text
stringlengths 2
100k
| meta
dict |
---|---|
map "http://hl7.org/fhir/StructureMap/ClinicalImpression3to2" = "R3 to R2 Conversion for ClinicalImpression"
conceptmap "ClinicalImpressionStatus" {
prefix s = "http://hl7.org/fhir/clinical-impression-status"
prefix t = "http://hl7.org/fhir/clinical-impression-status"
s:draft = t:"in-progress"
s:completed = t:completed
s:"entered-in-error" = t:"entered-in-error"
}
uses "http://hl7.org/fhir/StructureDefinition/ClinicalImpression" alias ClinicalImpression as source
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/ClinicalImpression" alias ClinicalImpressionR2 as target
imports "http://hl7.org/fhir/StructureMap/*3to2"
group for type+types ClinicalImpression extends DomainResource
input src : ClinicalImpression as source
input tgt : ClinicalImpressionR2 as target
"ClinicalImpression-subject" : for src.subject make tgt.patient
"ClinicalImpression-assessor" : for src.assessor make tgt.assessor
"ClinicalImpression-status" : for src.status as v make tgt.status = translate(v, "#ClinicalImpressionStatus", "code")
"ClinicalImpression-date" : for src.date make tgt.date
"ClinicalImpression-description" : for src.description make tgt.description
"ClinicalImpression-previous" : for src.previous make tgt.previous
"ClinicalImpression-problem" : for src.problem make tgt.problem
"ClinicalImpression-investigations" : for src.investigation as vs0 make tgt.investigations as vt0 then cimInvestigation(vs0, vt0)
"ClinicalImpression-protocol" : for src.protocol make tgt.protocol
"ClinicalImpression-summary" : for src.summary make tgt.summary
"ClinicalImpression-finding" : for src.finding as vs0 make tgt.finding as vt0 then cimFinding(vs0, vt0)
"ClinicalImpression-action" : for src.action make tgt.action
endgroup
group cimFinding extends BackboneElement
input src as source
input tgt as target
"ClinicalImpression.finding-item" : for src.item make tgt.item
"ClinicalImpression.finding-reason" : for src.basis make tgt.reason
endgroup
group cimInvestigation extends BackboneElement
input src as source
input tgt as target
"ClinicalImpression.finding-code" : for src.code make tgt.code
"ClinicalImpression.finding-item" : for src.item make tgt.item
endgroup
| {
"pile_set_name": "Github"
} |
using System;
namespace Template10.Models
{
public class TodoItem : Mvvm.BindableBase
{
private string _Key = default(string);
public string Key { get { return _Key; } set { Set(ref _Key, value); } }
private string _Title = default(string);
public string Title { get { return _Title; } set { Set(ref _Title, value); } }
private DateTime _DueDate = default(DateTime);
public DateTime DueDate { get { return _DueDate; } set { Set(ref _DueDate, value); } }
private bool _IsComplete = default(bool);
public bool IsComplete { get { return _IsComplete; } set { Set(ref _IsComplete, value); } }
private string _Details = default(string);
public string Details { get { return _Details; } set { Set(ref _Details, value); } }
private bool _IsFavorite = default(bool);
public bool IsFavorite { get { return _IsFavorite; } set { Set(ref _IsFavorite, value); } }
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2017 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 httpproxy_test
import (
"bytes"
"errors"
"fmt"
"net/url"
"os"
"strings"
"testing"
"golang.org/x/net/http/httpproxy"
)
// setHelper calls t.Helper() for Go 1.9+ (see go19_test.go) and does nothing otherwise.
var setHelper = func(t *testing.T) {}
type proxyForURLTest struct {
cfg httpproxy.Config
req string // URL to fetch; blank means "http://example.com"
want string
wanterr error
}
func (t proxyForURLTest) String() string {
var buf bytes.Buffer
space := func() {
if buf.Len() > 0 {
buf.WriteByte(' ')
}
}
if t.cfg.HTTPProxy != "" {
fmt.Fprintf(&buf, "http_proxy=%q", t.cfg.HTTPProxy)
}
if t.cfg.HTTPSProxy != "" {
space()
fmt.Fprintf(&buf, "https_proxy=%q", t.cfg.HTTPSProxy)
}
if t.cfg.NoProxy != "" {
space()
fmt.Fprintf(&buf, "no_proxy=%q", t.cfg.NoProxy)
}
req := "http://example.com"
if t.req != "" {
req = t.req
}
space()
fmt.Fprintf(&buf, "req=%q", req)
return strings.TrimSpace(buf.String())
}
var proxyForURLTests = []proxyForURLTest{{
cfg: httpproxy.Config{
HTTPProxy: "127.0.0.1:8080",
},
want: "http://127.0.0.1:8080",
}, {
cfg: httpproxy.Config{
HTTPProxy: "cache.corp.example.com:1234",
},
want: "http://cache.corp.example.com:1234",
}, {
cfg: httpproxy.Config{
HTTPProxy: "cache.corp.example.com",
},
want: "http://cache.corp.example.com",
}, {
cfg: httpproxy.Config{
HTTPProxy: "https://cache.corp.example.com",
},
want: "https://cache.corp.example.com",
}, {
cfg: httpproxy.Config{
HTTPProxy: "http://127.0.0.1:8080",
},
want: "http://127.0.0.1:8080",
}, {
cfg: httpproxy.Config{
HTTPProxy: "https://127.0.0.1:8080",
},
want: "https://127.0.0.1:8080",
}, {
cfg: httpproxy.Config{
HTTPProxy: "socks5://127.0.0.1",
},
want: "socks5://127.0.0.1",
}, {
// Don't use secure for http
cfg: httpproxy.Config{
HTTPProxy: "http.proxy.tld",
HTTPSProxy: "secure.proxy.tld",
},
req: "http://insecure.tld/",
want: "http://http.proxy.tld",
}, {
// Use secure for https.
cfg: httpproxy.Config{
HTTPProxy: "http.proxy.tld",
HTTPSProxy: "secure.proxy.tld",
},
req: "https://secure.tld/",
want: "http://secure.proxy.tld",
}, {
cfg: httpproxy.Config{
HTTPProxy: "http.proxy.tld",
HTTPSProxy: "https://secure.proxy.tld",
},
req: "https://secure.tld/",
want: "https://secure.proxy.tld",
}, {
// Issue 16405: don't use HTTP_PROXY in a CGI environment,
// where HTTP_PROXY can be attacker-controlled.
cfg: httpproxy.Config{
HTTPProxy: "http://10.1.2.3:8080",
CGI: true,
},
want: "<nil>",
wanterr: errors.New("refusing to use HTTP_PROXY value in CGI environment; see golang.org/s/cgihttpproxy"),
}, {
// HTTPS proxy is still used even in CGI environment.
// (perhaps dubious but it's the historical behaviour).
cfg: httpproxy.Config{
HTTPSProxy: "https://secure.proxy.tld",
CGI: true,
},
req: "https://secure.tld/",
want: "https://secure.proxy.tld",
}, {
want: "<nil>",
}, {
cfg: httpproxy.Config{
NoProxy: "example.com",
HTTPProxy: "proxy",
},
req: "http://example.com/",
want: "<nil>",
}, {
cfg: httpproxy.Config{
NoProxy: ".example.com",
HTTPProxy: "proxy",
},
req: "http://example.com/",
want: "http://proxy",
}, {
cfg: httpproxy.Config{
NoProxy: "ample.com",
HTTPProxy: "proxy",
},
req: "http://example.com/",
want: "http://proxy",
}, {
cfg: httpproxy.Config{
NoProxy: "example.com",
HTTPProxy: "proxy",
},
req: "http://foo.example.com/",
want: "<nil>",
}, {
cfg: httpproxy.Config{
NoProxy: ".foo.com",
HTTPProxy: "proxy",
},
req: "http://example.com/",
want: "http://proxy",
}}
func testProxyForURL(t *testing.T, tt proxyForURLTest) {
setHelper(t)
reqURLStr := tt.req
if reqURLStr == "" {
reqURLStr = "http://example.com"
}
reqURL, err := url.Parse(reqURLStr)
if err != nil {
t.Errorf("invalid URL %q", reqURLStr)
return
}
cfg := tt.cfg
proxyForURL := cfg.ProxyFunc()
url, err := proxyForURL(reqURL)
if g, e := fmt.Sprintf("%v", err), fmt.Sprintf("%v", tt.wanterr); g != e {
t.Errorf("%v: got error = %q, want %q", tt, g, e)
return
}
if got := fmt.Sprintf("%s", url); got != tt.want {
t.Errorf("%v: got URL = %q, want %q", tt, url, tt.want)
}
// Check that changing the Config doesn't change the results
// of the functuon.
cfg = httpproxy.Config{}
url, err = proxyForURL(reqURL)
if g, e := fmt.Sprintf("%v", err), fmt.Sprintf("%v", tt.wanterr); g != e {
t.Errorf("(after mutating config) %v: got error = %q, want %q", tt, g, e)
return
}
if got := fmt.Sprintf("%s", url); got != tt.want {
t.Errorf("(after mutating config) %v: got URL = %q, want %q", tt, url, tt.want)
}
}
func TestProxyForURL(t *testing.T) {
for _, tt := range proxyForURLTests {
testProxyForURL(t, tt)
}
}
func TestFromEnvironment(t *testing.T) {
os.Setenv("HTTP_PROXY", "httpproxy")
os.Setenv("HTTPS_PROXY", "httpsproxy")
os.Setenv("NO_PROXY", "noproxy")
os.Setenv("REQUEST_METHOD", "")
got := httpproxy.FromEnvironment()
want := httpproxy.Config{
HTTPProxy: "httpproxy",
HTTPSProxy: "httpsproxy",
NoProxy: "noproxy",
}
if *got != want {
t.Errorf("unexpected proxy config, got %#v want %#v", got, want)
}
}
func TestFromEnvironmentWithRequestMethod(t *testing.T) {
os.Setenv("HTTP_PROXY", "httpproxy")
os.Setenv("HTTPS_PROXY", "httpsproxy")
os.Setenv("NO_PROXY", "noproxy")
os.Setenv("REQUEST_METHOD", "PUT")
got := httpproxy.FromEnvironment()
want := httpproxy.Config{
HTTPProxy: "httpproxy",
HTTPSProxy: "httpsproxy",
NoProxy: "noproxy",
CGI: true,
}
if *got != want {
t.Errorf("unexpected proxy config, got %#v want %#v", got, want)
}
}
func TestFromEnvironmentLowerCase(t *testing.T) {
os.Setenv("http_proxy", "httpproxy")
os.Setenv("https_proxy", "httpsproxy")
os.Setenv("no_proxy", "noproxy")
os.Setenv("REQUEST_METHOD", "")
got := httpproxy.FromEnvironment()
want := httpproxy.Config{
HTTPProxy: "httpproxy",
HTTPSProxy: "httpsproxy",
NoProxy: "noproxy",
}
if *got != want {
t.Errorf("unexpected proxy config, got %#v want %#v", got, want)
}
}
var UseProxyTests = []struct {
host string
match bool
}{
// Never proxy localhost:
{"localhost", false},
{"127.0.0.1", false},
{"127.0.0.2", false},
{"[::1]", false},
{"[::2]", true}, // not a loopback address
{"192.168.1.1", false}, // matches exact IPv4
{"192.168.1.2", true}, // ports do not match
{"192.168.1.3", false}, // matches exact IPv4:port
{"192.168.1.4", true}, // no match
{"10.0.0.2", false}, // matches IPv4/CIDR
{"[2001:db8::52:0:1]", false}, // matches exact IPv6
{"[2001:db8::52:0:2]", true}, // no match
{"[2001:db8::52:0:3]", false}, // matches exact [IPv6]:port
{"[2002:db8:a::123]", false}, // matches IPv6/CIDR
{"[fe80::424b:c8be:1643:a1b6]", true}, // no match
{"barbaz.net", true}, // does not match as .barbaz.net
{"www.barbaz.net", false}, // does match as .barbaz.net
{"foobar.com", false}, // does match as foobar.com
{"www.foobar.com", false}, // match because NO_PROXY includes "foobar.com"
{"foofoobar.com", true}, // not match as a part of foobar.com
{"baz.com", true}, // not match as a part of barbaz.com
{"localhost.net", true}, // not match as suffix of address
{"local.localhost", true}, // not match as prefix as address
{"barbarbaz.net", true}, // not match, wrong domain
{"wildcard.io", true}, // does not match as *.wildcard.io
{"nested.wildcard.io", false}, // match as *.wildcard.io
{"awildcard.io", true}, // not a match because of '*'
}
var noProxy = "foobar.com, .barbaz.net, *.wildcard.io, 192.168.1.1, 192.168.1.2:81, 192.168.1.3:80, 10.0.0.0/30, 2001:db8::52:0:1, [2001:db8::52:0:2]:443, [2001:db8::52:0:3]:80, 2002:db8:a::45/64"
func TestUseProxy(t *testing.T) {
cfg := &httpproxy.Config{
NoProxy: noProxy,
}
for _, test := range UseProxyTests {
if httpproxy.ExportUseProxy(cfg, test.host+":80") != test.match {
t.Errorf("useProxy(%v) = %v, want %v", test.host, !test.match, test.match)
}
}
}
func TestInvalidNoProxy(t *testing.T) {
cfg := &httpproxy.Config{
NoProxy: ":1",
}
ok := httpproxy.ExportUseProxy(cfg, "example.com:80") // should not panic
if !ok {
t.Errorf("useProxy unexpected return; got false; want true")
}
}
func TestAllNoProxy(t *testing.T) {
cfg := &httpproxy.Config{
NoProxy: "*",
}
for _, test := range UseProxyTests {
if httpproxy.ExportUseProxy(cfg, test.host+":80") != false {
t.Errorf("useProxy(%v) = true, want false", test.host)
}
}
}
func BenchmarkProxyForURL(b *testing.B) {
cfg := &httpproxy.Config{
HTTPProxy: "http://proxy.example.org",
HTTPSProxy: "https://proxy.example.org",
NoProxy: noProxy,
}
for _, test := range UseProxyTests {
u, err := url.Parse("https://" + test.host + ":80")
if err != nil {
b.Fatalf("parsed failed: %s", test.host)
}
proxyFunc := cfg.ProxyFunc()
b.Run(test.host, func(b *testing.B) {
for n := 0; n < b.N; n++ {
if au, e := proxyFunc(u); e != nil && test.match == (au != nil) {
b.Errorf("useProxy(%v) = %v, want %v", test.host, !test.match, test.match)
}
}
})
}
}
| {
"pile_set_name": "Github"
} |
https-portal:
build: ../../..
ports:
- '80:80'
- '443:443'
environment:
FORCE_RENEW: $FORCE_RENEW
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
links:
- wordpress # to make sure wordpress starts first
wordpress:
image: wordpress
ports:
- '8080:80'
expose:
- '80'
- '81'
links:
- db:mysql
environment:
VIRTUAL_HOST: $TEST_DOMAIN
WORDPRESS_DB_HOST: mysql
WORDPRESS_DB_PASSWORD: asecretpassword
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: asecretpassword
| {
"pile_set_name": "Github"
} |
error[E0599]: no method named `fake` found for type `{integer}` in the current scope
--> $DIR/macro-backtrace-invalid-internals.rs:5:13
|
LL | 1.fake()
| ^^^^ method not found in `{integer}`
...
LL | fake_method_stmt!();
| -------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
--> $DIR/macro-backtrace-invalid-internals.rs:11:13
|
LL | 1.fake
| ^^^^
...
LL | fake_field_stmt!();
| ------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
--> $DIR/macro-backtrace-invalid-internals.rs:17:15
|
LL | (1).0
| ^
...
LL | fake_anon_field_stmt!();
| ------------------------ in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0689]: can't call method `neg` on ambiguous numeric type `{float}`
--> $DIR/macro-backtrace-invalid-internals.rs:41:15
|
LL | 2.0.neg()
| ^^^
...
LL | real_method_stmt!();
| -------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | 2.0_f32.neg()
| ^^^^^^^
error[E0599]: no method named `fake` found for type `{integer}` in the current scope
--> $DIR/macro-backtrace-invalid-internals.rs:23:13
|
LL | 1.fake()
| ^^^^ method not found in `{integer}`
...
LL | let _ = fake_method_expr!();
| ------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
--> $DIR/macro-backtrace-invalid-internals.rs:29:13
|
LL | 1.fake
| ^^^^
...
LL | let _ = fake_field_expr!();
| ------------------ in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
--> $DIR/macro-backtrace-invalid-internals.rs:35:15
|
LL | (1).0
| ^
...
LL | let _ = fake_anon_field_expr!();
| ----------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0689]: can't call method `neg` on ambiguous numeric type `{float}`
--> $DIR/macro-backtrace-invalid-internals.rs:47:15
|
LL | 2.0.neg()
| ^^^
...
LL | let _ = real_method_expr!();
| ------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | 2.0_f32.neg()
| ^^^^^^^
error: aborting due to 8 previous errors
Some errors have detailed explanations: E0599, E0610, E0689.
For more information about an error, try `rustc --explain E0599`.
| {
"pile_set_name": "Github"
} |
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../.symlinks/flutter/ios"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/path_provider" "${PODS_ROOT}/Headers/Public/shared_preferences" "${PODS_ROOT}/Headers/Public/sqflite" "${PODS_ROOT}/Headers/Public/url_launcher"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FMDB" "${PODS_CONFIGURATION_BUILD_DIR}/path_provider" "${PODS_CONFIGURATION_BUILD_DIR}/shared_preferences" "${PODS_CONFIGURATION_BUILD_DIR}/sqflite" "${PODS_CONFIGURATION_BUILD_DIR}/url_launcher"
OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/FMDB" -isystem "${PODS_ROOT}/Headers/Public/path_provider" -isystem "${PODS_ROOT}/Headers/Public/shared_preferences" -isystem "${PODS_ROOT}/Headers/Public/sqflite" -isystem "${PODS_ROOT}/Headers/Public/url_launcher"
OTHER_LDFLAGS = $(inherited) -ObjC -l"FMDB" -l"path_provider" -l"shared_preferences" -l"sqflite" -l"sqlite3" -l"url_launcher" -framework "Flutter"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
| {
"pile_set_name": "Github"
} |
/* vim:ts=4:sts=4:sw=4:
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
* Mihai Sucan <mihai DOT sucan AT gmail DOT com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
define(function(require, exports, module) {
"use strict";
var lang = require("./lib/lang");
var oop = require("./lib/oop");
var Range = require("./range").Range;
/**
* class Search
*
* A class designed to handle all sorts of text searches within a [[Document `Document`]].
*
**/
/**
* new Search()
*
* Creates a new `Search` object. The following search options are avaliable:
*
* * needle: string or regular expression
* * backwards: false
* * wrap: false
* * caseSensitive: false
* * wholeWord: false
* * range: Range or null for whole document
* * regExp: false
* * start: Range or position
* * skipCurrent: false
*
**/
var Search = function() {
this.$options = {};
};
(function() {
/**
* Search.set(options) -> Search
* - options (Object): An object containing all the new search properties
*
* Sets the search options via the `options` parameter.
*
**/
this.set = function(options) {
oop.mixin(this.$options, options);
return this;
};
/**
* Search.getOptions() -> Object
*
* [Returns an object containing all the search options.]{: #Search.getOptions}
*
**/
this.getOptions = function() {
return lang.copyObject(this.$options);
};
this.setOptions = function(options) {
this.$options = options;
};
/**
* Search.find(session) -> Range
* - session (EditSession): The session to search with
*
* Searches for `options.needle`. If found, this method returns the [[Range `Range`]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session.
*
**/
this.find = function(session) {
var iterator = this.$matchIterator(session, this.$options);
if (!iterator)
return false;
var firstRange = null;
iterator.forEach(function(range, row, offset) {
if (!range.start) {
var column = range.offset + (offset || 0);
firstRange = new Range(row, column, row, column+range.length);
} else
firstRange = range;
return true;
});
return firstRange;
};
/**
* Search.findAll(session) -> [Range]
* - session (EditSession): The session to search with
*
* Searches for all occurances `options.needle`. If found, this method returns an array of [[Range `Range`s]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session.
*
**/
this.findAll = function(session) {
var options = this.$options;
if (!options.needle)
return [];
this.$assembleRegExp(options);
var range = options.range;
var lines = range
? session.getLines(range.start.row, range.end.row)
: session.doc.getAllLines();
var ranges = [];
var re = options.re;
if (options.$isMultiLine) {
var len = re.length;
var maxRow = lines.length - len;
for (var row = re.offset || 0; row <= maxRow; row++) {
for (var j = 0; j < len; j++)
if (lines[row + j].search(re[j]) == -1)
break;
var startLine = lines[row];
var line = lines[row + len - 1];
var startIndex = startLine.match(re[0])[0].length;
var endIndex = line.match(re[len - 1])[0].length;
ranges.push(new Range(
row, startLine.length - startIndex,
row + len - 1, endIndex
));
}
} else {
for (var i = 0; i < lines.length; i++) {
var matches = lang.getMatchOffsets(lines[i], re);
for (var j = 0; j < matches.length; j++) {
var match = matches[j];
ranges.push(new Range(i, match.offset, i, match.offset + match.length));
}
}
}
if (range) {
var startColumn = range.start.column;
var endColumn = range.start.column;
var i = 0, j = ranges.length - 1;
while (i < j && ranges[i].start.column < startColumn && ranges[i].start.row == range.start.row)
i++;
while (i < j && ranges[j].end.column > endColumn && ranges[j].end.row == range.end.row)
j--;
return ranges.slice(i, j + 1);
}
return ranges;
};
/**
* Search.replace(input, replacement) -> String
* - input (String): The text to search in
* - replacement (String): The replacing text
* + (String): If `options.regExp` is `true`, this function returns `input` with the replacement already made. Otherwise, this function just returns `replacement`.<br/>
* If `options.needle` was not found, this function returns `null`.
*
* Searches for `options.needle` in `input`, and, if found, replaces it with `replacement`.
*
**/
this.replace = function(input, replacement) {
var options = this.$options;
var re = this.$assembleRegExp(options);
if (options.$isMultiLine)
return replacement;
if (!re)
return;
var match = re.exec(input);
if (!match || match[0].length != input.length)
return null;
replacement = input.replace(re, replacement);
if (options.preserveCase) {
replacement = replacement.split("");
for (var i = Math.min(input.length, input.length); i--; ) {
var ch = input[i];
if (ch && ch.toLowerCase() != ch)
replacement[i] = replacement[i].toUpperCase();
else
replacement[i] = replacement[i].toLowerCase();
}
replacement = replacement.join("");
}
return replacement;
};
/** internal, hide
* Search.$matchIterator(session) -> String | Boolean
* - session (EditSession): The session to search with
*
**/
this.$matchIterator = function(session, options) {
var re = this.$assembleRegExp(options);
if (!re)
return false;
var self = this, callback, backwards = options.backwards;
if (options.$isMultiLine) {
var len = re.length;
var matchIterator = function(line, row, offset) {
var startIndex = line.search(re[0]);
if (startIndex == -1)
return;
for (var i = 1; i < len; i++) {
line = session.getLine(row + i);
if (line.search(re[i]) == -1)
return;
}
var endIndex = line.match(re[len - 1])[0].length;
var range = new Range(row, startIndex, row + len - 1, endIndex);
if (re.offset == 1) {
range.start.row--;
range.start.column = Number.MAX_VALUE;
} else if (offset)
range.start.column += offset;
if (callback(range))
return true;
};
} else if (backwards) {
var matchIterator = function(line, row, startIndex) {
var matches = lang.getMatchOffsets(line, re);
for (var i = matches.length-1; i >= 0; i--)
if (callback(matches[i], row, startIndex))
return true;
};
} else {
var matchIterator = function(line, row, startIndex) {
var matches = lang.getMatchOffsets(line, re);
for (var i = 0; i < matches.length; i++)
if (callback(matches[i], row, startIndex))
return true;
};
}
return {
forEach: function(_callback) {
callback = _callback;
self.$lineIterator(session, options).forEach(matchIterator);
}
};
};
this.$assembleRegExp = function(options) {
if (options.needle instanceof RegExp)
return options.re = options.needle;
var needle = options.needle;
if (!options.needle)
return options.re = false;
if (!options.regExp)
needle = lang.escapeRegExp(needle);
if (options.wholeWord)
needle = "\\b" + needle + "\\b";
var modifier = options.caseSensitive ? "g" : "gi";
options.$isMultiLine = /[\n\r]/.test(needle);
if (options.$isMultiLine)
return options.re = this.$assembleMultilineRegExp(needle, modifier);
try {
var re = new RegExp(needle, modifier);
} catch(e) {
re = false;
}
return options.re = re;
};
this.$assembleMultilineRegExp = function(needle, modifier) {
var parts = needle.replace(/\r\n|\r|\n/g, "$\n^").split("\n");
var re = [];
for (var i = 0; i < parts.length; i++) try {
re.push(new RegExp(parts[i], modifier));
} catch(e) {
return false;
}
if (parts[0] == "") {
re.shift();
re.offset = 1;
} else {
re.offset = 0;
}
return re;
};
this.$lineIterator = function(session, options) {
var backwards = options.backwards == true;
var skipCurrent = options.skipCurrent != false;
var range = options.range;
var start = options.start;
if (!start)
start = range ? range[backwards ? "end" : "start"] : session.selection.getRange();
if (start.start)
start = start[skipCurrent != backwards ? "end" : "start"];
var firstRow = range ? range.start.row : 0;
var lastRow = range ? range.end.row : session.getLength() - 1;
var forEach = backwards ? function(callback) {
var row = start.row;
var line = session.getLine(row).substring(0, start.column);
if (callback(line, row))
return;
for (row--; row >= firstRow; row--)
if (callback(session.getLine(row), row))
return;
if (options.wrap == false)
return;
for (row = lastRow, firstRow = start.row; row >= firstRow; row--)
if (callback(session.getLine(row), row))
return;
} : function(callback) {
var row = start.row;
var line = session.getLine(row).substr(start.column);
if (callback(line, row, start.column))
return;
for (row = row+1; row <= lastRow; row++)
if (callback(session.getLine(row), row))
return;
if (options.wrap == false)
return;
for (row = firstRow, lastRow = start.row; row <= lastRow; row++)
if (callback(session.getLine(row), row))
return;
};
return {forEach: forEach};
};
}).call(Search.prototype);
exports.Search = Search;
});
| {
"pile_set_name": "Github"
} |
<?php
/**
* 控制过滤器, 集成了RBAC菜单权限验证
* @author 边走边乔 <771405950>
*/
namespace backend\components;
use Yii;
use yii\web\User;
use yii\di\Instance;
use yii\web\ForbiddenHttpException;
//class AccessControl extends \yii\base\ActionFilter {
class AccessControl extends \yii\filters\AccessControl {
/**
* This method is invoked right before an action is to be executed (after all possible filters.)
* You may override this method to do last-minute preparation for the action.
* @param Action $action the action to be executed.
* @return boolean whether the action should continue to be executed.
*/
public function beforeAction($action)
{
$user = $this->user;
//-----菜单权限检查-----
$actionId = $action->getUniqueId();
foreach ($this->rules as $i => $rule) {
if(in_array($action->id, $rule->actions)) break;
/*if(Yii::$app->user->identity->username == 'admin') {
$this->rules[] = Yii::createObject(array_merge($this->ruleConfig, [
'actions' => [$action->id],
'allow' => true,
]));
} else*/if (!Yii::$app->user->can($actionId)) {
$this->rules[] = Yii::createObject(array_merge($this->ruleConfig, [
'actions' => [$action->id],
'allow' => false,
]));
} else {
$this->rules[] = Yii::createObject(array_merge($this->ruleConfig, [
'actions' => [$action->id],
'allow' => true,
]));
}
}
//----------
$request = Yii::$app->getRequest();
/* @var $rule AccessRule */
foreach ($this->rules as $rule) {
if ($allow = $rule->allows($action, $user, $request)) {
return true;
} elseif ($allow === false) {
if (isset($rule->denyCallback)) {
call_user_func($rule->denyCallback, $rule, $action);
} elseif ($this->denyCallback !== null) {
call_user_func($this->denyCallback, $rule, $action);
} else {
$this->denyAccess($user);
}
return false;
}
}
if ($this->denyCallback !== null) {
call_user_func($this->denyCallback, null, $action);
} else {
$this->denyAccess($user);
}
return false;
}
} | {
"pile_set_name": "Github"
} |
'''
@author prateek3255
@date 05/01/2018
'''
def rabinKarp(string,pattern,q=153):
n=len(string)
m=len(pattern)
d=256
h=d**(m-1)%q
p=0
t=0
for i in range(0,m):
p=(d*p+ord(pattern[i]))%q
t=(d*t+ord(string[i]))%q
for i in range(n-m+1):
if p==t and string[i:i+m]==pattern:
return i
if i<(n-m):
t= (d*(t-ord(string[i])*h)+ord(string[i+m]))%q
if t<0:
t+=q
return -1
print(rabinKarp("helloworld","hello"))
print(rabinKarp("helloworld","hop"))
print(rabinKarp("ABABDABACDABABCABAB","ABABCABAB"))
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2010-2011 Espressif System
*
*/
#ifndef _WLAN_LWIP_IF_H_
#define _WLAN_LWIP_IF_H_
#define LWIP_IF0_PRIO 28
#define LWIP_IF1_PRIO 29
enum {
SIG_LWIP_RX = 0,
};
struct netif * eagle_lwip_if_alloc(struct ieee80211_conn *conn, const uint8 *macaddr, struct ip_info *info);
struct netif * eagle_lwip_getif(uint8 index);
#ifndef IOT_SIP_MODE
sint8 ieee80211_output_pbuf(struct netif *ifp, struct pbuf* pb);
#else
sint8 ieee80211_output_pbuf(struct ieee80211_conn *conn, esf_buf *eb);
#endif
#endif /* _WLAN_LWIP_IF_H_ */
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2020 Proton Technologies AG
//
// This file is part of ProtonMail Bridge.
//
// ProtonMail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ProtonMail Bridge 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 ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
// This is main qml file
import QtQuick 2.8
import BridgeUI 1.0
import ProtonUI 1.0
// All imports from dynamic must be loaded before
import QtQuick.Window 2.2
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.3
Item {
id: gui
property MainWindow winMain
property bool isFirstWindow: true
property int warningFlags: 0
InfoWindow { id: infoWin }
OutgoingNoEncPopup { id: outgoingNoEncPopup }
BugReportWindow {
id: bugreportWin
clientVersion.visible : true
// pre-fill the form
onPrefill : {
userAddress.text=""
if (accountsModel.count>0) {
var addressList = accountsModel.get(0).aliases.split(";")
if (addressList.length>0) {
userAddress.text = addressList[0]
}
}
clientVersion.text=go.getLastMailClient()
}
}
onWarningFlagsChanged : {
if (gui.warningFlags==Style.okInfoBar) {
go.normalSystray()
} else {
if ((gui.warningFlags & Style.errorInfoBar) == Style.errorInfoBar) {
go.errorSystray()
} else {
go.highlightSystray()
}
}
}
// Signals from Go
Connections {
target: go
onShowWindow : {
gui.openMainWindow()
}
onShowHelp : {
gui.openMainWindow(false)
winMain.tabbar.currentIndex = 2
winMain.showAndRise()
}
onShowQuit : {
gui.openMainWindow(false)
winMain.dialogGlobal.state="quit"
winMain.dialogGlobal.show()
winMain.showAndRise()
}
onProcessFinished : {
winMain.dialogGlobal.hide()
winMain.dialogAddUser.hide()
winMain.dialogChangePort.hide()
infoWin.hide()
}
onOpenManual : Qt.openUrlExternally("http://protonmail.com/bridge")
onNotifyBubble : {
gui.showBubble(tabIndex, message, true)
}
onSilentBubble : {
gui.showBubble(tabIndex, message, false)
}
onBubbleClosed : {
gui.warningFlags &= ~Style.warnBubbleMessage
}
onSetConnectionStatus: {
go.isConnectionOK = isAvailable
gui.openMainWindow(false)
if (go.isConnectionOK) {
if( winMain.updateState=="noInternet") {
go.setUpdateState("upToDate")
}
} else {
go.setUpdateState("noInternet")
}
}
onRunCheckVersion : {
gui.openMainWindow(false)
go.setUpdateState("upToDate")
winMain.dialogGlobal.state="checkUpdates"
winMain.dialogGlobal.show()
go.isNewVersionAvailable(showMessage)
}
onSetUpdateState : {
// once app is outdated prevent from state change
if (winMain.updateState != "forceUpdate") {
winMain.updateState = updateState
}
}
onSetAddAccountWarning : winMain.dialogAddUser.setWarning(message, 0)
onNotifyVersionIsTheLatest : {
go.silentBubble(2,qsTr("You have the latest version!", "notification", -1))
}
onNotifyUpdate : {
go.setUpdateState("forceUpdate")
if (!winMain.dialogUpdate.visible) {
gui.openMainWindow(true)
go.runCheckVersion(false)
winMain.dialogUpdate.show()
}
}
onNotifyLogout : {
go.notifyBubble(0, qsTr("Account %1 has been disconnected. Please log in to continue to use the Bridge with this account.").arg(accname) )
}
onNotifyAddressChanged : {
go.notifyBubble(0, qsTr("The address list has been changed for account %1. You may need to reconfigure the settings in your email client.").arg(accname) )
}
onNotifyAddressChangedLogout : {
go.notifyBubble(0, qsTr("The address list has been changed for account %1. You have to reconfigure the settings in your email client.").arg(accname) )
}
onNotifyPortIssue : { // busyPortIMAP , busyPortSMTP
if (!busyPortIMAP && !busyPortSMTP) { // at least one must have issues to show warning
return
}
gui.openMainWindow(false)
winMain.tabbar.currentIndex=1
go.isDefaultPort = false
var text
if (busyPortIMAP && busyPortSMTP) { // both have problems
text = qsTr("The default ports used by Bridge for IMAP (%1) and SMTP (%2) are occupied by one or more other applications." , "the first part of notification text (two ports)").arg(go.getIMAPPort()).arg(go.getSMTPPort())
text += " "
text += qsTr("To change the ports for these servers, go to Settings -> Advanced Settings.", "the second part of notification text (two ports)")
} else { // only one is occupied
var server, port
if (busyPortSMTP) {
server = "SMTP"
port = go.getSMTPPort()
} else {
server = "IMAP"
port = go.getIMAPPort()
}
text = qsTr("The default port used by Bridge for %1 (%2) is occupied by another application.", "the first part of notification text (one port)").arg(server).arg(port)
text += " "
text += qsTr("To change the port for this server, go to Settings -> Advanced Settings.", "the second part of notification text (one port)")
}
go.notifyBubble(1, text )
}
onNotifyKeychainRebuild : {
go.notifyBubble(1, qsTr(
"Your MacOS keychain is probably corrupted. Please consult the instructions in our <a href=\"https://protonmail.com/bridge/faq#c15\">FAQ</a>.",
"notification message"
))
}
onNotifyHasNoKeychain : {
gui.winMain.dialogGlobal.state="noKeychain"
gui.winMain.dialogGlobal.show()
}
onShowNoActiveKeyForRecipient : {
go.notifyBubble(0, qsTr(
"Key pinning is enabled for %1 but no active key is pinned. " +
"You must pin the key in order to send a message to this address. " +
"You can find instructions " +
"<a href=\"https://protonmail.com/support/knowledge-base/key-pinning/\">here</a>."
).arg(recipient))
}
onFailedAutostartCode : {
gui.openMainWindow(true)
switch (code) {
case "permission" : // linux+darwin
case "85070005" : // windows
go.notifyBubble(1, go.failedAutostartPerm)
break
case "81004003" : // windows
go.notifyBubble(1, go.failedAutostart+" "+qsTr("Can not create instance.", "for autostart"))
break
case "" :
default :
go.notifyBubble(1, go.failedAutostart)
}
}
onShowOutgoingNoEncPopup : {
outgoingNoEncPopup.show(messageID, subject)
}
onSetOutgoingNoEncPopupCoord : {
outgoingNoEncPopup.x = x
outgoingNoEncPopup.y = y
}
onUpdateFinished : {
winMain.dialogUpdate.finished(hasError)
}
onShowCertIssue : {
winMain.tlsBarState="notOK"
}
onShowIMAPCertTroubleshoot : {
go.notifyBubble(1, qsTr(
"Bridge was unable to establish a connection with your Email client. <br> <a href=\"https://protonmail.com/support/knowledge-base/bridge-ssl-connection-issue\">Learn more</a> <br>",
"notification message"
))
}
}
Timer {
id: checkVersionTimer
repeat : true
triggeredOnStart: false
interval : Style.main.verCheckRepeatTime
onTriggered : go.runCheckVersion(false)
}
function openMainWindow(showAndRise) {
// wait and check until font is loaded
while(true){
if (Style.fontawesome.status == FontLoader.Loading) continue
if (Style.fontawesome.status != FontLoader.Ready) console.log("Error while loading font")
break
}
if (typeof(showAndRise)==='undefined') {
showAndRise = true
}
if (gui.winMain == null) {
gui.winMain = Qt.createQmlObject(
'import BridgeUI 1.0; MainWindow {visible : false}',
gui, "winMain"
)
}
if (showAndRise) {
gui.winMain.showAndRise()
}
}
function closeMainWindow () {
gui.winMain.hide()
gui.winMain.destroy(5000)
gui.winMain = null
gui.isFirstWindow = false
}
function showBubble(tabIndex, message, isWarning) {
gui.openMainWindow(true)
if (isWarning) {
gui.warningFlags |= Style.warnBubbleMessage
}
winMain.bubbleNote.text = message
winMain.bubbleNote.place(tabIndex)
winMain.bubbleNote.show()
}
// On start
Component.onCompleted : {
// set messages for translations
go.wrongCredentials = qsTr("Incorrect username or password." , "notification", -1)
go.wrongMailboxPassword = qsTr("Incorrect mailbox password." , "notification", -1)
go.canNotReachAPI = qsTr("Cannot contact server, please check your internet connection." , "notification", -1)
go.versionCheckFailed = qsTr("Version check was unsuccessful. Please try again later." , "notification", -1)
go.credentialsNotRemoved = qsTr("Credentials could not be removed." , "notification", -1)
go.failedAutostartPerm = qsTr("Unable to configure automatic start due to permissions settings - see <a href=\"https://protonmail.com/bridge/faq#c11\">FAQ</a> for details.", "notification", -1)
go.failedAutostart = qsTr("Unable to configure automatic start." , "notification", -1)
go.genericErrSeeLogs = qsTr("An error happened during procedure. See logs for more details." , "notification", -1)
// start window
gui.openMainWindow(false)
checkVersionTimer.start()
if (go.isShownOnStart) {
gui.winMain.showAndRise()
}
go.runCheckVersion(false)
if (go.isFreshVersion) {
go.getLocalVersionInfo()
gui.winMain.dialogVersionInfo.show()
}
}
}
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: ce4d5cda474b9a14385be6aca998e173
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 0e9f368be4b1b2a40aafee51ede3f09a
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
package me.ccrama.redditslide.Visuals;
import android.content.Context;
import android.graphics.Color;
import androidx.core.content.ContextCompat;
import java.util.Map;
import java.util.TreeMap;
import me.ccrama.redditslide.R;
/**
* Created by carlo_000 on 2/8/2016.
*/
public class GetClosestColor {
public static int distance(int a, int b) {
return Math.abs(Color.red(a) - Color.red(b)) + Math.abs(Color.green(a) - Color.green(b)) + Math.abs(Color.blue(a) - Color.blue(b));
}
public static int getClosestColor(String hex, Context context) {
int[] allColors = new int[]{
ContextCompat.getColor(context, R.color.md_red_200),
ContextCompat.getColor(context, R.color.md_red_300),
ContextCompat.getColor(context, R.color.md_red_400),
ContextCompat.getColor(context, R.color.md_red_500),
ContextCompat.getColor(context, R.color.md_red_600),
ContextCompat.getColor(context, R.color.md_red_700),
ContextCompat.getColor(context, R.color.md_red_800),
ContextCompat.getColor(context, R.color.md_red_900),
ContextCompat.getColor(context, R.color.md_pink_200),
ContextCompat.getColor(context, R.color.md_pink_300),
ContextCompat.getColor(context, R.color.md_pink_400),
ContextCompat.getColor(context, R.color.md_pink_500),
ContextCompat.getColor(context, R.color.md_pink_600),
ContextCompat.getColor(context, R.color.md_pink_700),
ContextCompat.getColor(context, R.color.md_pink_800),
ContextCompat.getColor(context, R.color.md_pink_900),
ContextCompat.getColor(context, R.color.md_purple_200),
ContextCompat.getColor(context, R.color.md_purple_300),
ContextCompat.getColor(context, R.color.md_purple_400),
ContextCompat.getColor(context, R.color.md_purple_500),
ContextCompat.getColor(context, R.color.md_purple_600),
ContextCompat.getColor(context, R.color.md_purple_700),
ContextCompat.getColor(context, R.color.md_purple_800),
ContextCompat.getColor(context, R.color.md_purple_900),
ContextCompat.getColor(context, R.color.md_deep_purple_200),
ContextCompat.getColor(context, R.color.md_deep_purple_300),
ContextCompat.getColor(context, R.color.md_deep_purple_400),
ContextCompat.getColor(context, R.color.md_deep_purple_500),
ContextCompat.getColor(context, R.color.md_deep_purple_600),
ContextCompat.getColor(context, R.color.md_deep_purple_700),
ContextCompat.getColor(context, R.color.md_deep_purple_800),
ContextCompat.getColor(context, R.color.md_deep_purple_900),
ContextCompat.getColor(context, R.color.md_indigo_200),
ContextCompat.getColor(context, R.color.md_indigo_300),
ContextCompat.getColor(context, R.color.md_indigo_400),
ContextCompat.getColor(context, R.color.md_indigo_500),
ContextCompat.getColor(context, R.color.md_indigo_600),
ContextCompat.getColor(context, R.color.md_indigo_700),
ContextCompat.getColor(context, R.color.md_indigo_800),
ContextCompat.getColor(context, R.color.md_indigo_900),
ContextCompat.getColor(context, R.color.md_blue_200),
ContextCompat.getColor(context, R.color.md_blue_300),
ContextCompat.getColor(context, R.color.md_blue_400),
ContextCompat.getColor(context, R.color.md_blue_500),
ContextCompat.getColor(context, R.color.md_blue_600),
ContextCompat.getColor(context, R.color.md_blue_700),
ContextCompat.getColor(context, R.color.md_blue_800),
ContextCompat.getColor(context, R.color.md_blue_900),
ContextCompat.getColor(context, R.color.md_light_blue_200),
ContextCompat.getColor(context, R.color.md_light_blue_300),
ContextCompat.getColor(context, R.color.md_light_blue_400),
ContextCompat.getColor(context, R.color.md_light_blue_500),
ContextCompat.getColor(context, R.color.md_light_blue_600),
ContextCompat.getColor(context, R.color.md_light_blue_700),
ContextCompat.getColor(context, R.color.md_light_blue_800),
ContextCompat.getColor(context, R.color.md_light_blue_900),
ContextCompat.getColor(context, R.color.md_cyan_200),
ContextCompat.getColor(context, R.color.md_cyan_300),
ContextCompat.getColor(context, R.color.md_cyan_400),
ContextCompat.getColor(context, R.color.md_cyan_500),
ContextCompat.getColor(context, R.color.md_cyan_600),
ContextCompat.getColor(context, R.color.md_cyan_700),
ContextCompat.getColor(context, R.color.md_cyan_800),
ContextCompat.getColor(context, R.color.md_cyan_900),
ContextCompat.getColor(context, R.color.md_teal_200),
ContextCompat.getColor(context, R.color.md_teal_300),
ContextCompat.getColor(context, R.color.md_teal_400),
ContextCompat.getColor(context, R.color.md_teal_500),
ContextCompat.getColor(context, R.color.md_teal_600),
ContextCompat.getColor(context, R.color.md_teal_700),
ContextCompat.getColor(context, R.color.md_teal_800),
ContextCompat.getColor(context, R.color.md_teal_900),
ContextCompat.getColor(context, R.color.md_green_200),
ContextCompat.getColor(context, R.color.md_green_300),
ContextCompat.getColor(context, R.color.md_green_400),
ContextCompat.getColor(context, R.color.md_green_500),
ContextCompat.getColor(context, R.color.md_green_600),
ContextCompat.getColor(context, R.color.md_green_700),
ContextCompat.getColor(context, R.color.md_green_800),
ContextCompat.getColor(context, R.color.md_green_900),
ContextCompat.getColor(context, R.color.md_light_green_200),
ContextCompat.getColor(context, R.color.md_light_green_300),
ContextCompat.getColor(context, R.color.md_light_green_400),
ContextCompat.getColor(context, R.color.md_light_green_500),
ContextCompat.getColor(context, R.color.md_light_green_600),
ContextCompat.getColor(context, R.color.md_light_green_700),
ContextCompat.getColor(context, R.color.md_light_green_800),
ContextCompat.getColor(context, R.color.md_light_green_900),
ContextCompat.getColor(context, R.color.md_lime_200),
ContextCompat.getColor(context, R.color.md_lime_300),
ContextCompat.getColor(context, R.color.md_lime_400),
ContextCompat.getColor(context, R.color.md_lime_500),
ContextCompat.getColor(context, R.color.md_lime_600),
ContextCompat.getColor(context, R.color.md_lime_700),
ContextCompat.getColor(context, R.color.md_lime_800),
ContextCompat.getColor(context, R.color.md_lime_900),
ContextCompat.getColor(context, R.color.md_yellow_400),
ContextCompat.getColor(context, R.color.md_yellow_500),
ContextCompat.getColor(context, R.color.md_yellow_600),
ContextCompat.getColor(context, R.color.md_yellow_700),
ContextCompat.getColor(context, R.color.md_yellow_800),
ContextCompat.getColor(context, R.color.md_yellow_900),
ContextCompat.getColor(context, R.color.md_amber_200),
ContextCompat.getColor(context, R.color.md_amber_300),
ContextCompat.getColor(context, R.color.md_amber_400),
ContextCompat.getColor(context, R.color.md_amber_500),
ContextCompat.getColor(context, R.color.md_amber_600),
ContextCompat.getColor(context, R.color.md_amber_700),
ContextCompat.getColor(context, R.color.md_amber_800),
ContextCompat.getColor(context, R.color.md_amber_900),
ContextCompat.getColor(context, R.color.md_orange_200),
ContextCompat.getColor(context, R.color.md_orange_300),
ContextCompat.getColor(context, R.color.md_orange_400),
ContextCompat.getColor(context, R.color.md_orange_500),
ContextCompat.getColor(context, R.color.md_orange_600),
ContextCompat.getColor(context, R.color.md_orange_700),
ContextCompat.getColor(context, R.color.md_orange_800),
ContextCompat.getColor(context, R.color.md_orange_900),
ContextCompat.getColor(context, R.color.md_deep_orange_200),
ContextCompat.getColor(context, R.color.md_deep_orange_300),
ContextCompat.getColor(context, R.color.md_deep_orange_400),
ContextCompat.getColor(context, R.color.md_deep_orange_500),
ContextCompat.getColor(context, R.color.md_deep_orange_600),
ContextCompat.getColor(context, R.color.md_deep_orange_700),
ContextCompat.getColor(context, R.color.md_deep_orange_800),
ContextCompat.getColor(context, R.color.md_deep_orange_900),
ContextCompat.getColor(context, R.color.md_brown_200),
ContextCompat.getColor(context, R.color.md_brown_300),
ContextCompat.getColor(context, R.color.md_brown_400),
ContextCompat.getColor(context, R.color.md_brown_500),
ContextCompat.getColor(context, R.color.md_brown_600),
ContextCompat.getColor(context, R.color.md_brown_700),
ContextCompat.getColor(context, R.color.md_brown_800),
ContextCompat.getColor(context, R.color.md_brown_900),
ContextCompat.getColor(context, R.color.md_grey_400),
ContextCompat.getColor(context, R.color.md_grey_500),
ContextCompat.getColor(context, R.color.md_grey_600),
ContextCompat.getColor(context, R.color.md_grey_700),
ContextCompat.getColor(context, R.color.md_grey_800),
ContextCompat.getColor(context, R.color.md_grey_900),
Color.parseColor("#000000"),
ContextCompat.getColor(context, R.color.md_blue_grey_300),
ContextCompat.getColor(context, R.color.md_blue_grey_400),
ContextCompat.getColor(context, R.color.md_blue_grey_500),
ContextCompat.getColor(context, R.color.md_blue_grey_600),
ContextCompat.getColor(context, R.color.md_blue_grey_700),
ContextCompat.getColor(context, R.color.md_blue_grey_800)};
Map<Integer, Integer> colors = new TreeMap<>();
int base = Color.parseColor(hex);
for (int i : allColors) {
colors.put(distance(base, i), i);
}
return colors.get(colors.keySet().toArray()[0]);
}
} | {
"pile_set_name": "Github"
} |
#include<stdio.h>
#include<assert.h>
int main()
{
int rd, rs, rt;
int result;
rs = 0x00000010;
rt = 0x00000001;
result = 0x00000008;
__asm
("addqh.w %0, %1, %2\n\t"
: "=r"(rd)
: "r"(rs), "r"(rt)
);
assert(rd == result);
rs = 0xFFFFFFFE;
rt = 0x00000001;
result = 0xFFFFFFFF;
__asm
("addqh.w %0, %1, %2\n\t"
: "=r"(rd)
: "r"(rs), "r"(rt)
);
assert(rd == result);
return 0;
}
| {
"pile_set_name": "Github"
} |
package com.pediy.bbs.kanxue.util;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class SimpleHASH {
private static String convertToHex(byte[] data) {
StringBuilder buf = new StringBuilder();
for (byte b : data) {
int halfbyte = (b >>> 4) & 0x0F;
int two_halfs = 0;
do {
buf.append((0 <= halfbyte) && (halfbyte <= 9) ? (char) ('0' + halfbyte) : (char) ('a' + (halfbyte - 10)));
halfbyte = b & 0x0F;
} while (two_halfs++ < 1);
}
return buf.toString();
}
public static String sha1(String text) {
return convertToHex(hash("SHA-1", text));
}
public static String md5(String text) {
return convertToHex(hash("MD5", text));
}
private static byte[] hash(String hashType, String input) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance(hashType);
if (md == null)
return null;
md.update(input.getBytes("iso-8859-1"), 0, input.length());
} catch (NoSuchAlgorithmException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
return null;
} catch (UnsupportedEncodingException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
return null;
}
return md.digest();
}
}
| {
"pile_set_name": "Github"
} |
export interface ISPDataService {
GetWebProperties(webUrl: string, selectFields: string[]): Promise<any>;
}
| {
"pile_set_name": "Github"
} |
#include "pe_exception.h"
namespace pe_bliss
{
//PE exception class constructors
pe_exception::pe_exception(const char* text, exception_id id)
:std::runtime_error(text), id_(id)
{}
pe_exception::pe_exception(const std::string& text, exception_id id)
:std::runtime_error(text), id_(id)
{}
//Returns exception ID
pe_exception::exception_id pe_exception::get_id() const
{
return id_;
}
}
| {
"pile_set_name": "Github"
} |
// Code generated by protoc-gen-go.
// source: ipv6_rib_edm_proto.proto
// DO NOT EDIT!
/*
Package cisco_ios_xr_ip_rib_ipv6_oper_ipv6_rib_vrfs_vrf_afs_af_safs_saf_ip_rib_route_table_names_ip_rib_route_table_name_protocol_local_lspv_information is a generated protocol buffer package.
It is generated from these files:
ipv6_rib_edm_proto.proto
It has these top-level messages:
Ipv6RibEdmProto_KEYS
Ipv6RibEdmProto
*/
package cisco_ios_xr_ip_rib_ipv6_oper_ipv6_rib_vrfs_vrf_afs_af_safs_saf_ip_rib_route_table_names_ip_rib_route_table_name_protocol_local_lspv_information
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// Information of a rib protocol
type Ipv6RibEdmProto_KEYS struct {
VrfName string `protobuf:"bytes,1,opt,name=vrf_name,json=vrfName" json:"vrf_name,omitempty"`
AfName string `protobuf:"bytes,2,opt,name=af_name,json=afName" json:"af_name,omitempty"`
SafName string `protobuf:"bytes,3,opt,name=saf_name,json=safName" json:"saf_name,omitempty"`
RouteTableName string `protobuf:"bytes,4,opt,name=route_table_name,json=routeTableName" json:"route_table_name,omitempty"`
}
func (m *Ipv6RibEdmProto_KEYS) Reset() { *m = Ipv6RibEdmProto_KEYS{} }
func (m *Ipv6RibEdmProto_KEYS) String() string { return proto.CompactTextString(m) }
func (*Ipv6RibEdmProto_KEYS) ProtoMessage() {}
func (*Ipv6RibEdmProto_KEYS) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *Ipv6RibEdmProto_KEYS) GetVrfName() string {
if m != nil {
return m.VrfName
}
return ""
}
func (m *Ipv6RibEdmProto_KEYS) GetAfName() string {
if m != nil {
return m.AfName
}
return ""
}
func (m *Ipv6RibEdmProto_KEYS) GetSafName() string {
if m != nil {
return m.SafName
}
return ""
}
func (m *Ipv6RibEdmProto_KEYS) GetRouteTableName() string {
if m != nil {
return m.RouteTableName
}
return ""
}
type Ipv6RibEdmProto struct {
// Name
ProtocolNames string `protobuf:"bytes,50,opt,name=protocol_names,json=protocolNames" json:"protocol_names,omitempty"`
// Instance
Instance string `protobuf:"bytes,51,opt,name=instance" json:"instance,omitempty"`
// Proto version
Version uint32 `protobuf:"varint,52,opt,name=version" json:"version,omitempty"`
// Number of redist clients
RedistributionClientCount uint32 `protobuf:"varint,53,opt,name=redistribution_client_count,json=redistributionClientCount" json:"redistribution_client_count,omitempty"`
// Number of proto clients
ProtocolClientsCount uint32 `protobuf:"varint,54,opt,name=protocol_clients_count,json=protocolClientsCount" json:"protocol_clients_count,omitempty"`
// Number of routes (including active, backup and deleted), where, number of backup routes = RoutesCounts - ActiveRoutesCount - DeletedRoutesCount
RoutesCounts uint32 `protobuf:"varint,55,opt,name=routes_counts,json=routesCounts" json:"routes_counts,omitempty"`
// Number of active routes (not deleted)
ActiveRoutesCount uint32 `protobuf:"varint,56,opt,name=active_routes_count,json=activeRoutesCount" json:"active_routes_count,omitempty"`
// Number of deleted routes
DeletedRoutesCount uint32 `protobuf:"varint,57,opt,name=deleted_routes_count,json=deletedRoutesCount" json:"deleted_routes_count,omitempty"`
// Number of paths for all routes
PathsCount uint32 `protobuf:"varint,58,opt,name=paths_count,json=pathsCount" json:"paths_count,omitempty"`
// Memory for proto's routes and paths in bytes
ProtocolRouteMemory uint32 `protobuf:"varint,59,opt,name=protocol_route_memory,json=protocolRouteMemory" json:"protocol_route_memory,omitempty"`
// Number of backup routes
BackupRoutesCount uint32 `protobuf:"varint,60,opt,name=backup_routes_count,json=backupRoutesCount" json:"backup_routes_count,omitempty"`
}
func (m *Ipv6RibEdmProto) Reset() { *m = Ipv6RibEdmProto{} }
func (m *Ipv6RibEdmProto) String() string { return proto.CompactTextString(m) }
func (*Ipv6RibEdmProto) ProtoMessage() {}
func (*Ipv6RibEdmProto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *Ipv6RibEdmProto) GetProtocolNames() string {
if m != nil {
return m.ProtocolNames
}
return ""
}
func (m *Ipv6RibEdmProto) GetInstance() string {
if m != nil {
return m.Instance
}
return ""
}
func (m *Ipv6RibEdmProto) GetVersion() uint32 {
if m != nil {
return m.Version
}
return 0
}
func (m *Ipv6RibEdmProto) GetRedistributionClientCount() uint32 {
if m != nil {
return m.RedistributionClientCount
}
return 0
}
func (m *Ipv6RibEdmProto) GetProtocolClientsCount() uint32 {
if m != nil {
return m.ProtocolClientsCount
}
return 0
}
func (m *Ipv6RibEdmProto) GetRoutesCounts() uint32 {
if m != nil {
return m.RoutesCounts
}
return 0
}
func (m *Ipv6RibEdmProto) GetActiveRoutesCount() uint32 {
if m != nil {
return m.ActiveRoutesCount
}
return 0
}
func (m *Ipv6RibEdmProto) GetDeletedRoutesCount() uint32 {
if m != nil {
return m.DeletedRoutesCount
}
return 0
}
func (m *Ipv6RibEdmProto) GetPathsCount() uint32 {
if m != nil {
return m.PathsCount
}
return 0
}
func (m *Ipv6RibEdmProto) GetProtocolRouteMemory() uint32 {
if m != nil {
return m.ProtocolRouteMemory
}
return 0
}
func (m *Ipv6RibEdmProto) GetBackupRoutesCount() uint32 {
if m != nil {
return m.BackupRoutesCount
}
return 0
}
func init() {
proto.RegisterType((*Ipv6RibEdmProto_KEYS)(nil), "cisco_ios_xr_ip_rib_ipv6_oper.ipv6_rib.vrfs.vrf.afs.af.safs.saf.ip_rib_route_table_names.ip_rib_route_table_name.protocol.local.lspv.information.ipv6_rib_edm_proto_KEYS")
proto.RegisterType((*Ipv6RibEdmProto)(nil), "cisco_ios_xr_ip_rib_ipv6_oper.ipv6_rib.vrfs.vrf.afs.af.safs.saf.ip_rib_route_table_names.ip_rib_route_table_name.protocol.local.lspv.information.ipv6_rib_edm_proto")
}
func init() { proto.RegisterFile("ipv6_rib_edm_proto.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 433 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xcf, 0x6e, 0x13, 0x31,
0x10, 0xc6, 0xb5, 0x14, 0x35, 0x61, 0x20, 0x15, 0xb8, 0x85, 0x3a, 0x70, 0xa0, 0x2a, 0x42, 0xca,
0xc9, 0x42, 0x6d, 0x29, 0x7f, 0xc5, 0xa5, 0xe2, 0x84, 0xe0, 0x10, 0xb8, 0x70, 0xb2, 0xbc, 0x8e,
0x57, 0x58, 0xec, 0xae, 0x57, 0x1e, 0xef, 0x0a, 0xde, 0x02, 0xf1, 0xaa, 0xbc, 0x00, 0xf2, 0x78,
0x1d, 0x12, 0xa2, 0x5e, 0x1c, 0x79, 0xbe, 0xdf, 0xcf, 0xf9, 0x26, 0x01, 0x6e, 0xbb, 0xe1, 0x52,
0x7a, 0x5b, 0x4a, 0xb3, 0x6a, 0x64, 0xe7, 0x5d, 0x70, 0x82, 0x4e, 0xf6, 0xab, 0xd0, 0x16, 0xb5,
0x93, 0xd6, 0xa1, 0xfc, 0xe1, 0xa5, 0xed, 0x88, 0x22, 0xdc, 0x75, 0xc6, 0x8b, 0x2c, 0x8a, 0xc1,
0x57, 0x18, 0x0f, 0xa1, 0x2a, 0x14, 0xaa, 0x12, 0x18, 0x3f, 0x51, 0x55, 0x62, 0x54, 0xbc, 0xeb,
0x83, 0x91, 0x41, 0x95, 0xb5, 0x91, 0xad, 0x6a, 0x0c, 0x5e, 0x17, 0xa4, 0x2f, 0xd6, 0xae, 0x16,
0xb5, 0xd3, 0xaa, 0x16, 0x35, 0x76, 0x83, 0xb0, 0x6d, 0xe5, 0x7c, 0xa3, 0x82, 0x75, 0xed, 0xe9,
0xef, 0x02, 0x8e, 0x77, 0xfb, 0xca, 0x0f, 0xef, 0xbf, 0x7e, 0x66, 0x73, 0x98, 0x0e, 0xbe, 0xa2,
0x77, 0x78, 0x71, 0x52, 0x2c, 0x6e, 0x2d, 0x27, 0x83, 0xaf, 0x3e, 0xa9, 0xc6, 0xb0, 0x63, 0x98,
0xa8, 0x31, 0xb9, 0x41, 0xc9, 0xbe, 0x4a, 0xc1, 0x1c, 0xa6, 0x98, 0x93, 0xbd, 0xe4, 0xe0, 0x18,
0x2d, 0xe0, 0xee, 0xff, 0xf5, 0xf8, 0x4d, 0x42, 0x0e, 0x68, 0xfe, 0x25, 0x8e, 0x23, 0x79, 0xfa,
0x67, 0x0f, 0xd8, 0x6e, 0x29, 0xf6, 0x14, 0x0e, 0xf2, 0x3a, 0x69, 0x6b, 0x7e, 0x46, 0xfa, 0x2c,
0x4f, 0xa3, 0x8c, 0xec, 0x21, 0x4c, 0x6d, 0x8b, 0x41, 0xb5, 0xda, 0xf0, 0x73, 0x02, 0xd6, 0x77,
0xc6, 0x61, 0x32, 0x18, 0x8f, 0xd6, 0xb5, 0xfc, 0xe2, 0xa4, 0x58, 0xcc, 0x96, 0xf9, 0xca, 0xde,
0xc1, 0x23, 0x6f, 0x56, 0x16, 0x83, 0xb7, 0x65, 0x1f, 0x7f, 0x1a, 0xa9, 0x6b, 0x6b, 0xda, 0x20,
0xb5, 0xeb, 0xdb, 0xc0, 0x9f, 0x13, 0x3d, 0xdf, 0x46, 0xae, 0x88, 0xb8, 0x8a, 0x00, 0xbb, 0x80,
0x07, 0xeb, 0x72, 0xc9, 0xc4, 0x51, 0xbd, 0x24, 0xf5, 0x28, 0xa7, 0x49, 0xc2, 0x64, 0x3d, 0x81,
0x19, 0xed, 0x3e, 0xb2, 0xc8, 0x5f, 0x10, 0x7c, 0x27, 0x0d, 0x89, 0x41, 0x26, 0xe0, 0x50, 0xe9,
0x60, 0x07, 0x23, 0x37, 0x59, 0xfe, 0x92, 0xd0, 0x7b, 0x29, 0x5a, 0xfe, 0x13, 0xd8, 0x33, 0x38,
0x5a, 0x99, 0xda, 0x04, 0xb3, 0xda, 0x16, 0x5e, 0x91, 0xc0, 0xc6, 0x6c, 0xd3, 0x78, 0x0c, 0xb7,
0x3b, 0x15, 0xbe, 0x65, 0xf0, 0x35, 0x81, 0x40, 0xa3, 0x04, 0x9c, 0xc1, 0xfd, 0xf5, 0x76, 0xe9,
0x4f, 0x6c, 0x4c, 0xe3, 0xfc, 0x4f, 0xfe, 0x86, 0xd0, 0xc3, 0x1c, 0xd2, 0xa3, 0x1f, 0x29, 0x8a,
0xb5, 0x4b, 0xa5, 0xbf, 0xf7, 0xdd, 0x76, 0x8b, 0xb7, 0xa9, 0x76, 0x8a, 0x36, 0x4a, 0x94, 0xfb,
0xf4, 0xc8, 0xf9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe4, 0x59, 0xd3, 0xae, 0x40, 0x03, 0x00,
0x00,
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; URL=doc/html/index.html">
</head>
<body>
Automatic redirection failed, click this <a href="doc/html/index.html">link</a>
<hr>
<p>Copyright Louis Dionne 2013-2017</p>
<p>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file <a href="LICENSE.md">LICENSE.md</a> or copy at
<a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)
</p>
</body>
</html>
| {
"pile_set_name": "Github"
} |
[
"a",
"à",
"â",
"abord",
"afin",
"ah",
"ai",
"aie",
"ainsi",
"allaient",
"allo",
"allô",
"allons",
"après",
"assez",
"attendu",
"au",
"aucun",
"aucune",
"aujourd",
"aujourd'hui",
"auquel",
"aura",
"auront",
"aussi",
"autre",
"autres",
"aux",
"auxquelles",
"auxquels",
"avaient",
"avais",
"avait",
"avant",
"avec",
"avoir",
"ayant",
"b",
"bah",
"beaucoup",
"bien",
"bigre",
"boum",
"bravo",
"brrr",
"c",
"ça",
"car",
"ce",
"ceci",
"cela",
"celle",
"celle-ci",
"celle-là",
"celles",
"celles-ci",
"celles-là",
"celui",
"celui-ci",
"celui-là",
"cent",
"cependant",
"certain",
"certaine",
"certaines",
"certains",
"certes",
"ces",
"cet",
"cette",
"ceux",
"ceux-ci",
"ceux-là",
"chacun",
"chaque",
"cher",
"chère",
"chères",
"chers",
"chez",
"chiche",
"chut",
"ci",
"cinq",
"cinquantaine",
"cinquante",
"cinquantième",
"cinquième",
"clac",
"clic",
"combien",
"comme",
"comment",
"compris",
"concernant",
"contre",
"couic",
"crac",
"d",
"da",
"dans",
"de",
"debout",
"dedans",
"dehors",
"delà",
"depuis",
"derrière",
"des",
"dès",
"désormais",
"desquelles",
"desquels",
"dessous",
"dessus",
"deux",
"deuxième",
"deuxièmement",
"devant",
"devers",
"devra",
"différent",
"différente",
"différentes",
"différents",
"dire",
"divers",
"diverse",
"diverses",
"dix",
"dix-huit",
"dixième",
"dix-neuf",
"dix-sept",
"doit",
"doivent",
"donc",
"dont",
"douze",
"douzième",
"dring",
"du",
"duquel",
"durant",
"e",
"effet",
"eh",
"elle",
"elle-même",
"elles",
"elles-mêmes",
"en",
"encore",
"entre",
"envers",
"environ",
"es",
"ès",
"est",
"et",
"etant",
"étaient",
"étais",
"était",
"étant",
"etc",
"été",
"etre",
"être",
"eu",
"euh",
"eux",
"eux-mêmes",
"excepté",
"f",
"façon",
"fais",
"faisaient",
"faisant",
"fait",
"feront",
"fi",
"flac",
"floc",
"font",
"g",
"gens",
"h",
"ha",
"hé",
"hein",
"hélas",
"hem",
"hep",
"hi",
"ho",
"holà",
"hop",
"hormis",
"hors",
"hou",
"houp",
"hue",
"hui",
"huit",
"huitième",
"hum",
"hurrah",
"i",
"il",
"ils",
"importe",
"j",
"je",
"jusqu",
"jusque",
"k",
"l",
"la",
"là",
"laquelle",
"las",
"le",
"lequel",
"les",
"lès",
"lesquelles",
"lesquels",
"leur",
"leurs",
"longtemps",
"lorsque",
"lui",
"lui-même",
"m",
"ma",
"maint",
"mais",
"malgré",
"me",
"même",
"mêmes",
"merci",
"mes",
"mien",
"mienne",
"miennes",
"miens",
"mille",
"mince",
"moi",
"moi-même",
"moins",
"mon",
"moyennant",
"n",
"na",
"ne",
"néanmoins",
"neuf",
"neuvième",
"ni",
"nombreuses",
"nombreux",
"non",
"nos",
"notre",
"nôtre",
"nôtres",
"nous",
"nous-mêmes",
"nul",
"o",
"o|",
"ô",
"oh",
"ohé",
"olé",
"ollé",
"on",
"ont",
"onze",
"onzième",
"ore",
"ou",
"où",
"ouf",
"ouias",
"oust",
"ouste",
"outre",
"p",
"paf",
"pan",
"par",
"parmi",
"partant",
"particulier",
"particulière",
"particulièrement",
"pas",
"passé",
"pendant",
"personne",
"peu",
"peut",
"peuvent",
"peux",
"pff",
"pfft",
"pfut",
"pif",
"plein",
"plouf",
"plus",
"plusieurs",
"plutôt",
"pouah",
"pour",
"pourquoi",
"premier",
"première",
"premièrement",
"près",
"proche",
"psitt",
"puisque",
"q",
"qu",
"quand",
"quant",
"quanta",
"quant-à-soi",
"quarante",
"quatorze",
"quatre",
"quatre-vingt",
"quatrième",
"quatrièmement",
"que",
"quel",
"quelconque",
"quelle",
"quelles",
"quelque",
"quelques",
"quelqu'un",
"quels",
"qui",
"quiconque",
"quinze",
"quoi",
"quoique",
"r",
"revoici",
"revoilà",
"rien",
"s",
"sa",
"sacrebleu",
"sans",
"sapristi",
"sauf",
"se",
"seize",
"selon",
"sept",
"septième",
"sera",
"seront",
"ses",
"si",
"sien",
"sienne",
"siennes",
"siens",
"sinon",
"six",
"sixième",
"soi",
"soi-même",
"soit",
"soixante",
"son",
"sont",
"sous",
"stop",
"suis",
"suivant",
"sur",
"surtout",
"t",
"ta",
"tac",
"tant",
"te",
"té",
"tel",
"telle",
"tellement",
"telles",
"tels",
"tenant",
"tes",
"tic",
"tien",
"tienne",
"tiennes",
"tiens",
"toc",
"toi",
"toi-même",
"ton",
"touchant",
"toujours",
"tous",
"tout",
"toute",
"toutes",
"treize",
"trente",
"très",
"trois",
"troisième",
"troisièmement",
"trop",
"tsoin",
"tsouin",
"tu",
"u",
"un",
"une",
"unes",
"uns",
"v",
"va",
"vais",
"vas",
"vé",
"vers",
"via",
"vif",
"vifs",
"vingt",
"vivat",
"vive",
"vives",
"vlan",
"voici",
"voilà",
"vont",
"vos",
"votre",
"vôtre",
"vôtres",
"vous",
"vous-mêmes",
"vu",
"w",
"x",
"y",
"z",
"zut"
]
| {
"pile_set_name": "Github"
} |
function varargout = norm_tv(varargin)
% NORM_TV Returns total variation semi-norm
switch class(varargin{1})
case 'double' % What is the numerical value of this argument (needed for displays etc)
X = varargin{1};
[n,m] = size(X);
Dx = [diff(X,1,1);zeros(1,m)];
Dy = [diff(X,1,2) zeros(n,1)];
Z = [Dx(:);Dy(:)];
varargout{1} = sum(sqrt(sum(Z.^2,1)));
case 'sdpvar'
varargout{1} = yalmip('define',mfilename,varargin{:});
case 'char' % YALMIP sends 'model' when it wants the epigraph or hypograph
if isequal(varargin{1},'graph')
t = varargin{2};
X = varargin{3};
[n,m] = size(X);
Dx = [diff(X,1,1);zeros(1,m)];
Dy = [diff(X,1,2) zeros(n,1)];
T = sdpvar(n,m,'full');
F = cone([reshape(T,1,[]);reshape(Dx,1,[]);reshape(Dy,1,[])]);
F = [F, sum(sum(T)) <= t];
varargout{1} = F;
varargout{2} = struct('convexity','convex','monotonicity','none','definiteness','positive','model','graph');
varargout{3} = X;
else
varargout{1} = [];
varargout{2} = [];
varargout{3} = [];
end
otherwise
end | {
"pile_set_name": "Github"
} |
/* eslint sonarjs/cognitive-complexity: 0 */ // --> OFF
import { TestSuite } from '../../../../client-common/src/__tests__/TestSuite';
const testSuite = new TestSuite('secured_api_keys');
test(testSuite.testName, async () => {
const client = testSuite.makeSearchClient();
const index1 = client.initIndex(testSuite.makeIndexName());
const index2 = client.initIndex(testSuite.makeIndexName());
await index1.saveObject({ objectID: 'one' }).wait();
await index2.saveObject({ objectID: 'one' }).wait();
const securedApiKey = await client.generateSecuredApiKey(process.env.ALGOLIA_SEARCH_KEY_1 || '', {
validUntil: Math.round(new Date().getTime() / 1000) + 60,
restrictIndices: index1.indexName,
});
await expect(
testSuite
.algoliasearch(index1.appId, securedApiKey, {
hosts: client.transporter.hosts,
})
.initIndex(index1.indexName)
.search('')
).resolves.toMatchObject({
hits: [{ objectID: 'one' }],
nbHits: 1,
});
await expect(
testSuite
.algoliasearch(index2.appId, securedApiKey)
.initIndex(index2.indexName)
.search('')
).rejects.toMatchObject({
message: 'Index not allowed with this API key',
name: 'ApiError',
status: 403,
});
expect(client.getSecuredApiKeyRemainingValidity(securedApiKey)).toBeGreaterThan(0);
const expiredSecuredApiKey = await client.generateSecuredApiKey(
process.env.ALGOLIA_SEARCH_KEY_1 || '',
{
validUntil: Math.round(new Date().getTime() / 1000) - 60,
restrictIndices: index1.indexName,
}
);
expect(client.getSecuredApiKeyRemainingValidity(expiredSecuredApiKey)).toBeLessThan(0);
expect(() => client.getSecuredApiKeyRemainingValidity('azdza')).toThrow(
'ValidUntil not found in given secured api key.'
);
});
| {
"pile_set_name": "Github"
} |
.dd { position: relative; display: block; margin: 10px; padding: 0; list-style: none; font-size: 13px; line-height: 20px; }
.dd-list { display: block; position: relative; margin: 0; padding: 0; list-style: none; }
.dd-list .dd-list { padding-left: 30px; }
.dd-collapsed .dd-list { display: none; }
.dd-item,
.dd-empty,
.dd-placeholder { display: block; position: relative; margin: 0; padding: 0;}
.dd-handle {
display: block;
margin: 1px 0;
padding: 8px 10px;
color: #333;
text-decoration: none;
border: 1px solid #ddd;
background: #fff;
}
.dd-handle:hover { color: #2ea8e5; background: #fff; }
.dd-item > button { display: block; position: relative; cursor: pointer; float: left; width: 25px; height: 20px; margin: 5px 0; padding: 0; text-indent: 100%; white-space: nowrap; overflow: hidden; border: 0; background: transparent; font-size: 12px; line-height: 1; text-align: center; font-weight: bold; }
.dd-item > button:before { content: '+'; display: block; position: absolute; width: 100%; text-align: center; text-indent: 0; }
.dd-item > button[data-action="collapse"]:before { content: '-'; }
.dd-placeholder { margin: 5px 0; padding: 0; min-height: 30px; background: #f2fbff; border: 1px dashed #b6bcbf; box-sizing: border-box; -moz-box-sizing: border-box; }
.dd-dragel { position: absolute; pointer-events: none; z-index: 9999; }
.dd-dragel > .dd-item .dd-handle { margin-top: 0; }
.dd-dragel .dd-handle {
-webkit-box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1);
box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1);
} | {
"pile_set_name": "Github"
} |
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: global::Android.Runtime.ResourceDesignerAttribute("CocosSharpBox2d.Droid.Resource", IsApplication=true)]
namespace CocosSharpBox2d.Droid
{
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
public partial class Resource
{
static Resource()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
public static void UpdateIdValues()
{
}
public partial class Attribute
{
static Attribute()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Attribute()
{
}
}
public partial class Drawable
{
// aapt resource value: 0x7f020000
public const int icon = 2130837504;
// aapt resource value: 0x7f020001
public const int Splash = 2130837505;
static Drawable()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Drawable()
{
}
}
public partial class String
{
// aapt resource value: 0x7f030000
public const int ApplicationName = 2130903040;
static String()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private String()
{
}
}
public partial class Style
{
// aapt resource value: 0x7f040000
public const int Theme_Splash = 2130968576;
static Style()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Style()
{
}
}
}
}
#pragma warning restore 1591
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
* All rights reserved
* www.brocade.com
*
* Linux driver for Brocade Fibre Channel Host Bus Adapter.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License (GPL) Version 2 as
* published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#ifndef __BFA_FCS_FABRIC_H__
#define __BFA_FCS_FABRIC_H__
struct bfa_fcs_s;
#include <defs/bfa_defs_status.h>
#include <defs/bfa_defs_vf.h>
#include <cs/bfa_q.h>
#include <cs/bfa_sm.h>
#include <defs/bfa_defs_pport.h>
#include <fcs/bfa_fcs_lport.h>
#include <protocol/fc_sp.h>
#include <fcs/bfa_fcs_auth.h>
/*
* forward declaration
*/
struct bfad_vf_s;
enum bfa_fcs_fabric_type {
BFA_FCS_FABRIC_UNKNOWN = 0,
BFA_FCS_FABRIC_SWITCHED = 1,
BFA_FCS_FABRIC_PLOOP = 2,
BFA_FCS_FABRIC_N2N = 3,
};
struct bfa_fcs_fabric_s {
struct list_head qe; /* queue element */
bfa_sm_t sm; /* state machine */
struct bfa_fcs_s *fcs; /* FCS instance */
struct bfa_fcs_port_s bport; /* base logical port */
enum bfa_fcs_fabric_type fab_type; /* fabric type */
enum bfa_pport_type oper_type; /* current link topology */
u8 is_vf; /* is virtual fabric? */
u8 is_npiv; /* is NPIV supported ? */
u8 is_auth; /* is Security/Auth supported ? */
u16 bb_credit; /* BB credit from fabric */
u16 vf_id; /* virtual fabric ID */
u16 num_vports; /* num vports */
u16 rsvd;
struct list_head vport_q; /* queue of virtual ports */
struct list_head vf_q; /* queue of virtual fabrics */
struct bfad_vf_s *vf_drv; /* driver vf structure */
struct bfa_timer_s link_timer; /* Link Failure timer. Vport */
wwn_t fabric_name; /* attached fabric name */
bfa_boolean_t auth_reqd; /* authentication required */
struct bfa_timer_s delay_timer; /* delay timer */
union {
u16 swp_vfid;/* switch port VF id */
} event_arg;
struct bfa_fcs_auth_s auth; /* authentication config */
struct bfa_wc_s wc; /* wait counter for delete */
struct bfa_vf_stats_s stats; /* fabric/vf stats */
struct bfa_lps_s *lps; /* lport login services */
u8 fabric_ip_addr[BFA_FCS_FABRIC_IPADDR_SZ]; /* attached
* fabric's ip addr
*/
};
#define bfa_fcs_fabric_npiv_capable(__f) ((__f)->is_npiv)
#define bfa_fcs_fabric_is_switched(__f) \
((__f)->fab_type == BFA_FCS_FABRIC_SWITCHED)
/**
* The design calls for a single implementation of base fabric and vf.
*/
#define bfa_fcs_vf_t struct bfa_fcs_fabric_s
struct bfa_vf_event_s {
u32 undefined;
};
/**
* bfa fcs vf public functions
*/
bfa_status_t bfa_fcs_vf_mode_enable(struct bfa_fcs_s *fcs, u16 vf_id);
bfa_status_t bfa_fcs_vf_mode_disable(struct bfa_fcs_s *fcs);
bfa_status_t bfa_fcs_vf_create(bfa_fcs_vf_t *vf, struct bfa_fcs_s *fcs,
u16 vf_id, struct bfa_port_cfg_s *port_cfg,
struct bfad_vf_s *vf_drv);
bfa_status_t bfa_fcs_vf_delete(bfa_fcs_vf_t *vf);
void bfa_fcs_vf_start(bfa_fcs_vf_t *vf);
bfa_status_t bfa_fcs_vf_stop(bfa_fcs_vf_t *vf);
void bfa_fcs_vf_list(struct bfa_fcs_s *fcs, u16 *vf_ids, int *nvfs);
void bfa_fcs_vf_list_all(struct bfa_fcs_s *fcs, u16 *vf_ids, int *nvfs);
void bfa_fcs_vf_get_attr(bfa_fcs_vf_t *vf, struct bfa_vf_attr_s *vf_attr);
void bfa_fcs_vf_get_stats(bfa_fcs_vf_t *vf,
struct bfa_vf_stats_s *vf_stats);
void bfa_fcs_vf_clear_stats(bfa_fcs_vf_t *vf);
void bfa_fcs_vf_get_ports(bfa_fcs_vf_t *vf, wwn_t vpwwn[], int *nports);
bfa_fcs_vf_t *bfa_fcs_vf_lookup(struct bfa_fcs_s *fcs, u16 vf_id);
struct bfad_vf_s *bfa_fcs_vf_get_drv_vf(bfa_fcs_vf_t *vf);
#endif /* __BFA_FCS_FABRIC_H__ */
| {
"pile_set_name": "Github"
} |
# 🏭 plugin-lib-webpack
[](https://www.npmjs.com/package/@start/plugin-lib-webpack) [](https://travis-ci.org/deepsweet/start) [](https://ci.appveyor.com/project/deepsweet/start) [](https://codecov.io/github/deepsweet/start) [](https://david-dm.org/deepsweet/start?path=packages/plugin-lib-webpack)
Bundle files using [Webpack](https://webpack.js.org/).
## Install
```sh
$ yarn add --dev @start/plugin-lib-webpack
# or
$ npm install --save-dev @start/plugin-lib-webpack
```
## Usage
### Signature
```ts
webpack(config: Configuration, statsOptions?: StatsOptions)
```
#### `config`
[webpack configuration](https://webpack.js.org/configuration/).
#### `statsOptions`
[webpack stats options](https://webpack.js.org/configuration/stats/#stats).
Default:
```js
{
colors: true
}
```
### Example
```js
import sequence from '@start/plugin-sequence'
import env from '@start/plugin-env'
import webpack from '@start/plugin-lib-webpack'
export const task = async () => {
const { default: webpackConfig } = await import('./webpack.config')
return sequence(
env('NODE_ENV', 'production'),
webpack(webpackConfig)
)
}
```
| {
"pile_set_name": "Github"
} |
# Configuration file for ipython-nbconvert.
c = get_config()
#------------------------------------------------------------------------------
# NbConvertApp configuration
#------------------------------------------------------------------------------
# This application is used to convert notebook files (*.ipynb) to various other
# formats.
#
# WARNING: THE COMMANDLINE INTERFACE MAY CHANGE IN FUTURE RELEASES.
# NbConvertApp will inherit config from: BaseIPythonApplication, Application
# The IPython profile to use.
# c.NbConvertApp.profile = u'default'
# The export format to be used.
# c.NbConvertApp.export_format = 'html'
# Set the log level by value or name.
# c.NbConvertApp.log_level = 30
# List of notebooks to convert. Wildcards are supported. Filenames passed
# positionally will be added to the list.
# c.NbConvertApp.notebooks = []
# Path to an extra config file to load.
#
# If specified, load this config file in addition to any other IPython config.
# c.NbConvertApp.extra_config_file = u''
# PostProcessor class used to write the results of the conversion
# c.NbConvertApp.postprocessor_class = u''
# Whether to create profile dir if it doesn't exist
# c.NbConvertApp.auto_create = False
# overwrite base name use for output files. can only be use when converting one
# notebook at a time.
# c.NbConvertApp.output_base = ''
# The name of the IPython directory. This directory is used for logging
# configuration (through profiles), history storage, etc. The default is usually
# $HOME/.ipython. This options can also be specified through the environment
# variable IPYTHONDIR.
# c.NbConvertApp.ipython_dir = u''
# Whether to install the default config files into the profile dir. If a new
# profile is being created, and IPython contains config files for that profile,
# then they will be staged into the new directory. Otherwise, default config
# files will be automatically generated.
# c.NbConvertApp.copy_config_files = False
# The date format used by logging formatters for %(asctime)s
# c.NbConvertApp.log_datefmt = '%Y-%m-%d %H:%M:%S'
# The Logging format template
# c.NbConvertApp.log_format = '[%(name)s]%(highlevel)s %(message)s'
# Create a massive crash report when IPython encounters what may be an internal
# error. The default is to append a short message to the usual traceback
# c.NbConvertApp.verbose_crash = False
# Writer class used to write the results of the conversion
# c.NbConvertApp.writer_class = 'FilesWriter'
# Whether to overwrite existing config files when copying
# c.NbConvertApp.overwrite = False
#------------------------------------------------------------------------------
# NbConvertBase configuration
#------------------------------------------------------------------------------
# Global configurable class for shared config
#
# Useful for display data priority that might be use by many transformers
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.NbConvertBase.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
# default highlight language
# c.NbConvertBase.default_language = 'ipython'
#------------------------------------------------------------------------------
# ProfileDir configuration
#------------------------------------------------------------------------------
# An object to manage the profile directory and its resources.
#
# The profile directory is used by all IPython applications, to manage
# configuration, logging and security.
#
# This object knows how to find, create and manage these directories. This
# should be used by any code that wants to handle profiles.
# Set the profile location directly. This overrides the logic used by the
# `profile` option.
# c.ProfileDir.location = u''
#------------------------------------------------------------------------------
# Exporter configuration
#------------------------------------------------------------------------------
# Class containing methods that sequentially run a list of preprocessors on a
# NotebookNode object and then return the modified NotebookNode object and
# accompanying resources dict.
# Extension of the file that should be written to disk
# c.Exporter.file_extension = 'txt'
# List of preprocessors, by name or namespace, to enable.
# c.Exporter.preprocessors = []
# List of preprocessors available by default, by name, namespace, instance, or
# type.
# c.Exporter.default_preprocessors = ['IPython.nbconvert.preprocessors.coalesce_streams', 'IPython.nbconvert.preprocessors.SVG2PDFPreprocessor', 'IPython.nbconvert.preprocessors.ExtractOutputPreprocessor', 'IPython.nbconvert.preprocessors.CSSHTMLHeaderPreprocessor', 'IPython.nbconvert.preprocessors.RevealHelpPreprocessor', 'IPython.nbconvert.preprocessors.LatexPreprocessor', 'IPython.nbconvert.preprocessors.HighlightMagicsPreprocessor']
#------------------------------------------------------------------------------
# HTMLExporter configuration
#------------------------------------------------------------------------------
# Exports a basic HTML document. This exporter assists with the export of HTML.
# Inherit from it if you are writing your own HTML template and need custom
# preprocessors/filters. If you don't need custom preprocessors/ filters, just
# change the 'template_file' config option.
# HTMLExporter will inherit config from: TemplateExporter, Exporter
#
# c.HTMLExporter.jinja_variable_block_start = ''
#
# c.HTMLExporter.jinja_variable_block_end = ''
# formats of raw cells to be included in this Exporter's output.
# c.HTMLExporter.raw_mimetypes = []
# Name of the template file to use
# c.HTMLExporter.template_file = u'default'
# List of preprocessors available by default, by name, namespace, instance, or
# type.
# c.HTMLExporter.default_preprocessors = ['IPython.nbconvert.preprocessors.coalesce_streams', 'IPython.nbconvert.preprocessors.SVG2PDFPreprocessor', 'IPython.nbconvert.preprocessors.ExtractOutputPreprocessor', 'IPython.nbconvert.preprocessors.CSSHTMLHeaderPreprocessor', 'IPython.nbconvert.preprocessors.RevealHelpPreprocessor', 'IPython.nbconvert.preprocessors.LatexPreprocessor', 'IPython.nbconvert.preprocessors.HighlightMagicsPreprocessor']
#
# c.HTMLExporter.template_path = ['.']
# Extension of the file that should be written to disk
# c.HTMLExporter.file_extension = 'txt'
#
# c.HTMLExporter.jinja_comment_block_end = ''
# Dictionary of filters, by name and namespace, to add to the Jinja environment.
# c.HTMLExporter.filters = {}
#
# c.HTMLExporter.jinja_comment_block_start = ''
#
# c.HTMLExporter.jinja_logic_block_end = ''
#
# c.HTMLExporter.jinja_logic_block_start = ''
#
# c.HTMLExporter.template_extension = '.tpl'
# List of preprocessors, by name or namespace, to enable.
# c.HTMLExporter.preprocessors = []
#------------------------------------------------------------------------------
# LatexExporter configuration
#------------------------------------------------------------------------------
# Exports to a Latex template. Inherit from this class if your template is
# LaTeX based and you need custom tranformers/filters. Inherit from it if you
# are writing your own HTML template and need custom tranformers/filters. If
# you don't need custom tranformers/filters, just change the 'template_file'
# config option. Place your template in the special "/latex" subfolder of the
# "../templates" folder.
# LatexExporter will inherit config from: TemplateExporter, Exporter
#
# c.LatexExporter.jinja_variable_block_start = '((('
#
# c.LatexExporter.jinja_variable_block_end = ')))'
# formats of raw cells to be included in this Exporter's output.
# c.LatexExporter.raw_mimetypes = []
# Name of the template file to use
# c.LatexExporter.template_file = u'default'
# List of preprocessors available by default, by name, namespace, instance, or
# type.
# c.LatexExporter.default_preprocessors = ['IPython.nbconvert.preprocessors.coalesce_streams', 'IPython.nbconvert.preprocessors.SVG2PDFPreprocessor', 'IPython.nbconvert.preprocessors.ExtractOutputPreprocessor', 'IPython.nbconvert.preprocessors.CSSHTMLHeaderPreprocessor', 'IPython.nbconvert.preprocessors.RevealHelpPreprocessor', 'IPython.nbconvert.preprocessors.LatexPreprocessor', 'IPython.nbconvert.preprocessors.HighlightMagicsPreprocessor']
#
# c.LatexExporter.template_path = ['.']
# Extension of the file that should be written to disk
# c.LatexExporter.file_extension = 'txt'
#
# c.LatexExporter.jinja_comment_block_end = '=))'
# Dictionary of filters, by name and namespace, to add to the Jinja environment.
# c.LatexExporter.filters = {}
#
# c.LatexExporter.jinja_comment_block_start = '((='
#
# c.LatexExporter.jinja_logic_block_end = '*))'
#
# c.LatexExporter.jinja_logic_block_start = '((*'
#
# c.LatexExporter.template_extension = '.tplx'
# List of preprocessors, by name or namespace, to enable.
# c.LatexExporter.preprocessors = []
#------------------------------------------------------------------------------
# MarkdownExporter configuration
#------------------------------------------------------------------------------
# Exports to a markdown document (.md)
# MarkdownExporter will inherit config from: TemplateExporter, Exporter
#
# c.MarkdownExporter.jinja_variable_block_start = ''
#
# c.MarkdownExporter.jinja_variable_block_end = ''
# formats of raw cells to be included in this Exporter's output.
# c.MarkdownExporter.raw_mimetypes = []
# Name of the template file to use
# c.MarkdownExporter.template_file = u'default'
# List of preprocessors available by default, by name, namespace, instance, or
# type.
# c.MarkdownExporter.default_preprocessors = ['IPython.nbconvert.preprocessors.coalesce_streams', 'IPython.nbconvert.preprocessors.SVG2PDFPreprocessor', 'IPython.nbconvert.preprocessors.ExtractOutputPreprocessor', 'IPython.nbconvert.preprocessors.CSSHTMLHeaderPreprocessor', 'IPython.nbconvert.preprocessors.RevealHelpPreprocessor', 'IPython.nbconvert.preprocessors.LatexPreprocessor', 'IPython.nbconvert.preprocessors.HighlightMagicsPreprocessor']
#
# c.MarkdownExporter.template_path = ['.']
# Extension of the file that should be written to disk
# c.MarkdownExporter.file_extension = 'txt'
#
# c.MarkdownExporter.jinja_comment_block_end = ''
# Dictionary of filters, by name and namespace, to add to the Jinja environment.
# c.MarkdownExporter.filters = {}
#
# c.MarkdownExporter.jinja_comment_block_start = ''
#
# c.MarkdownExporter.jinja_logic_block_end = ''
#
# c.MarkdownExporter.jinja_logic_block_start = ''
#
# c.MarkdownExporter.template_extension = '.tpl'
# List of preprocessors, by name or namespace, to enable.
# c.MarkdownExporter.preprocessors = []
#------------------------------------------------------------------------------
# PythonExporter configuration
#------------------------------------------------------------------------------
# Exports a Python code file.
# PythonExporter will inherit config from: TemplateExporter, Exporter
#
# c.PythonExporter.jinja_variable_block_start = ''
#
# c.PythonExporter.jinja_variable_block_end = ''
# formats of raw cells to be included in this Exporter's output.
# c.PythonExporter.raw_mimetypes = []
# Name of the template file to use
# c.PythonExporter.template_file = u'default'
# List of preprocessors available by default, by name, namespace, instance, or
# type.
# c.PythonExporter.default_preprocessors = ['IPython.nbconvert.preprocessors.coalesce_streams', 'IPython.nbconvert.preprocessors.SVG2PDFPreprocessor', 'IPython.nbconvert.preprocessors.ExtractOutputPreprocessor', 'IPython.nbconvert.preprocessors.CSSHTMLHeaderPreprocessor', 'IPython.nbconvert.preprocessors.RevealHelpPreprocessor', 'IPython.nbconvert.preprocessors.LatexPreprocessor', 'IPython.nbconvert.preprocessors.HighlightMagicsPreprocessor']
#
# c.PythonExporter.template_path = ['.']
# Extension of the file that should be written to disk
# c.PythonExporter.file_extension = 'txt'
#
# c.PythonExporter.jinja_comment_block_end = ''
# Dictionary of filters, by name and namespace, to add to the Jinja environment.
# c.PythonExporter.filters = {}
#
# c.PythonExporter.jinja_comment_block_start = ''
#
# c.PythonExporter.jinja_logic_block_end = ''
#
# c.PythonExporter.jinja_logic_block_start = ''
#
# c.PythonExporter.template_extension = '.tpl'
# List of preprocessors, by name or namespace, to enable.
# c.PythonExporter.preprocessors = []
#------------------------------------------------------------------------------
# RSTExporter configuration
#------------------------------------------------------------------------------
# Exports restructured text documents.
# RSTExporter will inherit config from: TemplateExporter, Exporter
#
# c.RSTExporter.jinja_variable_block_start = ''
#
# c.RSTExporter.jinja_variable_block_end = ''
# formats of raw cells to be included in this Exporter's output.
# c.RSTExporter.raw_mimetypes = []
# Name of the template file to use
# c.RSTExporter.template_file = u'default'
# List of preprocessors available by default, by name, namespace, instance, or
# type.
# c.RSTExporter.default_preprocessors = ['IPython.nbconvert.preprocessors.coalesce_streams', 'IPython.nbconvert.preprocessors.SVG2PDFPreprocessor', 'IPython.nbconvert.preprocessors.ExtractOutputPreprocessor', 'IPython.nbconvert.preprocessors.CSSHTMLHeaderPreprocessor', 'IPython.nbconvert.preprocessors.RevealHelpPreprocessor', 'IPython.nbconvert.preprocessors.LatexPreprocessor', 'IPython.nbconvert.preprocessors.HighlightMagicsPreprocessor']
#
# c.RSTExporter.template_path = ['.']
# Extension of the file that should be written to disk
# c.RSTExporter.file_extension = 'txt'
#
# c.RSTExporter.jinja_comment_block_end = ''
# Dictionary of filters, by name and namespace, to add to the Jinja environment.
# c.RSTExporter.filters = {}
#
# c.RSTExporter.jinja_comment_block_start = ''
#
# c.RSTExporter.jinja_logic_block_end = ''
#
# c.RSTExporter.jinja_logic_block_start = ''
#
# c.RSTExporter.template_extension = '.tpl'
# List of preprocessors, by name or namespace, to enable.
# c.RSTExporter.preprocessors = []
#------------------------------------------------------------------------------
# SlidesExporter configuration
#------------------------------------------------------------------------------
# Exports HTML slides with reveal.js
# SlidesExporter will inherit config from: HTMLExporter, TemplateExporter,
# Exporter
#
# c.SlidesExporter.jinja_variable_block_start = ''
#
# c.SlidesExporter.jinja_variable_block_end = ''
# formats of raw cells to be included in this Exporter's output.
# c.SlidesExporter.raw_mimetypes = []
# Name of the template file to use
# c.SlidesExporter.template_file = u'default'
# List of preprocessors available by default, by name, namespace, instance, or
# type.
# c.SlidesExporter.default_preprocessors = ['IPython.nbconvert.preprocessors.coalesce_streams', 'IPython.nbconvert.preprocessors.SVG2PDFPreprocessor', 'IPython.nbconvert.preprocessors.ExtractOutputPreprocessor', 'IPython.nbconvert.preprocessors.CSSHTMLHeaderPreprocessor', 'IPython.nbconvert.preprocessors.RevealHelpPreprocessor', 'IPython.nbconvert.preprocessors.LatexPreprocessor', 'IPython.nbconvert.preprocessors.HighlightMagicsPreprocessor']
#
# c.SlidesExporter.template_path = ['.']
# Extension of the file that should be written to disk
# c.SlidesExporter.file_extension = 'txt'
#
# c.SlidesExporter.jinja_comment_block_end = ''
# Dictionary of filters, by name and namespace, to add to the Jinja environment.
# c.SlidesExporter.filters = {}
#
# c.SlidesExporter.jinja_comment_block_start = ''
#
# c.SlidesExporter.jinja_logic_block_end = ''
#
# c.SlidesExporter.jinja_logic_block_start = ''
#
# c.SlidesExporter.template_extension = '.tpl'
# List of preprocessors, by name or namespace, to enable.
# c.SlidesExporter.preprocessors = []
#------------------------------------------------------------------------------
# TemplateExporter configuration
#------------------------------------------------------------------------------
# Exports notebooks into other file formats. Uses Jinja 2 templating engine to
# output new formats. Inherit from this class if you are creating a new
# template type along with new filters/preprocessors. If the filters/
# preprocessors provided by default suffice, there is no need to inherit from
# this class. Instead, override the template_file and file_extension traits via
# a config file.
#
# - citation2latex - highlight2html - filter_data_type - markdown2html -
# markdown2rst - get_lines - ansi2latex - strip_ansi - add_prompts -
# comment_lines - ascii_only - markdown2latex - escape_latex - add_anchor -
# ipython2python - posix_path - highlight2latex - path2url - ansi2html -
# wrap_text - indent - strip_dollars - html2text - strip_files_prefix
# TemplateExporter will inherit config from: Exporter
#
# c.TemplateExporter.jinja_variable_block_start = ''
#
# c.TemplateExporter.jinja_variable_block_end = ''
# formats of raw cells to be included in this Exporter's output.
# c.TemplateExporter.raw_mimetypes = []
# Name of the template file to use
# c.TemplateExporter.template_file = u'default'
# List of preprocessors available by default, by name, namespace, instance, or
# type.
# c.TemplateExporter.default_preprocessors = ['IPython.nbconvert.preprocessors.coalesce_streams', 'IPython.nbconvert.preprocessors.SVG2PDFPreprocessor', 'IPython.nbconvert.preprocessors.ExtractOutputPreprocessor', 'IPython.nbconvert.preprocessors.CSSHTMLHeaderPreprocessor', 'IPython.nbconvert.preprocessors.RevealHelpPreprocessor', 'IPython.nbconvert.preprocessors.LatexPreprocessor', 'IPython.nbconvert.preprocessors.HighlightMagicsPreprocessor']
#
# c.TemplateExporter.template_path = ['.']
# Extension of the file that should be written to disk
# c.TemplateExporter.file_extension = 'txt'
#
# c.TemplateExporter.jinja_comment_block_end = ''
# Dictionary of filters, by name and namespace, to add to the Jinja environment.
# c.TemplateExporter.filters = {}
#
# c.TemplateExporter.jinja_comment_block_start = ''
#
# c.TemplateExporter.jinja_logic_block_end = ''
#
# c.TemplateExporter.jinja_logic_block_start = ''
#
# c.TemplateExporter.template_extension = '.tpl'
# List of preprocessors, by name or namespace, to enable.
# c.TemplateExporter.preprocessors = []
#------------------------------------------------------------------------------
# CSSHTMLHeaderPreprocessor configuration
#------------------------------------------------------------------------------
# Preprocessor used to pre-process notebook for HTML output. Adds IPython
# notebook front-end CSS and Pygments CSS to HTML output.
# CSSHTMLHeaderPreprocessor will inherit config from: Preprocessor,
# NbConvertBase
# default highlight language
# c.CSSHTMLHeaderPreprocessor.default_language = 'ipython'
# CSS highlight class identifier
# c.CSSHTMLHeaderPreprocessor.highlight_class = '.highlight'
#
# c.CSSHTMLHeaderPreprocessor.enabled = False
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.CSSHTMLHeaderPreprocessor.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
#------------------------------------------------------------------------------
# ConvertFiguresPreprocessor configuration
#------------------------------------------------------------------------------
# Converts all of the outputs in a notebook from one format to another.
# ConvertFiguresPreprocessor will inherit config from: Preprocessor,
# NbConvertBase
# default highlight language
# c.ConvertFiguresPreprocessor.default_language = 'ipython'
# Format the converter writes
# c.ConvertFiguresPreprocessor.to_format = u''
#
# c.ConvertFiguresPreprocessor.enabled = False
# Format the converter accepts
# c.ConvertFiguresPreprocessor.from_format = u''
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.ConvertFiguresPreprocessor.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
#------------------------------------------------------------------------------
# ExtractOutputPreprocessor configuration
#------------------------------------------------------------------------------
# Extracts all of the outputs from the notebook file. The extracted outputs
# are returned in the 'resources' dictionary.
# ExtractOutputPreprocessor will inherit config from: Preprocessor,
# NbConvertBase
# default highlight language
# c.ExtractOutputPreprocessor.default_language = 'ipython'
#
# c.ExtractOutputPreprocessor.output_filename_template = '{unique_key}_{cell_index}_{index}{extension}'
#
# c.ExtractOutputPreprocessor.extract_output_types = set(['svg', 'application/pdf', 'jpeg', 'png'])
#
# c.ExtractOutputPreprocessor.enabled = False
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.ExtractOutputPreprocessor.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
#------------------------------------------------------------------------------
# HighlightMagicsPreprocessor configuration
#------------------------------------------------------------------------------
# Detects and tags code cells that use a different languages than Python.
# HighlightMagicsPreprocessor will inherit config from: Preprocessor,
# NbConvertBase
# Syntax highlighting for magic's extension languages. Each item associates a
# language magic extension such as %%R, with a pygments lexer such as r.
# c.HighlightMagicsPreprocessor.languages = {}
#
# c.HighlightMagicsPreprocessor.enabled = False
# default highlight language
# c.HighlightMagicsPreprocessor.default_language = 'ipython'
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.HighlightMagicsPreprocessor.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
#------------------------------------------------------------------------------
# LatexPreprocessor configuration
#------------------------------------------------------------------------------
# Preprocessor for latex destined documents.
#
# Mainly populates the `latex` key in the resources dict, adding definitions for
# pygments highlight styles.
# LatexPreprocessor will inherit config from: Preprocessor, NbConvertBase
# default highlight language
# c.LatexPreprocessor.default_language = 'ipython'
#
# c.LatexPreprocessor.enabled = False
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.LatexPreprocessor.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
#------------------------------------------------------------------------------
# Preprocessor configuration
#------------------------------------------------------------------------------
# A configurable preprocessor
#
# Inherit from this class if you wish to have configurability for your
# preprocessor.
#
# Any configurable traitlets this class exposed will be configurable in profiles
# using c.SubClassName.attribute = value
#
# you can overwrite :meth:`preprocess_cell` to apply a transformation
# independently on each cell or :meth:`preprocess` if you prefer your own logic.
# See corresponding docstring for informations.
#
# Disabled by default and can be enabled via the config by
# 'c.YourPreprocessorName.enabled = True'
# Preprocessor will inherit config from: NbConvertBase
# default highlight language
# c.Preprocessor.default_language = 'ipython'
#
# c.Preprocessor.enabled = False
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.Preprocessor.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
#------------------------------------------------------------------------------
# RevealHelpPreprocessor configuration
#------------------------------------------------------------------------------
# RevealHelpPreprocessor will inherit config from: Preprocessor, NbConvertBase
# The URL prefix for reveal.js. This can be a a relative URL for a local copy of
# reveal.js, or point to a CDN.
#
# For speaker notes to work, a local reveal.js prefix must be used.
# c.RevealHelpPreprocessor.url_prefix = 'reveal.js'
# default highlight language
# c.RevealHelpPreprocessor.default_language = 'ipython'
#
# c.RevealHelpPreprocessor.enabled = False
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.RevealHelpPreprocessor.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
#------------------------------------------------------------------------------
# SVG2PDFPreprocessor configuration
#------------------------------------------------------------------------------
# Converts all of the outputs in a notebook from SVG to PDF.
# SVG2PDFPreprocessor will inherit config from: ConvertFiguresPreprocessor,
# Preprocessor, NbConvertBase
# Format the converter accepts
# c.SVG2PDFPreprocessor.from_format = u''
# default highlight language
# c.SVG2PDFPreprocessor.default_language = 'ipython'
#
# c.SVG2PDFPreprocessor.enabled = False
# Format the converter writes
# c.SVG2PDFPreprocessor.to_format = u''
# The command to use for converting SVG to PDF
#
# This string is a template, which will be formatted with the keys to_filename
# and from_filename.
#
# The conversion call must read the SVG from {from_flename}, and write a PDF to
# {to_filename}.
# c.SVG2PDFPreprocessor.command = u''
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.SVG2PDFPreprocessor.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
# The path to Inkscape, if necessary
# c.SVG2PDFPreprocessor.inkscape = u''
#------------------------------------------------------------------------------
# FilesWriter configuration
#------------------------------------------------------------------------------
# Consumes nbconvert output and produces files.
# FilesWriter will inherit config from: WriterBase, NbConvertBase
# List of the files that the notebook references. Files will be included with
# written output.
# c.FilesWriter.files = []
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.FilesWriter.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
# default highlight language
# c.FilesWriter.default_language = 'ipython'
# Directory to write output to. Leave blank to output to the current directory
# c.FilesWriter.build_directory = ''
#------------------------------------------------------------------------------
# StdoutWriter configuration
#------------------------------------------------------------------------------
# Consumes output from nbconvert export...() methods and writes to the stdout
# stream.
# StdoutWriter will inherit config from: WriterBase, NbConvertBase
# List of the files that the notebook references. Files will be included with
# written output.
# c.StdoutWriter.files = []
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.StdoutWriter.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
# default highlight language
# c.StdoutWriter.default_language = 'ipython'
#------------------------------------------------------------------------------
# WriterBase configuration
#------------------------------------------------------------------------------
# Consumes output from nbconvert export...() methods and writes to a useful
# location.
# WriterBase will inherit config from: NbConvertBase
# List of the files that the notebook references. Files will be included with
# written output.
# c.WriterBase.files = []
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.WriterBase.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
# default highlight language
# c.WriterBase.default_language = 'ipython'
#------------------------------------------------------------------------------
# PDFPostProcessor configuration
#------------------------------------------------------------------------------
# Writer designed to write to PDF files
# PDFPostProcessor will inherit config from: PostProcessorBase, NbConvertBase
# Filename extensions of temp files to remove after running.
# c.PDFPostProcessor.temp_file_exts = ['.aux', '.bbl', '.blg', '.idx', '.log', '.out']
# Whether or not to display the output of the compile call.
# c.PDFPostProcessor.verbose = False
# Shell command used to run bibtex.
# c.PDFPostProcessor.bib_command = [u'bibtex', u'{filename}']
# default highlight language
# c.PDFPostProcessor.default_language = 'ipython'
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.PDFPostProcessor.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
# How many times pdflatex will be called.
# c.PDFPostProcessor.latex_count = 3
# Whether or not to open the pdf after the compile call.
# c.PDFPostProcessor.pdf_open = False
# Shell command used to compile PDF.
# c.PDFPostProcessor.latex_command = [u'pdflatex', u'{filename}']
#------------------------------------------------------------------------------
# PostProcessorBase configuration
#------------------------------------------------------------------------------
# PostProcessorBase will inherit config from: NbConvertBase
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.PostProcessorBase.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
# default highlight language
# c.PostProcessorBase.default_language = 'ipython'
#------------------------------------------------------------------------------
# ServePostProcessor configuration
#------------------------------------------------------------------------------
# Post processor designed to serve files
#
# Proxies reveal.js requests to a CDN if no local reveal.js is present
# ServePostProcessor will inherit config from: PostProcessorBase, NbConvertBase
# The IP address to listen on.
# c.ServePostProcessor.ip = '127.0.0.1'
# URL prefix for reveal.js
# c.ServePostProcessor.reveal_prefix = 'reveal.js'
# default highlight language
# c.ServePostProcessor.default_language = 'ipython'
# port for the server to listen on.
# c.ServePostProcessor.port = 8000
# An ordered list of preferred output type, the first encountered will usually
# be used when converting discarding the others.
# c.ServePostProcessor.display_data_priority = ['html', 'application/pdf', 'svg', 'latex', 'png', 'jpg', 'jpeg', 'text']
# Should the browser be opened automatically?
# c.ServePostProcessor.open_in_browser = True
# URL for reveal.js CDN.
# c.ServePostProcessor.reveal_cdn = 'https://cdn.jsdelivr.net/reveal.js/2.5.0'
| {
"pile_set_name": "Github"
} |
============
Clangd
============
.. contents::
.. toctree::
:maxdepth: 1
:program:`Clangd` is an implementation of the `Language Server Protocol
<https://github.com/Microsoft/language-server-protocol>`_ leveraging Clang.
Clangd's goal is to provide language "smartness" features like code completion,
find references, etc. for clients such as C/C++ Editors.
Using Clangd
==================
:program:`Clangd` is not meant to be used by C/C++ developers directly but
rather from a client implementing the protocol. A client would be typically
implemented in an IDE or an editor.
At the moment, `Visual Studio Code <https://code.visualstudio.com/>`_ is mainly
used in order to test :program:`Clangd` but more clients are likely to make
use of :program:`Clangd` in the future as it matures and becomes a production
quality tool. If you are interested in trying :program:`Clangd` in combination
with Visual Studio Code, you can start by `installing Clangd`_ or
`building Clangd`_, then open Visual Studio Code in the clangd-vscode folder and
launch the extension.
Installing Clangd
==================
Packages are available for debian-based distributions, see the `LLVM packages
page <http://apt.llvm.org/>`_. :program:`Clangd` is included in the
`clang-tools` package.
However, it is a good idea to check your distribution's packaging system first
as it might already be available.
Otherwise, you can install :program:`Clangd` by `building Clangd`_ first.
Building Clangd
==================
You can follow the instructions for `building Clang
<https://clang.llvm.org/get_started.html>`_ but "extra Clang tools" is **not**
optional.
Current Status
==================
Many features could be implemented in :program:`Clangd`.
Here is a list of features that could be useful with the status of whether or
not they are already implemented in :program:`Clangd` and specified in the
Language Server Protocol. Note that for some of the features, it is not clear
whether or not they should be part of the Language Server Protocol, so those
features might be eventually developed outside :program:`Clangd` or as an
extension to the protocol.
+-------------------------------------+------------+----------+
| C/C++ Editor feature | LSP | Clangd |
+=====================================+============+==========+
| Formatting | Yes | Yes |
+-------------------------------------+------------+----------+
| Completion | Yes | Yes |
+-------------------------------------+------------+----------+
| Diagnostics | Yes | Yes |
+-------------------------------------+------------+----------+
| Fix-its | Yes | Yes |
+-------------------------------------+------------+----------+
| Go to Definition | Yes | Yes |
+-------------------------------------+------------+----------+
| Signature Help | Yes | Yes |
+-------------------------------------+------------+----------+
| Document Highlights | Yes | Yes |
+-------------------------------------+------------+----------+
| Rename | Yes | Yes |
+-------------------------------------+------------+----------+
| Source hover | Yes | Yes |
+-------------------------------------+------------+----------+
| Find References | Yes | No |
+-------------------------------------+------------+----------+
| Code Lens | Yes | No |
+-------------------------------------+------------+----------+
| Document Symbols | Yes | No |
+-------------------------------------+------------+----------+
| Workspace Symbols | Yes | No |
+-------------------------------------+------------+----------+
| Syntax and Semantic Coloring | No | No |
+-------------------------------------+------------+----------+
| Code folding | No | No |
+-------------------------------------+------------+----------+
| Call hierarchy | No | No |
+-------------------------------------+------------+----------+
| Type hierarchy | No | No |
+-------------------------------------+------------+----------+
| Organize Includes | No | No |
+-------------------------------------+------------+----------+
| Quick Assist | No | No |
+-------------------------------------+------------+----------+
| Extract Local Variable | No | No |
+-------------------------------------+------------+----------+
| Extract Function/Method | No | No |
+-------------------------------------+------------+----------+
| Hide Method | No | No |
+-------------------------------------+------------+----------+
| Implement Method | No | No |
+-------------------------------------+------------+----------+
| Gen. Getters/Setters | No | No |
+-------------------------------------+------------+----------+
Getting Involved
==================
A good place for interested contributors is the `Clang developer mailing list
<http://lists.llvm.org/mailman/listinfo/cfe-dev>`_.
If you're also interested in contributing patches to :program:`Clangd`, take a
look at the `LLVM Developer Policy
<http://llvm.org/docs/DeveloperPolicy.html>`_ and `Code Reviews
<http://llvm.org/docs/Phabricator.html>`_ page. Contributions of new features
to the `Language Server Protocol
<https://github.com/Microsoft/language-server-protocol>`_ itself would also be
very useful, so that :program:`Clangd` can eventually implement them in a
conforming way.
| {
"pile_set_name": "Github"
} |
<refentry xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="5.0" xml:id="text.prev">
<refmeta>
<refentrytitle>text.prev</refentrytitle>
<refmiscinfo class="other" otherclass="datatype">string</refmiscinfo>
</refmeta>
<refnamediv>
<refname>text.prev</refname>
<refpurpose>FIXME:</refpurpose>
</refnamediv>
<refsynopsisdiv>
<src:fragment xml:id="text.prev.frag">
<xsl:param name="text.prev">Prev</xsl:param>
</src:fragment>
</refsynopsisdiv>
<refsection><info><title>Description</title></info>
<para>FIXME:</para>
</refsection>
</refentry>
| {
"pile_set_name": "Github"
} |
package com.tencent.mm.aq;
import com.tencent.mm.e.b.bj;
import com.tencent.mm.model.ah;
import com.tencent.mm.model.ar;
import com.tencent.mm.modelcdntran.CdnTransportEngine;
import com.tencent.mm.modelcdntran.f.a;
import com.tencent.mm.modelcdntran.keep_ProgressInfo;
import com.tencent.mm.modelcdntran.keep_SceneResult;
import com.tencent.mm.sdk.platformtools.aa;
import com.tencent.mm.sdk.platformtools.ad;
import com.tencent.mm.sdk.platformtools.be;
import com.tencent.mm.sdk.platformtools.v;
import com.tencent.mm.storage.ai;
import com.tencent.mm.storage.aj;
import com.tencent.mm.t.d;
import com.tencent.mm.t.j;
import java.io.ByteArrayOutputStream;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
final class m$a
implements f.a, d
{
String caS;
List<q> caT;
long cap;
q caq;
long startTime;
private m$a(m paramm) {}
public final int a(String arg1, int paramInt, keep_ProgressInfo paramkeep_ProgressInfo, keep_SceneResult paramkeep_SceneResult, boolean paramBoolean)
{
v.d("MicroMsg.SightMassSendService", "cdntra cdnCallback clientid:%s startRet:%d proginfo:[%s] res:[%s]", new Object[] { caS, Integer.valueOf(paramInt), paramkeep_ProgressInfo, paramkeep_SceneResult });
if (paramInt == 44531)
{
v.d("MicroMsg.SightMassSendService", "cdntra ERR_CNDCOM_MEDIA_IS_UPLOADING clientid:%s", new Object[] { caS });
return 0;
}
if (paramInt != 0)
{
m.J(caT);
v.e("MicroMsg.SightMassSendService", "upload to CDN error, massSendId %d, errCode %d", new Object[] { Long.valueOf(cap), Integer.valueOf(paramInt) });
com.tencent.mm.plugin.report.service.g.gdY.h(10421, new Object[] { Integer.valueOf(paramInt), Integer.valueOf(1), Long.valueOf(startTime), Long.valueOf(be.Gp()), Integer.valueOf(com.tencent.mm.modelcdntran.c.aI(aa.getContext())), Integer.valueOf(CdnTransportEngine.bDt), Integer.valueOf(0), "" });
caR.b(cap, 3, paramInt);
return 0;
}
if (paramkeep_ProgressInfo != null)
{
v.v("MicroMsg.SightMassSendService", "progress length %d", new Object[] { Integer.valueOf(field_finishedLength) });
??? = caT.iterator();
while (???.hasNext())
{
paramkeep_SceneResult = (q)???.next();
cbj = be.Go();
caw = field_finishedLength;
aqQ = 1032;
s.d(paramkeep_SceneResult);
}
return 0;
}
if (paramkeep_SceneResult != null)
{
if (field_retCode != 0)
{
v.e("MicroMsg.SightMassSendService", "cdntra sceneResult.retCode :%d arg[%s] info[%s], massSendId[%d]", new Object[] { Integer.valueOf(field_retCode), field_arg, field_transInfo, Long.valueOf(cap) });
m.J(caT);
com.tencent.mm.plugin.report.service.g.gdY.h(10421, new Object[] { Integer.valueOf(field_retCode), Integer.valueOf(1), Long.valueOf(startTime), Long.valueOf(be.Gp()), Integer.valueOf(com.tencent.mm.modelcdntran.c.aI(aa.getContext())), Integer.valueOf(CdnTransportEngine.bDt), Integer.valueOf(field_fileLength), field_transInfo, "", "", "", "", "", "", "", report_Part2 });
caR.b(cap, 3, field_retCode);
}
}
else {
return 0;
}
v.i("MicroMsg.SightMassSendService", "uploadvideo by cdn, isHitCacheUpload[%d] massSendId[%d]", new Object[] { Integer.valueOf(field_UploadHitCacheType), Long.valueOf(cap) });
??? = "<msg><videomsg aeskey=\"" + field_aesKey + "\" cdnthumbaeskey=\"" + field_aesKey + "\" cdnvideourl=\"" + field_fileId + "\" ";
??? = ??? + "cdnthumburl=\"" + field_fileId + "\" ";
??? = ??? + "length=\"" + field_fileLength + "\" ";
??? = ??? + "cdnthumblength=\"" + field_thumbimgLength + "\"/></msg>";
v.i("MicroMsg.SightMassSendService", "cdn callback new build cdnInfo:%s", new Object[] { ??? });
paramkeep_ProgressInfo = caT.iterator();
while (paramkeep_ProgressInfo.hasNext())
{
q localq = (q)paramkeep_ProgressInfo.next();
if (be.kf(localq.EC()))
{
cbr = ???;
aqQ = 2097152;
paramBoolean = s.d(localq);
v.i("MicroMsg.SightMassSendService", "massSendId[%d] info %s, update recv xml ret %B", new Object[] { Long.valueOf(cap), localq.getFileName(), Boolean.valueOf(paramBoolean) });
}
}
for (;;)
{
synchronized (m.a(caR))
{
paramkeep_ProgressInfo = (String)m.b(caR).get(Long.valueOf(cap));
if (be.kf(paramkeep_ProgressInfo)) {
v.i("MicroMsg.SightMassSendService", "check cdn client id FAIL do NOTHING, massSendId %d, oldClientId %s, selfClientId %s", new Object[] { Long.valueOf(cap), paramkeep_ProgressInfo, caS });
}
}
v.i("MicroMsg.SightMassSendService", "check cdn client id ok do MASS SEND, massSendId %d, oldClientId %s, selfClientId %s", new Object[] { Long.valueOf(cap), paramkeep_ProgressInfo, caS });
m.b(caR).put(Long.valueOf(cap), "done_upload_cdn_client_id");
ah.tF().a(245, this);
paramkeep_ProgressInfo = new g(cap, caq, paramkeep_SceneResult, caS);
if (!ah.tF().a(paramkeep_ProgressInfo, 0))
{
v.e("MicroMsg.SightMassSendService", "try to do NetSceneMassUploadSight fail");
ah.tF().b(245, this);
caR.b(cap, 3, 0);
}
}
}
public final void a(String paramString, ByteArrayOutputStream paramByteArrayOutputStream) {}
public final byte[] h(String paramString, byte[] paramArrayOfByte)
{
return null;
}
public final void onSceneEnd(int paramInt1, int paramInt2, String paramString, j paramj)
{
ah.tF().b(245, this);
if ((paramInt1 == 4) && (paramInt2 == -22))
{
v.e("MicroMsg.SightMassSendService", "ERR: onGYNetEnd BLACK errtype:" + paramInt1 + " errCode:" + paramInt2 + " massSendId:" + cap);
m.K(caT);
caR.b(cap, paramInt1, paramInt2);
return;
}
if ((paramInt1 == 4) && (paramInt2 != 0))
{
v.e("MicroMsg.SightMassSendService", "ERR: onGYNetEnd SERVER FAILED errtype:" + paramInt1 + " errCode:" + paramInt2 + " massSendId:" + cap);
m.J(caT);
caR.b(cap, paramInt1, paramInt2);
return;
}
if ((paramInt1 != 0) || (paramInt2 != 0))
{
v.e("MicroMsg.SightMassSendService", "ERR: onGYNetEnd FAILED (WILL RETRY) errtype:" + paramInt1 + " errCode:" + paramInt2 + " massSendId:" + cap);
m.J(caT);
caR.b(cap, paramInt1, paramInt2);
return;
}
paramString = caT.iterator();
if (paramString.hasNext())
{
paramj = (q)paramString.next();
cbj = be.Go();
status = 199;
aqQ = 1280;
if (s.d(paramj))
{
if (paramj != null) {
break label354;
}
v.e("MicroMsg.VideoLogic", "video info is null");
}
for (;;)
{
v.v("MicroMsg.SightMassSendService", "massSendId %d, file %s, set status %d", new Object[] { Long.valueOf(cap), paramj.getFileName(), Integer.valueOf(199) });
break;
label354:
ai localai;
if (cbm > 0)
{
localai = ah.tE().rt().dQ(cbm);
paramInt1 = field_type;
v.i("MicroMsg.VideoLogic", "ashutest::updateWriteFinMassMsgInfo, msg type %d", new Object[] { Integer.valueOf(paramInt1) });
if ((43 == paramInt1) || (62 == paramInt1))
{
localai.bC(1);
localai.cr(paramj.Ez());
localai.u(bJA);
localai.bB(2);
localai.setContent(o.a(paramj.EA(), cbl, false));
ah.tE().rt().a(cbm, localai);
v.d("MicroMsg.VideoLogic", "updateWriteFinMassMsgInfo msgId:%d", new Object[] { Long.valueOf(field_msgId) });
}
}
else
{
localai = new ai();
localai.cr(paramj.Ez());
localai.setType(62);
localai.bC(1);
localai.cs(paramj.getFileName());
localai.bB(2);
localai.v(ar.fz(paramj.Ez()));
cbm = ((int)ar.e(localai));
aqQ = 8192;
s.d(paramj);
v.d("MicroMsg.VideoLogic", "updateWriteFinMassMsgInfo insert msgId:%d", new Object[] { Long.valueOf(field_msgId) });
}
}
}
paramString = caR;
long l = cap;
ah.tw().t(new m.1(paramString, l));
}
}
/* Location:
* Qualified Name: com.tencent.mm.aq.m.a
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | {
"pile_set_name": "Github"
} |
#define __SYSCALL_LL_E(x) \
((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
((union { long long ll; long l[2]; }){ .ll = x }).l[1]
#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
static __inline long __syscall0(long n)
{
register unsigned long d0 __asm__("d0") = n;
__asm__ __volatile__ ("trap #0" : "+r"(d0)
:
: "memory");
return d0;
}
static inline long __syscall1(long n, long a)
{
register unsigned long d0 __asm__("d0") = n;
register unsigned long d1 __asm__("d1") = a;
__asm__ __volatile__ ("trap #0" : "+r"(d0)
: "r"(d1)
: "memory");
return d0;
}
static inline long __syscall2(long n, long a, long b)
{
register unsigned long d0 __asm__("d0") = n;
register unsigned long d1 __asm__("d1") = a;
register unsigned long d2 __asm__("d2") = b;
__asm__ __volatile__ ("trap #0" : "+r"(d0)
: "r"(d1), "r"(d2)
: "memory");
return d0;
}
static inline long __syscall3(long n, long a, long b, long c)
{
register unsigned long d0 __asm__("d0") = n;
register unsigned long d1 __asm__("d1") = a;
register unsigned long d2 __asm__("d2") = b;
register unsigned long d3 __asm__("d3") = c;
__asm__ __volatile__ ("trap #0" : "+r"(d0)
: "r"(d1), "r"(d2), "r"(d3)
: "memory");
return d0;
}
static inline long __syscall4(long n, long a, long b, long c, long d)
{
register unsigned long d0 __asm__("d0") = n;
register unsigned long d1 __asm__("d1") = a;
register unsigned long d2 __asm__("d2") = b;
register unsigned long d3 __asm__("d3") = c;
register unsigned long d4 __asm__("d4") = d;
__asm__ __volatile__ ("trap #0" : "+r"(d0)
: "r"(d1), "r"(d2), "r"(d3), "r"(d4)
: "memory");
return d0;
}
static inline long __syscall5(long n, long a, long b, long c, long d, long e)
{
register unsigned long d0 __asm__("d0") = n;
register unsigned long d1 __asm__("d1") = a;
register unsigned long d2 __asm__("d2") = b;
register unsigned long d3 __asm__("d3") = c;
register unsigned long d4 __asm__("d4") = d;
register unsigned long d5 __asm__("d5") = e;
__asm__ __volatile__ ("trap #0" : "+r"(d0)
: "r"(d1), "r"(d2), "r"(d3), "r"(d4), "r"(d5)
: "memory");
return d0;
}
static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
{
register unsigned long d0 __asm__("d0") = n;
register unsigned long d1 __asm__("d1") = a;
register unsigned long d2 __asm__("d2") = b;
register unsigned long d3 __asm__("d3") = c;
register unsigned long d4 __asm__("d4") = d;
register unsigned long d5 __asm__("d5") = e;
register unsigned long a0 __asm__("a0") = f;
__asm__ __volatile__ ("trap #0" : "+r"(d0)
: "r"(d1), "r"(d2), "r"(d3), "r"(d4), "r"(d5), "r"(a0)
: "memory");
return d0;
}
#define SYSCALL_USE_SOCKETCALL
#define SYSCALL_IPC_BROKEN_MODE
| {
"pile_set_name": "Github"
} |
---
title: C26451
description: "Describes the causes of MSVC code analysis warning C26451, and shows how to fix it."
ms.date: 07/15/2020
ms.topic: "reference"
f1_keywords: ["C26451"]
helpviewer_keywords: ["C26451"]
dev_langs: ["C++"]
---
# Warning C26451
> Arithmetic overflow: Using operator '*operator*' on a *size-a* byte value and then casting the result to a *size-b* byte value. Cast the value to the wider type before calling operator '*operator*' to avoid overflow
This warning indicates incorrect behavior that results from integral promotion rules and types larger than the ones in which arithmetic is typically performed.
## Remarks
Code analysis detects when an integral value gets shifted left, multiplied, added, or subtracted, and the result gets cast to a wider integral type. If the operation overflows the narrower integral type, then data is lost. You can prevent this loss by casting the value to a wider type before the arithmetic operation.
## Example 1
The following code generates this warning:
```cpp
void leftshift(int i) noexcept
{
unsigned __int64 x;
x = i << 31; // C26451 reported here
// code
}
```
To correct this warning, use the following code:
```cpp
void leftshift(int i) noexcept
{
unsigned __int64 x;
x = static_cast<unsigned __int64>(i) << 31; // OK
// code
}
```
## Example 2
```cpp
void somefunc(__int64 /* y */) noexcept
{}
void callsomefunc(int x) noexcept
{
somefunc(x * 2); // C26451 reported here
}
```
To correct this warning, use the following code:
```cpp
void callsomefunc(int x) noexcept
{
somefunc(static_cast<__int64>(x) * 2); // OK
}
```
## Example 3
```cpp
__int64 add(int x) noexcept
{
constexpr auto value = 2;
return x += value; // C26451 reported here
}
```
To correct this warning, use the following code:
```cpp
__int64 add(int x) noexcept
{
constexpr auto value = 2;
const __int64 y = static_cast<__int64>(x) + value; // OK
return y;
}
```
## See also
- [ES.103: Don't overflow](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Res-overflow)
| {
"pile_set_name": "Github"
} |
package s3
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"net/http"
"os"
"strings"
"golang.org/x/net/proxy"
)
type Client struct {
AccessKeyID string
SecretAccessKey string
Token string
Region string
Bucket string
Domain string
Protocol string
SOCKS5Proxy string
SignatureVersion int
CACertificates []string
SkipSystemCAs bool
InsecureSkipVerify bool
UsePathBuckets bool
ua *http.Client
trace bool
traceTo io.Writer
traceBody bool
}
func NewClient(c *Client) (*Client, error) {
var (
roots *x509.CertPool
err error
)
if c.SignatureVersion == 0 {
c.SignatureVersion = 4
}
if trace := os.Getenv("S3_TRACE"); trace != "" {
switch strings.ToLower(trace) {
case "yes", "y", "1":
c.Trace(os.Stderr, true, true)
case "headers", "header":
c.Trace(os.Stderr, true, false)
default:
c.Trace(os.Stderr, false, false)
}
}
if !c.SkipSystemCAs {
roots, err = x509.SystemCertPool()
if err != nil {
return nil, fmt.Errorf("unable to retrieve system root certificate authorities: %s", err)
}
} else {
roots = x509.NewCertPool()
}
for _, ca := range c.CACertificates {
if ok := roots.AppendCertsFromPEM([]byte(ca)); !ok {
return nil, fmt.Errorf("unable to append CA certificate")
}
}
dial := http.DefaultTransport.(*http.Transport).Dial
if c.SOCKS5Proxy != "" {
dialer, err := proxy.SOCKS5("tcp", c.SOCKS5Proxy, nil, proxy.Direct)
if err != nil {
return nil, err
}
dial = dialer.Dial
}
c.ua = &http.Client{
Transport: &http.Transport{
Dial: dial,
Proxy: http.ProxyFromEnvironment,
TLSClientConfig: &tls.Config{
RootCAs: roots,
InsecureSkipVerify: c.InsecureSkipVerify,
},
},
}
return c, nil
}
func (c *Client) domain() string {
if c.Domain == "" {
return "s3.amazonaws.com"
}
return c.Domain
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env bash
# 2019 QCRI (Ahmed Ali)
export LC_ALL=C
words_file=
train_text=
dev_text=
oov_symbol="<UNK>"
echo "$0 $@"
[ -f path.sh ] && . ./path.sh
. ./utils/parse_options.sh || exit 1
echo "-------------------------------------"
echo "Building an SRILM language model "
echo "-------------------------------------"
if [ $# -ne 2 ] ; then
echo "Incorrect number of parameters. "
echo "Script has to be called like this:"
echo " $0 [switches] <datadir> <tgtdir>"
echo "For example: "
echo " $0 data data/srilm"
echo "The allowed switches are: "
echo " words_file=<word_file|> word list file -- data/lang/words.txt by default"
echo " train_text=<train_text|> data/train/text is used in case when not specified"
echo " dev_text=<dev_text|> last 10 % of the train text is used by default"
echo " oov_symbol=<unk_sumbol|<UNK>> symbol to use for oov modeling -- <UNK> by default"
exit 1
fi
datadir=$1
tgtdir=$2
outlm=lm.gz
##End of configuration
loc=`which ngram-count`;
if [ -z $loc ]; then
if uname -a | grep 64 >/dev/null; then # some kind of 64 bit...
sdir=`pwd`/../../../tools/srilm/bin/i686-m64
else
sdir=`pwd`/../../../tools/srilm/bin/i686
fi
if [ -f $sdir/ngram-count ]; then
echo Using SRILM tools from $sdir
export PATH=$PATH:$sdir
else
echo You appear to not have SRILM tools installed, either on your path,
echo or installed in $sdir. See tools/install_srilm.sh for installation
echo instructions.
exit 1
fi
fi
# Prepare the destination directory
mkdir -p $tgtdir
for f in $words_file $train_text $dev_text; do
[ ! -s $f ] && echo "No such file $f" && exit 1;
done
[ -z $words_file ] && words_file=$datadir/lang/words.txt
if [ ! -z "$train_text" ] && [ -z "$dev_text" ] ; then
nr=`cat $train_text | wc -l`
nr_dev=$(($nr / 10 ))
nr_train=$(( $nr - $nr_dev ))
orig_train_text=$train_text
head -n $nr_train $train_text > $tgtdir/train_text
tail -n $nr_dev $train_text > $tgtdir/dev_text
train_text=$tgtdir/train_text
dev_text=$tgtdir/dev_text
echo "Using words file: $words_file"
echo "Using train text: 9/10 of $orig_train_text"
echo "Using dev text : 1/10 of $orig_train_text"
elif [ ! -z "$train_text" ] && [ ! -z "$dev_text" ] ; then
echo "Using words file: $words_file"
echo "Using train text: $train_text"
echo "Using dev text : $dev_text"
train_text=$train_text
dev_text=$dev_text
else
train_text=$datadir/train/text
dev_text=$datadir/dev2h/text
echo "Using words file: $words_file"
echo "Using train text: $train_text"
echo "Using dev text : $dev_text"
fi
# Extract the word list from the training dictionary; exclude special symbols
sort $words_file | awk '{print $1}' | grep -v '\#0' | grep -v '<eps>' | grep -v -F "$oov_symbol" > $tgtdir/vocab
if (($?)); then
echo "Failed to create vocab from $words_file"
exit 1
else
# wc vocab # doesn't work due to some encoding issues
echo vocab contains `cat $tgtdir/vocab | perl -ne 'BEGIN{$l=$w=0;}{split; $w+=$#_; $w++; $l++;}END{print "$l lines, $w words\n";}'`
fi
# Kaldi transcript files contain Utterance_ID as the first word; remove it
cat $train_text | cut -f2- -d' ' > $tgtdir/train.txt
if (($?)); then
echo "Failed to create $tgtdir/train.txt from $train_text"
exit 1
else
echo "Removed first word (uid) from every line of $train_text"
# wc text.train train.txt # doesn't work due to some encoding issues
echo $train_text contains `cat $train_text | perl -ane 'BEGIN{$w=$s=0;}{$w+=@F; $w--; $s++;}END{print "$w words, $s sentences\n";}'`
echo train.txt contains `cat $tgtdir/train.txt | perl -ane 'BEGIN{$w=$s=0;}{$w+=@F; $s++;}END{print "$w words, $s sentences\n";}'`
fi
# Kaldi transcript files contain Utterance_ID as the first word; remove it
cat $dev_text | cut -f2- -d' ' > $tgtdir/dev.txt
if (($?)); then
echo "Failed to create $tgtdir/dev.txt from $dev_text"
exit 1
else
echo "Removed first word (uid) from every line of $dev_text"
# wc text.train train.txt # doesn't work due to some encoding issues
echo $dev_text contains `cat $dev_text | perl -ane 'BEGIN{$w=$s=0;}{$w+=@F; $w--; $s++;}END{print "$w words, $s sentences\n";}'`
echo $tgtdir/dev.txt contains `cat $tgtdir/dev.txt | perl -ane 'BEGIN{$w=$s=0;}{$w+=@F; $s++;}END{print "$w words, $s sentences\n";}'`
fi
echo "-------------------"
echo "Good-Turing 2grams"
echo "-------------------"
ngram-count -lm $tgtdir/2gram.gt01.gz -gt1min 0 -gt2min 1 -order 2 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/2gram.gt02.gz -gt1min 0 -gt2min 2 -order 2 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
echo "-------------------"
echo "Kneser-Ney 2grams"
echo "-------------------"
ngram-count -lm $tgtdir/2gram.kn01.gz -kndiscount1 -gt1min 0 -kndiscount2 -gt2min 1 -order 2 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/2gram.kn02.gz -kndiscount1 -gt1min 0 -kndiscount2 -gt2min 2 -order 2 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
echo "-------------------"
echo "Good-Turing 3grams"
echo "-------------------"
ngram-count -lm $tgtdir/3gram.gt011.gz -gt1min 0 -gt2min 1 -gt3min 1 -order 3 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/3gram.gt012.gz -gt1min 0 -gt2min 1 -gt3min 2 -order 3 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/3gram.gt022.gz -gt1min 0 -gt2min 2 -gt3min 2 -order 3 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/3gram.gt023.gz -gt1min 0 -gt2min 2 -gt3min 3 -order 3 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
echo "-------------------"
echo "Kneser-Ney 3grams"
echo "-------------------"
ngram-count -lm $tgtdir/3gram.kn011.gz -kndiscount1 -gt1min 0 -kndiscount2 -gt2min 1 -kndiscount3 -gt3min 1 -order 3 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/3gram.kn012.gz -kndiscount1 -gt1min 0 -kndiscount2 -gt2min 1 -kndiscount3 -gt3min 2 -order 3 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/3gram.kn022.gz -kndiscount1 -gt1min 0 -kndiscount2 -gt2min 2 -kndiscount3 -gt3min 2 -order 3 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/3gram.kn023.gz -kndiscount1 -gt1min 0 -kndiscount2 -gt2min 2 -kndiscount3 -gt3min 3 -order 3 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
echo "-------------------"
echo "Good-Turing 4grams"
echo "-------------------"
ngram-count -lm $tgtdir/4gram.gt0111.gz -gt1min 0 -gt2min 1 -gt3min 1 -gt4min 1 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/4gram.gt0112.gz -gt1min 0 -gt2min 1 -gt3min 1 -gt4min 2 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/4gram.gt0122.gz -gt1min 0 -gt2min 1 -gt3min 2 -gt4min 2 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/4gram.gt0123.gz -gt1min 0 -gt2min 1 -gt3min 2 -gt4min 3 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/4gram.gt0113.gz -gt1min 0 -gt2min 1 -gt3min 1 -gt4min 3 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/4gram.gt0222.gz -gt1min 0 -gt2min 2 -gt3min 2 -gt4min 2 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/4gram.gt0223.gz -gt1min 0 -gt2min 2 -gt3min 2 -gt4min 3 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
echo "-------------------"
echo "Kneser-Ney 4grams"
echo "-------------------"
ngram-count -lm $tgtdir/4gram.kn0111.gz -kndiscount1 -gt1min 0 -kndiscount2 -gt2min 1 -kndiscount3 -gt3min 1 -kndiscount4 -gt4min 1 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/4gram.kn0112.gz -kndiscount1 -gt1min 0 -kndiscount2 -gt2min 1 -kndiscount3 -gt3min 1 -kndiscount4 -gt4min 2 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/4gram.kn0113.gz -kndiscount1 -gt1min 0 -kndiscount2 -gt2min 1 -kndiscount3 -gt3min 1 -kndiscount4 -gt4min 3 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/4gram.kn0122.gz -kndiscount1 -gt1min 0 -kndiscount2 -gt2min 1 -kndiscount3 -gt3min 2 -kndiscount4 -gt4min 2 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/4gram.kn0123.gz -kndiscount1 -gt1min 0 -kndiscount2 -gt2min 1 -kndiscount3 -gt3min 2 -kndiscount4 -gt4min 3 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/4gram.kn0222.gz -kndiscount1 -gt1min 0 -kndiscount2 -gt2min 2 -kndiscount3 -gt3min 2 -kndiscount4 -gt4min 2 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
ngram-count -lm $tgtdir/4gram.kn0223.gz -kndiscount1 -gt1min 0 -kndiscount2 -gt2min 2 -kndiscount3 -gt3min 2 -kndiscount4 -gt4min 3 -order 4 -text $tgtdir/train.txt -vocab $tgtdir/vocab -unk -sort -map-unk "$oov_symbol"
if [ ! -z ${LIBLBFGS} ]; then
#please not that if the switch -map-unk "$oov_symbol" is used with -maxent-convert-to-arpa, ngram-count will segfault
#instead of that, we simply output the model in the maxent format and convert it using the "ngram"
echo "-------------------"
echo "Maxent 2grams"
echo "-------------------"
sed 's/'${oov_symbol}'/<unk>/g' $tgtdir/train.txt | \
ngram-count -lm - -order 2 -text - -vocab $tgtdir/vocab -unk -sort -maxent -maxent-convert-to-arpa|\
sed 's/<unk>/'${oov_symbol}'/g' | gzip -c > $tgtdir/2gram.me.gz || exit 1
echo "-------------------"
echo "Maxent 3grams"
echo "-------------------"
sed 's/'${oov_symbol}'/<unk>/g' $tgtdir/train.txt | \
ngram-count -lm - -order 3 -text - -vocab $tgtdir/vocab -unk -sort -maxent -maxent-convert-to-arpa|\
sed 's/<unk>/'${oov_symbol}'/g' | gzip -c > $tgtdir/3gram.me.gz || exit 1
echo "-------------------"
echo "Maxent 4grams"
echo "-------------------"
sed 's/'${oov_symbol}'/<unk>/g' $tgtdir/train.txt | \
ngram-count -lm - -order 4 -text - -vocab $tgtdir/vocab -unk -sort -maxent -maxent-convert-to-arpa|\
sed 's/<unk>/'${oov_symbol}'/g' | gzip -c > $tgtdir/4gram.me.gz || exit 1
fi
echo "--------------------"
echo "Computing perplexity"
echo "--------------------"
(
for f in $tgtdir/2gram* ; do ( echo $f; ngram -order 2 -lm $f -unk -map-unk "$oov_symbol" -ppl $tgtdir/dev.txt ) | paste -s -d ' ' - ; done
for f in $tgtdir/3gram* ; do ( echo $f; ngram -order 3 -lm $f -unk -map-unk "$oov_symbol" -ppl $tgtdir/dev.txt ) | paste -s -d ' ' - ; done
for f in $tgtdir/4gram* ; do ( echo $f; ngram -order 4 -lm $f -unk -map-unk "$oov_symbol" -ppl $tgtdir/dev.txt ) | paste -s -d ' ' - ; done
) | sort -r -n -k 15,15g | column -t | tee $tgtdir/perplexities.txt
echo "The perlexity scores report is stored in $tgtdir/perplexities.txt "
#This will link the lowest perplexity LM as the output LM.
#ln -sf $tgtdir/`head -n 1 $tgtdir/perplexities.txt | cut -f 1 -d ' '` $outlm
#A slight modification of the previous approach:
#We look at the two lowest perplexity LMs and use a 3gram LM if one of the two, even if the 4gram is of lower ppl
nof_trigram_lm=`head -n 2 $tgtdir/perplexities.txt | grep 3gram | wc -l`
if [[ $nof_trigram_lm -eq 0 ]] ; then
lmfilename=`head -n 1 $tgtdir/perplexities.txt | cut -f 1 -d ' '`
elif [[ $nof_trigram_lm -eq 2 ]] ; then
lmfilename=`head -n 1 $tgtdir/perplexities.txt | cut -f 1 -d ' '`
else #exactly one 3gram LM
lmfilename=`head -n 2 $tgtdir/perplexities.txt | grep 3gram | cut -f 1 -d ' '`
fi
(cd $tgtdir; ln -sf `basename $lmfilename` $outlm )
| {
"pile_set_name": "Github"
} |
/**
* External dependencies
*/
var React = require( 'react' ),
sprintf = require( 'sprintf-js' ).sprintf;
/**
* Internal dependencies
*/
var config = require( '../config.js' ),
postClasses = require( './shared/post-classes.jsx' ),
editLink = require( './shared/edit-link.jsx' );
/**
*
*/
module.exports = React.createClass( {
mixins: [ postClasses, editLink ],
render: function() {
return (
<article id={ 'post-' + this.props.post.id } className={ this.postClasses() }>
<header className="entry-header">
<h1 className="entry-title">
{ this.props.post.title.rendered }
</h1>
</header>
<div className="entry-content" dangerouslySetInnerHTML={ { __html: this.props.post.content.rendered } } />
<footer className="entry-footer" dangerouslySetInnerHTML={ { __html: this.editLink() } } />
</article>
);
}
} );
| {
"pile_set_name": "Github"
} |
/*
The MIT License (MIT)
Copyright (c) wenjie.zhao
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "BleUtil.hpp"
#include <QLocale>
QString formatS_size(qint64 bytes)
{
/// According to the Si standard KB is 1000 bytes, KiB is 1024
/// but on windows sizes are calculated by dividing by 1024 so we do what they do.
const qint64 kb = 1024;
const qint64 mb = 1024 * kb;
const qint64 gb = 1024 * mb;
const qint64 tb = 1024 * gb;
if (bytes >= tb)
return QString(QObject::tr("%1 TB")).arg(QLocale().toString(qreal(bytes) / tb, 'f', 3));
if (bytes >= gb)
return QString(QObject::tr("%1 GB")).arg(QLocale().toString(qreal(bytes) / gb, 'f', 2));
if (bytes >= mb)
return QString(QObject::tr("%1 MB")).arg(QLocale().toString(qreal(bytes) / mb, 'f', 1));
if (bytes >= kb)
return QString(QObject::tr("%1 KB")).arg(QLocale().toString(bytes / kb));
return QString(QObject::tr("%1 B")).arg(QLocale().toString(bytes));
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_source_debit</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>listbox_source_debit</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>AccountingTransaction_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
| {
"pile_set_name": "Github"
} |
/* @theme: default; */
$product-view-desc-title-offset: 0 0 $offset-y-m 0;
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\programs\pkey\rsa_sign.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="mbedTLS.vcxproj">
<Project>{46cf2d25-6a36-4189-b59c-e4815388e554}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{10790F49-6887-AAB6-2D86-BCBD516F8D26}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>rsa_sign</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ShowProgress>NotSet</ShowProgress>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);mbedTLS.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>Debug</AdditionalLibraryDirectories>
</Link>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ShowProgress>NotSet</ShowProgress>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);mbedTLS.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>Debug</AdditionalLibraryDirectories>
</Link>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>Release</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);mbedTLS.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>Release</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies);</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
| {
"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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
| {
"pile_set_name": "Github"
} |
#language: fr
Fonctionnalité:
Contexte:
Étant donné je suis sur "/xml/feed.xml"
Scénario:
Alors le flux XML devrait être valide avec sa DTD
Scénario:
Alors le flux XML devrait être valide avec le XSD "tests/fixtures/www/xml/schema.xsd"
Scénario:
Alors le flux XML devrait être valide avec cette XSD :
"""
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="page">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string" />
<xs:element name="content" type="xs:string" />
<xs:element name="comment" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
"""
Scénario:
Alors le flux XML devrait être valide avec le schéma relax NG "tests/fixtures/www/xml/schema.ng"
Scénario:
Alors le flux XML devrait être valide avec ce schéma relax NG :
"""
<?xml version="1.0" encoding="UTF-8"?>
<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<element name="page">
<element name="title">
<data type="string"/>
</element>
<element name="content">
<data type="string"/>
</element>
<element name="comment">
<data type="string"/>
</element>
</element>
</start>
</grammar>
"""
Scénario:
Étant donné je suis sur "/xml/feed.atom"
Alors le flux atom devrait être valide
Scénario:
Étant donné je suis sur "/xml/feed.rss"
Alors le flux RSS2 devrait être valide
| {
"pile_set_name": "Github"
} |
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="test">
<content>
<span><children/></span>
</content>
</binding>
</bindings>
<script type="application/x-javascript">
function runTest() {
var div = document.getElementById("testDiv");
// First we have to make sure that we've looked up the primary frame for
// the previous child span. Appending text to it should do the trick.
div.firstChild.
appendChild(document.createTextNode("This is text in a div "));
// Now flush out reflow
document.body.offsetWidth;
var node = document.createElementNS("http://www.w3.org/1999/xhtml",
"span");
div.appendChild(node);
node.appendChild(document.createTextNode("This text should appear"));
}
</script>
</head>
<body onload="runTest()">
<div id="testDiv" style="width: 0; -moz-binding: url(#test)"><span></span></div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
# encoding: utf-8
import math
import torch as th
import torch
from torch import nn
class Bottleneck(nn.Module):
expansion = 4
def __init__(self, inplanes, planes, stride=1, downsample=None):
super(Bottleneck, self).__init__()
self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False)
self.bn1 = nn.BatchNorm2d(planes)
self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride,
padding=1, bias=False)
self.bn2 = nn.BatchNorm2d(planes)
self.conv3 = nn.Conv2d(planes, planes * 4, kernel_size=1, bias=False)
self.bn3 = nn.BatchNorm2d(planes * 4)
self.relu = nn.ReLU(inplace=True)
self.downsample = downsample
self.stride = stride
def forward(self, x):
residual = x
out = self.conv1(x)
out = self.bn1(out)
out = self.relu(out)
out = self.conv2(out)
out = self.bn2(out)
out = self.relu(out)
out = self.conv3(out)
out = self.bn3(out)
if self.downsample is not None:
residual = self.downsample(x)
out += residual
out = self.relu(out)
return out
class CBAM_Module(nn.Module):
def __init__(self, channels, reduction):
super(CBAM_Module, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.max_pool = nn.AdaptiveMaxPool2d(1)
self.fc1 = nn.Conv2d(channels, channels // reduction, kernel_size=1,
padding=0)
self.relu = nn.ReLU(inplace=True)
self.fc2 = nn.Conv2d(channels // reduction, channels, kernel_size=1,
padding=0)
self.sigmoid_channel = nn.Sigmoid()
self.conv_after_concat = nn.Conv2d(2, 1, kernel_size = 3, stride=1, padding = 1)
self.sigmoid_spatial = nn.Sigmoid()
def forward(self, x):
#channel attention
module_input = x
avg = self.avg_pool(x)
mx = self.max_pool(x)
avg = self.fc1(avg)
mx = self.fc1(mx)
avg = self.relu(avg)
mx = self.relu(mx)
avg = self.fc2(avg)
mx = self.fc2(mx)
x = avg + mx
x = self.sigmoid_channel(x)
x = module_input * x
#spatial attention
module_input = x
avg = torch.mean(x, 1, True)
mx, _ = torch.max(x, 1, True)
x = torch.cat((avg, mx), 1)
x = self.conv_after_concat(x)
x = self.sigmoid_spatial(x)
x = module_input * x
return x
class CBAMBottleneck(nn.Module):
expansion = 4
def __init__(self, inplanes, planes, stride=1, downsample=None):
super(CBAMBottleneck, self).__init__()
self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False)
self.bn1 = nn.BatchNorm2d(planes)
self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride,
padding=1, bias=False)
self.bn2 = nn.BatchNorm2d(planes)
self.conv3 = nn.Conv2d(planes, planes * 4, kernel_size=1, bias=False)
self.bn3 = nn.BatchNorm2d(planes * 4)
self.relu = nn.ReLU(inplace=True)
self.cbam = CBAM_Module(planes * 4, reduction=16)
self.downsample = downsample
self.stride = stride
def forward(self, x):
residual = x
out = self.conv1(x)
out = self.bn1(out)
out = self.relu(out)
out = self.conv2(out)
out = self.bn2(out)
out = self.relu(out)
out = self.conv3(out)
out = self.bn3(out)
out = self.cbam(out)
if self.downsample is not None:
residual = self.downsample(x)
out += residual
out = self.relu(out)
return out
def cbam_resnet50():
return ResNet(last_stride=1, block=CBAMBottleneck)
class ResNet(nn.Module):
def __init__(self, last_stride=2, block=Bottleneck, layers=[3, 4, 6, 3]):
self.inplanes = 64
super().__init__()
self.conv1 = nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3,
bias=False)
self.bn1 = nn.BatchNorm2d(64)
self.relu = nn.ReLU(inplace=True)
self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
self.layer1 = self._make_layer(block, 64, layers[0])
self.layer2 = self._make_layer(block, 128, layers[1], stride=2)
self.layer3 = self._make_layer(block, 256, layers[2], stride=2)
self.layer4 = self._make_layer(
block, 512, layers[3], stride=last_stride)
def _make_layer(self, block, planes, blocks, stride=1):
downsample = None
if stride != 1 or self.inplanes != planes * block.expansion:
downsample = nn.Sequential(
nn.Conv2d(self.inplanes, planes * block.expansion,
kernel_size=1, stride=stride, bias=False),
nn.BatchNorm2d(planes * block.expansion),
)
layers = []
layers.append(block(self.inplanes, planes, stride, downsample))
self.inplanes = planes * block.expansion
for i in range(1, blocks):
layers.append(block(self.inplanes, planes))
return nn.Sequential(*layers)
def forward(self, x):
x = self.conv1(x)
x = self.bn1(x)
x = self.relu(x)
x = self.maxpool(x)
x = self.layer1(x)
x = self.layer2(x)
x = self.layer3(x)
x = self.layer4(x)
return x
def load_param(self, param_dict):
for i in param_dict:
if 'fc' in i:
continue
self.state_dict()[i].copy_(param_dict[i])
def random_init(self):
for m in self.modules():
if isinstance(m, nn.Conv2d):
n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels
m.weight.data.normal_(0, math.sqrt(2. / n))
elif isinstance(m, nn.BatchNorm2d):
m.weight.data.fill_(1)
m.bias.data.zero_()
if __name__ == "__main__":
net = ResNet(last_stride=2)
import torch
x = net(torch.zeros(1, 3, 256, 128))
print(x.shape)
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2019, Blue Brain Project
# Cyrille Favreau <[email protected]>
#
# This file is part of Brayns <https://github.com/BlueBrain/Brayns>
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License version 3.0 as published
# by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# All rights reserved. Do not distribute without further notice.
"""Helper classes and functions"""
| {
"pile_set_name": "Github"
} |
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <limits.h>
#include "syscall.h"
char *ctermid(char *s)
{
static char s2[L_ctermid];
int fd;
if (!s) s = s2;
*s = 0;
fd = open("/dev/tty", O_WRONLY | O_NOCTTY | O_CLOEXEC);
if (fd >= 0) {
ttyname_r(fd, s, L_ctermid);
__syscall(SYS_close, fd);
}
return s;
}
| {
"pile_set_name": "Github"
} |
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Michael Sevakis
*
* Convert caps masks into HAVE_* defines
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
/** INPUTS **/
/* NOTE: Playback is implied in all this. Make sense? :) */
#define SRC_MIC 0
#define SRC_LINEIN 1
#define SRC_SPDIF 2
#define SRC_FMRADIO 3
#define SRC_CAP_MIC (1 << SRC_MIC)
#define SRC_CAP_LINEIN (1 << SRC_LINEIN)
#define SRC_CAP_SPDIF (1 << SRC_SPDIF)
#define SRC_CAP_FMRADIO (1 << SRC_FMRADIO)
/* audio monitor mux sources */
#ifndef INPUT_SRC_CAPS
#define INPUT_SRC_CAPS 0 /* Nothing but playback */
#endif
/* Microphone */
#if (INPUT_SRC_CAPS & SRC_CAP_MIC)
#define HAVE_MIC_IN
#define HAVE_MIC_IN_(...) __VA_ARGS__
#else
#define HAVE_MIC_IN_(...)
#endif
/* Line In */
#if (INPUT_SRC_CAPS & SRC_CAP_LINEIN)
#define HAVE_LINE_IN
#define HAVE_LINE_IN_(...) __VA_ARGS__
#else
#define HAVE_LINE_IN_(...)
#endif
/* S/PDIF */
#if (INPUT_SRC_CAPS & SRC_CAP_SPDIF)
#define HAVE_SPDIF_IN
#define HAVE_SPDIF_IN_(...) __VA_ARGS__
#else
#define HAVE_SPDIF_IN_(...)
#endif
/* FM Radio */
#if (INPUT_SRC_CAPS & SRC_CAP_FMRADIO)
#define HAVE_FMRADIO_IN
#define HAVE_FMRADIO_IN_(...) __VA_ARGS__
#else
#define HAVE_FMRADIO_IN_(...)
#endif
#if INPUT_SRC_CAPS != 0 && (INPUT_SRC_CAPS & (INPUT_SRC_CAPS-1)) != 0
#define HAVE_MULTI_INPUT_SRC
#endif
#ifdef HAVE_RECORDING
/* Recordable source implies it has the input as well */
/* For now there's no restrictions on any targets with which inputs
are recordable so define them as equivalent - if they do differ,
special handling is needed right now. */
#ifndef REC_SRC_CAPS
#define REC_SRC_CAPS INPUT_SRC_CAPS
#endif
/* Microphone */
#if (REC_SRC_CAPS & SRC_CAP_MIC)
#define HAVE_MIC_REC
#define HAVE_MIC_REC_(...) __VA_ARGS__
#else
#define HAVE_MIC_REC_(...)
#endif
/* Line In */
#if (REC_SRC_CAPS & SRC_CAP_LINEIN)
#define HAVE_LINE_REC
#define HAVE_LINE_REC_(...) __VA_ARGS__
#else
#define HAVE_LINE_REC_(...)
#endif
/* S/PDIF */
#if (REC_SRC_CAPS & SRC_CAP_SPDIF)
#define HAVE_SPDIF_REC
#define HAVE_SPDIF_REC_(...) __VA_ARGS__
#else
#define HAVE_SPDIF_REC_(...)
#endif
/* FM Radio */
#if (REC_SRC_CAPS & SRC_CAP_FMRADIO)
#define HAVE_FMRADIO_REC
#define HAVE_FMRADIO_REC_(...) __VA_ARGS__
#else
#define HAVE_FMRADIO_REC_(...)
#endif
#if REC_SRC_CAPS != 0 && (REC_SRC_CAPS & (REC_SRC_CAPS-1)) != 0
#define HAVE_MULTI_REC_SRC
#endif
#endif /* HAVE_RECORDING */
/* Samplerate config */
#define PCM_SAMPR_CONFIG_ONLY /* no C code */
#include "pcm_sampr.h"
#undef PCM_SAMPR_CONFIG_ONLY
#define PLAY_SAMPR_CAPS (HW_SAMPR_CAPS & (SAMPR_CAP_44 | SAMPR_CAP_48))
/**
* PLAY_SAMPR_MIN: The minimum allowable samplerate for global playback.
* Music won't play at a lower rate.
* PLAY_SAMPR_MAX: The maximum allowable samplerate for global playback.
* Music won't play at a faster rate.
* PLAY_SAMPR_DEFAULT: The default samplerate, unless configured otherwise.
* PLAY_SAMPR_HW_MIN: The minimum allowable rate for some subsystems such
* as the DSP core. DSP never exceeds *MAX to lessen
* buffer allocation demands and overhead.
*/
#if PLAY_SAMPR_CAPS & (PLAY_SAMPR_CAPS - 1)
#define HAVE_PLAY_FREQ
# define PLAY_SAMPR_MIN SAMPR_44
# define PLAY_SAMPR_MAX SAMPR_48
# define PLAY_SAMPR_DEFAULT SAMPR_44
# define PLAY_SAMPR_HW_MIN HW_SAMPR_MIN
#elif PLAY_SAMPR_CAPS & SAMPR_CAP_44
# define PLAY_SAMPR_MIN SAMPR_44
# define PLAY_SAMPR_MAX SAMPR_44
# define PLAY_SAMPR_DEFAULT SAMPR_44
# define PLAY_SAMPR_HW_MIN HW_SAMPR_MIN
#elif PLAY_SAMPR_CAPS & SAMPR_CAP_48
# define PLAY_SAMPR_MIN SAMPR_48
# define PLAY_SAMPR_MAX SAMPR_48
# define PLAY_SAMPR_DEFAULT SAMPR_48
# define PLAY_SAMPR_HW_MIN HW_SAMPR_MIN
#endif
| {
"pile_set_name": "Github"
} |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2014 Benoit Steiner <[email protected]>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include "main.h"
#include <Eigen/Core>
#include <Eigen/CXX11/Tensor>
using Eigen::MatrixXf;
using Eigen::Tensor;
static void test_simple()
{
MatrixXf m1(3,3);
MatrixXf m2(3,3);
m1.setRandom();
m2.setRandom();
TensorMap<Tensor<float, 2> > mat1(m1.data(), 3,3);
TensorMap<Tensor<float, 2> > mat2(m2.data(), 3,3);
Tensor<float, 2> mat3(3,3);
mat3 = mat1;
typedef Tensor<float, 1>::DimensionPair DimPair;
Eigen::array<DimPair, 1> dims;
dims[0] = DimPair(1, 0);
mat3 = mat3.contract(mat2, dims).eval();
VERIFY_IS_APPROX(mat3(0, 0), (m1*m2).eval()(0,0));
VERIFY_IS_APPROX(mat3(0, 1), (m1*m2).eval()(0,1));
VERIFY_IS_APPROX(mat3(0, 2), (m1*m2).eval()(0,2));
VERIFY_IS_APPROX(mat3(1, 0), (m1*m2).eval()(1,0));
VERIFY_IS_APPROX(mat3(1, 1), (m1*m2).eval()(1,1));
VERIFY_IS_APPROX(mat3(1, 2), (m1*m2).eval()(1,2));
VERIFY_IS_APPROX(mat3(2, 0), (m1*m2).eval()(2,0));
VERIFY_IS_APPROX(mat3(2, 1), (m1*m2).eval()(2,1));
VERIFY_IS_APPROX(mat3(2, 2), (m1*m2).eval()(2,2));
}
static void test_const()
{
MatrixXf input(3,3);
input.setRandom();
MatrixXf output = input;
output.rowwise() -= input.colwise().maxCoeff();
Eigen::array<int, 1> depth_dim;
depth_dim[0] = 0;
Tensor<float, 2>::Dimensions dims2d;
dims2d[0] = 1;
dims2d[1] = 3;
Eigen::array<int, 2> bcast;
bcast[0] = 3;
bcast[1] = 1;
const TensorMap<Tensor<const float, 2> > input_tensor(input.data(), 3, 3);
Tensor<float, 2> output_tensor= (input_tensor - input_tensor.maximum(depth_dim).eval().reshape(dims2d).broadcast(bcast));
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
VERIFY_IS_APPROX(output(i, j), output_tensor(i, j));
}
}
}
void test_cxx11_tensor_forced_eval()
{
CALL_SUBTEST(test_simple());
CALL_SUBTEST(test_const());
}
| {
"pile_set_name": "Github"
} |
a
{
text-decoration:none;
padding: 2px 4px 4px 6px;
display : block;
border-width: 1px;
border-style: solid;
margin : 0px;
}
a.cke_scayt_toogle:hover,
a.cke_scayt_toogle:focus,
a.cke_scayt_toogle:active
{
border-color: #316ac5;
background-color: #dff1ff;
color : #000;
cursor: pointer;
margin : 0px;
}
a.cke_scayt_toogle {
color : #316ac5;
border-color: #fff;
}
.scayt_enabled a.cke_scayt_item {
color : #316ac5;
border-color: #fff;
margin : 0px;
}
.scayt_disabled a.cke_scayt_item {
color : gray;
border-color : #fff;
}
.scayt_enabled a.cke_scayt_item:hover,
.scayt_enabled a.cke_scayt_item:focus,
.scayt_enabled a.cke_scayt_item:active
{
border-color: #316ac5;
background-color: #dff1ff;
color : #000;
cursor: pointer;
}
.scayt_disabled a.cke_scayt_item:hover,
.scayt_disabled a.cke_scayt_item:focus,
.scayt_disabled a.cke_scayt_item:active
{
border-color: gray;
background-color: #dff1ff;
color : gray;
cursor: no-drop;
}
.cke_scayt_set_on, .cke_scayt_set_off
{
display: none;
}
.scayt_enabled .cke_scayt_set_on
{
display: none;
}
.scayt_disabled .cke_scayt_set_on
{
display: inline;
}
.scayt_disabled .cke_scayt_set_off
{
display: none;
}
.scayt_enabled .cke_scayt_set_off
{
display: inline;
}
| {
"pile_set_name": "Github"
} |
diff -u binutils-2.17.50.0.17.oorig/ld/Makefile.am binutils-2.17.50.0.17/ld/Makefile.am
--- binutils-2.17.50.0.17.oorig/ld/Makefile.am 2007-06-18 19:29:29.000000000 +0200
+++ binutils-2.17.50.0.17/ld/Makefile.am 2007-06-25 10:00:36.000000000 +0200
@@ -18,7 +18,7 @@
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
EMUL = @EMUL@
EMULATION_OFILES = @EMULATION_OFILES@
diff -u binutils-2.17.50.0.17.oorig/ld/Makefile.in binutils-2.17.50.0.17/ld/Makefile.in
--- binutils-2.17.50.0.17.oorig/ld/Makefile.in 2007-06-18 19:29:29.000000000 +0200
+++ binutils-2.17.50.0.17/ld/Makefile.in 2007-06-25 10:00:36.000000000 +0200
@@ -287,7 +287,7 @@
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
INCDIR = $(BASEDIR)/include
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package org.graalvm.visualvm.sources;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.graalvm.visualvm.lib.profiler.api.ProfilerDialogs;
import org.graalvm.visualvm.lib.profiler.spi.java.GoToSourceProvider;
import org.graalvm.visualvm.sources.impl.SourceHandles;
import org.graalvm.visualvm.sources.impl.SourceRoots;
import org.graalvm.visualvm.sources.impl.SourceViewers;
import org.netbeans.api.options.OptionsDisplayer;
import org.openide.filesystems.FileObject;
import org.openide.util.Lookup;
import org.openide.util.NbBundle;
import org.openide.util.lookup.ServiceProvider;
/**
*
* @author Jiri Sedlacek
*/
@NbBundle.Messages({
"VisualVMGoToSource_NoSourceRootsCaption=Go To Source", // NOI18N
"VisualVMGoToSource_NoSourceRoots=<html><br><b>Source roots have not been defined yet.</b><br><br>Use Options | Sources | Definitions to define the directories or archives containing the sources.</html>", // NOI18N
"VisualVMGoToSource_ClassSourceNotFound=No source found for {0}", // NOI18N
"VisualVMGoToSource_MethodSourceNotFound=No source found for {0}.{1}", // NOI18N
"VisualVMGoToSource_OpenSourceFailed=Failed to open source for {0}" // NOI18N
})
final class VisualVMGoToSource {
private static final Logger LOGGER = Logger.getLogger(VisualVMGoToSource.class.getName());
private static boolean openSourceImpl(SourceHandle handle) {
try {
if (!SourceViewers.getSelectedViewer().open(handle))
ProfilerDialogs.displayError(Bundle.VisualVMGoToSource_OpenSourceFailed(SourceHandle.simpleUri(handle.getSourceUri())));
return true;
} catch (Throwable t) {
ProfilerDialogs.displayError(Bundle.VisualVMGoToSource_OpenSourceFailed(SourceHandle.simpleUri(handle.getSourceUri())));
LOGGER.log(Level.INFO, "Failed to open source " + handle.toString(), t); // NOI18N
return true;
} finally {
try { handle.close(); }
catch (Throwable t) { LOGGER.log(Level.INFO, "Failed to close source " + handle.toString(), t); } // NOI18N
}
}
@ServiceProvider(service=GoToSourceProvider.class)
public static final class Provider extends GoToSourceProvider {
@Override
public boolean openSource(Lookup.Provider project, String className, String methodName, String signature, int line) {
if (SourceRoots.getRoots().length == 0) {
ProfilerDialogs.displayWarning(Bundle.VisualVMGoToSource_NoSourceRoots(), Bundle.VisualVMGoToSource_NoSourceRootsCaption(), null);
OptionsDisplayer.getDefault().open("SourcesOptions"); // NOI18N
} else {
for (SourceHandleProvider provider : SourceHandles.registeredProviders()) {
SourceHandle handle = provider.createHandle(className, methodName, signature, line);
if (handle != null) return handle == SourceHandle.EMPTY ? true : openSourceImpl(handle);
}
if (methodName == null || methodName.isEmpty() || "*".equals(methodName)) { // NOI18N
ProfilerDialogs.displayError(Bundle.VisualVMGoToSource_ClassSourceNotFound(className));
} else {
ProfilerDialogs.displayError(Bundle.VisualVMGoToSource_MethodSourceNotFound(className, methodName));
}
}
return true;
}
@Override
public boolean openFile(FileObject srcFile, int offset) {
throw new UnsupportedOperationException("GoToSource: openFile not supported in VisualVM"); // NOI18N
}
}
}
| {
"pile_set_name": "Github"
} |
export GOPATH=$PROJECTS/go
export PATH="$GOPATH/bin:$PATH"
| {
"pile_set_name": "Github"
} |
package gokeepasslib
import (
"errors"
"github.com/tobischo/gokeepasslib/v3/crypto"
)
// Constant enumerator for the inner random stream ID
const (
NoStreamID uint32 = 0 // ID for non-protection
ARC4StreamID uint32 = 1 // ID for ARC4 protection, not implemented
SalsaStreamID uint32 = 2 // ID for Salsa20 protection
ChaChaStreamID uint32 = 3 // ID for ChaCha20 protection
)
// EncrypterManager is the manager to handle an Encrypter
type EncrypterManager struct {
Encrypter Encrypter
}
// Encrypter is responsible for database encrypting and decrypting
type Encrypter interface {
Decrypt(data []byte) []byte
Encrypt(data []byte) []byte
}
// StreamManager is the manager to handle a Stream
type StreamManager struct {
Stream Stream
}
// Stream is responsible for stream encrypting and decrypting of protected fields
type Stream interface {
Unpack(payload string) []byte
Pack(payload []byte) string
}
// NewEncrypterManager initialize a new EncrypterManager
func NewEncrypterManager(key []byte, iv []byte) (manager *EncrypterManager, err error) {
var encrypter Encrypter
manager = new(EncrypterManager)
switch len(iv) {
case 12:
// ChaCha20
encrypter, err = crypto.NewChaChaEncrypter(key, iv)
case 16:
// AES
encrypter, err = crypto.NewAESEncrypter(key, iv)
default:
return nil, ErrUnsupportedEncrypterType
}
manager.Encrypter = encrypter
return
}
// NewStreamManager initialize a new StreamManager
func NewStreamManager(id uint32, key []byte) (manager *StreamManager, err error) {
var stream Stream
manager = new(StreamManager)
switch id {
case NoStreamID:
stream = crypto.NewInsecureStream()
case SalsaStreamID:
stream, err = crypto.NewSalsaStream(key)
case ChaChaStreamID:
stream, err = crypto.NewChaChaStream(key)
default:
return nil, ErrUnsupportedStreamType
}
manager.Stream = stream
return
}
// Decrypt returns the decrypted data
func (em *EncrypterManager) Decrypt(data []byte) []byte {
return em.Encrypter.Decrypt(data)
}
// Encrypt returns the encrypted data
func (em *EncrypterManager) Encrypt(data []byte) []byte {
return em.Encrypter.Encrypt(data)
}
// Unpack returns the payload as unencrypted byte array
func (cs *StreamManager) Unpack(payload string) []byte {
return cs.Stream.Unpack(payload)
}
// Pack returns the payload as encrypted string
func (cs *StreamManager) Pack(payload []byte) string {
return cs.Stream.Pack(payload)
}
// UnlockProtectedGroups unlocks an array of protected groups
func (cs *StreamManager) UnlockProtectedGroups(gs []Group) {
for i := range gs { //For each top level group
cs.UnlockProtectedGroup(&gs[i])
}
}
// UnlockProtectedGroup unlocks a protected group
func (cs *StreamManager) UnlockProtectedGroup(g *Group) {
cs.UnlockProtectedEntries(g.Entries)
cs.UnlockProtectedGroups(g.Groups)
}
// UnlockProtectedEntries unlocks an array of protected entries
func (cs *StreamManager) UnlockProtectedEntries(e []Entry) {
for i := range e {
cs.UnlockProtectedEntry(&e[i])
}
}
// UnlockProtectedEntry unlocks a protected entry
func (cs *StreamManager) UnlockProtectedEntry(e *Entry) {
for i := range e.Values {
if bool(e.Values[i].Value.Protected.Bool) {
e.Values[i].Value.Content = string(cs.Unpack(e.Values[i].Value.Content))
}
}
for i := range e.Histories {
cs.UnlockProtectedEntries(e.Histories[i].Entries)
}
}
// LockProtectedGroups locks an array of unprotected groups
func (cs *StreamManager) LockProtectedGroups(gs []Group) {
for i := range gs {
cs.LockProtectedGroup(&gs[i])
}
}
// LockProtectedGroup locks an unprotected group
func (cs *StreamManager) LockProtectedGroup(g *Group) {
cs.LockProtectedEntries(g.Entries)
cs.LockProtectedGroups(g.Groups)
}
// LockProtectedEntries locks an array of unprotected entries
func (cs *StreamManager) LockProtectedEntries(es []Entry) {
for i := range es {
cs.LockProtectedEntry(&es[i])
}
}
// LockProtectedEntry locks an unprotected entry
func (cs *StreamManager) LockProtectedEntry(e *Entry) {
for i := range e.Values {
if bool(e.Values[i].Value.Protected.Bool) {
e.Values[i].Value.Content = cs.Pack([]byte(e.Values[i].Value.Content))
}
}
for i := range e.Histories {
cs.LockProtectedEntries(e.Histories[i].Entries)
}
}
// ErrUnsupportedEncrypterType is retured if no encrypter manager can be created
// due to an invalid length of EncryptionIV
var ErrUnsupportedEncrypterType = errors.New("Type of encrypter unsupported")
// ErrUnsupportedStreamType is retured if no stream manager can be created
// due to an unsupported InnerRandomStreamID value
var ErrUnsupportedStreamType = errors.New("Type of stream manager unsupported")
| {
"pile_set_name": "Github"
} |
/******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
*
******************************************************************************/
/*
The purpose of rtw_io.c
a. provides the API
b. provides the protocol engine
c. provides the software interface between caller and the hardware interface
Compiler Flag Option:
1. CONFIG_SDIO_HCI:
a. USE_SYNC_IRP: Only sync operations are provided.
b. USE_ASYNC_IRP:Both sync/async operations are provided.
2. CONFIG_USB_HCI:
a. USE_ASYNC_IRP: Both sync/async operations are provided.
3. CONFIG_CFIO_HCI:
b. USE_SYNC_IRP: Only sync operations are provided.
Only sync read/rtw_write_mem operations are provided.
[email protected]
*/
#define _RTW_IO_C_
#include <drv_types.h>
#include <hal_data.h>
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
#error "Shall be Linux or Windows, but not both!\n"
#endif
#ifdef CONFIG_SDIO_HCI
#define rtw_le16_to_cpu(val) val
#define rtw_le32_to_cpu(val) val
#define rtw_cpu_to_le16(val) val
#define rtw_cpu_to_le32(val) val
#else
#define rtw_le16_to_cpu(val) le16_to_cpu(val)
#define rtw_le32_to_cpu(val) le32_to_cpu(val)
#define rtw_cpu_to_le16(val) cpu_to_le16(val)
#define rtw_cpu_to_le32(val) cpu_to_le32(val)
#endif
u8 _rtw_read8(_adapter *adapter, u32 addr)
{
u8 r_val;
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
_func_enter_;
_read8 = pintfhdl->io_ops._read8;
r_val = _read8(pintfhdl, addr);
_func_exit_;
return r_val;
}
u16 _rtw_read16(_adapter *adapter, u32 addr)
{
u16 r_val;
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
_func_enter_;
_read16 = pintfhdl->io_ops._read16;
r_val = _read16(pintfhdl, addr);
_func_exit_;
return rtw_le16_to_cpu(r_val);
}
u32 _rtw_read32(_adapter *adapter, u32 addr)
{
u32 r_val;
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
_func_enter_;
_read32 = pintfhdl->io_ops._read32;
r_val = _read32(pintfhdl, addr);
_func_exit_;
return rtw_le32_to_cpu(r_val);
}
int _rtw_write8(_adapter *adapter, u32 addr, u8 val)
{
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
int ret;
_func_enter_;
_write8 = pintfhdl->io_ops._write8;
ret = _write8(pintfhdl, addr, val);
_func_exit_;
return RTW_STATUS_CODE(ret);
}
int _rtw_write16(_adapter *adapter, u32 addr, u16 val)
{
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
int ret;
_func_enter_;
_write16 = pintfhdl->io_ops._write16;
val = rtw_cpu_to_le16(val);
ret = _write16(pintfhdl, addr, val);
_func_exit_;
return RTW_STATUS_CODE(ret);
}
int _rtw_write32(_adapter *adapter, u32 addr, u32 val)
{
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
int ret;
_func_enter_;
_write32 = pintfhdl->io_ops._write32;
val = rtw_cpu_to_le32(val);
ret = _write32(pintfhdl, addr, val);
_func_exit_;
return RTW_STATUS_CODE(ret);
}
int _rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *pdata)
{
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = (struct intf_hdl*)(&(pio_priv->intf));
int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr,u32 length, u8 *pdata);
int ret;
_func_enter_;
_writeN = pintfhdl->io_ops._writeN;
ret = _writeN(pintfhdl, addr,length,pdata);
_func_exit_;
return RTW_STATUS_CODE(ret);
}
#ifdef CONFIG_SDIO_HCI
u8 _rtw_sd_f0_read8(_adapter *adapter, u32 addr)
{
u8 r_val = 0x00;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
u8 (*_sd_f0_read8)(struct intf_hdl *pintfhdl, u32 addr);
_func_enter_;
_sd_f0_read8 = pintfhdl->io_ops._sd_f0_read8;
if (_sd_f0_read8)
r_val = _sd_f0_read8(pintfhdl, addr);
else
DBG_871X_LEVEL(_drv_warning_, FUNC_ADPT_FMT" _sd_f0_read8 callback is NULL\n", FUNC_ADPT_ARG(adapter));
_func_exit_;
return r_val;
}
#ifdef CONFIG_SDIO_INDIRECT_ACCESS
u8 _rtw_sd_iread8(_adapter *adapter, u32 addr)
{
u8 r_val = 0x00;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
u8 (*_sd_iread8)(struct intf_hdl *pintfhdl, u32 addr);
_sd_iread8 = pintfhdl->io_ops._sd_iread8;
if (_sd_iread8)
r_val = _sd_iread8(pintfhdl, addr);
else
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iread8 callback is NULL\n", FUNC_ADPT_ARG(adapter));
return r_val;
}
u16 _rtw_sd_iread16(_adapter *adapter, u32 addr)
{
u16 r_val = 0x00;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
u16 (*_sd_iread16)(struct intf_hdl *pintfhdl, u32 addr);
_sd_iread16 = pintfhdl->io_ops._sd_iread16;
if (_sd_iread16)
r_val = _sd_iread16(pintfhdl, addr);
else
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iread16 callback is NULL\n", FUNC_ADPT_ARG(adapter));
return r_val;
}
u32 _rtw_sd_iread32(_adapter *adapter, u32 addr)
{
u32 r_val = 0x00;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
u32 (*_sd_iread32)(struct intf_hdl *pintfhdl, u32 addr);
_sd_iread32 = pintfhdl->io_ops._sd_iread32;
if (_sd_iread32)
r_val = _sd_iread32(pintfhdl, addr);
else
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iread32 callback is NULL\n", FUNC_ADPT_ARG(adapter));
return r_val;
}
int _rtw_sd_iwrite8(_adapter *adapter, u32 addr, u8 val)
{
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_sd_iwrite8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
int ret = -1;
_sd_iwrite8 = pintfhdl->io_ops._sd_iwrite8;
if (_sd_iwrite8)
ret = _sd_iwrite8(pintfhdl, addr, val);
else
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iwrite8 callback is NULL\n", FUNC_ADPT_ARG(adapter));
return RTW_STATUS_CODE(ret);
}
int _rtw_sd_iwrite16(_adapter *adapter, u32 addr, u16 val)
{
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_sd_iwrite16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
int ret = -1;
_sd_iwrite16 = pintfhdl->io_ops._sd_iwrite16;
if (_sd_iwrite16)
ret = _sd_iwrite16(pintfhdl, addr, val);
else
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iwrite16 callback is NULL\n", FUNC_ADPT_ARG(adapter));
return RTW_STATUS_CODE(ret);
}
int _rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val)
{
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_sd_iwrite32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
int ret = -1;
_sd_iwrite32 = pintfhdl->io_ops._sd_iwrite32;
if (_sd_iwrite32)
ret = _sd_iwrite32(pintfhdl, addr, val);
else
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iwrite32 callback is NULL\n", FUNC_ADPT_ARG(adapter));
return RTW_STATUS_CODE(ret);
}
#endif /* CONFIG_SDIO_INDIRECT_ACCESS */
#endif /* CONFIG_SDIO_HCI */
int _rtw_write8_async(_adapter *adapter, u32 addr, u8 val)
{
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_write8_async)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
int ret;
_func_enter_;
_write8_async = pintfhdl->io_ops._write8_async;
ret = _write8_async(pintfhdl, addr, val);
_func_exit_;
return RTW_STATUS_CODE(ret);
}
int _rtw_write16_async(_adapter *adapter, u32 addr, u16 val)
{
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
int ret;
_func_enter_;
_write16_async = pintfhdl->io_ops._write16_async;
val = rtw_cpu_to_le16(val);
ret = _write16_async(pintfhdl, addr, val);
_func_exit_;
return RTW_STATUS_CODE(ret);
}
int _rtw_write32_async(_adapter *adapter, u32 addr, u32 val)
{
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
int ret;
_func_enter_;
_write32_async = pintfhdl->io_ops._write32_async;
val = rtw_cpu_to_le32(val);
ret = _write32_async(pintfhdl, addr, val);
_func_exit_;
return RTW_STATUS_CODE(ret);
}
void _rtw_read_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
{
void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
_func_enter_;
if (RTW_CANNOT_RUN(adapter)) {
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_mem:bDriverStopped(%s) OR bSurpriseRemoved(%s)"
, rtw_is_drv_stopped(adapter)?"True":"False"
, rtw_is_surprise_removed(adapter)?"True":"False"));
return;
}
_read_mem = pintfhdl->io_ops._read_mem;
_read_mem(pintfhdl, addr, cnt, pmem);
_func_exit_;
}
void _rtw_write_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
{
void (*_write_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
_func_enter_;
_write_mem = pintfhdl->io_ops._write_mem;
_write_mem(pintfhdl, addr, cnt, pmem);
_func_exit_;
}
void _rtw_read_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
{
u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
_func_enter_;
if (RTW_CANNOT_RUN(adapter)) {
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_port:bDriverStopped(%s) OR bSurpriseRemoved(%s)"
, rtw_is_drv_stopped(adapter)?"True":"False"
, rtw_is_surprise_removed(adapter)?"True":"False"));
return;
}
_read_port = pintfhdl->io_ops._read_port;
_read_port(pintfhdl, addr, cnt, pmem);
_func_exit_;
}
void _rtw_read_port_cancel(_adapter *adapter)
{
void (*_read_port_cancel)(struct intf_hdl *pintfhdl);
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
_read_port_cancel = pintfhdl->io_ops._read_port_cancel;
RTW_DISABLE_FUNC(adapter, DF_RX_BIT);
if(_read_port_cancel)
_read_port_cancel(pintfhdl);
}
u32 _rtw_write_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
{
u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
u32 ret = _SUCCESS;
_func_enter_;
_write_port = pintfhdl->io_ops._write_port;
ret = _write_port(pintfhdl, addr, cnt, pmem);
_func_exit_;
return ret;
}
u32 _rtw_write_port_and_wait(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem, int timeout_ms)
{
int ret = _SUCCESS;
struct xmit_buf *pxmitbuf = (struct xmit_buf *)pmem;
struct submit_ctx sctx;
rtw_sctx_init(&sctx, timeout_ms);
pxmitbuf->sctx = &sctx;
ret = _rtw_write_port(adapter, addr, cnt, pmem);
if (ret == _SUCCESS)
ret = rtw_sctx_wait(&sctx, __func__);
return ret;
}
void _rtw_write_port_cancel(_adapter *adapter)
{
void (*_write_port_cancel)(struct intf_hdl *pintfhdl);
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
_write_port_cancel = pintfhdl->io_ops._write_port_cancel;
RTW_DISABLE_FUNC(adapter, DF_TX_BIT);
if(_write_port_cancel)
_write_port_cancel(pintfhdl);
}
int rtw_init_io_priv(_adapter *padapter, void (*set_intf_ops)(_adapter *padapter,struct _io_ops *pops))
{
struct io_priv *piopriv = &padapter->iopriv;
struct intf_hdl *pintf = &piopriv->intf;
if (set_intf_ops == NULL)
return _FAIL;
piopriv->padapter = padapter;
pintf->padapter = padapter;
pintf->pintf_dev = adapter_to_dvobj(padapter);
set_intf_ops(padapter,&pintf->io_ops);
return _SUCCESS;
}
/*
* Increase and check if the continual_io_error of this @param dvobjprive is larger than MAX_CONTINUAL_IO_ERR
* @return _TRUE:
* @return _FALSE:
*/
int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
{
int ret = _FALSE;
int value;
if( (value=ATOMIC_INC_RETURN(&dvobj->continual_io_error)) > MAX_CONTINUAL_IO_ERR) {
DBG_871X("[dvobj:%p][ERROR] continual_io_error:%d > %d\n", dvobj, value, MAX_CONTINUAL_IO_ERR);
ret = _TRUE;
} else {
//DBG_871X("[dvobj:%p] continual_io_error:%d\n", dvobj, value);
}
return ret;
}
/*
* Set the continual_io_error of this @param dvobjprive to 0
*/
void rtw_reset_continual_io_error(struct dvobj_priv *dvobj)
{
ATOMIC_SET(&dvobj->continual_io_error, 0);
}
#ifdef DBG_IO
u32 read_sniff_ranges[][2] = {
//{0x520, 0x523},
};
u32 write_sniff_ranges[][2] = {
//{0x520, 0x523},
//{0x4c, 0x4c},
};
int read_sniff_num = sizeof(read_sniff_ranges)/sizeof(u32)/2;
int write_sniff_num = sizeof(write_sniff_ranges)/sizeof(u32)/2;
bool match_read_sniff_ranges(u32 addr, u16 len)
{
int i;
for (i = 0; i<read_sniff_num; i++) {
if (addr + len > read_sniff_ranges[i][0] && addr <= read_sniff_ranges[i][1])
return _TRUE;
}
return _FALSE;
}
bool match_write_sniff_ranges(u32 addr, u16 len)
{
int i;
for (i = 0; i<write_sniff_num; i++) {
if (addr + len > write_sniff_ranges[i][0] && addr <= write_sniff_ranges[i][1])
return _TRUE;
}
return _FALSE;
}
u8 dbg_rtw_read8(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u8 val = _rtw_read8(adapter, addr);
if (match_read_sniff_ranges(addr, 1))
DBG_871X("DBG_IO %s:%d rtw_read8(0x%04x) return 0x%02x\n", caller, line, addr, val);
return val;
}
u16 dbg_rtw_read16(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u16 val = _rtw_read16(adapter, addr);
if (match_read_sniff_ranges(addr, 2))
DBG_871X("DBG_IO %s:%d rtw_read16(0x%04x) return 0x%04x\n", caller, line, addr, val);
return val;
}
u32 dbg_rtw_read32(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u32 val = _rtw_read32(adapter, addr);
if (match_read_sniff_ranges(addr, 4))
DBG_871X("DBG_IO %s:%d rtw_read32(0x%04x) return 0x%08x\n", caller, line, addr, val);
return val;
}
int dbg_rtw_write8(_adapter *adapter, u32 addr, u8 val, const char *caller, const int line)
{
if (match_write_sniff_ranges(addr, 1))
DBG_871X("DBG_IO %s:%d rtw_write8(0x%04x, 0x%02x)\n", caller, line, addr, val);
return _rtw_write8(adapter, addr, val);
}
int dbg_rtw_write16(_adapter *adapter, u32 addr, u16 val, const char *caller, const int line)
{
if (match_write_sniff_ranges(addr, 2))
DBG_871X("DBG_IO %s:%d rtw_write16(0x%04x, 0x%04x)\n", caller, line, addr, val);
return _rtw_write16(adapter, addr, val);
}
int dbg_rtw_write32(_adapter *adapter, u32 addr, u32 val, const char *caller, const int line)
{
if (match_write_sniff_ranges(addr, 4))
DBG_871X("DBG_IO %s:%d rtw_write32(0x%04x, 0x%08x)\n", caller, line, addr, val);
return _rtw_write32(adapter, addr, val);
}
int dbg_rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *data, const char *caller, const int line)
{
if (match_write_sniff_ranges(addr, length))
DBG_871X("DBG_IO %s:%d rtw_writeN(0x%04x, %u)\n", caller, line, addr, length);
return _rtw_writeN(adapter, addr, length, data);
}
#ifdef CONFIG_SDIO_HCI
u8 dbg_rtw_sd_f0_read8(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u8 val = _rtw_sd_f0_read8(adapter, addr);
#if 0
if (match_read_sniff_ranges(addr, 1))
DBG_871X("DBG_IO %s:%d rtw_sd_f0_read8(0x%04x) return 0x%02x\n", caller, line, addr, val);
#endif
return val;
}
#ifdef CONFIG_SDIO_INDIRECT_ACCESS
u8 dbg_rtw_sd_iread8(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u8 val = rtw_sd_iread8(adapter, addr);
if (match_read_sniff_ranges(addr, 1))
DBG_871X("DBG_IO %s:%d rtw_sd_iread8(0x%04x) return 0x%02x\n", caller, line, addr, val);
return val;
}
u16 dbg_rtw_sd_iread16(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u16 val = _rtw_sd_iread16(adapter, addr);
if (match_read_sniff_ranges(addr, 2))
DBG_871X("DBG_IO %s:%d rtw_sd_iread16(0x%04x) return 0x%04x\n", caller, line, addr, val);
return val;
}
u32 dbg_rtw_sd_iread32(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u32 val = _rtw_sd_iread32(adapter, addr);
if (match_read_sniff_ranges(addr, 4))
DBG_871X("DBG_IO %s:%d rtw_sd_iread32(0x%04x) return 0x%08x\n", caller, line, addr, val);
return val;
}
int dbg_rtw_sd_iwrite8(_adapter *adapter, u32 addr, u8 val, const char *caller, const int line)
{
if (match_write_sniff_ranges(addr, 1))
DBG_871X("DBG_IO %s:%d rtw_sd_iwrite8(0x%04x, 0x%02x)\n", caller, line, addr, val);
return _rtw_sd_iwrite8(adapter, addr, val);
}
int dbg_rtw_sd_iwrite16(_adapter *adapter, u32 addr, u16 val, const char *caller, const int line)
{
if (match_write_sniff_ranges(addr, 2))
DBG_871X("DBG_IO %s:%d rtw_sd_iwrite16(0x%04x, 0x%04x)\n", caller, line, addr, val);
return _rtw_sd_iwrite16(adapter, addr, val);
}
int dbg_rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val, const char *caller, const int line)
{
if (match_write_sniff_ranges(addr, 4))
DBG_871X("DBG_IO %s:%d rtw_sd_iwrite32(0x%04x, 0x%08x)\n", caller, line, addr, val);
return _rtw_sd_iwrite32(adapter, addr, val);
}
#endif /* CONFIG_SDIO_INDIRECT_ACCESS */
#endif /* CONFIG_SDIO_HCI */
#endif
| {
"pile_set_name": "Github"
} |
# Hey Emacs, this is a -*- makefile -*-
###############################################################################
# Makefile for the RES-Raven-Mega3290 project
###############################################################################
## General Flags
PROJECT = ravenlcd_3290
MCU = atmega3290
TARGET = $(PROJECT).elf
CC = avr-gcc
## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU)
COMMON += -DF_CPU=8000000UL
## Compile options common for all C compilation units.
CFLAGS = $(COMMON) $(CEXTRA)
CFLAGS += -D AVRGCC -Wall -gdwarf-2 -Os -fsigned-char
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
CFLAGS += -fshort-enums
## Assembly specific flags
ASMFLAGS = $(COMMON)
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf-2
## Linker flags
LDFLAGS = $(COMMON)
LDFLAGS += -Wl,-Map=$(PROJECT).map,--cref
## Intel Hex file production flags
HEX_FLASH_FLAGS = -j .text -j .data
HEX_EEPROM_FLAGS = -j .eeprom
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0
## Include Directories
INCLUDES =
## Objects that must be built in order to link
SRC = adc.c key.c lcd.c raven3290.c uart.c menu.c sleep.c beep.c temp.c timer.c
OBJECTS = $(SRC:.c=.o)
## Objects explicitly added by the user
LINKONLYOBJECTS =
## Build
all: $(TARGET) $(PROJECT).hex $(PROJECT).eep $(PROJECT).lss size
## Compile: create object files from C source files.
.c.o:
$(CC) $(INCLUDES) $(CFLAGS) -c $<
##Link
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
%.hex: $(TARGET)
avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@
%.eep: $(TARGET)
avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0
%.lss: $(TARGET)
avr-objdump -h -S $< > $@
size: ${TARGET}
@echo
@avr-size -C --mcu=${MCU} ${TARGET}
## Clean target
.PHONY: clean
clean:
-rm -rf $(OBJECTS) $(PROJECT).elf dep/* $(PROJECT).hex $(PROJECT).eep $(PROJECT).map $(PROJECT).lss
## Other dependencies
## In cygwin the /dep folder causes make to fail after the initial make.
## $make CYG=1 allows cleans and makes based on .c dependencies (but not .h)
ifndef CYG
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
endif
| {
"pile_set_name": "Github"
} |
17
17
17
15
14
14
14
14
14
16
16
15
15
16
17
17
17
16
16
17
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="pluginSchema"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="pluginSchema /data/capabilities/validate/pluginSchema.xsd">
<name>Uniquity</name>
<description>Check for uniqueness.</description>
<class>org.geotools.validation.attributes.UniquityValidation</class>
</plugin>
| {
"pile_set_name": "Github"
} |
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
<title>iron-a11y-announcer demo</title>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../../iron-demo-helpers/demo-snippet.html">
<link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html">
<link rel="import" href="../../paper-button/paper-button.html">
<link rel="import" href="x-announces.html">
<link rel="import" href="../iron-a11y-announcer.html">
<custom-style>
<style is="custom-style" include="demo-pages-shared-styles">
input {
margin-right: 20px;
}
</style>
</custom-style>
</head>
<body>
<div class="vertical-section-container centered">
<p><b>Note</b>: in order to hear the announcements, be sure to turn on your favorite screen reader!</p>
<h4>Announcer used directly on the main document</h4>
<demo-snippet>
<template>
<input id="input" value="Pizza is delicious">
<paper-button raised onclick="_announce()">Announce</paper-button>
<script>
window.addEventListener('WebComponentsReady', function() {
// Initialize the announcer.
Polymer.IronA11yAnnouncer.requestAvailability();
// Optional; for testing, set the mode to assertive to announce immediately.
Polymer.IronA11yAnnouncer.instance.mode = 'assertive';
});
function _announce() {
Polymer.IronA11yAnnouncer.instance.fire('iron-announce', {
text: input.value.trim()
}, {
bubbles: true
});
}
</script>
</template>
</demo-snippet>
<h4>Announcer used inside a custom element</h4>
<demo-snippet>
<template>
<x-announces message="Hello, my name is Ava"></x-announces>
<x-announces message="This true sentence is false."></x-announces>
<x-announces message="Are you paying attention?"></x-announces>
</template>
</demo-snippet>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_mail_channel
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server saas~12.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-12 11:32+0000\n"
"PO-Revision-Date: 2019-08-26 09:16+0000\n"
"Language-Team: Uighur (https://www.transifex.com/odoo/teams/41243/ug/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: ug\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
#: model_terms:ir.ui.view,arch_db:website_mail_channel.messages_short
msgid "- <i class=\"fa fa-calendar\" role=\"img\" aria-label=\"Date\" title=\"Date\"/>"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.messages_short
msgid ""
"- <i class=\"fa fa-paperclip\" role=\"img\" aria-label=\"Attachments\" "
"title=\"Attachments\"/>"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
msgid ""
"<i class=\"fa fa-arrow-left\" role=\"img\" aria-label=\"Previous message\" "
"title=\"Previous message\"/>"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
msgid ""
"<i class=\"fa fa-arrow-right\" role=\"img\" aria-label=\"Next message\" "
"title=\"Next message\"/>"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
msgid ""
"<i class=\"fa fa-chevron-down\" role=\"img\" aria-label=\"Show attachments\""
" title=\"Show attachments\"/>"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.messages_short
msgid ""
"<i class=\"fa fa-chevron-down\" role=\"img\" aria-label=\"Show replies\" "
"title=\"Show replies\"/>"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
msgid ""
"<i class=\"fa fa-chevron-right\" role=\"img\" aria-label=\"Hide "
"attachments\" title=\"Hide attachments\"/>"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.messages_short
msgid ""
"<i class=\"fa fa-chevron-right\" role=\"img\" aria-label=\"Hide replies\" "
"title=\"Hide replies\"/>"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_messages
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
msgid "<i class=\"fa fa-envelope-o\" role=\"img\" aria-label=\"Alias\" title=\"Alias\"/>"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
#: model_terms:ir.ui.view,arch_db:website_mail_channel.subscribe
msgid "<i class=\"fa fa-envelope-o\"/> send mail"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
#: model_terms:ir.ui.view,arch_db:website_mail_channel.subscribe
msgid "<i class=\"fa fa-file-o\"/> archives"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
msgid ""
"<i class=\"fa fa-fw fa-user\" role=\"img\" aria-label=\"Recipients\" "
"title=\"Recipients\"/>"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
#: model_terms:ir.ui.view,arch_db:website_mail_channel.subscribe
msgid "<i class=\"fa fa-times\"/> unsubscribe"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.subscribe
msgid "<span class=\"oe_snippet_thumbnail_title\">Discussion Group</span>"
msgstr ""
#. module: website_mail_channel
#: model:mail.template,body_html:website_mail_channel.mail_template_list_subscribe
msgid ""
"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;\"><tr><td align=\"center\">\n"
"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"590\" style=\"padding: 16px; background-color: white; color: #454748; border-collapse:separate;\">\n"
"<tbody>\n"
" <!-- HEADER -->\n"
" <tr>\n"
" <td align=\"center\" style=\"min-width: 590px;\">\n"
" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"590\" style=\"min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;\">\n"
" <tr><td valign=\"middle\">\n"
" <span style=\"font-size: 10px;\">Your Channel</span><br/>\n"
" <span style=\"font-size: 20px; font-weight: bold;\">${object.name}</span>\n"
" </td><td valign=\"middle\" align=\"right\">\n"
" <img src=\"/logo.png?company=${user.company_id.id}\" style=\"padding: 0px; margin: 0px; height: auto; width: 80px;\" alt=\"${user.company_id.name}\"/>\n"
" </td></tr>\n"
" <tr><td colspan=\"2\" style=\"text-align:center;\">\n"
" <hr width=\"100%\" style=\"background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin:16px 0px 16px 0px;\"/>\n"
" </td></tr>\n"
" </table>\n"
" </td>\n"
" </tr>\n"
" <!-- CONTENT -->\n"
" <tr>\n"
" <td align=\"center\" style=\"min-width: 590px;\">\n"
" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"590\" style=\"min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;\">\n"
" <tr><td valign=\"top\" style=\"font-size: 13px;\">\n"
" <div style=\"margin: 0px; padding: 0px;\">\n"
" Hello,<br/><br/>\n"
" You have requested to be subscribed to the mailing list <strong>${object.name}</strong>.\n"
" <br/><br/>\n"
" To confirm, please visit the following link: <strong><a href=\"${ctx['token_url']}\">${ctx['token_url']}</a></strong>\n"
" <br/><br/>\n"
" If this was a mistake or you did not requested this action, please ignore this message.\n"
" % if user.signature\n"
" <br/>\n"
" ${user.signature | safe}\n"
" % endif\n"
" </div>\n"
" </td></tr>\n"
" <tr><td style=\"text-align:center;\">\n"
" <hr width=\"100%\" style=\"background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;\"/>\n"
" </td></tr>\n"
" </table>\n"
" </td>\n"
" </tr>\n"
" <!-- FOOTER -->\n"
" <tr>\n"
" <td align=\"center\" style=\"min-width: 590px;\">\n"
" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"590\" style=\"min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;\">\n"
" <tr><td valign=\"middle\" align=\"left\">\n"
" ${user.company_id.name}\n"
" </td></tr>\n"
" <tr><td valign=\"middle\" align=\"left\" style=\"opacity: 0.7;\">\n"
" % if user.company_id.phone\n"
" ${user.company_id.phone} |\n"
" %endif\n"
" % if user.company_id.email\n"
" <a href=\"'mailto:%s' % ${user.company_id.email}\" style=\"text-decoration:none; color: #454748;\">${user.company_id.email}</a> |\n"
" % endif\n"
" % if user.company_id.website\n"
" <a href=\"'%s' % ${user.company_id.website}\" style=\"text-decoration:none; color: #454748;\">${user.company_id.website}\n"
" </a>\n"
" % endif\n"
" </td></tr>\n"
" </table>\n"
" </td>\n"
" </tr>\n"
"</tbody>\n"
"</table>\n"
"</td></tr>\n"
"<!-- POWERED BY -->\n"
"<tr><td align=\"center\" style=\"min-width: 590px;\">\n"
" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"590\" style=\"min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;\">\n"
" <tr><td style=\"text-align: center; font-size: 13px;\">\n"
" Powered by <a target=\"_blank\" href=\"https://www.odoo.com?utm_source=db&utm_medium=mail\" style=\"color: #875A7B;\">Odoo</a>\n"
" </td></tr>\n"
" </table>\n"
"</td></tr>\n"
"</table>\n"
" "
msgstr ""
#. module: website_mail_channel
#: model:mail.template,body_html:website_mail_channel.mail_template_list_unsubscribe
msgid ""
"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;\"><tr><td align=\"center\">\n"
"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"590\" style=\"padding: 16px; background-color: white; color: #454748; border-collapse:separate;\">\n"
"<tbody>\n"
" <!-- HEADER -->\n"
" <tr>\n"
" <td align=\"center\" style=\"min-width: 590px;\">\n"
" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"590\" style=\"min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;\">\n"
" <tr><td valign=\"middle\">\n"
" <span style=\"font-size: 10px;\">Your Channel</span><br/>\n"
" <span style=\"font-size: 20px; font-weight: bold;\">${object.name}</span>\n"
" </td><td valign=\"middle\" align=\"right\">\n"
" <img src=\"/logo.png?company=${user.company_id.id}\" style=\"padding: 0px; margin: 0px; height: auto; width: 80px;\" alt=\"${user.company_id.name}\"/>\n"
" </td></tr>\n"
" <tr><td colspan=\"2\" style=\"text-align:center;\">\n"
" <hr width=\"100%\" style=\"background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin:16px 0px 16px 0px;\"/>\n"
" </td></tr>\n"
" </table>\n"
" </td>\n"
" </tr>\n"
" <!-- CONTENT -->\n"
" <tr>\n"
" <td align=\"center\" style=\"min-width: 590px;\">\n"
" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"590\" style=\"min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;\">\n"
" <tr><td valign=\"top\" style=\"font-size: 13px;\">\n"
" <div style=\"margin: 0px; padding: 0px;\">\n"
" Hello,<br/><br/>\n"
" You have requested to be unsubscribed to the mailing list <strong>${object.name}</strong>.\n"
" <br/><br/>\n"
" To confirm, please visit the following link: <strong><a href=\"${ctx['token_url']}\">${ctx['token_url']}</a></strong>.\n"
" <br/><br/>\n"
" If this was a mistake or you did not requested this action, please ignore this message.\n"
" % if user.signature:\n"
" <br/>\n"
" ${user.signature | safe}\n"
" % endif\n"
" </div>\n"
" </td></tr>\n"
" <tr><td style=\"text-align:center;\">\n"
" <hr width=\"100%\" style=\"background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;\"/>\n"
" </td></tr>\n"
" </table>\n"
" </td>\n"
" </tr>\n"
" <!-- FOOTER -->\n"
" <tr>\n"
" <td align=\"center\" style=\"min-width: 590px;\">\n"
" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"590\" style=\"min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;\">\n"
" <tr><td valign=\"middle\" align=\"left\">\n"
" ${user.company_id.name}\n"
" </td></tr>\n"
" <tr><td valign=\"middle\" align=\"left\" style=\"opacity: 0.7;\">\n"
" % if user.company_id.phone\n"
" ${user.company_id.phone} |\n"
" %endif\n"
" % if user.company_id.email\n"
" <a href=\"'mailto:%s' % ${user.company_id.email}\" style=\"text-decoration:none; color: #454748;\">${user.company_id.email}</a> |\n"
" % endif\n"
" % if user.company_id.website\n"
" <a href=\"'%s' % ${user.company_id.website}\" style=\"text-decoration:none; color: #454748;\">${user.company_id.website}\n"
" </a>\n"
" % endif\n"
" </td></tr>\n"
" </table>\n"
" </td>\n"
" </tr>\n"
"</tbody>\n"
"</table>\n"
"</td></tr>\n"
"<!-- POWERED BY -->\n"
"<tr><td align=\"center\" style=\"min-width: 590px;\">\n"
" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"590\" style=\"min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;\">\n"
" <tr><td style=\"text-align: center; font-size: 13px;\">\n"
" Powered by <a target=\"_blank\" href=\"https://www.odoo.com?utm_source=db&utm_medium=mail\" style=\"color: #875A7B;\">Odoo</a>\n"
" </td></tr>\n"
" </table>\n"
"</td></tr>\n"
"</table>\n"
" "
msgstr ""
#. module: website_mail_channel
#. openerp-web
#: code:addons/website_mail_channel/static/src/js/website_mail_channel.editor.js:15
#, python-format
msgid "Add a Subscribe Button"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
msgid "Alone we can do so little, together we can do so much"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_messages
msgid "Archives"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
#: model_terms:ir.ui.view,arch_db:website_mail_channel.messages_short
msgid "Avatar"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
msgid "Browse archives"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_messages
msgid "By date"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_messages
msgid "By thread"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.subscribe
msgid "Change Discussion List"
msgstr ""
#. module: website_mail_channel
#: model:mail.template,subject:website_mail_channel.mail_template_list_subscribe
msgid "Confirm subscription to ${object.name}"
msgstr ""
#. module: website_mail_channel
#: model:mail.template,subject:website_mail_channel.mail_template_list_unsubscribe
msgid "Confirm unsubscription to ${object.name}"
msgstr ""
#. module: website_mail_channel
#: model:ir.model,name:website_mail_channel.model_mail_channel
msgid "Discussion Channel"
msgstr ""
#. module: website_mail_channel
#. openerp-web
#: code:addons/website_mail_channel/static/src/js/website_mail_channel.editor.js:16
#, python-format
msgid "Discussion List"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
msgid "Follow-Ups"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
msgid "Group"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.invalid_token_subscription
msgid "Invalid or expired confirmation link."
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_messages
#: model:website.menu,name:website_mail_channel.menu_mailing_list
msgid "Mailing Lists"
msgstr ""
#. module: website_mail_channel
#: code:addons/website_mail_channel/models/mail_mail.py:20
#, python-format
msgid "Mailing-List"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
msgid ""
"Need to unsubscribe? It's right here! <span class=\"fa fa-2x fa-arrow-down "
"float-right\" role=\"img\" aria-label=\"\" title=\"Read this !\"/>"
msgstr ""
#. module: website_mail_channel
#: model:ir.model,name:website_mail_channel.model_mail_mail
msgid "Outgoing Mails"
msgstr ""
#. module: website_mail_channel
#: code:addons/website_mail_channel/models/mail_mail.py:21
#, python-format
msgid "Post to"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
msgid "Reference"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
msgid "Stay in touch with our Community"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
#: model_terms:ir.ui.view,arch_db:website_mail_channel.subscribe
msgid "Subscribe"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.not_subscribed
msgid "The address"
msgstr ""
#. module: website_mail_channel
#: code:addons/website_mail_channel/controllers/main.py:245
#, python-format
msgid ""
"The address %s is already unsubscribed or was never subscribed to any "
"mailing list"
msgstr ""
#. module: website_mail_channel
#: code:addons/website_mail_channel/models/mail_mail.py:22
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
#, python-format
msgid "Unsubscribe"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.confirmation_subscription
msgid "You have been correctly"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.subscribe
msgid "a confirmation email has been sent."
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
msgid "attachments"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
#: model_terms:ir.ui.view,arch_db:website_mail_channel.messages_short
msgid "by"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.not_subscribed
msgid ""
"is already\n"
" unsubscribed or was never subscribed to the mailing\n"
" list, you may want to check that the address was\n"
" correct."
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_message
#: model_terms:ir.ui.view,arch_db:website_mail_channel.group_messages
msgid "mailing list archives"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
msgid ""
"members<br/>\n"
" <i class=\"fa fa-fw fa-envelope-o\" role=\"img\" aria-label=\"Traffic\" title=\"Traffic\"/>"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
msgid "messages / month"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.messages_short
msgid "more replies"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.messages_short
msgid "replies"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.messages_short
msgid "show"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.confirmation_subscription
msgid "subscribed"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.confirmation_subscription
msgid "to the mailing list."
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.confirmation_subscription
msgid "unsubscribed"
msgstr ""
#. module: website_mail_channel
#: model_terms:ir.ui.view,arch_db:website_mail_channel.mail_channels
#: model_terms:ir.ui.view,arch_db:website_mail_channel.subscribe
msgid "your email..."
msgstr ""
| {
"pile_set_name": "Github"
} |
#------------------------------------------------------------------------
# Copyright (c) 1997-2001 by Total Control Software
# All Rights Reserved
#------------------------------------------------------------------------
#
# Module Name: dbShelve.py
#
# Description: A reimplementation of the standard shelve.py that
# forces the use of cPickle, and DB.
#
# Creation Date: 11/3/97 3:39:04PM
#
# License: This is free software. You may use this software for any
# purpose including modification/redistribution, so long as
# this header remains intact and that you do not claim any
# rights of ownership or authorship of this software. This
# software has been tested, but no warranty is expressed or
# implied.
#
# 13-Dec-2000: Updated to be used with the new bsddb3 package.
# Added DBShelfCursor class.
#
#------------------------------------------------------------------------
"""Manage shelves of pickled objects using bsddb database files for the
storage.
"""
#------------------------------------------------------------------------
import sys
absolute_import = (sys.version_info[0] >= 3)
if absolute_import :
# Because this syntaxis is not valid before Python 2.5
exec("from . import db")
else :
import db
if sys.version_info[0] >= 3 :
import cPickle # Will be converted to "pickle" by "2to3"
else :
if sys.version_info < (2, 6) :
import cPickle
else :
# When we drop support for python 2.4
# we could use: (in 2.5 we need a __future__ statement)
#
# with warnings.catch_warnings():
# warnings.filterwarnings(...)
# ...
#
# We can not use "with" as is, because it would be invalid syntax
# in python 2.4 and (with no __future__) 2.5.
# Here we simulate "with" following PEP 343 :
import warnings
w = warnings.catch_warnings()
w.__enter__()
try :
warnings.filterwarnings('ignore',
message='the cPickle module has been removed in Python 3.0',
category=DeprecationWarning)
import cPickle
finally :
w.__exit__()
del w
HIGHEST_PROTOCOL = cPickle.HIGHEST_PROTOCOL
def _dumps(object, protocol):
return cPickle.dumps(object, protocol=protocol)
if sys.version_info < (2, 6) :
from UserDict import DictMixin as MutableMapping
else :
import collections
MutableMapping = collections.MutableMapping
#------------------------------------------------------------------------
def open(filename, flags=db.DB_CREATE, mode=0660, filetype=db.DB_HASH,
dbenv=None, dbname=None):
"""
A simple factory function for compatibility with the standard
shleve.py module. It can be used like this, where key is a string
and data is a pickleable object:
from bsddb import dbshelve
db = dbshelve.open(filename)
db[key] = data
db.close()
"""
if type(flags) == type(''):
sflag = flags
if sflag == 'r':
flags = db.DB_RDONLY
elif sflag == 'rw':
flags = 0
elif sflag == 'w':
flags = db.DB_CREATE
elif sflag == 'c':
flags = db.DB_CREATE
elif sflag == 'n':
flags = db.DB_TRUNCATE | db.DB_CREATE
else:
raise db.DBError, "flags should be one of 'r', 'w', 'c' or 'n' or use the bsddb.db.DB_* flags"
d = DBShelf(dbenv)
d.open(filename, dbname, filetype, flags, mode)
return d
#---------------------------------------------------------------------------
class DBShelveError(db.DBError): pass
class DBShelf(MutableMapping):
"""A shelf to hold pickled objects, built upon a bsddb DB object. It
automatically pickles/unpickles data objects going to/from the DB.
"""
def __init__(self, dbenv=None):
self.db = db.DB(dbenv)
self._closed = True
if HIGHEST_PROTOCOL:
self.protocol = HIGHEST_PROTOCOL
else:
self.protocol = 1
def __del__(self):
self.close()
def __getattr__(self, name):
"""Many methods we can just pass through to the DB object.
(See below)
"""
return getattr(self.db, name)
#-----------------------------------
# Dictionary access methods
def __len__(self):
return len(self.db)
def __getitem__(self, key):
data = self.db[key]
return cPickle.loads(data)
def __setitem__(self, key, value):
data = _dumps(value, self.protocol)
self.db[key] = data
def __delitem__(self, key):
del self.db[key]
def keys(self, txn=None):
if txn is not None:
return self.db.keys(txn)
else:
return self.db.keys()
if sys.version_info >= (2, 6) :
def __iter__(self) : # XXX: Load all keys in memory :-(
for k in self.db.keys() :
yield k
# Do this when "DB" support iteration
# Or is it enough to pass thru "getattr"?
#
# def __iter__(self) :
# return self.db.__iter__()
def open(self, *args, **kwargs):
self.db.open(*args, **kwargs)
self._closed = False
def close(self, *args, **kwargs):
self.db.close(*args, **kwargs)
self._closed = True
def __repr__(self):
if self._closed:
return '<DBShelf @ 0x%x - closed>' % (id(self))
else:
return repr(dict(self.iteritems()))
def items(self, txn=None):
if txn is not None:
items = self.db.items(txn)
else:
items = self.db.items()
newitems = []
for k, v in items:
newitems.append( (k, cPickle.loads(v)) )
return newitems
def values(self, txn=None):
if txn is not None:
values = self.db.values(txn)
else:
values = self.db.values()
return map(cPickle.loads, values)
#-----------------------------------
# Other methods
def __append(self, value, txn=None):
data = _dumps(value, self.protocol)
return self.db.append(data, txn)
def append(self, value, txn=None):
if self.get_type() == db.DB_RECNO:
return self.__append(value, txn=txn)
raise DBShelveError, "append() only supported when dbshelve opened with filetype=dbshelve.db.DB_RECNO"
def associate(self, secondaryDB, callback, flags=0):
def _shelf_callback(priKey, priData, realCallback=callback):
# Safe in Python 2.x because expresion short circuit
if sys.version_info[0] < 3 or isinstance(priData, bytes) :
data = cPickle.loads(priData)
else :
data = cPickle.loads(bytes(priData, "iso8859-1")) # 8 bits
return realCallback(priKey, data)
return self.db.associate(secondaryDB, _shelf_callback, flags)
#def get(self, key, default=None, txn=None, flags=0):
def get(self, *args, **kw):
# We do it with *args and **kw so if the default value wasn't
# given nothing is passed to the extension module. That way
# an exception can be raised if set_get_returns_none is turned
# off.
data = self.db.get(*args, **kw)
try:
return cPickle.loads(data)
except (EOFError, TypeError, cPickle.UnpicklingError):
return data # we may be getting the default value, or None,
# so it doesn't need unpickled.
def get_both(self, key, value, txn=None, flags=0):
data = _dumps(value, self.protocol)
data = self.db.get(key, data, txn, flags)
return cPickle.loads(data)
def cursor(self, txn=None, flags=0):
c = DBShelfCursor(self.db.cursor(txn, flags))
c.protocol = self.protocol
return c
def put(self, key, value, txn=None, flags=0):
data = _dumps(value, self.protocol)
return self.db.put(key, data, txn, flags)
def join(self, cursorList, flags=0):
raise NotImplementedError
#----------------------------------------------
# Methods allowed to pass-through to self.db
#
# close, delete, fd, get_byteswapped, get_type, has_key,
# key_range, open, remove, rename, stat, sync,
# upgrade, verify, and all set_* methods.
#---------------------------------------------------------------------------
class DBShelfCursor:
"""
"""
def __init__(self, cursor):
self.dbc = cursor
def __del__(self):
self.close()
def __getattr__(self, name):
"""Some methods we can just pass through to the cursor object. (See below)"""
return getattr(self.dbc, name)
#----------------------------------------------
def dup(self, flags=0):
c = DBShelfCursor(self.dbc.dup(flags))
c.protocol = self.protocol
return c
def put(self, key, value, flags=0):
data = _dumps(value, self.protocol)
return self.dbc.put(key, data, flags)
def get(self, *args):
count = len(args) # a method overloading hack
method = getattr(self, 'get_%d' % count)
method(*args)
def get_1(self, flags):
rec = self.dbc.get(flags)
return self._extract(rec)
def get_2(self, key, flags):
rec = self.dbc.get(key, flags)
return self._extract(rec)
def get_3(self, key, value, flags):
data = _dumps(value, self.protocol)
rec = self.dbc.get(key, flags)
return self._extract(rec)
def current(self, flags=0): return self.get_1(flags|db.DB_CURRENT)
def first(self, flags=0): return self.get_1(flags|db.DB_FIRST)
def last(self, flags=0): return self.get_1(flags|db.DB_LAST)
def next(self, flags=0): return self.get_1(flags|db.DB_NEXT)
def prev(self, flags=0): return self.get_1(flags|db.DB_PREV)
def consume(self, flags=0): return self.get_1(flags|db.DB_CONSUME)
def next_dup(self, flags=0): return self.get_1(flags|db.DB_NEXT_DUP)
def next_nodup(self, flags=0): return self.get_1(flags|db.DB_NEXT_NODUP)
def prev_nodup(self, flags=0): return self.get_1(flags|db.DB_PREV_NODUP)
def get_both(self, key, value, flags=0):
data = _dumps(value, self.protocol)
rec = self.dbc.get_both(key, flags)
return self._extract(rec)
def set(self, key, flags=0):
rec = self.dbc.set(key, flags)
return self._extract(rec)
def set_range(self, key, flags=0):
rec = self.dbc.set_range(key, flags)
return self._extract(rec)
def set_recno(self, recno, flags=0):
rec = self.dbc.set_recno(recno, flags)
return self._extract(rec)
set_both = get_both
def _extract(self, rec):
if rec is None:
return None
else:
key, data = rec
# Safe in Python 2.x because expresion short circuit
if sys.version_info[0] < 3 or isinstance(data, bytes) :
return key, cPickle.loads(data)
else :
return key, cPickle.loads(bytes(data, "iso8859-1")) # 8 bits
#----------------------------------------------
# Methods allowed to pass-through to self.dbc
#
# close, count, delete, get_recno, join_item
#---------------------------------------------------------------------------
| {
"pile_set_name": "Github"
} |
//============================================================================
// Copyright (c) 1996-2002 Winbond Electronic Corporation
//
// Module Name:
// Wb35Tx.c
//
// Abstract:
// Processing the Tx message and put into down layer
//
//============================================================================
#include <linux/usb.h>
#include <linux/gfp.h>
#include "wb35tx_f.h"
#include "mds_f.h"
unsigned char
Wb35Tx_get_tx_buffer(struct hw_data * pHwData, u8 **pBuffer)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
*pBuffer = pWb35Tx->TxBuffer[0];
return true;
}
static void Wb35Tx(struct wbsoft_priv *adapter);
static void Wb35Tx_complete(struct urb * pUrb)
{
struct wbsoft_priv *adapter = pUrb->context;
struct hw_data * pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
struct wb35_mds *pMds = &adapter->Mds;
printk("wb35: tx complete\n");
// Variable setting
pWb35Tx->EP4vm_state = VM_COMPLETED;
pWb35Tx->EP4VM_status = pUrb->status; //Store the last result of Irp
pMds->TxOwner[ pWb35Tx->TxSendIndex ] = 0;// Set the owner. Free the owner bit always.
pWb35Tx->TxSendIndex++;
pWb35Tx->TxSendIndex %= MAX_USB_TX_BUFFER_NUMBER;
if (pHwData->SurpriseRemove) // Let WbWlanHalt to handle surprise remove
goto error;
if (pWb35Tx->tx_halt)
goto error;
// The URB is completed, check the result
if (pWb35Tx->EP4VM_status != 0) {
printk("URB submission failed\n");
pWb35Tx->EP4vm_state = VM_STOP;
goto error;
}
Mds_Tx(adapter);
Wb35Tx(adapter);
return;
error:
atomic_dec(&pWb35Tx->TxFireCounter);
pWb35Tx->EP4vm_state = VM_STOP;
}
static void Wb35Tx(struct wbsoft_priv *adapter)
{
struct hw_data * pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
u8 *pTxBufferAddress;
struct wb35_mds *pMds = &adapter->Mds;
struct urb * pUrb = (struct urb *)pWb35Tx->Tx4Urb;
int retv;
u32 SendIndex;
if (pHwData->SurpriseRemove)
goto cleanup;
if (pWb35Tx->tx_halt)
goto cleanup;
// Ownership checking
SendIndex = pWb35Tx->TxSendIndex;
if (!pMds->TxOwner[SendIndex]) //No more data need to be sent, return immediately
goto cleanup;
pTxBufferAddress = pWb35Tx->TxBuffer[SendIndex];
//
// Issuing URB
//
usb_fill_bulk_urb(pUrb, pHwData->udev,
usb_sndbulkpipe(pHwData->udev, 4),
pTxBufferAddress, pMds->TxBufferSize[ SendIndex ],
Wb35Tx_complete, adapter);
pWb35Tx->EP4vm_state = VM_RUNNING;
retv = usb_submit_urb(pUrb, GFP_ATOMIC);
if (retv<0) {
printk("EP4 Tx Irp sending error\n");
goto cleanup;
}
// Check if driver needs issue Irp for EP2
pWb35Tx->TxFillCount += pMds->TxCountInBuffer[SendIndex];
if (pWb35Tx->TxFillCount > 12)
Wb35Tx_EP2VM_start(adapter);
pWb35Tx->ByteTransfer += pMds->TxBufferSize[SendIndex];
return;
cleanup:
pWb35Tx->EP4vm_state = VM_STOP;
atomic_dec(&pWb35Tx->TxFireCounter);
}
void Wb35Tx_start(struct wbsoft_priv *adapter)
{
struct hw_data * pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
// Allow only one thread to run into function
if (atomic_inc_return(&pWb35Tx->TxFireCounter) == 1) {
pWb35Tx->EP4vm_state = VM_RUNNING;
Wb35Tx(adapter);
} else
atomic_dec(&pWb35Tx->TxFireCounter);
}
unsigned char Wb35Tx_initial(struct hw_data * pHwData)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
pWb35Tx->Tx4Urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!pWb35Tx->Tx4Urb)
return false;
pWb35Tx->Tx2Urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!pWb35Tx->Tx2Urb)
{
usb_free_urb( pWb35Tx->Tx4Urb );
return false;
}
return true;
}
//======================================================
void Wb35Tx_stop(struct hw_data * pHwData)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
// Trying to canceling the Trp of EP2
if (pWb35Tx->EP2vm_state == VM_RUNNING)
usb_unlink_urb( pWb35Tx->Tx2Urb ); // Only use unlink, let Wb35Tx_destrot to free them
pr_debug("EP2 Tx stop\n");
// Trying to canceling the Irp of EP4
if (pWb35Tx->EP4vm_state == VM_RUNNING)
usb_unlink_urb( pWb35Tx->Tx4Urb ); // Only use unlink, let Wb35Tx_destrot to free them
pr_debug("EP4 Tx stop\n");
}
//======================================================
void Wb35Tx_destroy(struct hw_data * pHwData)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
// Wait for VM stop
do {
msleep(10); // Delay for waiting function enter 940623.1.a
} while( (pWb35Tx->EP2vm_state != VM_STOP) && (pWb35Tx->EP4vm_state != VM_STOP) );
msleep(10); // Delay for waiting function enter 940623.1.b
if (pWb35Tx->Tx4Urb)
usb_free_urb( pWb35Tx->Tx4Urb );
if (pWb35Tx->Tx2Urb)
usb_free_urb( pWb35Tx->Tx2Urb );
pr_debug("Wb35Tx_destroy OK\n");
}
void Wb35Tx_CurrentTime(struct wbsoft_priv *adapter, u32 TimeCount)
{
struct hw_data * pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
unsigned char Trigger = false;
if (pWb35Tx->TxTimer > TimeCount)
Trigger = true;
else if (TimeCount > (pWb35Tx->TxTimer+500))
Trigger = true;
if (Trigger) {
pWb35Tx->TxTimer = TimeCount;
Wb35Tx_EP2VM_start(adapter);
}
}
static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter);
static void Wb35Tx_EP2VM_complete(struct urb * pUrb)
{
struct wbsoft_priv *adapter = pUrb->context;
struct hw_data * pHwData = &adapter->sHwData;
struct T02_descriptor T02, TSTATUS;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
u32 * pltmp = (u32 *)pWb35Tx->EP2_buf;
u32 i;
u16 InterruptInLength;
// Variable setting
pWb35Tx->EP2vm_state = VM_COMPLETED;
pWb35Tx->EP2VM_status = pUrb->status;
// For Linux 2.4. Interrupt will always trigger
if (pHwData->SurpriseRemove) // Let WbWlanHalt to handle surprise remove
goto error;
if (pWb35Tx->tx_halt)
goto error;
//The Urb is completed, check the result
if (pWb35Tx->EP2VM_status != 0) {
printk("EP2 IoCompleteRoutine return error\n");
pWb35Tx->EP2vm_state= VM_STOP;
goto error;
}
// Update the Tx result
InterruptInLength = pUrb->actual_length;
// Modify for minimum memory access and DWORD alignment.
T02.value = cpu_to_le32(pltmp[0]) >> 8; // [31:8] -> [24:0]
InterruptInLength -= 1;// 20051221.1.c Modify the follow for more stable
InterruptInLength >>= 2; // InterruptInLength/4
for (i = 1; i <= InterruptInLength; i++) {
T02.value |= ((cpu_to_le32(pltmp[i]) & 0xff) << 24);
TSTATUS.value = T02.value; //20061009 anson's endian
Mds_SendComplete( adapter, &TSTATUS );
T02.value = cpu_to_le32(pltmp[i]) >> 8;
}
return;
error:
atomic_dec(&pWb35Tx->TxResultCount);
pWb35Tx->EP2vm_state = VM_STOP;
}
static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter)
{
struct hw_data * pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
struct urb * pUrb = (struct urb *)pWb35Tx->Tx2Urb;
u32 * pltmp = (u32 *)pWb35Tx->EP2_buf;
int retv;
if (pHwData->SurpriseRemove)
goto error;
if (pWb35Tx->tx_halt)
goto error;
//
// Issuing URB
//
usb_fill_int_urb( pUrb, pHwData->udev, usb_rcvintpipe(pHwData->udev,2),
pltmp, MAX_INTERRUPT_LENGTH, Wb35Tx_EP2VM_complete, adapter, 32);
pWb35Tx->EP2vm_state = VM_RUNNING;
retv = usb_submit_urb(pUrb, GFP_ATOMIC);
if (retv < 0) {
pr_debug("EP2 Tx Irp sending error\n");
goto error;
}
return;
error:
pWb35Tx->EP2vm_state = VM_STOP;
atomic_dec(&pWb35Tx->TxResultCount);
}
void Wb35Tx_EP2VM_start(struct wbsoft_priv *adapter)
{
struct hw_data * pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
// Allow only one thread to run into function
if (atomic_inc_return(&pWb35Tx->TxResultCount) == 1) {
pWb35Tx->EP2vm_state = VM_RUNNING;
Wb35Tx_EP2VM(adapter);
} else
atomic_dec(&pWb35Tx->TxResultCount);
}
| {
"pile_set_name": "Github"
} |
#ifndef __SOUND_PHASE_H
#define __SOUND_PHASE_H
/*
* ALSA driver for ICEnsemble ICE1712 (Envy24)
*
* Lowlevel functions for Terratec PHASE 22
*
* Copyright (c) 2005 Misha Zhilin <[email protected]>
*
* 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
*
*/
#define PHASE_DEVICE_DESC "{Terratec,Phase 22},"\
"{Terratec,Phase 28},"\
"{Terrasoniq,TS22},"
#define VT1724_SUBDEVICE_PHASE22 0x3b155011
#define VT1724_SUBDEVICE_PHASE28 0x3b154911
#define VT1724_SUBDEVICE_TS22 0x3b157b11
/* entry point */
extern struct snd_ice1712_card_info snd_vt1724_phase_cards[];
/* PHASE28 GPIO bits */
#define PHASE28_SPI_MISO (1 << 21)
#define PHASE28_WM_RESET (1 << 20)
#define PHASE28_SPI_CLK (1 << 19)
#define PHASE28_SPI_MOSI (1 << 18)
#define PHASE28_WM_RW (1 << 17)
#define PHASE28_AC97_RESET (1 << 16)
#define PHASE28_DIGITAL_SEL1 (1 << 15)
#define PHASE28_HP_SEL (1 << 14)
#define PHASE28_WM_CS (1 << 12)
#define PHASE28_AC97_COMMIT (1 << 11)
#define PHASE28_AC97_ADDR (1 << 10)
#define PHASE28_AC97_DATA_LOW (1 << 9)
#define PHASE28_AC97_DATA_HIGH (1 << 8)
#define PHASE28_AC97_DATA_MASK 0xFF
#endif /* __SOUND_PHASE */
| {
"pile_set_name": "Github"
} |
/*
* Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
*
* 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.maxkey.web;
/**
* Web Application Constants define.
*
* @author Crystal.Sea
*
*/
public class WebConstants {
public static final String USERNAME = "username";
public static final String REMOTE_USERNAME = "remote_username";
public static final String CURRENT_USER = "current_user";
public static final String CURRENT_USER_SESSION_ID = "current_user_session_id";
public static final String CURRENT_COMPANY = "current_user_company";
public static final String CURRENT_DEPARTMENT = "current_user_department";
public static final String CURRENT_USER_NAVIGATIONS = "current_user_navigations";
public static final String CURRENT_USER_ROLES = "current_user_roles";
public static final String CURRENT_USER_SYSTEM_ROLES = "current_user_system_roles";
public static final String CURRENT_LOGIN_USER_PASSWORD_SET_TYPE
= "current_login_user_password_set_type";
public static final String CURRENT_MESSAGE = "current_message";
// SPRING_SECURITY_SAVED_REQUEST
public static final String FIRST_SAVED_REQUEST_PARAMETER = "SPRING_SECURITY_SAVED_REQUEST";
public static final String KAPTCHA_SESSION_KEY = "kaptcha_session_key";
public static final String SINGLE_SIGN_ON_APP_ID = "single_sign_on_app_id";
public static final String REMEBER_ME_SESSION = "remeber_me_session";
public static final String KERBEROS_TOKEN_PARAMETER = "kerberosToken";
public static final String CAS_SERVICE_PARAMETER = "service";
public static final String KERBEROS_USERDOMAIN_PARAMETER = "kerberosUserDomain";
public static final String REMEBER_ME_COOKIE = "sign_in_remeber_me";
public static final String JWT_TOKEN_PARAMETER = "jwt";
public static final String CURRENT_SINGLESIGNON_URI = "current_singlesignon_uri";
public static final String AUTHENTICATION = "current_authentication";
public static final String THEME_COOKIE_NAME = "maxkey_theme";
public static final String LOGIN_ERROR_SESSION_MESSAGE = "login_error_session_message_key";
}
| {
"pile_set_name": "Github"
} |
"""
Using This Code Example
=========================
The code examples provided are provided by Daniel Greenfeld and Audrey Roy of
Two Scoops Press to help you reference Two Scoops of Django: Best Practices
for Django 1.8. Code samples follow PEP-0008, with exceptions made for the
purposes of improving book formatting. Example code is provided "as is", and
is not intended to be, and should not be considered or labeled as "tutorial code".
Permissions
============
In general, you may use the code we've provided with this book in your programs
and documentation. You do not need to contact us for permission unless you're
reproducing a significant portion of the code or using it in commercial
distributions. Examples:
* Writing a program that uses several chunks of code from this course does not require permission.
* Selling or distributing a digital package from material taken from this book does require permission.
* Answering a question by citing this book and quoting example code does not require permission.
* Incorporating a significant amount of example code from this book into your product's documentation does require permission.
Attributions usually include the title, author, publisher and an ISBN. For
example, "Two Scoops of Django: Best Practices for Django 1.8, by Daniel
Roy Greenfeld and Audrey Roy Greenfeld. Copyright 2015 Two Scoops Press (ISBN-WILL-GO-HERE)."
If you feel your use of code examples falls outside fair use of the permission
given here, please contact us at [email protected]."""
# flavors/test_api.py
import json
from django.core.urlresolvers import reverse
from django.test import TestCase
from flavors.models import Flavor
class DjangoRestFrameworkTests(TestCase):
def setUp(self):
Flavor.objects.get_or_create(title="title1", slug="slug1")
Flavor.objects.get_or_create(title="title2", slug="slug2")
self.create_read_url = reverse("flavor_rest_api")
self.read_update_delete_url = \
reverse("flavor_rest_api", kwargs={"slug": "slug1"})
def test_list(self):
response = self.client.get(self.create_read_url)
# Are both titles in the content?
self.assertContains(response, "title1")
self.assertContains(response, "title2")
def test_detail(self):
response = self.client.get(self.read_update_delete_url)
data = json.loads(response.content)
content = {"id": 1, "title": "title1", "slug": "slug1",
"scoops_remaining": 0}
self.assertEquals(data, content)
def test_create(self):
post = {"title": "title3", "slug": "slug3"}
response = self.client.post(self.create_read_url, post)
data = json.loads(response.content)
self.assertEquals(response.status_code, 201)
content = {"id": 3, "title": "title3", "slug": "slug3",
"scoops_remaining": 0}
self.assertEquals(data, content)
self.assertEquals(Flavor.objects.count(), 3)
def test_delete(self):
response = self.client.delete(self.read_update_delete_url)
self.assertEquals(response.status_code, 204)
self.assertEquals(Flavor.objects.count(), 1)
| {
"pile_set_name": "Github"
} |
---
id: dev
title: Craft.js - Build any page editor with React
---
You know a web application is fancy when it has a page editor. Without a doubt, a page editor helps boost user experience significantly. If you're a frontend developer and have been tasked to be build one before, then you know precisely the difficulties and challenges of building one.
Existing libraries such as Grape.js or react-page are great for a working out-of-the-box page editor solution. However, as soon as you need to customise the look and feel of the page editor itself, you will find yourself hacking in the library's code.
## Introducing Craft.js
Craft.js is a React framework to build any type of page editor. Instead of providing a working page editor implementation with a user interface, Craft.js provides an abstraction for you to implement your own page editor upon. It comes backed-in with an extensible drag-n-drop system which handles the way React elements should be rendered/updated, and a cohesive API to interact with the editor which you can additionally implement your own features on top of.
### TL;DR
- Design your own user interface for your page editor
- Write React components that end-user could edit
- Govern drag-and-drop conditions for your components
- Control how your components should be edited. From simple text fields to content editables and drag to resize; if you can do it in React, then you can do it with Craft.js.
## Editable React Components
Let's start with a simple Card component like this:
```jsx
const Card = ({title}) => {
return (
<div>
<h2>{title}</h2>
<div id="p-only">
<p>Hi</p>
</div>
</div>
)
}
```
First, to integrate it with with Craft.js' drag-and-drop system, we just need to do the following modifications:
```jsx
import {useNode} from "@craftjs/core";
const Card = ({title}) => {
const { connectors: { connect, drag } } = useNode();
return (
<div ref={dom => connect(drag(dom))}>
<h2>{title}</h2>
<div id="p-only">
<p>Hi</p>
</div>
</div>
)
}
```
What's happening here?
- We passed the `connect` connector to the root element of our component; this tells Craft.js that this element represents the `Card` component. Hence, the dimensions of the specified element will be taken into consideration during drag and drop events.
- Then, we also passed `drag` connector to the same root element; this adds the drag handlers to the DOM. If the component is rendered as the child of a `<Canvas />`, the user will be able to drag this element and it will move the entire Text component.
Next, we might want to be able to control the drag-n-drop rules of our Card component. For example, let's say we only want our Card component to be draggable as long as its `title` prop is not "No Drag". We can achieve this easily as such:
```jsx
const Card = () => {...}
Card.craft = {
rules: {
canDrag: (node) => node.data.props.title != "No Drag"
}
}
```
#### Droppable regions
Next, let's take a look at the `#p-only` element we specified in our Card component. What if we want this area to be droppable where only `p` can be dropped?
This is where the`<Canvas />` component provided by Craft.js becomes useful. It defines a droppable region where each of its immediate child is draggable.
```jsx
import {useNode, Canvas} from "@craftjs/core";
const Card = ({title}) => {
const { connectors: { connect, drag } } = useNode();
return (
<div ref={dom => connect(drag(dom))}>
<h2>{title}</h2>
<Canvas id="p-only">
<p>Hi</p>
</Canvas>
</div>
)
}
```
Your next question might be about how we control our newly created droppable region. The `<Canvas />` component accepts an `is` prop which can be either a HTML element or a React component (by default, it's a `div`). So, if we supply a React component, we can essentially achieve the same design flexibility as we have with our Card component:
```jsx
import {useNode, Canvas} from "@craftjs/core";
const Container = ({children}) => {
const { connectors: {connect} } = useNode();
return (
<div ref={dom => connect(dom)}>
{children}
</div>
)
}
Container.craft = {
rules: {
canMoveIn: (incomingNode) => incomingNode.data.type == "p"
}
}
const Card = ({title}) => {
const { connectors: { connect, drag } } = useNode();
return (
<div ref={dom => connect(drag(dom))}>
<h2>{title}</h2>
<Canvas id="p-only" is={Container}>
<p>Hi</p>
</Canvas>
</div>
)
}
```
Let's break this down a bit. Our `<Container />` component is being rendered as a droppable region. This means, all dropped elements will be rendered in the component's `children` prop. Next, we also specified the `connectors` just as we did previously. This time, we specified a `canMoveIn` rule where only elements with the `p` tag will be accepted into the component.
## Control editing behaviours
Of course, any page editor must allow the end-user to edit the elements that are rendered. With Craft.js, you are in control of this as well.
Let's make our `h2` element content editable so our users could visually edit the `title` prop:
```jsx
const Card = ({title}) => {
const { connectors: { connect, drag }, setProp } = useNode();
return (
<div ref={dom => connect(drag(dom))}>
<h2 contentEditable onKeyUp={e => setProp(e.target.innerText)}>{title}</h2>
...
</div>
)
}
```
> In a real application, you may want to consider using react-contenteditable
Obviously, we do not want the element to be content editable all the time; perhaps only when our Card component is actually clicked:
```jsx
const Card = ({title}) => {
const { connectors: { connect, drag }, setProp, isSelected } = useNode((node) => ({
isSelected: node.events.selected
}));
return (
<div ref={dom => connect(drag(dom))}>
<h2 contentEditable={isSelected} onKeyUp={e => setProp(e.target.innerText)}>{title}</h2>
...
</div>
)
}
```
What we are doing is essentially accessing Craft's internal state and retrieving information about the current instance of our Card component. In this case, we are retrieving the `selected` event state which returns `true` when the user clicks on the DOM specified by the `connect` connector of the Component.
## Your page editor, your user interface
Essentially, Craft.js exposes these few React components:
- `Editor` creates the Editor context and sets everything up
- `Frame` defines the editable area
As you may have noticed, none of these are UI components. Instead, they are intended to be plugged into any user interface you would like to implement for your page editor.
Let's take a look at a super simple interface that we could design:
```jsx
// pages/index.js
import React from 'react';
export default function App() {
return (
<>
<h2>My page editor</h2>
<Editor> {/* sets everything up */ }
<div>
<Frame> {/* This part is now editable */ }
<Canvas is="div" style={{background: "#eee"}}> { /* Creates a gray droppable div */ }
<h2>Drag me around</h2>
<p>I'm draggable too</h2>
<Canvas is="div"> {/* a div that is both droppable and draggable */}
<h2>Hi</h2> {/* a draggable h2 */}
</Canvas>
</Canvas>
</Frame>
</div>
</Editor>
</>
);
}
```
### Interacting with the editor
Your user interface will most likely need to display some information or perform certain editor-related actions.
Let's say we want to design a Toolbar component that does the following things:
- Tells us the the type of the currently selected element
- Has a button to save the current editor state
- Has another button to load the last saved editor state
```jsx
import React, {useState} from 'react';
export default function App() {
return (
<>
<h2>My page editor</h2>
<Editor>
<Toolbar /> {/* Add this */}
<div>
<Frame>
...
</Frame>
</div>
</Editor>
</>
);
}
const Toolbar = () => {
const [savedState, setSavedState] = useState();
const { selectedType, actions, query } = useEditor(state => {
const selectedId = state.events.selected;
return {
selectedType: selectedId && state.nodes[selectedId].data.type
}
});
return (
<div>
<h2>Currently selected: {selectedType} </h2>
<a onClick={() => {
const editorState = query.serialize();
setSavedState(editorState);
}}>Save checkpoint</a>
{
savedState ? (
<a onClick={() =>
actions.deserialize(editorState)
}>Load from checkpoint</a>
) : null
}
</div>
)
}
```
Let's break this down:
- First, we access the editor's state to retrieve the type of the currently selected element
- Then, when the "Save Checkpoint" button is clicked, we use the `serialize` query which tells the editor to return its state in a serialised JSON form. We then save the JSON output in our component's state
- Once we have the JSON, we display the "Load from checkpoint" button. When this button is clicked, we simply call the `deserialize` editor action which essentially returns the editor to the state stored in the JSON output.
## Closing words
This has been a high-level overview of Craft.js and we've only covered some very basic examples. We've seen how we could easily control almost every aspect of the page editor experience. Hopefully, this article has given you an idea on the possibilities of what you can do with Craft.js.
| {
"pile_set_name": "Github"
} |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <UIKit/UITableViewController.h>
@class NSArray, NSString;
@protocol _UIDocumentPickerOverviewDelegate;
__attribute__((visibility("hidden")))
@interface _UIDocumentPickerOverviewViewController : UITableViewController
{
_Bool _manage;
id <_UIDocumentPickerOverviewDelegate> _delegate;
NSArray *_allPickers;
NSString *_currentExtensionIdentifier;
NSArray *_auxiliaryOptions;
NSArray *_fileTypes;
unsigned long long _mode;
}
@property(nonatomic) _Bool manage; // @synthesize manage=_manage;
@property(nonatomic) unsigned long long mode; // @synthesize mode=_mode;
@property(retain, nonatomic) NSArray *fileTypes; // @synthesize fileTypes=_fileTypes;
@property(retain, nonatomic) NSArray *auxiliaryOptions; // @synthesize auxiliaryOptions=_auxiliaryOptions;
@property(retain, nonatomic) NSString *currentExtensionIdentifier; // @synthesize currentExtensionIdentifier=_currentExtensionIdentifier;
@property(retain, nonatomic) NSArray *allPickers; // @synthesize allPickers=_allPickers;
@property(nonatomic) __weak id <_UIDocumentPickerOverviewDelegate> delegate; // @synthesize delegate=_delegate;
- (void).cxx_destruct;
- (void)tableView:(id)arg1 didSelectRowAtIndexPath:(id)arg2;
- (void)tableView:(id)arg1 willDisplayCell:(id)arg2 forRowAtIndexPath:(id)arg3;
- (id)tableView:(id)arg1 cellForRowAtIndexPath:(id)arg2;
- (long long)tableView:(id)arg1 numberOfRowsInSection:(long long)arg2;
- (long long)numberOfSectionsInTableView:(id)arg1;
- (void)updatePreferredContentSize;
- (void)viewWillDisappear:(_Bool)arg1;
- (void)viewDidAppear:(_Bool)arg1;
- (void)viewWillAppear:(_Bool)arg1;
- (void)updateContents;
- (void)traitCollectionDidChange:(id)arg1;
- (id)initWithFileTypes:(id)arg1 mode:(unsigned long long)arg2 auxiliaryOptions:(id)arg3 includeManagementItem:(_Bool)arg4;
@end
| {
"pile_set_name": "Github"
} |
usr/lib/lib*.so.*
| {
"pile_set_name": "Github"
} |
/*
Copyright (c) 2012, The Cinder Project, All rights reserved.
This code is intended for use with the Cinder C++ library: http://libcinder.org
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.
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 HOLDER 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.
*/
#pragma once
#include "cinder/Stream.h"
#include "cinder/Vector.h"
#include "cinder/app/MouseEvent.h"
#include "cinder/app/KeyEvent.h"
#include "cinder/app/TouchEvent.h"
#include "cinder/app/Renderer.h"
#include "cinder/Display.h"
#include "cinder/app/Window.h"
#include <string>
#include <vector>
#include <list>
#include <windows.h>
#undef min
#undef max
// we declare all of the MultiTouch stuff in Win7 here to prevent requiring users to use the Win7 headers
#if ! defined( WM_TOUCH )
DECLARE_HANDLE(HTOUCHINPUT);
typedef struct tagTOUCHINPUT {
LONG x;
LONG y;
HANDLE hSource;
DWORD dwID;
DWORD dwFlags;
DWORD dwMask;
DWORD dwTime;
ULONG_PTR dwExtraInfo;
DWORD cxContact;
DWORD cyContact;
} TOUCHINPUT, *PTOUCHINPUT;
typedef TOUCHINPUT const * PCTOUCHINPUT;
#define TOUCH_COORD_TO_PIXEL(l) ((l) / 100)
#define WM_TOUCH 0x0240
#endif
namespace cinder { namespace app {
class AppImplMsw {
public:
AppImplMsw( class AppBase *aApp );
virtual ~AppImplMsw();
class AppBase* getApp() { return mApp; }
float getFrameRate() const { return mFrameRate; }
virtual void setFrameRate( float aFrameRate ) = 0;
virtual void quit() = 0;
virtual WindowRef getWindow() const { return mActiveWindow; }
void setWindow( WindowRef window ) { mActiveWindow = window; }
static void hideCursor();
static void showCursor();
static fs::path getOpenFilePath( const fs::path &initialPath, std::vector<std::string> extensions );
static fs::path getSaveFilePath( const fs::path &initialPath, std::vector<std::string> extensions );
static fs::path getFolderPath( const fs::path &initialPath );
protected:
bool setupHasBeenCalled() const { return mSetupHasBeenCalled; }
virtual void closeWindow( class WindowImplMsw *windowImpl ) = 0;
virtual void setForegroundWindow( WindowRef window ) = 0;
bool getHighDensityDisplayEnabled() const;
class AppBase *mApp;
float mFrameRate;
WindowRef mActiveWindow;
bool mSetupHasBeenCalled;
bool mHighDensityDispalyEnabled();
bool mNeedsToRefreshDisplays;
bool mActive;
ULONG_PTR mGdiplusToken;
friend class WindowImplMsw;
friend LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM );
};
class WindowImplMsw {
public:
WindowImplMsw( const Window::Format &format, RendererRef sharedRenderer, AppImplMsw *appImpl );
WindowImplMsw( HWND hwnd, RendererRef renderer, RendererRef sharedRenderer, AppImplMsw *appImpl );
virtual ~WindowImplMsw() {}
virtual bool isFullScreen() { return mFullScreen; }
virtual void setFullScreen( bool fullScreen, const app::FullScreenOptions &options );
virtual ivec2 getSize() const { return ivec2( toPoints( mWindowWidthPx ), toPoints( mWindowHeightPx ) ); }
virtual void setSize( const ivec2 &sizePoints );
virtual ivec2 getPos() const { return mWindowOffset; }
virtual void setPos( const ivec2 &pos );
virtual float getContentScale() const;
int toPoints( int pixels ) const { return (int)(pixels / getContentScale()); }
float toPoints( float pixels ) const { return pixels / getContentScale(); }
ivec2 toPixels( const ivec2& points ) { return ivec2( int(points.x * getContentScale()), int(points.y * getContentScale()) ); }
virtual void close();
virtual std::string getTitle() const;
virtual void setTitle( const std::string &title );
virtual void hide();
virtual void show();
virtual bool isHidden() const;
virtual DisplayRef getDisplay() const { return mDisplay; }
virtual RendererRef getRenderer() const { return mRenderer; }
virtual const std::vector<TouchEvent::Touch>& getActiveTouches() const { return mActiveTouches; }
virtual void* getNative() { return mWnd; }
void enableMultiTouch();
bool isBorderless() const { return mBorderless; }
void setBorderless( bool borderless );
bool isAlwaysOnTop() const { return mAlwaysOnTop; }
void setAlwaysOnTop( bool alwaysOnTop );
AppImplMsw* getAppImpl() { return mAppImpl; }
WindowRef getWindow() { return mWindowRef; }
virtual void keyDown( const KeyEvent &event );
virtual void draw();
virtual void redraw();
virtual void resize();
HWND getHwnd() const { return mWnd; }
HDC getDc() const { return mDC; }
void privateClose();
protected:
//! Sets 'mWindowStyle' and 'mWindowExStyle' based on 'mFullScreen' and 'mBorderless'
void setWindowStyleValues();
void createWindow( const ivec2 &windowSize, const std::string &title, DisplayRef display, RendererRef sharedRenderer );
void completeCreation();
static void registerWindowClass();
void getScreenSize( int clientWidth, int clientHeight, int *resultWidth, int *resultHeight );
void onTouch( HWND hWnd, WPARAM wParam, LPARAM lParam );
virtual void toggleFullScreen( const app::FullScreenOptions &options );
AppImplMsw *mAppImpl;
WindowRef mWindowRef;
HWND mWnd;
HDC mDC;
DWORD mWindowStyle, mWindowExStyle;
ivec2 mWindowOffset;
bool mHidden;
int mWindowWidthPx, mWindowHeightPx;
bool mFullScreen, mBorderless, mAlwaysOnTop, mResizable;
ivec2 mWindowedPos, mWindowedSizePx;
DisplayRef mDisplay;
RendererRef mRenderer;
std::map<DWORD,vec2> mMultiTouchPrev;
std::vector<TouchEvent::Touch> mActiveTouches;
bool mIsDragging;
friend AppImplMsw;
friend LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM );
};
typedef std::shared_ptr<class BlankingWindow> BlankingWindowRef;
class BlankingWindow {
public:
static BlankingWindowRef create( DisplayRef display ) { return BlankingWindowRef( new BlankingWindow( display ) ); }
BlankingWindow( DisplayRef display );
void destroy();
protected:
static void registerWindowClass();
HWND mWnd;
};
} } // namespace cinder::app | {
"pile_set_name": "Github"
} |
//=========================================================================
// FILENAME : tagutils-wav.c
// DESCRIPTION : WAV metadata reader
//=========================================================================
// Copyright (c) 2009 NETGEAR, Inc. All Rights Reserved.
// based on software from Ron Pedde's FireFly Media Server project
//=========================================================================
/*
* 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, see <http://www.gnu.org/licenses/>.
*/
#define GET_WAV_INT32(p) ((((uint8_t)((p)[3])) << 24) | \
(((uint8_t)((p)[2])) << 16) | \
(((uint8_t)((p)[1])) << 8) | \
(((uint8_t)((p)[0]))))
#define GET_WAV_INT16(p) ((((uint8_t)((p)[1])) << 8) | \
(((uint8_t)((p)[0]))))
static int
_get_wavtags(char *filename, struct song_metadata *psong)
{
int fd;
uint32_t len;
unsigned char hdr[12];
unsigned char fmt[16];
//uint32_t chunk_data_length;
uint32_t format_data_length = 0;
uint32_t compression_code = 0;
uint32_t channel_count = 0;
uint32_t sample_rate = 0;
uint32_t sample_bit_length = 0;
uint32_t bit_rate;
uint32_t data_length = 0;
uint32_t sec, ms;
uint32_t current_offset;
uint32_t block_len;
//DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Getting WAV file info\n");
if(!(fd = open(filename, O_RDONLY)))
{
DPRINTF(E_WARN, L_SCANNER, "Could not create file handle\n");
return -1;
}
len = 12;
if(!(len = read(fd, hdr, len)) || (len != 12))
{
DPRINTF(E_WARN, L_SCANNER, "Could not read wav header from %s\n", filename);
close(fd);
return -1;
}
/* I've found some wav files that have INFO tags
* in them... */
if(strncmp((char*)hdr + 0, "RIFF", 4) ||
strncmp((char*)hdr + 8, "WAVE", 4))
{
DPRINTF(E_WARN, L_SCANNER, "Invalid wav header in %s\n", filename);
close(fd);
return -1;
}
//chunk_data_length = GET_WAV_INT32(hdr + 4);
/* now, walk through the chunks */
current_offset = 12;
while(current_offset + 8 < psong->file_size)
{
len = 8;
if(!(len = read(fd, hdr, len)) || (len != 8))
{
close(fd);
DPRINTF(E_WARN, L_SCANNER, "Error reading block: %s\n", filename);
return -1;
}
current_offset += 8;
block_len = GET_WAV_INT32(hdr + 4);
//DEBUG DPRINTF(E_DEBUG, L_SCANNER, "Read block %02x%02x%02x%02x (%c%c%c%c) of "
// "size 0x%08x\n",hdr[0],hdr[1],hdr[2],hdr[3],
// isprint(hdr[0]) ? hdr[0] : '?',
// isprint(hdr[1]) ? hdr[1] : '?',
// isprint(hdr[2]) ? hdr[2] : '?',
// isprint(hdr[3]) ? hdr[3] : '?',
// block_len);
if(block_len < 0)
{
close(fd);
DPRINTF(E_WARN, L_SCANNER, "Bad block len: %s\n", filename);
return -1;
}
if(strncmp((char*)&hdr, "fmt ", 4) == 0)
{
//DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Found 'fmt ' header\n");
len = 16;
if(!read(fd, fmt, len) || (len != 16))
{
close(fd);
DPRINTF(E_WARN, L_SCANNER, "Bad .wav file: can't read fmt: %s\n",
filename);
return -1;
}
format_data_length = block_len;
compression_code = GET_WAV_INT16(fmt);
channel_count = GET_WAV_INT16(fmt + 2);
sample_rate = GET_WAV_INT32(fmt + 4);
sample_bit_length = GET_WAV_INT16(fmt + 14);
//DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Compression code: %d\n",compression_code);
//DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Channel count: %d\n",channel_count);
//DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Sample Rate: %d\n",sample_rate);
//DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Sample bit length %d\n",sample_bit_length);
}
else if(strncmp((char*)&hdr, "data", 4) == 0)
{
//DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Found 'data' header\n");
data_length = block_len;
goto next_block;
}
else if(strncmp((char*)&hdr, "LIST", 4) == 0)
{
char *tags;
char *p;
int off;
uint32_t taglen;
char **m;
len = GET_WAV_INT32(hdr + 4);
if(len > 65536 || len < 9)
goto next_block;
tags = malloc(len+1);
if(!tags)
goto next_block;
if(read(fd, tags, len) < len ||
strncmp(tags, "INFO", 4) != 0)
{
free(tags);
goto next_block;
}
tags[len] = '\0';
off = 4;
p = tags + off;
while(off < len - 8)
{
taglen = GET_WAV_INT32(p + 4);
//DEBUG DPRINTF(E_DEBUG, L_SCANNER, "%.*s: %.*s (%d)\n", 4, p, taglen, p + 8, taglen);
m = NULL;
if (taglen > 2048) {
DPRINTF(E_WARN, L_SCANNER, "Ignoring long tag [%.*s] in %s\n",
4, p+8, filename);
}
else if(strncmp(p, "INAM", 4) == 0)
m = &(psong->title);
else if(strncmp(p, "IALB", 4) == 0 ||
strncmp(p, "IPRD", 4) == 0)
m = &(psong->album);
else if(strncmp(p, "IGRE", 4) == 0 ||
strncmp(p, "IGNR", 4) == 0)
m = &(psong->genre);
else if(strncmp(p, "ICMT", 4) == 0)
m = &(psong->comment);
else if(strncmp(p, "IART", 4) == 0)
m = &(psong->contributor[ROLE_TRACKARTIST]);
else if(strncmp(p, "IAAR", 4) == 0)
m = &(psong->contributor[ROLE_ALBUMARTIST]);
else if(strncmp(p, "ICOM", 4) == 0 ||
strncmp(p, "IMUS", 4) == 0)
m = &(psong->contributor[ROLE_COMPOSER]);
else if(strncasecmp(p, "ITRK", 4) == 0)
psong->track = atoi(p + 8);
else if(strncmp(p, "ICRD", 4) == 0 ||
strncmp(p, "IYER", 4) == 0)
psong->year = atoi(p + 8);
if(m)
{
*m = malloc(taglen + 1);
strncpy(*m, p + 8, taglen);
(*m)[taglen] = '\0';
}
p += taglen + 8;
off += taglen + 8;
/* Handle some common WAV file malformations */
while (*p == '\0') {
p++;
off++;
}
}
free(tags);
}
next_block:
lseek(fd, current_offset + block_len, SEEK_SET);
current_offset += block_len;
}
close(fd);
if(((format_data_length != 16) && (format_data_length != 18)) ||
(compression_code != 1) ||
(channel_count < 1))
{
DPRINTF(E_WARN, L_SCANNER, "Invalid wav header in %s\n", filename);
return -1;
}
if( !data_length )
data_length = psong->file_size - 44;
bit_rate = sample_rate * channel_count * ((sample_bit_length + 7) / 8) * 8;
psong->bitrate = bit_rate;
psong->samplerate = sample_rate;
psong->channels = channel_count;
//DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Data length: %d\n", data_length);
sec = data_length / (bit_rate / 8);
ms = ((data_length % (bit_rate / 8)) * 1000) / (bit_rate / 8);
psong->song_length = (sec * 1000) + ms;
//DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Song length: %d\n", psong->song_length);
//DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Bit rate: %d\n", psong->bitrate);
/* Upon further review, WAV files should be little-endian, and DLNA requires the LPCM profile to be big-endian.
asprintf(&(psong->mime), "audio/L16;rate=%d;channels=%d", psong->samplerate, psong->channels);
*/
return 0;
}
static int
_get_wavfileinfo(char *filename, struct song_metadata *psong)
{
psong->lossless = 1;
/* Upon further review, WAV files should be little-endian, and DLNA requires the LPCM profile to be big-endian.
asprintf(&(psong->dlna_pn), "LPCM");
*/
return 0;
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2009 Francisco Jerez.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include "nouveau_driver.h"
#include "nouveau_context.h"
#include "nouveau_fbo.h"
#include "nouveau_util.h"
#include "nv_object.xml.h"
#include "nv10_3d.xml.h"
#include "nv10_driver.h"
static inline unsigned
get_rt_format(mesa_format format)
{
switch (format) {
case MESA_FORMAT_B8G8R8X8_UNORM:
return NV10_3D_RT_FORMAT_COLOR_X8R8G8B8;
case MESA_FORMAT_B8G8R8A8_UNORM:
return NV10_3D_RT_FORMAT_COLOR_A8R8G8B8;
case MESA_FORMAT_B5G6R5_UNORM:
return NV10_3D_RT_FORMAT_COLOR_R5G6B5;
case MESA_FORMAT_Z_UNORM16:
return NV10_3D_RT_FORMAT_DEPTH_Z16;
case MESA_FORMAT_S8_UINT_Z24_UNORM:
return NV10_3D_RT_FORMAT_DEPTH_Z24S8;
default:
assert(0);
}
}
static void
setup_hierz_buffer(struct gl_context *ctx)
{
struct nouveau_pushbuf *push = context_push(ctx);
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct nouveau_framebuffer *nfb = to_nouveau_framebuffer(fb);
unsigned pitch = align(fb->Width, 128),
height = align(fb->Height, 2),
size = pitch * height;
if (!nfb->hierz.bo || nfb->hierz.bo->size != size) {
union nouveau_bo_config config = {
.nv04.surf_flags = NV04_BO_ZETA,
.nv04.surf_pitch = 0
};
nouveau_bo_ref(NULL, &nfb->hierz.bo);
nouveau_bo_new(context_dev(ctx), NOUVEAU_BO_VRAM, 0, size,
&config, &nfb->hierz.bo);
}
PUSH_SPACE(push, 11);
BEGIN_NV04(push, NV17_3D(HIERZ_OFFSET), 1);
PUSH_MTHDl(push, NV17_3D(HIERZ_OFFSET), BUFCTX_FB,
nfb->hierz.bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR);
BEGIN_NV04(push, NV17_3D(HIERZ_WINDOW_X), 4);
PUSH_DATAf(push, - 1792);
PUSH_DATAf(push, - 2304 + fb->Height);
PUSH_DATAf(push, fb->_DepthMaxF / 2);
PUSH_DATAf(push, 0);
BEGIN_NV04(push, NV17_3D(HIERZ_PITCH), 1);
PUSH_DATA (push, pitch);
BEGIN_NV04(push, NV17_3D(HIERZ_ENABLE), 1);
PUSH_DATA (push, 1);
}
void
nv10_emit_framebuffer(struct gl_context *ctx, int emit)
{
struct nouveau_pushbuf *push = context_push(ctx);
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct nouveau_surface *s;
unsigned rt_format = NV10_3D_RT_FORMAT_TYPE_LINEAR;
unsigned rt_pitch = 0, zeta_pitch = 0;
unsigned bo_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR;
if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT)
return;
PUSH_RESET(push, BUFCTX_FB);
/* At least nv11 seems to get sad if we don't do this before
* swapping RTs.*/
if (context_eng3d(ctx)->oclass < NV17_3D_CLASS) {
int i;
for (i = 0; i < 6; i++) {
BEGIN_NV04(push, NV04_GRAPH(3D, NOP), 1);
PUSH_DATA (push, 0);
}
}
/* Render target */
if (fb->_ColorDrawBuffers[0]) {
s = &to_nouveau_renderbuffer(
fb->_ColorDrawBuffers[0])->surface;
rt_format |= get_rt_format(s->format);
zeta_pitch = rt_pitch = s->pitch;
BEGIN_NV04(push, NV10_3D(COLOR_OFFSET), 1);
PUSH_MTHDl(push, NV10_3D(COLOR_OFFSET), BUFCTX_FB,
s->bo, 0, bo_flags);
}
/* depth/stencil */
if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
s = &to_nouveau_renderbuffer(
fb->Attachment[BUFFER_DEPTH].Renderbuffer)->surface;
rt_format |= get_rt_format(s->format);
zeta_pitch = s->pitch;
BEGIN_NV04(push, NV10_3D(ZETA_OFFSET), 1);
PUSH_MTHDl(push, NV10_3D(ZETA_OFFSET), BUFCTX_FB,
s->bo, 0, bo_flags);
if (context_eng3d(ctx)->oclass >= NV17_3D_CLASS) {
setup_hierz_buffer(ctx);
context_dirty(ctx, ZCLEAR);
}
}
BEGIN_NV04(push, NV10_3D(RT_FORMAT), 2);
PUSH_DATA (push, rt_format);
PUSH_DATA (push, zeta_pitch << 16 | rt_pitch);
context_dirty(ctx, VIEWPORT);
context_dirty(ctx, SCISSOR);
context_dirty(ctx, DEPTH);
}
void
nv10_emit_render_mode(struct gl_context *ctx, int emit)
{
}
void
nv10_emit_scissor(struct gl_context *ctx, int emit)
{
struct nouveau_pushbuf *push = context_push(ctx);
int x, y, w, h;
get_scissors(ctx->DrawBuffer, &x, &y, &w, &h);
BEGIN_NV04(push, NV10_3D(RT_HORIZ), 2);
PUSH_DATA (push, w << 16 | x);
PUSH_DATA (push, h << 16 | y);
}
void
nv10_emit_viewport(struct gl_context *ctx, int emit)
{
struct nouveau_pushbuf *push = context_push(ctx);
struct gl_viewport_attrib *vp = &ctx->ViewportArray[0];
struct gl_framebuffer *fb = ctx->DrawBuffer;
float a[4] = {};
get_viewport_translate(ctx, a);
a[0] -= 2048;
a[1] -= 2048;
if (nv10_use_viewport_zclear(ctx))
a[2] = nv10_transform_depth(ctx, (vp->Far + vp->Near) / 2);
BEGIN_NV04(push, NV10_3D(VIEWPORT_TRANSLATE_X), 4);
PUSH_DATAp(push, a, 4);
BEGIN_NV04(push, NV10_3D(VIEWPORT_CLIP_HORIZ(0)), 1);
PUSH_DATA (push, (fb->Width - 1) << 16 | 0x08000800);
BEGIN_NV04(push, NV10_3D(VIEWPORT_CLIP_VERT(0)), 1);
PUSH_DATA (push, (fb->Height - 1) << 16 | 0x08000800);
context_dirty(ctx, PROJECTION);
}
void
nv10_emit_zclear(struct gl_context *ctx, int emit)
{
struct nouveau_context *nctx = to_nouveau_context(ctx);
struct nouveau_pushbuf *push = context_push(ctx);
struct nouveau_framebuffer *nfb =
to_nouveau_framebuffer(ctx->DrawBuffer);
if (nfb->hierz.bo) {
BEGIN_NV04(push, NV17_3D(ZCLEAR_ENABLE), 2);
PUSH_DATAb(push, !nctx->hierz.clear_blocked);
PUSH_DATA (push, nfb->hierz.clear_value |
(nctx->hierz.clear_seq & 0xff));
} else {
BEGIN_NV04(push, NV10_3D(DEPTH_RANGE_NEAR), 2);
PUSH_DATAf(push, nv10_transform_depth(ctx, 0));
PUSH_DATAf(push, nv10_transform_depth(ctx, 1));
context_dirty(ctx, VIEWPORT);
}
}
| {
"pile_set_name": "Github"
} |
<?php
declare(strict_types = 1);
namespace Embed\Detectors;
class Language extends Detector
{
public function detect(): ?string
{
$document = $this->extractor->getDocument();
$metas = $this->extractor->getMetas();
$ld = $this->extractor->getLinkedData();
return $document->select('/html')->str('lang')
?: $document->select('/html')->str('xml:lang')
?: $metas->str('language', 'lang', 'og:locale', 'dc:language')
?: $document->select('.//meta', ['http-equiv' => 'content-language'])->str('content')
?: $ld->str('inLanguage');
}
}
| {
"pile_set_name": "Github"
} |
{
"name": "@uifabric/example-data",
"version": "7.1.5",
"description": "Data generators for Fluent UI React examples.",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"typings": "lib/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/fluentui"
},
"license": "MIT",
"scripts": {
"build": "just-scripts build",
"bundle": "just-scripts bundle",
"lint": "just-scripts lint",
"test": "just-scripts test",
"clean": "just-scripts clean",
"code-style": "just-scripts code-style",
"update-api": "just-scripts update-api",
"just": "just-scripts"
},
"devDependencies": {
"@fluentui/eslint-plugin": "^0.54.1",
"@uifabric/build": "^7.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
| {
"pile_set_name": "Github"
} |
(function(angular) {
'use strict';
function HeroListController($scope, $element, $attrs) {
var ctrl = this;
// This would be loaded by $http etc.
ctrl.list = [
{
name: 'Superman',
location: ''
},
{
name: 'Batman',
location: 'Wayne Manor'
}
];
ctrl.updateHero = function(hero, prop, value) {
hero[prop] = value;
};
ctrl.deleteHero = function(hero) {
var idx = ctrl.list.indexOf(hero);
if (idx >= 0) {
ctrl.list.splice(idx, 1);
}
};
}
angular.module('heroApp').component('heroList', {
templateUrl: 'heroList.html',
controller: HeroListController
});
})(window.angular); | {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Wed Oct 19 15:34:06 PDT 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OrcProto.DecimalStatistics (ORC Core 1.2.1 API)</title>
<meta name="date" content="2016-10-19">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="OrcProto.DecimalStatistics (ORC Core 1.2.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":10,"i2":9,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":9,"i18":9,"i19":10,"i20":10,"i21":9,"i22":9,"i23":9,"i24":9,"i25":9,"i26":9,"i27":9,"i28":9,"i29":9,"i30":9,"i31":10,"i32":10,"i33":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/OrcProto.DecimalStatistics.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/apache/orc/OrcProto.DateStatisticsOrBuilder.html" title="interface in org.apache.orc"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.Builder.html" title="class in org.apache.orc"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/orc/OrcProto.DecimalStatistics.html" target="_top">Frames</a></li>
<li><a href="OrcProto.DecimalStatistics.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested.class.summary">Nested</a> | </li>
<li><a href="#field.summary">Field</a> | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.orc</div>
<h2 title="Class OrcProto.DecimalStatistics" class="title">Class OrcProto.DecimalStatistics</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>com.google.protobuf.AbstractMessageLite</li>
<li>
<ul class="inheritance">
<li>com.google.protobuf.AbstractMessage</li>
<li>
<ul class="inheritance">
<li>com.google.protobuf.GeneratedMessage</li>
<li>
<ul class="inheritance">
<li>org.apache.orc.OrcProto.DecimalStatistics</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>, <a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html" title="interface in org.apache.orc">OrcProto.DecimalStatisticsOrBuilder</a></dd>
</dl>
<dl>
<dt>Enclosing class:</dt>
<dd><a href="../../../org/apache/orc/OrcProto.html" title="class in org.apache.orc">OrcProto</a></dd>
</dl>
<hr>
<br>
<pre>public static final class <span class="typeNameLabel">OrcProto.DecimalStatistics</span>
extends com.google.protobuf.GeneratedMessage
implements <a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html" title="interface in org.apache.orc">OrcProto.DecimalStatisticsOrBuilder</a></pre>
<div class="block">Protobuf type <code>orc.proto.DecimalStatistics</code></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../serialized-form.html#org.apache.orc.OrcProto.DecimalStatistics">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.Builder.html" title="class in org.apache.orc">OrcProto.DecimalStatistics.Builder</a></span></code>
<div class="block">Protobuf type <code>orc.proto.DecimalStatistics</code></div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.com.google.protobuf.GeneratedMessage">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage</h3>
<code>com.google.protobuf.GeneratedMessage.BuilderParent, com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessage.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessage.ExtendableBuilder>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessage.ExtendableMessage>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessage.ExtendableMessage>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingType extends com.google.protobuf.Message,Type></code></li>
</ul>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#MAXIMUM_FIELD_NUMBER">MAXIMUM_FIELD_NUMBER</a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#MINIMUM_FIELD_NUMBER">MINIMUM_FIELD_NUMBER</a></span></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static com.google.protobuf.Parser<<a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#PARSER">PARSER</a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#SUM_FIELD_NUMBER">SUM_FIELD_NUMBER</a></span></code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.com.google.protobuf.GeneratedMessage">
<!-- -->
</a>
<h3>Fields inherited from class com.google.protobuf.GeneratedMessage</h3>
<code>alwaysUseFieldBuilders</code></li>
</ul>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#getDefaultInstance--">getDefaultInstance</a></span>()</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#getDefaultInstanceForType--">getDefaultInstanceForType</a></span>()</code> </td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static com.google.protobuf.Descriptors.Descriptor</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#getDescriptor--">getDescriptor</a></span>()</code> </td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#getMaximum--">getMaximum</a></span>()</code>
<div class="block"><code>optional string maximum = 2;</code></div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>com.google.protobuf.ByteString</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#getMaximumBytes--">getMaximumBytes</a></span>()</code>
<div class="block"><code>optional string maximum = 2;</code></div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#getMinimum--">getMinimum</a></span>()</code>
<div class="block"><code>optional string minimum = 1;</code></div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>com.google.protobuf.ByteString</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#getMinimumBytes--">getMinimumBytes</a></span>()</code>
<div class="block"><code>optional string minimum = 1;</code></div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>com.google.protobuf.Parser<<a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#getParserForType--">getParserForType</a></span>()</code> </td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#getSerializedSize--">getSerializedSize</a></span>()</code> </td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#getSum--">getSum</a></span>()</code>
<div class="block"><code>optional string sum = 3;</code></div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>com.google.protobuf.ByteString</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#getSumBytes--">getSumBytes</a></span>()</code>
<div class="block"><code>optional string sum = 3;</code></div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>com.google.protobuf.UnknownFieldSet</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#getUnknownFields--">getUnknownFields</a></span>()</code> </td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#hasMaximum--">hasMaximum</a></span>()</code>
<div class="block"><code>optional string maximum = 2;</code></div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#hasMinimum--">hasMinimum</a></span>()</code>
<div class="block"><code>optional string minimum = 1;</code></div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#hasSum--">hasSum</a></span>()</code>
<div class="block"><code>optional string sum = 3;</code></div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>protected com.google.protobuf.GeneratedMessage.FieldAccessorTable</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#internalGetFieldAccessorTable--">internalGetFieldAccessorTable</a></span>()</code> </td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#isInitialized--">isInitialized</a></span>()</code> </td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.Builder.html" title="class in org.apache.orc">OrcProto.DecimalStatistics.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#newBuilder--">newBuilder</a></span>()</code> </td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.Builder.html" title="class in org.apache.orc">OrcProto.DecimalStatistics.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#newBuilder-org.apache.orc.OrcProto.DecimalStatistics-">newBuilder</a></span>(<a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> prototype)</code> </td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.Builder.html" title="class in org.apache.orc">OrcProto.DecimalStatistics.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#newBuilderForType--">newBuilderForType</a></span>()</code> </td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>protected <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.Builder.html" title="class in org.apache.orc">OrcProto.DecimalStatistics.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#newBuilderForType-com.google.protobuf.GeneratedMessage.BuilderParent-">newBuilderForType</a></span>(com.google.protobuf.GeneratedMessage.BuilderParent parent)</code> </td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#parseDelimitedFrom-java.io.InputStream-">parseDelimitedFrom</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> input)</code> </td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#parseDelimitedFrom-java.io.InputStream-com.google.protobuf.ExtensionRegistryLite-">parseDelimitedFrom</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)</code> </td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#parseFrom-byte:A-">parseFrom</a></span>(byte[] data)</code> </td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#parseFrom-byte:A-com.google.protobuf.ExtensionRegistryLite-">parseFrom</a></span>(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)</code> </td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#parseFrom-com.google.protobuf.ByteString-">parseFrom</a></span>(com.google.protobuf.ByteString data)</code> </td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#parseFrom-com.google.protobuf.ByteString-com.google.protobuf.ExtensionRegistryLite-">parseFrom</a></span>(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)</code> </td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#parseFrom-com.google.protobuf.CodedInputStream-">parseFrom</a></span>(com.google.protobuf.CodedInputStream input)</code> </td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code>static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#parseFrom-com.google.protobuf.CodedInputStream-com.google.protobuf.ExtensionRegistryLite-">parseFrom</a></span>(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)</code> </td>
</tr>
<tr id="i29" class="rowColor">
<td class="colFirst"><code>static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#parseFrom-java.io.InputStream-">parseFrom</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> input)</code> </td>
</tr>
<tr id="i30" class="altColor">
<td class="colFirst"><code>static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#parseFrom-java.io.InputStream-com.google.protobuf.ExtensionRegistryLite-">parseFrom</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)</code> </td>
</tr>
<tr id="i31" class="rowColor">
<td class="colFirst"><code><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.Builder.html" title="class in org.apache.orc">OrcProto.DecimalStatistics.Builder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#toBuilder--">toBuilder</a></span>()</code> </td>
</tr>
<tr id="i32" class="altColor">
<td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#writeReplace--">writeReplace</a></span>()</code> </td>
</tr>
<tr id="i33" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html#writeTo-com.google.protobuf.CodedOutputStream-">writeTo</a></span>(com.google.protobuf.CodedOutputStream output)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.google.protobuf.GeneratedMessage">
<!-- -->
</a>
<h3>Methods inherited from class com.google.protobuf.GeneratedMessage</h3>
<code>getAllFields, getDescriptorForType, getField, getRepeatedField, getRepeatedFieldCount, hasField, makeExtensionsImmutable, newFileScopedGeneratedExtension, newMessageScopedGeneratedExtension, parseUnknownField</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.google.protobuf.AbstractMessage">
<!-- -->
</a>
<h3>Methods inherited from class com.google.protobuf.AbstractMessage</h3>
<code>equals, findInitializationErrors, getInitializationErrorString, hashBoolean, hashCode, hashEnum, hashEnumList, hashFields, hashLong, toString</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.google.protobuf.AbstractMessageLite">
<!-- -->
</a>
<h3>Methods inherited from class com.google.protobuf.AbstractMessageLite</h3>
<code>toByteArray, toByteString, writeDelimitedTo, writeTo</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.google.protobuf.MessageOrBuilder">
<!-- -->
</a>
<h3>Methods inherited from interface com.google.protobuf.MessageOrBuilder</h3>
<code>findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getRepeatedField, getRepeatedFieldCount, hasField</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.google.protobuf.MessageLite">
<!-- -->
</a>
<h3>Methods inherited from interface com.google.protobuf.MessageLite</h3>
<code>toByteArray, toByteString, writeDelimitedTo, writeTo</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="PARSER">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PARSER</h4>
<pre>public static com.google.protobuf.Parser<<a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a>> PARSER</pre>
</li>
</ul>
<a name="MINIMUM_FIELD_NUMBER">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MINIMUM_FIELD_NUMBER</h4>
<pre>public static final int MINIMUM_FIELD_NUMBER</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../constant-values.html#org.apache.orc.OrcProto.DecimalStatistics.MINIMUM_FIELD_NUMBER">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="MAXIMUM_FIELD_NUMBER">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MAXIMUM_FIELD_NUMBER</h4>
<pre>public static final int MAXIMUM_FIELD_NUMBER</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../constant-values.html#org.apache.orc.OrcProto.DecimalStatistics.MAXIMUM_FIELD_NUMBER">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="SUM_FIELD_NUMBER">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SUM_FIELD_NUMBER</h4>
<pre>public static final int SUM_FIELD_NUMBER</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../constant-values.html#org.apache.orc.OrcProto.DecimalStatistics.SUM_FIELD_NUMBER">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getDefaultInstance--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDefaultInstance</h4>
<pre>public static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> getDefaultInstance()</pre>
</li>
</ul>
<a name="getDefaultInstanceForType--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDefaultInstanceForType</h4>
<pre>public <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> getDefaultInstanceForType()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getDefaultInstanceForType</code> in interface <code>com.google.protobuf.MessageLiteOrBuilder</code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getDefaultInstanceForType</code> in interface <code>com.google.protobuf.MessageOrBuilder</code></dd>
</dl>
</li>
</ul>
<a name="getUnknownFields--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUnknownFields</h4>
<pre>public final com.google.protobuf.UnknownFieldSet getUnknownFields()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getUnknownFields</code> in interface <code>com.google.protobuf.MessageOrBuilder</code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>getUnknownFields</code> in class <code>com.google.protobuf.GeneratedMessage</code></dd>
</dl>
</li>
</ul>
<a name="getDescriptor--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDescriptor</h4>
<pre>public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()</pre>
</li>
</ul>
<a name="internalGetFieldAccessorTable--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>internalGetFieldAccessorTable</h4>
<pre>protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>internalGetFieldAccessorTable</code> in class <code>com.google.protobuf.GeneratedMessage</code></dd>
</dl>
</li>
</ul>
<a name="getParserForType--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getParserForType</h4>
<pre>public com.google.protobuf.Parser<<a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a>> getParserForType()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getParserForType</code> in interface <code>com.google.protobuf.Message</code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getParserForType</code> in interface <code>com.google.protobuf.MessageLite</code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>getParserForType</code> in class <code>com.google.protobuf.GeneratedMessage</code></dd>
</dl>
</li>
</ul>
<a name="hasMinimum--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasMinimum</h4>
<pre>public boolean hasMinimum()</pre>
<div class="block"><code>optional string minimum = 1;</code></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html#hasMinimum--">hasMinimum</a></code> in interface <code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html" title="interface in org.apache.orc">OrcProto.DecimalStatisticsOrBuilder</a></code></dd>
</dl>
</li>
</ul>
<a name="getMinimum--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMinimum</h4>
<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getMinimum()</pre>
<div class="block"><code>optional string minimum = 1;</code></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html#getMinimum--">getMinimum</a></code> in interface <code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html" title="interface in org.apache.orc">OrcProto.DecimalStatisticsOrBuilder</a></code></dd>
</dl>
</li>
</ul>
<a name="getMinimumBytes--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMinimumBytes</h4>
<pre>public com.google.protobuf.ByteString getMinimumBytes()</pre>
<div class="block"><code>optional string minimum = 1;</code></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html#getMinimumBytes--">getMinimumBytes</a></code> in interface <code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html" title="interface in org.apache.orc">OrcProto.DecimalStatisticsOrBuilder</a></code></dd>
</dl>
</li>
</ul>
<a name="hasMaximum--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasMaximum</h4>
<pre>public boolean hasMaximum()</pre>
<div class="block"><code>optional string maximum = 2;</code></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html#hasMaximum--">hasMaximum</a></code> in interface <code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html" title="interface in org.apache.orc">OrcProto.DecimalStatisticsOrBuilder</a></code></dd>
</dl>
</li>
</ul>
<a name="getMaximum--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaximum</h4>
<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getMaximum()</pre>
<div class="block"><code>optional string maximum = 2;</code></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html#getMaximum--">getMaximum</a></code> in interface <code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html" title="interface in org.apache.orc">OrcProto.DecimalStatisticsOrBuilder</a></code></dd>
</dl>
</li>
</ul>
<a name="getMaximumBytes--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaximumBytes</h4>
<pre>public com.google.protobuf.ByteString getMaximumBytes()</pre>
<div class="block"><code>optional string maximum = 2;</code></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html#getMaximumBytes--">getMaximumBytes</a></code> in interface <code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html" title="interface in org.apache.orc">OrcProto.DecimalStatisticsOrBuilder</a></code></dd>
</dl>
</li>
</ul>
<a name="hasSum--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasSum</h4>
<pre>public boolean hasSum()</pre>
<div class="block"><code>optional string sum = 3;</code></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html#hasSum--">hasSum</a></code> in interface <code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html" title="interface in org.apache.orc">OrcProto.DecimalStatisticsOrBuilder</a></code></dd>
</dl>
</li>
</ul>
<a name="getSum--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSum</h4>
<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getSum()</pre>
<div class="block"><code>optional string sum = 3;</code></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html#getSum--">getSum</a></code> in interface <code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html" title="interface in org.apache.orc">OrcProto.DecimalStatisticsOrBuilder</a></code></dd>
</dl>
</li>
</ul>
<a name="getSumBytes--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSumBytes</h4>
<pre>public com.google.protobuf.ByteString getSumBytes()</pre>
<div class="block"><code>optional string sum = 3;</code></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html#getSumBytes--">getSumBytes</a></code> in interface <code><a href="../../../org/apache/orc/OrcProto.DecimalStatisticsOrBuilder.html" title="interface in org.apache.orc">OrcProto.DecimalStatisticsOrBuilder</a></code></dd>
</dl>
</li>
</ul>
<a name="isInitialized--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isInitialized</h4>
<pre>public final boolean isInitialized()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>isInitialized</code> in interface <code>com.google.protobuf.MessageLiteOrBuilder</code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>isInitialized</code> in class <code>com.google.protobuf.GeneratedMessage</code></dd>
</dl>
</li>
</ul>
<a name="writeTo-com.google.protobuf.CodedOutputStream-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeTo</h4>
<pre>public void writeTo(com.google.protobuf.CodedOutputStream output)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>writeTo</code> in interface <code>com.google.protobuf.MessageLite</code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>writeTo</code> in class <code>com.google.protobuf.AbstractMessage</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="getSerializedSize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSerializedSize</h4>
<pre>public int getSerializedSize()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getSerializedSize</code> in interface <code>com.google.protobuf.MessageLite</code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>getSerializedSize</code> in class <code>com.google.protobuf.AbstractMessage</code></dd>
</dl>
</li>
</ul>
<a name="writeReplace--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeReplace</h4>
<pre>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> writeReplace()
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/ObjectStreamException.html?is-external=true" title="class or interface in java.io">ObjectStreamException</a></pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>writeReplace</code> in class <code>com.google.protobuf.GeneratedMessage</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/ObjectStreamException.html?is-external=true" title="class or interface in java.io">ObjectStreamException</a></code></dd>
</dl>
</li>
</ul>
<a name="parseFrom-com.google.protobuf.ByteString-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseFrom</h4>
<pre>public static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException</pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>com.google.protobuf.InvalidProtocolBufferException</code></dd>
</dl>
</li>
</ul>
<a name="parseFrom-com.google.protobuf.ByteString-com.google.protobuf.ExtensionRegistryLite-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseFrom</h4>
<pre>public static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException</pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>com.google.protobuf.InvalidProtocolBufferException</code></dd>
</dl>
</li>
</ul>
<a name="parseFrom-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseFrom</h4>
<pre>public static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException</pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>com.google.protobuf.InvalidProtocolBufferException</code></dd>
</dl>
</li>
</ul>
<a name="parseFrom-byte:A-com.google.protobuf.ExtensionRegistryLite-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseFrom</h4>
<pre>public static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException</pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>com.google.protobuf.InvalidProtocolBufferException</code></dd>
</dl>
</li>
</ul>
<a name="parseFrom-java.io.InputStream-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseFrom</h4>
<pre>public static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> parseFrom(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> input)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="parseFrom-java.io.InputStream-com.google.protobuf.ExtensionRegistryLite-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseFrom</h4>
<pre>public static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> parseFrom(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="parseDelimitedFrom-java.io.InputStream-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseDelimitedFrom</h4>
<pre>public static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> parseDelimitedFrom(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> input)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="parseDelimitedFrom-java.io.InputStream-com.google.protobuf.ExtensionRegistryLite-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseDelimitedFrom</h4>
<pre>public static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> parseDelimitedFrom(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="parseFrom-com.google.protobuf.CodedInputStream-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseFrom</h4>
<pre>public static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> parseFrom(com.google.protobuf.CodedInputStream input)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="parseFrom-com.google.protobuf.CodedInputStream-com.google.protobuf.ExtensionRegistryLite-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseFrom</h4>
<pre>public static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="newBuilder--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newBuilder</h4>
<pre>public static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.Builder.html" title="class in org.apache.orc">OrcProto.DecimalStatistics.Builder</a> newBuilder()</pre>
</li>
</ul>
<a name="newBuilderForType--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newBuilderForType</h4>
<pre>public <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.Builder.html" title="class in org.apache.orc">OrcProto.DecimalStatistics.Builder</a> newBuilderForType()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>newBuilderForType</code> in interface <code>com.google.protobuf.Message</code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>newBuilderForType</code> in interface <code>com.google.protobuf.MessageLite</code></dd>
</dl>
</li>
</ul>
<a name="newBuilder-org.apache.orc.OrcProto.DecimalStatistics-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newBuilder</h4>
<pre>public static <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.Builder.html" title="class in org.apache.orc">OrcProto.DecimalStatistics.Builder</a> newBuilder(<a href="../../../org/apache/orc/OrcProto.DecimalStatistics.html" title="class in org.apache.orc">OrcProto.DecimalStatistics</a> prototype)</pre>
</li>
</ul>
<a name="toBuilder--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toBuilder</h4>
<pre>public <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.Builder.html" title="class in org.apache.orc">OrcProto.DecimalStatistics.Builder</a> toBuilder()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>toBuilder</code> in interface <code>com.google.protobuf.Message</code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>toBuilder</code> in interface <code>com.google.protobuf.MessageLite</code></dd>
</dl>
</li>
</ul>
<a name="newBuilderForType-com.google.protobuf.GeneratedMessage.BuilderParent-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>newBuilderForType</h4>
<pre>protected <a href="../../../org/apache/orc/OrcProto.DecimalStatistics.Builder.html" title="class in org.apache.orc">OrcProto.DecimalStatistics.Builder</a> newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>newBuilderForType</code> in class <code>com.google.protobuf.GeneratedMessage</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/OrcProto.DecimalStatistics.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/apache/orc/OrcProto.DateStatisticsOrBuilder.html" title="interface in org.apache.orc"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../org/apache/orc/OrcProto.DecimalStatistics.Builder.html" title="class in org.apache.orc"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/orc/OrcProto.DecimalStatistics.html" target="_top">Frames</a></li>
<li><a href="OrcProto.DecimalStatistics.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested.class.summary">Nested</a> | </li>
<li><a href="#field.summary">Field</a> | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2013–2016 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/* normalize.css v3.0.0 | MIT License | git.io/normalize */
//
// 1. Set default font family to sans-serif.
// 2. Prevent iOS text size adjust after orientation change, without disabling
// user zoom.
//
html {
font-family: sans-serif; // 1
-ms-text-size-adjust: 100%; // 2
-webkit-text-size-adjust: 100%; // 2
}
//
// Remove default margin.
//
body {
margin: 0;
}
// HTML5 display definitions
// ==========================================================================
//
// Correct `block` display not defined in IE 8/9.
//
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
//
// 1. Correct `inline-block` display not defined in IE 8/9.
// 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
//
audio,
canvas,
progress,
video {
display: inline-block; // 1
vertical-align: baseline; // 2
}
//
// Prevent modern browsers from displaying `audio` without controls.
// Remove excess height in iOS 5 devices.
//
audio:not([controls]) {
display: none;
height: 0;
}
//
// Address `[hidden]` styling not present in IE 8/9.
// Hide the `template` element in IE, Safari, and Firefox < 22.
//
[hidden],
template {
display: none;
}
// Links
// ==========================================================================
//
// Remove the gray background color from active links in IE 10.
//
a {
background: transparent;
}
//
// Improve readability when focused and also mouse hovered in all browsers.
//
a:active,
a:hover {
outline: 0;
}
// Text-level semantics
// ==========================================================================
//
// Address styling not present in IE 8/9, Safari 5, and Chrome.
//
abbr[title] {
border-bottom: 1px dotted;
}
//
// Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
//
b,
strong {
font-weight: bold;
}
//
// Address styling not present in Safari 5 and Chrome.
//
dfn {
font-style: italic;
}
//
// Address variable `h1` font-size and margin within `section` and `article`
// contexts in Firefox 4+, Safari 5, and Chrome.
//
h1 {
font-size: 2em;
margin: 0.67em 0;
}
//
// Address styling not present in IE 8/9.
//
mark {
background: #ff0;
color: #000;
}
//
// Address inconsistent and variable font size in all browsers.
//
small {
font-size: 80%;
}
//
// Prevent `sub` and `sup` affecting `line-height` in all browsers.
//
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
// Embedded content
// ==========================================================================
//
// Remove border when inside `a` element in IE 8/9.
//
img {
border: 0;
}
//
// Correct overflow displayed oddly in IE 9.
//
svg:not(:root) {
overflow: hidden;
}
// Grouping content
// ==========================================================================
//
// Address margin not present in IE 8/9 and Safari 5.
//
figure {
margin: 1em 40px;
}
//
// Address differences between Firefox and other browsers.
//
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
//
// Contain overflow in all browsers.
//
pre {
overflow: auto;
}
//
// Address odd `em`-unit font size rendering in all browsers.
//
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
// Forms
// ==========================================================================
//
// Known limitation: by default, Chrome and Safari on OS X allow very limited
// styling of `select`, unless a `border` property is set.
//
//
// 1. Correct color not being inherited.
// Known issue: affects color of disabled elements.
// 2. Correct font properties not being inherited.
// 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
//
button,
input,
optgroup,
select,
textarea {
color: inherit; // 1
font: inherit; // 2
margin: 0; // 3
}
//
// Address `overflow` set to `hidden` in IE 8/9/10.
//
button {
overflow: visible;
}
//
// Address inconsistent `text-transform` inheritance for `button` and `select`.
// All other form control elements do not inherit `text-transform` values.
// Correct `button` style inheritance in Firefox, IE 8+, and Opera
// Correct `select` style inheritance in Firefox.
//
button,
select {
text-transform: none;
}
//
// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
// and `video` controls.
// 2. Correct inability to style clickable `input` types in iOS.
// 3. Improve usability and consistency of cursor style between image-type
// `input` and others.
//
button,
html input[type="button"], // 1
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; // 2
cursor: pointer; // 3
}
//
// Re-set default cursor for disabled elements.
//
button[disabled],
html input[disabled] {
cursor: default;
}
//
// Remove inner padding and border in Firefox 4+.
//
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
//
// Address Firefox 4+ setting `line-height` on `input` using `!important` in
// the UA stylesheet.
//
input {
line-height: normal;
}
//
// It's recommended that you don't attempt to style these elements.
// Firefox's implementation doesn't respect box-sizing, padding, or width.
//
// 1. Address box sizing set to `content-box` in IE 8/9/10.
// 2. Remove excess padding in IE 8/9/10.
//
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; // 1
padding: 0; // 2
}
//
// Fix the cursor style for Chrome's increment/decrement buttons. For certain
// `font-size` values of the `input`, it causes the cursor style of the
// decrement button to change from `default` to `text`.
//
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
//
// 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
// 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
// (include `-moz` to future-proof).
//
input[type="search"] {
-webkit-appearance: textfield; // 1
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; // 2
box-sizing: content-box;
}
//
// Remove inner padding and search cancel button in Safari and Chrome on OS X.
// Safari (but not Chrome) clips the cancel button when the search input has
// padding (and `textfield` appearance).
//
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
//
// Define consistent border, margin, and padding.
//
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
//
// 1. Correct `color` not being inherited in IE 8/9.
// 2. Remove padding so people aren't caught out if they zero out fieldsets.
//
legend {
border: 0; // 1
padding: 0; // 2
}
//
// Remove default vertical scrollbar in IE 8/9.
//
textarea {
overflow: auto;
}
//
// Don't inherit the `font-weight` (applied by a rule above).
// NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
//
optgroup {
font-weight: bold;
}
// Tables
// ==========================================================================
//
// Remove most spacing between table cells.
//
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}
| {
"pile_set_name": "Github"
} |
__[32m<a href="__">[0m
| {
"pile_set_name": "Github"
} |
/* Copyright Massachusetts Institute of Technology 1985 */
#include "copyright.h"
/*
* XMenu: MIT Project Athena, X Window system menu package
*
* XMenu.h - Include file for the MIT Project Athena
* XMenu X window system menu package.
*
* Author: Tony Della Fera, DEC
* August, 1984
*/
#ifndef _XMenu_h_
#define _XMenu_h_
#include <stdlib.h>
#include <X11/Xutil.h>
#include "X10.h"
#define FAILURE -1
#define SUCCESS 1
#define POST_ERROR -1
#define NO_SELECTION -1
#define XM_FAILURE -1
#define XM_SUCCESS 1
#define XM_NO_SELECT 2
#define XM_IA_SELECT 3
#define XME_CODE_COUNT 17
#define XME_NO_ERROR 0
#define XME_NOT_INIT 1
#define XME_ARG_BOUNDS 2
#define XME_P_NOT_FOUND 3
#define XME_S_NOT_FOUND 4
#define XME_STYLE_PARAM 5
#define XME_GRAB_MOUSE 6
#define XME_INTERP_LOC 7
#define XME_CALLOC 8
#define XME_CREATE_ASSOC 9
#define XME_STORE_BITMAP 10
#define XME_MAKE_TILES 11
#define XME_MAKE_PIXMAP 12
#define XME_CREATE_CURSOR 13
#define XME_OPEN_FONT 14
#define XME_CREATE_WINDOW 15
#define XME_CREATE_TRANSP 16
/*
* XMenu error code and error list definitions.
*/
extern int _XMErrorCode;
extern char const *const _XMErrorList[];
/*
* Define the XMWindow datatypes.
*
* An XMWindow is either an XMPane or an XMSelect.
*
* XMWindow is wrapper used to identify the constant window
* information that makes up XMPane and XMSelect objects.
*
* An XMPane is a menu pane made up of one or more XMSelect and a label.
*
* An XMSelect is a menu selection object with a label and a data pointer.
*/
typedef enum _xmwintype {PANE, SELECTION, PL_HEADER, SL_HEADER, SEPARATOR} XMWType;
typedef struct _xmwindow {
struct _xmwindow *next; /* Next obj pointer (for emacs_insque). */
struct _xmwindow *prev; /* Prev obj pointer (for emacs_insque). */
XMWType type; /* Type of window. */
Window window; /* X Window Id. */
int window_x; /* Window upper left X coordinate. */
int window_y; /* Window upper left y coordinate. */
int window_w; /* Window width. */
int window_h; /* Window height. */
int active; /* Window active? */
int activated; /* Window activated? */
int pad_l1; /* ---- */
char *pad_l2; /* ---- */
int pad_l3; /* ---- */
int pad_l4; /* ---- */
int pad_l5; /* ---- */
int pad_l6; /* ---- */
int pad_l7; /* ---- */
int pad_l8; /* ---- */
struct _xmwindow *pad_l9; /* ---- */
char *pad_l10; /* ---- */
struct _xmwindow *pad_l11; /* ---- */
} XMWindow;
typedef struct _xmpane {
struct _xmpane *next; /* Next obj pointer (for emacs_insque). */
struct _xmpane *prev; /* Prev obj pointer (for emacs_insque). */
XMWType type; /* Type of window. */
Window window; /* X Window Id. */
int window_x; /* Window upper left X coordinate. */
int window_y; /* Window upper left y coordinate. */
int window_w; /* Window width. */
int window_h; /* Window height. */
int active; /* Window active? */
int activated; /* Window activated? */
int serial; /* -- Pane serial number. */
char const *label; /* -- Pane label. */
int label_width; /* -- Pane label width in pixels. */
int label_length; /* -- Pane label length in chars. */
int label_x; /* -- Pane label X offset. */
int label_uy; /* -- Pane label upper Y offset. */
int label_ly; /* -- Pane label lower Y offset. */
int s_count; /* -- Selections in this pane. */
struct _xmselect *s_list; /* -- Selection window list. */
char *pad_l10; /* ---- */
struct _xmwindow *pad_l11; /* ---- */
} XMPane;
typedef struct _xmselect {
struct _xmselect *next; /* Next obj pointer (for emacs_insque). */
struct _xmselect *prev; /* Prev obj pointer (for emacs_insque). */
XMWType type; /* Type of window. */
Window window; /* X Window Id. */
Window parent; /* X Window id of parent window. */
int window_x; /* Window upper left X coordinate. */
int window_y; /* Window upper left y coordinate. */
int window_w; /* Window width. */
int window_h; /* Window height. */
int active; /* Window active? */
int activated; /* Window activated? */
int serial; /* -- Selection serial number. */
char *label; /* -- Selection label. */
int label_width; /* -- Selection label width in pixels. */
int label_length; /* -- Selection label length in chars. */
int label_x; /* -- Selection label X offset. */
int label_y; /* -- Selection label Y offset. */
int pad_l7; /* ---- */
int pad_l8; /* ---- */
struct _xmwindow *pad_l9; /* ---- */
char *data; /* -- Selection data pointer. */
struct _xmpane *parent_p; /* -- Selection parent pane structure. */
char const *help_string; /* Help string or null. */
} XMSelect;
/*
* Define the XMStyle datatype.
*
* Menu presentation style information.
*
*/
typedef enum _xmstyle {
LEFT, /* Left oriented object. */
RIGHT, /* Right oriented object. */
CENTER /* Center oriented object. */
} XMStyle;
/*
* Define the XMMode datatype.
*
* Menu presentation mode information.
*
*/
typedef enum _xmmode {
BOX, /* BOXed graphic rendition. */
INVERT /* INVERTed graphic rendition. */
} XMMode;
/*
* Define the XMenu datatype.
*
* All dimensions are in pixels unless otherwise noted.
*/
typedef struct _xmenu {
/* -------------------- Menu data -------------------- */
XMStyle menu_style; /* Menu display style. */
XMMode menu_mode; /* Menu display mode. */
int freeze; /* Freeze server mode? */
int aeq; /* Asynchronous Event Queuing mode? */
int recompute; /* Recompute menu dependencies? */
Window parent; /* Menu's parent window. */
int width; /* Overall menu width. */
int height; /* Overall menu height. */
int x_pos; /* Overall menu origin. */
int y_pos; /* Overall menu origin. */
Cursor mouse_cursor; /* Mouse cursor raster. */
XAssocTable *assoc_tab; /* XMWindow association table. */
XMPane *p_list; /* List of XMPanes. */
/* -------------------- Pane window data -------------------- */
XMStyle p_style; /* Pane display style. */
int p_events; /* Pane window X events. */
XFontStruct *p_fnt_info; /* Flag font info structure. */
GC pane_GC; /* Pane graphics context. */
int p_fnt_pad; /* Fixed flag font padding in pixels. */
double p_spread; /* Pane spread in flag height fractions. */
int p_bdr_width; /* Pane border width. */
int flag_height; /* Flag height. */
int p_width; /* Menu pane width. */
int p_height; /* Menu pane height. */
int p_x_off; /* Pane window X offset. */
int p_y_off; /* Pane window Y offset. */
int p_count; /* Number of panes per menu. */
/* -------------------- Selection window data -------------------- */
XMStyle s_style; /* Selection display style. */
int s_events; /* Selection window X events. */
XFontStruct *s_fnt_info; /* Body font info structure. */
int s_fnt_pad; /* Fixed body font padding in pixels. */
double s_spread; /* Select spread in line height fractions. */
int s_bdr_width; /* Select border width. */
int s_width; /* Selection window width. */
int s_height; /* Selection window height. */
int s_x_off; /* Selection window X offset. */
int s_y_off; /* Selection window Y offset. */
int s_count; /* Maximum number of selections per pane. */
GC normal_select_GC; /* GC used for inactive selections. */
GC inverse_select_GC; /* GC used for active (current) selection. */
GC inact_GC; /* GC used for inactive selections and */
/* panes headers. */
/* -------------------- Color data -------------------- */
unsigned long p_bdr_color; /* Color of pane border pixmap. */
unsigned long s_bdr_color; /* Color of selection border pixmap. */
unsigned long p_frg_color; /* Color of pane foreground pixmap. */
unsigned long s_frg_color; /* Color of selection pixmap. */
unsigned long bkgnd_color; /* Color of menu background pixmap. */
/* -------------------- Pixmap data -------------------- */
Pixmap p_bdr_pixmap; /* Pane border pixmap. */
Pixmap s_bdr_pixmap; /* Selection border pixmap. */
Pixmap p_frg_pixmap; /* Pane foreground pixmap. */
Pixmap s_frg_pixmap; /* Selection foreground pixmap. */
Pixmap bkgnd_pixmap; /* Menu background pixmap. */
Pixmap inact_pixmap; /* Menu inactive pixmap. */
} XMenu;
typedef void (*Wait_func)(void*);
/*
* XMenu library routine declarations.
*/
XMenu *XMenuCreate(Display *display, Window parent, char const *def_env);
int XMenuAddPane(Display *display, XMenu *menu, char const *label, int active);
int XMenuAddSelection(Display *display, XMenu *menu, int p_num, char *data, char *label, int active, char const *help);
int XMenuInsertPane(XMenu *menu, int p_num, char *label, int active);
int XMenuInsertSelection(XMenu *menu, int p_num, int s_num, char *data, char *label, int active);
int XMenuFindPane(XMenu *menu, char *label);
int XMenuFindSelection(XMenu *menu, int p_num, char *label);
int XMenuChangePane(XMenu *menu, int p_num, char *label);
int XMenuChangeSelection(Display *display, XMenu *menu, int p_num, int s_num, char *data, int data_sw, char *label, int label_sw);
int XMenuSetPane(XMenu *menu, int p_num, int active);
int XMenuSetSelection(XMenu *menu, int p_num, int s_num, int active);
int XMenuRecompute(Display *display, XMenu *menu);
void XMenuEventHandler(int (*handler) (XEvent *));
int XMenuLocate(Display *display, XMenu *menu, int p_num, int s_num, int x_pos, int y_pos, int *ul_x, int *ul_y, int *width, int *height);
void XMenuSetFreeze(XMenu *menu, int freeze);
void XMenuActivateSetWaitFunction(Wait_func func, void *data);
int XMenuActivate(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, unsigned int event_mask, char **data, void (*help_callback) (char const *, int, int));
char *XMenuPost(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, int event_mask);
int XMenuDeletePane(Display *display, XMenu *menu, int p_num);
int XMenuDeleteSelection(Display *display, XMenu *menu, int p_num, int s_num);
void XMenuDestroy(Display *display, XMenu *menu);
char const *XMenuError(void);
void XMenuSetAEQ(XMenu *menu, int aeq);
#endif
/* Don't add after this point. */
| {
"pile_set_name": "Github"
} |
//
// AppDelegate.h
// 1简单工厂模式
//
// Created by 黄成都 on 15/8/10.
// Copyright (c) 2015年 黄成都. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
| {
"pile_set_name": "Github"
} |
// generated by gengoos.go using 'go generate'
package sys
const GOOS = `windows`
const GoosAndroid = 0
const GoosDarwin = 0
const GoosDragonfly = 0
const GoosFreebsd = 0
const GoosLinux = 0
const GoosNacl = 0
const GoosNetbsd = 0
const GoosOpenbsd = 0
const GoosPlan9 = 0
const GoosSolaris = 0
const GoosWindows = 1
| {
"pile_set_name": "Github"
} |
0
2
2
2
2
2
0
2
2
2
2
2
2
0
2
0
0
2
0
2
0
0
0
2
0
2
2
2
2
0
0
0
0
2
4
2
4
0
0
2
0
2
2
2
2
0
0
2
4
2
6
2
4
0
0
0
4
0
2
2
0
0
0
0
2
2
2
0
0
0
2
4
2
0
2
2
0
0
2
0
0
0
2
0
0
2
0
0
2
0
0
0
2
2
0
0
2
0
2
2
0
2
0
0
4
0
2
0
0
2
2
2
4
0
0
0
2
0
2
0
0
2
2
2
2
0
0
2
2
2
0
2
0
0
2
4
2
2
0
2
2
0
0
0
2
0
2
2
0
0
0
0
0
2
4
0
2
2
2
2
2
0
0
2
0
2
0
2
2
2
2
2
2
2
0
2
0
2
2
4
2
0
0
0
2
0
0
2
2
0
0
2
0
2
0
2
2
2
2
0
2
0
2
0
2
0
0
4
0
0
0
2
0
2
2
2
0
2
2
0
2
0
0
0
0
2
2
0
2
0
0
2
0
0
2
2
4
2
0
0
2
0
2
2
2
2
2
2
0
0
4
0
0
2
0
2
2
2
4
4
2
2
0
2
0
0
0
0
2
0
0
0
2
2
0
2
2
0
0
2
2
2
2
2
0
2
2
2
| {
"pile_set_name": "Github"
} |
#
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
add_library(keys_manager
keys_manager_impl.cpp
)
target_link_libraries(keys_manager
boost
shared_model_cryptography
logger
)
| {
"pile_set_name": "Github"
} |
1
00:00:33,515 --> 00:00:45,093
♬~
2
00:00:45,093 --> 00:00:47,596
(清)大病?
3
00:00:47,596 --> 00:00:50,098
兄さんが?
4
00:00:50,098 --> 00:00:53,001
(熊吉)
話すかどうか迷ったけんど➡
5
00:00:53,001 --> 00:00:56,872
ここまで一緒に来てよ
隠す訳にゃあいかにゃあ。
6
00:00:56,872 --> 00:01:03,612
先生は 立つこんもできにゃあ
大病にかかってるだ。
7
00:01:03,612 --> 00:01:09,484
(到)予定どおり 来年の春まで
観測は続けられる…。
8
00:01:09,484 --> 00:01:12,484
一生のお願いだ。
9
00:01:15,624 --> 00:01:18,527
元気でいたと言ってくれ。
10
00:01:18,527 --> 00:01:21,496
このとおり。
11
00:01:21,496 --> 00:01:24,633
(重三郎)
奥さんも 体壊してるだ。➡
12
00:01:24,633 --> 00:01:29,137
なのに 無理してよ
気象観測 続けてるだ。
13
00:01:29,137 --> 00:01:32,574
(熊吉)先生と約束しただ。➡
14
00:01:32,574 --> 00:01:37,574
このこん 山下りても
絶対 人に言わにゃあってよ。
15
00:01:43,585 --> 00:01:47,455
(和田)「野中 到氏慰問のため
富士登山敢行。➡
16
00:01:47,455 --> 00:01:50,455
夫妻 健康に異常なし」。
17
00:01:52,594 --> 00:01:55,497
(勝良)ご心配をおかけしました。
18
00:01:55,497 --> 00:01:59,467
清君も 足の凍傷は
特に問題ないようです。
19
00:01:59,467 --> 00:02:03,605
御殿場の宿で しばし休養を。
20
00:02:03,605 --> 00:02:06,605
何よりです みんな 無事で…。
21
00:02:24,626 --> 00:02:30,498
♬~
22
00:02:30,498 --> 00:02:35,570
そうきゃ 旦那さんも 奥さんも。
23
00:02:35,570 --> 00:02:50,585
♬~
24
00:02:50,585 --> 00:02:56,091
元気にしとるそうよ
観測も順調にいきよるって。
25
00:02:56,091 --> 00:02:59,594
そげんなら よかった。
26
00:02:59,594 --> 00:03:05,467
園子 あとは あなたよ。 園子。
27
00:03:05,467 --> 00:03:19,467
♬~
28
00:03:28,623 --> 00:03:34,623
園子の事が 気がかりか?
29
00:03:37,432 --> 00:03:43,432
前は よく夢に出てきてくれたのに
今は 全く。
30
00:03:52,580 --> 00:03:59,580
帰ってやってくれ 園子のもとに。
31
00:04:02,090 --> 00:04:09,090
春になったら お前だけでも。
32
00:04:15,603 --> 00:04:23,478
♬~
33
00:04:23,478 --> 00:04:30,618
「明治の女は
強くあらねばならない」。
34
00:04:30,618 --> 00:04:33,521
♬~
35
00:04:33,521 --> 00:04:37,425
幼い頃から
母に そう教えられました。
36
00:04:37,425 --> 00:04:46,568
妻として強くあれ。
夫を支え 精いっぱい尽くせと。
37
00:04:46,568 --> 00:04:51,439
♬~
38
00:04:51,439 --> 00:04:57,439
あなたが ここで死ぬなら
私も死にます。
39
00:05:01,583 --> 00:05:07,583
あなたが生きるなら 私も。
40
00:05:10,592 --> 00:05:19,601
お前といると
なかなか死ねそうにないな。
41
00:05:19,601 --> 00:05:45,601
♬~
42
00:05:56,437 --> 00:06:01,576
清さん
みんなが お見送りに来てるだよ。
43
00:06:01,576 --> 00:06:03,576
ああ…。
44
00:06:11,586 --> 00:06:16,586
(けさ)あの~ これ
汽車ん中で食べてくんな。
45
00:06:18,459 --> 00:06:25,600
馬の用意は できてるだ。
どうかよう お体 大事に。
46
00:06:25,600 --> 00:06:29,600
皆さん ありがとうございます。
47
00:06:32,407 --> 00:06:36,044
地元の皆さんの
温かいご支援を受け➡
48
00:06:36,044 --> 00:06:39,544
兄 野中 到は 無事…。
49
00:06:43,551 --> 00:06:47,051
現在も 気象観測を…。
50
00:06:50,058 --> 00:06:55,558
そして 姉 千代子も…。
51
00:07:17,585 --> 00:07:23,458
(千代子)今日は 晴れです。
気温は マイナス18度。
52
00:07:23,458 --> 00:07:28,458
随分暖かい いいお天気ですよ。
53
00:07:35,970 --> 00:07:38,907
重体です。
54
00:07:38,907 --> 00:07:42,543
兄は…。
55
00:07:42,543 --> 00:07:45,446
姉も 本当は重体です。
56
00:07:45,446 --> 00:07:50,418
このままにしておけば
必ず死にます。
57
00:07:50,418 --> 00:07:54,555
♬~
58
00:07:54,555 --> 00:08:00,428
すみません
やっぱり 僕は家族なので➡
59
00:08:00,428 --> 00:08:03,564
黙っている事はできません。
60
00:08:03,564 --> 00:08:07,435
早く 村長に知らせるだ。 おい。
61
00:08:07,435 --> 00:08:09,437
は… はい。
62
00:08:09,437 --> 00:08:17,578
♬~
63
00:08:17,578 --> 00:08:20,248
到君が 重体…。
64
00:08:20,248 --> 00:08:24,585
申し訳ありません
黙っておりまして。
65
00:08:24,585 --> 00:08:30,091
(勝良)今や 観測を一日12回
続けているのは 千代子で➡
66
00:08:30,091 --> 00:08:36,898
それも ようやっと体にむち打って
という事のようです。
67
00:08:36,898 --> 00:08:39,901
(清)
兄さんの気持ちは 分かります。➡
68
00:08:39,901 --> 00:08:45,540
あれだけ時間をかけ 準備をして
今や 国中に期待されて➡
69
00:08:45,540 --> 00:08:48,042
おめおめと
山を下りる事はできない。
70
00:08:48,042 --> 00:08:51,913
それは 分かります。 ですが➡
71
00:08:51,913 --> 00:08:55,917
病気になったら
下山するのが 当たり前です。
72
00:08:55,917 --> 00:09:01,417
出直すのが 当たり前です。
これでは 犬死にも同然。
73
00:09:04,492 --> 00:09:09,430
元はといえば
こちらが勝手に動いた事です。
74
00:09:09,430 --> 00:09:14,569
到を助けてくれと
お頼みする訳にはまいりません。
75
00:09:14,569 --> 00:09:17,569
私たちは ただ 事実を。
76
00:09:28,082 --> 00:09:32,520
直ちに 御殿場へ向かいます。
77
00:09:32,520 --> 00:09:37,520
地元警察と協力し
救援隊の編成を。
78
00:09:39,394 --> 00:09:44,532
犬死になどさせません
必ず ご夫妻を助けます。
79
00:09:44,532 --> 00:09:49,404
この和田の首を懸けてでも。
80
00:09:49,404 --> 00:09:52,404
ありがとうございます。
81
00:09:57,545 --> 00:10:00,545
(只圓)ご苦労さん。
82
00:10:14,562 --> 00:10:16,562
千代子…。
83
00:10:18,900 --> 00:10:20,935
救援隊?
84
00:10:20,935 --> 00:10:29,077
やはり 千代子は 具合が…。
特に 到君は 重体のごたる。
85
00:10:29,077 --> 00:10:35,583
世間に騒がれんうちに 救援隊ば
やって 下山させるらしか。
86
00:10:35,583 --> 00:10:38,486
(園子)ゴホッ ゴホッ…。
(只圓)おお 園子。
87
00:10:38,486 --> 00:10:40,455
早く とみ子に知らせんと…。
88
00:10:40,455 --> 00:10:43,458
さっき 出ていきよったが。
え?
89
00:10:43,458 --> 00:11:46,587
♬~
90
00:11:46,587 --> 00:11:49,490
(重三郎)あっ…。
91
00:11:49,490 --> 00:11:52,490
来なすったずら。
92
00:11:58,599 --> 00:12:02,470
ご苦労さんです。
御厨警察署長 筑紫であります。
93
00:12:02,470 --> 00:12:04,472
どうも 和田です。
94
00:12:04,472 --> 00:12:07,608
村長より 仰せつかって
代表で参りました さあ 早う中へ。
95
00:12:07,608 --> 00:12:10,108
人目に つかにゃあうちに。
96
00:12:12,113 --> 00:12:15,616
これか。 この かんじき。
97
00:12:15,616 --> 00:12:18,119
鍛冶屋は 何と?
98
00:12:18,119 --> 00:12:23,624
なんぼ腕のええ職人でも
1組作んにゃ 丸々一日かかんだ。
99
00:12:23,624 --> 00:12:29,497
急ぐんなら 何人かで
手分けしにゃあと 駄目だってよ。
100
00:12:29,497 --> 00:12:32,900
しかたない。 この辺りの鍛冶屋
全て当たってくれ。
101
00:12:32,900 --> 00:12:34,835
へえ 分かったずら。
102
00:12:34,835 --> 00:12:37,071
(筑紫)絶対
このこんは 漏らさんようにな。
103
00:12:37,071 --> 00:12:39,974
もし 新聞屋に嗅ぎつかれてよ
騒ぎになったら➡
104
00:12:39,974 --> 00:12:43,474
救援活動どこじゃにゃあからよ。
へい。
105
00:12:45,580 --> 00:12:50,084
まず 何か所かに 基地を分ける。
(與平治)基地だ?
106
00:12:50,084 --> 00:12:53,588
1つは 御殿場口の太郎坊。➡
107
00:12:53,588 --> 00:12:56,490
ここに 救援用の物資を集める。➡
108
00:12:56,490 --> 00:12:59,490
次に 3合目。
109
00:13:01,462 --> 00:13:05,600
ここの小屋にも 燃料や食料を。
火も絶やさずに。
110
00:13:05,600 --> 00:13:09,470
3合目みゃでは
簡単な服装でも行けるだ。
111
00:13:09,470 --> 00:13:12,473
次に 8合目。➡
112
00:13:12,473 --> 00:13:16,611
ここにも 食料と燃料。➡
113
00:13:16,611 --> 00:13:19,611
そして 頂上にも。
114
00:13:21,482 --> 00:13:25,119
浅間神社前の石室小屋。
115
00:13:25,119 --> 00:13:27,622
浅間神社前?
116
00:13:27,622 --> 00:13:32,393
ほんまに小屋はあるけんど…。
無理だら 凍ってるだ。
117
00:13:32,393 --> 00:13:36,564
なんとかして 掘り砕く。
そこにも 食料と燃料。
118
00:13:36,564 --> 00:13:39,467
我々救援隊の
安全確保の意味もあります。
119
00:13:39,467 --> 00:13:43,437
とにかく
行って 状況を見ましょう。
120
00:13:43,437 --> 00:13:45,573
頼んだぞ。
121
00:13:45,573 --> 00:13:47,573
へえ。
122
00:13:49,443 --> 00:13:55,916
(助五郎)ほう~。
うめ~く作ったもんだあ。➡
123
00:13:55,916 --> 00:13:59,253
これを
雪沓の底に くっつけたらよ➡
124
00:13:59,253 --> 00:14:04,091
どんなに硬え氷の上でも
歩けるだら。
125
00:14:04,091 --> 00:14:09,597
(與平治)頼むわ。 お前ら
鍛冶屋の力が 絶対必要なんだ。
126
00:14:09,597 --> 00:14:13,100
お二人が死んじまったら
御殿場の恥だ。
127
00:14:13,100 --> 00:14:17,605
このかんじき見りゃよ
先生がどんな人だか分かるだ。
128
00:14:17,605 --> 00:14:22,476
絶対 人数分 仕上げてみせるだ。
なあ みんな。
129
00:14:22,476 --> 00:14:24,478
(一同)おう!
130
00:14:24,478 --> 00:14:27,478
やってやろうじゃねえか!
任しとけ!
131
00:14:29,617 --> 00:14:35,423
(とみ子)覚悟はしとったけど
救援隊が出るごとなるとは…。
132
00:14:35,423 --> 00:14:40,561
ばってん 考えようによっては
これで助かるかもしれん。
133
00:14:40,561 --> 00:14:44,432
これだけ多くの人が
ご心配下さっとる訳だから。
134
00:14:44,432 --> 00:14:49,070
でも 山は 登るとより
下りる方が難しかけん。
135
00:14:49,070 --> 00:14:54,575
そげな弱った体で
冬の山ば下りれるとでしょうか?
136
00:14:54,575 --> 00:14:57,478
救助の人にだって
何かあったら…。
137
00:14:57,478 --> 00:15:02,917
あなたは 昔から 物事ば
悪く悪く考える癖があるたいねえ。
138
00:15:02,917 --> 00:15:05,586
姉さんは
良く考え過ぎなんですよ。
139
00:15:05,586 --> 00:15:08,489
出来た。
(園子)ゴホッ ゴホッ…。
140
00:15:08,489 --> 00:15:12,460
どうしたの? えっ?
141
00:15:12,460 --> 00:15:15,596
あっ 血…。
142
00:15:15,596 --> 00:15:19,467
あ… あ… お医者さんば…。
お願い!
143
00:15:19,467 --> 00:15:24,271
園子 園子… 園子!
144
00:15:24,271 --> 00:15:33,547
♬~
145
00:15:33,547 --> 00:15:36,050
(井岡)失礼!
146
00:15:36,050 --> 00:15:39,553
私 東京日報記者の
井岡と申します。
147
00:15:39,553 --> 00:15:42,456
野中夫妻について 伺いたい事が。
148
00:15:42,456 --> 00:15:45,426
わしゃ 何も知らにゃあ。
149
00:15:45,426 --> 00:15:49,426
もう記事に出ています。
はあ?
150
00:15:51,565 --> 00:15:56,437
他社です。 やられました。
是非 何か情報を。
151
00:15:56,437 --> 00:15:58,437
はあ…。
152
00:16:00,574 --> 00:16:09,583
(重三郎)今頃よ 新聞記者が
いっぴゃあ来てるだら。
153
00:16:09,583 --> 00:16:15,083
(恵造)
だけんどよ かんじきがなきゃあ
登っちゃあこれにゃあだ。
154
00:16:17,458 --> 00:16:23,458
(和田)急がないと。
まず 目指すのは 8合目だ。
155
00:16:46,420 --> 00:16:48,420
千代子。
156
00:16:51,559 --> 00:16:55,559
今日は おじい様の命日だ。
157
00:17:00,568 --> 00:17:09,577
そうですね。
野中のおじい様 お懐かしいわ。
158
00:17:09,577 --> 00:17:12,480
[ 回想 ]
(閑哉)おお 来よったか。
159
00:17:12,480 --> 00:17:15,449
いとこの千代子たい。
160
00:17:15,449 --> 00:17:18,449
こんにちは。
こんにちは。
161
00:17:22,590 --> 00:17:31,398
昔 父上が役人として
地方を転々としてた頃➡
162
00:17:31,398 --> 00:17:41,398
預けられ
さんざん叱られ 鍛えられた。
163
00:17:43,544 --> 00:17:47,544
厳しいお方でしたから。
164
00:17:55,556 --> 00:17:59,059
お好きだったお麩の吸い物。
165
00:17:59,059 --> 00:18:04,559
それに
これは 氷砂糖の代わりです。
166
00:18:06,567 --> 00:18:10,070
あのキラキラした砂糖は➡
167
00:18:10,070 --> 00:18:15,576
食べるより 見ている方がいい
などと おっしゃっていたな。
168
00:18:15,576 --> 00:18:20,576
形ばかりのお供え物ですが。
169
00:18:29,590 --> 00:18:36,397
♬~
170
00:18:36,397 --> 00:18:42,397
何の話をしている? おじい様と。
171
00:18:44,538 --> 00:18:48,042
昔の話。
172
00:18:48,042 --> 00:18:54,915
おじい様 山に連れていったり
竹刀を振らせたり➡
173
00:18:54,915 --> 00:18:59,553
天気の事を教えたり。
174
00:18:59,553 --> 00:19:04,425
今の到さんを作った方だから。
175
00:19:04,425 --> 00:19:11,565
どうか 観測が成功するよう
お導き下さい。
176
00:19:11,565 --> 00:19:17,565
到さんをお守り下さいと。
177
00:19:22,576 --> 00:19:26,080
俺も 同じ事を。
178
00:19:26,080 --> 00:19:28,582
え?
179
00:19:28,582 --> 00:19:35,389
お前の具合が
少しでも よくなるよう➡
180
00:19:35,389 --> 00:19:39,526
見ていて下さいと。
181
00:19:39,526 --> 00:19:52,539
♬~
182
00:19:52,539 --> 00:19:58,412
≪(恵造)お~い!
聞こえるか~!?➡
183
00:19:58,412 --> 00:20:03,550
野中さん 生きてるか!?
184
00:20:03,550 --> 00:20:06,453
野中さ~ん!
185
00:20:06,453 --> 00:20:09,423
≪今 戸を開けますから。
186
00:20:09,423 --> 00:20:13,560
凍っちまってるから
開けるのは 大変だ!
187
00:20:13,560 --> 00:20:19,560
返事だけよ してくんなあ!
野中先生は 大丈夫か?
188
00:20:21,435 --> 00:20:26,435
≪(恵造)声だけでもよ
聞かせてもらえにゃあか?
189
00:20:31,578 --> 00:20:37,451
おかげさまで 無事です。
けれど 今 休んでおりますので。
190
00:20:37,451 --> 00:20:42,589
(重三郎)おらっちは ゆうべ
浅間神社の前の小屋に泊まっただ。
191
00:20:42,589 --> 00:20:46,589
8合目にゃ 和田先生が来てるだ!
192
00:20:48,462 --> 00:20:53,100
用意ができ次第 明日の昼頃には
みんなでよ➡
193
00:20:53,100 --> 00:20:59,100
お二人を助けに来るだ。
それまでよ 待っててくんな!
194
00:21:13,487 --> 00:21:17,624
和田先生が見えるのか?
195
00:21:17,624 --> 00:21:26,633
♬~
196
00:21:26,633 --> 00:21:30,504
(和田)鶴吉君 熊吉君。➡
197
00:21:30,504 --> 00:21:35,442
もし 野中夫妻を背負って
下りるとしたら➡
198
00:21:35,442 --> 00:21:38,579
どこをどう通るか
考えてくれないか。
199
00:21:38,579 --> 00:21:41,081
背負うのかよ?
200
00:21:41,081 --> 00:21:45,586
もはや 自力で歩く事は
困難だと考えた方がいい。
201
00:21:45,586 --> 00:21:51,458
だから 背負って下りてもらう。
その際 道が出来ていないと➡
202
00:21:51,458 --> 00:21:56,096
足でも滑らせたら
一巻の終わりだ。
203
00:21:56,096 --> 00:22:00,968
(恵造)そういやあ
9合目には 氷の斜面があるだ。
204
00:22:00,968 --> 00:22:03,971
あそこだけは
しっかり足場切らにゃあと➡
205
00:22:03,971 --> 00:22:06,771
とんでもにゃあこんに なるだ。
206
00:22:08,609 --> 00:22:11,512
よし。 では こうしよう。
207
00:22:11,512 --> 00:22:16,116
明日の朝
私と熊吉君たちは 山頂へ。➡
208
00:22:16,116 --> 00:22:22,623
重三郎君は 残りの者を指揮し
9合目の氷に 足場を刻む作業。
209
00:22:22,623 --> 00:22:27,127
恵造さんは ここで 火を守り
食事の用意をしながら➡
210
00:22:27,127 --> 00:22:30,030
皆が下りてくるのを待つ。
211
00:22:30,030 --> 00:22:34,935
必ず 明日のうちに
野中夫妻を救出する。
212
00:22:34,935 --> 00:22:37,571
(一同)へい!
213
00:22:37,571 --> 00:22:43,571
♬~
214
00:22:51,585 --> 00:22:59,459
和田先生なら…
話せば きっと分かって下さる。
215
00:22:59,459 --> 00:23:04,598
無理に下山しろとは
おっしゃるまい。
216
00:23:04,598 --> 00:23:07,598
必ず 力になって下さる。
217
00:23:12,472 --> 00:23:19,472
俺には 何か 薬… 野菜や果物…。
218
00:23:21,615 --> 00:23:27,487
そのような物があれば 必ず治る。
219
00:23:27,487 --> 00:23:31,487
そうすれば 観測に戻れる。
220
00:23:33,560 --> 00:23:38,432
そうだ… そのご相談を…。
221
00:23:38,432 --> 00:23:43,570
(戸をたたく音)
≪(熊吉)旦那さん! 熊吉ずら!➡
222
00:23:43,570 --> 00:23:46,570
和田先生が来なすってるだ!
223
00:23:50,444 --> 00:23:55,582
(戸をたたく音)
≪(熊吉)旦那さん!
224
00:23:55,582 --> 00:24:00,454
(戸をたたく音)
225
00:24:00,454 --> 00:24:04,091
≪(熊吉)奥さん!
226
00:24:04,091 --> 00:24:08,591
今 開くようにします。
少々お待ち下さい。
227
00:24:40,560 --> 00:24:42,860
お願いします。
228
00:24:54,574 --> 00:24:57,477
≪(熊吉)せ~の!
229
00:24:57,477 --> 00:25:11,591
(風の音)
230
00:25:11,591 --> 00:25:58,591
♬~
231
00:26:02,576 --> 00:26:06,076
ただいま お茶を。
232
00:26:11,585 --> 00:26:15,585
(和田)いや すぐにたつ。
233
00:26:23,597 --> 00:26:29,597
野中君 長い間 ご苦労だった。
234
00:26:31,405 --> 00:26:34,705
よく これまで頑張ってくれた。
235
00:26:36,877 --> 00:26:43,750
君が 富士山頂の冬季気象観測に
挑んだその功績は➡
236
00:26:43,750 --> 00:26:47,521
多大なものがある。
237
00:26:47,521 --> 00:26:55,521
中央気象台長に代わって
心から お礼を申し上げる。
238
00:27:12,579 --> 00:27:20,579
だが
その体では これ以上は無理だ。
239
00:27:23,590 --> 00:27:26,493
山を下りよう。➡
240
00:27:26,493 --> 00:27:33,400
富士山は 決して逃げやしない。
来年も再来年も 冬は やって来る。
241
00:27:33,400 --> 00:27:37,537
今年は ひとまず取りやめて
体を治して➡
242
00:27:37,537 --> 00:27:41,537
来年 改めて出直したまえ。
243
00:27:47,547 --> 00:27:54,888
ですが… その保証は?
244
00:27:54,888 --> 00:27:58,588
保証?
245
00:28:01,561 --> 00:28:08,435
来年 また できるという保証は
あるのでしょうか?
246
00:28:08,435 --> 00:28:15,575
一度下山すれば ある事ない事
何らかの理由をつけて➡
247
00:28:15,575 --> 00:28:24,584
この計画自体 流れるという事も
大いにあります。
248
00:28:24,584 --> 00:28:29,584
お役所とは そういうところです。
249
00:28:31,391 --> 00:28:37,531
だが 君は その役所の命を受け
この任務に就いている。
250
00:28:37,531 --> 00:28:41,401
責任者である私も
こうして来ている。
251
00:28:41,401 --> 00:28:45,405
計画は中止 直ちに下山。
252
00:28:45,405 --> 00:28:48,542
これは 官命だ。
253
00:28:48,542 --> 00:28:51,042
官命?
254
00:28:55,048 --> 00:28:57,951
和田先生。
255
00:28:57,951 --> 00:29:02,556
清たちが
何と言ったか知りませんが➡
256
00:29:02,556 --> 00:29:06,426
私は 病気ではない。
257
00:29:06,426 --> 00:29:13,567
野菜や果物を食べれば
すぐによくなる。
258
00:29:13,567 --> 00:29:19,439
私たちの事を
気遣って下さるなら➡
259
00:29:19,439 --> 00:29:26,439
どうか…
どうか そのような支援を…。
260
00:29:30,016 --> 00:29:34,521
君の気持ちは よく分かる。
261
00:29:34,521 --> 00:29:38,391
だが これは 官命だ。
262
00:29:38,391 --> 00:29:43,530
下山せよという
上からの命令なんだ。
263
00:29:43,530 --> 00:29:48,401
だったら
その証拠を見せて頂きましょう。
264
00:29:48,401 --> 00:29:54,541
官命というぐらいなら
ちゃんとした文書があるはずだ!
265
00:29:54,541 --> 00:30:00,046
ゴホッ ゴホッゴホッ…。
266
00:30:00,046 --> 00:30:02,949
野中君。
267
00:30:02,949 --> 00:30:06,449
君は 病気だ。
268
00:30:09,556 --> 00:30:13,059
この先 風が強くなる。
269
00:30:13,059 --> 00:30:17,564
ご夫妻を担ぎ下ろす
準備をして下さい。
270
00:30:17,564 --> 00:30:25,564
♬~
271
00:30:29,576 --> 00:30:34,447
お願いします 先生。
272
00:30:34,447 --> 00:30:39,586
どうか 観測を続けさせて下さい。
273
00:30:39,586 --> 00:30:44,586
このまま主人を
ここに置いてやって下さい。
274
00:30:47,460 --> 00:30:52,599
続けさせて下さい
お願いします 先生。
275
00:30:52,599 --> 00:30:55,599
これは 官命です。
276
00:31:06,613 --> 00:31:10,116
では 申し上げますが➡
277
00:31:10,116 --> 00:31:15,989
その水銀晴雨計は 山頂の環境に
耐えられず 壊れてしまいました。
278
00:31:15,989 --> 00:31:21,127
ほかにも 気象台から借りた機器が
次々に壊れ➡
279
00:31:21,127 --> 00:31:26,627
その負担が
主人の体力を奪いました。
280
00:31:28,635 --> 00:31:31,538
何が言いたい?
281
00:31:31,538 --> 00:31:35,075
苦情を申し上げているのでは
ありません。
282
00:31:35,075 --> 00:31:39,946
そんな中でも 可能な限り
観測を続けてきたのです。
283
00:31:39,946 --> 00:31:44,084
その数字の変化は
とても意味のあるものと…。
284
00:31:44,084 --> 00:31:48,584
直ちに ここを閉めます。
和田先生!
285
00:31:50,590 --> 00:31:53,093
あなたは 帰りたくないんですか?
286
00:31:53,093 --> 00:31:55,595
会いたくないんですか?
娘さんに。
287
00:31:55,595 --> 00:31:58,498
そばで
看病したくはないんですか?
288
00:31:58,498 --> 00:32:01,468
看病?
289
00:32:01,468 --> 00:32:07,107
看病って どういう事ですか?
園子に 何が…?
290
00:32:07,107 --> 00:32:14,607
いや 別に。 すまない
ご主人の事と混同してしまって。
291
00:32:19,619 --> 00:32:23,619
どういう事ですか!?
教えて下さい!
292
00:32:26,493 --> 00:32:29,493
園子…。
293
00:32:31,564 --> 00:32:36,436
(熊吉)奥さん!
294
00:32:36,436 --> 00:32:40,436
おい! おい!
295
00:32:45,578 --> 00:32:48,481
園子が?
296
00:32:48,481 --> 00:32:53,981
病気だそうだ。 肺炎だと。
297
00:32:56,589 --> 00:33:00,460
(和田)
すまない 口止めされていた。➡
298
00:33:00,460 --> 00:33:07,460
だが こうなった以上
下山を勧める訳を分かってくれ。
299
00:33:09,602 --> 00:33:15,475
待っている人が いるんだよ
君や奥さんを。
300
00:33:15,475 --> 00:33:22,615
「助けてくれ」と言いに来た清君。
頭を下げられた お父上の心中。
301
00:33:22,615 --> 00:33:32,058
そして 何より 本当に
気象学を発展させたいなら➡
302
00:33:32,058 --> 00:33:37,931
真に観測の成功を祈るなら➡
303
00:33:37,931 --> 00:33:41,431
ここで死んでは駄目だ。
304
00:33:43,570 --> 00:33:50,443
犠牲者が出た そら見ろ
やはり 高所観測など必要ない。
305
00:33:50,443 --> 00:33:55,582
そうして 研究が遅れる。
306
00:33:55,582 --> 00:34:01,454
それは 君も本望ではないはずだ。
307
00:34:01,454 --> 00:34:26,454
♬~
308
00:34:54,574 --> 00:34:57,574
千代子。
309
00:35:04,083 --> 00:35:09,583
ひとまず 山を下りよう。
310
00:35:24,470 --> 00:36:52,458
♬~
311
00:36:52,458 --> 00:36:55,458
(鶴吉)奥さん 行くだ。
312
00:36:57,230 --> 00:36:59,565
はい。
313
00:36:59,565 --> 00:37:43,543
♬~
314
00:37:43,543 --> 00:37:46,045
(重三郎)ふんばるだ~!
315
00:37:46,045 --> 00:37:48,948
引っ張られちゃ おしみゃあだ!
316
00:37:48,948 --> 00:37:52,448
野中君 もう少しだ 頑張れ!
317
00:37:54,554 --> 00:37:57,056
息が…。
318
00:37:57,056 --> 00:38:00,560
すまにゃあ 我慢してくんな。
319
00:38:00,560 --> 00:38:08,434
♬~
320
00:38:08,434 --> 00:38:12,572
寝んなよ 目ぇ開けるだ!
321
00:38:12,572 --> 00:38:39,532
♬~
322
00:38:39,532 --> 00:38:43,402
(園子)お母様!
323
00:38:43,402 --> 00:38:59,402
♬~
324
00:39:09,529 --> 00:39:16,529
あなた… あなた!
325
00:39:18,571 --> 00:39:21,474
到さんは どうしたんです?
326
00:39:21,474 --> 00:39:24,076
(恵造)気ぃ失ってるだ。➡
327
00:39:24,076 --> 00:39:28,576
何ぼ呼んでもよ
何の反応もにゃあだ。
328
00:39:31,884 --> 00:39:36,522
あなた… ねえ あなた!
329
00:39:36,522 --> 00:39:38,522
あなた!
330
00:39:41,394 --> 00:39:44,394
(熊吉)うっ…。
331
00:39:52,004 --> 00:39:54,504
(床をたたく音)
332
00:39:56,542 --> 00:40:02,415
もっと温めよう。 体温が戻れば
きっと 野中君は 目を覚ます。
333
00:40:02,415 --> 00:40:05,415
(重三郎)先生!
334
00:40:13,559 --> 00:40:16,462
先生!
335
00:40:16,462 --> 00:40:19,432
こうすりゃ ちょっとでもよ…。
336
00:40:19,432 --> 00:40:21,434
おい お前 足! 足 こすれ!
337
00:40:21,434 --> 00:40:24,070
先生!
目ぇ覚まして下さい!
338
00:40:24,070 --> 00:40:26,973
あなた!
石をぬくめるだ。
おう。
339
00:40:26,973 --> 00:40:29,942
毛布くんな!
俺の懐炉を使ってくんな!
340
00:40:29,942 --> 00:40:32,942
あなた… ねえ あなた!
341
00:40:37,583 --> 00:40:41,454
う… ゴホッ ゴホッ…。
342
00:40:41,454 --> 00:40:44,454
ゴホッ ゴホッ…。
343
00:40:52,598 --> 00:40:54,533
あなた…。
344
00:40:54,533 --> 00:40:57,533
おお 目覚めたか…。
345
00:41:04,610 --> 00:41:11,110
千代子?
はい ここにいます。
346
00:41:15,121 --> 00:41:19,992
なぜ こんなに暗い?
347
00:41:19,992 --> 00:41:22,492
え?
348
00:41:24,630 --> 00:41:29,630
痛い… 目が。
349
00:41:35,574 --> 00:41:39,445
それに…➡
350
00:41:39,445 --> 00:41:42,445
何も見えない。
351
00:41:44,583 --> 00:41:47,583
先生。
352
00:41:49,455 --> 00:41:55,594
もしかして
目に凍傷を受けたのかもしれない。
353
00:41:55,594 --> 00:41:58,497
(恵造)凍傷…。
354
00:41:58,497 --> 00:42:02,468
(和田)明日下山したら
すぐに医者に診せよう。
355
00:42:02,468 --> 00:42:19,618
♬~
356
00:42:19,618 --> 00:42:22,521
あっ ねえ あれ!
357
00:42:22,521 --> 00:42:27,493
そうだよ 帰ってきただよ!
358
00:42:27,493 --> 00:42:33,566
♬~
359
00:42:33,566 --> 00:42:39,438
(重三郎)おじさん!
(與平治)重三郎 大変だったな。
360
00:42:39,438 --> 00:42:43,576
♬~
361
00:42:43,576 --> 00:42:46,479
旦那さん!
旦那さん!
えがった…。
362
00:42:46,479 --> 00:42:49,479
(つる)旦那さん。
(けさ)旦那さん!
363
00:42:51,450 --> 00:42:55,588
奥さん! よう頑張っただ。
364
00:42:55,588 --> 00:42:58,491
野中先生!
365
00:42:58,491 --> 00:43:01,460
野中先生だ!
先生が来たぞ!
366
00:43:01,460 --> 00:43:05,598
野中先生 帰ってきただよ!
野中先生!
367
00:43:05,598 --> 00:43:10,102
野中先生!
先生! 先生!
368
00:43:10,102 --> 00:43:13,005
こ… これは…。
369
00:43:13,005 --> 00:43:15,975
野中先生!
よくぞ ご無事で!
370
00:43:15,975 --> 00:43:18,611
離れるだ ほら 離れるだ!
371
00:43:18,611 --> 00:43:21,113
(井岡)
野中先生 話を聞かせて下さい!➡
372
00:43:21,113 --> 00:43:24,617
すいません すいません 野中さん。
私ですね➡
373
00:43:24,617 --> 00:43:27,119
以前 取材をさせて頂いた…。
(和田)待った!
374
00:43:27,119 --> 00:43:30,022
取材は あとだ!
ご夫妻を 早く医者に!
375
00:43:30,022 --> 00:43:31,957
そこを なんとか…。
376
00:43:31,957 --> 00:43:34,560
もう少しだ 頑張ってね 先生。
377
00:43:34,560 --> 00:43:41,434
お帰りなさい よくぞ ご無事で。
野中先生 よかったなあ!
378
00:43:41,434 --> 00:43:45,571
よう頑張ったなあ
よう頑張ったなあ。
379
00:43:45,571 --> 00:43:50,571
♬~
380
00:43:54,580 --> 00:43:59,452
(三浦)やはり 栄養失調です。
381
00:43:59,452 --> 00:44:03,589
それに 過度の疲労。
382
00:44:03,589 --> 00:44:08,589
しばらく温かくして
寝ている方がいいでしょう。
383
00:44:10,262 --> 00:44:13,165
目は
やはり 凍傷だと思われますが➡
384
00:44:13,165 --> 00:44:17,603
そのうち 痛みが取れれば
見えるようになるでしょう。
385
00:44:17,603 --> 00:44:22,475
ありがとうございます。
386
00:44:22,475 --> 00:44:25,478
≪(與平治)あの~ 野中先生。
387
00:44:25,478 --> 00:44:29,478
東京から お客さんずら。
388
00:44:39,558 --> 00:44:42,558
父上…。
389
00:44:44,430 --> 00:44:48,567
残念でした。
390
00:44:48,567 --> 00:44:52,438
何も言うな 到。
391
00:44:52,438 --> 00:44:57,576
今は
一日も早く体をよくする事だ。
392
00:44:57,576 --> 00:45:01,576
それが 世間様に対するお礼だ。
393
00:45:07,586 --> 00:45:11,586
千代子も ゆっくり休め。
394
00:45:16,595 --> 00:45:22,595
お母様… 園子は?
395
00:45:31,544 --> 00:45:37,416
園子に 何が?
396
00:45:37,416 --> 00:45:42,555
あの子は 無事ですか?
397
00:45:42,555 --> 00:45:44,555
それとも…。
398
00:45:46,425 --> 00:45:52,565
重い肺炎でした。
けれど 峠は越えました。
399
00:45:52,565 --> 00:45:57,436
♬~
400
00:45:57,436 --> 00:46:06,579
今は まだ 福岡の家にいます。
でも もう大丈夫。
401
00:46:06,579 --> 00:46:20,092
♬~
402
00:46:20,092 --> 00:46:24,597
お許し下さい…。
403
00:46:24,597 --> 00:46:28,100
お母様…。
404
00:46:28,100 --> 00:46:31,003
分かっています。
405
00:46:31,003 --> 00:46:35,541
本当に… 申し訳ないと。
406
00:46:35,541 --> 00:46:38,444
全て 私が…。
407
00:46:38,444 --> 00:46:41,046
分かっています。
408
00:46:41,046 --> 00:46:43,949
分かってますよ 千代子。
409
00:46:43,949 --> 00:46:49,555
♬~
410
00:46:49,555 --> 00:46:54,059
もし…
あなたが後を追わなかったら➡
411
00:46:54,059 --> 00:46:58,564
私は もう到と会えなかった。
412
00:46:58,564 --> 00:47:03,564
到を助けてくれて ありがとう。
413
00:47:05,437 --> 00:47:08,574
ありがとう 千代子。
414
00:47:08,574 --> 00:47:57,556
♬~
415
00:47:57,556 --> 00:48:00,459
(清)兄さん。
416
00:48:00,459 --> 00:48:03,429
どうですか? 目の方は。
417
00:48:03,429 --> 00:48:06,565
ああ もう だいぶ見えるように。
418
00:48:06,565 --> 00:48:12,438
しかし よかったですね
園子が無事で。
419
00:48:12,438 --> 00:48:17,438
今頃 姉さんも
福岡で涙の再会ですね。
420
00:48:19,578 --> 00:48:22,578
本当は…。
421
00:48:26,452 --> 00:48:31,690
分かっている。 俺のせいだ。
422
00:48:31,690 --> 00:48:34,490
何がですか?
423
00:48:38,464 --> 00:48:43,402
千代子に
あれだけの苦労をかけた。
424
00:48:43,402 --> 00:48:46,402
園子にも。
425
00:48:48,540 --> 00:48:55,414
けれど
千代子は 決して 俺を責めない。
426
00:48:55,414 --> 00:48:58,414
ただの一度も文句を言わない。
427
00:49:00,552 --> 00:49:04,552
それが なんとも不憫で…。
428
00:49:08,427 --> 00:49:14,427
ですが 兄さんには
やらなければならない事が。
429
00:49:16,568 --> 00:49:22,568
ここで 兄さんが諦めたら
それこそ 報われない。
430
00:49:31,517 --> 00:49:58,544
♬~
431
00:49:58,544 --> 00:50:01,447
この後も 野中 到と千代子は➡
432
00:50:01,447 --> 00:50:05,417
再び 富士山頂での
冬季観測を目指した。
433
00:50:05,417 --> 00:50:09,054
しかし 気象器械の問題➡
434
00:50:09,054 --> 00:50:13,559
到自身の健康問題などから
断念せざるをえず➡
435
00:50:13,559 --> 00:50:18,430
和田の助言もあって
地上で努力する事を決めた。
436
00:50:18,430 --> 00:50:23,569
まずは 東京を去り
佐藤茶屋の近くに居を構え➡
437
00:50:23,569 --> 00:50:30,075
富士観象会を設立。
その拠点は 野中山と呼ばれた。
438
00:50:30,075 --> 00:50:35,581
これまでの功績をたたえ
褒章の話が持ち上がったが➡
439
00:50:35,581 --> 00:50:41,581
「千代子と一緒でなければ」と
到は その栄誉を受けなかった。
440
00:50:46,592 --> 00:50:50,462
その後
千代子は 3男2女を産み➡
441
00:50:50,462 --> 00:50:55,462
夫を助け
観測所設立に向け 尽力した。
442
00:50:59,605 --> 00:51:04,476
しかし 大正12年2月
悪性インフルエンザが流行。
443
00:51:04,476 --> 00:51:09,615
野中一家も これにかかり
病を押して 千代子が看病。
444
00:51:09,615 --> 00:51:16,488
家族たちが 快方に向かった頃
倒れる事となる。
445
00:51:16,488 --> 00:51:19,488
享年52。
446
00:51:22,628 --> 00:51:27,499
昭和7年 ようやく
さまざまな条件がそろい➡
447
00:51:27,499 --> 00:51:31,436
国立の気象観測所が建設された。
448
00:51:31,436 --> 00:51:41,580
♬~
449
00:51:41,580 --> 00:51:47,580
到は 3女 恭子を伴って
富士山頂に向かった。
450
00:51:50,589 --> 00:51:54,459
そして 再び出会う。
451
00:51:54,459 --> 00:52:01,600
♬~
452
00:52:01,600 --> 00:52:04,503
(恭子)あれが…。
453
00:52:04,503 --> 00:52:19,503
♬~
454
00:52:25,624 --> 00:52:30,624
(恭子)本当に ここで
気象観測をしていらしたなんて…。
455
00:52:56,588 --> 00:52:59,491
(恭子)ごめんなさい お父様。
456
00:52:59,491 --> 00:53:06,598
最初に このお話を聞いた時
信じられないって思いました。
457
00:53:06,598 --> 00:53:13,598
こんな大変な場所で
まさか お母様が…。
458
00:53:17,609 --> 00:53:24,483
(恭子)そのあとも ずっと
お父様の活動を支えて…。➡
459
00:53:24,483 --> 00:53:28,483
愚痴も何もおっしゃらなくて。
460
00:53:30,622 --> 00:53:35,460
昔 聞いた事があるんです。
461
00:53:35,460 --> 00:53:40,432
「いつも お父様と一緒で
大変ではないの?➡
462
00:53:40,432 --> 00:53:45,432
つらいって
お思いになった事は?」って。
463
00:53:47,572 --> 00:53:50,475
一度もないわ。
464
00:53:50,475 --> 00:53:57,582
だって お父様は
私に夢をくれたのよ。 家族も。
465
00:53:57,582 --> 00:54:02,454
それ以上 必要なものって ある?
466
00:54:02,454 --> 00:54:19,604
♬~
467
00:54:19,604 --> 00:54:27,479
♬「涙のような雨が降れば」
468
00:54:27,479 --> 00:54:35,554
♬「私が傘を差しかける」
469
00:54:35,554 --> 00:54:44,563
♬「風が泣いて寒い夜は」
470
00:54:44,563 --> 00:54:52,437
♬「あなたが抱きしめてくれる」
471
00:54:52,437 --> 00:55:01,580
♬「共に歩み共に生きて」
472
00:55:01,580 --> 00:55:10,088
♬「ここまで来たけれど」
473
00:55:10,088 --> 00:55:14,593
♬「二人でいられたから」
474
00:55:14,593 --> 00:55:18,463
♬「怖いものはなかった」
475
00:55:18,463 --> 00:55:26,605
♬「運命で結ばれた愛」
476
00:55:26,605 --> 00:55:42,888
♬~
477
00:55:42,888 --> 00:55:51,563
♬「短すぎる秋の日差し」
478
00:55:51,563 --> 00:55:59,437
♬「浴びて輝く横顔を」
479
00:55:59,437 --> 00:56:08,580
♬「今まぶたに
焼き付けよう」
480
00:56:08,580 --> 00:56:16,454
♬「二度と
忘れないために」
481
00:56:16,454 --> 00:56:25,030
♬「嬉しいことも
悲しいことも」
482
00:56:25,030 --> 00:56:33,538
♬「すべてが
愛しくて」
483
00:56:33,538 --> 00:56:38,043
♬「二人にしかわからぬ」
484
00:56:38,043 --> 00:56:42,547
♬「言葉を超えた言葉」
485
00:56:42,547 --> 00:56:50,055
♬「今日もまた交し合うの」
486
00:56:50,055 --> 00:56:58,563
♬「やがて長い冬が来ても」
487
00:56:58,563 --> 00:57:06,438
♬「私のそばにいて」
488
00:57:06,438 --> 00:57:11,076
♬「二人を
分かつ時が」
489
00:57:11,076 --> 00:57:15,580
♬「たとえ
巡り来ようと」
490
00:57:15,580 --> 00:57:23,455
♬「永遠に
生き続ける愛」
491
00:57:23,455 --> 00:57:28,093
♬「二人を
分かつ時が」
492
00:57:28,093 --> 00:57:32,530
♬「たとえ巡り来ようと」
493
00:57:32,530 --> 00:57:38,403
♬「永遠に生き続ける愛」
494
00:57:38,403 --> 00:57:42,403
♬~
495
00:57:44,542 --> 00:57:49,414
野中 到は 89歳まで長寿を保ち➡
496
00:57:49,414 --> 00:57:55,414
昭和30年2月 永遠の眠りについた。
| {
"pile_set_name": "Github"
} |
auto lo
iface lo inet loopback
address 10.0.0.22/32
auto eth0
iface eth0 inet dhcp
# downlinks
auto swp1
iface swp1
auto swp2
iface swp2
auto swp3
iface swp3
auto swp4
iface swp4
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2015 Toradex AG.
*
* Author: Sanchayan Maity <[email protected]>
*
* Based on the barebox ocotp driver,
* Copyright (c) 2010 Baruch Siach <[email protected]>
* Orex Computed Radiography
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/nvmem-provider.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
/* OCOTP Register Offsets */
#define OCOTP_CTRL_REG 0x00
#define OCOTP_CTRL_SET 0x04
#define OCOTP_CTRL_CLR 0x08
#define OCOTP_TIMING 0x10
#define OCOTP_DATA 0x20
#define OCOTP_READ_CTRL_REG 0x30
#define OCOTP_READ_FUSE_DATA 0x40
/* OCOTP Register bits and masks */
#define OCOTP_CTRL_WR_UNLOCK 16
#define OCOTP_CTRL_WR_UNLOCK_KEY 0x3E77
#define OCOTP_CTRL_WR_UNLOCK_MASK GENMASK(31, 16)
#define OCOTP_CTRL_ADDR 0
#define OCOTP_CTRL_ADDR_MASK GENMASK(6, 0)
#define OCOTP_CTRL_RELOAD_SHADOWS BIT(10)
#define OCOTP_CTRL_ERR BIT(9)
#define OCOTP_CTRL_BUSY BIT(8)
#define OCOTP_TIMING_STROBE_READ 16
#define OCOTP_TIMING_STROBE_READ_MASK GENMASK(21, 16)
#define OCOTP_TIMING_RELAX 12
#define OCOTP_TIMING_RELAX_MASK GENMASK(15, 12)
#define OCOTP_TIMING_STROBE_PROG 0
#define OCOTP_TIMING_STROBE_PROG_MASK GENMASK(11, 0)
#define OCOTP_READ_CTRL_READ_FUSE 0x1
#define VF610_OCOTP_TIMEOUT 100000
#define BF(value, field) (((value) << field) & field##_MASK)
#define DEF_RELAX 20
static const int base_to_fuse_addr_mappings[][2] = {
{0x400, 0x00},
{0x410, 0x01},
{0x420, 0x02},
{0x450, 0x05},
{0x4F0, 0x0F},
{0x600, 0x20},
{0x610, 0x21},
{0x620, 0x22},
{0x630, 0x23},
{0x640, 0x24},
{0x650, 0x25},
{0x660, 0x26},
{0x670, 0x27},
{0x6F0, 0x2F},
{0x880, 0x38},
{0x890, 0x39},
{0x8A0, 0x3A},
{0x8B0, 0x3B},
{0x8C0, 0x3C},
{0x8D0, 0x3D},
{0x8E0, 0x3E},
{0x8F0, 0x3F},
{0xC80, 0x78},
{0xC90, 0x79},
{0xCA0, 0x7A},
{0xCB0, 0x7B},
{0xCC0, 0x7C},
{0xCD0, 0x7D},
{0xCE0, 0x7E},
{0xCF0, 0x7F},
};
struct vf610_ocotp {
void __iomem *base;
struct clk *clk;
struct device *dev;
struct nvmem_device *nvmem;
int timing;
};
static int vf610_ocotp_wait_busy(void __iomem *base)
{
int timeout = VF610_OCOTP_TIMEOUT;
while ((readl(base) & OCOTP_CTRL_BUSY) && --timeout)
udelay(10);
if (!timeout) {
writel(OCOTP_CTRL_ERR, base + OCOTP_CTRL_CLR);
return -ETIMEDOUT;
}
udelay(10);
return 0;
}
static int vf610_ocotp_calculate_timing(struct vf610_ocotp *ocotp_dev)
{
u32 clk_rate;
u32 relax, strobe_read, strobe_prog;
u32 timing;
clk_rate = clk_get_rate(ocotp_dev->clk);
/* Refer section OTP read/write timing parameters in TRM */
relax = clk_rate / (1000000000 / DEF_RELAX) - 1;
strobe_prog = clk_rate / (1000000000 / 10000) + 2 * (DEF_RELAX + 1) - 1;
strobe_read = clk_rate / (1000000000 / 40) + 2 * (DEF_RELAX + 1) - 1;
timing = BF(relax, OCOTP_TIMING_RELAX);
timing |= BF(strobe_read, OCOTP_TIMING_STROBE_READ);
timing |= BF(strobe_prog, OCOTP_TIMING_STROBE_PROG);
return timing;
}
static int vf610_get_fuse_address(int base_addr_offset)
{
int i;
for (i = 0; i < ARRAY_SIZE(base_to_fuse_addr_mappings); i++) {
if (base_to_fuse_addr_mappings[i][0] == base_addr_offset)
return base_to_fuse_addr_mappings[i][1];
}
return -EINVAL;
}
static int vf610_ocotp_read(void *context, unsigned int offset,
void *val, size_t bytes)
{
struct vf610_ocotp *ocotp = context;
void __iomem *base = ocotp->base;
u32 reg, *buf = val;
int fuse_addr;
int ret;
while (bytes > 0) {
fuse_addr = vf610_get_fuse_address(offset);
if (fuse_addr > 0) {
writel(ocotp->timing, base + OCOTP_TIMING);
ret = vf610_ocotp_wait_busy(base + OCOTP_CTRL_REG);
if (ret)
return ret;
reg = readl(base + OCOTP_CTRL_REG);
reg &= ~OCOTP_CTRL_ADDR_MASK;
reg &= ~OCOTP_CTRL_WR_UNLOCK_MASK;
reg |= BF(fuse_addr, OCOTP_CTRL_ADDR);
writel(reg, base + OCOTP_CTRL_REG);
writel(OCOTP_READ_CTRL_READ_FUSE,
base + OCOTP_READ_CTRL_REG);
ret = vf610_ocotp_wait_busy(base + OCOTP_CTRL_REG);
if (ret)
return ret;
if (readl(base) & OCOTP_CTRL_ERR) {
dev_dbg(ocotp->dev, "Error reading from fuse address %x\n",
fuse_addr);
writel(OCOTP_CTRL_ERR, base + OCOTP_CTRL_CLR);
}
/*
* In case of error, we do not abort and expect to read
* 0xBADABADA as mentioned by the TRM. We just read this
* value and return.
*/
*buf = readl(base + OCOTP_READ_FUSE_DATA);
} else {
*buf = 0;
}
buf++;
bytes -= 4;
offset += 4;
}
return 0;
}
static struct nvmem_config ocotp_config = {
.name = "ocotp",
.stride = 4,
.word_size = 4,
.reg_read = vf610_ocotp_read,
};
static const struct of_device_id ocotp_of_match[] = {
{ .compatible = "fsl,vf610-ocotp", },
{/* sentinel */},
};
MODULE_DEVICE_TABLE(of, ocotp_of_match);
static int vf610_ocotp_remove(struct platform_device *pdev)
{
struct vf610_ocotp *ocotp_dev = platform_get_drvdata(pdev);
return nvmem_unregister(ocotp_dev->nvmem);
}
static int vf610_ocotp_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct resource *res;
struct vf610_ocotp *ocotp_dev;
ocotp_dev = devm_kzalloc(&pdev->dev,
sizeof(struct vf610_ocotp), GFP_KERNEL);
if (!ocotp_dev)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ocotp_dev->base = devm_ioremap_resource(dev, res);
if (IS_ERR(ocotp_dev->base))
return PTR_ERR(ocotp_dev->base);
ocotp_dev->clk = devm_clk_get(dev, NULL);
if (IS_ERR(ocotp_dev->clk)) {
dev_err(dev, "failed getting clock, err = %ld\n",
PTR_ERR(ocotp_dev->clk));
return PTR_ERR(ocotp_dev->clk);
}
ocotp_config.size = resource_size(res);
ocotp_config.priv = ocotp_dev;
ocotp_config.dev = dev;
ocotp_dev->nvmem = nvmem_register(&ocotp_config);
if (IS_ERR(ocotp_dev->nvmem))
return PTR_ERR(ocotp_dev->nvmem);
ocotp_dev->dev = dev;
platform_set_drvdata(pdev, ocotp_dev);
ocotp_dev->timing = vf610_ocotp_calculate_timing(ocotp_dev);
return 0;
}
static struct platform_driver vf610_ocotp_driver = {
.probe = vf610_ocotp_probe,
.remove = vf610_ocotp_remove,
.driver = {
.name = "vf610-ocotp",
.of_match_table = ocotp_of_match,
},
};
module_platform_driver(vf610_ocotp_driver);
MODULE_AUTHOR("Sanchayan Maity <[email protected]>");
MODULE_DESCRIPTION("Vybrid OCOTP driver");
MODULE_LICENSE("GPL v2");
| {
"pile_set_name": "Github"
} |
c
c dpodi computes the determinant and inverse of a certain
c double precision symmetric positive definite matrix (see below)
c using the factors computed by dpoco, dpofa or dqrdc.
c
c on entry
c
c a double precision(lda, n)
c the output a from dpoco or dpofa
c or the output x from dqrdc.
c
c lda integer
c the leading dimension of the array a .
c
c n integer
c the order of the matrix a .
c
c job integer
c = 11 both determinant and inverse.
c = 01 inverse only.
c = 10 determinant only.
c
c on return
c
c a if dpoco or dpofa was used to factor a then
c dpodi produces the upper half of inverse(a) .
c if dqrdc was used to decompose x then
c dpodi produces the upper half of inverse(trans(x)*x)
c where trans(x) is the transpose.
c elements of a below the diagonal are unchanged.
c if the units digit of job is zero, a is unchanged.
c
c det double precision(2)
c determinant of a or of trans(x)*x if requested.
c otherwise not referenced.
c determinant = det(1) * 10.0**det(2)
c with 1.0 .le. det(1) .lt. 10.0
c or det(1) .eq. 0.0 .
c
c error condition
c
c a division by zero will occur if the input factor contains
c a zero on the diagonal and the inverse is requested.
c it will not occur if the subroutines are called correctly
c and if dpoco or dpofa has set info .eq. 0 .
c
c linpack. this version dated 08/14/78 .
c cleve moler, university of new mexico, argonne national lab.
c
c subroutines and functions
c
c blas daxpy,dscal
c fortran mod
c
subroutine dpodi(a,lda,n,det,job)
integer lda,n,job
double precision a(lda,*)
double precision det(2)
c
c internal variables
c
double precision t
double precision s
integer i,j,jm1,k,kp1
c
c compute determinant
c
if (job/10 .eq. 0) go to 70
det(1) = 1.0d0
det(2) = 0.0d0
s = 10.0d0
do 50 i = 1, n
det(1) = a(i,i)**2*det(1)
c ...exit
if (det(1) .eq. 0.0d0) go to 60
10 if (det(1) .ge. 1.0d0) go to 20
det(1) = s*det(1)
det(2) = det(2) - 1.0d0
go to 10
20 continue
30 if (det(1) .lt. s) go to 40
det(1) = det(1)/s
det(2) = det(2) + 1.0d0
go to 30
40 continue
50 continue
60 continue
70 continue
c
c compute inverse(r)
c
if (mod(job,10) .eq. 0) go to 140
do 100 k = 1, n
a(k,k) = 1.0d0/a(k,k)
t = -a(k,k)
call dscal(k-1,t,a(1,k),1)
kp1 = k + 1
if (n .lt. kp1) go to 90
do 80 j = kp1, n
t = a(k,j)
a(k,j) = 0.0d0
call daxpy(k,t,a(1,k),1,a(1,j),1)
80 continue
90 continue
100 continue
c
c form inverse(r) * trans(inverse(r))
c
do 130 j = 1, n
jm1 = j - 1
if (jm1 .lt. 1) go to 120
do 110 k = 1, jm1
t = a(k,j)
call daxpy(k,t,a(1,j),1,a(1,k),1)
110 continue
120 continue
t = a(j,j)
call dscal(j,t,a(1,j),1)
130 continue
140 continue
return
end
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.oracle.webservices.internal.api.databinding;
import com.sun.xml.internal.ws.api.databinding.MetadataReader;
import com.sun.xml.internal.ws.model.ExternalMetadataReader;
import javax.xml.ws.WebServiceFeature;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* WebServiceFeature allowing to define either on server or client side external xml descriptors replacing/supplementing
* WS metadata provided by class annotations. This can be useful if those annotations are missing (existing non-WS
* components) or if it is necessary to override those.
*
* @author Miroslav Kos (miroslav.kos at oracle.com)
*/
public class ExternalMetadataFeature extends WebServiceFeature {
private static final String ID = "com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature";
/**
* Enable this feature. Defaults to true.
*/
private boolean enabled = true;
private List<String> resourceNames;
private List<File> files;
private MetadataReader reader;
private ExternalMetadataFeature() {
}
public void addResources(String... resourceNames) {
if (this.resourceNames == null) {
this.resourceNames = new ArrayList<String>();
}
Collections.addAll(this.resourceNames, resourceNames);
}
public List<String> getResourceNames() { return resourceNames; }
public void addFiles(File... files) {
if (this.files == null) {
this.files = new ArrayList<File>();
}
Collections.addAll(this.files, files);
}
public List<File> getFiles() { return files; }
public boolean isEnabled() {
return enabled;
}
private void setEnabled(final boolean x) {
enabled = x;
}
@Override
public String getID() {
return ID;
}
public MetadataReader getMetadataReader(ClassLoader classLoader, boolean disableXmlSecurity) {
if (reader != null && enabled) return reader;
return enabled ? new ExternalMetadataReader(files, resourceNames, classLoader, true, disableXmlSecurity) : null;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ExternalMetadataFeature that = (ExternalMetadataFeature) o;
if (enabled != that.enabled) return false;
if (files != null ? !files.equals(that.files) : that.files != null) return false;
if (resourceNames != null ? !resourceNames.equals(that.resourceNames) : that.resourceNames != null)
return false;
return true;
}
@Override
public int hashCode() {
int result = (enabled ? 1 : 0);
result = 31 * result + (resourceNames != null ? resourceNames.hashCode() : 0);
result = 31 * result + (files != null ? files.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "[" + getID() +
", enabled=" + enabled +
", resourceNames=" + resourceNames +
", files=" + files +
']';
}
public static Builder builder() {
return new Builder(new ExternalMetadataFeature());
}
public final static class Builder {
final private ExternalMetadataFeature o;
Builder(final ExternalMetadataFeature x) {
o = x;
}
public ExternalMetadataFeature build() {
return o;
}
public Builder addResources(String... res) {
o.addResources(res);
return this;
}
public Builder addFiles(File... files) {
o.addFiles(files);
return this;
}
public Builder setEnabled(boolean enabled) {
o.setEnabled(enabled);
return this;
}
public Builder setReader( MetadataReader r ) {
o.reader = r;
return this;
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* Sample dynamic sized record fifo implementation
*
* Copyright (C) 2010 Stefani Seibold <[email protected]>
*
* Released under the GPL version 2 only.
*
*/
#include <linux/init.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/mutex.h>
#include <linux/kfifo.h>
/*
* This module shows how to create a variable sized record fifo.
*/
/* fifo size in elements (bytes) */
#define FIFO_SIZE 128
/* name of the proc entry */
#define PROC_FIFO "record-fifo"
/* lock for procfs read access */
static DEFINE_MUTEX(read_lock);
/* lock for procfs write access */
static DEFINE_MUTEX(write_lock);
/*
* define DYNAMIC in this example for a dynamically allocated fifo.
*
* Otherwise the fifo storage will be a part of the fifo structure.
*/
#if 0
#define DYNAMIC
#endif
/*
* struct kfifo_rec_ptr_1 and STRUCT_KFIFO_REC_1 can handle records of a
* length between 0 and 255 bytes.
*
* struct kfifo_rec_ptr_2 and STRUCT_KFIFO_REC_2 can handle records of a
* length between 0 and 65535 bytes.
*/
#ifdef DYNAMIC
struct kfifo_rec_ptr_1 test;
#else
typedef STRUCT_KFIFO_REC_1(FIFO_SIZE) mytest;
static mytest test;
#endif
static const char *expected_result[] = {
"a",
"bb",
"ccc",
"dddd",
"eeeee",
"ffffff",
"ggggggg",
"hhhhhhhh",
"iiiiiiiii",
"jjjjjjjjjj",
};
static int __init testfunc(void)
{
char buf[100];
unsigned int i;
unsigned int ret;
struct { unsigned char buf[6]; } hello = { "hello" };
printk(KERN_INFO "record fifo test start\n");
kfifo_in(&test, &hello, sizeof(hello));
/* show the size of the next record in the fifo */
printk(KERN_INFO "fifo peek len: %u\n", kfifo_peek_len(&test));
/* put in variable length data */
for (i = 0; i < 10; i++) {
memset(buf, 'a' + i, i + 1);
kfifo_in(&test, buf, i + 1);
}
/* skip first element of the fifo */
printk(KERN_INFO "skip 1st element\n");
kfifo_skip(&test);
printk(KERN_INFO "fifo len: %u\n", kfifo_len(&test));
/* show the first record without removing from the fifo */
ret = kfifo_out_peek(&test, buf, sizeof(buf));
if (ret)
printk(KERN_INFO "%.*s\n", ret, buf);
/* check the correctness of all values in the fifo */
i = 0;
while (!kfifo_is_empty(&test)) {
ret = kfifo_out(&test, buf, sizeof(buf));
buf[ret] = '\0';
printk(KERN_INFO "item = %.*s\n", ret, buf);
if (strcmp(buf, expected_result[i++])) {
printk(KERN_WARNING "value mismatch: test failed\n");
return -EIO;
}
}
if (i != ARRAY_SIZE(expected_result)) {
printk(KERN_WARNING "size mismatch: test failed\n");
return -EIO;
}
printk(KERN_INFO "test passed\n");
return 0;
}
static ssize_t fifo_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
int ret;
unsigned int copied;
if (mutex_lock_interruptible(&write_lock))
return -ERESTARTSYS;
ret = kfifo_from_user(&test, buf, count, &copied);
mutex_unlock(&write_lock);
return ret ? ret : copied;
}
static ssize_t fifo_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
int ret;
unsigned int copied;
if (mutex_lock_interruptible(&read_lock))
return -ERESTARTSYS;
ret = kfifo_to_user(&test, buf, count, &copied);
mutex_unlock(&read_lock);
return ret ? ret : copied;
}
static const struct file_operations fifo_fops = {
.owner = THIS_MODULE,
.read = fifo_read,
.write = fifo_write,
.llseek = noop_llseek,
};
static int __init example_init(void)
{
#ifdef DYNAMIC
int ret;
ret = kfifo_alloc(&test, FIFO_SIZE, GFP_KERNEL);
if (ret) {
printk(KERN_ERR "error kfifo_alloc\n");
return ret;
}
#else
INIT_KFIFO(test);
#endif
if (testfunc() < 0) {
#ifdef DYNAMIC
kfifo_free(&test);
#endif
return -EIO;
}
if (proc_create(PROC_FIFO, 0, NULL, &fifo_fops) == NULL) {
#ifdef DYNAMIC
kfifo_free(&test);
#endif
return -ENOMEM;
}
return 0;
}
static void __exit example_exit(void)
{
remove_proc_entry(PROC_FIFO, NULL);
#ifdef DYNAMIC
kfifo_free(&test);
#endif
}
module_init(example_init);
module_exit(example_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Stefani Seibold <[email protected]>");
| {
"pile_set_name": "Github"
} |
/*
* (C) 2011 Thomas Renninger <[email protected]>, Novell Inc.
*
* Licensed under the terms of the GNU GPL License version 2.
*/
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <getopt.h>
#include <cpufreq.h>
#include "helpers/helpers.h"
#include "helpers/sysfs.h"
static struct option set_opts[] = {
{ .name = "perf-bias", .has_arg = optional_argument, .flag = NULL, .val = 'b'},
{ .name = "sched-mc", .has_arg = optional_argument, .flag = NULL, .val = 'm'},
{ .name = "sched-smt", .has_arg = optional_argument, .flag = NULL, .val = 's'},
{ },
};
static void print_wrong_arg_exit(void)
{
printf(_("invalid or unknown argument\n"));
exit(EXIT_FAILURE);
}
int cmd_info(int argc, char **argv)
{
extern char *optarg;
extern int optind, opterr, optopt;
unsigned int cpu;
union {
struct {
int sched_mc:1;
int sched_smt:1;
int perf_bias:1;
};
int params;
} params = {};
int ret = 0;
setlocale(LC_ALL, "");
textdomain(PACKAGE);
/* parameter parsing */
while ((ret = getopt_long(argc, argv, "msb", set_opts, NULL)) != -1) {
switch (ret) {
case 'b':
if (params.perf_bias)
print_wrong_arg_exit();
params.perf_bias = 1;
break;
case 'm':
if (params.sched_mc)
print_wrong_arg_exit();
params.sched_mc = 1;
break;
case 's':
if (params.sched_smt)
print_wrong_arg_exit();
params.sched_smt = 1;
break;
default:
print_wrong_arg_exit();
}
};
if (!params.params)
params.params = 0x7;
/* Default is: show output of CPU 0 only */
if (bitmask_isallclear(cpus_chosen))
bitmask_setbit(cpus_chosen, 0);
if (params.sched_mc) {
ret = sysfs_get_sched("mc");
printf(_("System's multi core scheduler setting: "));
if (ret < 0)
/* if sysfs file is missing it's: errno == ENOENT */
printf(_("not supported\n"));
else
printf("%d\n", ret);
}
if (params.sched_smt) {
ret = sysfs_get_sched("smt");
printf(_("System's thread sibling scheduler setting: "));
if (ret < 0)
/* if sysfs file is missing it's: errno == ENOENT */
printf(_("not supported\n"));
else
printf("%d\n", ret);
}
/* Add more per cpu options here */
if (!params.perf_bias)
return ret;
if (params.perf_bias) {
if (!run_as_root) {
params.perf_bias = 0;
printf(_("Intel's performance bias setting needs root privileges\n"));
} else if (!(cpupower_cpu_info.caps & CPUPOWER_CAP_PERF_BIAS)) {
printf(_("System does not support Intel's performance"
" bias setting\n"));
params.perf_bias = 0;
}
}
/* loop over CPUs */
for (cpu = bitmask_first(cpus_chosen);
cpu <= bitmask_last(cpus_chosen); cpu++) {
if (!bitmask_isbitset(cpus_chosen, cpu) ||
cpufreq_cpu_exists(cpu))
continue;
printf(_("analyzing CPU %d:\n"), cpu);
if (params.perf_bias) {
ret = msr_intel_get_perf_bias(cpu);
if (ret < 0) {
printf(_("Could not read perf-bias value\n"));
break;
} else
printf(_("perf-bias: %d\n"), ret);
}
}
return ret;
}
| {
"pile_set_name": "Github"
} |
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "services/device/public/cpp/generic_sensor/sensor_traits.h"
namespace device {
using mojom::SensorType;
double GetSensorMaxAllowedFrequency(SensorType type) {
switch (type) {
case SensorType::AMBIENT_LIGHT:
return SensorTraits<SensorType::AMBIENT_LIGHT>::kMaxAllowedFrequency;
case SensorType::PROXIMITY:
return SensorTraits<SensorType::PROXIMITY>::kMaxAllowedFrequency;
case SensorType::ACCELEROMETER:
return SensorTraits<SensorType::ACCELEROMETER>::kMaxAllowedFrequency;
case SensorType::LINEAR_ACCELERATION:
return SensorTraits<
SensorType::LINEAR_ACCELERATION>::kMaxAllowedFrequency;
case SensorType::GYROSCOPE:
return SensorTraits<SensorType::GYROSCOPE>::kMaxAllowedFrequency;
case SensorType::MAGNETOMETER:
return SensorTraits<SensorType::MAGNETOMETER>::kMaxAllowedFrequency;
case SensorType::PRESSURE:
return SensorTraits<SensorType::PRESSURE>::kMaxAllowedFrequency;
case SensorType::ABSOLUTE_ORIENTATION_EULER_ANGLES:
return SensorTraits<
SensorType::ABSOLUTE_ORIENTATION_EULER_ANGLES>::kMaxAllowedFrequency;
case SensorType::ABSOLUTE_ORIENTATION_QUATERNION:
return SensorTraits<
SensorType::ABSOLUTE_ORIENTATION_QUATERNION>::kMaxAllowedFrequency;
case SensorType::RELATIVE_ORIENTATION_EULER_ANGLES:
return SensorTraits<
SensorType::RELATIVE_ORIENTATION_EULER_ANGLES>::kMaxAllowedFrequency;
case SensorType::RELATIVE_ORIENTATION_QUATERNION:
return SensorTraits<
SensorType::RELATIVE_ORIENTATION_QUATERNION>::kMaxAllowedFrequency;
// No default so the compiler will warn us if a new type is added.
}
NOTREACHED() << "Unknown sensor type " << type;
return SensorTraits<SensorType::LAST>::kMaxAllowedFrequency;
}
double GetSensorDefaultFrequency(mojom::SensorType type) {
switch (type) {
case SensorType::AMBIENT_LIGHT:
return SensorTraits<SensorType::AMBIENT_LIGHT>::kDefaultFrequency;
case SensorType::PROXIMITY:
return SensorTraits<SensorType::PROXIMITY>::kDefaultFrequency;
case SensorType::ACCELEROMETER:
return SensorTraits<SensorType::ACCELEROMETER>::kDefaultFrequency;
case SensorType::LINEAR_ACCELERATION:
return SensorTraits<SensorType::LINEAR_ACCELERATION>::kDefaultFrequency;
case SensorType::GYROSCOPE:
return SensorTraits<SensorType::GYROSCOPE>::kDefaultFrequency;
case SensorType::MAGNETOMETER:
return SensorTraits<SensorType::MAGNETOMETER>::kDefaultFrequency;
case SensorType::PRESSURE:
return SensorTraits<SensorType::PRESSURE>::kDefaultFrequency;
case SensorType::ABSOLUTE_ORIENTATION_EULER_ANGLES:
return SensorTraits<
SensorType::ABSOLUTE_ORIENTATION_EULER_ANGLES>::kDefaultFrequency;
case SensorType::ABSOLUTE_ORIENTATION_QUATERNION:
return SensorTraits<
SensorType::ABSOLUTE_ORIENTATION_QUATERNION>::kDefaultFrequency;
case SensorType::RELATIVE_ORIENTATION_EULER_ANGLES:
return SensorTraits<
SensorType::RELATIVE_ORIENTATION_EULER_ANGLES>::kDefaultFrequency;
case SensorType::RELATIVE_ORIENTATION_QUATERNION:
return SensorTraits<
SensorType::RELATIVE_ORIENTATION_QUATERNION>::kDefaultFrequency;
// No default so the compiler will warn us if a new type is added.
}
NOTREACHED() << "Unknown sensor type " << type;
return SensorTraits<SensorType::LAST>::kDefaultFrequency;
}
} // namespace device
| {
"pile_set_name": "Github"
} |
/*
* Loader Library by Parra Studios
* A plugin for loading javascript code at run-time into a process.
*
* Copyright (C) 2016 - 2020 Vicente Eduardo Ferrer Garcia <[email protected]>
*
* 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.
*
*/
#ifndef JSM_LOADER_IMPL_H
#define JSM_LOADER_IMPL_H 1
#include <jsm_loader/jsm_loader_api.h>
#include <loader/loader_impl_interface.h>
#ifdef __cplusplus
extern "C" {
#endif
JSM_LOADER_API loader_impl_data jsm_loader_impl_initialize(loader_impl impl, configuration config, loader_host host);
JSM_LOADER_API int jsm_loader_impl_execution_path(loader_impl impl, const loader_naming_path path);
JSM_LOADER_API loader_handle jsm_loader_impl_load(loader_impl impl, const loader_naming_path path, loader_naming_name name);
JSM_LOADER_API int jsm_loader_impl_clear(loader_impl impl, loader_handle handle);
JSM_LOADER_API int jsm_loader_impl_discover(loader_impl impl, loader_handle handle, context ctx);
JSM_LOADER_API int jsm_loader_impl_destroy(loader_impl impl);
#ifdef __cplusplus
}
#endif
#endif /* JSM_LOADER_IMPL_H */
| {
"pile_set_name": "Github"
} |
using System;
using System.IO;
using System.IO.Compression;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
using Dasync.EETypes;
using Dasync.EETypes.Communication;
using Dasync.EETypes.Descriptors;
using Dasync.Serialization;
using Dasync.ValueContainer;
namespace Dasync.Communication.Http
{
public class HttpCommunicator : ICommunicator, ISynchronousCommunicator
{
private HttpClient _httpClient;
private ISerializer _serializer;
private string _urlTemplate;
private bool _compressPayload;
private MediaTypeHeaderValue _mediaTypeHeaderValue;
public HttpCommunicator(ISerializer serializer, string urlTemplate, bool compressPayload)
{
_serializer = serializer;
_urlTemplate = urlTemplate;
_httpClient = new HttpClient();
_compressPayload = compressPayload;
var mediaType = "application/" + _serializer.Format;
_mediaTypeHeaderValue = new MediaTypeHeaderValue(mediaType);
if (_serializer is ITextSerializer)
_mediaTypeHeaderValue.CharSet = "utf-8";
}
public string Type => HttpCommunicationMethod.MethodType;
public CommunicationTraits Traits =>
CommunicationTraits.Volatile |
CommunicationTraits.SyncReplies;
public async Task<InvokeRoutineResult> InvokeAsync(
MethodInvocationData data,
InvocationPreferences preferences)
{
HttpResponseMessage response;
using (var requestContent = CreateContent(data))
{
requestContent.Headers.TryAddWithoutValidation(DasyncHttpHeaders.Envelope, "invoke");
requestContent.Headers.TryAddWithoutValidation(DasyncHttpHeaders.IntentId, data.IntentId);
AddAsyncHeader(requestContent.Headers, preferAsync: !preferences.Synchronous);
AddCallerHeaders(requestContent.Headers, data.Caller);
AddRetryHeader(requestContent.Headers, retryCount: 0);
var url = _urlTemplate
.Replace("{serviceName}", data.Service.Name)
.Replace("{methodName}", data.Method.Name);
response = await _httpClient.PostAsync(url, requestContent);
}
using (response)
{
if ((int)response.StatusCode == DasyncHttpCodes.Scheduled)
{
return new InvokeRoutineResult
{
Outcome = InvocationOutcome.Scheduled
};
}
if ((int)response.StatusCode == DasyncHttpCodes.Deduplicated)
{
return new InvokeRoutineResult
{
Outcome = InvocationOutcome.Deduplicated
};
}
var methodOutcome = response.Headers.GetValue(DasyncHttpHeaders.TaskResult);
if (string.IsNullOrEmpty(methodOutcome))
{
throw new Exception(); // TODO: add info
}
var responseStream = await response.Content.ReadAsStreamAsync();
var encoding = response.Headers.GetContentEncoding();
if (!string.IsNullOrEmpty(encoding))
{
if ("gzip".Equals(encoding, StringComparison.OrdinalIgnoreCase))
{
responseStream = new GZipStream(responseStream, CompressionMode.Decompress);
}
else if ("deflate".Equals(encoding, StringComparison.OrdinalIgnoreCase))
{
responseStream = new DeflateStream(responseStream, CompressionMode.Decompress);
}
else
{
throw new Exception($"Unknown content encoding '{encoding}'.");
}
}
using (responseStream)
{
var taskResult = TaskResult.CreateEmpty(preferences.ResultValueType);
_serializer.Populate(responseStream, (IValueContainer)taskResult);
return new InvokeRoutineResult
{
Outcome = InvocationOutcome.Complete,
Result = taskResult
};
}
}
}
public async Task<ContinueRoutineResult> ContinueAsync(
MethodContinuationData data,
InvocationPreferences preferences)
{
HttpResponseMessage response;
using (var requestContent = CreateContent(data))
{
requestContent.Headers.TryAddWithoutValidation(DasyncHttpHeaders.Envelope, "continue");
requestContent.Headers.TryAddWithoutValidation(DasyncHttpHeaders.IntentId, data.IntentId);
AddAsyncHeader(requestContent.Headers, preferAsync: true);
AddCallerHeaders(requestContent.Headers, data.Caller);
AddRetryHeader(requestContent.Headers, retryCount: 0);
var url = _urlTemplate
.Replace("{serviceName}", data.Service.Name)
.Replace("{methodName}", data.Method.Name)
+ "/" + data.Method.IntentId;
if (!string.IsNullOrEmpty(data.Method.ETag))
url += "?etag=" + data.Method.ETag;
response = await _httpClient.PostAsync(url, requestContent);
}
using (response)
{
if ((int)response.StatusCode == DasyncHttpCodes.Scheduled)
{
return new ContinueRoutineResult
{
};
}
if ((int)response.StatusCode == DasyncHttpCodes.Deduplicated)
{
return new ContinueRoutineResult
{
};
}
throw new Exception(); // TODO: add info
}
}
public async Task<InvokeRoutineResult> GetInvocationResultAsync(
ServiceId serviceId,
MethodId methodId,
string intentId,
Type resultValueType,
CancellationToken ct)
{
var url = _urlTemplate
.Replace("{serviceName}", serviceId.Name)
.Replace("{methodName}", methodId.Name)
+ "/" + intentId;
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri(url)
};
request.Headers.TryAddWithoutValidation(DasyncHttpHeaders.Envelope, "poll");
if (_compressPayload)
request.Headers.TryAddWithoutValidation("Accept-Encoding", "gzip");
// TODO: add time for long polling
//AddAsyncHeader(message.Headers, preferAsync: false, waitTime: );
HttpResponseMessage response;
using (request)
{
response = await _httpClient.SendAsync(request, ct);
}
using (response)
{
if ((int)response.StatusCode == DasyncHttpCodes.Running)
{
return new InvokeRoutineResult
{
Outcome = InvocationOutcome.Unknown
};
}
var methodOutcome = response.Headers.GetValue(DasyncHttpHeaders.TaskResult);
if (string.IsNullOrEmpty(methodOutcome))
{
throw new Exception(); // TODO: add info
}
var responseStream = await response.Content.ReadAsStreamAsync();
var encoding = response.Headers.GetContentEncoding();
if (!string.IsNullOrEmpty(encoding))
{
if ("gzip".Equals(encoding, StringComparison.OrdinalIgnoreCase))
{
responseStream = new GZipStream(responseStream, CompressionMode.Decompress);
}
else if ("deflate".Equals(encoding, StringComparison.OrdinalIgnoreCase))
{
responseStream = new DeflateStream(responseStream, CompressionMode.Decompress);
}
else
{
throw new Exception($"Unknown content encoding '{encoding}'.");
}
}
using (responseStream)
{
var taskResult = TaskResult.CreateEmpty(resultValueType);
_serializer.Populate(responseStream, (IValueContainer)taskResult);
return new InvokeRoutineResult
{
Outcome = InvocationOutcome.Complete,
Result = taskResult
};
}
}
}
private void AddCallerHeaders(HttpContentHeaders headers, CallerDescriptor caller)
{
if (caller == null)
return;
if (!string.IsNullOrEmpty(caller.IntentId))
headers.TryAddWithoutValidation(DasyncHttpHeaders.CallerIntentId, caller.IntentId);
if (caller.Service != null)
{
headers.TryAddWithoutValidation(DasyncHttpHeaders.CallerServiceName, caller.Service.Name);
if (!string.IsNullOrEmpty(caller.Service.Proxy))
headers.TryAddWithoutValidation(DasyncHttpHeaders.CallerServiceProxy, caller.Service.Proxy);
}
if (caller.Method != null)
headers.TryAddWithoutValidation(DasyncHttpHeaders.CallerMethodName, caller.Method.Name);
if (caller.Event != null)
headers.TryAddWithoutValidation(DasyncHttpHeaders.CallerEventName, caller.Event.Name);
}
private void AddRetryHeader(HttpContentHeaders headers, int retryCount)
{
headers.TryAddWithoutValidation(DasyncHttpHeaders.Retry, retryCount > 0 ? "true" : "false");
}
private void AddAsyncHeader(HttpContentHeaders headers, bool preferAsync, TimeSpan? waitTime = null)
{
if (!preferAsync && !waitTime.HasValue)
return;
var headerValue = preferAsync ? "respond-async" : null;
if (waitTime.HasValue)
{
if (headerValue != null)
headerValue += ", ";
headerValue += "wait=";
headerValue += (int)waitTime.Value.TotalSeconds;
}
headers.TryAddWithoutValidation("Prefer", headerValue);
}
private HttpContent CreateContent(object envelope)
{
var bodyStream = new MemoryStream();
Stream writeStream = bodyStream;
if (_compressPayload)
writeStream = new GZipStream(writeStream, CompressionLevel.Optimal, leaveOpen: true);
_serializer.Serialize(writeStream, envelope);
if (_compressPayload)
writeStream.Dispose();
bodyStream.Position = 0;
var requestContent = new StreamContent(bodyStream);
requestContent.Headers.ContentType = _mediaTypeHeaderValue;
if (_compressPayload)
requestContent.Headers.ContentEncoding.Add("gzip");
return requestContent;
}
}
}
| {
"pile_set_name": "Github"
} |
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Globalization;
namespace StrongGrid.Utilities
{
/// <summary>
/// Converts a <see cref="DateTime" /> expressed in a format acceptable to SendGrid to and from JSON.
/// </summary>
/// <seealso cref="Newtonsoft.Json.Converters.DateTimeConverterBase" />
internal class SendGridDateTimeConverter : DateTimeConverterBase
{
private const string SENDGRID_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
/// <summary>
/// Determines whether this instance can convert the specified object type.
/// </summary>
/// <param name="objectType">Type of the object.</param>
/// <returns>
/// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.
/// </returns>
public override bool CanConvert(Type objectType)
{
return objectType == typeof(DateTime);
}
/// <summary>
/// Writes the JSON representation of the object.
/// </summary>
/// <param name="writer">The <see cref="T:Newtonsoft.Json.JsonWriter" /> to write to.</param>
/// <param name="value">The value.</param>
/// <param name="serializer">The calling serializer.</param>
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
if (value == null) return;
writer.WriteValue(((DateTime)value).ToString(SENDGRID_DATETIME_FORMAT));
}
/// <summary>
/// Reads the JSON representation of the object.
/// </summary>
/// <param name="reader">The <see cref="T:Newtonsoft.Json.JsonReader" /> to read from.</param>
/// <param name="objectType">Type of the object.</param>
/// <param name="existingValue">The existing value of object being read.</param>
/// <param name="serializer">The calling serializer.</param>
/// <returns>
/// The object value.
/// </returns>
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
if (reader.Value == null) return null;
var date = DateTime.ParseExact(reader.Value.ToString(), SENDGRID_DATETIME_FORMAT, new CultureInfo("en-US"), DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal);
return date;
}
}
}
| {
"pile_set_name": "Github"
} |
-----BEGIN CERTIFICATE-----
MIICYDCCAhKgAwIBAgIQAIC6aHfvpeVCfcZzLFSFuDAFBgMrZXAwgZ8xCzAJBgNV
BAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMQ0wCwYD
VQQEDARSb290MRAwDgYDVQQKDAd3b2xmU1NMMRAwDgYDVQQLDAdFRDI1NTE5MRgw
FgYDVQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29s
ZnNzbC5jb20wIhgPMjAxODA0MTIxNjIyMTdaGA8yMDIxMDEwNzE1MjIxN1owgZ0x
CzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFu
MQswCQYDVQQEDAJDQTEQMA4GA1UECgwHd29sZlNTTDEQMA4GA1UECwwHRUQyNTUx
OTEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZv
QHdvbGZzc2wuY29tMCowBQYDK2VwAyEAZap/BaQENKDqrR+phvDYf3LfqQ4ToDhm
Jl7rSDCASEmjYDBeMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFJI/lnIC+mEcIW2I
3evdPJsXxJ+3MB8GA1UdIwQYMBaAFP4BRn9vKz4csG/hzE0CJfdNCpW4MA4GA1Ud
DwEB/wQEAwIBxjAFBgMrZXADQQBMQNB/vPv0ohpY9nLj6NoYDZTcDv3B5wKleu7L
wn76ofwVmv4e4Dfff6t2UAbUPRplcz+S1ERip0yzKgGH4wYG
-----END CERTIFICATE-----
| {
"pile_set_name": "Github"
} |
// Modified by Princeton University on June 9th, 2015
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T1 Processor File: fsmuld_msb_near.s
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
*
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
*
* The above named 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 work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ========== Copyright Header End ============================================
*/
/***********************************************************************
* Name: fsmuld_msb_near.s
* Date: 11/6/02
*
*
**********************************************************************/
#define ENABLE_T0_Fp_disabled_0x20
#include "boot.s"
.global sam_fast_immu_miss
.global sam_fast_dmmu_miss
.text
.global main
! Testing fsmuld with rounding mode near
!// fsmuld_msb_near
!//
!// Test FSMULD on corner cases of carry into MSB out of multiplier
!// in round to nearest mode
!// Inputs are all combinations of positive and negative and:
!// - fraction is 0
!// - maximum fraction
main:
! Common code
wr %g0, 0x4, %fprs ! make sure fef is 1
setx source1, %l0, %l1
setx source2, %l0, %l2
setx result, %l0, %l3
setx fcc_result, %l0, %l4
setx cexc_flag, %l0, %l5
setx fsr_rounding_mode, %l0, %l6
setx scratch, %l0, %l7
set 256, %g1 ! Set loop count
set 0x0, %g2 ! Set loop iterator
fsmuld_loop:
ldx [%l6+0x0], %fsr
! instruction specific code
sll %g2, 0x2, %g3
ldx [%l6], %fsr ! Load fsr with rounding mode
ld [%l1+%g3], %f0 ! Load source 1
ld [%l2+%g3], %f2 ! Load source 2
fsmuld %f0, %f2, %f4 ! Perform the operation
std %f4, [%l7+0x0] ! Store the result for comparison
stx %fsr, [%l7+0x8] ! Store the fsr for comparison
ldx [%l7+0x0], %g4 ! Load result from memory for comparison
ldx [%l7+0x8], %g5 ! Load fsr from memory for comparison
sll %g2, 0x3, %g3
ldx [%l5+%g3], %g6 ! Load fsr with expected cexc mode
mov 0x0f, %g3 ! Mask for nv
and %g3, %g6, %g7 ! Mask off nv
srl %g7, 0x3, %g7 ! Shift to get of
or %g7, %g6, %g6 ! Generate correct nx with of
mov 0x01, %g3 ! Mask to get nx
and %g3, %g6, %g7 ! Mask off all but nx
sll %g7, 0x2, %g7 ! Shift to align nx and uf
or %g7, 0x1b, %g7 ! Mask for all cexc bits
and %g7, %g6, %g6 ! Generate correct uf for denorm
sll %g6, 0x5, %g7 ! Generate aexc
or %g6, %g7, %g7 ! Generate expected fsr
ldx [%l6], %g6 ! Load fsr with rounding mode
or %g6, %g7, %g7 ! Generate expected fsr
sll %g2, 0x3, %g3
ldx [%l3+%g3], %g6 ! Load expected result
subcc %g4, %g6, %g0 ! Compare
bne,a test_fail ! If not equal, test failed
nop
subcc %g5, %g7, %g0 ! Compare
bne,a test_fail ! If not equal, test failed
nop
add %g2, 0x1, %g2 ! Increment loop iterator
subcc %g2, %g1, %g0 ! Compare
bne,a fsmuld_loop ! Loop
nop
/*******************************************************
* Exit code
*******************************************************/
test_pass:
ta T_GOOD_TRAP
test_fail:
ta T_BAD_TRAP
/*******************************************************
* Data section
*******************************************************/
.data
fsr_rounding_mode:
.xword 0x0000000000000000
source1:
.word 0x5f000000
.word 0x5f000000
.word 0x5f000001
.word 0x5f7fffff
.word 0x5f800000
.word 0x5f800000
.word 0x5f800001
.word 0x5fffffff
.word 0x3f800000
.word 0x3f800000
.word 0x3f800001
.word 0x3fffffff
.word 0x40000000
.word 0x40000000
.word 0x40000001
.word 0x407fffff
.word 0x1f800000
.word 0x1f800000
.word 0x1f800001
.word 0x1fffffff
.word 0x1f800000
.word 0x1f800000
.word 0x1f800001
.word 0x1fffffff
.word 0x3f800000
.word 0x3f800000
.word 0x3f800001
.word 0x3fffffff
.word 0x3f000000
.word 0x3f000000
.word 0x3f000001
.word 0x3f7fffff
.word 0x5f800000
.word 0x5fffffff
.word 0x5fffffff
.word 0x5fffffff
.word 0x5f800000
.word 0x5fffffff
.word 0x5fffffff
.word 0x5fffffff
.word 0x3f800000
.word 0x3fffffff
.word 0x3fffffff
.word 0x3fffffff
.word 0x00000001
.word 0x007fffff
.word 0x007fffff
.word 0x007fffff
.word 0x20000000
.word 0x207fffff
.word 0x207fffff
.word 0x207fffff
.word 0x1f800000
.word 0x1fffffff
.word 0x1fffffff
.word 0x1fffffff
.word 0x00000001
.word 0x007fffff
.word 0x007fffff
.word 0x007fffff
.word 0x00000001
.word 0x007fffff
.word 0x007fffff
.word 0x007fffff
.word 0x5f000000
.word 0x5f000000
.word 0x5f000001
.word 0x5f7fffff
.word 0x5f800000
.word 0x5f800000
.word 0x5f800001
.word 0x5fffffff
.word 0x3f800000
.word 0x3f800000
.word 0x3f800001
.word 0x3fffffff
.word 0x40000000
.word 0x40000000
.word 0x40000001
.word 0x407fffff
.word 0x1f800000
.word 0x1f800000
.word 0x1f800001
.word 0x1fffffff
.word 0x1f800000
.word 0x1f800000
.word 0x1f800001
.word 0x1fffffff
.word 0x3f800000
.word 0x3f800000
.word 0x3f800001
.word 0x3fffffff
.word 0x3f000000
.word 0x3f000000
.word 0x3f000001
.word 0x3f7fffff
.word 0x5f800000
.word 0x5fffffff
.word 0x5fffffff
.word 0x5fffffff
.word 0x5f800000
.word 0x5fffffff
.word 0x5fffffff
.word 0x5fffffff
.word 0x3f800000
.word 0x3fffffff
.word 0x3fffffff
.word 0x3fffffff
.word 0x00000001
.word 0x007fffff
.word 0x007fffff
.word 0x007fffff
.word 0x20000000
.word 0x207fffff
.word 0x207fffff
.word 0x207fffff
.word 0x1f800000
.word 0x1fffffff
.word 0x1fffffff
.word 0x1fffffff
.word 0x00000001
.word 0x007fffff
.word 0x007fffff
.word 0x007fffff
.word 0x00000001
.word 0x007fffff
.word 0x007fffff
.word 0x007fffff
.word 0xdf000000
.word 0xdf000000
.word 0xdf000001
.word 0xdf7fffff
.word 0xdf800000
.word 0xdf800000
.word 0xdf800001
.word 0xdfffffff
.word 0xbf800000
.word 0xbf800000
.word 0xbf800001
.word 0xbfffffff
.word 0xc0000000
.word 0xc0000000
.word 0xc0000001
.word 0xc07fffff
.word 0x9f800000
.word 0x9f800000
.word 0x9f800001
.word 0x9fffffff
.word 0x9f800000
.word 0x9f800000
.word 0x9f800001
.word 0x9fffffff
.word 0xbf800000
.word 0xbf800000
.word 0xbf800001
.word 0xbfffffff
.word 0xbf000000
.word 0xbf000000
.word 0xbf000001
.word 0xbf7fffff
.word 0xdf800000
.word 0xdfffffff
.word 0xdfffffff
.word 0xdfffffff
.word 0xdf800000
.word 0xdfffffff
.word 0xdfffffff
.word 0xdfffffff
.word 0xbf800000
.word 0xbfffffff
.word 0xbfffffff
.word 0xbfffffff
.word 0x80000001
.word 0x807fffff
.word 0x807fffff
.word 0x807fffff
.word 0xa0000000
.word 0xa07fffff
.word 0xa07fffff
.word 0xa07fffff
.word 0x9f800000
.word 0x9fffffff
.word 0x9fffffff
.word 0x9fffffff
.word 0x80000001
.word 0x807fffff
.word 0x807fffff
.word 0x807fffff
.word 0x80000001
.word 0x807fffff
.word 0x807fffff
.word 0x807fffff
.word 0xdf000000
.word 0xdf000000
.word 0xdf000001
.word 0xdf7fffff
.word 0xdf800000
.word 0xdf800000
.word 0xdf800001
.word 0xdfffffff
.word 0xbf800000
.word 0xbf800000
.word 0xbf800001
.word 0xbfffffff
.word 0xc0000000
.word 0xc0000000
.word 0xc0000001
.word 0xc07fffff
.word 0x9f800000
.word 0x9f800000
.word 0x9f800001
.word 0x9fffffff
.word 0x9f800000
.word 0x9f800000
.word 0x9f800001
.word 0x9fffffff
.word 0xbf800000
.word 0xbf800000
.word 0xbf800001
.word 0xbfffffff
.word 0xbf000000
.word 0xbf000000
.word 0xbf000001
.word 0xbf7fffff
.word 0xdf800000
.word 0xdfffffff
.word 0xdfffffff
.word 0xdfffffff
.word 0xdf800000
.word 0xdfffffff
.word 0xdfffffff
.word 0xdfffffff
.word 0xbf800000
.word 0xbfffffff
.word 0xbfffffff
.word 0xbfffffff
.word 0x80000001
.word 0x807fffff
.word 0x807fffff
.word 0x807fffff
.word 0xa0000000
.word 0xa07fffff
.word 0xa07fffff
.word 0xa07fffff
.word 0x9f800000
.word 0x9fffffff
.word 0x9fffffff
.word 0x9fffffff
.word 0x80000001
.word 0x807fffff
.word 0x807fffff
.word 0x807fffff
.word 0x80000001
.word 0x807fffff
.word 0x807fffff
.word 0x807fffff
.align 8
source2:
.word 0x5f800000
.word 0x5fffffff
.word 0x5fffffff
.word 0x5fffffff
.word 0x5f800000
.word 0x5fffffff
.word 0x5fffffff
.word 0x5fffffff
.word 0x3f800000
.word 0x3fffffff
.word 0x3fffffff
.word 0x3fffffff
.word 0x00000001
.word 0x007fffff
.word 0x007fffff
.word 0x007fffff
.word 0x20000000
.word 0x207fffff
.word 0x207fffff
.word 0x207fffff
.word 0x1f800000
.word 0x1fffffff
.word 0x1fffffff
.word 0x1fffffff
.word 0x00000001
.word 0x007fffff
.word 0x007fffff
.word 0x007fffff
.word 0x00000001
.word 0x007fffff
.word 0x007fffff
.word 0x007fffff
.word 0x5f000000
.word 0x5f000000
.word 0x5f000001
.word 0x5f7fffff
.word 0x5f800000
.word 0x5f800000
.word 0x5f800001
.word 0x5fffffff
.word 0x3f800000
.word 0x3f800000
.word 0x3f800001
.word 0x3fffffff
.word 0x40000000
.word 0x40000000
.word 0x40000001
.word 0x407fffff
.word 0x1f800000
.word 0x1f800000
.word 0x1f800001
.word 0x1fffffff
.word 0x1f800000
.word 0x1f800000
.word 0x1f800001
.word 0x1fffffff
.word 0x3f800000
.word 0x3f800000
.word 0x3f800001
.word 0x3fffffff
.word 0x3f000000
.word 0x3f000000
.word 0x3f000001
.word 0x3f7fffff
.word 0xdf800000
.word 0xdfffffff
.word 0xdfffffff
.word 0xdfffffff
.word 0xdf800000
.word 0xdfffffff
.word 0xdfffffff
.word 0xdfffffff
.word 0xbf800000
.word 0xbfffffff
.word 0xbfffffff
.word 0xbfffffff
.word 0x80000001
.word 0x807fffff
.word 0x807fffff
.word 0x807fffff
.word 0xa0000000
.word 0xa07fffff
.word 0xa07fffff
.word 0xa07fffff
.word 0x9f800000
.word 0x9fffffff
.word 0x9fffffff
.word 0x9fffffff
.word 0x80000001
.word 0x807fffff
.word 0x807fffff
.word 0x807fffff
.word 0x80000001
.word 0x807fffff
.word 0x807fffff
.word 0x807fffff
.word 0xdf000000
.word 0xdf000000
.word 0xdf000001
.word 0xdf7fffff
.word 0xdf800000
.word 0xdf800000
.word 0xdf800001
.word 0xdfffffff
.word 0xbf800000
.word 0xbf800000
.word 0xbf800001
.word 0xbfffffff
.word 0xc0000000
.word 0xc0000000
.word 0xc0000001
.word 0xc07fffff
.word 0x9f800000
.word 0x9f800000
.word 0x9f800001
.word 0x9fffffff
.word 0x9f800000
.word 0x9f800000
.word 0x9f800001
.word 0x9fffffff
.word 0xbf800000
.word 0xbf800000
.word 0xbf800001
.word 0xbfffffff
.word 0xbf000000
.word 0xbf000000
.word 0xbf000001
.word 0xbf7fffff
.word 0x5f800000
.word 0x5fffffff
.word 0x5fffffff
.word 0x5fffffff
.word 0x5f800000
.word 0x5fffffff
.word 0x5fffffff
.word 0x5fffffff
.word 0x3f800000
.word 0x3fffffff
.word 0x3fffffff
.word 0x3fffffff
.word 0x00000001
.word 0x007fffff
.word 0x007fffff
.word 0x007fffff
.word 0x20000000
.word 0x207fffff
.word 0x207fffff
.word 0x207fffff
.word 0x1f800000
.word 0x1fffffff
.word 0x1fffffff
.word 0x1fffffff
.word 0x00000001
.word 0x007fffff
.word 0x007fffff
.word 0x007fffff
.word 0x00000001
.word 0x007fffff
.word 0x007fffff
.word 0x007fffff
.word 0x5f000000
.word 0x5f000000
.word 0x5f000001
.word 0x5f7fffff
.word 0x5f800000
.word 0x5f800000
.word 0x5f800001
.word 0x5fffffff
.word 0x3f800000
.word 0x3f800000
.word 0x3f800001
.word 0x3fffffff
.word 0x40000000
.word 0x40000000
.word 0x40000001
.word 0x407fffff
.word 0x1f800000
.word 0x1f800000
.word 0x1f800001
.word 0x1fffffff
.word 0x1f800000
.word 0x1f800000
.word 0x1f800001
.word 0x1fffffff
.word 0x3f800000
.word 0x3f800000
.word 0x3f800001
.word 0x3fffffff
.word 0x3f000000
.word 0x3f000000
.word 0x3f000001
.word 0x3f7fffff
.word 0xdf800000
.word 0xdfffffff
.word 0xdfffffff
.word 0xdfffffff
.word 0xdf800000
.word 0xdfffffff
.word 0xdfffffff
.word 0xdfffffff
.word 0xbf800000
.word 0xbfffffff
.word 0xbfffffff
.word 0xbfffffff
.word 0x80000001
.word 0x807fffff
.word 0x807fffff
.word 0x807fffff
.word 0xa0000000
.word 0xa07fffff
.word 0xa07fffff
.word 0xa07fffff
.word 0x9f800000
.word 0x9fffffff
.word 0x9fffffff
.word 0x9fffffff
.word 0x80000001
.word 0x807fffff
.word 0x807fffff
.word 0x807fffff
.word 0x80000001
.word 0x807fffff
.word 0x807fffff
.word 0x807fffff
.word 0xdf000000
.word 0xdf000000
.word 0xdf000001
.word 0xdf7fffff
.word 0xdf800000
.word 0xdf800000
.word 0xdf800001
.word 0xdfffffff
.word 0xbf800000
.word 0xbf800000
.word 0xbf800001
.word 0xbfffffff
.word 0xc0000000
.word 0xc0000000
.word 0xc0000001
.word 0xc07fffff
.word 0x9f800000
.word 0x9f800000
.word 0x9f800001
.word 0x9fffffff
.word 0x9f800000
.word 0x9f800000
.word 0x9f800001
.word 0x9fffffff
.word 0xbf800000
.word 0xbf800000
.word 0xbf800001
.word 0xbfffffff
.word 0xbf000000
.word 0xbf000000
.word 0xbf000001
.word 0xbf7fffff
.align 8
result:
.xword 0x47e0000000000000
.xword 0x47efffffe0000000
.xword 0x47f000000fffffe0
.xword 0x47ffffffc0000020
.xword 0x47f0000000000000
.xword 0x47ffffffe0000000
.xword 0x480000000fffffe0
.xword 0x480fffffc0000020
.xword 0x3ff0000000000000
.xword 0x3fffffffe0000000
.xword 0x400000000fffffe0
.xword 0x400fffffc0000020
.xword 0x36b0000000000000
.xword 0x381fffffc0000000
.xword 0x381fffffffffff80
.xword 0x382fffffa0000040
.xword 0x3800000000000000
.xword 0x380fffffe0000000
.xword 0x381000000fffffe0
.xword 0x381fffffc0000020
.xword 0x37f0000000000000
.xword 0x37ffffffe0000000
.xword 0x380000000fffffe0
.xword 0x380fffffc0000020
.xword 0x36a0000000000000
.xword 0x380fffffc0000000
.xword 0x380fffffffffff80
.xword 0x381fffffa0000040
.xword 0x3690000000000000
.xword 0x37ffffffc0000000
.xword 0x37ffffffffffff80
.xword 0x380fffffa0000040
.xword 0x47e0000000000000
.xword 0x47efffffe0000000
.xword 0x47f000000fffffe0
.xword 0x47ffffffc0000020
.xword 0x47f0000000000000
.xword 0x47ffffffe0000000
.xword 0x480000000fffffe0
.xword 0x480fffffc0000020
.xword 0x3ff0000000000000
.xword 0x3fffffffe0000000
.xword 0x400000000fffffe0
.xword 0x400fffffc0000020
.xword 0x36b0000000000000
.xword 0x381fffffc0000000
.xword 0x381fffffffffff80
.xword 0x382fffffa0000040
.xword 0x3800000000000000
.xword 0x380fffffe0000000
.xword 0x381000000fffffe0
.xword 0x381fffffc0000020
.xword 0x37f0000000000000
.xword 0x37ffffffe0000000
.xword 0x380000000fffffe0
.xword 0x380fffffc0000020
.xword 0x36a0000000000000
.xword 0x380fffffc0000000
.xword 0x380fffffffffff80
.xword 0x381fffffa0000040
.xword 0x3690000000000000
.xword 0x37ffffffc0000000
.xword 0x37ffffffffffff80
.xword 0x380fffffa0000040
.xword 0xc7e0000000000000
.xword 0xc7efffffe0000000
.xword 0xc7f000000fffffe0
.xword 0xc7ffffffc0000020
.xword 0xc7f0000000000000
.xword 0xc7ffffffe0000000
.xword 0xc80000000fffffe0
.xword 0xc80fffffc0000020
.xword 0xbff0000000000000
.xword 0xbfffffffe0000000
.xword 0xc00000000fffffe0
.xword 0xc00fffffc0000020
.xword 0xb6b0000000000000
.xword 0xb81fffffc0000000
.xword 0xb81fffffffffff80
.xword 0xb82fffffa0000040
.xword 0xb800000000000000
.xword 0xb80fffffe0000000
.xword 0xb81000000fffffe0
.xword 0xb81fffffc0000020
.xword 0xb7f0000000000000
.xword 0xb7ffffffe0000000
.xword 0xb80000000fffffe0
.xword 0xb80fffffc0000020
.xword 0xb6a0000000000000
.xword 0xb80fffffc0000000
.xword 0xb80fffffffffff80
.xword 0xb81fffffa0000040
.xword 0xb690000000000000
.xword 0xb7ffffffc0000000
.xword 0xb7ffffffffffff80
.xword 0xb80fffffa0000040
.xword 0xc7e0000000000000
.xword 0xc7efffffe0000000
.xword 0xc7f000000fffffe0
.xword 0xc7ffffffc0000020
.xword 0xc7f0000000000000
.xword 0xc7ffffffe0000000
.xword 0xc80000000fffffe0
.xword 0xc80fffffc0000020
.xword 0xbff0000000000000
.xword 0xbfffffffe0000000
.xword 0xc00000000fffffe0
.xword 0xc00fffffc0000020
.xword 0xb6b0000000000000
.xword 0xb81fffffc0000000
.xword 0xb81fffffffffff80
.xword 0xb82fffffa0000040
.xword 0xb800000000000000
.xword 0xb80fffffe0000000
.xword 0xb81000000fffffe0
.xword 0xb81fffffc0000020
.xword 0xb7f0000000000000
.xword 0xb7ffffffe0000000
.xword 0xb80000000fffffe0
.xword 0xb80fffffc0000020
.xword 0xb6a0000000000000
.xword 0xb80fffffc0000000
.xword 0xb80fffffffffff80
.xword 0xb81fffffa0000040
.xword 0xb690000000000000
.xword 0xb7ffffffc0000000
.xword 0xb7ffffffffffff80
.xword 0xb80fffffa0000040
.xword 0xc7e0000000000000
.xword 0xc7efffffe0000000
.xword 0xc7f000000fffffe0
.xword 0xc7ffffffc0000020
.xword 0xc7f0000000000000
.xword 0xc7ffffffe0000000
.xword 0xc80000000fffffe0
.xword 0xc80fffffc0000020
.xword 0xbff0000000000000
.xword 0xbfffffffe0000000
.xword 0xc00000000fffffe0
.xword 0xc00fffffc0000020
.xword 0xb6b0000000000000
.xword 0xb81fffffc0000000
.xword 0xb81fffffffffff80
.xword 0xb82fffffa0000040
.xword 0xb800000000000000
.xword 0xb80fffffe0000000
.xword 0xb81000000fffffe0
.xword 0xb81fffffc0000020
.xword 0xb7f0000000000000
.xword 0xb7ffffffe0000000
.xword 0xb80000000fffffe0
.xword 0xb80fffffc0000020
.xword 0xb6a0000000000000
.xword 0xb80fffffc0000000
.xword 0xb80fffffffffff80
.xword 0xb81fffffa0000040
.xword 0xb690000000000000
.xword 0xb7ffffffc0000000
.xword 0xb7ffffffffffff80
.xword 0xb80fffffa0000040
.xword 0xc7e0000000000000
.xword 0xc7efffffe0000000
.xword 0xc7f000000fffffe0
.xword 0xc7ffffffc0000020
.xword 0xc7f0000000000000
.xword 0xc7ffffffe0000000
.xword 0xc80000000fffffe0
.xword 0xc80fffffc0000020
.xword 0xbff0000000000000
.xword 0xbfffffffe0000000
.xword 0xc00000000fffffe0
.xword 0xc00fffffc0000020
.xword 0xb6b0000000000000
.xword 0xb81fffffc0000000
.xword 0xb81fffffffffff80
.xword 0xb82fffffa0000040
.xword 0xb800000000000000
.xword 0xb80fffffe0000000
.xword 0xb81000000fffffe0
.xword 0xb81fffffc0000020
.xword 0xb7f0000000000000
.xword 0xb7ffffffe0000000
.xword 0xb80000000fffffe0
.xword 0xb80fffffc0000020
.xword 0xb6a0000000000000
.xword 0xb80fffffc0000000
.xword 0xb80fffffffffff80
.xword 0xb81fffffa0000040
.xword 0xb690000000000000
.xword 0xb7ffffffc0000000
.xword 0xb7ffffffffffff80
.xword 0xb80fffffa0000040
.xword 0x47e0000000000000
.xword 0x47efffffe0000000
.xword 0x47f000000fffffe0
.xword 0x47ffffffc0000020
.xword 0x47f0000000000000
.xword 0x47ffffffe0000000
.xword 0x480000000fffffe0
.xword 0x480fffffc0000020
.xword 0x3ff0000000000000
.xword 0x3fffffffe0000000
.xword 0x400000000fffffe0
.xword 0x400fffffc0000020
.xword 0x36b0000000000000
.xword 0x381fffffc0000000
.xword 0x381fffffffffff80
.xword 0x382fffffa0000040
.xword 0x3800000000000000
.xword 0x380fffffe0000000
.xword 0x381000000fffffe0
.xword 0x381fffffc0000020
.xword 0x37f0000000000000
.xword 0x37ffffffe0000000
.xword 0x380000000fffffe0
.xword 0x380fffffc0000020
.xword 0x36a0000000000000
.xword 0x380fffffc0000000
.xword 0x380fffffffffff80
.xword 0x381fffffa0000040
.xword 0x3690000000000000
.xword 0x37ffffffc0000000
.xword 0x37ffffffffffff80
.xword 0x380fffffa0000040
.xword 0x47e0000000000000
.xword 0x47efffffe0000000
.xword 0x47f000000fffffe0
.xword 0x47ffffffc0000020
.xword 0x47f0000000000000
.xword 0x47ffffffe0000000
.xword 0x480000000fffffe0
.xword 0x480fffffc0000020
.xword 0x3ff0000000000000
.xword 0x3fffffffe0000000
.xword 0x400000000fffffe0
.xword 0x400fffffc0000020
.xword 0x36b0000000000000
.xword 0x381fffffc0000000
.xword 0x381fffffffffff80
.xword 0x382fffffa0000040
.xword 0x3800000000000000
.xword 0x380fffffe0000000
.xword 0x381000000fffffe0
.xword 0x381fffffc0000020
.xword 0x37f0000000000000
.xword 0x37ffffffe0000000
.xword 0x380000000fffffe0
.xword 0x380fffffc0000020
.xword 0x36a0000000000000
.xword 0x380fffffc0000000
.xword 0x380fffffffffff80
.xword 0x381fffffa0000040
.xword 0x3690000000000000
.xword 0x37ffffffc0000000
.xword 0x37ffffffffffff80
.xword 0x380fffffa0000040
.align 8
fcc_result:
cexc_flag:
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.xword 0x0000000000000000
.align 8
scratch:
.xword 0x0000000000000000
.xword 0x0000000000000000
| {
"pile_set_name": "Github"
} |
/**
* \file
*
* \brief Header file for SAMD20E15
*
* Copyright (c) 2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*
* \asf_license_stop
*
*/
#ifndef _SAMD20E15_
#define _SAMD20E15_
/**
* \ingroup SAMD20_definitions
* \addtogroup SAMD20E15_definitions SAMD20E15 definitions
* This file defines all structures and symbols for SAMD20E15:
* - registers and bitfields
* - peripheral base address
* - peripheral ID
* - PIO definitions
*/
/*@{*/
#ifdef __cplusplus
extern "C" {
#endif
#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
#include <stdint.h>
#ifndef __cplusplus
typedef volatile const uint32_t RoReg; /**< Read only 32-bit register (volatile const unsigned int) */
typedef volatile const uint16_t RoReg16; /**< Read only 16-bit register (volatile const unsigned int) */
typedef volatile const uint8_t RoReg8; /**< Read only 8-bit register (volatile const unsigned int) */
#else
typedef volatile uint32_t RoReg; /**< Read only 32-bit register (volatile const unsigned int) */
typedef volatile uint16_t RoReg16; /**< Read only 16-bit register (volatile const unsigned int) */
typedef volatile uint8_t RoReg8; /**< Read only 8-bit register (volatile const unsigned int) */
#endif
typedef volatile uint32_t WoReg; /**< Write only 32-bit register (volatile unsigned int) */
typedef volatile uint16_t WoReg16; /**< Write only 16-bit register (volatile unsigned int) */
typedef volatile uint32_t WoReg8; /**< Write only 8-bit register (volatile unsigned int) */
typedef volatile uint32_t RwReg; /**< Read-Write 32-bit register (volatile unsigned int) */
typedef volatile uint16_t RwReg16; /**< Read-Write 16-bit register (volatile unsigned int) */
typedef volatile uint8_t RwReg8; /**< Read-Write 8-bit register (volatile unsigned int) */
#define CAST(type, value) ((type *)(value))
#define REG_ACCESS(type, address) (*(type*)(address)) /**< C code: Register value */
#else
#define CAST(type, value) (value)
#define REG_ACCESS(type, address) (address) /**< Assembly code: Register address */
#endif
/* ************************************************************************** */
/** CMSIS DEFINITIONS FOR SAMD20E15 */
/* ************************************************************************** */
/** \defgroup SAMD20E15_cmsis CMSIS Definitions */
/*@{*/
/** Interrupt Number Definition */
typedef enum IRQn
{
/****** Cortex-M0+ Processor Exceptions Numbers ******************************/
NonMaskableInt_IRQn = -14,/**< 2 Non Maskable Interrupt */
HardFault_IRQn = -13,/**< 3 Cortex-M0+ Hard Fault Interrupt */
SVCall_IRQn = -5, /**< 11 Cortex-M0+ SV Call Interrupt */
PendSV_IRQn = -2, /**< 14 Cortex-M0+ Pend SV Interrupt */
SysTick_IRQn = -1, /**< 15 Cortex-M0+ System Tick Interrupt */
/****** SAMD20E15-specific Interrupt Numbers ***********************/
PM_IRQn = 0, /**< 0 SAMD20E15 Power Manager (PM) */
SYSCTRL_IRQn = 1, /**< 1 SAMD20E15 System Control (SYSCTRL) */
WDT_IRQn = 2, /**< 2 SAMD20E15 Watchdog Timer (WDT) */
RTC_IRQn = 3, /**< 3 SAMD20E15 Real-Time Counter (RTC) */
EIC_IRQn = 4, /**< 4 SAMD20E15 External Interrupt Controller (EIC) */
NVMCTRL_IRQn = 5, /**< 5 SAMD20E15 Non-Volatile Memory Controller (NVMCTRL) */
EVSYS_IRQn = 6, /**< 6 SAMD20E15 Event System Interface (EVSYS) */
SERCOM0_IRQn = 7, /**< 7 SAMD20E15 Serial Communication Interface 0 (SERCOM0) */
SERCOM1_IRQn = 8, /**< 8 SAMD20E15 Serial Communication Interface 1 (SERCOM1) */
SERCOM2_IRQn = 9, /**< 9 SAMD20E15 Serial Communication Interface 2 (SERCOM2) */
SERCOM3_IRQn = 10, /**< 10 SAMD20E15 Serial Communication Interface 3 (SERCOM3) */
TC0_IRQn = 13, /**< 13 SAMD20E15 Basic Timer Counter 0 (TC0) */
TC1_IRQn = 14, /**< 14 SAMD20E15 Basic Timer Counter 1 (TC1) */
TC2_IRQn = 15, /**< 15 SAMD20E15 Basic Timer Counter 2 (TC2) */
TC3_IRQn = 16, /**< 16 SAMD20E15 Basic Timer Counter 3 (TC3) */
TC4_IRQn = 17, /**< 17 SAMD20E15 Basic Timer Counter 4 (TC4) */
TC5_IRQn = 18, /**< 18 SAMD20E15 Basic Timer Counter 5 (TC5) */
ADC_IRQn = 21, /**< 21 SAMD20E15 Analog Digital Converter (ADC) */
AC_IRQn = 22, /**< 22 SAMD20E15 Analog Comparators (AC) */
DAC_IRQn = 23, /**< 23 SAMD20E15 Digital Analog Converter (DAC) */
PTC_IRQn = 24, /**< 24 SAMD20E15 Peripheral Touch Controller (PTC) */
PERIPH_COUNT_IRQn = 25 /**< Number of peripheral IDs */
} IRQn_Type;
typedef struct _DeviceVectors
{
/* Stack pointer */
void* pvStack;
/* Cortex-M handlers */
void* pfnReset_Handler;
void* pfnNMI_Handler;
void* pfnHardFault_Handler;
void* pfnReservedM12;
void* pfnReservedM11;
void* pfnReservedM10;
void* pfnReservedM9;
void* pfnReservedM8;
void* pfnReservedM7;
void* pfnReservedM6;
void* pfnSVC_Handler;
void* pfnReservedM4;
void* pfnReservedM3;
void* pfnPendSV_Handler;
void* pfnSysTick_Handler;
/* Peripheral handlers */
void* pfnPM_Handler; /* 0 Power Manager */
void* pfnSYSCTRL_Handler; /* 1 System Control */
void* pfnWDT_Handler; /* 2 Watchdog Timer */
void* pfnRTC_Handler; /* 3 Real-Time Counter */
void* pfnEIC_Handler; /* 4 External Interrupt Controller */
void* pfnNVMCTRL_Handler; /* 5 Non-Volatile Memory Controller */
void* pfnEVSYS_Handler; /* 6 Event System Interface */
void* pfnSERCOM0_Handler; /* 7 Serial Communication Interface 0 */
void* pfnSERCOM1_Handler; /* 8 Serial Communication Interface 1 */
void* pfnSERCOM2_Handler; /* 9 Serial Communication Interface 2 */
void* pfnSERCOM3_Handler; /* 10 Serial Communication Interface 3 */
void* pfnReserved11;
void* pfnReserved12;
void* pfnTC0_Handler; /* 13 Basic Timer Counter 0 */
void* pfnTC1_Handler; /* 14 Basic Timer Counter 1 */
void* pfnTC2_Handler; /* 15 Basic Timer Counter 2 */
void* pfnTC3_Handler; /* 16 Basic Timer Counter 3 */
void* pfnTC4_Handler; /* 17 Basic Timer Counter 4 */
void* pfnTC5_Handler; /* 18 Basic Timer Counter 5 */
void* pfnReserved19;
void* pfnReserved20;
void* pfnADC_Handler; /* 21 Analog Digital Converter */
void* pfnAC_Handler; /* 22 Analog Comparators */
void* pfnDAC_Handler; /* 23 Digital Analog Converter */
void* pfnPTC_Handler; /* 24 Peripheral Touch Controller */
} DeviceVectors;
/* Cortex-M0+ processor handlers */
void Reset_Handler ( void );
void NMI_Handler ( void );
void HardFault_Handler ( void );
void SVC_Handler ( void );
void PendSV_Handler ( void );
void SysTick_Handler ( void );
/* Peripherals handlers */
void PM_Handler ( void );
void SYSCTRL_Handler ( void );
void WDT_Handler ( void );
void RTC_Handler ( void );
void EIC_Handler ( void );
void NVMCTRL_Handler ( void );
void EVSYS_Handler ( void );
void SERCOM0_Handler ( void );
void SERCOM1_Handler ( void );
void SERCOM2_Handler ( void );
void SERCOM3_Handler ( void );
void TC0_Handler ( void );
void TC1_Handler ( void );
void TC2_Handler ( void );
void TC3_Handler ( void );
void TC4_Handler ( void );
void TC5_Handler ( void );
void ADC_Handler ( void );
void AC_Handler ( void );
void DAC_Handler ( void );
void PTC_Handler ( void );
/*
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
*/
#define LITTLE_ENDIAN 1
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
#define __MPU_PRESENT 0 /*!< MPU present or not */
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
#define __VTOR_PRESENT 1 /*!< VTOR present or not */
#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
/**
* \brief CMSIS includes
*/
#include <core_cm0plus.h>
#if !defined DONT_USE_CMSIS_INIT
#include "system_samd20.h"
#endif /* DONT_USE_CMSIS_INIT */
/*@}*/
/* ************************************************************************** */
/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMD20E15 */
/* ************************************************************************** */
/** \defgroup SAMD20E15_api Peripheral Software API */
/*@{*/
#include "component/ac.h"
#include "component/adc.h"
#include "component/dac.h"
#include "component/dsu.h"
#include "component/eic.h"
#include "component/evsys.h"
#include "component/gclk.h"
#include "component/nvmctrl.h"
#include "component/pac.h"
#include "component/pm.h"
#include "component/port.h"
#include "component/rtc.h"
#include "component/sercom.h"
#include "component/sysctrl.h"
#include "component/tc.h"
#include "component/wdt.h"
/*@}*/
/* ************************************************************************** */
/** REGISTERS ACCESS DEFINITIONS FOR SAMD20E15 */
/* ************************************************************************** */
/** \defgroup SAMD20E15_reg Registers Access Definitions */
/*@{*/
#include "instance/ac.h"
#include "instance/adc.h"
#include "instance/dac.h"
#include "instance/dsu.h"
#include "instance/eic.h"
#include "instance/evsys.h"
#include "instance/gclk.h"
#include "instance/nvmctrl.h"
#include "instance/pac0.h"
#include "instance/pac1.h"
#include "instance/pac2.h"
#include "instance/pm.h"
#include "instance/port.h"
#include "instance/rtc.h"
#include "instance/sercom0.h"
#include "instance/sercom1.h"
#include "instance/sercom2.h"
#include "instance/sercom3.h"
#include "instance/sysctrl.h"
#include "instance/tc0.h"
#include "instance/tc1.h"
#include "instance/tc2.h"
#include "instance/tc3.h"
#include "instance/tc4.h"
#include "instance/tc5.h"
#include "instance/wdt.h"
/*@}*/
/* ************************************************************************** */
/** PERIPHERAL ID DEFINITIONS FOR SAMD20E15 */
/* ************************************************************************** */
/** \defgroup SAMD20E15_id Peripheral Ids Definitions */
/*@{*/
// Peripheral instances on HPB0 bridge
#define ID_PAC0 0 /**< \brief Peripheral Access Controller 0 (PAC0) */
#define ID_PM 1 /**< \brief Power Manager (PM) */
#define ID_SYSCTRL 2 /**< \brief System Control (SYSCTRL) */
#define ID_GCLK 3 /**< \brief Generic Clock Generator (GCLK) */
#define ID_WDT 4 /**< \brief Watchdog Timer (WDT) */
#define ID_RTC 5 /**< \brief Real-Time Counter (RTC) */
#define ID_EIC 6 /**< \brief External Interrupt Controller (EIC) */
// Peripheral instances on HPB1 bridge
#define ID_PAC1 32 /**< \brief Peripheral Access Controller 1 (PAC1) */
#define ID_DSU 33 /**< \brief Device Service Unit (DSU) */
#define ID_NVMCTRL 34 /**< \brief Non-Volatile Memory Controller (NVMCTRL) */
#define ID_PORT 35 /**< \brief Port Module (PORT) */
// Peripheral instances on HPB2 bridge
#define ID_PAC2 64 /**< \brief Peripheral Access Controller 2 (PAC2) */
#define ID_EVSYS 65 /**< \brief Event System Interface (EVSYS) */
#define ID_SERCOM0 66 /**< \brief Serial Communication Interface 0 (SERCOM0) */
#define ID_SERCOM1 67 /**< \brief Serial Communication Interface 1 (SERCOM1) */
#define ID_SERCOM2 68 /**< \brief Serial Communication Interface 2 (SERCOM2) */
#define ID_SERCOM3 69 /**< \brief Serial Communication Interface 3 (SERCOM3) */
#define ID_TC0 72 /**< \brief Basic Timer Counter 0 (TC0) */
#define ID_TC1 73 /**< \brief Basic Timer Counter 1 (TC1) */
#define ID_TC2 74 /**< \brief Basic Timer Counter 2 (TC2) */
#define ID_TC3 75 /**< \brief Basic Timer Counter 3 (TC3) */
#define ID_TC4 76 /**< \brief Basic Timer Counter 4 (TC4) */
#define ID_TC5 77 /**< \brief Basic Timer Counter 5 (TC5) */
#define ID_ADC 80 /**< \brief Analog Digital Converter (ADC) */
#define ID_AC 81 /**< \brief Analog Comparators (AC) */
#define ID_DAC 82 /**< \brief Digital Analog Converter (DAC) */
#define ID_PTC 83 /**< \brief Peripheral Touch Controller (PTC) */
#define ID_PERIPH_COUNT 84 /**< \brief Number of peripheral IDs */
/*@}*/
/* ************************************************************************** */
/** BASE ADDRESS DEFINITIONS FOR SAMD20E15 */
/* ************************************************************************** */
/** \defgroup SAMD20E15_base Peripheral Base Address Definitions */
/*@{*/
#if defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)
#define AC (0x42004400UL) /**< \brief (AC) APB Base Address */
#define ADC (0x42004000UL) /**< \brief (ADC) APB Base Address */
#define DAC (0x42004800UL) /**< \brief (DAC) APB Base Address */
#define DSU (0x41002000UL) /**< \brief (DSU) APB Base Address */
#define EIC (0x40001800UL) /**< \brief (EIC) APB Base Address */
#define EVSYS (0x42000400UL) /**< \brief (EVSYS) APB Base Address */
#define GCLK (0x40000C00UL) /**< \brief (GCLK) APB Base Address */
#define NVMCTRL (0x41004000UL) /**< \brief (NVMCTRL) APB Base Address */
#define NVMCTRL_CAL (0x00800000UL) /**< \brief (NVMCTRL) CAL Base Address */
#define NVMCTRL_LOCKBIT (0x00802000UL) /**< \brief (NVMCTRL) LOCKBIT Base Address */
#define NVMCTRL_OTP1 (0x00806000UL) /**< \brief (NVMCTRL) OTP1 Base Address */
#define NVMCTRL_OTP2 (0x00806008UL) /**< \brief (NVMCTRL) OTP2 Base Address */
#define NVMCTRL_OTP4 (0x00806020UL) /**< \brief (NVMCTRL) OTP4 Base Address */
#define NVMCTRL_TEMP_LOG (0x00806030UL) /**< \brief (NVMCTRL) TEMP_LOG Base Address */
#define NVMCTRL_USER (0x00804000UL) /**< \brief (NVMCTRL) USER Base Address */
#define PAC0 (0x40000000UL) /**< \brief (PAC0) APB Base Address */
#define PAC1 (0x41000000UL) /**< \brief (PAC1) APB Base Address */
#define PAC2 (0x42000000UL) /**< \brief (PAC2) APB Base Address */
#define PM (0x40000400UL) /**< \brief (PM) APB Base Address */
#define PORT (0x41004400UL) /**< \brief (PORT) APB Base Address */
#define PORT_IOBUS (0x60000000UL) /**< \brief (PORT) IOBUS Base Address */
#define RTC (0x40001400UL) /**< \brief (RTC) APB Base Address */
#define SERCOM0 (0x42000800UL) /**< \brief (SERCOM0) APB Base Address */
#define SERCOM1 (0x42000C00UL) /**< \brief (SERCOM1) APB Base Address */
#define SERCOM2 (0x42001000UL) /**< \brief (SERCOM2) APB Base Address */
#define SERCOM3 (0x42001400UL) /**< \brief (SERCOM3) APB Base Address */
#define SYSCTRL (0x40000800UL) /**< \brief (SYSCTRL) APB Base Address */
#define TC0 (0x42002000UL) /**< \brief (TC0) APB Base Address */
#define TC1 (0x42002400UL) /**< \brief (TC1) APB Base Address */
#define TC2 (0x42002800UL) /**< \brief (TC2) APB Base Address */
#define TC3 (0x42002C00UL) /**< \brief (TC3) APB Base Address */
#define TC4 (0x42003000UL) /**< \brief (TC4) APB Base Address */
#define TC5 (0x42003400UL) /**< \brief (TC5) APB Base Address */
#define WDT (0x40001000UL) /**< \brief (WDT) APB Base Address */
#else
#define AC ((Ac *)0x42004400UL) /**< \brief (AC) APB Base Address */
#define AC_INST_NUM 1 /**< \brief (AC) Number of instances */
#define AC_INSTS { AC } /**< \brief (AC) Instances List */
#define ADC ((Adc *)0x42004000UL) /**< \brief (ADC) APB Base Address */
#define ADC_INST_NUM 1 /**< \brief (ADC) Number of instances */
#define ADC_INSTS { ADC } /**< \brief (ADC) Instances List */
#define DAC ((Dac *)0x42004800UL) /**< \brief (DAC) APB Base Address */
#define DAC_INST_NUM 1 /**< \brief (DAC) Number of instances */
#define DAC_INSTS { DAC } /**< \brief (DAC) Instances List */
#define DSU ((Dsu *)0x41002000UL) /**< \brief (DSU) APB Base Address */
#define DSU_INST_NUM 1 /**< \brief (DSU) Number of instances */
#define DSU_INSTS { DSU } /**< \brief (DSU) Instances List */
#define EIC ((Eic *)0x40001800UL) /**< \brief (EIC) APB Base Address */
#define EIC_INST_NUM 1 /**< \brief (EIC) Number of instances */
#define EIC_INSTS { EIC } /**< \brief (EIC) Instances List */
#define EVSYS ((Evsys *)0x42000400UL) /**< \brief (EVSYS) APB Base Address */
#define EVSYS_INST_NUM 1 /**< \brief (EVSYS) Number of instances */
#define EVSYS_INSTS { EVSYS } /**< \brief (EVSYS) Instances List */
#define GCLK ((Gclk *)0x40000C00UL) /**< \brief (GCLK) APB Base Address */
#define GCLK_INST_NUM 1 /**< \brief (GCLK) Number of instances */
#define GCLK_INSTS { GCLK } /**< \brief (GCLK) Instances List */
#define NVMCTRL ((Nvmctrl *)0x41004000UL) /**< \brief (NVMCTRL) APB Base Address */
#define NVMCTRL_CAL (0x00800000UL) /**< \brief (NVMCTRL) CAL Base Address */
#define NVMCTRL_LOCKBIT (0x00802000UL) /**< \brief (NVMCTRL) LOCKBIT Base Address */
#define NVMCTRL_OTP1 (0x00806000UL) /**< \brief (NVMCTRL) OTP1 Base Address */
#define NVMCTRL_OTP2 (0x00806008UL) /**< \brief (NVMCTRL) OTP2 Base Address */
#define NVMCTRL_OTP4 (0x00806020UL) /**< \brief (NVMCTRL) OTP4 Base Address */
#define NVMCTRL_TEMP_LOG (0x00806030UL) /**< \brief (NVMCTRL) TEMP_LOG Base Address */
#define NVMCTRL_USER (0x00804000UL) /**< \brief (NVMCTRL) USER Base Address */
#define NVMCTRL_INST_NUM 1 /**< \brief (NVMCTRL) Number of instances */
#define NVMCTRL_INSTS { NVMCTRL } /**< \brief (NVMCTRL) Instances List */
#define PAC0 ((Pac *)0x40000000UL) /**< \brief (PAC0) APB Base Address */
#define PAC1 ((Pac *)0x41000000UL) /**< \brief (PAC1) APB Base Address */
#define PAC2 ((Pac *)0x42000000UL) /**< \brief (PAC2) APB Base Address */
#define PAC_INST_NUM 3 /**< \brief (PAC) Number of instances */
#define PAC_INSTS { PAC0, PAC1, PAC2 } /**< \brief (PAC) Instances List */
#define PM ((Pm *)0x40000400UL) /**< \brief (PM) APB Base Address */
#define PM_INST_NUM 1 /**< \brief (PM) Number of instances */
#define PM_INSTS { PM } /**< \brief (PM) Instances List */
#define PORT ((Port *)0x41004400UL) /**< \brief (PORT) APB Base Address */
#define PORT_IOBUS ((Port *)0x60000000UL) /**< \brief (PORT) IOBUS Base Address */
#define PORT_INST_NUM 1 /**< \brief (PORT) Number of instances */
#define PORT_INSTS { PORT } /**< \brief (PORT) Instances List */
#define PTC_GCLK_ID 27
#define PTC_INST_NUM 1 /**< \brief (PTC) Number of instances */
#define PTC_INSTS { PTC } /**< \brief (PTC) Instances List */
#define RTC ((Rtc *)0x40001400UL) /**< \brief (RTC) APB Base Address */
#define RTC_INST_NUM 1 /**< \brief (RTC) Number of instances */
#define RTC_INSTS { RTC } /**< \brief (RTC) Instances List */
#define SERCOM0 ((Sercom *)0x42000800UL) /**< \brief (SERCOM0) APB Base Address */
#define SERCOM1 ((Sercom *)0x42000C00UL) /**< \brief (SERCOM1) APB Base Address */
#define SERCOM2 ((Sercom *)0x42001000UL) /**< \brief (SERCOM2) APB Base Address */
#define SERCOM3 ((Sercom *)0x42001400UL) /**< \brief (SERCOM3) APB Base Address */
#define SERCOM_INST_NUM 4 /**< \brief (SERCOM) Number of instances */
#define SERCOM_INSTS { SERCOM0, SERCOM1, SERCOM2, SERCOM3 } /**< \brief (SERCOM) Instances List */
#define SYSCTRL ((Sysctrl *)0x40000800UL) /**< \brief (SYSCTRL) APB Base Address */
#define SYSCTRL_INST_NUM 1 /**< \brief (SYSCTRL) Number of instances */
#define SYSCTRL_INSTS { SYSCTRL } /**< \brief (SYSCTRL) Instances List */
#define TC0 ((Tc *)0x42002000UL) /**< \brief (TC0) APB Base Address */
#define TC1 ((Tc *)0x42002400UL) /**< \brief (TC1) APB Base Address */
#define TC2 ((Tc *)0x42002800UL) /**< \brief (TC2) APB Base Address */
#define TC3 ((Tc *)0x42002C00UL) /**< \brief (TC3) APB Base Address */
#define TC4 ((Tc *)0x42003000UL) /**< \brief (TC4) APB Base Address */
#define TC5 ((Tc *)0x42003400UL) /**< \brief (TC5) APB Base Address */
#define TC_INST_NUM 6 /**< \brief (TC) Number of instances */
#define TC_INSTS { TC0, TC1, TC2, TC3, TC4, TC5 } /**< \brief (TC) Instances List */
#define WDT ((Wdt *)0x40001000UL) /**< \brief (WDT) APB Base Address */
#define WDT_INST_NUM 1 /**< \brief (WDT) Number of instances */
#define WDT_INSTS { WDT } /**< \brief (WDT) Instances List */
#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
/*@}*/
/* ************************************************************************** */
/** PORT DEFINITIONS FOR SAMD20E15 */
/* ************************************************************************** */
/** \defgroup SAMD20E15_port PORT Definitions */
/*@{*/
#include "pio/samd20e15.h"
/*@}*/
/* ************************************************************************** */
/** MEMORY MAPPING DEFINITIONS FOR SAMD20E15 */
/* ************************************************************************** */
#define FLASH_SIZE 0x8000UL /* 32 kB */
#define FLASH_PAGE_SIZE 64
#define FLASH_NB_OF_PAGES 512
#define FLASH_USER_PAGE_SIZE 64
#define HRAMC0_SIZE 0x1000UL /* 4 kB */
#define FLASH_ADDR (0x00000000UL) /**< FLASH base address */
#define FLASH_USER_PAGE_ADDR (0x00800000UL) /**< FLASH_USER_PAGE base address */
#define HRAMC0_ADDR (0x20000000UL) /**< HRAMC0 base address */
#define DSU_DID_RESETVALUE 0x1000130DUL
#define PORT_GROUPS 1
/* ************************************************************************** */
/** ELECTRICAL DEFINITIONS FOR SAMD20E15 */
/* ************************************************************************** */
#ifdef __cplusplus
}
#endif
/*@}*/
#endif /* SAMD20E15_H */
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
| {
"pile_set_name": "Github"
} |
/*
* Tencent is pleased to support the open source community by making Tinker available.
*
* Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* 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.tencent.tinker.anno;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.LinkedHashSet;
import java.util.Scanner;
import java.util.Set;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic;
import javax.tools.JavaFileObject;
/**
* Tinker Annotations Processor
*
* Created by zhaoyuan on 16/3/31.
*/
@SupportedSourceVersion(SourceVersion.RELEASE_7)
public class AnnotationProcessor extends AbstractProcessor {
private static final String SUFFIX = "$$DefaultLifeCycle";
private static final String APPLICATION_TEMPLATE_PATH = "/TinkerAnnoApplication.tmpl";
@Override
public Set<String> getSupportedAnnotationTypes() {
final Set<String> supportedAnnotationTypes = new LinkedHashSet<>();
supportedAnnotationTypes.add(DefaultLifeCycle.class.getName());
return supportedAnnotationTypes;
}
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
processDefaultLifeCycle(roundEnv.getElementsAnnotatedWith(DefaultLifeCycle.class));
return true;
}
private void processDefaultLifeCycle(Set<? extends Element> elements) {
// DefaultLifeCycle
for (Element e : elements) {
DefaultLifeCycle ca = e.getAnnotation(DefaultLifeCycle.class);
String lifeCycleClassName = ((TypeElement) e).getQualifiedName().toString();
String lifeCyclePackageName = lifeCycleClassName.substring(0, lifeCycleClassName.lastIndexOf('.'));
lifeCycleClassName = lifeCycleClassName.substring(lifeCycleClassName.lastIndexOf('.') + 1);
String applicationClassName = ca.application();
if (applicationClassName.startsWith(".")) {
applicationClassName = lifeCyclePackageName + applicationClassName;
}
String applicationPackageName = applicationClassName.substring(0, applicationClassName.lastIndexOf('.'));
applicationClassName = applicationClassName.substring(applicationClassName.lastIndexOf('.') + 1);
String loaderClassName = ca.loaderClass();
if (loaderClassName.startsWith(".")) {
loaderClassName = lifeCyclePackageName + loaderClassName;
}
final InputStream is = AnnotationProcessor.class.getResourceAsStream(APPLICATION_TEMPLATE_PATH);
final Scanner scanner = new Scanner(is);
final String template = scanner.useDelimiter("\\A").next();
final String fileContent = template
.replaceAll("%PACKAGE%", applicationPackageName)
.replaceAll("%APPLICATION%", applicationClassName)
.replaceAll("%APPLICATION_LIFE_CYCLE%", lifeCyclePackageName + "." + lifeCycleClassName)
.replaceAll("%TINKER_FLAGS%", "" + ca.flags())
.replaceAll("%TINKER_LOADER_CLASS%", "" + loaderClassName)
.replaceAll("%TINKER_LOAD_VERIFY_FLAG%", "" + ca.loadVerifyFlag())
.replaceAll("%TINKER_USE_DLC%", "" + ca.useDelegateLastClassLoader());
try {
JavaFileObject fileObject = processingEnv.getFiler().createSourceFile(applicationPackageName + "." + applicationClassName);
processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Creating " + fileObject.toUri());
Writer writer = fileObject.openWriter();
try {
PrintWriter pw = new PrintWriter(writer);
pw.print(fileContent);
pw.flush();
} finally {
writer.close();
}
} catch (IOException x) {
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, x.toString());
}
}
}
}
| {
"pile_set_name": "Github"
} |
// Boost.Geometry
// Copyright (c) 2018 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2015-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_FORMULAS_ANDOYER_INVERSE_HPP
#define BOOST_GEOMETRY_FORMULAS_ANDOYER_INVERSE_HPP
#include <boost/math/constants/constants.hpp>
#include <boost/geometry/core/radius.hpp>
#include <boost/geometry/util/condition.hpp>
#include <boost/geometry/util/math.hpp>
#include <boost/geometry/formulas/differential_quantities.hpp>
#include <boost/geometry/formulas/flattening.hpp>
#include <boost/geometry/formulas/result_inverse.hpp>
namespace boost { namespace geometry { namespace formula
{
/*!
\brief The solution of the inverse problem of geodesics on latlong coordinates,
Forsyth-Andoyer-Lambert type approximation with first order terms.
\author See
- Technical Report: PAUL D. THOMAS, MATHEMATICAL MODELS FOR NAVIGATION SYSTEMS, 1965
http://www.dtic.mil/docs/citations/AD0627893
- Technical Report: PAUL D. THOMAS, SPHEROIDAL GEODESICS, REFERENCE SYSTEMS, AND LOCAL GEOMETRY, 1970
http://www.dtic.mil/docs/citations/AD703541
*/
template <
typename CT,
bool EnableDistance,
bool EnableAzimuth,
bool EnableReverseAzimuth = false,
bool EnableReducedLength = false,
bool EnableGeodesicScale = false
>
class andoyer_inverse
{
static const bool CalcQuantities = EnableReducedLength || EnableGeodesicScale;
static const bool CalcAzimuths = EnableAzimuth || EnableReverseAzimuth || CalcQuantities;
static const bool CalcFwdAzimuth = EnableAzimuth || CalcQuantities;
static const bool CalcRevAzimuth = EnableReverseAzimuth || CalcQuantities;
public:
typedef result_inverse<CT> result_type;
template <typename T1, typename T2, typename Spheroid>
static inline result_type apply(T1 const& lon1,
T1 const& lat1,
T2 const& lon2,
T2 const& lat2,
Spheroid const& spheroid)
{
result_type result;
// coordinates in radians
if ( math::equals(lon1, lon2) && math::equals(lat1, lat2) )
{
return result;
}
CT const c0 = CT(0);
CT const c1 = CT(1);
CT const pi = math::pi<CT>();
CT const f = formula::flattening<CT>(spheroid);
CT const dlon = lon2 - lon1;
CT const sin_dlon = sin(dlon);
CT const cos_dlon = cos(dlon);
CT const sin_lat1 = sin(lat1);
CT const cos_lat1 = cos(lat1);
CT const sin_lat2 = sin(lat2);
CT const cos_lat2 = cos(lat2);
// H,G,T = infinity if cos_d = 1 or cos_d = -1
// lat1 == +-90 && lat2 == +-90
// lat1 == lat2 && lon1 == lon2
CT cos_d = sin_lat1*sin_lat2 + cos_lat1*cos_lat2*cos_dlon;
// on some platforms cos_d may be outside valid range
if (cos_d < -c1)
cos_d = -c1;
else if (cos_d > c1)
cos_d = c1;
CT const d = acos(cos_d); // [0, pi]
CT const sin_d = sin(d); // [-1, 1]
if ( BOOST_GEOMETRY_CONDITION(EnableDistance) )
{
CT const K = math::sqr(sin_lat1-sin_lat2);
CT const L = math::sqr(sin_lat1+sin_lat2);
CT const three_sin_d = CT(3) * sin_d;
CT const one_minus_cos_d = c1 - cos_d;
CT const one_plus_cos_d = c1 + cos_d;
// cos_d = 1 means that the points are very close
// cos_d = -1 means that the points are antipodal
CT const H = math::equals(one_minus_cos_d, c0) ?
c0 :
(d + three_sin_d) / one_minus_cos_d;
CT const G = math::equals(one_plus_cos_d, c0) ?
c0 :
(d - three_sin_d) / one_plus_cos_d;
CT const dd = -(f/CT(4))*(H*K+G*L);
CT const a = CT(get_radius<0>(spheroid));
result.distance = a * (d + dd);
}
if ( BOOST_GEOMETRY_CONDITION(CalcAzimuths) )
{
// sin_d = 0 <=> antipodal points (incl. poles) or very close
if (math::equals(sin_d, c0))
{
// T = inf
// dA = inf
// azimuth = -inf
// TODO: The following azimuths are inconsistent with distance
// i.e. according to azimuths below a segment with antipodal endpoints
// travels through the north pole, however the distance returned above
// is the length of a segment traveling along the equator.
// Furthermore, this special case handling is only done in andoyer
// formula.
// The most correct way of fixing it is to handle antipodal regions
// correctly and consistently across all formulas.
// points very close
if (cos_d >= c0)
{
result.azimuth = c0;
result.reverse_azimuth = c0;
}
// antipodal points
else
{
// Set azimuth to 0 unless the first endpoint is the north pole
if (! math::equals(sin_lat1, c1))
{
result.azimuth = c0;
result.reverse_azimuth = pi;
}
else
{
result.azimuth = pi;
result.reverse_azimuth = c0;
}
}
}
else
{
CT const c2 = CT(2);
CT A = c0;
CT U = c0;
if (math::equals(cos_lat2, c0))
{
if (sin_lat2 < c0)
{
A = pi;
}
}
else
{
CT const tan_lat2 = sin_lat2/cos_lat2;
CT const M = cos_lat1*tan_lat2-sin_lat1*cos_dlon;
A = atan2(sin_dlon, M);
CT const sin_2A = sin(c2*A);
U = (f/ c2)*math::sqr(cos_lat1)*sin_2A;
}
CT B = c0;
CT V = c0;
if (math::equals(cos_lat1, c0))
{
if (sin_lat1 < c0)
{
B = pi;
}
}
else
{
CT const tan_lat1 = sin_lat1/cos_lat1;
CT const N = cos_lat2*tan_lat1-sin_lat2*cos_dlon;
B = atan2(sin_dlon, N);
CT const sin_2B = sin(c2*B);
V = (f/ c2)*math::sqr(cos_lat2)*sin_2B;
}
CT const T = d / sin_d;
// even with sin_d == 0 checked above if the second point
// is somewhere in the antipodal area T may still be great
// therefore dA and dB may be great and the resulting azimuths
// may be some more or less arbitrary angles
if (BOOST_GEOMETRY_CONDITION(CalcFwdAzimuth))
{
CT const dA = V*T - U;
result.azimuth = A - dA;
normalize_azimuth(result.azimuth, A, dA);
}
if (BOOST_GEOMETRY_CONDITION(CalcRevAzimuth))
{
CT const dB = -U*T + V;
if (B >= 0)
result.reverse_azimuth = pi - B - dB;
else
result.reverse_azimuth = -pi - B - dB;
normalize_azimuth(result.reverse_azimuth, B, dB);
}
}
}
if (BOOST_GEOMETRY_CONDITION(CalcQuantities))
{
CT const b = CT(get_radius<2>(spheroid));
typedef differential_quantities<CT, EnableReducedLength, EnableGeodesicScale, 1> quantities;
quantities::apply(dlon, sin_lat1, cos_lat1, sin_lat2, cos_lat2,
result.azimuth, result.reverse_azimuth,
b, f,
result.reduced_length, result.geodesic_scale);
}
return result;
}
private:
static inline void normalize_azimuth(CT & azimuth, CT const& A, CT const& dA)
{
CT const c0 = 0;
if (A >= c0) // A indicates Eastern hemisphere
{
if (dA >= c0) // A altered towards 0
{
if (azimuth < c0)
{
azimuth = c0;
}
}
else // dA < 0, A altered towards pi
{
CT const pi = math::pi<CT>();
if (azimuth > pi)
{
azimuth = pi;
}
}
}
else // A indicates Western hemisphere
{
if (dA <= c0) // A altered towards 0
{
if (azimuth > c0)
{
azimuth = c0;
}
}
else // dA > 0, A altered towards -pi
{
CT const minus_pi = -math::pi<CT>();
if (azimuth < minus_pi)
{
azimuth = minus_pi;
}
}
}
}
};
}}} // namespace boost::geometry::formula
#endif // BOOST_GEOMETRY_FORMULAS_ANDOYER_INVERSE_HPP
| {
"pile_set_name": "Github"
} |
/**
* This file is part of alf.io.
*
* alf.io is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* alf.io 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 alf.io. If not, see <http://www.gnu.org/licenses/>.
*/
package alfio.model.group;
import ch.digitalfondue.npjt.ConstructorAnnotationRowMapper.Column;
import lombok.Getter;
@Getter
public class LinkedGroup {
/**
* Link type
*/
public enum Type {
/**
* Allow exactly one ticket per group member
*/
ONCE_PER_VALUE,
/**
* Allow a limited quantity ( 1 < n < ∞)
*/
LIMITED_QUANTITY,
/**
* No limit
*/
UNLIMITED
}
public enum MatchType {
/**
* The given email address *must* match the group member's email address exactly
*/
FULL,
/**
* Try to find a FULL match; if not successful, try to match email domain (everything after '@')
*/
EMAIL_DOMAIN
}
private final int id;
private final int groupId;
private final Integer eventId;
private final Integer ticketCategoryId;
private final Type type;
private final MatchType matchType;
private final Integer maxAllocation;
public LinkedGroup(@Column("id") int id,
@Column("a_group_id_fk") int groupId,
@Column("event_id_fk") Integer eventId,
@Column("ticket_category_id_fk") Integer ticketCategoryId,
@Column("type") Type type,
@Column("match_type") MatchType matchType,
@Column("max_allocation") Integer maxAllocation) {
this.id = id;
this.groupId = groupId;
this.eventId = eventId;
this.ticketCategoryId = ticketCategoryId;
this.type = type;
this.matchType = matchType;
this.maxAllocation = maxAllocation;
}
}
| {
"pile_set_name": "Github"
} |
<header>Protected Web Directories (under home directory)</header>
This option specifies whether the domain owner will have access to the Protected Web Directories Webmin module, which allows creation of one or more directories that are password protected. This can, of course, be done using .htaccess files, but many users do not know how to create or use .htaccess files, and this module provides a web-based means of performing the same task.
<footer>
| {
"pile_set_name": "Github"
} |
/* jshint node:true */
/* global describe, it */
"use strict";
var jsc = require("../lib/jsverify.js");
var arbitraryAssert = require("../lib/arbitraryAssert.js");
describe("suchthat", function () {
var arb = jsc.suchthat(jsc.integer, function (v) {
return v % 2 === 0;
});
it("should construct valid arbitrary", function () {
arbitraryAssert(arb);
});
it("should support smap", function () {
var arbAsString = arb.smap(
function (v) { return v.toString(); },
function (v) { return parseInt(v, 10); }
);
jsc.assert(jsc.forall(arbAsString, function (value) {
return typeof value === "string";
}));
jsc.assert(jsc.forall(arbAsString, function (value) {
return parseInt(value, 10) % 2 === 0;
}));
});
});
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.