text stringlengths 2 99k | meta dict |
|---|---|
/*
Package buffer provides http.Handler middleware that solves several problems when dealing with http requests:
Reads the entire request and response into buffer, optionally buffering it to disk for large requests.
Checks the limits for the requests and responses, rejecting in case if the limit was exceeded.
Changes request content-transfer-encoding from chunked and provides total size to the handlers.
Examples of a buffering middleware:
// sample HTTP handler
handler := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
w.Write([]byte("hello"))
})
// Buffer will read the body in buffer before passing the request to the handler
// calculate total size of the request and transform it from chunked encoding
// before passing to the server
buffer.New(handler)
// This version will buffer up to 2MB in memory and will serialize any extra
// to a temporary file, if the request size exceeds 10MB it will reject the request
buffer.New(handler,
buffer.MemRequestBodyBytes(2 * 1024 * 1024),
buffer.MaxRequestBodyBytes(10 * 1024 * 1024))
// Will do the same as above, but with responses
buffer.New(handler,
buffer.MemResponseBodyBytes(2 * 1024 * 1024),
buffer.MaxResponseBodyBytes(10 * 1024 * 1024))
// Buffer will replay the request if the handler returns error at least 3 times
// before returning the response
buffer.New(handler, buffer.Retry(`IsNetworkError() && Attempts() <= 2`))
*/
package buffer
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"reflect"
"github.com/mailgun/multibuf"
log "github.com/sirupsen/logrus"
"github.com/vulcand/oxy/utils"
)
const (
// DefaultMemBodyBytes Store up to 1MB in RAM
DefaultMemBodyBytes = 1048576
// DefaultMaxBodyBytes No limit by default
DefaultMaxBodyBytes = -1
// DefaultMaxRetryAttempts Maximum retry attempts
DefaultMaxRetryAttempts = 10
)
var errHandler utils.ErrorHandler = &SizeErrHandler{}
// Buffer is responsible for buffering requests and responses
// It buffers large requests and responses to disk,
type Buffer struct {
maxRequestBodyBytes int64
memRequestBodyBytes int64
maxResponseBodyBytes int64
memResponseBodyBytes int64
retryPredicate hpredicate
next http.Handler
errHandler utils.ErrorHandler
log *log.Logger
}
// New returns a new buffer middleware. New() function supports optional functional arguments
func New(next http.Handler, setters ...optSetter) (*Buffer, error) {
strm := &Buffer{
next: next,
maxRequestBodyBytes: DefaultMaxBodyBytes,
memRequestBodyBytes: DefaultMemBodyBytes,
maxResponseBodyBytes: DefaultMaxBodyBytes,
memResponseBodyBytes: DefaultMemBodyBytes,
log: log.StandardLogger(),
}
for _, s := range setters {
if err := s(strm); err != nil {
return nil, err
}
}
if strm.errHandler == nil {
strm.errHandler = errHandler
}
return strm, nil
}
// Logger defines the logger the buffer will use.
//
// It defaults to logrus.StandardLogger(), the global logger used by logrus.
func Logger(l *log.Logger) optSetter {
return func(b *Buffer) error {
b.log = l
return nil
}
}
type optSetter func(b *Buffer) error
// CondSetter Conditional setter.
// ex: Cond(a > 4, MemRequestBodyBytes(a))
func CondSetter(condition bool, setter optSetter) optSetter {
if !condition {
// NoOp setter
return func(*Buffer) error {
return nil
}
}
return setter
}
// Retry provides a predicate that allows buffer middleware to replay the request
// if it matches certain condition, e.g. returns special error code. Available functions are:
//
// Attempts() - limits the amount of retry attempts
// ResponseCode() - returns http response code
// IsNetworkError() - tests if response code is related to networking error
//
// Example of the predicate:
//
// `Attempts() <= 2 && ResponseCode() == 502`
//
func Retry(predicate string) optSetter {
return func(b *Buffer) error {
p, err := parseExpression(predicate)
if err != nil {
return err
}
b.retryPredicate = p
return nil
}
}
// ErrorHandler sets error handler of the server
func ErrorHandler(h utils.ErrorHandler) optSetter {
return func(b *Buffer) error {
b.errHandler = h
return nil
}
}
// MaxRequestBodyBytes sets the maximum request body size in bytes
func MaxRequestBodyBytes(m int64) optSetter {
return func(b *Buffer) error {
if m < 0 {
return fmt.Errorf("max bytes should be >= 0 got %d", m)
}
b.maxRequestBodyBytes = m
return nil
}
}
// MemRequestBodyBytes bytes sets the maximum request body to be stored in memory
// buffer middleware will serialize the excess to disk.
func MemRequestBodyBytes(m int64) optSetter {
return func(b *Buffer) error {
if m < 0 {
return fmt.Errorf("mem bytes should be >= 0 got %d", m)
}
b.memRequestBodyBytes = m
return nil
}
}
// MaxResponseBodyBytes sets the maximum request body size in bytes
func MaxResponseBodyBytes(m int64) optSetter {
return func(b *Buffer) error {
if m < 0 {
return fmt.Errorf("max bytes should be >= 0 got %d", m)
}
b.maxResponseBodyBytes = m
return nil
}
}
// MemResponseBodyBytes sets the maximum request body to be stored in memory
// buffer middleware will serialize the excess to disk.
func MemResponseBodyBytes(m int64) optSetter {
return func(b *Buffer) error {
if m < 0 {
return fmt.Errorf("mem bytes should be >= 0 got %d", m)
}
b.memResponseBodyBytes = m
return nil
}
}
// Wrap sets the next handler to be called by buffer handler.
func (b *Buffer) Wrap(next http.Handler) error {
b.next = next
return nil
}
func (b *Buffer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
if b.log.Level >= log.DebugLevel {
logEntry := b.log.WithField("Request", utils.DumpHttpRequest(req))
logEntry.Debug("vulcand/oxy/buffer: begin ServeHttp on request")
defer logEntry.Debug("vulcand/oxy/buffer: completed ServeHttp on request")
}
if err := b.checkLimit(req); err != nil {
b.log.Errorf("vulcand/oxy/buffer: request body over limit, err: %v", err)
b.errHandler.ServeHTTP(w, req, err)
return
}
// Read the body while keeping limits in mind. This reader controls the maximum bytes
// to read into memory and disk. This reader returns an error if the total request size exceeds the
// predefined MaxSizeBytes. This can occur if we got chunked request, in this case ContentLength would be set to -1
// and the reader would be unbounded bufio in the http.Server
body, err := multibuf.New(req.Body, multibuf.MaxBytes(b.maxRequestBodyBytes), multibuf.MemBytes(b.memRequestBodyBytes))
if err != nil || body == nil {
b.log.Errorf("vulcand/oxy/buffer: error when reading request body, err: %v", err)
b.errHandler.ServeHTTP(w, req, err)
return
}
// Set request body to buffered reader that can replay the read and execute Seek
// Note that we don't change the original request body as it's handled by the http server
// and we don'w want to mess with standard library
defer func() {
if body != nil {
errClose := body.Close()
if errClose != nil {
b.log.Errorf("vulcand/oxy/buffer: failed to close body, err: %v", errClose)
}
}
}()
// We need to set ContentLength based on known request size. The incoming request may have been
// set without content length or using chunked TransferEncoding
totalSize, err := body.Size()
if err != nil {
b.log.Errorf("vulcand/oxy/buffer: failed to get request size, err: %v", err)
b.errHandler.ServeHTTP(w, req, err)
return
}
if totalSize == 0 {
body = nil
}
outreq := b.copyRequest(req, body, totalSize)
attempt := 1
for {
// We create a special writer that will limit the response size, buffer it to disk if necessary
writer, err := multibuf.NewWriterOnce(multibuf.MaxBytes(b.maxResponseBodyBytes), multibuf.MemBytes(b.memResponseBodyBytes))
if err != nil {
b.log.Errorf("vulcand/oxy/buffer: failed create response writer, err: %v", err)
b.errHandler.ServeHTTP(w, req, err)
return
}
// We are mimicking http.ResponseWriter to replace writer with our special writer
bw := &bufferWriter{
header: make(http.Header),
buffer: writer,
responseWriter: w,
log: b.log,
}
defer bw.Close()
b.next.ServeHTTP(bw, outreq)
if bw.hijacked {
b.log.Debugf("vulcand/oxy/buffer: connection was hijacked downstream. Not taking any action in buffer.")
return
}
var reader multibuf.MultiReader
if bw.expectBody(outreq) {
rdr, err := writer.Reader()
if err != nil {
b.log.Errorf("vulcand/oxy/buffer: failed to read response, err: %v", err)
b.errHandler.ServeHTTP(w, req, err)
return
}
defer rdr.Close()
reader = rdr
}
if (b.retryPredicate == nil || attempt > DefaultMaxRetryAttempts) ||
!b.retryPredicate(&context{r: req, attempt: attempt, responseCode: bw.code}) {
utils.CopyHeaders(w.Header(), bw.Header())
w.WriteHeader(bw.code)
if reader != nil {
io.Copy(w, reader)
}
return
}
attempt++
if body != nil {
if _, err := body.Seek(0, 0); err != nil {
b.log.Errorf("vulcand/oxy/buffer: failed to rewind response body, err: %v", err)
b.errHandler.ServeHTTP(w, req, err)
return
}
}
outreq = b.copyRequest(req, body, totalSize)
b.log.Debugf("vulcand/oxy/buffer: retry Request(%v %v) attempt %v", req.Method, req.URL, attempt)
}
}
func (b *Buffer) copyRequest(req *http.Request, body io.ReadCloser, bodySize int64) *http.Request {
o := *req
o.URL = utils.CopyURL(req.URL)
o.Header = make(http.Header)
utils.CopyHeaders(o.Header, req.Header)
o.ContentLength = bodySize
// remove TransferEncoding that could have been previously set because we have transformed the request from chunked encoding
o.TransferEncoding = []string{}
// http.Transport will close the request body on any error, we are controlling the close process ourselves, so we override the closer here
if body == nil {
o.Body = ioutil.NopCloser(req.Body)
} else {
o.Body = ioutil.NopCloser(body.(io.Reader))
}
return &o
}
func (b *Buffer) checkLimit(req *http.Request) error {
if b.maxRequestBodyBytes <= 0 {
return nil
}
if req.ContentLength > b.maxRequestBodyBytes {
return &multibuf.MaxSizeReachedError{MaxSize: b.maxRequestBodyBytes}
}
return nil
}
type bufferWriter struct {
header http.Header
code int
buffer multibuf.WriterOnce
responseWriter http.ResponseWriter
hijacked bool
log *log.Logger
}
// RFC2616 #4.4
func (b *bufferWriter) expectBody(r *http.Request) bool {
if r.Method == "HEAD" {
return false
}
if (b.code >= 100 && b.code < 200) || b.code == 204 || b.code == 304 {
return false
}
// refer to https://github.com/vulcand/oxy/issues/113
// if b.header.Get("Content-Length") == "" && b.header.Get("Transfer-Encoding") == "" {
// return false
// }
if b.header.Get("Content-Length") == "0" {
return false
}
return true
}
func (b *bufferWriter) Close() error {
return b.buffer.Close()
}
func (b *bufferWriter) Header() http.Header {
return b.header
}
func (b *bufferWriter) Write(buf []byte) (int, error) {
length, err := b.buffer.Write(buf)
if err != nil {
// Since go1.11 (https://github.com/golang/go/commit/8f38f28222abccc505b9a1992deecfe3e2cb85de)
// if the writer returns an error, the reverse proxy panics
b.log.Error(err)
length = len(buf)
}
return length, nil
}
// WriteHeader sets rw.Code.
func (b *bufferWriter) WriteHeader(code int) {
b.code = code
}
// CloseNotifier interface - this allows downstream connections to be terminated when the client terminates.
func (b *bufferWriter) CloseNotify() <-chan bool {
if cn, ok := b.responseWriter.(http.CloseNotifier); ok {
return cn.CloseNotify()
}
b.log.Warningf("Upstream ResponseWriter of type %v does not implement http.CloseNotifier. Returning dummy channel.", reflect.TypeOf(b.responseWriter))
return make(<-chan bool)
}
// Hijack This allows connections to be hijacked for websockets for instance.
func (b *bufferWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
if hi, ok := b.responseWriter.(http.Hijacker); ok {
conn, rw, err := hi.Hijack()
if err != nil {
b.hijacked = true
}
return conn, rw, err
}
b.log.Warningf("Upstream ResponseWriter of type %v does not implement http.Hijacker. Returning dummy channel.", reflect.TypeOf(b.responseWriter))
return nil, nil, fmt.Errorf("the response writer wrapped in this proxy does not implement http.Hijacker. Its type is: %v", reflect.TypeOf(b.responseWriter))
}
// SizeErrHandler Size error handler
type SizeErrHandler struct{}
func (e *SizeErrHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, err error) {
if _, ok := err.(*multibuf.MaxSizeReachedError); ok {
w.WriteHeader(http.StatusRequestEntityTooLarge)
w.Write([]byte(http.StatusText(http.StatusRequestEntityTooLarge)))
return
}
utils.DefaultHandler.ServeHTTP(w, req, err)
}
| {
"pile_set_name": "Github"
} |
.. tabs-drivers::
tabs:
- id: shell
content: |
.. class:: copyable-code
.. code-block:: javascript
db.inventory.insertMany([
{ item: "journal", qty: 25, tags: ["blank", "red"], size: { h: 14, w: 21, uom: "cm" } },
{ item: "mat", qty: 85, tags: ["gray"], size: { h: 27.9, w: 35.5, uom: "cm" } },
{ item: "mousepad", qty: 25, tags: ["gel", "blue"], size: { h: 19, w: 22.85, uom: "cm" } }
])
.. only:: website
You can run the operation in the web shell below:
.. include:: /includes/fact-mws.rst
- id: python
content: |
.. class:: copyable-code
.. literalinclude:: /driver-examples/test_examples.py
:language: python
:dedent: 8
:start-after: Start Example 3
:end-before: End Example 3
- id: motor
content: |
.. class:: copyable-code
.. literalinclude:: /driver-examples/test_examples_motor.py
:language: python
:dedent: 8
:start-after: Start Example 3
:end-before: End Example 3
- id: java-sync
content: |
.. class:: copyable-code
.. literalinclude:: /driver-examples/DocumentationSamples.java
:language: java
:dedent: 8
:start-after: Start Example 3
:end-before: End Example 3
- id: java-async
content: |
.. class:: copyable-code
.. literalinclude:: /driver-examples/AsyncDocumentationSamples.java
:language: java
:dedent: 8
:start-after: Start Example 3
:end-before: End Example 3
- id: nodejs
content: |
.. literalinclude:: /driver-examples/node_insert.js
:language: javascript
:dedent: 6
:start-after: Start Example 3
:end-before: End Example 3
- id: php
content: |
.. class:: copyable-code
.. literalinclude:: /driver-examples/DocumentationExamplesTest.php
:language: php
:dedent: 8
:start-after: Start Example 3
:end-before: End Example 3
- id: perl
content: |
.. class:: copyable-code
.. literalinclude:: /driver-examples/driver-examples.t
:language: perl
:dedent: 4
:start-after: Start Example 3
:end-before: End Example 3
- id: ruby
content: |
.. class:: copyable-code
.. literalinclude:: /driver-examples/shell_examples_spec.rb
:language: ruby
:dedent: 8
:start-after: Start Example 3
:end-before: End Example 3
- id: scala
content: |
.. class:: copyable-code
.. literalinclude:: /driver-examples/DocumentationExampleSpec.scala
:language: scala
:dedent: 4
:start-after: Start Example 3
:end-before: End Example 3
- id: csharp
content: |
.. class:: copyable-code
.. literalinclude:: /driver-examples/DocumentationExamples.cs
:language: c#
:dedent: 12
:start-after: Start Example 3
:end-before: End Example 3
- id: go
content: |
.. literalinclude:: /driver-examples/go_examples.go
:language: go
:dedent: 2
:start-after: Start Example 3
:end-before: End Example 3
| {
"pile_set_name": "Github"
} |
==== Redirects
Actions can be redirected using the link:../ref/Controllers/redirect.html[redirect] controller method:
[source,groovy]
----
class OverviewController {
def login() {}
def find() {
if (!session.user)
redirect(action: 'login')
return
}
...
}
}
----
Internally the link:../ref/Controllers/redirect.html[redirect] method uses the {javaee}javax/servlet/http/HttpServletResponse.html[HttpServletResponse] object's `sendRedirect` method.
The `redirect` method expects one of:
* The name of an action (and controller name if the redirect isn't to an action in the current controller):
[source,groovy]
----
// Also redirects to the index action in the home controller
redirect(controller: 'home', action: 'index')
----
* A URI for a resource relative the application context path:
[source,groovy]
----
// Redirect to an explicit URI
redirect(uri: "/login.html")
----
* Or a full URL:
[source,groovy]
----
// Redirect to a URL
redirect(url: "http://grails.org")
----
* A link:GORM.html[domain class] instance:
[source,groovy]
----
// Redirect to the domain instance
Book book = ... // obtain a domain instance
redirect book
----
In the above example Grails will construct a link using the domain class `id` (if present).
Parameters can optionally be passed from one action to the next using the `params` argument of the method:
[source,groovy]
----
redirect(action: 'myaction', params: [myparam: "myvalue"])
----
These parameters are made available through the link:../ref/Controllers/params.html[params] dynamic property that accesses request parameters. If a parameter is specified with the same name as a request parameter, the request parameter is overridden and the controller parameter is used.
Since the `params` object is a Map, you can use it to pass the current request parameters from one action to the next:
[source,groovy]
----
redirect(action: "next", params: params)
----
Finally, you can also include a fragment in the target URI:
[source,groovy]
----
redirect(controller: "test", action: "show", fragment: "profile")
----
which will (depending on the URL mappings) redirect to something like "/myapp/test/show#profile".
==== Chaining
Actions can also be chained. Chaining allows the model to be retained from one action to the next. For example calling the `first` action in this action:
[source,groovy]
----
class ExampleChainController {
def first() {
chain(action: second, model: [one: 1])
}
def second () {
chain(action: third, model: [two: 2])
}
def third() {
[three: 3])
}
}
----
results in the model:
[source,groovy]
----
[one: 1, two: 2, three: 3]
----
The model can be accessed in subsequent controller actions in the chain using the `chainModel` map. This dynamic property only exists in actions following the call to the `chain` method:
[source,groovy]
----
class ChainController {
def nextInChain() {
def model = chainModel.myModel
...
}
}
----
Like the `redirect` method you can also pass parameters to the `chain` method:
[source,groovy]
----
chain(action: "action1", model: [one: 1], params: [myparam: "param1"])
----
NOTE: The chain method uses the HTTP session and hence should only be used if your application is stateful.
| {
"pile_set_name": "Github"
} |
Title: Vivaldi:贴心好用的新浏览器
Date: 2016-04-13 13:20:24
Authors: toy
Category: Apps
Tags: web browser, vivaldi
Slug: vivaldi
自从上网冲浪那天伊始我们便使用浏览器,时至今日已经有不计其数的浏览器出现。一款浏览器真正打动人心的地方是什么?我以为是不仅具有十分贴心的设计,而且使用起来感觉非常舒服。从这个角度来说,Vivaldi 恰是这样的浏览器。
<!-- PELICAN_END_SUMMARY -->
[]({filename}/images/vivaldi.png)
Vivaldi 由 Opera 的联合创始人 Jon von Tetzchner 所创建,基于开源的
Chromium,并使用了诸如 Node.js、JavaScript、React 等 Web 技术,真可以说是既因 Web 而生,也为 Web 而建。
使用 Vivaldi 给我的感觉是,往往在其它浏览器中需要扩展或是插件才能使用的功能,Vivaldi 直接打包开箱就能用。比如,在浏览网页时地址栏实时的视觉反馈让我们知晓网页的加载进度、页面大小、以及请求数量。又比如,Vivaldi 提供一种名叫 Tab stacks 的功能,不仅可以把标签组织在一起,而且能够让两个标签平铺显示,如上图所见。此外,Vivaldi 还为键盘控准备了 F2 以用于快速搜索标签、书签、历史、设置等内容。Vivaldi 还包括其他一些好东东,相信你只要用一用就不难发现。
Vivaldi 提供有 DEB 和 RPM 二进制包,支持 32 位及 64 位架构,可从其官方网站下载。
→ [Vivaldi](https://vivaldi.com/download/)
| {
"pile_set_name": "Github"
} |
<?php
/**
* Bitrix Framework
* @package bitrix
* @subpackage main
* @copyright 2001-2012 Bitrix
*/
namespace Bitrix\Main;
use Bitrix\Main\Data;
use Bitrix\Main\Diag;
use Bitrix\Main\IO;
/**
* Base class for any application.
*/
abstract class Application
{
/**
* @var Application
*/
protected static $instance = null;
protected $isBasicKernelInitialized = false;
protected $isExtendedKernelInitialized = false;
/**
* Execution context.
*
* @var Context
*/
protected $context;
/**
* Pool of database connections.
*
* @var Data\ConnectionPool
*/
protected $connectionPool;
/**
* Managed cache instance.
*
* @var \Bitrix\Main\Data\ManagedCache
*/
protected $managedCache;
/**
* Tagged cache instance.
*
* @var \Bitrix\Main\Data\TaggedCache
*/
protected $taggedCache;
/**
* LRU cache instance.
*
* @var \Bitrix\Main\Data\LruCache
*/
protected $lruCache;
/**
* @var \Bitrix\Main\Diag\ExceptionHandler
*/
protected $exceptionHandler = null;
/**
* @var Dispatcher
*/
private $dispatcher = null;
/**
* Creates new application instance.
*/
protected function __construct()
{
}
/**
* Returns current instance of the Application.
*
* @return Application
* @throws SystemException
*/
/**
* <p>Статический метод возвращает текущий экземпляр приложения.</p> <p>Без параметров</p>
*
*
* @return \Bitrix\Main\Application
*
* <h4>Example</h4>
* <pre bgcolor="#323232" style="padding:5px;">
* Объект приложения можно получить так:$application = Application::getInstance();
* </pre>
*
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/getinstance.php
* @author Bitrix
*/
public static function getInstance()
{
if (!isset(static::$instance))
static::$instance = new static();
return static::$instance;
}
/**
* Does minimally possible kernel initialization
*
* @throws SystemException
*/
/**
* <p>Нестатичный метод производит первичную инициализацию ядра.</p> <p>Без параметров</p>
*
*
* @return public
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/initializebasickernel.php
* @author Bitrix
*/
public function initializeBasicKernel()
{
if ($this->isBasicKernelInitialized)
return;
$this->isBasicKernelInitialized = true;
$this->initializeExceptionHandler();
$this->initializeCache();
$this->createDatabaseConnection();
}
/**
* Does full kernel initialization. Should be called somewhere after initializeBasicKernel()
*
* @param array $params Parameters of the current request (depends on application type)
* @throws SystemException
*/
/**
* <p>Нестатический метод производит полную инициализацию ядра. Метод следует вызывать после метода <a href="http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/initializebasickernel.php">initializeBasicKernel</a>.</p>
*
*
* @param array $params Параметры текущего запроса (в зависимости от типа приложения).
*
* @return public
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/initializeextendedkernel.php
* @author Bitrix
*/
public function initializeExtendedKernel(array $params)
{
if ($this->isExtendedKernelInitialized)
return;
$this->isExtendedKernelInitialized = true;
$this->initializeContext($params);
//$this->initializeDispatcher();
}
final public function getDispatcher()
{
if (is_null($this->dispatcher))
throw new NotSupportedException();
if (!($this->dispatcher instanceof Dispatcher))
throw new NotSupportedException();
return clone $this->dispatcher;
}
/**
* Initializes context of the current request.
* Should be implemented in subclass.
*/
abstract protected function initializeContext(array $params);
/**
* Starts request execution. Should be called after initialize.
* Should be implemented in subclass.
*/
/**
* <p>Нестатический метод запускает выполнение запроса. Вызывается после методов инициализации.</p> <p>Следует реализовывать как подкласс.</p> <p>Без параметров</p> <a name="example"></a>
*
*
* @return public
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/start.php
* @author Bitrix
*/
abstract public function start();
/**
* Exception handler can be initialized through the Config\Configuration (.settings.php file).
*
* 'exception_handling' => array(
* 'value' => array(
* 'debug' => true, // output exception on screen
* 'handled_errors_types' => E_ALL & ~E_STRICT & ~E_NOTICE, // catchable error types, printed to log
* 'exception_errors_types' => E_ALL & ~E_NOTICE & ~E_STRICT, // error types from catchable which throws exceptions
* 'ignore_silence' => false, // ignore @
* 'assertion_throws_exception' => true, // assertion throws exception
* 'assertion_error_type' => 256,
* 'log' => array(
* 'class_name' => 'MyLog', // custom log class, must extends ExceptionHandlerLog; can be omited, in this case default Diag\FileExceptionHandlerLog will be used
* 'extension' => 'MyLogExt', // php extension, is used only with 'class_name'
* 'required_file' => 'modules/mylog.module/mylog.php' // included file, is used only with 'class_name'
* 'settings' => array( // any settings for 'class_name'
* 'file' => 'bitrix/modules/error.log',
* 'log_size' => 1000000,
* ),
* ),
* ),
* 'readonly' => false,
* ),
*
*/
protected function initializeExceptionHandler()
{
$exceptionHandler = new Diag\ExceptionHandler();
$exceptionHandling = Config\Configuration::getValue("exception_handling");
if ($exceptionHandling == null)
$exceptionHandling = array();
if (!isset($exceptionHandling["debug"]) || !is_bool($exceptionHandling["debug"]))
$exceptionHandling["debug"] = false;
$exceptionHandler->setDebugMode($exceptionHandling["debug"]);
if (isset($exceptionHandling["handled_errors_types"]) && is_int($exceptionHandling["handled_errors_types"]))
$exceptionHandler->setHandledErrorsTypes($exceptionHandling["handled_errors_types"]);
if (isset($exceptionHandling["exception_errors_types"]) && is_int($exceptionHandling["exception_errors_types"]))
$exceptionHandler->setExceptionErrorsTypes($exceptionHandling["exception_errors_types"]);
if (isset($exceptionHandling["ignore_silence"]) && is_bool($exceptionHandling["ignore_silence"]))
$exceptionHandler->setIgnoreSilence($exceptionHandling["ignore_silence"]);
if (isset($exceptionHandling["assertion_throws_exception"]) && is_bool($exceptionHandling["assertion_throws_exception"]))
$exceptionHandler->setAssertionThrowsException($exceptionHandling["assertion_throws_exception"]);
if (isset($exceptionHandling["assertion_error_type"]) && is_int($exceptionHandling["assertion_error_type"]))
$exceptionHandler->setAssertionErrorType($exceptionHandling["assertion_error_type"]);
$exceptionHandler->initialize(
array($this, "createExceptionHandlerOutput"),
array($this, "createExceptionHandlerLog")
);
$this->exceptionHandler = $exceptionHandler;
}
static public function createExceptionHandlerLog()
{
$exceptionHandling = Config\Configuration::getValue("exception_handling");
if ($exceptionHandling === null || !is_array($exceptionHandling) || !isset($exceptionHandling["log"]) || !is_array($exceptionHandling["log"]))
return null;
$options = $exceptionHandling["log"];
$log = null;
if (isset($options["class_name"]) && !empty($options["class_name"]))
{
if (isset($options["extension"]) && !empty($options["extension"]) && !extension_loaded($options["extension"]))
return null;
if (isset($options["required_file"]) && !empty($options["required_file"]) && ($requiredFile = Loader::getLocal($options["required_file"])) !== false)
require_once($requiredFile);
$className = $options["class_name"];
if (!class_exists($className))
return null;
$log = new $className();
}
elseif (isset($options["settings"]) && is_array($options["settings"]))
{
$log = new Diag\FileExceptionHandlerLog();
}
else
{
return null;
}
$log->initialize(
isset($options["settings"]) && is_array($options["settings"]) ? $options["settings"] : array()
);
return $log;
}
static public function createExceptionHandlerOutput()
{
return new Diag\ExceptionHandlerOutput();
}
/**
* Creates database connection pool.
*/
protected function createDatabaseConnection()
{
$this->connectionPool = new Data\ConnectionPool();
}
protected function initializeCache()
{
//TODO: Should be transfered to where GET parameter is defined in future
//magic parameters: show cache usage statistics
$show_cache_stat = "";
if (isset($_GET["show_cache_stat"]))
{
$show_cache_stat = (strtoupper($_GET["show_cache_stat"]) == "Y" ? "Y" : "");
@setcookie("show_cache_stat", $show_cache_stat, false, "/");
}
elseif (isset($_COOKIE["show_cache_stat"]))
{
$show_cache_stat = $_COOKIE["show_cache_stat"];
}
Data\Cache::setShowCacheStat($show_cache_stat === "Y");
if (isset($_GET["clear_cache_session"]))
Data\Cache::setClearCacheSession($_GET["clear_cache_session"] === 'Y');
if (isset($_GET["clear_cache"]))
Data\Cache::setClearCache($_GET["clear_cache"] === 'Y');
}
/*
final private function initializeDispatcher()
{
$dispatcher = new Dispatcher();
$dispatcher->initialize();
$this->dispatcher = $dispatcher;
}
*/
/**
* @return \Bitrix\Main\Diag\ExceptionHandler
*/
public function getExceptionHandler()
{
return $this->exceptionHandler;
}
/**
* Returns database connections pool object.
*
* @return Data\ConnectionPool
*/
/**
* <p>Нестатический метод возвращает объект пула соединений базы данных.</p> <p>Без параметров</p> <a name="example"></a>
*
*
* @return \Bitrix\Main\Data\ConnectionPool
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/getconnectionpool.php
* @author Bitrix
*/
public function getConnectionPool()
{
return $this->connectionPool;
}
/**
* Returns context of the current request.
*
* @return Context
*/
/**
* <p>Нестатический метод возвращает содержание текущего соединения.</p> <p>Без параметров</p> <a name="example"></a>
*
*
* @return \Bitrix\Main\Context
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/getcontext.php
* @author Bitrix
*/
public function getContext()
{
return $this->context;
}
/**
* Modifies context of the current request.
*
* @param Context $context
*/
/**
* <p>Нестатический метод изменяет содержание текущего запроса.</p>
*
*
* @param mixed $Bitrix
*
* @param Bitri $Main
*
* @param Context $context
*
* @return public
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/setcontext.php
* @author Bitrix
*/
public function setContext(Context $context)
{
$this->context = $context;
}
/**
* Static method returns database connection for the specified name.
* If name is empty - default connection is returned.
*
* @static
* @param string $name Name of database connection. If empty - default connection.
* @return DB\Connection
*/
/**
* <p>Статический метод возвращает соединение с базой данных указанного имени. Если параметр <b>name</b> - пустой, то возвращается соединение по умолчанию.</p>
*
*
* @param string $name = "" Название соединения. Если пустое - то соединение по умолчанию.
*
* @return \Bitrix\Main\DB\Connection
*
* <h4>Example</h4>
* <pre bgcolor="#323232" style="padding:5px;">
* Как из класса приложения получить соединение с БД$connection = Application::getConnection();use Bitrix\Main\Application;
* use Bitrix\Main\Diag\Debug;
*
* $record = Application::getConnection()
* ->query("select 1+1;")
* ->fetch();
* Debug::writeToFile($record);
* </pre>
*
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/getconnection.php
* @author Bitrix
*/
public static function getConnection($name = "")
{
$pool = Application::getInstance()->getConnectionPool();
return $pool->getConnection($name);
}
/**
* Returns new instance of the Cache object.
*
* @return Data\Cache
*/
/**
* <p>Возвращает новый экземпляр объекта кеша. Нестатический метод.</p> <p>Без параметров</p> <a name="example"></a>
*
*
* @return \Bitrix\Main\Data\Cache
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/getcache.php
* @author Bitrix
*/
static public function getCache()
{
return Data\Cache::createInstance();
}
/**
* Returns manager of the managed cache.
*
* @return Data\ManagedCache
*/
/**
* <p>Нестатический метод возвращает объект управляемого кеша.</p> <p>Без параметров</p> <a name="example"></a>
*
*
* @return \Bitrix\Main\Data\ManagedCache
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/getmanagedcache.php
* @author Bitrix
*/
public function getManagedCache()
{
if ($this->managedCache == null)
{
$this->managedCache = new Data\ManagedCache();
}
return $this->managedCache;
}
/**
* Returns manager of the managed cache.
*
* @return Data\TaggedCache
*/
/**
* <p>Нестатический метод возвращает объект тегированного кеша.</p> <p>Без параметров</p> <a name="example"></a>
*
*
* @return \Bitrix\Main\Data\TaggedCache
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/gettaggedcache.php
* @author Bitrix
*/
public function getTaggedCache()
{
if ($this->taggedCache == null)
{
$this->taggedCache = new Data\TaggedCache();
}
return $this->taggedCache;
}
/**
* Returns true id server is in utf-8 mode. False - otherwise.
*
* @return bool
*/
/**
* <p>Статический метод вернёт <i>true</i> если сервер работает в utf-8. И вернёт <i>false</i> в противном случае.</p> <p>Без параметров</p> <a name="example"></a>
*
*
* @return boolean
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/isutfmode.php
* @author Bitrix
*/
public static function isUtfMode()
{
static $isUtfMode = null;
if ($isUtfMode === null)
{
$isUtfMode = Config\Configuration::getValue("utf_mode");
if ($isUtfMode === null)
$isUtfMode = false;
}
return $isUtfMode;
}
/**
* Returns server document root.
*
* @return null|string
*/
/**
* <p>Статический метод возвращает <i>document root</i> сервера.</p> <p class="note">Обратите внимание: вместо <b>$_SERVER["DOCUMENT_ROOT"]</b> сейчас можно использовать <i>Bitrix\Main\Application::getDocumentRoot()</i>.</p> <p>Без параметров</p> <a name="example"></a>
*
*
* @return mixed
*
* <h4>Example</h4>
* <pre bgcolor="#323232" style="padding:5px;">
* Как из класса приложения получить <i>document_root</i>:$docRoot = Application::getDocumentRoot()
* </pre>
*
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/getdocumentroot.php
* @author Bitrix
*/
public static function getDocumentRoot()
{
static $documentRoot = null;
if ($documentRoot != null)
return $documentRoot;
$context = Application::getInstance()->getContext();
if ($context != null)
{
$server = $context->getServer();
if ($server != null)
return $documentRoot = $server->getDocumentRoot();
}
return Loader::getDocumentRoot();
}
/**
* Returns personal root directory (relative to document root)
*
* @return null|string
*/
/**
* <p>Статический метод возвращает путь к персональной директории (относительно <i>document root</i>).</p> <p>Без параметров</p> <a name="example"></a>
*
*
* @return mixed
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/getpersonalroot.php
* @author Bitrix
*/
public static function getPersonalRoot()
{
static $personalRoot = null;
if ($personalRoot != null)
return $personalRoot;
$context = Application::getInstance()->getContext();
if ($context != null)
{
$server = $context->getServer();
if ($server != null)
return $personalRoot = $server->getPersonalRoot();
}
return isset($_SERVER["BX_PERSONAL_ROOT"]) ? $_SERVER["BX_PERSONAL_ROOT"] : "/bitrix";
}
/**
* Resets accelerator if any.
*/
/**
* <p>Статический метод производит перезапуск акселлератора.</p> <p>Без параметров</p> <a name="example"></a>
*
*
* @return public
*
* @static
* @link http://dev.1c-bitrix.ru/api_d7/bitrix/main/application/resetaccelerator.php
* @author Bitrix
*/
public static function resetAccelerator()
{
if (defined("BX_NO_ACCELERATOR_RESET"))
return;
$fl = Config\Configuration::getValue("no_accelerator_reset");
if ($fl)
return;
if (function_exists("accelerator_reset"))
accelerator_reset();
elseif (function_exists("wincache_refresh_if_changed"))
wincache_refresh_if_changed();
}
}
| {
"pile_set_name": "Github"
} |
#include <assert.h>
#include <limits.h>
#include <stdint.h>
#include "blake2.h"
#include "crypto_generichash_blake2b.h"
#include "private/implementations.h"
int
crypto_generichash_blake2b(unsigned char *out, size_t outlen,
const unsigned char *in, unsigned long long inlen,
const unsigned char *key, size_t keylen)
{
if (outlen <= 0U || outlen > BLAKE2B_OUTBYTES ||
keylen > BLAKE2B_KEYBYTES || inlen > UINT64_MAX) {
return -1;
}
assert(outlen <= UINT8_MAX);
assert(keylen <= UINT8_MAX);
return blake2b((uint8_t *) out, in, key, (uint8_t) outlen, (uint64_t) inlen,
(uint8_t) keylen);
}
int
crypto_generichash_blake2b_salt_personal(
unsigned char *out, size_t outlen, const unsigned char *in,
unsigned long long inlen, const unsigned char *key, size_t keylen,
const unsigned char *salt, const unsigned char *personal)
{
if (outlen <= 0U || outlen > BLAKE2B_OUTBYTES ||
keylen > BLAKE2B_KEYBYTES || inlen > UINT64_MAX) {
return -1;
}
assert(outlen <= UINT8_MAX);
assert(keylen <= UINT8_MAX);
return blake2b_salt_personal((uint8_t *) out, in, key, (uint8_t) outlen,
(uint64_t) inlen, (uint8_t) keylen, salt,
personal);
}
int
crypto_generichash_blake2b_init(crypto_generichash_blake2b_state *state,
const unsigned char *key, const size_t keylen,
const size_t outlen)
{
if (outlen <= 0U || outlen > BLAKE2B_OUTBYTES ||
keylen > BLAKE2B_KEYBYTES) {
return -1;
}
assert(outlen <= UINT8_MAX);
assert(keylen <= UINT8_MAX);
if (key == NULL || keylen <= 0U) {
if (blake2b_init(state, (uint8_t) outlen) != 0) {
return -1; /* LCOV_EXCL_LINE */
}
} else if (blake2b_init_key(state, (uint8_t) outlen, key,
(uint8_t) keylen) != 0) {
return -1; /* LCOV_EXCL_LINE */
}
return 0;
}
int
crypto_generichash_blake2b_init_salt_personal(
crypto_generichash_blake2b_state *state, const unsigned char *key,
const size_t keylen, const size_t outlen, const unsigned char *salt,
const unsigned char *personal)
{
if (outlen <= 0U || outlen > BLAKE2B_OUTBYTES ||
keylen > BLAKE2B_KEYBYTES) {
return -1;
}
assert(outlen <= UINT8_MAX);
assert(keylen <= UINT8_MAX);
if (key == NULL || keylen <= 0U) {
if (blake2b_init_salt_personal(state, (uint8_t) outlen, salt,
personal) != 0) {
return -1; /* LCOV_EXCL_LINE */
}
} else if (blake2b_init_key_salt_personal(state, (uint8_t) outlen, key,
(uint8_t) keylen, salt,
personal) != 0) {
return -1; /* LCOV_EXCL_LINE */
}
return 0;
}
int
crypto_generichash_blake2b_update(crypto_generichash_blake2b_state *state,
const unsigned char *in,
unsigned long long inlen)
{
return blake2b_update(state, (const uint8_t *) in, (uint64_t) inlen);
}
int
crypto_generichash_blake2b_final(crypto_generichash_blake2b_state *state,
unsigned char *out, const size_t outlen)
{
assert(outlen <= UINT8_MAX);
return blake2b_final(state, (uint8_t *) out, (uint8_t) outlen);
}
int
_crypto_generichash_blake2b_pick_best_implementation(void)
{
return blake2b_pick_best_implementation();
}
| {
"pile_set_name": "Github"
} |
/**
* Copyright (C) 2016 Turi
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD license. See the LICENSE file for details.
*/
#ifndef GRAPHLAB_UNITY_LIB_SFRAME_CSV_LINE_TOKENIZER_HPP
#define GRAPHLAB_UNITY_LIB_SFRAME_CSV_LINE_TOKENIZER_HPP
#include <vector>
#include <string>
#include <cstdlib>
#include <functional>
#include <memory>
#include <flexible_type/flexible_type.hpp>
#include <parallel/mutex.hpp>
namespace graphlab {
class flexible_type_parser;
/**
* CSV Line Tokenizer
*
* This CSV tokenizer is adapted from Pandas. To use, simply set
* the appropriate options inside the struct, and use one of the
* tokenize_line functions to parse a line inside a CSV file.
*
* \note This parser at the moment only handles the case where each row of
* the CSV is on one line. It is in fact very possible that this is not the
* case. Pandas in particular permits line breaks inside of quoted strings,
* and vectors, and that is quite problematic. A more general parser is not
* difficult to construct however, we just need another tokenize_line_impl
* function which also handles file buffer management. It might also be faster
* since we can do direct buffer reads and we do not pay the cost of fstream
* searching for the line break characters.
*/
struct csv_line_tokenizer {
/**
* If set to true, quotes inside a field will be preserved (Default false).
* i.e. if set to true, the 2nd entry in the following row will be read as
* ""hello world"" with the quote characters.
* \verbatim
* 1,"hello world",5
* \endverbatim
*/
bool preserve_quoting = false;
/**
* The character to use to identify the beginning of a C escape sequence
* (Defualt '\'). i.e. "\n" will be converted to the '\n' character, "\\"
* will be converted to "\", etc. Note that only the single character
* escapes are converted. unicode (\Unnnn), octal (\nnn), hexadecimal (\xnn)
* are not interpreted.
*/
char escape_char = '\\';
/**
* If set to true, initial spaces before fields are ignored (Default true).
*/
bool skip_initial_space = true;
/**
* The delimiter character to use to separate fields (Default ",")
*/
std::string delimiter = ",";
/**
* The string to use to separate lines. Defaults to "\n".
* Setting the new line string to "\n" has special effects in that it
* causes "\r", "\r\n" and "\n" to be all interpreted as new lines.
*/
std::string line_terminator = "\n";
/**
* The character used to begin a comment (Default '#'). An occurance of
* this character outside of quoted strings will cause the parser to
* ignore the remainder of the line.
* \verbatim
* # this is a
* # comment
* user,name,rating
* 123,hello,45
* 312,chu, 21
* 333,zzz, 3 # this is also a comment
* 444,aaa, 51
* \endverbatim
*/
char comment_char = '#';
/**
* Whether comment char is used
*/
bool has_comment_char = true;
/**
* If set to true, pairs of quote characters in a quoted string
* are interpreted as a single quote (Default false).
* For instance, if set to true, the 2nd field of the 2nd line is read as
* \b "hello "world""
* \verbatim
* user, message
* 123, "hello ""world"""
* \endverbatim
*/
bool double_quote = false;
/**
* The quote character to use (Default '\"')
*/
char quote_char = '\"';
/**
* The strings which will be parsed as missing values.
*
* (also see empty_string_in_na_values)
*/
std::vector<std::string> na_values;
/**
* Constructor. Does nothing but set up internal buffers.
*/
csv_line_tokenizer();
/**
* called before any parsing functions are used. Initializes the spirit parser.
*/
void init();
/**
* Tokenize a single CSV line into seperate fields.
* The output vector will be cleared, and each field will be inserted into
* the output vector. Returns true on success and false on failure.
*
* \param str Pointer to string to tokenize.
* Contents of string may be modified.
* \param len Length of string to tokenize
* \param output Output vector which will contain the result
*
* \returns true on success, false on failure.
*/
bool tokenize_line(const char* str, size_t len,
std::vector<std::string>& output);
/**
* Tokenize a single CSV line into seperate fields, calling a callback
* for each parsed token.
*
* The function is of the form:
* \code
* bool receive_token(const char* buffer, size_t len) {
* // add the first len bytes of the buffer as the parsed token
* // return true on success and false on failure.
*
* // if this function returns false, the tokenize_line call will also
* // return false
*
* // The buffer may be modified
* }
* \endcode
*
* For instance, to insert the parsed tokens into an output vector, the
* following code could be used:
*
* \code
* return tokenize_line(str,
* [&](const char* buf, size_t len)->bool {
* output.emplace_back(buf, len);
* return true;
* });
* \endcode
*
* \param str Pointer to line to tokenize. Contents of string may be modified.
* \param len Length of line to tokenize
* \param fn Callback function which is called on every token
*
* \returns true on success, false on failure.
*/
bool tokenize_line(const char* str, size_t len,
std::function<bool (std::string&, size_t)> fn);
/**
* Tokenizes a line directly into array of flexible_type and type specifiers.
* This version of tokenize line is strict, requiring that the length of
* the output vector matches up exactly with the number of columns, and the
* types of the flexible_type be fully specified.
*
* For instance:
* If my input line is
* \verbatim
* 1, hello world, 2.0
* \endverbatim
*
* then output vector must have 3 elements.
*
* If the types of the 3 elements in the output vector are:
* [flex_type_enum::INTEGER, flex_type_enum::STRING, flex_type_enum::FLOAT]
* then, they will be parsed as such emitting an output of
* [1, "hello world", 2.0].
*
* However, if the types of the 3 elements in the output vector are:
* [flex_type_enum::STRING, flex_type_enum::STRING, flex_type_enum::STRING]
* then, the output will contain be ["1", "hello world", "2.0"].
*
* Type interpretation failures will produce an error.
* For instance if the types are
* [flex_type_enum::STRING, flex_type_enum::INTEGER, flex_type_enum::STRING],
* since the second element cannot be correctly interpreted as an integer,
* the tokenization will fail.
*
* The types current supported are:
* - flex_type_enum::INTEGER
* - flex_type_enum::FLOAT
* - flex_type_enum::STRING
* - flex_type_enum::VECTOR (a vector of numbers specified like [1 2 3]
* but allowing separators to be spaces, commas(,)
* or semicolons(;). The separator should not
* match the CSV separator since the parsers are
* independent)
*
* The tokenizer will not modify the types of the output vector. However,
* if permit_undefined is specified, the output type can be set to
* flex_type_enum::UNDEFINED for an empty non-string field. For instance:
*
*
* If my input line is
* \verbatim
* 1, , 2.0
* \endverbatim
* If I have type specifiers
* [flex_type_enum::INTEGER, flex_type_enum::STRING, flex_type_enum::FLOAT]
* This will be parsed as [1, "", 2.0] regardless of permit_undefined.
*
* However if I have type specifiers
* [flex_type_enum::INTEGER, flex_type_enum::INTEGER, flex_type_enum::FLOAT]
* and permit_undefined == false, This will be parsed as [1, 0, 2.0].
*
* And if I have type specifiers
* [flex_type_enum::INTEGER, flex_type_enum::INTEGER, flex_type_enum::FLOAT]
* and permit_undefined == true, This will be parsed as [1, UNDEFINED, 2.0].
*
* \param str Pointer to line to tokenize
* \param len Length of line to tokenize
* \param output The output vector which is of the same length as the number
* of columns, and has all the types specified.
* \param permit_undefined Allows output vector to repr
* \param output_order a pointer to an array of the same length as the output.
* Essentially column 'i' will be written to output_order[i].
* if output_order[i] == -1, the column is ignored.
* If output_order == nullptr, this is equivalent to the
* having output_order[i] == i
*
* \returns the number of output entries filled.
*/
size_t tokenize_line(char* str, size_t len,
std::vector<flexible_type>& output,
bool permit_undefined,
const std::vector<size_t>* output_order = nullptr);
/**
* Parse the buf content into flexible_type.
* The type of the flexible_type is determined by the out variable.
*
* If recursive_parse is set to true, things which parse to strings will
* attempt to be reparsed. This allows for instance
* the quoted element "123" to be parsed as an integer instead of a string.
*
* If recursive_parse is true, the contents of the buffer may be modified
* (the buffer itself is used to maintain the recursive parse state)
*/
bool parse_as(char** buf, size_t len,
flexible_type& out, bool recursive_parse=false);
private:
// internal buffer
std::string field_buffer;
// current length of internal buffer
size_t field_buffer_len = 0;
// the state of the tokenizer state machine
enum class tokenizer_state {
START_FIELD, IN_FIELD, IN_QUOTED_FIELD
};
/**
* \param str Pointer to line to tokenize
* \param len Length of line to tokenize
* \param add_token Callback function which is called on every successful token.
* This function is allowed to modify the input string.
* \param lookahead_fn Callback function which is called to look ahead
* for the end of the token when bracketing [], {} is
* encountered. it is called with a (char**, len) and return
* true/false on success/failure. This function must not
* modify the input string.
* \param undotoken Callback function which is called to undo the previously
* parsed token. Only called when lookahead succeeds, but later
* parsing fails, thus requiring cancellation of the lookahead.
*
* \note Whether this function modifies the input string is dependent on
* whether add_token modifies the input string.
*/
template <typename Fn, typename Fn2, typename Fn3>
bool tokenize_line_impl(char* str, size_t len,
Fn add_token,
Fn2 lookahead,
Fn3 undotoken);
std::shared_ptr<flexible_type_parser> parser;
// some precomputed information about the delimiter so we avoid excess
// string comparisons of the delimiter value
bool delimiter_is_new_line = false;
bool delimiter_is_space_but_not_tab = false;
char delimiter_first_character;
bool delimiter_is_singlechar = false;
bool delimiter_is_not_empty = true;
bool empty_string_in_na_values = false;
bool is_regular_line_terminator = true;
};
} // namespace graphlab
#endif
| {
"pile_set_name": "Github"
} |
package com.beyondxia.host;
import android.app.Application;
import com.beyondxia.modules.BuildConfig;
import com.beyondxia.modules.ServiceHelper;
/**
* Created by xiaojunxia on 2018/9/26.
*/
public class MyApp extends Application {
@Override
public void onCreate() {
super.onCreate();
ServiceHelper.init(this, BuildConfig.DEBUG,true);
}
}
| {
"pile_set_name": "Github"
} |
# - Try to find the OpenSSL library
# Once done this will define
#
# OpenSSL_FOUND - system has the OpenSSL library
# OpenSSL_INCLUDE_DIRS - Include paths needed
# OpenSSL_LIBRARY_DIRS - Linker paths needed
# OpenSSL_LIBRARIES - Libraries needed
# Copyright (c) 2010, Ambroz Bizjak, <ambrop7@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
include(FindLibraryWithDebug)
if (OpenSSL_LIBRARIES)
set(OpenSSL_FIND_QUIETLY TRUE)
endif ()
set(OpenSSL_FOUND FALSE)
if (WIN32)
find_path(OpenSSL_FIND_INCLUDE_DIR openssl/ssl.h)
if (OpenSSL_FIND_INCLUDE_DIR)
# look for libraries built with GCC
find_library(OpenSSL_FIND_LIBRARIES_SSL NAMES ssl)
find_library(OpenSSL_FIND_LIBRARIES_CRYPTO NAMES crypto)
if (OpenSSL_FIND_LIBRARIES_SSL AND OpenSSL_FIND_LIBRARIES_CRYPTO)
set(OpenSSL_FOUND TRUE)
set(OpenSSL_LIBRARY_DIRS "" CACHE STRING "OpenSSL library dirs")
set(OpenSSL_LIBRARIES "${OpenSSL_FIND_LIBRARIES_SSL};${OpenSSL_FIND_LIBRARIES_CRYPTO}" CACHE STRING "OpenSSL libraries")
else ()
# look for libraries built with MSVC
FIND_LIBRARY_WITH_DEBUG(OpenSSL_FIND_LIBRARIES_SSL WIN32_DEBUG_POSTFIX d NAMES ssl ssleay ssleay32 libssleay32 ssleay32MD)
FIND_LIBRARY_WITH_DEBUG(OpenSSL_FIND_LIBRARIES_EAY WIN32_DEBUG_POSTFIX d NAMES eay libeay libeay32 libeay32MD)
if (OpenSSL_FIND_LIBRARIES_SSL AND OpenSSL_FIND_LIBRARIES_EAY)
set(OpenSSL_FOUND TRUE)
set(OpenSSL_LIBRARY_DIRS "" CACHE STRING "OpenSSL library dirs")
set(OpenSSL_LIBRARIES "${OpenSSL_FIND_LIBRARIES_SSL};${OpenSSL_FIND_LIBRARIES_EAY}" CACHE STRING "OpenSSL libraries")
endif ()
endif ()
if (OpenSSL_FOUND)
set(OpenSSL_INCLUDE_DIRS "${OpenSSL_FIND_INCLUDE_DIR}" CACHE STRING "OpenSSL include dirs")
endif ()
endif ()
else ()
find_package(PkgConfig REQUIRED)
pkg_check_modules(OpenSSL_PC openssl)
if (OpenSSL_PC_FOUND)
set(OpenSSL_FOUND TRUE)
set(OpenSSL_INCLUDE_DIRS "${OpenSSL_PC_INCLUDE_DIRS}" CACHE STRING "OpenSSL include dirs")
set(OpenSSL_LIBRARY_DIRS "${OpenSSL_PC_LIBRARY_DIRS}" CACHE STRING "OpenSSL library dirs")
set(OpenSSL_LIBRARIES "${OpenSSL_PC_LIBRARIES}" CACHE STRING "OpenSSL libraries")
endif ()
endif ()
if (OpenSSL_FOUND)
if (NOT OpenSSL_FIND_QUIETLY)
MESSAGE(STATUS "Found OpenSSL: ${OpenSSL_INCLUDE_DIRS} ${OpenSSL_LIBRARY_DIRS} ${OpenSSL_LIBRARIES}")
endif ()
else ()
if (OpenSSL_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find OpenSSL")
endif ()
endif ()
mark_as_advanced(OpenSSL_INCLUDE_DIRS OpenSSL_LIBRARY_DIRS OpenSSL_LIBRARIES)
| {
"pile_set_name": "Github"
} |
1 polish x-vnd.Haiku-SMTP 815985329
POP3 authentication failed. The server said:\n smtp Nieudane uwierzytelnianie POP3. Serwer odpowiedział:\n
Destination: ConfigView Katalog docelowy:
Error while logging in to %serv smtp Błąd podczas logowania do %serv
Connecting to server… smtp Łączenie z serwerem…
Unencrypted ConfigView Nieszyfrowane
. The server says:\n smtp . Serwer mówi:\n
Error while opening connection to %serv smtp Błąd podczas otwierania połączenia do %serv
. The server said:\n smtp . Serwer odpowiedział:\n
None ConfigView Brak
SMTP server: ConfigView Serwer SMTP:
ESMTP ConfigView ESMTP
POP3 before SMTP ConfigView POP3 przed SMTP
SSL ConfigView SSL
| {
"pile_set_name": "Github"
} |
{
"kind": "webfonts#webfont",
"family": "Bahianita",
"category": "display",
"variants": ["regular"],
"subsets": ["latin", "latin-ext", "vietnamese"],
"version": "v2",
"lastModified": "2019-11-05",
"files": {
"regular": "http://fonts.gstatic.com/s/bahianita/v2/yYLr0hTb3vuqqsBUgxWtxTvV2NJPcA.ttf"
}
}
| {
"pile_set_name": "Github"
} |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
// Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
//
// 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/.
#ifndef EIGEN_CWISE_BINARY_OP_H
#define EIGEN_CWISE_BINARY_OP_H
namespace Eigen {
/** \class CwiseBinaryOp
* \ingroup Core_Module
*
* \brief Generic expression where a coefficient-wise binary operator is applied to two expressions
*
* \param BinaryOp template functor implementing the operator
* \param Lhs the type of the left-hand side
* \param Rhs the type of the right-hand side
*
* This class represents an expression where a coefficient-wise binary operator is applied to two expressions.
* It is the return type of binary operators, by which we mean only those binary operators where
* both the left-hand side and the right-hand side are Eigen expressions.
* For example, the return type of matrix1+matrix2 is a CwiseBinaryOp.
*
* Most of the time, this is the only way that it is used, so you typically don't have to name
* CwiseBinaryOp types explicitly.
*
* \sa MatrixBase::binaryExpr(const MatrixBase<OtherDerived> &,const CustomBinaryOp &) const, class CwiseUnaryOp, class CwiseNullaryOp
*/
namespace internal {
template<typename BinaryOp, typename Lhs, typename Rhs>
struct traits<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
{
// we must not inherit from traits<Lhs> since it has
// the potential to cause problems with MSVC
typedef typename remove_all<Lhs>::type Ancestor;
typedef typename traits<Ancestor>::XprKind XprKind;
enum {
RowsAtCompileTime = traits<Ancestor>::RowsAtCompileTime,
ColsAtCompileTime = traits<Ancestor>::ColsAtCompileTime,
MaxRowsAtCompileTime = traits<Ancestor>::MaxRowsAtCompileTime,
MaxColsAtCompileTime = traits<Ancestor>::MaxColsAtCompileTime
};
// even though we require Lhs and Rhs to have the same scalar type (see CwiseBinaryOp constructor),
// we still want to handle the case when the result type is different.
typedef typename result_of<
BinaryOp(
typename Lhs::Scalar,
typename Rhs::Scalar
)
>::type Scalar;
typedef typename promote_storage_type<typename traits<Lhs>::StorageKind,
typename traits<Rhs>::StorageKind>::ret StorageKind;
typedef typename promote_index_type<typename traits<Lhs>::Index,
typename traits<Rhs>::Index>::type Index;
typedef typename Lhs::Nested LhsNested;
typedef typename Rhs::Nested RhsNested;
typedef typename remove_reference<LhsNested>::type _LhsNested;
typedef typename remove_reference<RhsNested>::type _RhsNested;
enum {
LhsCoeffReadCost = _LhsNested::CoeffReadCost,
RhsCoeffReadCost = _RhsNested::CoeffReadCost,
LhsFlags = _LhsNested::Flags,
RhsFlags = _RhsNested::Flags,
SameType = is_same<typename _LhsNested::Scalar,typename _RhsNested::Scalar>::value,
StorageOrdersAgree = (int(Lhs::Flags)&RowMajorBit)==(int(Rhs::Flags)&RowMajorBit),
Flags0 = (int(LhsFlags) | int(RhsFlags)) & (
HereditaryBits
| (int(LhsFlags) & int(RhsFlags) &
( AlignedBit
| (StorageOrdersAgree ? LinearAccessBit : 0)
| (functor_traits<BinaryOp>::PacketAccess && StorageOrdersAgree && SameType ? PacketAccessBit : 0)
)
)
),
Flags = (Flags0 & ~RowMajorBit) | (LhsFlags & RowMajorBit),
CoeffReadCost = LhsCoeffReadCost + RhsCoeffReadCost + functor_traits<BinaryOp>::Cost
};
};
} // end namespace internal
// we require Lhs and Rhs to have the same scalar type. Currently there is no example of a binary functor
// that would take two operands of different types. If there were such an example, then this check should be
// moved to the BinaryOp functors, on a per-case basis. This would however require a change in the BinaryOp functors, as
// currently they take only one typename Scalar template parameter.
// It is tempting to always allow mixing different types but remember that this is often impossible in the vectorized paths.
// So allowing mixing different types gives very unexpected errors when enabling vectorization, when the user tries to
// add together a float matrix and a double matrix.
#define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP,LHS,RHS) \
EIGEN_STATIC_ASSERT((internal::functor_is_product_like<BINOP>::ret \
? int(internal::scalar_product_traits<LHS, RHS>::Defined) \
: int(internal::is_same<LHS, RHS>::value)), \
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
template<typename BinaryOp, typename Lhs, typename Rhs, typename StorageKind>
class CwiseBinaryOpImpl;
template<typename BinaryOp, typename Lhs, typename Rhs>
class CwiseBinaryOp : internal::no_assignment_operator,
public CwiseBinaryOpImpl<
BinaryOp, Lhs, Rhs,
typename internal::promote_storage_type<typename internal::traits<Lhs>::StorageKind,
typename internal::traits<Rhs>::StorageKind>::ret>
{
public:
typedef typename CwiseBinaryOpImpl<
BinaryOp, Lhs, Rhs,
typename internal::promote_storage_type<typename internal::traits<Lhs>::StorageKind,
typename internal::traits<Rhs>::StorageKind>::ret>::Base Base;
EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseBinaryOp)
typedef typename internal::nested<Lhs>::type LhsNested;
typedef typename internal::nested<Rhs>::type RhsNested;
typedef typename internal::remove_reference<LhsNested>::type _LhsNested;
typedef typename internal::remove_reference<RhsNested>::type _RhsNested;
EIGEN_STRONG_INLINE CwiseBinaryOp(const Lhs& aLhs, const Rhs& aRhs, const BinaryOp& func = BinaryOp())
: m_lhs(aLhs), m_rhs(aRhs), m_functor(func)
{
EIGEN_CHECK_BINARY_COMPATIBILIY(BinaryOp,typename Lhs::Scalar,typename Rhs::Scalar);
// require the sizes to match
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Lhs, Rhs)
eigen_assert(aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols());
}
EIGEN_STRONG_INLINE Index rows() const {
// return the fixed size type if available to enable compile time optimizations
if (internal::traits<typename internal::remove_all<LhsNested>::type>::RowsAtCompileTime==Dynamic)
return m_rhs.rows();
else
return m_lhs.rows();
}
EIGEN_STRONG_INLINE Index cols() const {
// return the fixed size type if available to enable compile time optimizations
if (internal::traits<typename internal::remove_all<LhsNested>::type>::ColsAtCompileTime==Dynamic)
return m_rhs.cols();
else
return m_lhs.cols();
}
/** \returns the left hand side nested expression */
const _LhsNested& lhs() const { return m_lhs; }
/** \returns the right hand side nested expression */
const _RhsNested& rhs() const { return m_rhs; }
/** \returns the functor representing the binary operation */
const BinaryOp& functor() const { return m_functor; }
protected:
LhsNested m_lhs;
RhsNested m_rhs;
const BinaryOp m_functor;
};
template<typename BinaryOp, typename Lhs, typename Rhs>
class CwiseBinaryOpImpl<BinaryOp, Lhs, Rhs, Dense>
: public internal::dense_xpr_base<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >::type
{
typedef CwiseBinaryOp<BinaryOp, Lhs, Rhs> Derived;
public:
typedef typename internal::dense_xpr_base<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >::type Base;
EIGEN_DENSE_PUBLIC_INTERFACE( Derived )
EIGEN_STRONG_INLINE const Scalar coeff(Index rowId, Index colId) const
{
return derived().functor()(derived().lhs().coeff(rowId, colId),
derived().rhs().coeff(rowId, colId));
}
template<int LoadMode>
EIGEN_STRONG_INLINE PacketScalar packet(Index rowId, Index colId) const
{
return derived().functor().packetOp(derived().lhs().template packet<LoadMode>(rowId, colId),
derived().rhs().template packet<LoadMode>(rowId, colId));
}
EIGEN_STRONG_INLINE const Scalar coeff(Index index) const
{
return derived().functor()(derived().lhs().coeff(index),
derived().rhs().coeff(index));
}
template<int LoadMode>
EIGEN_STRONG_INLINE PacketScalar packet(Index index) const
{
return derived().functor().packetOp(derived().lhs().template packet<LoadMode>(index),
derived().rhs().template packet<LoadMode>(index));
}
};
/** replaces \c *this by \c *this - \a other.
*
* \returns a reference to \c *this
*/
template<typename Derived>
template<typename OtherDerived>
EIGEN_STRONG_INLINE Derived &
MatrixBase<Derived>::operator-=(const MatrixBase<OtherDerived> &other)
{
SelfCwiseBinaryOp<internal::scalar_difference_op<Scalar>, Derived, OtherDerived> tmp(derived());
tmp = other.derived();
return derived();
}
/** replaces \c *this by \c *this + \a other.
*
* \returns a reference to \c *this
*/
template<typename Derived>
template<typename OtherDerived>
EIGEN_STRONG_INLINE Derived &
MatrixBase<Derived>::operator+=(const MatrixBase<OtherDerived>& other)
{
SelfCwiseBinaryOp<internal::scalar_sum_op<Scalar>, Derived, OtherDerived> tmp(derived());
tmp = other.derived();
return derived();
}
} // end namespace Eigen
#endif // EIGEN_CWISE_BINARY_OP_H
| {
"pile_set_name": "Github"
} |
/**
* ◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉ ...... SOURCE CODE ......◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉
* ◉◉◉................................................... ◉◉◉
* ◉◉◉ https://github.com/AAChartModel/AAChartCore ◉◉◉
* ◉◉◉ https://github.com/AAChartModel/AAChartCore-Kotlin ◉◉◉
* ◉◉◉................................................... ◉◉◉
* ◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉ ...... SOURCE CODE ......◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉
*/
/**
* -------------------------------------------------------------------------------
*
* 🌕 🌖 🌗 🌘 ❀❀❀ WARM TIPS!!! ❀❀❀ 🌑 🌒 🌓 🌔
*
* Please contact me on GitHub,if there are any problems encountered in use.
* GitHub Issues : https://github.com/AAChartModel/AAChartCore-Kotlin/issues
* -------------------------------------------------------------------------------
* And if you want to contribute for this project, please contact me as well
* GitHub : https://github.com/AAChartModel
* StackOverflow : https://stackoverflow.com/users/7842508/codeforu
* JianShu : http://www.jianshu.com/u/f1e6753d4254
* SegmentFault : https://segmentfault.com/u/huanghunbieguan
*
* -------------------------------------------------------------------------------
*/
package com.aachartmodel.aainfographics.AAInfographicsLib.AAChartCreator
import com.aachartmodel.aainfographics.AAInfographicsLib.AAOptionsModel.AAScrollablePlotArea
enum class AAChartAnimationType(val value :String){
Linear ("Linear"),
EaseInQuad ("easeInQuad"),
EaseOutQuad ("easeOutQuad"),
EaseInOutQuad ("easeInOutQuad"),
EaseInCubic ("easeInCubic"),
EaseOutCubic ("easeOutCubic"),
EaseInOutCubic ("easeInOutCubic"),
EaseInQuart ("easeInQuart"),
EaseOutQuart ("easeOutQuart"),
EaseInOutQuart ("easeInOutQuart"),
EaseInQuint ("easeInQuint"),
EaseOutQuint ("easeOutQuint"),
EaseInOutQuint ("easeInOutQuint"),
EaseInSine ("easeInSine"),
EaseOutSine ("easeOutSine"),
EaseInOutSine ("easeInOutSine"),
EaseInExpo ("easeInExpo"),
EaseOutExpo ("easeOutExpo"),
EaseInOutExpo ("easeInOutExpo"),
EaseInCirc ("easeInCirc"),
EaseOutCirc ("easeOutCirc"),
EaseInOutCirc ("easeInOutCirc"),
EaseOutBounce ("easeOutBounce"),
EaseInBack ("easeInBack"),
EaseOutBack ("easeOutBack"),
EaseInOutBack ("easeInOutBack"),
Elastic ("elastic"),
SwingFromTo ("swingFromTo"),
SwingFrom ("swingFrom"),
SwingTo ("swingTo"),
Bounce ("bounce"),
BouncePast ("bouncePast"),
EaseFromTo ("easeFromTo"),
EaseFrom ("easeFrom"),
EaseTo ("easeTo"),
}
enum class AAChartType(val value: String) {
Column ("column"),
Bar ("bar"),
Area ("area"),
Areaspline ("areaspline"),
Line ("line"),
Spline ("spline"),
Scatter ("scatter"),
Pie ("pie"),
Bubble ("bubble"),
Pyramid ("pyramid"),
Funnel ("funnel"),
Columnrange ("columnrange"),
Arearange ("arearange"),
Areasplinerange ("areasplinerange"),
Boxplot ("boxplot"),
Waterfall ("waterfall"),
Polygon ("polygon"),
Gauge ("gauge"),
Errorbar ("errorbar"),
}
enum class AAChartZoomType(val value: String) {
None ("none"),
X ("x"),
Y ("y"),
XY ("xy"),
}
enum class AAChartStackingType(val value: String) {
False (""),
Normal ("normal"),
Percent ("percent"),
}
enum class AAChartSymbolType(val value: String) {
Circle ("circle"),
Square ("square"),
Diamond ("diamond"),
Triangle ("triangle"),
TriangleDown ("triangle-down"),
}
enum class AAChartSymbolStyleType(val value: String) {
Normal ("normal"),
InnerBlank ("innerBlank"),
BorderBlank ("borderBlank"),
}
enum class AAChartLayoutType(val value: String) {
Horizontal ("horizontal"),
Vertical ("vertical"),
}
enum class AAChartAlignType(val value: String) {
Left ("left"),
Center ("center"),
Right ("right"),
}
enum class AAChartVerticalAlignType(val value: String) {
Top ("top"),
Middle ("middle"),
Bottom ("bottom"),
}
enum class AAChartLineDashStyleType(val value: String) {
Solid ("Solid"),
ShortDash ("ShortDash"),
ShortDot ("ShortDot"),
ShortDashDot ("ShortDashDot"),
ShortDashDotDot ("ShortDashDotDot"),
Dot ("Dot"),
Dash ("Dash"),
LongDash ("LongDash"),
DashDot ("DashDot"),
LongDashDot ("LongDashDot"),
LongDashDotDot ("LongDashDotDot"),
}
enum class AAChartFontWeightType(val value: String) {
Thin ("thin"),
Regular ("regular"),
Bold ("bold"),
}
class AAChartModel {
var animationType: AAChartAnimationType? = null //动画类型
var animationDuration: Int? = null //动画时间
var title: String? = null //标题内容
var titleFontColor: String? = null //标题字体颜色
var titleFontSize: Float? = null //标题字体大小
var titleFontWeight: AAChartFontWeightType? = null //标题字体粗细
var subtitle: String? = null //副标题内容
var subtitleAlign: AAChartAlignType? = null
var subtitleFontColor: String? = null //副标题字体颜色
var subtitleFontSize: Float? = null //副标题字体大小
var subtitleFontWeight: AAChartFontWeightType? = null //副标题字体粗细
var axesTextColor: String? = null //x 轴和 y 轴文字颜色
var chartType: AAChartType? = null //图表类型
var stacking: AAChartStackingType? = null //堆积样式
var markerRadius: Float? = null //折线连接点的半径长度
var markerSymbol: AAChartSymbolType? = null //折线曲线连接点的类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
var markerSymbolStyle: AAChartSymbolStyleType? = null
var zoomType: AAChartZoomType? = null //缩放类型 AAChartZoomTypeX表示可沿着 x 轴进行手势缩放
var pointHollow: Boolean? = null //折线或者曲线的连接点是否为空心的
var inverted: Boolean? = null //x 轴是否翻转(垂直)
var xAxisReversed: Boolean? = null //x 轴翻转
var yAxisReversed: Boolean? = null //y 轴翻转
var tooltipEnabled: Boolean? = null //是否显示浮动提示框(默认显示)
var tooltipValueSuffix: String? = null //浮动提示框单位后缀
var tooltipCrosshairs: Boolean? = null //是否显示准星线(默认显示)
var gradientColorEnable: Boolean? = null //是否要为渐变色
var polar: Boolean? = null //是否极化图形(变为雷达图)
var marginLeft: Float? = null
var marginRight: Float? = null
var dataLabelsEnabled: Boolean? = null //是否显示数据
var dataLabelsFontColor: String? = null
var dataLabelsFontSize: Float? = null
var dataLabelsFontWeight: AAChartFontWeightType? = null
var xAxisLabelsEnabled: Boolean? = null //x轴是否显示数据
var xAxisTickInterval: Int? = null
var categories: Array<String>? = null //x轴是否显示数据
var xAxisGridLineWidth: Float? = null //x轴网格线的宽度
var xAxisVisible: Boolean? = null //x 轴是否显示
var yAxisVisible: Boolean? = null //y 轴是否显示
var yAxisLabelsEnabled: Boolean? = null //y轴是否显示数据
var yAxisTitle: String? = null //y轴标题
var yAxisLineWidth: Float? = null //y 轴轴线的宽度
var yAxisMin: Float? = null
var yAxisMax: Float? = null
var yAxisAllowDecimals: Boolean? = null
var yAxisGridLineWidth: Float? = null //y轴网格线的宽度
var colorsTheme: Array<Any>? = null //图表主题颜色数组
var legendEnabled: Boolean? = null //是否显示图例
var backgroundColor: Any ? = null //图表背景色
var borderRadius: Float? = null //柱状图长条图头部圆角半径(可用于设置头部的形状,仅对条形图,柱状图有效)
var series: Array<AASeriesElement>? = null
var touchEventEnabled: Boolean? = null //是否支持用户触摸事件
var scrollablePlotArea: AAScrollablePlotArea? = null
fun animationType(prop: AAChartAnimationType): AAChartModel {
animationType = prop
return this
}
fun animationDuration(prop: Int?): AAChartModel {
animationDuration = prop
return this
}
fun title(prop: String): AAChartModel {
title = prop
return this
}
fun titleFontColor(prop: String): AAChartModel {
titleFontColor = prop
return this
}
fun titleFontSize(prop: Float?): AAChartModel {
titleFontSize = prop
return this
}
fun titleFontWeight(prop: AAChartFontWeightType): AAChartModel {
titleFontWeight = prop
return this
}
fun subtitle(prop: String): AAChartModel {
subtitle = prop
return this
}
fun subtitleAlign(prop: AAChartAlignType): AAChartModel {
subtitleAlign = prop
return this
}
fun subtitleFontColor(prop: String): AAChartModel {
subtitleFontColor = prop
return this
}
fun subtitleFontSize(prop: Float?): AAChartModel {
subtitleFontSize = prop
return this
}
fun subtitleFontWeight(prop: AAChartFontWeightType): AAChartModel {
subtitleFontWeight = prop
return this
}
fun axesTextColor(prop: String): AAChartModel {
axesTextColor = prop
return this
}
fun chartType(prop: AAChartType): AAChartModel {
chartType = prop
return this
}
fun stacking(prop: AAChartStackingType): AAChartModel {
stacking = prop
return this
}
fun markerRadius(prop: Float?): AAChartModel {
markerRadius = prop
return this
}
fun markerSymbol(prop: AAChartSymbolType): AAChartModel {
markerSymbol = prop
return this
}
fun markerSymbolStyle(prop: AAChartSymbolStyleType): AAChartModel {
markerSymbolStyle = prop
return this
}
fun zoomType(prop: AAChartZoomType): AAChartModel {
zoomType = prop
return this
}
fun pointHollow(prop: Boolean?): AAChartModel {
pointHollow = prop
return this
}
fun inverted(prop: Boolean?): AAChartModel {
inverted = prop
return this
}
fun xAxisReversed(prop: Boolean?): AAChartModel {
xAxisReversed = prop
return this
}
fun yAxisReversed(prop: Boolean?): AAChartModel {
yAxisReversed = prop
return this
}
fun tooltipEnabled(prop: Boolean?): AAChartModel {
tooltipEnabled = prop
return this
}
fun tooltipValueSuffix(prop: String?): AAChartModel {
tooltipValueSuffix = prop
return this
}
fun tooltipCrosshairs(prop: Boolean?): AAChartModel {
tooltipCrosshairs = prop
return this
}
fun gradientColorEnable(prop: Boolean?): AAChartModel {
gradientColorEnable = prop
return this
}
fun polar(prop: Boolean?): AAChartModel {
polar = prop
return this
}
fun marginLeft(prop: Float?): AAChartModel {
marginLeft = prop
return this
}
fun marginright(prop: Float?): AAChartModel {
marginRight = prop
return this
}
fun dataLabelsEnabled(prop: Boolean?): AAChartModel {
dataLabelsEnabled = prop
return this
}
fun dataLabelsFontColor(prop: String): AAChartModel {
dataLabelsFontColor = prop
return this
}
fun dataLabelsFontSize(prop: Float?): AAChartModel {
dataLabelsFontSize = prop
return this
}
fun dataLabelsFontWeight(prop: AAChartFontWeightType): AAChartModel {
dataLabelsFontWeight = prop
return this
}
fun xAxisLabelsEnabled(prop: Boolean?): AAChartModel {
xAxisLabelsEnabled = prop
return this
}
fun xAxisTickInterval(prop: Int?): AAChartModel {
xAxisTickInterval = prop
return this
}
fun categories(prop: Array<String>): AAChartModel {
categories = prop
return this
}
fun xAxisGridLineWidth(prop: Float?): AAChartModel {
xAxisGridLineWidth = prop
return this
}
fun yAxisGridLineWidth(prop: Float?): AAChartModel {
yAxisGridLineWidth = prop
return this
}
fun xAxisVisible(prop: Boolean?): AAChartModel {
xAxisVisible = prop
return this
}
fun yAxisVisible(prop: Boolean?): AAChartModel {
yAxisVisible = prop
return this
}
fun yAxisLabelsEnabled(prop: Boolean?): AAChartModel {
yAxisLabelsEnabled = prop
return this
}
fun yAxisTitle(prop: String): AAChartModel {
yAxisTitle = prop
return this
}
fun yAxisLineWidth(prop: Float?): AAChartModel {
yAxisLineWidth = prop
return this
}
fun yAxisMin(prop: Float?): AAChartModel {
yAxisMin = prop
return this
}
fun yAxisMax(prop: Float?): AAChartModel {
yAxisMax = prop
return this
}
fun yAxisAllowDecimals(prop: Boolean?): AAChartModel {
yAxisAllowDecimals = prop
return this
}
fun colorsTheme(prop: Array<Any>): AAChartModel {
colorsTheme = prop
return this
}
fun legendEnabled(prop: Boolean?): AAChartModel {
legendEnabled = prop
return this
}
fun backgroundColor(prop: Any): AAChartModel {
backgroundColor = prop
return this
}
fun borderRadius(prop: Float?): AAChartModel {
borderRadius = prop
return this
}
fun series(prop: Array<AASeriesElement>): AAChartModel {
series = prop
return this
}
fun touchEventEnabled(prop: Boolean?): AAChartModel {
touchEventEnabled = prop
return this
}
fun scrollablePlotArea(prop: AAScrollablePlotArea): AAChartModel? {
scrollablePlotArea = prop
return this
}
init {
title = ""
subtitle = ""
chartType = AAChartType.Line
animationDuration = 500 //以毫秒为单位
animationType = AAChartAnimationType.Linear
pointHollow = false
inverted = false
stacking = AAChartStackingType.False
xAxisReversed = false
yAxisReversed = false
zoomType = AAChartZoomType.None
dataLabelsEnabled = false
markerSymbolStyle = AAChartSymbolStyleType.Normal
colorsTheme = arrayOf("#fe117c", "#ffc069", "#06caf4", "#7dffc0")
tooltipCrosshairs = true
gradientColorEnable = false
polar = false
xAxisLabelsEnabled = true
xAxisGridLineWidth = 0f
yAxisLabelsEnabled = true
yAxisGridLineWidth = 1f
legendEnabled = true
backgroundColor = "#ffffff"
borderRadius = 0f//柱状图长条图头部圆角半径(可用于设置头部的形状,仅对条形图,柱状图有效,设置为1000时,柱形图或者条形图头部为楔形)
markerRadius = 6f//折线连接点的半径长度,如果值设置为0,这样就相当于不显示了
titleFontColor = "#000000" //标题字体颜色为黑色
titleFontWeight = AAChartFontWeightType.Regular //常规字体
titleFontSize = 11f
subtitleFontColor = "#000000" //副标题字体颜色为黑色
subtitleFontWeight = AAChartFontWeightType.Regular //常规字体
subtitleFontSize = 9f
dataLabelsFontColor = "#000000" //数据标签默认颜色为黑色
dataLabelsFontWeight = AAChartFontWeightType.Bold //图表的数据字体为粗体
dataLabelsFontSize = 10f
}
} | {
"pile_set_name": "Github"
} |
package ch.ge.ve.commons.fileutils
/*
* -
* #%L
* Common crypto utilities
* %%
* Copyright (C) 2016 République et Canton de Genève
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
import spock.lang.Specification
import spock.lang.Unroll
import java.nio.file.Path
import java.nio.file.Paths
import java.time.LocalDateTime
import java.time.ZonedDateTime
import java.time.ZoneId
import java.time.format.DateTimeFormatter
import java.util.regex.Pattern
/**
* This test suit aims at covering the {@link OutputFilesPattern} utility class.
*/
class OutputFilesPatternTest extends Specification {
private OutputFilesPattern ofp = new OutputFilesPattern()
private DateTimeFormatter dateTimeFormatter
private ZonedDateTime dateTime
private String username;
void setup() {
dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
dateTime = LocalDateTime.parse("2016-11-21 23:25:54", dateTimeFormatter).atZone(ZoneId.of("Europe/Zurich"));
username = System.getProperty("user.name")
System.setProperty("user.name", "MyUser")
}
void cleanup() {
System.setProperty("user.name", username)
}
def "injectParam should correctly inject user and date"() {
when:
def s = ofp.injectParams("{user} made something on {date}", "TheUser", dateTime)
then:
s == "TheUser made something on 20161121"
}
def "injectParam should inject system user and date if user parameter is not specified"() {
when:
def s = ofp.injectParams("{user} made something on {date}", dateTime)
then:
s == "MyUser made something on 20161121"
}
def "injectParam should correctly inject user and datetime"() {
when:
def s = ofp.injectParams("{user} made something on {datetime}", "TheUser", dateTime)
then:
s == "TheUser made something on 2016-11-21-23h25m54s"
}
def "injectParam should inject system user and datetime if user parameter is not specified"() {
when:
def s = ofp.injectParams("{user} made something on {datetime}", dateTime)
then:
s == "MyUser made something on 2016-11-21-23h25m54s"
}
def "injectParam should correctly inject user, date and operation code"() {
when:
def s = ofp.injectParams("{user} made something on {date} for operation {operationCode}", "TheUser", dateTime, "201611VP")
then:
s == "TheUser made something on 20161121 for operation 201611VP"
}
def "injectParam should correctly inject system user, date and operation code"() {
when:
def s = ofp.injectParams("{user} made something on {date} for operation {operationCode}", dateTime, "201611VP")
then:
s == "MyUser made something on 20161121 for operation 201611VP"
}
def "injectParam should correctly inject user, date, operation code and canton"() {
when:
def s = ofp.injectParams("{user} made something on {date} for operation {operationCode} and canton {canton}", "TheUser", dateTime, "201611VP", "GE")
then:
s == "TheUser made something on 20161121 for operation 201611VP and canton GE"
}
def "injectParam should correctly inject system user, date, operation code and canton"() {
when:
def s = ofp.injectParams("{user} made something on {date} for operation {operationCode} and canton {canton}", dateTime, "201611VP", "GE")
then:
s == "MyUser made something on 20161121 for operation 201611VP and canton GE"
}
def "injectParam should correctly inject system user, date, operation code, canton and voters name"() {
when:
def s = ofp.injectParams("{user} made something on {date} for operation {operationCode} and canton {canton}, for voters {votersName}", dateTime, "201611VP", "GE", "SE")
then:
s == "MyUser made something on 20161121 for operation 201611VP and canton GE, for voters SE"
}
@Unroll
def "findFirstFileByPattern should find file '#filename' for pattern '#pattern'"() {
given:
def rootPath = Paths.get(this.getClass().getClassLoader().getResource("aFile.txt").toURI()).getParent()
expect:
def foundPath = ofp.findFirstFileByPattern(Pattern.compile(pattern), rootPath)
isFilePresent(foundPath, filename)
where:
pattern || filename
/.*\.txt/ || "aFile.txt"
/another.*\.txt/ || "anotherFile.txt"
/unknown.*\.txt/ || null
}
private static boolean isFilePresent(Optional<Path> foundPath, String filename) {
if (foundPath.isPresent()) {
return filename == foundPath.get().getFileName().toString()
} else {
return null == filename
}
}
def "error while trying to find the first file matching a pattern should raise a FileOperationRuntimeException"() {
given:
def rootPath = Paths.get("unknown_path")
when:
ofp.findFirstFileByPattern(Pattern.compile(/.*\.txt/ ), rootPath)
then:
thrown(FileOperationRuntimeException)
}
}
| {
"pile_set_name": "Github"
} |
<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>chigraph: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="chigraphDoxygenIcon.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">chigraph
 <span id="projectnumber">master</span>
</div>
<div id="projectbrief">Systems programming language written for beginners in LLVM</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('structchi_1_1GraphFunction.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">chi::GraphFunction Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#ab2b04efa795ef12d628f13ff55e55043">addDataInput</a>(const DataType &type, std::string name, size_t addBefore=(std::numeric_limits< size_t >::max)())</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#aef07b609586e0961cc16d0000362470d">addDataOutput</a>(const DataType &type, std::string name, size_t addBefore=(std::numeric_limits< size_t >::max)())</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#aa19f446296aa429b583cad3c044d780c">addExecInput</a>(std::string name, size_t addBefore=(std::numeric_limits< size_t >::max)())</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a0ae483cab804b1128d14ff2560818f82">addExecOutput</a>(std::string name, size_t addBefore=(std::numeric_limits< size_t >::max)())</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#aca401237496ae311e43c7a43519e4720">context</a>() const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a1d740529978bdf31284b6b815ec0426b">createEntryNodeType</a>(std::unique_ptr< NodeType > *toFill) const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#af14ad950cfff4ad3091827f9b6ad1cd2">createExitNodeType</a>(std::unique_ptr< NodeType > *toFill) const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#ab457f58fbb96c8089340b4ebd43cb633">dataInputs</a>() const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#ab0bf0d819ff062c01220614f617d5965">dataOutputs</a>() const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#ad261ccd66a6fcbf6492cf6565e365d0e">description</a>() const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#ae47496f51bd5ba48bc0afd52f03ef722">entryNode</a>() const noexcept</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a64fa4eceaf024d3ebf628fe15e7ca9be">execInputs</a>() const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#ab47bbbd84f14240b824c1a780b125207">execOutputs</a>() const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#aa2c89c659786c9928a616a81dab267e4">functionType</a>() const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a9a3b003e74692f5d0aa474d28c0dd23d">getOrCreateLocalVariable</a>(std::string name, DataType type, bool *inserted=nullptr)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a0e722c9bae3101c4bb54ad9baae6f841">getOrInsertEntryNode</a>(float x, float y, boost::uuids::uuid id=boost::uuids::random_generator()(), NodeInstance **toFill=nullptr)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a44459c33f26a8f4d9529619991988100">GraphFunction</a>(GraphModule &mod, std::string name, std::vector< NamedDataType > dataIns, std::vector< NamedDataType > dataOuts, std::vector< std::string > execIns, std::vector< std::string > execOuts)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GraphFunction</b>(const GraphFunction &)=delete (defined in <a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a>)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GraphFunction</b>(GraphFunction &&)=delete (defined in <a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a>)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#ac75470b92fcf30495c7daab64d999ed8">insertNode</a>(std::unique_ptr< NodeType > type, float x, float y, boost::uuids::uuid id=boost::uuids::random_generator()(), NodeInstance **toFill=nullptr)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#abcd2e1de52782e5a16aca65b9af328ca">insertNode</a>(const boost::filesystem::path &moduleName, boost::string_view typeName, const nlohmann::json &typeJSON, float x, float y, boost::uuids::uuid id=boost::uuids::random_generator()(), NodeInstance **toFill=nullptr)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a0123fb77fb0a19ea18163afb88f7687b">localVariableFromName</a>(boost::string_view name) const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a44f8f791775e4878b6bde37140cd131d">localVariables</a>() const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a0564412e260698bdb3872d3d12dfc3bc">module</a>() const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a89069f6e08f71cfbafb245ea16c8d69f">name</a>() const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#acb3281f6b313b7070efb0ee84b937523">nodeByID</a>(const boost::uuids::uuid &id) const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#aa5985d96d7564d7ee7f240fdb02b41a6">nodes</a>()</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a900c0b670ad04a76b6add803ade7ae0d">nodes</a>() const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a56ba667341ecc6fce1e290cce6aedf53">nodesWithType</a>(const boost::filesystem::path &module, boost::string_view name) const noexcept</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>operator=</b>(const GraphFunction &)=delete (defined in <a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a>)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>operator=</b>(GraphFunction &&)=delete (defined in <a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a>)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#ad739c826ed87035857193995c23cabe2">qualifiedName</a>() const</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#abac77d34a4bf04d7c409655b0b3e89d0">removeDataInput</a>(size_t idx)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a65db0e7550128544600ebb1fff4bd69c">removeDataOutput</a>(size_t idx)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a90ff1195a338ddbf8e8654b6efc9b0b7">removeExecInput</a>(size_t idx)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#af452babcc5f350cf185b3b5f98151e14">removeExecOutput</a>(size_t idx)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a81f2a4203abba46ff8494a6a7e192094">removeLocalVariable</a>(boost::string_view name)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a2248f5089ddc01a46b9ba4129925a44c">removeNode</a>(NodeInstance &nodeToRemove)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a4bb426c921d46bbd8cbf237d716bc1c5">renameDataInput</a>(size_t idx, std::string newName)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a8b31017553adfc52ad6140868c328fbd">renameDataOutput</a>(size_t idx, std::string newName)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a26a88fe7adb30077c54732af11136685">renameExecInput</a>(size_t idx, std::string name)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a3c10d56dd68371400993b4a3c120f585">renameExecOutput</a>(size_t idx, std::string name)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a60bc423cb4fed3605a446da112949483">renameLocalVariable</a>(std::string oldName, std::string newName)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#aa69ea8953b3c1b9da14a5364c747e49b">retypeDataInput</a>(size_t idx, DataType newType)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a7772a0180716a2c29436d086d757743e">retypeDataOutput</a>(size_t idx, DataType newType)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a4c38679ec5e727bfb71c8eaaa5a8ca1a">retypeLocalVariable</a>(boost::string_view name, DataType newType)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#afdcae25278b1de714d77cf8051172cdf">setDescription</a>(std::string newDesc)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a27c87614be4357e97c1ececd2228f865">setName</a>(boost::string_view newName, bool updateReferences=true)</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html#a89c896ae804c853b4c291897f5f8634c">~GraphFunction</a>()=default</td><td class="entry"><a class="el" href="structchi_1_1GraphFunction.html">chi::GraphFunction</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Sat Sep 16 2017 17:41:35 for chigraph by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
</ul>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: k8s.io/kubernetes/vendor/k8s.io/api/batch/v1/generated.proto
/*
Package v1 is a generated protocol buffer package.
It is generated from these files:
k8s.io/kubernetes/vendor/k8s.io/api/batch/v1/generated.proto
It has these top-level messages:
Job
JobCondition
JobList
JobSpec
JobStatus
*/
package v1
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import k8s_io_api_core_v1 "k8s.io/api/core/v1"
import k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
import strings "strings"
import reflect "reflect"
import io "io"
// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package
func (m *Job) Reset() { *m = Job{} }
func (*Job) ProtoMessage() {}
func (*Job) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} }
func (m *JobCondition) Reset() { *m = JobCondition{} }
func (*JobCondition) ProtoMessage() {}
func (*JobCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} }
func (m *JobList) Reset() { *m = JobList{} }
func (*JobList) ProtoMessage() {}
func (*JobList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} }
func (m *JobSpec) Reset() { *m = JobSpec{} }
func (*JobSpec) ProtoMessage() {}
func (*JobSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} }
func (m *JobStatus) Reset() { *m = JobStatus{} }
func (*JobStatus) ProtoMessage() {}
func (*JobStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} }
func init() {
proto.RegisterType((*Job)(nil), "k8s.io.api.batch.v1.Job")
proto.RegisterType((*JobCondition)(nil), "k8s.io.api.batch.v1.JobCondition")
proto.RegisterType((*JobList)(nil), "k8s.io.api.batch.v1.JobList")
proto.RegisterType((*JobSpec)(nil), "k8s.io.api.batch.v1.JobSpec")
proto.RegisterType((*JobStatus)(nil), "k8s.io.api.batch.v1.JobStatus")
}
func (m *Job) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Job) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size()))
n1, err := m.ObjectMeta.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
dAtA[i] = 0x12
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size()))
n2, err := m.Spec.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
dAtA[i] = 0x1a
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size()))
n3, err := m.Status.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n3
return i, nil
}
func (m *JobCondition) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *JobCondition) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type)))
i += copy(dAtA[i:], m.Type)
dAtA[i] = 0x12
i++
i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status)))
i += copy(dAtA[i:], m.Status)
dAtA[i] = 0x1a
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.LastProbeTime.Size()))
n4, err := m.LastProbeTime.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n4
dAtA[i] = 0x22
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.LastTransitionTime.Size()))
n5, err := m.LastTransitionTime.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n5
dAtA[i] = 0x2a
i++
i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason)))
i += copy(dAtA[i:], m.Reason)
dAtA[i] = 0x32
i++
i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message)))
i += copy(dAtA[i:], m.Message)
return i, nil
}
func (m *JobList) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *JobList) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size()))
n6, err := m.ListMeta.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n6
if len(m.Items) > 0 {
for _, msg := range m.Items {
dAtA[i] = 0x12
i++
i = encodeVarintGenerated(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
return i, nil
}
func (m *JobSpec) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *JobSpec) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Parallelism != nil {
dAtA[i] = 0x8
i++
i = encodeVarintGenerated(dAtA, i, uint64(*m.Parallelism))
}
if m.Completions != nil {
dAtA[i] = 0x10
i++
i = encodeVarintGenerated(dAtA, i, uint64(*m.Completions))
}
if m.ActiveDeadlineSeconds != nil {
dAtA[i] = 0x18
i++
i = encodeVarintGenerated(dAtA, i, uint64(*m.ActiveDeadlineSeconds))
}
if m.Selector != nil {
dAtA[i] = 0x22
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size()))
n7, err := m.Selector.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n7
}
if m.ManualSelector != nil {
dAtA[i] = 0x28
i++
if *m.ManualSelector {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
dAtA[i] = 0x32
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.Template.Size()))
n8, err := m.Template.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n8
if m.BackoffLimit != nil {
dAtA[i] = 0x38
i++
i = encodeVarintGenerated(dAtA, i, uint64(*m.BackoffLimit))
}
if m.TTLSecondsAfterFinished != nil {
dAtA[i] = 0x40
i++
i = encodeVarintGenerated(dAtA, i, uint64(*m.TTLSecondsAfterFinished))
}
return i, nil
}
func (m *JobStatus) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *JobStatus) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Conditions) > 0 {
for _, msg := range m.Conditions {
dAtA[i] = 0xa
i++
i = encodeVarintGenerated(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.StartTime != nil {
dAtA[i] = 0x12
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.StartTime.Size()))
n9, err := m.StartTime.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n9
}
if m.CompletionTime != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.CompletionTime.Size()))
n10, err := m.CompletionTime.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n10
}
dAtA[i] = 0x20
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.Active))
dAtA[i] = 0x28
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.Succeeded))
dAtA[i] = 0x30
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.Failed))
return i, nil
}
func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *Job) Size() (n int) {
var l int
_ = l
l = m.ObjectMeta.Size()
n += 1 + l + sovGenerated(uint64(l))
l = m.Spec.Size()
n += 1 + l + sovGenerated(uint64(l))
l = m.Status.Size()
n += 1 + l + sovGenerated(uint64(l))
return n
}
func (m *JobCondition) Size() (n int) {
var l int
_ = l
l = len(m.Type)
n += 1 + l + sovGenerated(uint64(l))
l = len(m.Status)
n += 1 + l + sovGenerated(uint64(l))
l = m.LastProbeTime.Size()
n += 1 + l + sovGenerated(uint64(l))
l = m.LastTransitionTime.Size()
n += 1 + l + sovGenerated(uint64(l))
l = len(m.Reason)
n += 1 + l + sovGenerated(uint64(l))
l = len(m.Message)
n += 1 + l + sovGenerated(uint64(l))
return n
}
func (m *JobList) Size() (n int) {
var l int
_ = l
l = m.ListMeta.Size()
n += 1 + l + sovGenerated(uint64(l))
if len(m.Items) > 0 {
for _, e := range m.Items {
l = e.Size()
n += 1 + l + sovGenerated(uint64(l))
}
}
return n
}
func (m *JobSpec) Size() (n int) {
var l int
_ = l
if m.Parallelism != nil {
n += 1 + sovGenerated(uint64(*m.Parallelism))
}
if m.Completions != nil {
n += 1 + sovGenerated(uint64(*m.Completions))
}
if m.ActiveDeadlineSeconds != nil {
n += 1 + sovGenerated(uint64(*m.ActiveDeadlineSeconds))
}
if m.Selector != nil {
l = m.Selector.Size()
n += 1 + l + sovGenerated(uint64(l))
}
if m.ManualSelector != nil {
n += 2
}
l = m.Template.Size()
n += 1 + l + sovGenerated(uint64(l))
if m.BackoffLimit != nil {
n += 1 + sovGenerated(uint64(*m.BackoffLimit))
}
if m.TTLSecondsAfterFinished != nil {
n += 1 + sovGenerated(uint64(*m.TTLSecondsAfterFinished))
}
return n
}
func (m *JobStatus) Size() (n int) {
var l int
_ = l
if len(m.Conditions) > 0 {
for _, e := range m.Conditions {
l = e.Size()
n += 1 + l + sovGenerated(uint64(l))
}
}
if m.StartTime != nil {
l = m.StartTime.Size()
n += 1 + l + sovGenerated(uint64(l))
}
if m.CompletionTime != nil {
l = m.CompletionTime.Size()
n += 1 + l + sovGenerated(uint64(l))
}
n += 1 + sovGenerated(uint64(m.Active))
n += 1 + sovGenerated(uint64(m.Succeeded))
n += 1 + sovGenerated(uint64(m.Failed))
return n
}
func sovGenerated(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozGenerated(x uint64) (n int) {
return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *Job) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Job{`,
`ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
`Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "JobSpec", "JobSpec", 1), `&`, ``, 1) + `,`,
`Status:` + strings.Replace(strings.Replace(this.Status.String(), "JobStatus", "JobStatus", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
}
func (this *JobCondition) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&JobCondition{`,
`Type:` + fmt.Sprintf("%v", this.Type) + `,`,
`Status:` + fmt.Sprintf("%v", this.Status) + `,`,
`LastProbeTime:` + strings.Replace(strings.Replace(this.LastProbeTime.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`,
`LastTransitionTime:` + strings.Replace(strings.Replace(this.LastTransitionTime.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`,
`Reason:` + fmt.Sprintf("%v", this.Reason) + `,`,
`Message:` + fmt.Sprintf("%v", this.Message) + `,`,
`}`,
}, "")
return s
}
func (this *JobList) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&JobList{`,
`ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`,
`Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "Job", "Job", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
}
func (this *JobSpec) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&JobSpec{`,
`Parallelism:` + valueToStringGenerated(this.Parallelism) + `,`,
`Completions:` + valueToStringGenerated(this.Completions) + `,`,
`ActiveDeadlineSeconds:` + valueToStringGenerated(this.ActiveDeadlineSeconds) + `,`,
`Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
`ManualSelector:` + valueToStringGenerated(this.ManualSelector) + `,`,
`Template:` + strings.Replace(strings.Replace(this.Template.String(), "PodTemplateSpec", "k8s_io_api_core_v1.PodTemplateSpec", 1), `&`, ``, 1) + `,`,
`BackoffLimit:` + valueToStringGenerated(this.BackoffLimit) + `,`,
`TTLSecondsAfterFinished:` + valueToStringGenerated(this.TTLSecondsAfterFinished) + `,`,
`}`,
}, "")
return s
}
func (this *JobStatus) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&JobStatus{`,
`Conditions:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Conditions), "JobCondition", "JobCondition", 1), `&`, ``, 1) + `,`,
`StartTime:` + strings.Replace(fmt.Sprintf("%v", this.StartTime), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1) + `,`,
`CompletionTime:` + strings.Replace(fmt.Sprintf("%v", this.CompletionTime), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1) + `,`,
`Active:` + fmt.Sprintf("%v", this.Active) + `,`,
`Succeeded:` + fmt.Sprintf("%v", this.Succeeded) + `,`,
`Failed:` + fmt.Sprintf("%v", this.Failed) + `,`,
`}`,
}, "")
return s
}
func valueToStringGenerated(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *Job) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Job: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Job: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthGenerated
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *JobCondition) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: JobCondition: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: JobCondition: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Type = JobConditionType(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Status = k8s_io_api_core_v1.ConditionStatus(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field LastProbeTime", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.LastProbeTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Reason = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Message = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthGenerated
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *JobList) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: JobList: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: JobList: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Items = append(m.Items, Job{})
if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthGenerated
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *JobSpec) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: JobSpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: JobSpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Parallelism", wireType)
}
var v int32
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (int32(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.Parallelism = &v
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Completions", wireType)
}
var v int32
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (int32(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.Completions = &v
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ActiveDeadlineSeconds", wireType)
}
var v int64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.ActiveDeadlineSeconds = &v
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Selector == nil {
m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
}
if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ManualSelector", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
b := bool(v != 0)
m.ManualSelector = &b
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.Template.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 7:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field BackoffLimit", wireType)
}
var v int32
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (int32(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.BackoffLimit = &v
case 8:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field TTLSecondsAfterFinished", wireType)
}
var v int32
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (int32(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.TTLSecondsAfterFinished = &v
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthGenerated
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *JobStatus) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: JobStatus: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: JobStatus: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Conditions = append(m.Conditions, JobCondition{})
if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.StartTime == nil {
m.StartTime = &k8s_io_apimachinery_pkg_apis_meta_v1.Time{}
}
if err := m.StartTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field CompletionTime", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.CompletionTime == nil {
m.CompletionTime = &k8s_io_apimachinery_pkg_apis_meta_v1.Time{}
}
if err := m.CompletionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Active", wireType)
}
m.Active = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Active |= (int32(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Succeeded", wireType)
}
m.Succeeded = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Succeeded |= (int32(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 6:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType)
}
m.Failed = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Failed |= (int32(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthGenerated
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipGenerated(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGenerated
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGenerated
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGenerated
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
iNdEx += length
if length < 0 {
return 0, ErrInvalidLengthGenerated
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGenerated
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipGenerated(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
)
func init() {
proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/batch/v1/generated.proto", fileDescriptorGenerated)
}
var fileDescriptorGenerated = []byte{
// 929 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x5d, 0x6f, 0xe3, 0x44,
0x14, 0xad, 0x9b, 0xa6, 0x4d, 0xa6, 0x1f, 0x5b, 0x06, 0x55, 0x1b, 0x0a, 0xb2, 0x97, 0x20, 0xa1,
0x82, 0x84, 0x4d, 0x4b, 0x85, 0x10, 0x02, 0xa4, 0x75, 0x51, 0x25, 0xaa, 0x54, 0x5b, 0x26, 0x59,
0x21, 0x21, 0x90, 0x18, 0xdb, 0x37, 0x89, 0x89, 0xed, 0xb1, 0x3c, 0x93, 0x48, 0x7d, 0xe3, 0x27,
0xf0, 0x23, 0x10, 0x7f, 0x82, 0x77, 0xd4, 0xc7, 0x7d, 0xdc, 0x27, 0x8b, 0x9a, 0x1f, 0xc0, 0xfb,
0x3e, 0xa1, 0x19, 0x3b, 0xb6, 0xd3, 0x26, 0xa2, 0xcb, 0x5b, 0xe6, 0xcc, 0x39, 0xe7, 0x5e, 0xdf,
0x39, 0xb9, 0xe8, 0x8b, 0xc9, 0x67, 0xdc, 0xf4, 0x99, 0x35, 0x99, 0x3a, 0x90, 0x44, 0x20, 0x80,
0x5b, 0x33, 0x88, 0x3c, 0x96, 0x58, 0xc5, 0x05, 0x8d, 0x7d, 0xcb, 0xa1, 0xc2, 0x1d, 0x5b, 0xb3,
0x63, 0x6b, 0x04, 0x11, 0x24, 0x54, 0x80, 0x67, 0xc6, 0x09, 0x13, 0x0c, 0xbf, 0x99, 0x93, 0x4c,
0x1a, 0xfb, 0xa6, 0x22, 0x99, 0xb3, 0xe3, 0xc3, 0x8f, 0x46, 0xbe, 0x18, 0x4f, 0x1d, 0xd3, 0x65,
0xa1, 0x35, 0x62, 0x23, 0x66, 0x29, 0xae, 0x33, 0x1d, 0xaa, 0x93, 0x3a, 0xa8, 0x5f, 0xb9, 0xc7,
0x61, 0xb7, 0x56, 0xc8, 0x65, 0x09, 0x2c, 0xa9, 0x73, 0x78, 0x5a, 0x71, 0x42, 0xea, 0x8e, 0xfd,
0x08, 0x92, 0x6b, 0x2b, 0x9e, 0x8c, 0x24, 0xc0, 0xad, 0x10, 0x04, 0x5d, 0xa6, 0xb2, 0x56, 0xa9,
0x92, 0x69, 0x24, 0xfc, 0x10, 0xee, 0x09, 0x3e, 0xfd, 0x2f, 0x01, 0x77, 0xc7, 0x10, 0xd2, 0xbb,
0xba, 0xee, 0x3f, 0x1a, 0x6a, 0x5c, 0x30, 0x07, 0xff, 0x84, 0x5a, 0xb2, 0x17, 0x8f, 0x0a, 0xda,
0xd1, 0x9e, 0x68, 0x47, 0xdb, 0x27, 0x1f, 0x9b, 0xd5, 0x84, 0x4a, 0x4b, 0x33, 0x9e, 0x8c, 0x24,
0xc0, 0x4d, 0xc9, 0x36, 0x67, 0xc7, 0xe6, 0x33, 0xe7, 0x67, 0x70, 0xc5, 0x25, 0x08, 0x6a, 0xe3,
0x9b, 0xd4, 0x58, 0xcb, 0x52, 0x03, 0x55, 0x18, 0x29, 0x5d, 0xf1, 0x57, 0x68, 0x83, 0xc7, 0xe0,
0x76, 0xd6, 0x95, 0xfb, 0x3b, 0xe6, 0x92, 0xf9, 0x9b, 0x17, 0xcc, 0xe9, 0xc7, 0xe0, 0xda, 0x3b,
0x85, 0xd3, 0x86, 0x3c, 0x11, 0xa5, 0xc3, 0xe7, 0x68, 0x93, 0x0b, 0x2a, 0xa6, 0xbc, 0xd3, 0x50,
0x0e, 0xfa, 0x4a, 0x07, 0xc5, 0xb2, 0xf7, 0x0a, 0x8f, 0xcd, 0xfc, 0x4c, 0x0a, 0x75, 0xf7, 0xcf,
0x06, 0xda, 0xb9, 0x60, 0xce, 0x19, 0x8b, 0x3c, 0x5f, 0xf8, 0x2c, 0xc2, 0xa7, 0x68, 0x43, 0x5c,
0xc7, 0xa0, 0x3e, 0xbb, 0x6d, 0x3f, 0x99, 0x97, 0x1e, 0x5c, 0xc7, 0xf0, 0x2a, 0x35, 0xf6, 0xeb,
0x5c, 0x89, 0x11, 0xc5, 0xc6, 0xbd, 0xb2, 0x9d, 0x75, 0xa5, 0x3b, 0x5d, 0x2c, 0xf7, 0x2a, 0x35,
0x96, 0xa4, 0xc3, 0x2c, 0x9d, 0x16, 0x9b, 0xc2, 0x23, 0xb4, 0x1b, 0x50, 0x2e, 0xae, 0x12, 0xe6,
0xc0, 0xc0, 0x0f, 0xa1, 0xf8, 0xc6, 0x0f, 0x1f, 0xf6, 0x06, 0x52, 0x61, 0x1f, 0x14, 0x0d, 0xec,
0xf6, 0xea, 0x46, 0x64, 0xd1, 0x17, 0xcf, 0x10, 0x96, 0xc0, 0x20, 0xa1, 0x11, 0xcf, 0x3f, 0x49,
0x56, 0xdb, 0x78, 0xed, 0x6a, 0x87, 0x45, 0x35, 0xdc, 0xbb, 0xe7, 0x46, 0x96, 0x54, 0xc0, 0xef,
0xa3, 0xcd, 0x04, 0x28, 0x67, 0x51, 0xa7, 0xa9, 0xc6, 0x55, 0xbe, 0x0e, 0x51, 0x28, 0x29, 0x6e,
0xf1, 0x07, 0x68, 0x2b, 0x04, 0xce, 0xe9, 0x08, 0x3a, 0x9b, 0x8a, 0xf8, 0xa8, 0x20, 0x6e, 0x5d,
0xe6, 0x30, 0x99, 0xdf, 0x77, 0x7f, 0xd7, 0xd0, 0xd6, 0x05, 0x73, 0x7a, 0x3e, 0x17, 0xf8, 0x87,
0x7b, 0xf1, 0x35, 0x1f, 0xf6, 0x31, 0x52, 0xad, 0xc2, 0xbb, 0x5f, 0xd4, 0x69, 0xcd, 0x91, 0x5a,
0x74, 0xbf, 0x44, 0x4d, 0x5f, 0x40, 0x28, 0x9f, 0xba, 0x71, 0xb4, 0x7d, 0xd2, 0x59, 0x95, 0x3c,
0x7b, 0xb7, 0x30, 0x69, 0x7e, 0x23, 0xe9, 0x24, 0x57, 0x75, 0xff, 0xd8, 0x50, 0x8d, 0xca, 0x2c,
0xe3, 0x63, 0xb4, 0x1d, 0xd3, 0x84, 0x06, 0x01, 0x04, 0x3e, 0x0f, 0x55, 0xaf, 0x4d, 0xfb, 0x51,
0x96, 0x1a, 0xdb, 0x57, 0x15, 0x4c, 0xea, 0x1c, 0x29, 0x71, 0x59, 0x18, 0x07, 0x20, 0x87, 0x99,
0xc7, 0xad, 0x90, 0x9c, 0x55, 0x30, 0xa9, 0x73, 0xf0, 0x33, 0x74, 0x40, 0x5d, 0xe1, 0xcf, 0xe0,
0x6b, 0xa0, 0x5e, 0xe0, 0x47, 0xd0, 0x07, 0x97, 0x45, 0x5e, 0xfe, 0xd7, 0x69, 0xd8, 0x6f, 0x65,
0xa9, 0x71, 0xf0, 0x74, 0x19, 0x81, 0x2c, 0xd7, 0xe1, 0x1f, 0x51, 0x8b, 0x43, 0x00, 0xae, 0x60,
0x49, 0x11, 0x96, 0x4f, 0x1e, 0x38, 0x5f, 0xea, 0x40, 0xd0, 0x2f, 0xa4, 0xf6, 0x8e, 0x1c, 0xf0,
0xfc, 0x44, 0x4a, 0x4b, 0xfc, 0x39, 0xda, 0x0b, 0x69, 0x34, 0xa5, 0x25, 0x53, 0xa5, 0xa4, 0x65,
0xe3, 0x2c, 0x35, 0xf6, 0x2e, 0x17, 0x6e, 0xc8, 0x1d, 0x26, 0xfe, 0x16, 0xb5, 0x04, 0x84, 0x71,
0x40, 0x45, 0x1e, 0x99, 0xed, 0x93, 0xf7, 0xea, 0xef, 0x23, 0xff, 0x79, 0xb2, 0x91, 0x2b, 0xe6,
0x0d, 0x0a, 0x9a, 0x5a, 0x31, 0xe5, 0x7b, 0xcf, 0x51, 0x52, 0xda, 0xe0, 0x53, 0xb4, 0xe3, 0x50,
0x77, 0xc2, 0x86, 0xc3, 0x9e, 0x1f, 0xfa, 0xa2, 0xb3, 0xa5, 0x46, 0xbe, 0x9f, 0xa5, 0xc6, 0x8e,
0x5d, 0xc3, 0xc9, 0x02, 0x0b, 0x3f, 0x47, 0x8f, 0x85, 0x08, 0x8a, 0x89, 0x3d, 0x1d, 0x0a, 0x48,
0xce, 0xfd, 0xc8, 0xe7, 0x63, 0xf0, 0x3a, 0x2d, 0x65, 0xf0, 0x76, 0x96, 0x1a, 0x8f, 0x07, 0x83,
0xde, 0x32, 0x0a, 0x59, 0xa5, 0xed, 0xfe, 0xd6, 0x40, 0xed, 0x72, 0xab, 0xe1, 0xe7, 0x08, 0xb9,
0xf3, 0x1d, 0xc2, 0x3b, 0x9a, 0xca, 0xe3, 0xbb, 0xab, 0xf2, 0x58, 0x6e, 0x9b, 0x6a, 0x35, 0x97,
0x10, 0x27, 0x35, 0x23, 0xfc, 0x1d, 0x6a, 0x73, 0x41, 0x13, 0xa1, 0xb6, 0xc1, 0xfa, 0x6b, 0x6f,
0x83, 0xdd, 0x2c, 0x35, 0xda, 0xfd, 0xb9, 0x01, 0xa9, 0xbc, 0xf0, 0x10, 0xed, 0x55, 0xc1, 0xfc,
0x9f, 0x9b, 0x4d, 0xa5, 0xe0, 0x6c, 0xc1, 0x85, 0xdc, 0x71, 0x95, 0xfb, 0x25, 0x4f, 0xae, 0x8a,
0x67, 0xb3, 0xda, 0x2f, 0x79, 0xcc, 0x49, 0x71, 0x8b, 0x2d, 0xd4, 0xe6, 0x53, 0xd7, 0x05, 0xf0,
0xc0, 0x53, 0x21, 0x6b, 0xda, 0x6f, 0x14, 0xd4, 0x76, 0x7f, 0x7e, 0x41, 0x2a, 0x8e, 0x34, 0x1e,
0x52, 0x3f, 0x00, 0x4f, 0x85, 0xab, 0x66, 0x7c, 0xae, 0x50, 0x52, 0xdc, 0xda, 0x47, 0x37, 0xb7,
0xfa, 0xda, 0x8b, 0x5b, 0x7d, 0xed, 0xe5, 0xad, 0xbe, 0xf6, 0x4b, 0xa6, 0x6b, 0x37, 0x99, 0xae,
0xbd, 0xc8, 0x74, 0xed, 0x65, 0xa6, 0x6b, 0x7f, 0x65, 0xba, 0xf6, 0xeb, 0xdf, 0xfa, 0xda, 0xf7,
0xeb, 0xb3, 0xe3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x13, 0xdb, 0x98, 0xf9, 0xb8, 0x08, 0x00,
0x00,
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.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>
<PropertyGroup Label="Globals">
<ProjectGuid>{61EA6DDD-19CD-481B-8FA4-D92CEBB516C1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>NetBox</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<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 Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<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>false</LinkIncremental>
<OutDir>..\..\Far2_x86\Plugins\NetBox\</OutDir>
<IntDir>..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\</IntDir>
<GenerateManifest>false</GenerateManifest>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<TargetName>NetBox</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\Far2_x64\Plugins\NetBox\</OutDir>
<IntDir>..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\</IntDir>
<TargetName>NetBox</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\Far2_x86\Plugins\NetBox\</OutDir>
<IntDir>..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\</IntDir>
<GenerateManifest>false</GenerateManifest>
<TargetName>NetBox</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\Far2_x64\Plugins\NetBox\</OutDir>
<IntDir>..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\</IntDir>
<GenerateManifest>false</GenerateManifest>
<TargetName>NetBox</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<Optimization>Disabled</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>NB_CORE_EXPORTS;WINSCP;FARPLUGIN;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS;_WINSOCK_DEPRECATED_NO_WARNINGS;NOGDI;WIN32;_DEBUG;_WINDOWS;_WINDLL;_USRDLL;NETBOX_DEBUG;MPEXT;STRICT;NE_LFS;NE_HAVE_SSL;HAVE_OPENSSL;OPENSSL_NO_LOCKING;HAVE_EXPAT;HAVE_EXPAT_H;NE_HAVE_DAV;NE_HAVE_ZLIB;XML_STATIC;USE_DLMALLOC;USE_DL_PREFIX;_ATL_NO_COMMODULE;_ATL_NO_PERF_SUPPORT;_ATL_NO_DATETIME_RESOURCES_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.;..\include;..\..\libs\atlmfc\include;..\core;..\base;..\resource;..\windows;..\..\libs\Putty;..\..\libs\Putty\windows;..\..\libs\Putty\charset;..\PluginSDK\Far2;..\..\libs;..\..\libs\openssl\include;..\filezilla;..\filezilla\misc;..\..\libs\tinyxml2;..\..\libs\neon\src;..\..\libs\expat\lib;..\..\libs\dlmalloc;..\..\libs\rdestl;..\..\libs\fmt;..\..\libs\tinylog;</AdditionalIncludeDirectories>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
<OmitDefaultLibName>true</OmitDefaultLibName>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PreprocessToFile>false</PreprocessToFile>
<DisableSpecificWarnings>4481;4512;4702;4127;4244;</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\mfc.vs2015;..\..\libs\openssl\vs2015-x86;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\libputty.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\libtinyxml2.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\libneon.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\libexpat.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\dlmalloc.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\rdestl.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\fmt.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\tinylog.vs2015;</AdditionalLibraryDirectories>
<AdditionalDependencies>mfc.lib;shell32.lib;shlwapi.lib;libcmtd.lib;libcpmtd.lib;libtinyxml2.vs2015.lib;libssl.lib;libcrypto.lib;libputty.vs2015.lib;libexpat.lib;libneon.lib;Ws2_32.lib;kernel32.lib;user32.lib;comdlg32.lib;advapi32.lib;Version.lib;winhttp.lib;winspool.lib;Crypt32.lib;dlmalloc.vs2015.lib;rdestl.vs2015.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>uafxcwd.lib;mfcs100ud.lib;msvcrtd.lib;msvcurtd.lib;msvcprtd.lib;libc.lib;libcmt.lib;msvcrt.lib;libcmtd.lib;mfc100ud.lib;Atl.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>NetBox.def</ModuleDefinitionFile>
<AdditionalOptions>/verbose:lib /ignore:4099 /ignore:4204 %(AdditionalOptions)</AdditionalOptions>
<DelayLoadDLLs>shell32.dll;shlwapi.dll;crypt32.dll;version.dll;ws2_32.dll;oleaut32.dll;</DelayLoadDLLs>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>.;..\include;\..\..\libs\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>NB_CORE_EXPORTS;WINSCP;FARPLUGIN;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS;_WINSOCK_DEPRECATED_NO_WARNINGS;NOGDI;WIN32;WIN64;_DEBUG;_WINDOWS;_WINDLL;_USRDLL;NETBOX_DEBUG;MPEXT;STRICT;NE_LFS;NE_HAVE_SSL;HAVE_OPENSSL;OPENSSL_NO_LOCKING;HAVE_EXPAT;HAVE_EXPAT_H;NE_HAVE_DAV;NE_HAVE_ZLIB;XML_STATIC;USE_DLMALLOC;USE_DL_PREFIX;_ATL_NO_COMMODULE;_ATL_NO_PERF_SUPPORT;_ATL_NO_DATETIME_RESOURCES_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.;..\include;..\..\libs\atlmfc\include;..\core;..\base;..\resource;..\windows;..\..\libs\Putty;..\..\libs\Putty\windows;..\..\libs\Putty\charset;..\PluginSDK\Far2;..\..\libs;..\..\libs\openssl\include;..\filezilla;..\filezilla\misc;..\..\libs\tinyxml2;..\..\libs\neon\src;..\..\libs\expat\lib;..\..\libs\dlmalloc;..\..\libs\rdestl;..\..\libs\fmt;..\..\libs\tinylog;</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DisableSpecificWarnings>4481;4512;4702;4127;4244;</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\mfc.vs2015;..\..\libs\openssl\vs2015-x64;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\libputty.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\libtinyxml2.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\libneon.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\libexpat.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\dlmalloc.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\rdestl.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\fmt.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\tinylog.vs2015;</AdditionalLibraryDirectories>
<AdditionalDependencies>mfc.lib;shell32.lib;shlwapi.lib;libcmtd.lib;libcpmtd.lib;libtinyxml2.vs2015.lib;libssl.lib;libcrypto.lib;libputty.vs2015.lib;libexpat.lib;libneon.lib;Ws2_32.lib;kernel32.lib;user32.lib;comdlg32.lib;advapi32.lib;Version.lib;winhttp.lib;winspool.lib;Crypt32.lib;dlmalloc.vs2015.lib;rdestl.vs2015.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>uafxcwd.lib;mfc100ud.lib;msvcrtd.lib;msvcurtd.lib;msvcprtd.lib;libc.lib;libcmt.lib;msvcrt.lib;libcmtd.lib;Atl.lib;mfcs100ud.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>NetBox.def</ModuleDefinitionFile>
<AdditionalOptions>/verbose:lib /ignore:4099 /ignore:4204 %(AdditionalOptions)</AdditionalOptions>
<DelayLoadDLLs>shell32.dll;shlwapi.dll;crypt32.dll;version.dll;ws2_32.dll;oleaut32.dll;</DelayLoadDLLs>
<EntryPointSymbol>
</EntryPointSymbol>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>.;..\include;\..\..\libs\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Full</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>NB_CORE_EXPORTS;WINSCP;FARPLUGIN;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS;_WINSOCK_DEPRECATED_NO_WARNINGS;NOGDI;WIN32;NDEBUG;_WINDOWS;_WINDLL;_USRDLL;MPEXT;STRICT;NE_LFS;NE_HAVE_SSL;HAVE_OPENSSL;OPENSSL_NO_LOCKING;HAVE_EXPAT;HAVE_EXPAT_H;NE_HAVE_DAV;NE_HAVE_ZLIB;XML_STATIC;USE_DLMALLOC;USE_DL_PREFIX;_ATL_NO_COMMODULE;_ATL_NO_PERF_SUPPORT;_ATL_NO_DATETIME_RESOURCES_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.;..\include;..\..\libs\atlmfc\include;..\core;..\base;..\resource;..\windows;..\..\libs\Putty;..\..\libs\Putty\windows;..\..\libs\Putty\charset;..\PluginSDK\Far2;..\..\libs;..\..\libs\openssl\include;..\filezilla;..\filezilla\misc;..\..\libs\tinyxml2;..\..\libs\neon\src;..\..\libs\expat\lib;..\..\libs\dlmalloc;..\..\libs\rdestl;..\..\libs\fmt;..\..\libs\tinylog;</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<MinimalRebuild>false</MinimalRebuild>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<OmitFramePointers>true</OmitFramePointers>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CallingConvention>Cdecl</CallingConvention>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DisableSpecificWarnings>4481;4512;4702;4127;4244;</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\mfc.vs2015;..\..\libs\openssl\vs2015-x86;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\libputty.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\libtinyxml2.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\libneon.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\libexpat.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\dlmalloc.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\rdestl.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\fmt.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x86\tinylog.vs2015;</AdditionalLibraryDirectories>
<AdditionalDependencies>mfc.lib;shell32.lib;shlwapi.lib;libcmt.lib;libcpmt.lib;libtinyxml2.vs2015.lib;libssl.lib;libcrypto.lib;libputty.vs2015.lib;libexpat.lib;libneon.lib;Ws2_32.lib;kernel32.lib;user32.lib;comdlg32.lib;advapi32.lib;Version.lib;winhttp.lib;winspool.lib;Crypt32.lib;dlmalloc.vs2015.lib;rdestl.vs2015.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>NetBox.def</ModuleDefinitionFile>
<IgnoreSpecificDefaultLibraries>uafxcw.lib;mfc100u.lib;Atl.lib;msvcrt.lib;msvcurt.lib;msvcprt.lib;libc.lib;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<DelayLoadDLLs>shell32.dll;shlwapi.dll;crypt32.dll;version.dll;ws2_32.dll;oleaut32.dll;</DelayLoadDLLs>
</Link>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
<ResourceCompile>
<AdditionalIncludeDirectories>.;..\include;..\..\libs\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Full</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>NB_CORE_EXPORTS;WINSCP;FARPLUGIN;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS;_WINSOCK_DEPRECATED_NO_WARNINGS;NOGDI;WIN32;WIN64;NDEBUG;_WINDOWS;_WINDLL;_USRDLL;MPEXT;STRICT;NE_LFS;NE_HAVE_SSL;HAVE_OPENSSL;OPENSSL_NO_LOCKING;HAVE_EXPAT;HAVE_EXPAT_H;NE_HAVE_DAV;NE_HAVE_ZLIB;XML_STATIC;USE_DLMALLOC;USE_DL_PREFIX;_ATL_NO_COMMODULE;_ATL_NO_PERF_SUPPORT;_ATL_NO_DATETIME_RESOURCES_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.;..\include;..\..\libs\atlmfc\include;..\core;..\base;..\resource;..\windows;..\..\libs\Putty;..\..\libs\Putty\windows;..\..\libs\Putty\charset;..\PluginSDK\Far2;..\..\libs;..\..\libs\openssl\include;..\filezilla;..\filezilla\misc;..\..\libs\tinyxml2;..\..\libs\neon\src;..\..\libs\expat\lib;..\..\libs\dlmalloc;..\..\libs\rdestl;..\..\libs\fmt;..\..\libs\tinylog;</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<MinimalRebuild>false</MinimalRebuild>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<OmitFramePointers>true</OmitFramePointers>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>false</FunctionLevelLinking>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CallingConvention>Cdecl</CallingConvention>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DisableSpecificWarnings>4481;4512;4702;4127;4244;</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\mfc.vs2015;..\..\libs\openssl\vs2015-x64;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\libputty.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\libtinyxml2.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\libneon.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\libexpat.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\dlmalloc.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\rdestl.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\fmt.vs2015;..\..\build\vc15\$(SolutionName)\$(Configuration)\x64\tinylog.vs2015;</AdditionalLibraryDirectories>
<AdditionalDependencies>mfc.lib;shell32.lib;shlwapi.lib;libcmt.lib;libcpmt.lib;libtinyxml2.vs2015.lib;libssl.lib;libcrypto.lib;libputty.vs2015.lib;libexpat.lib;libneon.lib;Ws2_32.lib;kernel32.lib;user32.lib;comdlg32.lib;advapi32.lib;Version.lib;winhttp.lib;winspool.lib;Crypt32.lib;dlmalloc.vs2015.lib;rdestl.vs2015.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>NetBox.def</ModuleDefinitionFile>
<IgnoreSpecificDefaultLibraries>uafxcw.lib;mfc100u.lib;Atl.lib;msvcrt.lib;msvcurt.lib;msvcprt.lib;libc.lib;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<DelayLoadDLLs>shell32.dll;shlwapi.dll;crypt32.dll;version.dll;ws2_32.dll;oleaut32.dll;</DelayLoadDLLs>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
<ResourceCompile>
<AdditionalIncludeDirectories>.;..\include;\..\..\libs\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\nbcore\nbstring.cpp" />
<ClCompile Include="..\nbcore\nbmemory.cpp" />
<ClCompile Include="..\nbcore\nbutils.cpp" />
<ClCompile Include="..\base\Classes.cpp" />
<ClCompile Include="..\base\Masks.cpp" />
<ClCompile Include="..\base\WideStrUtils.cpp" />
<ClCompile Include="..\base\LibraryLoader.cpp" />
<ClCompile Include="..\base\StrUtils.cpp" />
<ClCompile Include="..\base\Sysutils.cpp" />
<ClCompile Include="..\base\UnicodeString.cpp" />
<ClCompile Include="..\base\Common.cpp" />
<ClCompile Include="..\base\Exceptions.cpp" />
<ClCompile Include="..\base\FileBuffer.cpp" />
<ClCompile Include="..\base\Global.cpp" />
<ClCompile Include="..\base\System.SyncObjs.cpp" />
<ClCompile Include="..\base\FormatUtils.cpp" />
<ClCompile Include="..\core\Bookmarks.cpp" />
<ClCompile Include="..\core\Configuration.cpp" />
<ClCompile Include="..\core\CopyParam.cpp" />
<ClCompile Include="..\core\CoreMain.cpp" />
<ClCompile Include="..\core\Cryptography.cpp" />
<ClCompile Include="..\core\FileInfo.cpp" />
<ClCompile Include="..\core\FileMasks.cpp" />
<ClCompile Include="..\core\FileOperationProgress.cpp" />
<ClCompile Include="..\core\FileSystems.cpp" />
<ClCompile Include="..\core\FtpFileSystem.cpp" />
<ClCompile Include="..\core\HierarchicalStorage.cpp" />
<ClCompile Include="..\core\NamedObjs.cpp" />
<ClCompile Include="..\core\Option.cpp" />
<ClCompile Include="..\core\PuttyIntf.cpp" />
<ClCompile Include="..\core\Queue.cpp" />
<ClCompile Include="..\core\RemoteFiles.cpp" />
<ClCompile Include="..\core\ScpFileSystem.cpp" />
<ClCompile Include="..\core\SecureShell.cpp" />
<ClCompile Include="..\core\SessionData.cpp" />
<ClCompile Include="..\core\SessionInfo.cpp" />
<ClCompile Include="..\core\Script.cpp" />
<ClCompile Include="..\core\SftpFileSystem.cpp" />
<ClCompile Include="..\core\Terminal.cpp" />
<ClCompile Include="..\core\WebDAVFileSystem.cpp" />
<ClCompile Include="..\core\WinSCPSecurity.cpp" />
<ClCompile Include="..\core\Http.cpp" />
<ClCompile Include="..\core\NeonIntf.cpp" />
<ClCompile Include="..\windows\GUIConfiguration.cpp" />
<ClCompile Include="..\windows\GUITools.cpp" />
<ClCompile Include="..\windows\ProgParams.cpp" />
<ClCompile Include="..\windows\SynchronizeController.cpp" />
<ClCompile Include="..\windows\Tools.cpp" />
<ClCompile Include="..\windows\WinInterface.cpp" />
<ClCompile Include="FarConfiguration.cpp" />
<ClCompile Include="FarDialog.cpp" />
<ClCompile Include="FarInterface.cpp" />
<ClCompile Include="FarPlugin.cpp" />
<ClCompile Include="FarPluginStrings.cpp" />
<ClCompile Include="FarUtils.cpp" />
<ClCompile Include="NetBox.cpp" />
<ClCompile Include="UnityBuildFilezilla.cpp">
</ClCompile>
<ClCompile Include="WinSCPDialogs.cpp" />
<ClCompile Include="WinSCPFileSystem.cpp" />
<ClCompile Include="WinSCPPlugin.cpp" />
<ClCompile Include="XmlStorage.cpp" />
<MASM Include="vc_crt_fix.asm">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</MASM>
<ClCompile Include="vc_crt_fix_impl.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">/Zc:threadSafeInit-</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">/Zc:threadSafeInit-</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/Zc:threadSafeInit-</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/Zc:threadSafeInit-</AdditionalOptions>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="NetBox.def" />
<None Include="NetBoxEng.lng" />
<None Include="NetBoxRus.lng" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="NetBox.rc" />
<ResourceCompile Include="..\resource\TextsFileZilla.rc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\libs\dlmalloc\dlmalloc.vs2015.vcxproj">
<Project>{5423dd5f-c5f6-40a0-ba13-4b0deb51d38e}</Project>
</ProjectReference>
<ProjectReference Include="..\..\libs\tinyxml2\libtinyxml2.vs2015.vcxproj">
<Project>{593a4fb1-1787-4192-bf73-9c43bf8fc142}</Project>
</ProjectReference>
<ProjectReference Include="..\..\libs\zlib\zlib.vs2015.vcxproj">
<Project>{e9f6071a-d2bc-471e-8899-5f49b024aa04}</Project>
</ProjectReference>
<ProjectReference Include="..\..\libs\Putty\libputty.vs2015.vcxproj">
<Project>{456AD982-730D-46F8-8BE2-0E00D7433741}</Project>
</ProjectReference>
<ProjectReference Include="..\..\libs\expat\lib\libexpat.vs2015.vcxproj">
<Project>{27250AA6-FED6-F96F-E32B-E8E9719F8FEB}</Project>
</ProjectReference>
<ProjectReference Include="..\..\libs\neon\libneon.vs2015.vcxproj">
<Project>{90DE9ADC-75C4-2AC0-72B1-5F2903110E0A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\libs\fmt\fmt.vs2015.vcxproj">
<Project>{D4974AF2-C241-491B-A257-C0B381494D6B}</Project>
</ProjectReference>
<ProjectReference Include="..\..\libs\tinylog\tinylog.vs2015.vcxproj">
<Project>{78D9EE83-A3AE-4276-8976-5ADB083843ED}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</ImportGroup>
</Project> | {
"pile_set_name": "Github"
} |
'use strict';
const {promisify} = require('util');
const {finished, Transform} = require('stream');
const fancyLog = require('fancy-log');
const git = require('./lib.js');
const inspectWithKind = require('inspect-with-kind');
const {isVinyl} = require('vinyl');
const PluginError = require('plugin-error');
const vinylFs = require('vinyl-fs');
/*
* Public: Push to gh-pages branch for github
*
* options - {Object} that contains all the options of the plugin
* - remoteUrl: The {String} remote url (github repository) of the project,
* - branch: The {String} branch where deploy will by done (default to `"gh-pages"`),
* - cacheDir: {String} where the git repo will be located. (default to a temporary folder)
* - push: {Boolean} to know whether or not the branch should be pushed (default to `true`)
* - message: {String} commit message (default to `"Update [timestamp]"`)
*
* Returns `Stream`.
**/
module.exports = function gulpGhPages(options) {
options = {...options};
const branch = options.branch || 'gh-pages';
const message = options.message || `Update ${new Date().toISOString()}`;
const files = [];
const TAG = branch === 'gh-pages' ? '[gh-pages]' : `[gh-pages (${branch})]`;
return new Transform({
objectMode: true,
transform(file, enc, cb) {
if (!isVinyl(file)) {
if (file !== null && typeof file === 'object' && typeof file.isNull === 'function') {
cb(new PluginError('gulp-gh-pages', 'gulp-gh-pages doesn\'t support gulp <= v3.x. Update your project to use gulp >= v4.0.0.'));
return;
}
cb(new PluginError('gulp-gh-pages', `Expected a stream created by gulp-gh-pages to receive Vinyl objects https://github.com/gulpjs/vinyl, but got ${
inspectWithKind(file)
}.`));
return;
}
if (file.isNull()) {
cb(null, file);
return;
}
if (file.isStream()) {
cb(new PluginError('gulp-gh-pages', 'Stream content is not supported'));
return;
}
files.push(file);
cb(null, file);
},
async flush(cb) {
if (files.length === 0) {
fancyLog(TAG, 'No files in the stream.');
cb();
return;
}
try {
const repo = await git.prepareRepo(options.remoteUrl, options.cacheDir || '.publish');
fancyLog(TAG, 'Cloning repo');
if (repo._localBranches.includes(branch)) {
fancyLog(TAG, `Checkout branch \`${branch}\``);
await repo.checkoutBranch(branch);
}
if (repo._remoteBranches.includes(`origin/${branch}`)) {
fancyLog(TAG, `Checkout remote branch \`${branch}\``);
await repo.checkoutBranch(branch);
fancyLog(TAG, 'Updating repository');
// updating to avoid having local cache not up to date
await promisify(repo._repo.git.bind(repo._repo))('pull');
} else {
fancyLog(TAG, `Create branch \`${branch}\` and checkout`);
await repo.createAndCheckoutBranch(branch);
}
await promisify(repo._repo.remove.bind(repo._repo))('.', {
r: true,
'ignore-unmatch': true
});
fancyLog(TAG, 'Copying files to repository');
const destStream = vinylFs.dest(repo._repo.path);
for (const file of files) {
destStream.write(file);
}
setImmediate(() => destStream.end());
await promisify(finished)(destStream);
await repo.addFiles('.', {force: options.force || false});
const filesToBeCommitted = Object.keys(repo._staged).length;
if (filesToBeCommitted === 0) {
fancyLog(TAG, 'No files have changed.');
cb();
return;
}
fancyLog(TAG, `Adding ${filesToBeCommitted} files.`);
fancyLog(TAG, `Committing "${message}"`);
const nrepo = await repo.commit(message);
if (!(options.push === undefined || options.push)) {
cb();
return;
}
fancyLog(TAG, 'Pushing to remote.');
await promisify(nrepo._repo.git.bind(nrepo._repo))('push', {
'set-upstream': true
}, ['origin', nrepo._currentBranch]);
cb();
} catch (err) {
cb(err);
}
}
});
};
| {
"pile_set_name": "Github"
} |
package com.sksamuel.elastic4s.requests.searches.queries.span
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
class SpanFirstQueryBodyFnTest extends AnyFunSuite with Matchers {
test("SpanFirstQueryBodyFn apply should return appropriate XContentBuilder") {
val builder = SpanFirstQueryBodyFn.apply(SpanFirstQuery(
SpanTermQuery("field1", "value1"),
end = 5,
boost = Some(2.0),
queryName = Some("rootName")
))
builder.string() shouldBe """{"span_first":{"match":{"span_term":{"field1":"value1"}},"end":5,"boost":2.0,"_name":"rootName"}}"""
}
}
| {
"pile_set_name": "Github"
} |
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -8186,6 +8186,27 @@ static const struct rf_channel rf_vals_5
{196, 83, 0, 12, 1},
};
+/*
+ * RF value list for rt3xxx with Xtal20MHz
+ * Supports: 2.4 GHz (all) (RF3322)
+ */
+static const struct rf_channel rf_vals_xtal20mhz_3x[] = {
+ {1, 0xE2, 2, 0x14},
+ {2, 0xE3, 2, 0x14},
+ {3, 0xE4, 2, 0x14},
+ {4, 0xE5, 2, 0x14},
+ {5, 0xE6, 2, 0x14},
+ {6, 0xE7, 2, 0x14},
+ {7, 0xE8, 2, 0x14},
+ {8, 0xE9, 2, 0x14},
+ {9, 0xEA, 2, 0x14},
+ {10, 0xEB, 2, 0x14},
+ {11, 0xEC, 2, 0x14},
+ {12, 0xED, 2, 0x14},
+ {13, 0xEE, 2, 0x14},
+ {14, 0xF0, 2, 0x18},
+};
+
static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
{
struct hw_mode_spec *spec = &rt2x00dev->spec;
@@ -8272,7 +8293,10 @@ static int rt2800_probe_hw_mode(struct r
case RF5390:
case RF5392:
spec->num_channels = 14;
- spec->channels = rf_vals_3x;
+ if (spec->clk_is_20mhz)
+ spec->channels = rf_vals_xtal20mhz_3x;
+ else
+ spec->channels = rf_vals_3x;
break;
case RF3052:
@@ -8456,6 +8480,19 @@ static int rt2800_probe_rt(struct rt2x00
return 0;
}
+int rt2800_probe_clk(struct rt2x00_dev *rt2x00dev)
+{
+ struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data;
+ struct hw_mode_spec *spec = &rt2x00dev->spec;
+
+ if (!pdata)
+ return -EINVAL;
+
+ spec->clk_is_20mhz = pdata->clk_is_20mhz;
+
+ return 0;
+}
+
int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev)
{
struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
@@ -8498,6 +8535,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r
rt2800_register_write(rt2x00dev, GPIO_CTRL, reg);
/*
+ * Probe SoC clock.
+ */
+ if (rt2x00_is_soc(rt2x00dev)) {
+ retval = rt2800_probe_clk(rt2x00dev);
+ if (retval)
+ return retval;
+ }
+
+ /*
* Initialize hw specifications.
*/
retval = rt2800_probe_hw_mode(rt2x00dev);
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
@@ -400,6 +400,7 @@ static inline struct rt2x00_intf* vif_to
* @channels: Device/chipset specific channel values (See &struct rf_channel).
* @channels_info: Additional information for channels (See &struct channel_info).
* @ht: Driver HT Capabilities (See &ieee80211_sta_ht_cap).
+ * @clk_is_20mhz: External crystal of WiSoC is 20MHz instead of 40MHz
*/
struct hw_mode_spec {
unsigned int supported_bands;
@@ -416,6 +417,7 @@ struct hw_mode_spec {
const struct channel_info *channels_info;
struct ieee80211_sta_ht_cap ht;
+ int clk_is_20mhz;
};
/*
--- a/include/linux/rt2x00_platform.h
+++ b/include/linux/rt2x00_platform.h
@@ -18,6 +18,7 @@ struct rt2x00_platform_data {
int disable_2ghz;
int disable_5ghz;
+ int clk_is_20mhz;
};
#endif /* _RT2X00_PLATFORM_H */
| {
"pile_set_name": "Github"
} |
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
// **NOTE** This file was generated by a tool and any changes will be overwritten.
// <auto-generated/>
// Template Source: Templates\CSharp\Requests\IEntityCollectionRequest.cs.tt
namespace Microsoft.Graph
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
using System.Linq.Expressions;
/// <summary>
/// The interface IContactFolderContactsCollectionRequest.
/// </summary>
public partial interface IContactFolderContactsCollectionRequest : IBaseRequest
{
/// <summary>
/// Adds the specified Contact to the collection via POST.
/// </summary>
/// <param name="contact">The Contact to add.</param>
/// <returns>The created Contact.</returns>
System.Threading.Tasks.Task<Contact> AddAsync(Contact contact);
/// <summary>
/// Adds the specified Contact to the collection via POST.
/// </summary>
/// <param name="contact">The Contact to add.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The created Contact.</returns>
System.Threading.Tasks.Task<Contact> AddAsync(Contact contact, CancellationToken cancellationToken);
/// <summary>
/// Gets the collection page.
/// </summary>
/// <returns>The collection page.</returns>
System.Threading.Tasks.Task<IContactFolderContactsCollectionPage> GetAsync();
/// <summary>
/// Gets the collection page.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The collection page.</returns>
System.Threading.Tasks.Task<IContactFolderContactsCollectionPage> GetAsync(CancellationToken cancellationToken);
/// <summary>
/// Adds the specified expand value to the request.
/// </summary>
/// <param name="value">The expand value.</param>
/// <returns>The request object to send.</returns>
IContactFolderContactsCollectionRequest Expand(string value);
/// <summary>
/// Adds the specified expand value to the request.
/// </summary>
/// <param name="expandExpression">The expression from which to calculate the expand value.</param>
/// <returns>The request object to send.</returns>
IContactFolderContactsCollectionRequest Expand(Expression<Func<Contact, object>> expandExpression);
/// <summary>
/// Adds the specified select value to the request.
/// </summary>
/// <param name="value">The select value.</param>
/// <returns>The request object to send.</returns>
IContactFolderContactsCollectionRequest Select(string value);
/// <summary>
/// Adds the specified select value to the request.
/// </summary>
/// <param name="selectExpression">The expression from which to calculate the select value.</param>
/// <returns>The request object to send.</returns>
IContactFolderContactsCollectionRequest Select(Expression<Func<Contact, object>> selectExpression);
/// <summary>
/// Adds the specified top value to the request.
/// </summary>
/// <param name="value">The top value.</param>
/// <returns>The request object to send.</returns>
IContactFolderContactsCollectionRequest Top(int value);
/// <summary>
/// Adds the specified filter value to the request.
/// </summary>
/// <param name="value">The filter value.</param>
/// <returns>The request object to send.</returns>
IContactFolderContactsCollectionRequest Filter(string value);
/// <summary>
/// Adds the specified skip value to the request.
/// </summary>
/// <param name="value">The skip value.</param>
/// <returns>The request object to send.</returns>
IContactFolderContactsCollectionRequest Skip(int value);
/// <summary>
/// Adds the specified orderby value to the request.
/// </summary>
/// <param name="value">The orderby value.</param>
/// <returns>The request object to send.</returns>
IContactFolderContactsCollectionRequest OrderBy(string value);
}
}
| {
"pile_set_name": "Github"
} |
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// GroupName is the group name use in this package
const GroupName = "extensions"
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
localSchemeBuilder = &SchemeBuilder
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Deployment{},
&DeploymentList{},
&DeploymentRollback{},
&ReplicationControllerDummy{},
&Scale{},
&DaemonSetList{},
&DaemonSet{},
&Ingress{},
&IngressList{},
&ReplicaSet{},
&ReplicaSetList{},
&PodSecurityPolicy{},
&PodSecurityPolicyList{},
&NetworkPolicy{},
&NetworkPolicyList{},
)
// Add the watch version that applies
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.buck.log;
import com.facebook.buck.core.model.BuildId;
import com.facebook.buck.core.util.immutables.BuckStyleValue;
import com.facebook.buck.log.views.JsonViews;
import com.facebook.buck.util.BuckConstant;
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import java.nio.file.Path;
import java.text.SimpleDateFormat;
import java.util.TimeZone;
import java.util.regex.Pattern;
@BuckStyleValue
@JsonDeserialize(as = ImmutableInvocationInfo.class)
public abstract class InvocationInfo {
private static final ThreadLocal<SimpleDateFormat> DIR_DATE_FORMAT =
new ThreadLocal<SimpleDateFormat>() {
@Override
protected SimpleDateFormat initialValue() {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd_HH'h'mm'm'ss's'");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
return simpleDateFormat;
}
};
private static final String DIR_NAME_TEMPLATE = "%s_%s_%s";
/** Pattern that must be able to match strings generated from the {@link #DIR_NAME_TEMPLATE}. */
private static final Pattern DIR_PATTERN = Pattern.compile(".+_.+_.+");
// TODO(#13704826): we should switch over to a machine-readable log format.
private static final String LOG_MSG_TEMPLATE = "InvocationInfo BuildId=[%s] Args=[%s]";
@JsonView(JsonViews.MachineReadableLog.class)
public abstract BuildId getBuildId();
@JsonView(JsonViews.MachineReadableLog.class)
public abstract boolean getSuperConsoleEnabled();
@JsonView(JsonViews.MachineReadableLog.class)
public abstract boolean getIsDaemon();
@JsonView(JsonViews.MachineReadableLog.class)
public abstract String getSubCommand();
@JsonView(JsonViews.MachineReadableLog.class)
public abstract ImmutableList<String> getCommandArgs();
@JsonView(JsonViews.MachineReadableLog.class)
public abstract ImmutableList<String> getUnexpandedCommandArgs();
@JsonView(JsonViews.MachineReadableLog.class)
public abstract Path getBuckLogDir();
// Just a convenient explicit alias.
public String getCommandId() {
return getBuildId().toString();
}
public String toLogLine() {
return String.format(
LOG_MSG_TEMPLATE, getBuildId().toString(), Joiner.on(", ").join(getCommandArgs()));
}
@JsonView(JsonViews.MachineReadableLog.class)
public abstract boolean getIsRemoteExecution();
@JsonView(JsonViews.MachineReadableLog.class)
public abstract String getRepository();
@JsonView(JsonViews.MachineReadableLog.class)
public abstract String getWatchmanVersion();
@JsonView(JsonViews.MachineReadableLog.class)
public abstract long getTimestampMillis();
public Path getLogDirectoryPath() {
return getBuckLogDir().resolve(getLogDirectoryName());
}
public Path getLogFilePath() {
return getLogDirectoryPath().resolve(BuckConstant.BUCK_LOG_FILE_NAME);
}
public Path getSimpleConsoleOutputFilePath() {
return getLogDirectoryPath().resolve(BuckConstant.BUCK_SIMPLE_CONSOLE_LOG_FILE_NAME);
}
private String getLogDirectoryName() {
return String.format(
DIR_NAME_TEMPLATE,
DIR_DATE_FORMAT.get().format(getTimestampMillis()),
getSubCommand(),
getBuildId());
}
static boolean isLogDirectory(Path directory) {
return DIR_PATTERN.matcher(directory.getFileName().toString()).matches();
}
@Override
public String toString() {
return String.format(
"buildId=[%s] subCommand=[%s] utcMillis=[%d]",
getBuildId().toString(), getSubCommand(), getTimestampMillis());
}
public static InvocationInfo of(
BuildId buildId,
boolean superConsoleEnabled,
boolean isDaemon,
String subCommand,
ImmutableList<String> commandArgs,
ImmutableList<String> unexpandedCommandArgs,
Path buckLogDir,
boolean isRemoteExecution,
String repository,
String watchmanVersion) {
return of(
buildId,
superConsoleEnabled,
isDaemon,
subCommand,
commandArgs,
unexpandedCommandArgs,
buckLogDir,
isRemoteExecution,
repository,
watchmanVersion,
System.currentTimeMillis());
}
public static InvocationInfo of(
BuildId buildId,
boolean superConsoleEnabled,
boolean isDaemon,
String subCommand,
ImmutableList<String> commandArgs,
ImmutableList<String> unexpandedCommandArgs,
Path buckLogDir,
boolean isRemoteExecution,
String repository,
String watchmanVersion,
long timestampMillis) {
return ImmutableInvocationInfo.of(
buildId,
superConsoleEnabled,
isDaemon,
subCommand,
commandArgs,
unexpandedCommandArgs,
buckLogDir,
isRemoteExecution,
repository,
watchmanVersion,
timestampMillis);
}
}
| {
"pile_set_name": "Github"
} |
/**
* The Burmese language file for Shadowbox.
*
* This file is part of Shadowbox.
*
* Shadowbox is an online media viewer application that supports all of the
* web's most popular media publishing formats. Shadowbox is written entirely
* in JavaScript and CSS and is highly customizable. Using Shadowbox, website
* authors can showcase a wide assortment of media in all major browsers without
* navigating users away from the linking page.
*
* Shadowbox is released under version 3.0 of the Creative Commons Attribution-
* Noncommercial-Share Alike license. This means that it is absolutely free
* for personal, noncommercial use provided that you 1) make attribution to the
* author and 2) release any derivative work under the same or a similar
* license.
*
* If you wish to use Shadowbox for commercial purposes, licensing information
* can be found at http://mjijackson.com/shadowbox/.
*
* @author Michael J. I. Jackson <mjijackson@gmail.com>
* @copyright 2007-2008 Michael J. I. Jackson
* @license http://creativecommons.org/licenses/by-nc-sa/3.0/
* @version SVN: $Id: shadowbox-my.js,v 1.1 2009-03-19 10:13:43 weshupne Exp $
*/
if(typeof Shadowbox == 'undefined'){
throw 'Unable to load Shadowbox language file, base library not found.';
}
/**
* An object containing all textual messages to be used in Shadowbox. These are
* provided so they may be translated into different languages. Alternative
* translations may be found in js/lang/shadowbox-*.js where * is an abbreviation
* of the language name (see
* http://www.gnu.org/software/gettext/manual/gettext.html#Language-Codes).
*
* @var {Object} LANG
* @public
* @static
*/
Shadowbox.LANG = {
code: 'my',
of: '',
loading: 'memuat turun',
cancel: 'Batal',
next: 'Seterusnya',
previous: 'Sebelum',
play: 'Mainkan',
pause: 'Hentikan',
close: 'Tutup',
errors: {
single: 'Anda perlu memasang <a href="{0}">{1}</a> plugin pelayar bagi melihat kandungan ini.',
shared: 'Anda perlu memasang kedua-dua <a href="{0}">{1}</a> dan <a href="{2}">{3}</a> plugin pelayar bagi melihat kandungan ini.',
either: 'Anda perlu memasang samada <a href="{0}">{1}</a> atau <a href="{2}">{3}</a> plugin pelayar bagi melihat kandungan ini.'
}
};
| {
"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>English</string>
<key>CFBundleExecutable</key>
<string>IPlugSurroundEffect</string>
<key>CFBundleGetInfoString</key>
<string>IPlugSurroundEffect v1.0.0 Copyright 2020 Acme Inc</string>
<key>CFBundleIdentifier</key>
<string>com.AcmeInc.vst3.IPlugSurroundEffect</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>IPlugSurroundEffect</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>pJL5</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSMinimumSystemVersion</key>
<string>10.11.0</string>
</dict>
</plist>
| {
"pile_set_name": "Github"
} |
"use strict"
function addLazyProperty(object, name, initializer, enumerable) {
Object.defineProperty(object, name, {
get: function() {
var v = initializer.call(this)
Object.defineProperty(this, name, { value: v, enumerable: !!enumerable, writable: true })
return v
},
set: function(v) {
Object.defineProperty(this, name, { value: v, enumerable: !!enumerable, writable: true })
return v
},
enumerable: !!enumerable,
configurable: true
})
}
module.exports = addLazyProperty
| {
"pile_set_name": "Github"
} |
package mage.cards.f;
import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author TheElk801
*/
public final class FlowstoneStrike extends CardImpl {
public FlowstoneStrike(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}");
// Target creature gets +1/-1 and gains haste until end of turn.
Effect effect = new BoostTargetEffect(1, -1, Duration.EndOfTurn);
effect.setText("Target creature gets +1/-1");
this.getSpellAbility().addEffect(effect);
effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
effect.setText("and gains haste until end of turn");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
public FlowstoneStrike(final FlowstoneStrike card) {
super(card);
}
@Override
public FlowstoneStrike copy() {
return new FlowstoneStrike(this);
}
}
| {
"pile_set_name": "Github"
} |
from ..lib import removed_packages
removed_packages.mark()
| {
"pile_set_name": "Github"
} |
package com.highperformancespark.examples.ml
import com.highperformancespark.examples.dataframe._
import scala.collection.{Map, mutable}
import scala.collection.mutable.{ArrayBuffer, MutableList}
import org.apache.spark._
import org.apache.spark.rdd.RDD
import org.apache.spark.sql._
import org.apache.spark.sql._
import org.apache.spark.sql.functions._
import org.apache.spark.sql.types._
//tag::basicImport[]
import org.apache.spark.ml._
import org.apache.spark.ml.feature._
import org.apache.spark.ml.classification._
//end::basicImport[]
//tag::renameImport[]
import org.apache.spark.ml.linalg.{Vector => SparkVector}
//end::renameImport[]
import org.apache.spark.ml.param._
import org.apache.spark.ml.tuning._
object SimplePipeline {
def constructAndSetParams(df: DataFrame) = {
val sqlCtx = df.sqlContext
//tag::constructSetParams[]
val hashingTF = new HashingTF()
hashingTF.setInputCol("input")
hashingTF.setOutputCol("hashed_terms")
//end::constructSetParams[]
}
def constructSimpleTransformer(df: DataFrame) = {
val sqlCtx = df.sqlContext
//tag::simpleTransformer[]
val hashingTF = new HashingTF()
// We don't set the output column here so the default output column of
// uid + "__output" is used.
hashingTF.setInputCol("input")
// Transformer the input
val transformed = hashingTF.transform(df)
// Since we don't know what the uid is we can use the getOutputCol function
val outputCol = hashingTF.getOutputCol
//end::simpleTransformer[]
(outputCol, transformed)
}
def constructVectorAssembler() = {
//tag::vectorAssembler[]
val assembler = new VectorAssembler()
assembler.setInputCols(Array("size", "zipcode"))
//end::vectorAssembler[]
}
// Here is a simple tokenizer to hashingtf transformer manually chained
def simpleTokenizerToHashing(df: DataFrame) = {
//tag::simpleTokenizerToHashing[]
val tokenizer = new Tokenizer()
tokenizer.setInputCol("name")
tokenizer.setOutputCol("tokenized_name")
val tokenizedData = tokenizer.transform(df)
val hashingTF = new HashingTF()
hashingTF.setInputCol("tokenized_name")
hashingTF.setOutputCol("name_tf")
hashingTF.transform(tokenizedData)
//end::simpleTokenizerToHashing[]
}
def constructSimpleEstimator(df: DataFrame) = {
val sqlCtx = df.sqlContext
//tag::simpleNaiveBayes[]
val nb = new NaiveBayes()
nb.setLabelCol("happy")
nb.setFeaturesCol("features")
nb.setPredictionCol("prediction")
val nbModel = nb.fit(df)
//end::simpleNaiveBayes[]
}
def stringIndexer(df: DataFrame) = {
//tag::stringIndexer[]
// Construct a simple string indexer
val sb = new StringIndexer()
sb.setInputCol("name")
sb.setOutputCol("indexed_name")
// Construct the model based on the input
val sbModel = sb.fit(df)
//end::stringIndexer[]
}
def reverseStringIndexer(sbModel: StringIndexerModel) = {
//tag::indexToString[]
// Construct the inverse of the model to go from index-to-string
// after prediction.
val sbInverse = new IndexToString()
sbInverse.setInputCol("prediction")
sbInverse.setLabels(sbModel.labels)
//end::indexToString[]
// Or if meta data is present
//tag::indexToStringMD[]
// Construct the inverse of the model to go from
// index-to-string after prediction.
val sbInverseMD = new IndexToString()
sbInverseMD.setInputCol("prediction")
//end::indexToStringMD[]
}
def normalizer() = {
//tag::normalizer[]
val normalizer = new Normalizer()
normalizer.setInputCol("features")
normalizer.setOutputCol("normalized_features")
//end::normalizer[]
}
def paramSearch(df: DataFrame) = {
val tokenizer = new Tokenizer()
tokenizer.setInputCol("name")
tokenizer.setOutputCol("tokenized_name")
val hashingTF = new HashingTF()
hashingTF.setInputCol("tokenized_name")
hashingTF.setOutputCol("name_tf")
val assembler = new VectorAssembler()
assembler.setInputCols(Array("size", "zipcode", "name_tf",
"attributes"))
val normalizer = new Normalizer()
normalizer.setInputCol("features")
normalizer.setOutputCol("normalized_features")
val nb = new NaiveBayes()
nb.setLabelCol("happy")
nb.setFeaturesCol("normalized_features")
nb.setPredictionCol("prediction")
val pipeline = new Pipeline()
pipeline.setStages(Array(tokenizer, hashingTF, assembler, normalizer, nb))
//tag::createSimpleParamGrid[]
// ParamGridBuilder constructs an Array of parameter combinations.
val paramGrid: Array[ParamMap] = new ParamGridBuilder()
.addGrid(nb.smoothing, Array(0.1, 0.5, 1.0, 2.0))
.build()
//end::createSimpleParamGrid[]
//tag::runSimpleCVSearch[]
val cv = new CrossValidator()
.setEstimator(pipeline)
.setEstimatorParamMaps(paramGrid)
val cvModel = cv.fit(df)
val bestModel = cvModel.bestModel
//end::runSimpleCVSearch[]
//tag::complexParamSearch[]
val complexParamGrid: Array[ParamMap] = new ParamGridBuilder()
.addGrid(nb.smoothing, Array(0.1, 0.5, 1.0, 2.0))
.addGrid(hashingTF.numFeatures, Array(1 << 18, 1 << 20))
.addGrid(hashingTF.binary, Array(true, false))
.addGrid(normalizer.p, Array(1.0, 1.5, 2.0))
.build()
//end::complexParamSearch[]
bestModel
}
def buildSimplePipeline(df: DataFrame) = {
//tag::simplePipeline[]
val tokenizer = new Tokenizer()
tokenizer.setInputCol("name")
tokenizer.setOutputCol("tokenized_name")
val hashingTF = new HashingTF()
hashingTF.setInputCol("tokenized_name")
hashingTF.setOutputCol("name_tf")
val assembler = new VectorAssembler()
assembler.setInputCols(Array("size", "zipcode", "name_tf",
"attributes"))
val nb = new NaiveBayes()
nb.setLabelCol("happy")
nb.setFeaturesCol("features")
nb.setPredictionCol("prediction")
val pipeline = new Pipeline()
pipeline.setStages(Array(tokenizer, hashingTF, assembler, nb))
//end::simplePipeline[]
//tag::trainPipeline[]
val pipelineModel = pipeline.fit(df)
//end::trainPipeline[]
//tag::accessStages[]
val tokenizer2 = pipelineModel.stages(0).asInstanceOf[Tokenizer]
val nbFit = pipelineModel.stages.last.asInstanceOf[NaiveBayesModel]
//end::accessStages[]
//tag::newPipeline[]
val normalizer = new Normalizer()
normalizer.setInputCol("features")
normalizer.setOutputCol("normalized_features")
nb.setFeaturesCol("normalized_features")
pipeline.setStages(Array(tokenizer, hashingTF, assembler, normalizer, nb))
val normalizedPipelineModel = pipelineModel.transform(df)
//end::newPipeline[]
}
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible 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 Ansible. If not, see <http://www.gnu.org/licenses/>.
#
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
DOCUMENTATION = """
---
module: vyos_config
version_added: "2.2"
author: "Peter Sprygada (@privateip)"
short_description: Manage VyOS configuration on remote device
description:
- This module provides configuration file management of VyOS
devices. It provides arguments for managing both the
configuration file and state of the active configuration. All
configuration statements are based on `set` and `delete` commands
in the device configuration.
extends_documentation_fragment: vyos
options:
lines:
description:
- The ordered set of configuration lines to be managed and
compared with the existing configuration on the remote
device.
required: false
default: null
src:
description:
- The C(src) argument specifies the path to the source config
file to load. The source config file can either be in
bracket format or set format. The source file can include
Jinja2 template variables.
required: no
default: null
match:
description:
- The C(match) argument controls the method used to match
against the current active configuration. By default, the
desired config is matched against the active config and the
deltas are loaded. If the C(match) argument is set to C(none)
the active configuration is ignored and the configuration is
always loaded.
required: false
default: line
choices: ['line', 'none']
backup:
description:
- The C(backup) argument will backup the current devices active
configuration to the Ansible control host prior to making any
changes. The backup file will be located in the backup folder
in the root of the playbook
required: false
default: false
choices: ['yes', 'no']
comment:
description:
- Allows a commit description to be specified to be included
when the configuration is committed. If the configuration is
not changed or committed, this argument is ignored.
required: false
default: 'configured by vyos_config'
config:
description:
- The C(config) argument specifies the base configuration to use
to compare against the desired configuration. If this value
is not specified, the module will automatically retrieve the
current active configuration from the remote device.
required: false
default: null
save:
description:
- The C(save) argument controls whether or not changes made
to the active configuration are saved to disk. This is
independent of committing the config. When set to True, the
active configuration is saved.
required: false
default: false
choices: ['yes', 'no']
"""
RETURN = """
updates:
description: The list of configuration commands sent to the device
returned: always
type: list
sample: ['...', '...']
filtered:
description: The list of configuration commands removed to avoid a load failure
returned: always
type: list
sample: ['...', '...']
"""
EXAMPLES = """
# Note: examples below use the following provider dict to handle
# transport and authentication to the node.
vars:
cli:
host: "{{ inventory_hostname }}"
username: vyos
password: vyos
transport: cli
- name: configure the remote device
vyos_config:
lines:
- set system host-name {{ inventory_hostname }}
- set service lldp
- delete service dhcp-server
provider: "{{ cli }}"
- name: backup and load from file
vyos_config:
src: vyos.cfg
backup: yes
provider: "{{ cli }}"
"""
import re
from ansible.module_utils.network import Command, get_exception
from ansible.module_utils.netcfg import NetworkConfig, dumps
from ansible.module_utils.vyos import NetworkModule, NetworkError
DEFAULT_COMMENT = 'configured by vyos_config'
CONFIG_FILTERS = [
re.compile(r'set system login user \S+ authentication encrypted-password')
]
def config_to_commands(config):
set_format = config.startswith('set') or config.startswith('delete')
candidate = NetworkConfig(indent=4, contents=config, device_os='junos')
if not set_format:
candidate = [c.line for c in candidate.items]
commands = list()
# this filters out less specific lines
for item in candidate:
for index, entry in enumerate(commands):
if item.startswith(entry):
del commands[index]
break
commands.append(item)
else:
commands = str(candidate).split('\n')
return commands
def get_config(module, result):
contents = module.params['config']
if not contents:
contents = module.config.get_config(output='set').split('\n')
else:
contents = config_to_commands(contents)
return contents
def get_candidate(module):
contents = module.params['src'] or module.params['lines']
if module.params['lines']:
contents = '\n'.join(contents)
return config_to_commands(contents)
def diff_config(commands, config):
config = [str(c).replace("'", '') for c in config]
updates = list()
visited = set()
for line in commands:
item = str(line).replace("'", '')
if not item.startswith('set') and not item.startswith('delete'):
raise ValueError('line must start with either `set` or `delete`')
elif item.startswith('set') and item not in config:
updates.append(line)
elif item.startswith('delete'):
if not config:
updates.append(line)
else:
item = re.sub(r'delete', 'set', item)
for entry in config:
if entry.startswith(item) and line not in visited:
updates.append(line)
visited.add(line)
return list(updates)
def sanitize_config(config, result):
result['filtered'] = list()
for regex in CONFIG_FILTERS:
for index, line in enumerate(list(config)):
if regex.search(line):
result['filtered'].append(line)
del config[index]
def load_config(module, commands, result):
comment = module.params['comment']
commit = not module.check_mode
save = module.params['save']
# sanitize loadable config to remove items that will fail
# remove items will be returned in the sanitized keyword
# in the result.
sanitize_config(commands, result)
diff = module.config.load_config(commands, commit=commit, comment=comment,
save=save)
if diff:
result['diff'] = dict(prepared=diff)
result['changed'] = True
def run(module, result):
# get the current active config from the node or passed in via
# the config param
config = get_config(module, result)
# create the candidate config object from the arguments
candidate = get_candidate(module)
# create loadable config that includes only the configuration updates
updates = diff_config(candidate, config)
result['updates'] = updates
load_config(module, updates, result)
if result.get('filtered'):
result['warnings'].append('Some configuration commands where '
'removed, please see the filtered key')
def main():
argument_spec = dict(
src=dict(type='path'),
lines=dict(type='list'),
match=dict(default='line', choices=['line', 'none']),
comment=dict(default=DEFAULT_COMMENT),
config=dict(),
backup=dict(default=False, type='bool'),
save=dict(default=False, type='bool'),
)
mutually_exclusive = [('lines', 'src')]
module = NetworkModule(argument_spec=argument_spec,
connect_on_load=False,
mutually_exclusive=mutually_exclusive,
supports_check_mode=True)
result = dict(changed=False)
if module.params['backup']:
result['__backup__'] = module.config.get_config()
try:
run(module, result)
except NetworkError:
exc = get_exception()
module.fail_json(msg=str(exc), **exc.kwargs)
module.exit_json(**result)
if __name__ == '__main__':
main()
| {
"pile_set_name": "Github"
} |
package vandy.mooc.threadconfig.activities;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import vandy.mooc.threadconfig.R;
import vandy.mooc.threadconfig.utils.UiUtils;
/**
* An activity that handles runtime configuration changes by using
* onRetainNonConfigurationInstance() and
* getLastNonConfigurationInstance().
*/
public class NonConfigActivity
extends LifecycleLoggingActivity {
/**
* A thread that delays output by 1 second to make it easier to
* visualize on the user's display.
*/
protected CountdownDisplay mThread;
/**
* Factory method that creates an intent that will launch this
* activity.
*/
public static Intent makeIntent(Context context) {
return new Intent(context, NonConfigActivity.class);
}
/**
* Hook method called when the Activity is first launched.
*/
protected void onCreate(Bundle savedInstanceState) {
// Call up to the super class to perform initializations.
super.onCreate(savedInstanceState);
// Sets the content view to the xml file.
setContentView(R.layout.thread_activity);
// Set mThread to the object that was stored by
// onRetainNonConfigurationInstance().
mThread = (CountdownDisplay) getLastNonConfigurationInstance();
}
/**
* Returns mThread so that it will be saved across runtime
* configuration changes. This hook method is called by Android
* as part of destroying an activity due to a configuration
* change, when it is known that a new instance will immediately
* be created for the new configuration.
*/
public Object onRetainNonConfigurationInstance() {
Log.d(TAG, "onRetainNonConfigurationInstance()");
return mThread;
}
/**
* Lifecycle hook method that's called when an activity is about
* to become visible.
*/
protected void onStart() {
super.onStart();
// Create a new CountdownDisplay if it's not currently
// initialized.
if (mThread == null) {
// Create and start a new CountdownDisplay thread.
mThread = new CountdownDisplay(this);
mThread.start();
UiUtils.showToast(this,
"starting a new thread");
} else
// This will be called after a runtime configuration
// change if the thread is still running.
UiUtils.showToast(this,
"continuing to run the thread");
// Set the output TextView.
mThread.setOutput((TextView) findViewById(R.id.color_output));
}
/**
* This lifecycle hook method is called when the activity is about
* to be destroyed.
*/
protected void onDestroy() {
// Call the super class.
super.onDestroy();
// If this activity is going away permanently then interrupt
// the thread.
if (!isChangingConfigurations())
// Interrupt the thread.
mThread.interrupt();
}
}
| {
"pile_set_name": "Github"
} |
<?php
namespace spec\Prophecy\Promise;
use PhpSpec\ObjectBehavior;
use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
class ReturnArgumentPromiseSpec extends ObjectBehavior
{
function it_is_promise()
{
$this->shouldBeAnInstanceOf('Prophecy\Promise\PromiseInterface');
}
function it_should_return_first_argument_if_provided(ObjectProphecy $object, MethodProphecy $method)
{
$this->execute(array('one', 'two'), $object, $method)->shouldReturn('one');
}
function it_should_return_null_if_no_arguments_provided(ObjectProphecy $object, MethodProphecy $method)
{
$this->execute(array(), $object, $method)->shouldReturn(null);
}
function it_should_return_nth_argument_if_provided(ObjectProphecy $object, MethodProphecy $method)
{
$this->beConstructedWith(1);
$this->execute(array('one', 'two'), $object, $method)->shouldReturn('two');
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2017-2018 Dgraph Labs, Inc. and Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package bulk
import (
"fmt"
"log"
"math"
"sync"
"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/dgraph/posting"
"github.com/dgraph-io/dgraph/protos/pb"
"github.com/dgraph-io/dgraph/schema"
wk "github.com/dgraph-io/dgraph/worker"
"github.com/dgraph-io/dgraph/x"
)
type schemaStore struct {
sync.RWMutex
schemaMap map[string]*pb.SchemaUpdate
types []*pb.TypeUpdate
*state
}
func newSchemaStore(initial *schema.ParsedSchema, opt *options, state *state) *schemaStore {
if opt == nil {
log.Fatalf("Cannot create schema store with nil options.")
}
s := &schemaStore{
schemaMap: map[string]*pb.SchemaUpdate{},
state: state,
}
// Load all initial predicates. Some predicates that might not be used when
// the alpha is started (e.g ACL predicates) might be included but it's
// better to include them in case the input data contains triples with these
// predicates.
for _, update := range schema.CompleteInitialSchema() {
s.schemaMap[update.Predicate] = update
}
if opt.StoreXids {
s.schemaMap["xid"] = &pb.SchemaUpdate{
ValueType: pb.Posting_STRING,
Tokenizer: []string{"hash"},
}
}
for _, sch := range initial.Preds {
p := sch.Predicate
sch.Predicate = "" // Predicate is stored in the (badger) key, so not needed in the value.
if _, ok := s.schemaMap[p]; ok {
fmt.Printf("Predicate %q already exists in schema\n", p)
continue
}
s.schemaMap[p] = sch
}
s.types = initial.Types
return s
}
func (s *schemaStore) getSchema(pred string) *pb.SchemaUpdate {
s.RLock()
defer s.RUnlock()
return s.schemaMap[pred]
}
func (s *schemaStore) setSchemaAsList(pred string) {
s.Lock()
defer s.Unlock()
sch, ok := s.schemaMap[pred]
if !ok {
return
}
sch.List = true
}
func (s *schemaStore) validateType(de *pb.DirectedEdge, objectIsUID bool) {
if objectIsUID {
de.ValueType = pb.Posting_UID
}
s.RLock()
sch, ok := s.schemaMap[de.Attr]
s.RUnlock()
if !ok {
s.Lock()
sch, ok = s.schemaMap[de.Attr]
if !ok {
sch = &pb.SchemaUpdate{ValueType: de.ValueType}
if objectIsUID {
sch.List = true
}
s.schemaMap[de.Attr] = sch
}
s.Unlock()
}
err := wk.ValidateAndConvert(de, sch)
if err != nil {
log.Fatalf("RDF doesn't match schema: %v", err)
}
}
func (s *schemaStore) getPredicates(db *badger.DB) []string {
txn := db.NewTransactionAt(math.MaxUint64, false)
defer txn.Discard()
opts := badger.DefaultIteratorOptions
opts.PrefetchValues = false
itr := txn.NewIterator(opts)
defer itr.Close()
m := make(map[string]struct{})
for itr.Rewind(); itr.Valid(); {
item := itr.Item()
pk, err := x.Parse(item.Key())
x.Check(err)
m[pk.Attr] = struct{}{}
itr.Seek(pk.SkipPredicate())
continue
}
var preds []string
for pred := range m {
preds = append(preds, pred)
}
return preds
}
func (s *schemaStore) write(db *badger.DB, preds []string) {
w := posting.NewTxnWriter(db)
for _, pred := range preds {
sch, ok := s.schemaMap[pred]
if !ok {
continue
}
k := x.SchemaKey(pred)
v, err := sch.Marshal()
x.Check(err)
// Write schema and types always at timestamp 1, s.state.writeTs may not be equal to 1
// if bulk loader was restarted or other similar scenarios.
x.Check(w.SetAt(k, v, posting.BitSchemaPosting, 1))
}
// Write all the types as all groups should have access to all the types.
for _, typ := range s.types {
k := x.TypeKey(typ.TypeName)
v, err := typ.Marshal()
x.Check(err)
x.Check(w.SetAt(k, v, posting.BitSchemaPosting, 1))
}
x.Check(w.Flush())
}
| {
"pile_set_name": "Github"
} |
/*
* =============================================================================
*
* Copyright (c) 2007-2010, The JASYPT team (http://www.jasypt.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
package org.jasypt.util.password;
import junit.framework.TestCase;
import org.jasypt.contrib.org.apache.commons.codec_1_3.binary.Base64;
public class StrongPasswordEncryptorTest extends TestCase {
public void testDigest() throws Exception {
String password = "This is a Password";
StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();
String encryptedPassword = passwordEncryptor.encryptPassword(password);
assertTrue(Base64.isArrayByteBase64(encryptedPassword.getBytes("US-ASCII")));
for (int i = 0; i < 10; i++) {
assertTrue(passwordEncryptor.checkPassword(password, encryptedPassword));
}
String password2 = "This is a Password";
for (int i = 0; i < 10; i++) {
assertFalse(passwordEncryptor.checkPassword(password2, encryptedPassword));
}
StrongPasswordEncryptor digester2 = new StrongPasswordEncryptor();
for (int i = 0; i < 10; i++) {
assertTrue(digester2.checkPassword(password, encryptedPassword));
}
for (int i = 0; i < 10; i++) {
assertFalse(
passwordEncryptor.encryptPassword(password).equals(
passwordEncryptor.encryptPassword(password)));
}
StrongPasswordEncryptor digester3 = new StrongPasswordEncryptor();
encryptedPassword = digester3.encryptPassword(password);
for (int i = 0; i < 10; i++) {
assertTrue(digester3.checkPassword(password, encryptedPassword));
}
}
}
| {
"pile_set_name": "Github"
} |
# -*- coding: utf-8 -*-
from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter(is_safe=True)
@stringfilter
def truncateletters(value, arg):
"""
Truncates a string after a certain number of letters
Argument: Number of letters to truncate after
"""
from django_extensions.utils.text import truncate_letters
try:
length = int(arg)
except ValueError: # invalid literal for int()
return value # Fail silently
return truncate_letters(value, length)
| {
"pile_set_name": "Github"
} |
/* Copyright 2013-2015 MongoDB Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Bson.IO;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Serializers;
using MongoDB.Driver.Core.Bindings;
using MongoDB.Driver.Core.Events;
using MongoDB.Driver.Core.Misc;
using MongoDB.Driver.Core.WireProtocol;
using MongoDB.Driver.Core.WireProtocol.Messages.Encoders;
namespace MongoDB.Driver.Core.Operations
{
/// <summary>
/// Represents an async cursor.
/// </summary>
/// <typeparam name="TDocument">The type of the documents.</typeparam>
public class AsyncCursor<TDocument> : IAsyncCursor<TDocument>
{
#region static
// private static fields
private static IBsonSerializer<BsonDocument> __getMoreCommandResultSerializer = new PartiallyRawBsonDocumentSerializer(
"cursor", new PartiallyRawBsonDocumentSerializer(
"nextBatch", new RawBsonArraySerializer()));
#endregion
// fields
private readonly int? _batchSize;
private readonly CollectionNamespace _collectionNamespace;
private readonly IChannelSource _channelSource;
private int _count;
private IReadOnlyList<TDocument> _currentBatch;
private long _cursorId;
private bool _disposed;
private IReadOnlyList<TDocument> _firstBatch;
private readonly int? _limit;
private readonly TimeSpan? _maxTime;
private readonly MessageEncoderSettings _messageEncoderSettings;
private readonly long? _operationId;
private readonly BsonDocument _query;
private readonly IBsonSerializer<TDocument> _serializer;
// constructors
/// <summary>
/// Initializes a new instance of the <see cref="AsyncCursor{TDocument}"/> class.
/// </summary>
/// <param name="channelSource">The channel source.</param>
/// <param name="collectionNamespace">The collection namespace.</param>
/// <param name="query">The query.</param>
/// <param name="firstBatch">The first batch.</param>
/// <param name="cursorId">The cursor identifier.</param>
/// <param name="batchSize">The size of a batch.</param>
/// <param name="limit">The limit.</param>
/// <param name="serializer">The serializer.</param>
/// <param name="messageEncoderSettings">The message encoder settings.</param>
/// <param name="maxTime">The maxTime for each batch.</param>
public AsyncCursor(
IChannelSource channelSource,
CollectionNamespace collectionNamespace,
BsonDocument query,
IReadOnlyList<TDocument> firstBatch,
long cursorId,
int? batchSize,
int? limit,
IBsonSerializer<TDocument> serializer,
MessageEncoderSettings messageEncoderSettings,
TimeSpan? maxTime = null)
{
_operationId = EventContext.OperationId;
_channelSource = channelSource;
_collectionNamespace = Ensure.IsNotNull(collectionNamespace, nameof(collectionNamespace));
_query = Ensure.IsNotNull(query, nameof(query));
_firstBatch = Ensure.IsNotNull(firstBatch, nameof(firstBatch));
_cursorId = cursorId;
_batchSize = Ensure.IsNullOrGreaterThanOrEqualToZero(batchSize, nameof(batchSize));
_limit = Ensure.IsNullOrGreaterThanOrEqualToZero(limit, nameof(limit));
_serializer = Ensure.IsNotNull(serializer, nameof(serializer));
_messageEncoderSettings = messageEncoderSettings;
_maxTime = maxTime;
if (_limit > 0 && _firstBatch.Count > _limit)
{
_firstBatch = _firstBatch.Take(_limit.Value).ToList();
}
_count = _firstBatch.Count;
// if we aren't going to need the channel source we can go ahead and Dispose it now
if (_cursorId == 0 && _channelSource != null)
{
_channelSource.Dispose();
_channelSource = null;
}
}
// properties
/// <inheritdoc/>
public IEnumerable<TDocument> Current
{
get
{
ThrowIfDisposed();
return _currentBatch;
}
}
// methods
private int CalculateGetMoreProtocolNumberToReturn()
{
var numberToReturn = _batchSize ?? 0;
if (_limit > 0)
{
var remaining = _limit.Value - _count;
if (numberToReturn == 0 || numberToReturn > remaining)
{
numberToReturn = remaining;
}
}
return numberToReturn;
}
private CursorBatch<TDocument> CreateCursorBatch(BsonDocument result)
{
var cursorDocument = result["cursor"].AsBsonDocument;
var cursorId = cursorDocument["id"].ToInt64();
var batch = (RawBsonArray)cursorDocument["nextBatch"];
using (batch)
{
var documents = CursorBatchDeserializationHelper.DeserializeBatch(batch, _serializer, _messageEncoderSettings);
return new CursorBatch<TDocument>(cursorId, documents);
}
}
private BsonDocument CreateGetMoreCommand()
{
var command = new BsonDocument
{
{ "getMore", _cursorId },
{ "collection", _collectionNamespace.CollectionName },
{ "batchSize", () => _batchSize.Value, _batchSize > 0 },
{ "maxTimeMS", () => _maxTime.Value.TotalMilliseconds, _maxTime.HasValue }
};
return command;
}
private CursorBatch<TDocument> ExecuteGetMoreCommand(IChannelHandle channel, CancellationToken cancellationToken)
{
var command = CreateGetMoreCommand();
var result = channel.Command<BsonDocument>(
_collectionNamespace.DatabaseNamespace,
command,
NoOpElementNameValidator.Instance,
() => CommandResponseHandling.Return,
false, // slaveOk
__getMoreCommandResultSerializer,
_messageEncoderSettings,
cancellationToken);
return CreateCursorBatch(result);
}
private async Task<CursorBatch<TDocument>> ExecuteGetMoreCommandAsync(IChannelHandle channel, CancellationToken cancellationToken)
{
var command = CreateGetMoreCommand();
var result = await channel.CommandAsync<BsonDocument>(
_collectionNamespace.DatabaseNamespace,
command,
NoOpElementNameValidator.Instance,
() => CommandResponseHandling.Return,
false, // slaveOk
__getMoreCommandResultSerializer,
_messageEncoderSettings,
cancellationToken).ConfigureAwait(false);
return CreateCursorBatch(result);
}
private CursorBatch<TDocument> ExecuteGetMoreProtocol(IChannelHandle channel, CancellationToken cancellationToken)
{
var numberToReturn = CalculateGetMoreProtocolNumberToReturn();
return channel.GetMore<TDocument>(
_collectionNamespace,
_query,
_cursorId,
numberToReturn,
_serializer,
_messageEncoderSettings,
cancellationToken);
}
private Task<CursorBatch<TDocument>> ExecuteGetMoreProtocolAsync(IChannelHandle channel, CancellationToken cancellationToken)
{
var numberToReturn = CalculateGetMoreProtocolNumberToReturn();
return channel.GetMoreAsync<TDocument>(
_collectionNamespace,
_query,
_cursorId,
numberToReturn,
_serializer,
_messageEncoderSettings,
cancellationToken);
}
private void ExecuteKillCursorsProtocol(IChannelHandle channel, CancellationToken cancellationToken)
{
channel.KillCursors(
new[] { _cursorId },
_messageEncoderSettings,
cancellationToken);
}
/// <inheritdoc/>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// Releases unmanaged and - optionally - managed resources.
/// </summary>
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (!_disposed)
{
try
{
if (_cursorId != 0)
{
using (var source = new CancellationTokenSource(TimeSpan.FromSeconds(10)))
{
KillCursor(_cursorId, source.Token);
}
}
}
catch
{
// ignore exceptions
}
if (_channelSource != null)
{
_channelSource.Dispose();
}
}
}
_disposed = true;
}
private CursorBatch<TDocument> GetNextBatch(CancellationToken cancellationToken)
{
using (EventContext.BeginOperation(_operationId))
using (var channel = _channelSource.GetChannel(cancellationToken))
{
if (Feature.FindCommand.IsSupported(channel.ConnectionDescription.ServerVersion))
{
return ExecuteGetMoreCommand(channel, cancellationToken);
}
else
{
return ExecuteGetMoreProtocol(channel, cancellationToken);
}
}
}
private async Task<CursorBatch<TDocument>> GetNextBatchAsync(CancellationToken cancellationToken)
{
using (EventContext.BeginOperation(_operationId))
using (var channel = await _channelSource.GetChannelAsync(cancellationToken).ConfigureAwait(false))
{
if (Feature.FindCommand.IsSupported(channel.ConnectionDescription.ServerVersion))
{
return await ExecuteGetMoreCommandAsync(channel, cancellationToken).ConfigureAwait(false);
}
else
{
return await ExecuteGetMoreProtocolAsync(channel, cancellationToken).ConfigureAwait(false);
}
}
}
private void KillCursor(long cursorId, CancellationToken cancellationToken)
{
try
{
using (EventContext.BeginOperation(_operationId))
using (EventContext.BeginKillCursors(_collectionNamespace))
using (var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(10)))
using (var channel = _channelSource.GetChannel(cancellationTokenSource.Token))
{
ExecuteKillCursorsProtocol(channel, cancellationToken);
}
}
catch
{
// ignore exceptions
}
}
/// <inheritdoc/>
public bool MoveNext(CancellationToken cancellationToken)
{
ThrowIfDisposed();
bool hasMore;
if (TryMoveNext(out hasMore))
{
return hasMore;
}
var batch = GetNextBatch(cancellationToken);
SaveBatch(batch);
return true;
}
/// <inheritdoc/>
public async Task<bool> MoveNextAsync(CancellationToken cancellationToken)
{
ThrowIfDisposed();
bool hasMore;
if (TryMoveNext(out hasMore))
{
return hasMore;
}
var batch = await GetNextBatchAsync(cancellationToken).ConfigureAwait(false);
SaveBatch(batch);
return true;
}
private void SaveBatch(CursorBatch<TDocument> batch)
{
var documents = batch.Documents;
_count += documents.Count;
if (_limit > 0 && _count > _limit.Value)
{
var remove = _count - _limit.Value;
var take = documents.Count - remove;
documents = documents.Take(take).ToList();
_count = _limit.Value;
}
_currentBatch = documents;
_cursorId = batch.CursorId;
}
private void ThrowIfDisposed()
{
if (_disposed)
{
throw new ObjectDisposedException(GetType().Name);
}
}
private bool TryMoveNext(out bool hasMore)
{
hasMore = false;
if (_firstBatch != null)
{
_currentBatch = _firstBatch;
_firstBatch = null;
hasMore = true;
return true;
}
if (_currentBatch == null)
{
return true;
}
if (_cursorId == 0 || (_limit > 0 && _count == _limit.Value))
{
_currentBatch = null;
return true;
}
return false;
}
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>creator</key>
<string>org.robofab.ufoLib</string>
<key>formatVersion</key>
<integer>2</integer>
</dict>
</plist>
| {
"pile_set_name": "Github"
} |
<?php
namespace Github\Exception;
class GitGetTreeNotFoundException extends \RuntimeException implements ClientException
{
private $basicError;
public function __construct(\Github\Model\BasicError $basicError)
{
parent::__construct('Resource Not Found', 404);
$this->basicError = $basicError;
}
public function getBasicError()
{
return $this->basicError;
}
} | {
"pile_set_name": "Github"
} |
import re
import requests
from bs4 import BeautifulSoup
from sota_extractor.taskdb.v01 import (
Task,
Dataset,
Link,
Sota,
SotaRow,
TaskDB,
)
REDITSOTA_URL = (
"https://raw.githubusercontent.com/RedditSota/"
"state-of-the-art-result-for-machine-learning-problems/master/README.md"
)
def reddit() -> TaskDB:
"""Extract Reddit SOTA tables."""
tdb = TaskDB()
md = requests.get(REDITSOTA_URL).text
# assumptions:
# ### Category
# #### Task
md_lines = md.split("\n")
category = None
task = None
for i in range(len(md_lines)):
line = md_lines[i]
if line.startswith("###") and not line.startswith("####"):
category = line.replace("###", "").strip()
if line.startswith("####") and not line.startswith("#####"):
task = line.replace("####", "").strip()
task = re.sub("^[0-9+].?", "", task).strip()
if "<table>" in line.lower():
end_i = None
# find the end of table
for j in range(i, len(md_lines)):
if "</table>" in md_lines[j].lower():
end_i = j + 1
break
if end_i and task and category:
html_lines = md_lines[i:end_i]
h = "\n".join(html_lines)
soup = BeautifulSoup(h, "html.parser")
# parse out the individual rows
entries = []
rows = soup.findAll("tr")
for row in rows:
cells = row.findAll("td")
if len(cells) >= 4:
# paper ref
c_paper = cells[0]
paper_title = c_paper.text.strip()
paper_url = None
if c_paper.find("a"):
paper_url = c_paper.find("a")["href"]
# datasets
c_datasets = cells[1]
c_datasets_li = c_datasets.findAll("li")
dataset_names = []
for dataset_li in c_datasets_li:
dataset_names.append(dataset_li.text.strip())
# metrics
c_metrics = cells[2]
c_metrics_li = c_metrics.findAll("li")
metrics = []
for metrics_li in c_metrics_li:
parts = metrics_li.text.split(":")
parts = [p.strip() for p in parts]
m = {}
if len(parts) == 2:
m[parts[0]] = parts[1]
metrics.append(m)
if not metrics:
# Try to use it as single value
parts = c_metrics.text.split(":")
parts = [p.strip() for p in parts]
m = {}
if len(parts) == 2:
m[parts[0]] = parts[1]
metrics.append(m)
# source code ref
c_code = cells[3]
c_code_a = c_code.findAll("a")
code_links = []
for code_a in c_code_a:
code_links.append(
Link(
title=code_a.text.strip(),
url=code_a["href"],
)
)
entries.append(
{
"paper_title": paper_title,
"paper_url": paper_url,
"dataset_names": dataset_names,
"metrics": metrics,
"code_links": code_links,
}
)
# Add the new task
t = Task(name=task, categories=[category])
t.source_link = Link(title="RedditSota", url=REDITSOTA_URL)
# Add datasets and perfomance on them
data_map = {}
for e in entries:
if len(e["dataset_names"]) == len(e["metrics"]):
for j in range(len(e["dataset_names"])):
dataset_name = e["dataset_names"][j]
# make sure the dataset exists
if dataset_name not in data_map:
# collect all the metrics mentioned for this
# dataset
all_metrics = [
list(ee["metrics"][j].keys())
for ee in entries
if dataset_name in ee["dataset_names"]
]
all_metrics = [
item
for sublist in all_metrics
for item in sublist
]
all_metrics = list(set(all_metrics))
dataset = Dataset(
name=dataset_name,
is_subdataset=False,
sota=Sota(metrics=all_metrics),
)
data_map[dataset_name] = dataset
t.datasets.append(dataset)
else:
dataset = data_map[dataset_name]
# record the metric for this dataset
sr = SotaRow(
model_name="",
paper_title=e["paper_title"],
paper_url=e["paper_url"],
metrics=e["metrics"][j],
code_links=e["code_links"],
)
dataset.sota.rows.append(sr)
# add and reset the task
tdb.add_task(t)
task = None
return tdb
| {
"pile_set_name": "Github"
} |
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
# Mayor.create(:name => 'Daley', :city => cities.first)
| {
"pile_set_name": "Github"
} |
// --------------------------------------------------------------------------
// OpenMS -- Open-Source Mass Spectrometry
// --------------------------------------------------------------------------
// Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
// ETH Zurich, and Freie Universitaet Berlin 2002-2020.
//
// This software is released under a three-clause BSD license:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of any author or any participating institution
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
// For a full list of authors, refer to the file AUTHORS.
// --------------------------------------------------------------------------
// 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 ANY OF THE AUTHORS OR THE CONTRIBUTING
// INSTITUTIONS 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.
//
// --------------------------------------------------------------------------
// $Maintainer: Eugen Netz $
// $Authors: Eugen Netz $
// --------------------------------------------------------------------------
#pragma once
#include <OpenMS/CONCEPT/ProgressLogger.h>
#include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
#include <OpenMS/KERNEL/StandardTypes.h>
#include <OpenMS/FORMAT/FASTAFile.h>
#include <OpenMS/ANALYSIS/XLMS/OPXLDataStructs.h>
namespace OpenMS
{
//-------------------------------------------------------------
//Doxygen docu
//-------------------------------------------------------------
/**
@brief Search for cross-linked peptide pairs in tandem MS spectra
This tool performs a search for cross-links in the given mass spectra.
It executes the following steps in order:
<ul>
<li>Processing of spectra: deisotoping and filtering</li>
<li>Digesting and preprocessing the protein database, building a peptide pair index dependent on the precursor masses of the MS2 spectra</li>
<li>Generating theoretical spectra of cross-linked peptides and aligning the experimental spectra against those</li>
<li>Scoring of cross-link spectrum matches</li>
<li>Using PeptideIndexer to map the peptides to all possible source proteins</li>
</ul>
See below for available parameters and more functionality.
<h3>Input: MS2 spectra and fasta database of proteins expected to be cross-linked in the sample</h3>
The spectra should be provided as one PeakMap. If you have multiple files, e.g. for multiple fractions, you should run this tool on each
file separately.
The database should be provided as a vector of FASTAEntrys containing the target and decoy proteins.
<h3>Parameters</h3>
The parameters for fixed and variable modifications refer to additional modifications beside the cross-linker.
The linker used in the experiment has to be described using the cross-linker specific parameters.
Only one mass is allowed for a cross-linker that links two peptides, while multiple masses are possible for mono-links of the same cross-linking reagent.
Mono-links are cross-linkers, that are linked to one peptide by one of their two reactive groups.
To search for isotopically labeled pairs of cross-linkers see the tool OpenPepXL.
The parameters -cross_linker:residue1 and -cross_linker:residue2 are used to enumerate the amino acids,
that each end of the linker can react with. This way any heterobifunctional cross-linker can be defined.
To define a homobifunctional cross-linker, these two parameters should have the same value.
The parameter -cross_linker:name is used to solve ambiguities caused by different cross-linkers with the same mass
after the linking reaction (see section on output for clarification).
<h3>Output: XL-MS Identifications with scores and linked positions in the proteins</h3>
The input parameters protein_ids and peptide_ids are filled with XL-MS search parameters and IDs
<CENTER>
<table>
<tr>
<td ALIGN = "center" BGCOLOR="#EBEBEB"> pot. predecessor tools </td>
<td VALIGN="middle" ROWSPAN=2> \f$ \longrightarrow \f$ OpenPepXLLF \f$ \longrightarrow \f$</td>
<td ALIGN = "center" BGCOLOR="#EBEBEB"> pot. successor tools </td>
</tr>
<tr>
<td VALIGN="middle" ALIGN = "center" ROWSPAN=1> - </td>
<td VALIGN="middle" ALIGN = "center" ROWSPAN=1> - </td>
</tr>
</table>
</CENTER>
*/
class OPENMS_DLLAPI OpenPepXLLFAlgorithm :
public DefaultParamHandler, public ProgressLogger
{
public:
/// Exit codes
enum ExitCodes
{
EXECUTION_OK,
ILLEGAL_PARAMETERS,
UNEXPECTED_RESULT,
INCOMPATIBLE_INPUT_DATA
};
/// Default constructor
OpenPepXLLFAlgorithm();
/// Default destructor
~OpenPepXLLFAlgorithm() override;
/**
* @brief Performs the main function of this class, the search for cross-linked peptides
* @param unprocessed_spectra The input PeakMap of experimental spectra
* @param fasta_db The protein database containing targets and decoys
* @param protein_ids A result vector containing search settings. Should contain one PeptideIdentification.
* @param peptide_ids A result vector containing cross-link spectrum matches as PeptideIdentifications and PeptideHits. Should be empty.
* @param preprocessed_pair_spectra A result structure containing linear and cross-linked ion spectra. Will be overwritten. This is only necessary for writing out xQuest type spectrum files.
* @param spectrum_pairs A result vector containing paired spectra indices. Should be empty. This is only necessary for writing out xQuest type spectrum files.
* @param all_top_csms A result vector containing cross-link spectrum matches as CrossLinkSpectrumMatches. Should be empty. This is only necessary for writing out xQuest type spectrum files.
* @param spectra A result vector containing the input spectra after preprocessing and filtering. Should be empty. This is only necessary for writing out xQuest type spectrum files.
*/
ExitCodes run(PeakMap& unprocessed_spectra, std::vector<FASTAFile::FASTAEntry>& fasta_db, std::vector<ProteinIdentification>& protein_ids, std::vector<PeptideIdentification>& peptide_ids, std::vector< std::vector< OPXLDataStructs::CrossLinkSpectrumMatch > >& all_top_csms, PeakMap& spectra);
private:
void updateMembers_() override;
String decoy_string_;
bool decoy_prefix_;
Int min_precursor_charge_;
Int max_precursor_charge_;
double precursor_mass_tolerance_;
bool precursor_mass_tolerance_unit_ppm_;
IntList precursor_correction_steps_;
double fragment_mass_tolerance_;
double fragment_mass_tolerance_xlinks_;
bool fragment_mass_tolerance_unit_ppm_;
StringList cross_link_residue1_;
StringList cross_link_residue2_;
double cross_link_mass_;
DoubleList cross_link_mass_mono_link_;
String cross_link_name_;
StringList fixedModNames_;
StringList varModNames_;
Size max_variable_mods_per_peptide_;
Size peptide_min_size_;
Size missed_cleavages_;
String enzyme_name_;
Int number_top_hits_;
String deisotope_mode_;
bool use_sequence_tags_;
Size sequence_tag_min_length_;
String add_y_ions_;
String add_b_ions_;
String add_x_ions_;
String add_a_ions_;
String add_c_ions_;
String add_z_ions_;
String add_losses_;
};
}
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 6e0d2f3cad2f24d2ca12b1ad39cb62bd
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
package com.alorma.github.ui.utils;
import core.User;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class AvatarHelper {
private static final String GITHUB_AVATAR =
"https://camo.githubusercontent.com/a8dd47617ff250cc8de355d383227032e8a9cf4d/68747470733a2f2f302e67726176617461722e636f6d2f6176617461722f37376366623362363061306336663039623233373964396265363736396239353f643d68747470732533412532462532466173736574732d63646e2e6769746875622e636f6d253246696d6167657325324667726176617461727325324667726176617461722d757365722d3432302e706e6726723d7826733d313430";
public static String getAvatar(User user) {
if (user == null) {
return null;
} else if (user.getAvatar() != null) {
return user.getAvatar();
} else if (user.getEmail() != null) {
try {
return "https://www.gravatar.com/avatar/" + md5(user.getEmail()) + "?d=" + urlEncode(GITHUB_AVATAR);
} catch (UnsupportedEncodingException e) {
return GITHUB_AVATAR;
}
} else {
return null;
}
}
private static String md5(final String s) {
final String MD5 = "MD5";
try {
// Create MD5 Hash
MessageDigest digest = java.security.MessageDigest.getInstance(MD5);
digest.update(s.getBytes());
byte messageDigest[] = digest.digest();
// Create Hex String
StringBuilder hexString = new StringBuilder();
for (byte aMessageDigest : messageDigest) {
String h = Integer.toHexString(0xFF & aMessageDigest);
while (h.length() < 2) h = "0" + h;
hexString.append(h);
}
return hexString.toString();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return GITHUB_AVATAR;
}
private static String urlEncode(String s) throws UnsupportedEncodingException {
return URLEncoder.encode(s, "UTF-8");
}
}
| {
"pile_set_name": "Github"
} |
### convert/
**make sure you set GOMAXPROCS=4 (or however many processors you have)**
| {
"pile_set_name": "Github"
} |
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<Color x:Key="ItemSelectionColor">#FFE2742F</Color>
<!-- Default theme resources -->
<SolidColorBrush x:Key="AWShopperAccentBrush" Color="#B8CB11" />
<SolidColorBrush x:Key="AWShopperAccentTextBrush" Color="#B8CB11" />
<SolidColorBrush x:Key="AWShopperButtonForegroundBrush" Color="Black" />
<SolidColorBrush x:Key="AWShopperFlyoutBorderBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperItemForegroundBrush" Color="White" />
<SolidColorBrush x:Key="AWShopperItemForegroundLighterBrush" Color="White" />
<SolidColorBrush x:Key="AWShopperItemForegroundLightestBrush" Color="White" />
<SolidColorBrush x:Key="AWShopperHighlightButtonForegroundBrush" Color="Black" />
<SolidColorBrush x:Key="AwShopperItemBackgroundBrush" Color="#FF353C41" />
<SolidColorBrush x:Key="AwShopperItemBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="AwShopperItemDiscountLine" Color="Gray" />
<SolidColorBrush x:Key="AwShopperAccentText2Brush" Color="{StaticResource ItemSelectionColor}" />
<SolidColorBrush x:Key="AwShopperRatingBrush" Color="Yellow" />
<SolidColorBrush x:Key="AwShopperFlyoutTextBrush" Color="Black" />
<SolidColorBrush x:Key="AwShopperTopBarButtonForegroundBrush" Color="Black" />
<SolidColorBrush x:Key="AwShopperTopBarButtonBackgroundBrush" Color="#FFAAB1B5" />
<!-- Application Background -->
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="#FF2C3339" />
<SolidColorBrush x:Key="ModalBackgroundThemeBrush" Color="#FF2C3339" />
<SolidColorBrush x:Key="SettingsFlyoutBackgroundThemeBrush" Color="White" />
<x:String x:Key="BackButtonGlyph"></x:String>
<x:String x:Key="BackButtonMinimalGlyph"></x:String>
<!-- ListView Selection Color -->
<SolidColorBrush x:Key="ListViewItemSelectedBackgroundThemeBrush" Color="{StaticResource ItemSelectionColor}" />
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBackgroundThemeBrush" Color="{StaticResource ItemSelectionColor}" />
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBorderThemeBrush" Color="{StaticResource ItemSelectionColor}" />
<SolidColorBrush x:Key="AWShopperItemSelectionColor" Color="{StaticResource ItemSelectionColor}" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<!-- High Contrast theme resources -->
<SolidColorBrush x:Key="AWShopperAccentBrush" Color="{StaticResource SystemColorButtonFaceColor}" />
<SolidColorBrush x:Key="AWShopperAccentTextBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperButtonForegroundBrush" Color="{StaticResource SystemColorButtonTextColor}" />
<SolidColorBrush x:Key="AWShopperFlyoutBorderBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperItemForegroundBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperItemForegroundLighterBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperItemForegroundLightestBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperHighlightButtonForegroundBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AwShopperItemBorderBrush" Color="White" />
<SolidColorBrush x:Key="AwShopperItemBackgroundBrush" Color="Black" />
<SolidColorBrush x:Key="AwShopperItemDiscountLine" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AwShopperAccentText2Brush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AwShopperRatingBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AwShopperFlyoutTextBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AwShopperTopBarButtonForegroundBrush" Color="Black" />
<SolidColorBrush x:Key="AwShopperTopBarButtonBackgroundBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<!-- Application Background -->
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="Black" />
<SolidColorBrush x:Key="ModalBackgroundThemeBrush" Color="Black" />
<SolidColorBrush x:Key="SettingsFlyoutBackgroundThemeBrush" Color="Black" />
<x:String x:Key="BackButtonGlyph"></x:String>
<x:String x:Key="BackButtonMinimalGlyph"></x:String>
<!-- ListView Selection Color -->
<SolidColorBrush x:Key="AWShopperItemSelectionColor" Color="White" />
<SolidColorBrush x:Key="ListViewItemSelectedBackgroundThemeBrush" Color="{StaticResource SystemColorHighlightColor}" />
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBackgroundThemeBrush" Color="{StaticResource SystemColorHighlightColor}" />
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBorderThemeBrush" Color="{StaticResource SystemColorHighlightColor}" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrastWhite">
<!-- High Contrast theme resources -->
<SolidColorBrush x:Key="AWShopperAccentBrush" Color="{StaticResource SystemColorButtonFaceColor}" />
<SolidColorBrush x:Key="AWShopperAccentTextBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperButtonForegroundBrush" Color="{StaticResource SystemColorButtonTextColor}" />
<SolidColorBrush x:Key="AWShopperFlyoutBorderBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperItemForegroundBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperItemForegroundLighterBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperItemForegroundLightestBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperHighlightButtonForegroundBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AwShopperItemBorderBrush" Color="Black" />
<SolidColorBrush x:Key="AwShopperItemBackgroundBrush" Color="White" />
<SolidColorBrush x:Key="AwShopperItemDiscountLine" Color="Black" />
<SolidColorBrush x:Key="AwShopperAccentText2Brush" Color="Black" />
<SolidColorBrush x:Key="AwShopperRatingBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AwShopperFlyoutTextBrush" Color="Black" />
<SolidColorBrush x:Key="AwShopperTopBarButtonForegroundBrush" Color="White" />
<SolidColorBrush x:Key="AwShopperTopBarButtonBackgroundBrush" Color="Black" />
<!-- Application Background -->
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="White" />
<SolidColorBrush x:Key="ModalBackgroundThemeBrush" Color="White" />
<SolidColorBrush x:Key="SettingsFlyoutBackgroundThemeBrush" Color="White" />
<x:String x:Key="BackButtonGlyph"></x:String>
<x:String x:Key="BackButtonMinimalGlyph"></x:String>
<!-- ListView Selection Color -->
<SolidColorBrush x:Key="AWShopperItemSelectionColor" Color="White" />
<SolidColorBrush x:Key="ListViewItemSelectedBackgroundThemeBrush" Color="{StaticResource SystemColorHighlightColor}" />
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBackgroundThemeBrush" Color="{StaticResource SystemColorHighlightColor}" />
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBorderThemeBrush" Color="{StaticResource SystemColorHighlightColor}" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrastBlack">
<!-- High Contrast theme resources -->
<SolidColorBrush x:Key="AWShopperAccentBrush" Color="{StaticResource SystemColorButtonFaceColor}" />
<SolidColorBrush x:Key="AWShopperAccentTextBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperButtonForegroundBrush" Color="{StaticResource SystemColorButtonTextColor}" />
<SolidColorBrush x:Key="AWShopperFlyoutBorderBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperItemForegroundBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperItemForegroundLighterBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperItemForegroundLightestBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AWShopperHighlightButtonForegroundBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<SolidColorBrush x:Key="AwShopperItemBorderBrush" Color="White" />
<SolidColorBrush x:Key="AwShopperItemBackgroundBrush" Color="Black" />
<SolidColorBrush x:Key="AwShopperItemDiscountLine" Color="Black" />
<SolidColorBrush x:Key="AwShopperAccentText2Brush" Color="White" />
<SolidColorBrush x:Key="AwShopperRatingBrush" Color="Yellow" />
<SolidColorBrush x:Key="AwShopperFlyoutTextBrush" Color="White" />
<SolidColorBrush x:Key="AwShopperTopBarButtonForegroundBrush" Color="Black" />
<SolidColorBrush x:Key="AwShopperTopBarButtonBackgroundBrush" Color="White" />
<!-- Application Background -->
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="Black" />
<SolidColorBrush x:Key="ModalBackgroundThemeBrush" Color="Black" />
<SolidColorBrush x:Key="SettingsFlyoutBackgroundThemeBrush" Color="Black" />
<x:String x:Key="BackButtonGlyph"></x:String>
<x:String x:Key="BackButtonMinimalGlyph"></x:String>
<!-- ListView Selection Color -->
<SolidColorBrush x:Key="AWShopperItemSelectionColor" Color="White" />
<SolidColorBrush x:Key="ListViewItemSelectedBackgroundThemeBrush" Color="{StaticResource SystemColorHighlightColor}" />
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBackgroundThemeBrush" Color="{StaticResource SystemColorHighlightColor}" />
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBorderThemeBrush" Color="{StaticResource SystemColorHighlightColor}" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<!-- AW Shopper Brushes -->
<SolidColorBrush x:Name="AWShopperItemDarkerBackgroundBrush" Color="#FF262C2F" />
<SolidColorBrush x:Name="AWShopperFlyoutContentBackground" Color="Black" />
<x:String x:Key="ChevronGlyph"></x:String>
<x:String x:Key="OpenedChevronGlyph"></x:String>
<!-- Item Panel Templates -->
<ItemsPanelTemplate x:Key="VerticalStackPanelItemsPanel">
<StackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="VerticalItemsStackPanelItemsPanel">
<ItemsStackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
<!-- Default TextBox and PasswordBox styles to support Headers in High Contrast themes -->
<Style x:Key="BaseTextBoxStyle" TargetType="TextBox">
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Margin="0"
Foreground="{StaticResource AWShopperItemForegroundBrush}"
Padding="0"
Text="{Binding}"
Visibility="{Binding Converter={StaticResource TextToHeaderVisibilityConverter}}" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="VerticalAlignment" Value="Bottom" />
</Style>
<Style x:Key="BasePasswordBoxStyle" TargetType="PasswordBox">
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Margin="0"
Foreground="{StaticResource AWShopperItemForegroundBrush}"
Padding="0"
Text="{Binding}"
Visibility="{Binding Converter={StaticResource TextToHeaderVisibilityConverter}}" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="VerticalAlignment" Value="Bottom" />
</Style>
<Style x:Key="BaseComboBoxStyle" TargetType="ComboBox">
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Margin="0"
Foreground="{StaticResource AWShopperItemForegroundBrush}"
Padding="0"
Text="{Binding}"
Visibility="{Binding Converter={StaticResource TextToHeaderVisibilityConverter}}" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="VerticalAlignment" Value="Bottom" />
</Style>
<Style BasedOn="{StaticResource BaseTextBoxStyle}" TargetType="TextBox" />
<Style BasedOn="{StaticResource BasePasswordBoxStyle}" TargetType="PasswordBox" />
<Style BasedOn="{StaticResource BaseComboBoxStyle}" TargetType="ComboBox" />
<!-- TextBox and PasswordBox styles for SettingsFlyouts to support High Contrast themes -->
<Style x:Key="SettingFlyoutTextBoxStyle"
BasedOn="{StaticResource BaseTextBoxStyle}"
TargetType="TextBox">
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Margin="0"
Foreground="{StaticResource AwShopperFlyoutTextBrush}"
Padding="0"
Text="{Binding}"
Visibility="{Binding Converter={StaticResource TextToHeaderVisibilityConverter}}" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SettingFlyoutPasswordBoxStyle"
BasedOn="{StaticResource BasePasswordBoxStyle}"
TargetType="PasswordBox">
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Margin="0"
Foreground="{StaticResource AwShopperFlyoutTextBrush}"
Padding="0"
Text="{Binding}"
Visibility="{Binding Converter={StaticResource TextToHeaderVisibilityConverter}}" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- TextBlock styles -->
<Style x:Key="BasicTextStyle" TargetType="TextBlock">
<!--
Setter Property="Foreground"
Value="{StaticResource ApplicationForegroundThemeBrush}" /
-->
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
<Setter Property="TextTrimming" Value="WordEllipsis" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Typography.StylisticSet20" Value="True" />
<Setter Property="Typography.DiscretionaryLigatures" Value="True" />
<Setter Property="Typography.CaseSensitiveForms" Value="True" />
</Style>
<Style x:Key="BaselineTextStyle"
BasedOn="{StaticResource BasicTextStyle}"
TargetType="TextBlock">
<Setter Property="LineHeight" Value="20" />
<Setter Property="LineStackingStrategy" Value="BlockLineHeight" />
<!-- Properly align text along its baseline -->
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-1" Y="4" />
</Setter.Value>
</Setter>
</Style>
<!--<Style
x:Key=""></Style>-->
<Style x:Key="HeaderTextStyle"
BasedOn="{StaticResource BaselineTextStyle}"
TargetType="TextBlock">
<Setter Property="FontSize" Value="56" />
<Setter Property="FontWeight" Value="Light" />
<Setter Property="LineHeight" Value="40" />
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-2" Y="8" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SubheaderTextStyle"
BasedOn="{StaticResource BaselineTextStyle}"
TargetType="TextBlock">
<Setter Property="FontSize" Value="26.667" />
<Setter Property="FontWeight" Value="Light" />
<Setter Property="LineHeight" Value="30" />
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-1" Y="6" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TitleTextStyle"
BasedOn="{StaticResource BaselineTextStyle}"
TargetType="TextBlock">
<Setter Property="FontWeight" Value="SemiBold" />
</Style>
<Style x:Key="ItemTextStyle"
BasedOn="{StaticResource BaselineTextStyle}"
TargetType="TextBlock" />
<Style x:Key="BodyTextStyle"
BasedOn="{StaticResource BaselineTextStyle}"
TargetType="TextBlock">
<Setter Property="FontWeight" Value="SemiLight" />
</Style>
<Style x:Key="CaptionTextStyle"
BasedOn="{StaticResource BaselineTextStyle}"
TargetType="TextBlock">
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}" />
</Style>
<Style x:Key="GroupHeaderTextStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
<Setter Property="TextTrimming" Value="WordEllipsis" />
<Setter Property="TextWrapping" Value="NoWrap" />
<Setter Property="Typography.StylisticSet20" Value="True" />
<Setter Property="Typography.Kerning" Value="True" />
<Setter Property="Typography.DiscretionaryLigatures" Value="True" />
<Setter Property="Typography.CaseSensitiveForms" Value="True" />
<Setter Property="FontSize" Value="26.667" />
<Setter Property="LineStackingStrategy" Value="BlockLineHeight" />
<Setter Property="FontWeight" Value="Light" />
<Setter Property="LineHeight" Value="30" />
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-2" Y="6" />
</Setter.Value>
</Setter>
</Style>
<!-- Button styles -->
<!--
TextButtonStyle is used to style a Button using subheader-styled text with no other adornment. There
are two styles that are based on TextButtonStyle (TextPrimaryButtonStyle and TextSecondaryButtonStyle)
which are used in the GroupedItemsPage as a group header and in the FileOpenPickerPage for triggering
commands.
-->
<Style x:Key="TextButtonStyle" TargetType="ButtonBase">
<Setter Property="MinWidth" Value="0" />
<Setter Property="MinHeight" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ButtonBase">
<Grid Background="Transparent">
<ContentPresenter x:Name="Text" Content="{TemplateBinding Content}" />
<Rectangle x:Name="FocusVisualWhite"
IsHitTestVisible="False"
Opacity="0"
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
StrokeDashArray="1,1"
StrokeDashOffset="1.5"
StrokeEndLineCap="Square" />
<Rectangle x:Name="FocusVisualBlack"
IsHitTestVisible="False"
Opacity="0"
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
StrokeDashArray="1,1"
StrokeDashOffset="0.5"
StrokeEndLineCap="Square" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPointerOverForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPressedForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPressedForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation Duration="0"
Storyboard.TargetName="FocusVisualWhite"
Storyboard.TargetProperty="Opacity"
To="1" />
<DoubleAnimation Duration="0"
Storyboard.TargetName="FocusVisualBlack"
Storyboard.TargetProperty="Opacity"
To="1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused" />
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked" />
<VisualState x:Name="Unchecked">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Indeterminate" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TextPrimaryButtonStyle"
BasedOn="{StaticResource TextButtonStyle}"
TargetType="ButtonBase">
<Setter Property="Foreground" Value="{StaticResource ApplicationHeaderForegroundThemeBrush}" />
</Style>
<!-- Title area styles -->
<Style x:Key="PageHeaderTextStyle"
BasedOn="{StaticResource HeaderTextStyle}"
TargetType="TextBlock">
<Setter Property="TextWrapping" Value="NoWrap" />
<Setter Property="VerticalAlignment" Value="Bottom" />
<Setter Property="Margin" Value="0,0,30,40" />
</Style>
<Style x:Key="PageSubheaderTextStyle"
BasedOn="{StaticResource SubheaderTextStyle}"
TargetType="TextBlock">
<Setter Property="TextWrapping" Value="NoWrap" />
<Setter Property="VerticalAlignment" Value="Bottom" />
<Setter Property="Margin" Value="0,0,0,40" />
</Style>
<Style x:Key="MinimalPageHeaderTextStyle"
BasedOn="{StaticResource PageSubheaderTextStyle}"
TargetType="TextBlock">
<Setter Property="Margin" Value="0,0,18,40" />
</Style>
<!--
BackButtonStyle is used to style a Button for use in the title area of a page. Margins appropriate for
the conventional page layout are included as part of the style.
-->
<Style x:Key="BackButtonStyle" TargetType="Button">
<Setter Property="MinWidth" Value="0" />
<Setter Property="Width" Value="48" />
<Setter Property="Height" Value="48" />
<Setter Property="Margin" Value="36,0,36,36" />
<Setter Property="VerticalAlignment" Value="Bottom" />
<Setter Property="FontFamily" Value="Segoe UI Symbol" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FontSize" Value="56" />
<Setter Property="AutomationProperties.AutomationId" Value="BackButton" />
<Setter Property="AutomationProperties.Name" Value="Back" />
<Setter Property="AutomationProperties.ItemType" Value="Navigation Button" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="RootGrid">
<Grid Margin="-1,-16,0,0">
<TextBlock x:Name="BackgroundGlyph"
Foreground="{StaticResource BackButtonBackgroundThemeBrush}"
Text="" />
<TextBlock x:Name="NormalGlyph"
Foreground="{StaticResource BackButtonForegroundThemeBrush}"
Text="{StaticResource BackButtonGlyph}" />
<TextBlock x:Name="ArrowGlyph"
Foreground="{StaticResource BackButtonPressedForegroundThemeBrush}"
Opacity="0"
Text="" />
</Grid>
<Rectangle x:Name="FocusVisualWhite"
IsHitTestVisible="False"
Opacity="0"
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
StrokeDashArray="1,1"
StrokeDashOffset="1.5"
StrokeEndLineCap="Square" />
<Rectangle x:Name="FocusVisualBlack"
IsHitTestVisible="False"
Opacity="0"
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
StrokeDashArray="1,1"
StrokeDashOffset="0.5"
StrokeEndLineCap="Square" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverBackgroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Duration="0"
Storyboard.TargetName="ArrowGlyph"
Storyboard.TargetProperty="Opacity"
To="1" />
<DoubleAnimation Duration="0"
Storyboard.TargetName="NormalGlyph"
Storyboard.TargetProperty="Opacity"
To="0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation Duration="0"
Storyboard.TargetName="FocusVisualWhite"
Storyboard.TargetProperty="Opacity"
To="1" />
<DoubleAnimation Duration="0"
Storyboard.TargetName="FocusVisualBlack"
Storyboard.TargetProperty="Opacity"
To="1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused" />
<VisualState x:Name="PointerFocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--
PortraitBackButtonStyle is used to style a Button for use in the title area of a portrait page. Margins appropriate
for the conventional page layout are included as part of the style.
-->
<Style x:Key="PortraitBackButtonStyle"
BasedOn="{StaticResource BackButtonStyle}"
TargetType="Button">
<Setter Property="Margin" Value="26,0,26,36" />
</Style>
<!--
MinimalBackButtonStyle is used to style a Button for use in the title area of a minimal layout page. Margins appropriate
for the conventional page layout are included as part of the style.
-->
<Style x:Key="MinimalBackButtonStyle"
BasedOn="{StaticResource PortraitBackButtonStyle}"
TargetType="Button">
<Setter Property="Margin" Value="20,0,0,20" />
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="0.75" ScaleY="0.75" />
</Setter.Value>
</Setter>
</Style>
<!-- ScrollViewer styles -->
<Style x:Key="HorizontalScrollViewerStyle" TargetType="ScrollViewer">
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="VerticalScrollBarVisibility" Value="Disabled" />
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled" />
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled" />
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
</Style>
<Style x:Key="VerticalScrollViewerStyle" TargetType="ScrollViewer">
<Setter Property="HorizontalScrollBarVisibility" Value="Hidden" />
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled" />
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
</Style>
<!-- Page layout roots typically use entrance animations and a theme-appropriate background color -->
<Style x:Key="LayoutRootStyle" TargetType="Panel">
<Setter Property="Background" Value="{StaticResource ApplicationPageBackgroundThemeBrush}" />
<Setter Property="ChildrenTransitions">
<Setter.Value>
<TransitionCollection>
<EntranceThemeTransition />
</TransitionCollection>
</Setter.Value>
</Setter>
</Style>
<!-- Form custom styles -->
<Style x:Key="FormTitleStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource ApplicationForegroundThemeBrush}" />
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
<Setter Property="Margin" Value="0,20,0,5" />
</Style>
<Style x:Key="ErrorMessageStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="Red" />
<Setter Property="Margin" Value="5,0" />
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
</Style>
<Style x:Key="HighlightTextBoxStyle"
BasedOn="{StaticResource BaseTextBoxStyle}"
TargetType="TextBox">
<Setter Property="BorderBrush" Value="Red" />
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Margin="0"
Foreground="Red"
Padding="0"
Text="{Binding}"
Visibility="{Binding Converter={StaticResource TextToHeaderVisibilityConverter}}" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="HighlightComboBoxStyle"
BasedOn="{StaticResource BaseComboBoxStyle}"
TargetType="ComboBox">
<Setter Property="BorderBrush" Value="Red" />
</Style>
<!-- Top AppBar style -->
<Style x:Key="HouseStyle" TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContentControl">
<StackPanel x:Name="ControlRoot" VerticalAlignment="Top">
<StackPanel.RenderTransform>
<ScaleTransform />
</StackPanel.RenderTransform>
<Viewbox x:Name="IconViewBox"
Width="86.4"
Height="86.4"
Stretch="Uniform">
<Canvas x:Name="IconCanvas"
Width="86.4"
Height="86.4"
Background="{StaticResource AwShopperTopBarButtonBackgroundBrush}">
<Path x:Name="IconGlyph"
Data="M 225.582,7.63947C 225.582,3.62878 222.31,0.334167 218.299,0.334167L 194.242,0.334167C 190.217,0.334167 186.938,3.62878 186.938,7.63947L 186.938,22.0661L 225.582,60.7488L 225.582,7.63947 Z M 281.939,143.101L 155.057,16.2112C 148.965,10.1259 139.081,10.1259 132.967,16.2112L 6.09198,143.101C -2.03451e-005,149.178 -2.03451e-005,159.09 6.09198,165.19C 9.1413,168.226 13.1306,169.75 17.148,169.75C 21.1133,169.75 25.1253,168.226 28.1826,165.19L 144.016,49.3193L 259.864,165.19C 265.965,171.245 275.855,171.267 281.939,165.19C 288.031,159.09 288.063,149.223 281.939,143.101 Z M 144.015,79.3772L 39.8861,183.491L 39.8861,281.429L 119.661,281.429L 119.661,198.741L 168.142,198.741L 168.142,281.429L 249.234,281.429L 249.234,184.604L 144.015,79.3772 Z "
Fill="{StaticResource AwShopperTopBarButtonForegroundBrush}">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="0.15" ScaleY="0.15" />
<TranslateTransform X="22" Y="26" />
</TransformGroup>
</Path.RenderTransform>
</Path>
</Canvas>
</Viewbox>
<TextBlock x:Name="TextLabel"
Width="88"
MaxHeight="32"
Margin="0,0,2,10"
FontSize="12"
Style="{StaticResource BasicTextStyle}"
Text="{TemplateBinding Content}"
TextAlignment="Center"
TextTrimming="WordEllipsis" />
<Rectangle x:Name="FocusVisualWhite"
Width="100"
Height="120"
Margin="0,-120,0,0"
IsHitTestVisible="False"
Opacity="0"
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
StrokeDashArray="1,1"
StrokeDashOffset="1.5"
StrokeEndLineCap="Square" />
<Rectangle x:Name="FocusVisualBlack"
Width="100"
Height="120"
Margin="0,-120,0,0"
IsHitTestVisible="False"
Opacity="0"
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
StrokeDashArray="1,1"
StrokeDashOffset="0.5"
StrokeEndLineCap="Square" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="ApplicationViewStates">
<VisualState x:Name="DefaultLayout" />
<VisualState x:Name="PortraitLayout" />
<VisualState x:Name="MinimalLayout">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Duration="0"
Storyboard.TargetName="ControlRoot"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
To="0.7" />
<DoubleAnimation Duration="0"
Storyboard.TargetName="ControlRoot"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
To="0.7" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconGlyph" Storyboard.TargetProperty="Fill">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AWShopperItemForegroundBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconCanvas" Storyboard.TargetProperty="(Panel.Background)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonBackgroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconGlyph" Storyboard.TargetProperty="Fill">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AWShopperFlyoutContentBackground}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconCanvas" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="White" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconGlyph" Storyboard.TargetProperty="Fill">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconCanvas" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation Duration="0"
Storyboard.TargetName="FocusVisualWhite"
Storyboard.TargetProperty="Opacity"
To="1" />
<DoubleAnimation Duration="0"
Storyboard.TargetName="FocusVisualBlack"
Storyboard.TargetProperty="Opacity"
To="1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused" />
<VisualState x:Name="PointerFocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CartStyle" TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContentControl">
<StackPanel x:Name="ControlRoot" VerticalAlignment="Top">
<StackPanel.RenderTransform>
<ScaleTransform />
</StackPanel.RenderTransform>
<Viewbox x:Name="IconViewBox"
Width="86.4"
Height="86.4"
Stretch="Uniform">
<Canvas x:Name="IconCanvas"
Width="86.4"
Height="86.4"
Background="{StaticResource AwShopperTopBarButtonBackgroundBrush}">
<Path x:Name="IconGlyph"
Data="F1 M 372.601,181.645L 364.733,181.645L 363.407,175.361C 363.161,174.768 362.819,174.233 362.681,173.593L 338.831,60.2533C 338.792,60.192 338.845,60.108 338.831,60.0707L 336.244,47.9467L 348.789,47.9467L 359.097,47.9467L 568.193,47.9467L 576.223,12.1387L 584.832,12.1387L 587.523,12.1387L 629.964,12.1387L 632.588,12.1387L 642.752,12.1387L 642.752,32.5213L 632.588,32.5213L 629.964,32.5213L 592.823,32.5213L 559.036,173.624L 550.945,215.913C 550.573,217.804 549.62,219.367 548.384,220.716C 553.027,225.077 555.971,231.195 555.971,238.057C 555.971,251.279 545.319,262 532.067,262C 518.821,262 508.1,251.279 508.1,238.057C 508.1,232.785 510.129,228.151 512.988,224.187L 413.115,224.187C 416.004,228.151 418.055,232.785 418.055,238.057C 418.055,251.279 407.319,262 394.044,262C 380.867,262 370.147,251.279 370.147,238.057C 370.147,232.785 372.205,228.151 375.087,224.187L 356.887,224.187C 356.855,224.187 356.756,224.132 356.688,224.132L 346.325,224.132L 346.325,203.804L 356.887,203.804L 362.681,203.804L 532.463,203.804L 536.725,181.676L 372.655,181.676L 372.601,181.645 Z "
Fill="{StaticResource AwShopperTopBarButtonForegroundBrush}"
Stretch="Fill">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="0.15" ScaleY="0.15" />
<TranslateTransform X="22" Y="26" />
</TransformGroup>
</Path.RenderTransform>
</Path>
</Canvas>
</Viewbox>
<TextBlock x:Name="TextLabel"
Width="88"
MaxHeight="32"
Margin="0,0,2,10"
FontSize="12"
Style="{StaticResource BasicTextStyle}"
Text="{TemplateBinding Content}"
TextAlignment="Center"
TextTrimming="WordEllipsis" />
<Rectangle x:Name="FocusVisualWhite"
Width="100"
Height="120"
Margin="0,-120,0,0"
IsHitTestVisible="False"
Opacity="0"
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
StrokeDashArray="1,1"
StrokeDashOffset="1.5"
StrokeEndLineCap="Square" />
<Rectangle x:Name="FocusVisualBlack"
Width="100"
Height="120"
Margin="0,-120,0,0"
IsHitTestVisible="False"
Opacity="0"
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
StrokeDashArray="1,1"
StrokeDashOffset="0.5"
StrokeEndLineCap="Square" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="ApplicationViewStates">
<VisualState x:Name="DefaultLayout" />
<VisualState x:Name="PortraitLayout" />
<VisualState x:Name="MinimalLayout">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Duration="0"
Storyboard.TargetName="ControlRoot"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
To="0.7" />
<DoubleAnimation Duration="0"
Storyboard.TargetName="ControlRoot"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
To="0.7" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconGlyph" Storyboard.TargetProperty="Fill">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AWShopperItemForegroundBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconCanvas" Storyboard.TargetProperty="(Panel.Background)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonBackgroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconGlyph" Storyboard.TargetProperty="Fill">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AWShopperFlyoutContentBackground}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconCanvas" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="White" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconGlyph" Storyboard.TargetProperty="Fill">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconCanvas" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation Duration="0"
Storyboard.TargetName="FocusVisualWhite"
Storyboard.TargetProperty="Opacity"
To="1" />
<DoubleAnimation Duration="0"
Storyboard.TargetName="FocusVisualBlack"
Storyboard.TargetProperty="Opacity"
To="1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused" />
<VisualState x:Name="PointerFocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Bottom AppBar style -->
<Style x:Name="AppBarStyle" TargetType="AppBar">
<Setter Property="Background" Value="{StaticResource AppBarBackgroundThemeBrush}" />
<Setter Property="Opacity" Value="0.9" />
<Setter Property="Padding" Value="10,0,10,0" />
<Setter Property="Height" Value="Auto" />
</Style>
<Style TargetType="Button">
<Setter Property="Foreground" Value="{StaticResource AWShopperHighlightButtonForegroundBrush}" />
<Setter Property="BorderBrush" Value="{StaticResource AWShopperHighlightButtonForegroundBrush}" />
</Style>
<Style x:Key="AWShopperFlyoutStyle" TargetType="FlyoutPresenter">
<Setter Property="Padding" Value="0" />
</Style>
</ResourceDictionary>
| {
"pile_set_name": "Github"
} |
require 'backports/tools/require_relative_dir'
Backports.require_relative_dir
| {
"pile_set_name": "Github"
} |
The standard library {\tt mailcaster} package implements a one-to-many inter-thread communication mechanism.
The {\tt mailcaster} package implements the \ahrefloc{api:Mailcaster}{Mailcaster} API.
The {\tt mailcaster} package source code is in \ahrefloc{src/lib/src/lib/thread-kit/src/lib/mailcaster.pkg}{src/lib/src/lib/thread-kit/src/lib/mailcaster.pkg}.
| {
"pile_set_name": "Github"
} |
/* This file is part of the Pangolin Project.
* http://github.com/stevenlovegrove/Pangolin
*
* Copyright (c) 2011 Steven Lovegrove
*
* 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 <pangolin/utils/threadedfilebuf.h>
#include <pangolin/utils/file_utils.h>
#include <pangolin/utils/sigstate.h>
#include <cstring>
#include <stdexcept>
#ifdef USE_POSIX_FILE_IO
#include <unistd.h>
#include <fcntl.h>
#endif
using namespace std;
namespace pangolin
{
threadedfilebuf::threadedfilebuf()
: mem_buffer(0), mem_size(0), mem_max_size(0), mem_start(0), mem_end(0), should_run(false), is_pipe(false)
{
}
threadedfilebuf::threadedfilebuf(const std::string& filename, size_t buffer_size_bytes )
: mem_buffer(0), mem_size(0), mem_max_size(0), mem_start(0), mem_end(0), should_run(false), is_pipe(pangolin::IsPipe(filename))
{
open(filename, buffer_size_bytes);
}
void threadedfilebuf::open(const std::string& filename, size_t buffer_size_bytes)
{
is_pipe = pangolin::IsPipe(filename);
#ifdef USE_POSIX_FILE_IO
if (filenum != -1) {
#else
if (file.is_open()) {
#endif
close();
}
#ifdef USE_POSIX_FILE_IO
filenum = ::open(filename.c_str(), O_CREAT | O_TRUNC | O_WRONLY | O_SYNC, S_IRWXU);
#else
file.open(filename.c_str(), ios::out | ios::binary);
#endif
#ifdef USE_POSIX_FILE_IO
if (filenum == -1) {
#else
if(!file.is_open()) {
#endif
throw std::runtime_error("Unable to open '" + filename + "' for writing.");
}
mem_buffer = 0;
mem_size = 0;
mem_start = 0;
mem_end = 0;
mem_max_size = static_cast<std::streamsize>(buffer_size_bytes);
mem_buffer = new char[static_cast<size_t>(mem_max_size)];
should_run = true;
write_thread = std::thread(std::ref(*this));
}
void threadedfilebuf::close()
{
should_run = false;
cond_queued.notify_all();
if(write_thread.joinable())
{
write_thread.join();
}
if(mem_buffer)
{
delete [] mem_buffer;
mem_buffer = 0;
}
#ifdef USE_POSIX_FILE_IO
::close(filenum);
filenum = -1;
#else
file.close();
#endif
}
void threadedfilebuf::soft_close()
{
// Forces sputn to write no bytes and exit early, results in lost data
mem_size = 0;
}
void threadedfilebuf::force_close()
{
soft_close();
close();
}
threadedfilebuf::~threadedfilebuf()
{
close();
}
std::streamsize threadedfilebuf::xsputn(const char* data, std::streamsize num_bytes)
{
if( num_bytes > mem_max_size ) {
std::unique_lock<std::mutex> lock(update_mutex);
// Wait until queue is empty
while( mem_size > 0 ) {
cond_dequeued.wait(lock);
}
// Allocate bigger buffer
delete [] mem_buffer;
mem_start = 0;
mem_end = 0;
mem_max_size = num_bytes * 4;
mem_buffer = new char[static_cast<size_t>(mem_max_size)];
}
{
std::unique_lock<std::mutex> lock(update_mutex);
// wait until there is space to write into buffer
while( mem_size + num_bytes > mem_max_size ) {
cond_dequeued.wait(lock);
}
// add image to end of mem_buffer
const std::streamsize array_a_size =
(mem_start <= mem_end) ? (mem_max_size - mem_end) : (mem_start - mem_end);
if( num_bytes <= array_a_size )
{
// copy in one
memcpy(mem_buffer + mem_end, data, static_cast<size_t>(num_bytes));
mem_end += num_bytes;
mem_size += num_bytes;
}else{
const std::streamsize array_b_size = num_bytes - array_a_size;
memcpy(mem_buffer + mem_end, data, (size_t)array_a_size);
memcpy(mem_buffer, data+array_a_size, (size_t)array_b_size);
mem_end = array_b_size;
mem_size += num_bytes;
}
if(mem_end == mem_max_size)
mem_end = 0;
}
cond_queued.notify_one();
input_pos += num_bytes;
return num_bytes;
}
int threadedfilebuf::overflow(int c)
{
const std::streamsize num_bytes = 1;
{
std::unique_lock<std::mutex> lock(update_mutex);
// wait until there is space to write into buffer
while( mem_size + num_bytes > mem_max_size ) {
cond_dequeued.wait(lock);
}
// add image to end of mem_buffer
mem_buffer[mem_end] = c;
mem_end += num_bytes;
mem_size += num_bytes;
if(mem_end == mem_max_size)
mem_end = 0;
}
cond_queued.notify_one();
input_pos += num_bytes;
return num_bytes;
}
std::streampos threadedfilebuf::seekoff(
std::streamoff off, std::ios_base::seekdir way,
std::ios_base::openmode /*which*/
) {
if(off == 0 && way == ios_base::cur) {
return input_pos;
}else{
return -1;
}
}
void threadedfilebuf::operator()()
{
std::streamsize data_to_write = 0;
while(true)
{
if(is_pipe)
{
try
{
if(SigState::I().sig_callbacks.at(SIGPIPE).value)
{
soft_close();
return;
}
} catch(std::out_of_range&)
{
// std::cout << "Please register a SIGPIPE handler for your writer" << std::endl;
}
}
{
std::unique_lock<std::mutex> lock(update_mutex);
while( mem_size == 0 ) {
if(!should_run) return;
cond_queued.wait(lock);
}
data_to_write =
(mem_start < mem_end) ?
mem_end - mem_start :
mem_max_size - mem_start;
}
#ifdef USE_POSIX_FILE_IO
int bytes_written = ::write(filenum, mem_buffer + mem_start, data_to_write);
if(bytes_written == -1)
{
throw std::runtime_error("Unable to write data.");
}
#else
std::streamsize bytes_written =
file.sputn(mem_buffer + mem_start, data_to_write );
#endif
{
std::unique_lock<std::mutex> lock(update_mutex);
mem_size -= bytes_written;
mem_start += bytes_written;
if(mem_start == mem_max_size)
mem_start = 0;
}
cond_dequeued.notify_all();
}
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2018 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.
// +build s390x,go1.11,!gccgo,!appengine
#include "textflag.h"
// Implementation of Poly1305 using the vector facility (vx) and the VMSL instruction.
// constants
#define EX0 V1
#define EX1 V2
#define EX2 V3
// temporaries
#define T_0 V4
#define T_1 V5
#define T_2 V6
#define T_3 V7
#define T_4 V8
#define T_5 V9
#define T_6 V10
#define T_7 V11
#define T_8 V12
#define T_9 V13
#define T_10 V14
// r**2 & r**4
#define R_0 V15
#define R_1 V16
#define R_2 V17
#define R5_1 V18
#define R5_2 V19
// key (r)
#define RSAVE_0 R7
#define RSAVE_1 R8
#define RSAVE_2 R9
#define R5SAVE_1 R10
#define R5SAVE_2 R11
// message block
#define M0 V20
#define M1 V21
#define M2 V22
#define M3 V23
#define M4 V24
#define M5 V25
// accumulator
#define H0_0 V26
#define H1_0 V27
#define H2_0 V28
#define H0_1 V29
#define H1_1 V30
#define H2_1 V31
GLOBL ·keyMask<>(SB), RODATA, $16
DATA ·keyMask<>+0(SB)/8, $0xffffff0ffcffff0f
DATA ·keyMask<>+8(SB)/8, $0xfcffff0ffcffff0f
GLOBL ·bswapMask<>(SB), RODATA, $16
DATA ·bswapMask<>+0(SB)/8, $0x0f0e0d0c0b0a0908
DATA ·bswapMask<>+8(SB)/8, $0x0706050403020100
GLOBL ·constants<>(SB), RODATA, $48
// EX0
DATA ·constants<>+0(SB)/8, $0x18191a1b1c1d1e1f
DATA ·constants<>+8(SB)/8, $0x0000050403020100
// EX1
DATA ·constants<>+16(SB)/8, $0x18191a1b1c1d1e1f
DATA ·constants<>+24(SB)/8, $0x00000a0908070605
// EX2
DATA ·constants<>+32(SB)/8, $0x18191a1b1c1d1e1f
DATA ·constants<>+40(SB)/8, $0x0000000f0e0d0c0b
GLOBL ·c<>(SB), RODATA, $48
// EX0
DATA ·c<>+0(SB)/8, $0x0000050403020100
DATA ·c<>+8(SB)/8, $0x0000151413121110
// EX1
DATA ·c<>+16(SB)/8, $0x00000a0908070605
DATA ·c<>+24(SB)/8, $0x00001a1918171615
// EX2
DATA ·c<>+32(SB)/8, $0x0000000f0e0d0c0b
DATA ·c<>+40(SB)/8, $0x0000001f1e1d1c1b
GLOBL ·reduce<>(SB), RODATA, $32
// 44 bit
DATA ·reduce<>+0(SB)/8, $0x0
DATA ·reduce<>+8(SB)/8, $0xfffffffffff
// 42 bit
DATA ·reduce<>+16(SB)/8, $0x0
DATA ·reduce<>+24(SB)/8, $0x3ffffffffff
// h = (f*g) % (2**130-5) [partial reduction]
// uses T_0...T_9 temporary registers
// input: m02_0, m02_1, m02_2, m13_0, m13_1, m13_2, r_0, r_1, r_2, r5_1, r5_2, m4_0, m4_1, m4_2, m5_0, m5_1, m5_2
// temp: t0, t1, t2, t3, t4, t5, t6, t7, t8, t9
// output: m02_0, m02_1, m02_2, m13_0, m13_1, m13_2
#define MULTIPLY(m02_0, m02_1, m02_2, m13_0, m13_1, m13_2, r_0, r_1, r_2, r5_1, r5_2, m4_0, m4_1, m4_2, m5_0, m5_1, m5_2, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) \
\ // Eliminate the dependency for the last 2 VMSLs
VMSLG m02_0, r_2, m4_2, m4_2 \
VMSLG m13_0, r_2, m5_2, m5_2 \ // 8 VMSLs pipelined
VMSLG m02_0, r_0, m4_0, m4_0 \
VMSLG m02_1, r5_2, V0, T_0 \
VMSLG m02_0, r_1, m4_1, m4_1 \
VMSLG m02_1, r_0, V0, T_1 \
VMSLG m02_1, r_1, V0, T_2 \
VMSLG m02_2, r5_1, V0, T_3 \
VMSLG m02_2, r5_2, V0, T_4 \
VMSLG m13_0, r_0, m5_0, m5_0 \
VMSLG m13_1, r5_2, V0, T_5 \
VMSLG m13_0, r_1, m5_1, m5_1 \
VMSLG m13_1, r_0, V0, T_6 \
VMSLG m13_1, r_1, V0, T_7 \
VMSLG m13_2, r5_1, V0, T_8 \
VMSLG m13_2, r5_2, V0, T_9 \
VMSLG m02_2, r_0, m4_2, m4_2 \
VMSLG m13_2, r_0, m5_2, m5_2 \
VAQ m4_0, T_0, m02_0 \
VAQ m4_1, T_1, m02_1 \
VAQ m5_0, T_5, m13_0 \
VAQ m5_1, T_6, m13_1 \
VAQ m02_0, T_3, m02_0 \
VAQ m02_1, T_4, m02_1 \
VAQ m13_0, T_8, m13_0 \
VAQ m13_1, T_9, m13_1 \
VAQ m4_2, T_2, m02_2 \
VAQ m5_2, T_7, m13_2 \
// SQUARE uses three limbs of r and r_2*5 to output square of r
// uses T_1, T_5 and T_7 temporary registers
// input: r_0, r_1, r_2, r5_2
// temp: TEMP0, TEMP1, TEMP2
// output: p0, p1, p2
#define SQUARE(r_0, r_1, r_2, r5_2, p0, p1, p2, TEMP0, TEMP1, TEMP2) \
VMSLG r_0, r_0, p0, p0 \
VMSLG r_1, r5_2, V0, TEMP0 \
VMSLG r_2, r5_2, p1, p1 \
VMSLG r_0, r_1, V0, TEMP1 \
VMSLG r_1, r_1, p2, p2 \
VMSLG r_0, r_2, V0, TEMP2 \
VAQ TEMP0, p0, p0 \
VAQ TEMP1, p1, p1 \
VAQ TEMP2, p2, p2 \
VAQ TEMP0, p0, p0 \
VAQ TEMP1, p1, p1 \
VAQ TEMP2, p2, p2 \
// carry h0->h1->h2->h0 || h3->h4->h5->h3
// uses T_2, T_4, T_5, T_7, T_8, T_9
// t6, t7, t8, t9, t10, t11
// input: h0, h1, h2, h3, h4, h5
// temp: t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11
// output: h0, h1, h2, h3, h4, h5
#define REDUCE(h0, h1, h2, h3, h4, h5, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) \
VLM (R12), t6, t7 \ // 44 and 42 bit clear mask
VLEIB $7, $0x28, t10 \ // 5 byte shift mask
VREPIB $4, t8 \ // 4 bit shift mask
VREPIB $2, t11 \ // 2 bit shift mask
VSRLB t10, h0, t0 \ // h0 byte shift
VSRLB t10, h1, t1 \ // h1 byte shift
VSRLB t10, h2, t2 \ // h2 byte shift
VSRLB t10, h3, t3 \ // h3 byte shift
VSRLB t10, h4, t4 \ // h4 byte shift
VSRLB t10, h5, t5 \ // h5 byte shift
VSRL t8, t0, t0 \ // h0 bit shift
VSRL t8, t1, t1 \ // h2 bit shift
VSRL t11, t2, t2 \ // h2 bit shift
VSRL t8, t3, t3 \ // h3 bit shift
VSRL t8, t4, t4 \ // h4 bit shift
VESLG $2, t2, t9 \ // h2 carry x5
VSRL t11, t5, t5 \ // h5 bit shift
VN t6, h0, h0 \ // h0 clear carry
VAQ t2, t9, t2 \ // h2 carry x5
VESLG $2, t5, t9 \ // h5 carry x5
VN t6, h1, h1 \ // h1 clear carry
VN t7, h2, h2 \ // h2 clear carry
VAQ t5, t9, t5 \ // h5 carry x5
VN t6, h3, h3 \ // h3 clear carry
VN t6, h4, h4 \ // h4 clear carry
VN t7, h5, h5 \ // h5 clear carry
VAQ t0, h1, h1 \ // h0->h1
VAQ t3, h4, h4 \ // h3->h4
VAQ t1, h2, h2 \ // h1->h2
VAQ t4, h5, h5 \ // h4->h5
VAQ t2, h0, h0 \ // h2->h0
VAQ t5, h3, h3 \ // h5->h3
VREPG $1, t6, t6 \ // 44 and 42 bit masks across both halves
VREPG $1, t7, t7 \
VSLDB $8, h0, h0, h0 \ // set up [h0/1/2, h3/4/5]
VSLDB $8, h1, h1, h1 \
VSLDB $8, h2, h2, h2 \
VO h0, h3, h3 \
VO h1, h4, h4 \
VO h2, h5, h5 \
VESRLG $44, h3, t0 \ // 44 bit shift right
VESRLG $44, h4, t1 \
VESRLG $42, h5, t2 \
VN t6, h3, h3 \ // clear carry bits
VN t6, h4, h4 \
VN t7, h5, h5 \
VESLG $2, t2, t9 \ // multiply carry by 5
VAQ t9, t2, t2 \
VAQ t0, h4, h4 \
VAQ t1, h5, h5 \
VAQ t2, h3, h3 \
// carry h0->h1->h2->h0
// input: h0, h1, h2
// temp: t0, t1, t2, t3, t4, t5, t6, t7, t8
// output: h0, h1, h2
#define REDUCE2(h0, h1, h2, t0, t1, t2, t3, t4, t5, t6, t7, t8) \
VLEIB $7, $0x28, t3 \ // 5 byte shift mask
VREPIB $4, t4 \ // 4 bit shift mask
VREPIB $2, t7 \ // 2 bit shift mask
VGBM $0x003F, t5 \ // mask to clear carry bits
VSRLB t3, h0, t0 \
VSRLB t3, h1, t1 \
VSRLB t3, h2, t2 \
VESRLG $4, t5, t5 \ // 44 bit clear mask
VSRL t4, t0, t0 \
VSRL t4, t1, t1 \
VSRL t7, t2, t2 \
VESRLG $2, t5, t6 \ // 42 bit clear mask
VESLG $2, t2, t8 \
VAQ t8, t2, t2 \
VN t5, h0, h0 \
VN t5, h1, h1 \
VN t6, h2, h2 \
VAQ t0, h1, h1 \
VAQ t1, h2, h2 \
VAQ t2, h0, h0 \
VSRLB t3, h0, t0 \
VSRLB t3, h1, t1 \
VSRLB t3, h2, t2 \
VSRL t4, t0, t0 \
VSRL t4, t1, t1 \
VSRL t7, t2, t2 \
VN t5, h0, h0 \
VN t5, h1, h1 \
VESLG $2, t2, t8 \
VN t6, h2, h2 \
VAQ t0, h1, h1 \
VAQ t8, t2, t2 \
VAQ t1, h2, h2 \
VAQ t2, h0, h0 \
// expands two message blocks into the lower halfs of the d registers
// moves the contents of the d registers into upper halfs
// input: in1, in2, d0, d1, d2, d3, d4, d5
// temp: TEMP0, TEMP1, TEMP2, TEMP3
// output: d0, d1, d2, d3, d4, d5
#define EXPACC(in1, in2, d0, d1, d2, d3, d4, d5, TEMP0, TEMP1, TEMP2, TEMP3) \
VGBM $0xff3f, TEMP0 \
VGBM $0xff1f, TEMP1 \
VESLG $4, d1, TEMP2 \
VESLG $4, d4, TEMP3 \
VESRLG $4, TEMP0, TEMP0 \
VPERM in1, d0, EX0, d0 \
VPERM in2, d3, EX0, d3 \
VPERM in1, d2, EX2, d2 \
VPERM in2, d5, EX2, d5 \
VPERM in1, TEMP2, EX1, d1 \
VPERM in2, TEMP3, EX1, d4 \
VN TEMP0, d0, d0 \
VN TEMP0, d3, d3 \
VESRLG $4, d1, d1 \
VESRLG $4, d4, d4 \
VN TEMP1, d2, d2 \
VN TEMP1, d5, d5 \
VN TEMP0, d1, d1 \
VN TEMP0, d4, d4 \
// expands one message block into the lower halfs of the d registers
// moves the contents of the d registers into upper halfs
// input: in, d0, d1, d2
// temp: TEMP0, TEMP1, TEMP2
// output: d0, d1, d2
#define EXPACC2(in, d0, d1, d2, TEMP0, TEMP1, TEMP2) \
VGBM $0xff3f, TEMP0 \
VESLG $4, d1, TEMP2 \
VGBM $0xff1f, TEMP1 \
VPERM in, d0, EX0, d0 \
VESRLG $4, TEMP0, TEMP0 \
VPERM in, d2, EX2, d2 \
VPERM in, TEMP2, EX1, d1 \
VN TEMP0, d0, d0 \
VN TEMP1, d2, d2 \
VESRLG $4, d1, d1 \
VN TEMP0, d1, d1 \
// pack h2:h0 into h1:h0 (no carry)
// input: h0, h1, h2
// output: h0, h1, h2
#define PACK(h0, h1, h2) \
VMRLG h1, h2, h2 \ // copy h1 to upper half h2
VESLG $44, h1, h1 \ // shift limb 1 44 bits, leaving 20
VO h0, h1, h0 \ // combine h0 with 20 bits from limb 1
VESRLG $20, h2, h1 \ // put top 24 bits of limb 1 into h1
VLEIG $1, $0, h1 \ // clear h2 stuff from lower half of h1
VO h0, h1, h0 \ // h0 now has 88 bits (limb 0 and 1)
VLEIG $0, $0, h2 \ // clear upper half of h2
VESRLG $40, h2, h1 \ // h1 now has upper two bits of result
VLEIB $7, $88, h1 \ // for byte shift (11 bytes)
VSLB h1, h2, h2 \ // shift h2 11 bytes to the left
VO h0, h2, h0 \ // combine h0 with 20 bits from limb 1
VLEIG $0, $0, h1 \ // clear upper half of h1
// if h > 2**130-5 then h -= 2**130-5
// input: h0, h1
// temp: t0, t1, t2
// output: h0
#define MOD(h0, h1, t0, t1, t2) \
VZERO t0 \
VLEIG $1, $5, t0 \
VACCQ h0, t0, t1 \
VAQ h0, t0, t0 \
VONE t2 \
VLEIG $1, $-4, t2 \
VAQ t2, t1, t1 \
VACCQ h1, t1, t1 \
VONE t2 \
VAQ t2, t1, t1 \
VN h0, t1, t2 \
VNC t0, t1, t1 \
VO t1, t2, h0 \
// func poly1305vmsl(out *[16]byte, m *byte, mlen uint64, key *[32]key)
TEXT ·poly1305vmsl(SB), $0-32
// This code processes 6 + up to 4 blocks (32 bytes) per iteration
// using the algorithm described in:
// NEON crypto, Daniel J. Bernstein & Peter Schwabe
// https://cryptojedi.org/papers/neoncrypto-20120320.pdf
// And as moddified for VMSL as described in
// Accelerating Poly1305 Cryptographic Message Authentication on the z14
// O'Farrell et al, CASCON 2017, p48-55
// https://ibm.ent.box.com/s/jf9gedj0e9d2vjctfyh186shaztavnht
LMG out+0(FP), R1, R4 // R1=out, R2=m, R3=mlen, R4=key
VZERO V0 // c
// load EX0, EX1 and EX2
MOVD $·constants<>(SB), R5
VLM (R5), EX0, EX2 // c
// setup r
VL (R4), T_0
MOVD $·keyMask<>(SB), R6
VL (R6), T_1
VN T_0, T_1, T_0
VZERO T_2 // limbs for r
VZERO T_3
VZERO T_4
EXPACC2(T_0, T_2, T_3, T_4, T_1, T_5, T_7)
// T_2, T_3, T_4: [0, r]
// setup r*20
VLEIG $0, $0, T_0
VLEIG $1, $20, T_0 // T_0: [0, 20]
VZERO T_5
VZERO T_6
VMSLG T_0, T_3, T_5, T_5
VMSLG T_0, T_4, T_6, T_6
// store r for final block in GR
VLGVG $1, T_2, RSAVE_0 // c
VLGVG $1, T_3, RSAVE_1 // c
VLGVG $1, T_4, RSAVE_2 // c
VLGVG $1, T_5, R5SAVE_1 // c
VLGVG $1, T_6, R5SAVE_2 // c
// initialize h
VZERO H0_0
VZERO H1_0
VZERO H2_0
VZERO H0_1
VZERO H1_1
VZERO H2_1
// initialize pointer for reduce constants
MOVD $·reduce<>(SB), R12
// calculate r**2 and 20*(r**2)
VZERO R_0
VZERO R_1
VZERO R_2
SQUARE(T_2, T_3, T_4, T_6, R_0, R_1, R_2, T_1, T_5, T_7)
REDUCE2(R_0, R_1, R_2, M0, M1, M2, M3, M4, R5_1, R5_2, M5, T_1)
VZERO R5_1
VZERO R5_2
VMSLG T_0, R_1, R5_1, R5_1
VMSLG T_0, R_2, R5_2, R5_2
// skip r**4 calculation if 3 blocks or less
CMPBLE R3, $48, b4
// calculate r**4 and 20*(r**4)
VZERO T_8
VZERO T_9
VZERO T_10
SQUARE(R_0, R_1, R_2, R5_2, T_8, T_9, T_10, T_1, T_5, T_7)
REDUCE2(T_8, T_9, T_10, M0, M1, M2, M3, M4, T_2, T_3, M5, T_1)
VZERO T_2
VZERO T_3
VMSLG T_0, T_9, T_2, T_2
VMSLG T_0, T_10, T_3, T_3
// put r**2 to the right and r**4 to the left of R_0, R_1, R_2
VSLDB $8, T_8, T_8, T_8
VSLDB $8, T_9, T_9, T_9
VSLDB $8, T_10, T_10, T_10
VSLDB $8, T_2, T_2, T_2
VSLDB $8, T_3, T_3, T_3
VO T_8, R_0, R_0
VO T_9, R_1, R_1
VO T_10, R_2, R_2
VO T_2, R5_1, R5_1
VO T_3, R5_2, R5_2
CMPBLE R3, $80, load // less than or equal to 5 blocks in message
// 6(or 5+1) blocks
SUB $81, R3
VLM (R2), M0, M4
VLL R3, 80(R2), M5
ADD $1, R3
MOVBZ $1, R0
CMPBGE R3, $16, 2(PC)
VLVGB R3, R0, M5
MOVD $96(R2), R2
EXPACC(M0, M1, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3)
EXPACC(M2, M3, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3)
VLEIB $2, $1, H2_0
VLEIB $2, $1, H2_1
VLEIB $10, $1, H2_0
VLEIB $10, $1, H2_1
VZERO M0
VZERO M1
VZERO M2
VZERO M3
VZERO T_4
VZERO T_10
EXPACC(M4, M5, M0, M1, M2, M3, T_4, T_10, T_0, T_1, T_2, T_3)
VLR T_4, M4
VLEIB $10, $1, M2
CMPBLT R3, $16, 2(PC)
VLEIB $10, $1, T_10
MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9)
REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M2, M3, M4, T_4, T_5, T_2, T_7, T_8, T_9)
VMRHG V0, H0_1, H0_0
VMRHG V0, H1_1, H1_0
VMRHG V0, H2_1, H2_0
VMRLG V0, H0_1, H0_1
VMRLG V0, H1_1, H1_1
VMRLG V0, H2_1, H2_1
SUB $16, R3
CMPBLE R3, $0, square
load:
// load EX0, EX1 and EX2
MOVD $·c<>(SB), R5
VLM (R5), EX0, EX2
loop:
CMPBLE R3, $64, add // b4 // last 4 or less blocks left
// next 4 full blocks
VLM (R2), M2, M5
SUB $64, R3
MOVD $64(R2), R2
REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, T_0, T_1, T_3, T_4, T_5, T_2, T_7, T_8, T_9)
// expacc in-lined to create [m2, m3] limbs
VGBM $0x3f3f, T_0 // 44 bit clear mask
VGBM $0x1f1f, T_1 // 40 bit clear mask
VPERM M2, M3, EX0, T_3
VESRLG $4, T_0, T_0 // 44 bit clear mask ready
VPERM M2, M3, EX1, T_4
VPERM M2, M3, EX2, T_5
VN T_0, T_3, T_3
VESRLG $4, T_4, T_4
VN T_1, T_5, T_5
VN T_0, T_4, T_4
VMRHG H0_1, T_3, H0_0
VMRHG H1_1, T_4, H1_0
VMRHG H2_1, T_5, H2_0
VMRLG H0_1, T_3, H0_1
VMRLG H1_1, T_4, H1_1
VMRLG H2_1, T_5, H2_1
VLEIB $10, $1, H2_0
VLEIB $10, $1, H2_1
VPERM M4, M5, EX0, T_3
VPERM M4, M5, EX1, T_4
VPERM M4, M5, EX2, T_5
VN T_0, T_3, T_3
VESRLG $4, T_4, T_4
VN T_1, T_5, T_5
VN T_0, T_4, T_4
VMRHG V0, T_3, M0
VMRHG V0, T_4, M1
VMRHG V0, T_5, M2
VMRLG V0, T_3, M3
VMRLG V0, T_4, M4
VMRLG V0, T_5, M5
VLEIB $10, $1, M2
VLEIB $10, $1, M5
MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9)
CMPBNE R3, $0, loop
REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9)
VMRHG V0, H0_1, H0_0
VMRHG V0, H1_1, H1_0
VMRHG V0, H2_1, H2_0
VMRLG V0, H0_1, H0_1
VMRLG V0, H1_1, H1_1
VMRLG V0, H2_1, H2_1
// load EX0, EX1, EX2
MOVD $·constants<>(SB), R5
VLM (R5), EX0, EX2
// sum vectors
VAQ H0_0, H0_1, H0_0
VAQ H1_0, H1_1, H1_0
VAQ H2_0, H2_1, H2_0
// h may be >= 2*(2**130-5) so we need to reduce it again
// M0...M4 are used as temps here
REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5)
next: // carry h1->h2
VLEIB $7, $0x28, T_1
VREPIB $4, T_2
VGBM $0x003F, T_3
VESRLG $4, T_3
// byte shift
VSRLB T_1, H1_0, T_4
// bit shift
VSRL T_2, T_4, T_4
// clear h1 carry bits
VN T_3, H1_0, H1_0
// add carry
VAQ T_4, H2_0, H2_0
// h is now < 2*(2**130-5)
// pack h into h1 (hi) and h0 (lo)
PACK(H0_0, H1_0, H2_0)
// if h > 2**130-5 then h -= 2**130-5
MOD(H0_0, H1_0, T_0, T_1, T_2)
// h += s
MOVD $·bswapMask<>(SB), R5
VL (R5), T_1
VL 16(R4), T_0
VPERM T_0, T_0, T_1, T_0 // reverse bytes (to big)
VAQ T_0, H0_0, H0_0
VPERM H0_0, H0_0, T_1, H0_0 // reverse bytes (to little)
VST H0_0, (R1)
RET
add:
// load EX0, EX1, EX2
MOVD $·constants<>(SB), R5
VLM (R5), EX0, EX2
REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9)
VMRHG V0, H0_1, H0_0
VMRHG V0, H1_1, H1_0
VMRHG V0, H2_1, H2_0
VMRLG V0, H0_1, H0_1
VMRLG V0, H1_1, H1_1
VMRLG V0, H2_1, H2_1
CMPBLE R3, $64, b4
b4:
CMPBLE R3, $48, b3 // 3 blocks or less
// 4(3+1) blocks remaining
SUB $49, R3
VLM (R2), M0, M2
VLL R3, 48(R2), M3
ADD $1, R3
MOVBZ $1, R0
CMPBEQ R3, $16, 2(PC)
VLVGB R3, R0, M3
MOVD $64(R2), R2
EXPACC(M0, M1, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3)
VLEIB $10, $1, H2_0
VLEIB $10, $1, H2_1
VZERO M0
VZERO M1
VZERO M4
VZERO M5
VZERO T_4
VZERO T_10
EXPACC(M2, M3, M0, M1, M4, M5, T_4, T_10, T_0, T_1, T_2, T_3)
VLR T_4, M2
VLEIB $10, $1, M4
CMPBNE R3, $16, 2(PC)
VLEIB $10, $1, T_10
MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M4, M5, M2, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9)
REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9)
VMRHG V0, H0_1, H0_0
VMRHG V0, H1_1, H1_0
VMRHG V0, H2_1, H2_0
VMRLG V0, H0_1, H0_1
VMRLG V0, H1_1, H1_1
VMRLG V0, H2_1, H2_1
SUB $16, R3
CMPBLE R3, $0, square // this condition must always hold true!
b3:
CMPBLE R3, $32, b2
// 3 blocks remaining
// setup [r²,r]
VSLDB $8, R_0, R_0, R_0
VSLDB $8, R_1, R_1, R_1
VSLDB $8, R_2, R_2, R_2
VSLDB $8, R5_1, R5_1, R5_1
VSLDB $8, R5_2, R5_2, R5_2
VLVGG $1, RSAVE_0, R_0
VLVGG $1, RSAVE_1, R_1
VLVGG $1, RSAVE_2, R_2
VLVGG $1, R5SAVE_1, R5_1
VLVGG $1, R5SAVE_2, R5_2
// setup [h0, h1]
VSLDB $8, H0_0, H0_0, H0_0
VSLDB $8, H1_0, H1_0, H1_0
VSLDB $8, H2_0, H2_0, H2_0
VO H0_1, H0_0, H0_0
VO H1_1, H1_0, H1_0
VO H2_1, H2_0, H2_0
VZERO H0_1
VZERO H1_1
VZERO H2_1
VZERO M0
VZERO M1
VZERO M2
VZERO M3
VZERO M4
VZERO M5
// H*[r**2, r]
MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9)
REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, H0_1, H1_1, T_10, M5)
SUB $33, R3
VLM (R2), M0, M1
VLL R3, 32(R2), M2
ADD $1, R3
MOVBZ $1, R0
CMPBEQ R3, $16, 2(PC)
VLVGB R3, R0, M2
// H += m0
VZERO T_1
VZERO T_2
VZERO T_3
EXPACC2(M0, T_1, T_2, T_3, T_4, T_5, T_6)
VLEIB $10, $1, T_3
VAG H0_0, T_1, H0_0
VAG H1_0, T_2, H1_0
VAG H2_0, T_3, H2_0
VZERO M0
VZERO M3
VZERO M4
VZERO M5
VZERO T_10
// (H+m0)*r
MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M3, M4, M5, V0, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9)
REDUCE2(H0_0, H1_0, H2_0, M0, M3, M4, M5, T_10, H0_1, H1_1, H2_1, T_9)
// H += m1
VZERO V0
VZERO T_1
VZERO T_2
VZERO T_3
EXPACC2(M1, T_1, T_2, T_3, T_4, T_5, T_6)
VLEIB $10, $1, T_3
VAQ H0_0, T_1, H0_0
VAQ H1_0, T_2, H1_0
VAQ H2_0, T_3, H2_0
REDUCE2(H0_0, H1_0, H2_0, M0, M3, M4, M5, T_9, H0_1, H1_1, H2_1, T_10)
// [H, m2] * [r**2, r]
EXPACC2(M2, H0_0, H1_0, H2_0, T_1, T_2, T_3)
CMPBNE R3, $16, 2(PC)
VLEIB $10, $1, H2_0
VZERO M0
VZERO M1
VZERO M2
VZERO M3
VZERO M4
VZERO M5
MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9)
REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, H0_1, H1_1, M5, T_10)
SUB $16, R3
CMPBLE R3, $0, next // this condition must always hold true!
b2:
CMPBLE R3, $16, b1
// 2 blocks remaining
// setup [r²,r]
VSLDB $8, R_0, R_0, R_0
VSLDB $8, R_1, R_1, R_1
VSLDB $8, R_2, R_2, R_2
VSLDB $8, R5_1, R5_1, R5_1
VSLDB $8, R5_2, R5_2, R5_2
VLVGG $1, RSAVE_0, R_0
VLVGG $1, RSAVE_1, R_1
VLVGG $1, RSAVE_2, R_2
VLVGG $1, R5SAVE_1, R5_1
VLVGG $1, R5SAVE_2, R5_2
// setup [h0, h1]
VSLDB $8, H0_0, H0_0, H0_0
VSLDB $8, H1_0, H1_0, H1_0
VSLDB $8, H2_0, H2_0, H2_0
VO H0_1, H0_0, H0_0
VO H1_1, H1_0, H1_0
VO H2_1, H2_0, H2_0
VZERO H0_1
VZERO H1_1
VZERO H2_1
VZERO M0
VZERO M1
VZERO M2
VZERO M3
VZERO M4
VZERO M5
// H*[r**2, r]
MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9)
REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M2, M3, M4, T_4, T_5, T_2, T_7, T_8, T_9)
VMRHG V0, H0_1, H0_0
VMRHG V0, H1_1, H1_0
VMRHG V0, H2_1, H2_0
VMRLG V0, H0_1, H0_1
VMRLG V0, H1_1, H1_1
VMRLG V0, H2_1, H2_1
// move h to the left and 0s at the right
VSLDB $8, H0_0, H0_0, H0_0
VSLDB $8, H1_0, H1_0, H1_0
VSLDB $8, H2_0, H2_0, H2_0
// get message blocks and append 1 to start
SUB $17, R3
VL (R2), M0
VLL R3, 16(R2), M1
ADD $1, R3
MOVBZ $1, R0
CMPBEQ R3, $16, 2(PC)
VLVGB R3, R0, M1
VZERO T_6
VZERO T_7
VZERO T_8
EXPACC2(M0, T_6, T_7, T_8, T_1, T_2, T_3)
EXPACC2(M1, T_6, T_7, T_8, T_1, T_2, T_3)
VLEIB $2, $1, T_8
CMPBNE R3, $16, 2(PC)
VLEIB $10, $1, T_8
// add [m0, m1] to h
VAG H0_0, T_6, H0_0
VAG H1_0, T_7, H1_0
VAG H2_0, T_8, H2_0
VZERO M2
VZERO M3
VZERO M4
VZERO M5
VZERO T_10
VZERO M0
// at this point R_0 .. R5_2 look like [r**2, r]
MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M2, M3, M4, M5, T_10, M0, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9)
REDUCE2(H0_0, H1_0, H2_0, M2, M3, M4, M5, T_9, H0_1, H1_1, H2_1, T_10)
SUB $16, R3, R3
CMPBLE R3, $0, next
b1:
CMPBLE R3, $0, next
// 1 block remaining
// setup [r²,r]
VSLDB $8, R_0, R_0, R_0
VSLDB $8, R_1, R_1, R_1
VSLDB $8, R_2, R_2, R_2
VSLDB $8, R5_1, R5_1, R5_1
VSLDB $8, R5_2, R5_2, R5_2
VLVGG $1, RSAVE_0, R_0
VLVGG $1, RSAVE_1, R_1
VLVGG $1, RSAVE_2, R_2
VLVGG $1, R5SAVE_1, R5_1
VLVGG $1, R5SAVE_2, R5_2
// setup [h0, h1]
VSLDB $8, H0_0, H0_0, H0_0
VSLDB $8, H1_0, H1_0, H1_0
VSLDB $8, H2_0, H2_0, H2_0
VO H0_1, H0_0, H0_0
VO H1_1, H1_0, H1_0
VO H2_1, H2_0, H2_0
VZERO H0_1
VZERO H1_1
VZERO H2_1
VZERO M0
VZERO M1
VZERO M2
VZERO M3
VZERO M4
VZERO M5
// H*[r**2, r]
MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9)
REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5)
// set up [0, m0] limbs
SUB $1, R3
VLL R3, (R2), M0
ADD $1, R3
MOVBZ $1, R0
CMPBEQ R3, $16, 2(PC)
VLVGB R3, R0, M0
VZERO T_1
VZERO T_2
VZERO T_3
EXPACC2(M0, T_1, T_2, T_3, T_4, T_5, T_6)// limbs: [0, m]
CMPBNE R3, $16, 2(PC)
VLEIB $10, $1, T_3
// h+m0
VAQ H0_0, T_1, H0_0
VAQ H1_0, T_2, H1_0
VAQ H2_0, T_3, H2_0
VZERO M0
VZERO M1
VZERO M2
VZERO M3
VZERO M4
VZERO M5
MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9)
REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5)
BR next
square:
// setup [r²,r]
VSLDB $8, R_0, R_0, R_0
VSLDB $8, R_1, R_1, R_1
VSLDB $8, R_2, R_2, R_2
VSLDB $8, R5_1, R5_1, R5_1
VSLDB $8, R5_2, R5_2, R5_2
VLVGG $1, RSAVE_0, R_0
VLVGG $1, RSAVE_1, R_1
VLVGG $1, RSAVE_2, R_2
VLVGG $1, R5SAVE_1, R5_1
VLVGG $1, R5SAVE_2, R5_2
// setup [h0, h1]
VSLDB $8, H0_0, H0_0, H0_0
VSLDB $8, H1_0, H1_0, H1_0
VSLDB $8, H2_0, H2_0, H2_0
VO H0_1, H0_0, H0_0
VO H1_1, H1_0, H1_0
VO H2_1, H2_0, H2_0
VZERO H0_1
VZERO H1_1
VZERO H2_1
VZERO M0
VZERO M1
VZERO M2
VZERO M3
VZERO M4
VZERO M5
// (h0*r**2) + (h1*r)
MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9)
REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5)
BR next
TEXT ·hasVMSLFacility(SB), NOSPLIT, $24-1
MOVD $x-24(SP), R1
XC $24, 0(R1), 0(R1) // clear the storage
MOVD $2, R0 // R0 is the number of double words stored -1
WORD $0xB2B01000 // STFLE 0(R1)
XOR R0, R0 // reset the value of R0
MOVBZ z-8(SP), R1
AND $0x01, R1
BEQ novmsl
vectorinstalled:
// check if the vector instruction has been enabled
VLEIB $0, $0xF, V16
VLGVB $0, V16, R1
CMPBNE R1, $0xF, novmsl
MOVB $1, ret+0(FP) // have vx
RET
novmsl:
MOVB $0, ret+0(FP) // no vx
RET
| {
"pile_set_name": "Github"
} |
"""
@generated
cargo-raze crate build file.
DO NOT EDIT! Replaced on runs of cargo-raze
"""
# buildifier: disable=load
load(
"@io_bazel_rules_rust//rust:rust.bzl",
"rust_binary",
"rust_library",
"rust_test",
)
# buildifier: disable=load
load("@bazel_skylib//lib:selects.bzl", "selects")
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//remote/non_cratesio/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
licenses([
"notice", # BSD-3-Clause from expression "BSD-3-Clause"
])
# Generated targets
# buildifier: leave-alone
rust_library(
name = "fuchsia_zircon_sys",
crate_type = "lib",
deps = [
],
srcs = glob(["**/*.rs"]),
crate_root = "src/lib.rs",
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
],
version = "0.3.3",
tags = [
"cargo-raze",
"manual",
],
crate_features = [
],
)
# Unsupported target "hello" with type "example" omitted
| {
"pile_set_name": "Github"
} |
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../../include/fpdfapi/fpdf_page.h"
#include "../../../include/fpdfapi/fpdf_module.h"
#include "../fpdf_page/pageint.h"
#include <limits.h>
CPDF_Document::CPDF_Document() : CPDF_IndirectObjects(NULL)
{
m_pRootDict = NULL;
m_pInfoDict = NULL;
m_bLinearized = FALSE;
m_dwFirstPageNo = 0;
m_dwFirstPageObjNum = 0;
m_pDocPage = CPDF_ModuleMgr::Get()->GetPageModule()->CreateDocData(this);
m_pDocRender = CPDF_ModuleMgr::Get()->GetRenderModule()->CreateDocData(this);
}
void CPDF_Document::CreateNewDoc()
{
ASSERT(m_pRootDict == NULL && m_pInfoDict == NULL);
m_pRootDict = FX_NEW CPDF_Dictionary;
m_pRootDict->SetAtName("Type", "Catalog");
int objnum = AddIndirectObject(m_pRootDict);
CPDF_Dictionary* pPages = FX_NEW CPDF_Dictionary;
pPages->SetAtName("Type", "Pages");
pPages->SetAtNumber("Count", 0);
pPages->SetAt("Kids", FX_NEW CPDF_Array);
objnum = AddIndirectObject(pPages);
m_pRootDict->SetAtReference("Pages", this, objnum);
m_pInfoDict = FX_NEW CPDF_Dictionary;
AddIndirectObject(m_pInfoDict);
}
static const FX_WCHAR g_FX_CP874Unicodes[128] = {
0x20AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x2026, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07,
0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F,
0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17,
0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F,
0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27,
0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F,
0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37,
0x0E38, 0x0E39, 0x0E3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0E3F,
0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47,
0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57,
0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0x0000, 0x0000, 0x0000, 0x0000,
};
static const FX_WCHAR g_FX_CP1250Unicodes[128] = {
0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021,
0x0000, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179,
0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
0x0000, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A,
0x00A0, 0x02C7, 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7,
0x00A8, 0x00A9, 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B,
0x00B0, 0x00B1, 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
0x00B8, 0x0105, 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C,
0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7,
0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E,
0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7,
0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF,
0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7,
0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F,
0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7,
0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9,
};
static const FX_WCHAR g_FX_CP1251Unicodes[128] = {
0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021,
0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F,
0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
0x0000, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F,
0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7,
0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407,
0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7,
0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457,
0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F,
};
static const FX_WCHAR g_FX_CP1253Unicodes[128] = {
0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
0x00A0, 0x0385, 0x0386, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
0x00A8, 0x00A9, 0x0000, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x00B5, 0x00B6, 0x00B7,
0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F,
0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7,
0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7,
0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7,
0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000,
};
static const FX_WCHAR g_FX_CP1254Unicodes[128] = {
0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000,
0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178,
0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF,
0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF,
};
static const FX_WCHAR g_FX_CP1255Unicodes[128] = {
0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
0x02C6, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
0x02DC, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AA, 0x00A5, 0x00A6, 0x00A7,
0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7,
0x05B8, 0x05B9, 0x0000, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF,
0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05F0, 0x05F1, 0x05F2, 0x05F3,
0x05F4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7,
0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7,
0x05E8, 0x05E9, 0x05EA, 0x0000, 0x0000, 0x200E, 0x200F, 0x0000,
};
static const FX_WCHAR g_FX_CP1256Unicodes[128] = {
0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688,
0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA,
0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
0x00A8, 0x00A9, 0x06BE, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
0x00B8, 0x00B9, 0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F,
0x06C1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00D7,
0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0641, 0x0642, 0x0643,
0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00E7,
0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF,
0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7,
0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2,
};
static const FX_WCHAR g_FX_CP1257Unicodes[128] = {
0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021,
0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x00A8, 0x02C7, 0x00B8,
0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x00AF, 0x02DB, 0x0000,
0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x0000, 0x00A6, 0x00A7,
0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6,
0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112,
0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B,
0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7,
0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF,
0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113,
0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C,
0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7,
0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x02D9,
};
typedef struct {
FX_BYTE m_Charset;
const FX_WCHAR* m_pUnicodes;
} FX_CharsetUnicodes;
const FX_CharsetUnicodes g_FX_CharsetUnicodes[] = {
{ FXFONT_THAI_CHARSET, g_FX_CP874Unicodes },
{ FXFONT_EASTEUROPE_CHARSET, g_FX_CP1250Unicodes },
{ FXFONT_RUSSIAN_CHARSET, g_FX_CP1251Unicodes },
{ FXFONT_GREEK_CHARSET, g_FX_CP1253Unicodes },
{ FXFONT_TURKISH_CHARSET, g_FX_CP1254Unicodes },
{ FXFONT_HEBREW_CHARSET, g_FX_CP1255Unicodes },
{ FXFONT_ARABIC_CHARSET, g_FX_CP1256Unicodes },
{ FXFONT_BALTIC_CHARSET, g_FX_CP1257Unicodes },
};
#if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_)
static void _InsertWidthArray(HDC hDC, int start, int end, CPDF_Array* pWidthArray)
{
int size = end - start + 1;
int* widths = FX_Alloc(int, size);
GetCharWidth(hDC, start, end, widths);
int i;
for (i = 1; i < size; i ++)
if (widths[i] != *widths) {
break;
}
if (i == size) {
int first = pWidthArray->GetInteger(pWidthArray->GetCount() - 1);
pWidthArray->AddInteger(first + size - 1);
pWidthArray->AddInteger(*widths);
} else {
CPDF_Array* pWidthArray1 = FX_NEW CPDF_Array;
pWidthArray->Add(pWidthArray1);
for (i = 0; i < size; i ++) {
pWidthArray1->AddInteger(widths[i]);
}
}
FX_Free(widths);
}
CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName)
{
LOGFONTA lfa;
FXSYS_memcpy32(&lfa, pLogFont, (char*)lfa.lfFaceName - (char*)&lfa);
CFX_ByteString face = CFX_ByteString::FromUnicode(pLogFont->lfFaceName);
if (face.GetLength() >= LF_FACESIZE) {
return NULL;
}
FXSYS_strcpy(lfa.lfFaceName, (FX_LPCSTR)face);
return AddWindowsFont(&lfa, bVert, bTranslateName);
}
extern CFX_ByteString _FPDF_GetNameFromTT(FX_LPCBYTE name_table, FX_DWORD name);
CFX_ByteString _FPDF_GetPSNameFromTT(HDC hDC)
{
CFX_ByteString result;
DWORD size = ::GetFontData(hDC, 'eman', 0, NULL, 0);
if (size != GDI_ERROR) {
LPBYTE buffer = FX_Alloc(BYTE, size);
::GetFontData(hDC, 'eman', 0, buffer, size);
result = _FPDF_GetNameFromTT(buffer, 6);
FX_Free(buffer);
}
return result;
}
CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName)
{
pLogFont->lfHeight = -1000;
pLogFont->lfWidth = 0;
HGDIOBJ hFont = CreateFontIndirectA(pLogFont);
HDC hDC = CreateCompatibleDC(NULL);
hFont = SelectObject(hDC, hFont);
int tm_size = GetOutlineTextMetrics(hDC, 0, NULL);
if (tm_size == 0) {
hFont = SelectObject(hDC, hFont);
DeleteObject(hFont);
DeleteDC(hDC);
return NULL;
}
LPBYTE tm_buf = FX_Alloc(BYTE, tm_size);
OUTLINETEXTMETRIC* ptm = (OUTLINETEXTMETRIC*)tm_buf;
GetOutlineTextMetrics(hDC, tm_size, ptm);
int flags = 0, italicangle, ascend, descend, capheight, bbox[4];
if (pLogFont->lfItalic) {
flags |= PDFFONT_ITALIC;
}
if ((pLogFont->lfPitchAndFamily & 3) == FIXED_PITCH) {
flags |= PDFFONT_FIXEDPITCH;
}
if ((pLogFont->lfPitchAndFamily & 0xf8) == FF_ROMAN) {
flags |= PDFFONT_SERIF;
}
if ((pLogFont->lfPitchAndFamily & 0xf8) == FF_SCRIPT) {
flags |= PDFFONT_SCRIPT;
}
FX_BOOL bCJK = pLogFont->lfCharSet == CHINESEBIG5_CHARSET || pLogFont->lfCharSet == GB2312_CHARSET ||
pLogFont->lfCharSet == HANGEUL_CHARSET || pLogFont->lfCharSet == SHIFTJIS_CHARSET;
CFX_ByteString basefont;
if (bTranslateName && bCJK) {
basefont = _FPDF_GetPSNameFromTT(hDC);
}
if (basefont.IsEmpty()) {
basefont = pLogFont->lfFaceName;
}
italicangle = ptm->otmItalicAngle / 10;
ascend = ptm->otmrcFontBox.top;
descend = ptm->otmrcFontBox.bottom;
capheight = ptm->otmsCapEmHeight;
bbox[0] = ptm->otmrcFontBox.left;
bbox[1] = ptm->otmrcFontBox.bottom;
bbox[2] = ptm->otmrcFontBox.right;
bbox[3] = ptm->otmrcFontBox.top;
FX_Free(tm_buf);
basefont.Replace(" ", "");
CPDF_Dictionary* pBaseDict = FX_NEW CPDF_Dictionary;
pBaseDict->SetAtName("Type", "Font");
CPDF_Dictionary* pFontDict = pBaseDict;
if (!bCJK) {
if (pLogFont->lfCharSet == ANSI_CHARSET || pLogFont->lfCharSet == DEFAULT_CHARSET ||
pLogFont->lfCharSet == SYMBOL_CHARSET) {
if (pLogFont->lfCharSet == SYMBOL_CHARSET) {
flags |= PDFFONT_SYMBOLIC;
} else {
flags |= PDFFONT_NONSYMBOLIC;
}
pBaseDict->SetAtName(FX_BSTRC("Encoding"), "WinAnsiEncoding");
} else {
flags |= PDFFONT_NONSYMBOLIC;
int i;
for (i = 0; i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes); i ++)
if (g_FX_CharsetUnicodes[i].m_Charset == pLogFont->lfCharSet) {
break;
}
if (i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes)) {
CPDF_Dictionary* pEncoding = FX_NEW CPDF_Dictionary;
pEncoding->SetAtName(FX_BSTRC("BaseEncoding"), "WinAnsiEncoding");
CPDF_Array* pArray = FX_NEW CPDF_Array;
pArray->AddInteger(128);
const FX_WCHAR* pUnicodes = g_FX_CharsetUnicodes[i].m_pUnicodes;
for (int j = 0; j < 128; j ++) {
CFX_ByteString name = PDF_AdobeNameFromUnicode(pUnicodes[j]);
if (name.IsEmpty()) {
pArray->AddName(FX_BSTRC(".notdef"));
} else {
pArray->AddName(name);
}
}
pEncoding->SetAt(FX_BSTRC("Differences"), pArray);
AddIndirectObject(pEncoding);
pBaseDict->SetAtReference(FX_BSTRC("Encoding"), this, pEncoding);
}
}
if (pLogFont->lfWeight > FW_MEDIUM && pLogFont->lfItalic) {
basefont += ",BoldItalic";
} else if (pLogFont->lfWeight > FW_MEDIUM) {
basefont += ",Bold";
} else if (pLogFont->lfItalic) {
basefont += ",Italic";
}
pBaseDict->SetAtName("Subtype", "TrueType");
pBaseDict->SetAtName("BaseFont", basefont);
pBaseDict->SetAtNumber("FirstChar", 32);
pBaseDict->SetAtNumber("LastChar", 255);
int char_widths[224];
GetCharWidth(hDC, 32, 255, char_widths);
CPDF_Array* pWidths = FX_NEW CPDF_Array;
for (int i = 0; i < 224; i ++) {
pWidths->AddInteger(char_widths[i]);
}
pBaseDict->SetAt("Widths", pWidths);
} else {
flags |= PDFFONT_NONSYMBOLIC;
pFontDict = FX_NEW CPDF_Dictionary;
CFX_ByteString cmap;
CFX_ByteString ordering;
int supplement;
CPDF_Array* pWidthArray = FX_NEW CPDF_Array;
switch (pLogFont->lfCharSet) {
case CHINESEBIG5_CHARSET:
cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H";
ordering = "CNS1";
supplement = 4;
pWidthArray->AddInteger(1);
_InsertWidthArray(hDC, 0x20, 0x7e, pWidthArray);
break;
case GB2312_CHARSET:
cmap = bVert ? "GBK-EUC-V" : "GBK-EUC-H";
ordering = "GB1", supplement = 2;
pWidthArray->AddInteger(7716);
_InsertWidthArray(hDC, 0x20, 0x20, pWidthArray);
pWidthArray->AddInteger(814);
_InsertWidthArray(hDC, 0x21, 0x7e, pWidthArray);
break;
case HANGEUL_CHARSET:
cmap = bVert ? "KSCms-UHC-V" : "KSCms-UHC-H";
ordering = "Korea1";
supplement = 2;
pWidthArray->AddInteger(1);
_InsertWidthArray(hDC, 0x20, 0x7e, pWidthArray);
break;
case SHIFTJIS_CHARSET:
cmap = bVert ? "90ms-RKSJ-V" : "90ms-RKSJ-H";
ordering = "Japan1";
supplement = 5;
pWidthArray->AddInteger(231);
_InsertWidthArray(hDC, 0x20, 0x7d, pWidthArray);
pWidthArray->AddInteger(326);
_InsertWidthArray(hDC, 0xa0, 0xa0, pWidthArray);
pWidthArray->AddInteger(327);
_InsertWidthArray(hDC, 0xa1, 0xdf, pWidthArray);
pWidthArray->AddInteger(631);
_InsertWidthArray(hDC, 0x7e, 0x7e, pWidthArray);
break;
}
pBaseDict->SetAtName("Subtype", "Type0");
pBaseDict->SetAtName("BaseFont", basefont);
pBaseDict->SetAtName("Encoding", cmap);
pFontDict->SetAt("W", pWidthArray);
pFontDict->SetAtName("Type", "Font");
pFontDict->SetAtName("Subtype", "CIDFontType2");
pFontDict->SetAtName("BaseFont", basefont);
CPDF_Dictionary* pCIDSysInfo = FX_NEW CPDF_Dictionary;
pCIDSysInfo->SetAtString("Registry", "Adobe");
pCIDSysInfo->SetAtString("Ordering", ordering);
pCIDSysInfo->SetAtInteger("Supplement", supplement);
pFontDict->SetAt("CIDSystemInfo", pCIDSysInfo);
CPDF_Array* pArray = FX_NEW CPDF_Array;
pBaseDict->SetAt("DescendantFonts", pArray);
AddIndirectObject(pFontDict);
pArray->AddReference(this, pFontDict);
}
AddIndirectObject(pBaseDict);
CPDF_Dictionary* pFontDesc = FX_NEW CPDF_Dictionary;
pFontDesc->SetAtName("Type", "FontDescriptor");
pFontDesc->SetAtName("FontName", basefont);
pFontDesc->SetAtInteger("Flags", flags);
CPDF_Array* pBBox = FX_NEW CPDF_Array;
for (int i = 0; i < 4; i ++) {
pBBox->AddInteger(bbox[i]);
}
pFontDesc->SetAt("FontBBox", pBBox);
pFontDesc->SetAtInteger("ItalicAngle", italicangle);
pFontDesc->SetAtInteger("Ascent", ascend);
pFontDesc->SetAtInteger("Descent", descend);
pFontDesc->SetAtInteger("CapHeight", capheight);
pFontDesc->SetAtInteger("StemV", pLogFont->lfWeight / 5);
AddIndirectObject(pFontDesc);
pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
hFont = SelectObject(hDC, hFont);
DeleteObject(hFont);
DeleteDC(hDC);
return LoadFont(pBaseDict);
}
#endif
#if (_FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_)
FX_UINT32 FX_GetLangHashCode( FX_LPCSTR pStr)
{
FXSYS_assert( pStr != NULL);
FX_INT32 iLength = FXSYS_strlen(pStr);
FX_LPCSTR pStrEnd = pStr + iLength;
FX_UINT32 uHashCode = 0;
while ( pStr < pStrEnd) {
uHashCode = 31 * uHashCode + tolower(*pStr++);
}
return uHashCode;
}
struct FX_LANG2CS {
FX_DWORD uLang;
int uCharset;
}*FX_LPLANG2CS;
static const FX_LANG2CS gs_FXLang2CharsetTable[] = {
{3109, 0},
{3121, 178},
{3129, 162},
{3139, 204},
{3141, 204},
{3166, 0},
{3184, 238},
{3197, 0},
{3201, 0},
{3239, 161},
{3241, 0},
{3246, 0},
{3247, 186},
{3248, 0},
{3259, 178},
{3267, 0},
{3273, 0},
{3276, 0},
{3301, 0},
{3310, 1},
{3325, 177},
{3329, 1},
{3338, 238},
{3341, 238},
{3345, 1},
{3355, 0},
{3370, 0},
{3371, 0},
{3383, 128},
{3424, 204},
{3427, 1},
{3428, 129},
{3436, 178},
{3464, 186},
{3466, 186},
{3486, 204},
{3487, 0},
{3493, 1},
{3494, 0},
{3508, 0},
{3518, 0},
{3520, 0},
{3569, 1},
{3580, 238},
{3588, 0},
{3645, 238},
{3651, 204},
{3672, 238},
{3673, 238},
{3678, 238},
{3679, 238},
{3683, 0},
{3684, 0},
{3693, 1},
{3697, 1},
{3700, 222},
{3710, 162},
{3734, 204},
{3741, 178},
{3749, 162},
{3763, 163},
{3886, 134},
{105943, 0},
{106375, 1},
{3923451837, 134},
{3923451838, 136},
};
static FX_WORD FX_GetCsFromLangCode(FX_UINT32 uCode)
{
FX_INT32 iStart = 0;
FX_INT32 iEnd = sizeof(gs_FXLang2CharsetTable) / sizeof(FX_LANG2CS) - 1;
while (iStart <= iEnd) {
FX_INT32 iMid = (iStart + iEnd) / 2;
const FX_LANG2CS &charset = gs_FXLang2CharsetTable[iMid];
if (uCode == charset.uLang) {
return charset.uCharset;
} else if (uCode < charset.uLang) {
iEnd = iMid - 1;
} else {
iStart = iMid + 1;
}
};
return 0;
}
static FX_WORD FX_GetCharsetFromLang(FX_LPCSTR pLang, FX_INT32 iLength)
{
FXSYS_assert(pLang);
if (iLength < 0) {
iLength = FXSYS_strlen(pLang);
}
FX_UINT32 uHash = FX_GetLangHashCode(pLang);
return FX_GetCsFromLangCode(uHash);
}
static void _CFString2CFXByteString(CFStringRef src, CFX_ByteString &dest)
{
SInt32 len = CFStringGetLength(src);
CFRange range = CFRangeMake(0, len);
CFIndex used = 0;
UInt8* pBuffer = (UInt8*)calloc(len+1, sizeof(UInt8));
CFStringGetBytes(src, range, kCFStringEncodingASCII, 0, false, pBuffer, len, &used);
dest = (FX_LPSTR)pBuffer;
free(pBuffer);
}
FX_BOOL IsHasCharSet(CFArrayRef languages, const CFX_DWordArray &charSets)
{
int iCount = charSets.GetSize();
for (int i = 0; i < CFArrayGetCount(languages); ++i) {
CFStringRef language = (CFStringRef)CFArrayGetValueAtIndex(languages, i);
FX_DWORD CharSet = FX_GetCharsetFromLang(CFStringGetCStringPtr(language, kCFStringEncodingMacRoman), -1);
for (int j = 0; j < iCount; ++j) {
if (CharSet == charSets[j]) {
return TRUE;
}
}
}
return FALSE;
}
void FX_GetCharWidth(CTFontRef font, UniChar start, UniChar end, int* width)
{
CGFloat size = CTFontGetSize(font);
for (; start <= end; ++start) {
CGGlyph pGlyph = 0;
CFIndex count = 1;
CTFontGetGlyphsForCharacters(font, &start, &pGlyph, count);
CGSize advances;
CTFontGetAdvancesForGlyphs(font, kCTFontDefaultOrientation, &pGlyph, &advances, 1);
*width = (int)(advances.width / size * 1000) ;
width++;
}
}
static void _InsertWidthArray(CTFontRef font, int start, int end, CPDF_Array* pWidthArray)
{
int size = end - start + 1;
int* widths = FX_Alloc(int, size);
FX_GetCharWidth(font, start, end, widths);
int i;
for (i = 1; i < size; i ++)
if (widths[i] != *widths) {
break;
}
if (i == size) {
int first = pWidthArray->GetInteger(pWidthArray->GetCount() - 1);
pWidthArray->AddInteger(first + size - 1);
pWidthArray->AddInteger(*widths);
} else {
CPDF_Array* pWidthArray1 = FX_NEW CPDF_Array;
pWidthArray->Add(pWidthArray1);
for (i = 0; i < size; i ++) {
pWidthArray1->AddInteger(widths[i]);
}
}
FX_Free(widths);
}
CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTranslateName)
{
CTFontRef font = (CTFontRef)pFont;
CTFontDescriptorRef descriptor = CTFontCopyFontDescriptor(font);
if (descriptor == NULL) {
return NULL;
}
CFX_ByteString basefont;
FX_BOOL bCJK = FALSE;
int flags = 0, italicangle = 0, ascend = 0, descend = 0, capheight = 0, bbox[4];
FXSYS_memset32(bbox, 0, sizeof(int) * 4);
CFArrayRef languages = (CFArrayRef)CTFontDescriptorCopyAttribute(descriptor, kCTFontLanguagesAttribute);
if (languages == NULL) {
CFRelease(descriptor);
return NULL;
}
CFX_DWordArray charSets;
charSets.Add(FXFONT_CHINESEBIG5_CHARSET);
charSets.Add(FXFONT_GB2312_CHARSET);
charSets.Add(FXFONT_HANGEUL_CHARSET);
charSets.Add(FXFONT_SHIFTJIS_CHARSET);
if (IsHasCharSet(languages, charSets)) {
bCJK = TRUE;
}
CFRelease(descriptor);
CFDictionaryRef traits = (CFDictionaryRef)CTFontCopyTraits(font);
if (traits == NULL) {
CFRelease(languages);
return NULL;
}
CFNumberRef sybolicTrait = (CFNumberRef)CFDictionaryGetValue(traits, kCTFontSymbolicTrait);
CTFontSymbolicTraits trait = 0;
CFNumberGetValue(sybolicTrait, kCFNumberSInt32Type, &trait);
if (trait & kCTFontItalicTrait) {
flags |= PDFFONT_ITALIC;
}
if (trait & kCTFontMonoSpaceTrait) {
flags |= PDFFONT_FIXEDPITCH;
}
if (trait & kCTFontModernSerifsClass) {
flags |= PDFFONT_SERIF;
}
if (trait & kCTFontScriptsClass) {
flags |= PDFFONT_SCRIPT;
}
CFNumberRef weightTrait = (CFNumberRef)CFDictionaryGetValue(traits, kCTFontWeightTrait);
Float32 weight = 0;
CFNumberGetValue(weightTrait, kCFNumberFloat32Type, &weight);
italicangle = CTFontGetSlantAngle(font);
ascend = CTFontGetAscent(font);
descend = CTFontGetDescent(font);
capheight = CTFontGetCapHeight(font);
CGRect box = CTFontGetBoundingBox(font);
bbox[0] = box.origin.x;
bbox[1] = box.origin.y;
bbox[2] = box.origin.x + box.size.width;
bbox[3] = box.origin.y + box.size.height;
if (bTranslateName && bCJK) {
CFStringRef postName = CTFontCopyPostScriptName(font);
_CFString2CFXByteString(postName, basefont);
CFRelease(postName);
}
if (basefont.IsEmpty()) {
CFStringRef fullName = CTFontCopyFullName(font);
_CFString2CFXByteString(fullName, basefont);
CFRelease(fullName);
}
basefont.Replace(" ", "");
CPDF_Dictionary* pFontDict = NULL;
CPDF_Dictionary* pBaseDict = FX_NEW CPDF_Dictionary;
pFontDict = pBaseDict;
if (!bCJK) {
charSets.RemoveAll();
charSets.Add(FXFONT_ANSI_CHARSET);
charSets.Add(FXFONT_DEFAULT_CHARSET);
charSets.Add(FXFONT_SYMBOL_CHARSET);
if (IsHasCharSet(languages, charSets)) {
charSets.RemoveAll();
charSets.Add(FXFONT_SYMBOL_CHARSET);
if (IsHasCharSet(languages, charSets)) {
flags |= PDFFONT_SYMBOLIC;
} else {
flags |= PDFFONT_NONSYMBOLIC;
}
pBaseDict->SetAtName(FX_BSTRC("Encoding"), "WinAnsiEncoding");
} else {
flags |= PDFFONT_NONSYMBOLIC;
int i;
for (i = 0; i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes); i ++) {
charSets.RemoveAll();
charSets.Add(g_FX_CharsetUnicodes[i].m_Charset);
if (IsHasCharSet(languages, charSets)) {
break;
}
}
if (i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes)) {
CPDF_Dictionary* pEncoding = FX_NEW CPDF_Dictionary;
pEncoding->SetAtName(FX_BSTRC("BaseEncoding"), "WinAnsiEncoding");
CPDF_Array* pArray = FX_NEW CPDF_Array;
pArray->AddInteger(128);
const FX_WCHAR* pUnicodes = g_FX_CharsetUnicodes[i].m_pUnicodes;
for (int j = 0; j < 128; j ++) {
CFX_ByteString name = PDF_AdobeNameFromUnicode(pUnicodes[j]);
if (name.IsEmpty()) {
pArray->AddName(FX_BSTRC(".notdef"));
} else {
pArray->AddName(name);
}
}
pEncoding->SetAt(FX_BSTRC("Differences"), pArray);
AddIndirectObject(pEncoding);
pBaseDict->SetAtReference(FX_BSTRC("Encoding"), this, pEncoding);
}
}
if (weight > 0.0 && trait & kCTFontItalicTrait) {
basefont += ",BoldItalic";
} else if (weight > 0.0) {
basefont += ",Bold";
} else if (trait & kCTFontItalicTrait) {
basefont += ",Italic";
}
pBaseDict->SetAtName("Subtype", "TrueType");
pBaseDict->SetAtName("BaseFont", basefont);
pBaseDict->SetAtNumber("FirstChar", 32);
pBaseDict->SetAtNumber("LastChar", 255);
int char_widths[224];
FX_GetCharWidth(font, 32, 255, char_widths);
CPDF_Array* pWidths = FX_NEW CPDF_Array;
for (int i = 0; i < 224; i ++) {
pWidths->AddInteger(char_widths[i]);
}
pBaseDict->SetAt("Widths", pWidths);
} else {
flags |= PDFFONT_NONSYMBOLIC;
CPDF_Array* pArray = NULL;
pFontDict = FX_NEW CPDF_Dictionary;
CFX_ByteString cmap;
CFX_ByteString ordering;
int supplement;
FX_BOOL bFound = FALSE;
CPDF_Array* pWidthArray = FX_NEW CPDF_Array;
charSets.RemoveAll();
charSets.Add(FXFONT_CHINESEBIG5_CHARSET);
if (IsHasCharSet(languages, charSets)) {
cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H";
ordering = "CNS1";
supplement = 4;
pWidthArray->AddInteger(1);
_InsertWidthArray(font, 0x20, 0x7e, pWidthArray);
bFound = TRUE;
}
charSets.RemoveAll();
charSets.Add(FXFONT_GB2312_CHARSET);
if (!bFound && IsHasCharSet(languages, charSets)) {
cmap = bVert ? "GBK-EUC-V" : "GBK-EUC-H";
ordering = "GB1", supplement = 2;
pWidthArray->AddInteger(7716);
_InsertWidthArray(font, 0x20, 0x20, pWidthArray);
pWidthArray->AddInteger(814);
_InsertWidthArray(font, 0x21, 0x7e, pWidthArray);
bFound = TRUE;
}
charSets.RemoveAll();
charSets.Add(FXFONT_HANGEUL_CHARSET);
if (!bFound && IsHasCharSet(languages, charSets)) {
cmap = bVert ? "KSCms-UHC-V" : "KSCms-UHC-H";
ordering = "Korea1";
supplement = 2;
pWidthArray->AddInteger(1);
_InsertWidthArray(font, 0x20, 0x7e, pWidthArray);
bFound = TRUE;
}
charSets.RemoveAll();
charSets.Add(FXFONT_SHIFTJIS_CHARSET);
if (!bFound && IsHasCharSet(languages, charSets)) {
cmap = bVert ? "90ms-RKSJ-V" : "90ms-RKSJ-H";
ordering = "Japan1";
supplement = 5;
pWidthArray->AddInteger(231);
_InsertWidthArray(font, 0x20, 0x7d, pWidthArray);
pWidthArray->AddInteger(326);
_InsertWidthArray(font, 0xa0, 0xa0, pWidthArray);
pWidthArray->AddInteger(327);
_InsertWidthArray(font, 0xa1, 0xdf, pWidthArray);
pWidthArray->AddInteger(631);
_InsertWidthArray(font, 0x7e, 0x7e, pWidthArray);
}
pBaseDict->SetAtName("Subtype", "Type0");
pBaseDict->SetAtName("BaseFont", basefont);
pBaseDict->SetAtName("Encoding", cmap);
pFontDict->SetAt("W", pWidthArray);
pFontDict->SetAtName("Type", "Font");
pFontDict->SetAtName("Subtype", "CIDFontType2");
pFontDict->SetAtName("BaseFont", basefont);
CPDF_Dictionary* pCIDSysInfo = FX_NEW CPDF_Dictionary;
pCIDSysInfo->SetAtString("Registry", "Adobe");
pCIDSysInfo->SetAtString("Ordering", ordering);
pCIDSysInfo->SetAtInteger("Supplement", supplement);
pFontDict->SetAt("CIDSystemInfo", pCIDSysInfo);
pArray = FX_NEW CPDF_Array;
pBaseDict->SetAt("DescendantFonts", pArray);
AddIndirectObject(pFontDict);
pArray->AddReference(this, pFontDict);
}
AddIndirectObject(pBaseDict);
CPDF_Dictionary* pFontDesc = FX_NEW CPDF_Dictionary;
pFontDesc->SetAtName("Type", "FontDescriptor");
pFontDesc->SetAtName("FontName", basefont);
pFontDesc->SetAtInteger("Flags", flags);
CPDF_Array* pBBox = FX_NEW CPDF_Array;
for (int i = 0; i < 4; i ++) {
pBBox->AddInteger(bbox[i]);
}
pFontDesc->SetAt("FontBBox", pBBox);
pFontDesc->SetAtInteger("ItalicAngle", italicangle);
pFontDesc->SetAtInteger("Ascent", ascend);
pFontDesc->SetAtInteger("Descent", descend);
pFontDesc->SetAtInteger("CapHeight", capheight);
CGFloat fStemV = 0;
int16_t min_width = SHRT_MAX;
static const UniChar stem_chars[] = {'i', 'I', '!', '1'};
const size_t count = sizeof(stem_chars) / sizeof(stem_chars[0]);
CGGlyph glyphs[count];
CGRect boundingRects[count];
if (CTFontGetGlyphsForCharacters(font, stem_chars, glyphs, count)) {
CTFontGetBoundingRectsForGlyphs(font, kCTFontHorizontalOrientation,
glyphs, boundingRects, count);
for (size_t i = 0; i < count; i++) {
int16_t width = boundingRects[i].size.width;
if (width > 0 && width < min_width) {
min_width = width;
fStemV = min_width;
}
}
}
pFontDesc->SetAtInteger("StemV", fStemV);
AddIndirectObject(pFontDesc);
pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
CFRelease(traits);
CFRelease(languages);
return LoadFont(pBaseDict);
}
#endif
static void _InsertWidthArray1(CFX_Font* pFont, IFX_FontEncoding* pEncoding, FX_WCHAR start, FX_WCHAR end, CPDF_Array* pWidthArray)
{
int size = end - start + 1;
int* widths = FX_Alloc(int, size);
int i;
for (i = 0; i < size; i ++) {
int glyph_index = pEncoding->GlyphFromCharCode(start + i);
widths[i] = pFont->GetGlyphWidth(glyph_index);
}
for (i = 1; i < size; i ++)
if (widths[i] != *widths) {
break;
}
if (i == size) {
int first = pWidthArray->GetInteger(pWidthArray->GetCount() - 1);
pWidthArray->AddInteger(first + size - 1);
pWidthArray->AddInteger(*widths);
} else {
CPDF_Array* pWidthArray1 = FX_NEW CPDF_Array;
pWidthArray->Add(pWidthArray1);
for (i = 0; i < size; i ++) {
pWidthArray1->AddInteger(widths[i]);
}
}
FX_Free(widths);
}
CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert)
{
if (pFont == NULL) {
return NULL;
}
FX_BOOL bCJK = charset == FXFONT_CHINESEBIG5_CHARSET || charset == FXFONT_GB2312_CHARSET ||
charset == FXFONT_HANGEUL_CHARSET || charset == FXFONT_SHIFTJIS_CHARSET;
CFX_ByteString basefont = pFont->GetFamilyName();
basefont.Replace(" ", "");
int flags = 0;
if (pFont->IsBold()) {
flags |= PDFFONT_FORCEBOLD;
}
if (pFont->IsItalic()) {
flags |= PDFFONT_ITALIC;
}
if (pFont->IsFixedWidth()) {
flags |= PDFFONT_FIXEDPITCH;
}
CPDF_Dictionary* pBaseDict = FX_NEW CPDF_Dictionary;
pBaseDict->SetAtName("Type", "Font");
IFX_FontEncoding* pEncoding = FXGE_CreateUnicodeEncoding(pFont);
CPDF_Dictionary* pFontDict = pBaseDict;
if (!bCJK) {
CPDF_Array* pWidths = FX_NEW CPDF_Array;
int charcode;
for (charcode = 32; charcode < 128; charcode ++) {
int glyph_index = pEncoding->GlyphFromCharCode(charcode);
int char_width = pFont->GetGlyphWidth(glyph_index);
pWidths->AddInteger(char_width);
}
if (charset == FXFONT_ANSI_CHARSET || charset == FXFONT_DEFAULT_CHARSET ||
charset == FXFONT_SYMBOL_CHARSET) {
if (charset == FXFONT_SYMBOL_CHARSET) {
flags |= PDFFONT_SYMBOLIC;
} else {
flags |= PDFFONT_NONSYMBOLIC;
}
pBaseDict->SetAtName(FX_BSTRC("Encoding"), "WinAnsiEncoding");
for (charcode = 128; charcode <= 255; charcode ++) {
int glyph_index = pEncoding->GlyphFromCharCode(charcode);
int char_width = pFont->GetGlyphWidth(glyph_index);
pWidths->AddInteger(char_width);
}
} else {
flags |= PDFFONT_NONSYMBOLIC;
int i;
for (i = 0; i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes); i ++)
if (g_FX_CharsetUnicodes[i].m_Charset == charset) {
break;
}
if (i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes)) {
CPDF_Dictionary* pEncodingDict = FX_NEW CPDF_Dictionary;
pEncodingDict->SetAtName(FX_BSTRC("BaseEncoding"), "WinAnsiEncoding");
CPDF_Array* pArray = FX_NEW CPDF_Array;
pArray->AddInteger(128);
const FX_WCHAR* pUnicodes = g_FX_CharsetUnicodes[i].m_pUnicodes;
for (int j = 0; j < 128; j ++) {
CFX_ByteString name = PDF_AdobeNameFromUnicode(pUnicodes[j]);
if (name.IsEmpty()) {
pArray->AddName(FX_BSTRC(".notdef"));
} else {
pArray->AddName(name);
}
int glyph_index = pEncoding->GlyphFromCharCode(pUnicodes[j]);
int char_width = pFont->GetGlyphWidth(glyph_index);
pWidths->AddInteger(char_width);
}
pEncodingDict->SetAt(FX_BSTRC("Differences"), pArray);
AddIndirectObject(pEncodingDict);
pBaseDict->SetAtReference(FX_BSTRC("Encoding"), this, pEncodingDict);
}
}
if (pFont->IsBold() && pFont->IsItalic()) {
basefont += ",BoldItalic";
} else if (pFont->IsBold()) {
basefont += ",Bold";
} else if (pFont->IsItalic()) {
basefont += ",Italic";
}
pBaseDict->SetAtName("Subtype", "TrueType");
pBaseDict->SetAtName("BaseFont", basefont);
pBaseDict->SetAtNumber("FirstChar", 32);
pBaseDict->SetAtNumber("LastChar", 255);
pBaseDict->SetAt("Widths", pWidths);
} else {
flags |= PDFFONT_NONSYMBOLIC;
pFontDict = FX_NEW CPDF_Dictionary;
CFX_ByteString cmap;
CFX_ByteString ordering;
int supplement;
CPDF_Array* pWidthArray = FX_NEW CPDF_Array;
switch (charset) {
case FXFONT_CHINESEBIG5_CHARSET:
cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H";
ordering = "CNS1";
supplement = 4;
pWidthArray->AddInteger(1);
_InsertWidthArray1(pFont, pEncoding, 0x20, 0x7e, pWidthArray);
break;
case FXFONT_GB2312_CHARSET:
cmap = bVert ? "GBK-EUC-V" : "GBK-EUC-H";
ordering = "GB1", supplement = 2;
pWidthArray->AddInteger(7716);
_InsertWidthArray1(pFont, pEncoding, 0x20, 0x20, pWidthArray);
pWidthArray->AddInteger(814);
_InsertWidthArray1(pFont, pEncoding, 0x21, 0x7e, pWidthArray);
break;
case FXFONT_HANGEUL_CHARSET:
cmap = bVert ? "KSCms-UHC-V" : "KSCms-UHC-H";
ordering = "Korea1";
supplement = 2;
pWidthArray->AddInteger(1);
_InsertWidthArray1(pFont, pEncoding, 0x20, 0x7e, pWidthArray);
break;
case FXFONT_SHIFTJIS_CHARSET:
cmap = bVert ? "90ms-RKSJ-V" : "90ms-RKSJ-H";
ordering = "Japan1";
supplement = 5;
pWidthArray->AddInteger(231);
_InsertWidthArray1(pFont, pEncoding, 0x20, 0x7d, pWidthArray);
pWidthArray->AddInteger(326);
_InsertWidthArray1(pFont, pEncoding, 0xa0, 0xa0, pWidthArray);
pWidthArray->AddInteger(327);
_InsertWidthArray1(pFont, pEncoding, 0xa1, 0xdf, pWidthArray);
pWidthArray->AddInteger(631);
_InsertWidthArray1(pFont, pEncoding, 0x7e, 0x7e, pWidthArray);
break;
}
pBaseDict->SetAtName("Subtype", "Type0");
pBaseDict->SetAtName("BaseFont", basefont);
pBaseDict->SetAtName("Encoding", cmap);
pFontDict->SetAt("W", pWidthArray);
pFontDict->SetAtName("Type", "Font");
pFontDict->SetAtName("Subtype", "CIDFontType2");
pFontDict->SetAtName("BaseFont", basefont);
CPDF_Dictionary* pCIDSysInfo = FX_NEW CPDF_Dictionary;
pCIDSysInfo->SetAtString("Registry", "Adobe");
pCIDSysInfo->SetAtString("Ordering", ordering);
pCIDSysInfo->SetAtInteger("Supplement", supplement);
pFontDict->SetAt("CIDSystemInfo", pCIDSysInfo);
CPDF_Array* pArray = FX_NEW CPDF_Array;
pBaseDict->SetAt("DescendantFonts", pArray);
AddIndirectObject(pFontDict);
pArray->AddReference(this, pFontDict);
}
AddIndirectObject(pBaseDict);
CPDF_Dictionary* pFontDesc = FX_NEW CPDF_Dictionary;
pFontDesc->SetAtName("Type", "FontDescriptor");
pFontDesc->SetAtName("FontName", basefont);
pFontDesc->SetAtInteger("Flags", flags);
pFontDesc->SetAtInteger("ItalicAngle", pFont->m_pSubstFont ? pFont->m_pSubstFont->m_ItalicAngle : 0);
pFontDesc->SetAtInteger("Ascent", pFont->GetAscent());
pFontDesc->SetAtInteger("Descent", pFont->GetDescent());
FX_RECT bbox;
pFont->GetBBox(bbox);
CPDF_Array* pBBox = FX_NEW CPDF_Array;
pBBox->AddInteger(bbox.left);
pBBox->AddInteger(bbox.bottom);
pBBox->AddInteger(bbox.right);
pBBox->AddInteger(bbox.top);
pFontDesc->SetAt("FontBBox", pBBox);
FX_INT32 nStemV = 0;
if (pFont->m_pSubstFont) {
nStemV = pFont->m_pSubstFont->m_Weight / 5;
} else {
static const FX_CHAR stem_chars[] = {'i', 'I', '!', '1'};
const size_t count = sizeof(stem_chars) / sizeof(stem_chars[0]);
FX_DWORD glyph = pEncoding->GlyphFromCharCode(stem_chars[0]);
nStemV = pFont->GetGlyphWidth(glyph);
for (size_t i = 1; i < count; i++) {
glyph = pEncoding->GlyphFromCharCode(stem_chars[i]);
int width = pFont->GetGlyphWidth(glyph);
if (width > 0 && width < nStemV) {
nStemV = width;
}
}
}
if (pEncoding) {
delete pEncoding;
}
pFontDesc->SetAtInteger("StemV", nStemV);
AddIndirectObject(pFontDesc);
pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
return LoadFont(pBaseDict);
}
static CPDF_Stream* GetFormStream(CPDF_Document* pDoc, CPDF_Object* pResObj)
{
if (pResObj->GetType() != PDFOBJ_REFERENCE) {
return NULL;
}
CPDF_Reference* pRef = (CPDF_Reference*)pResObj;
FX_BOOL bForm;
if (pDoc->IsFormStream(pRef->GetRefObjNum(), bForm) && !bForm) {
return NULL;
}
pResObj = pRef->GetDirect();
if (pResObj->GetType() != PDFOBJ_STREAM) {
return NULL;
}
CPDF_Stream* pXObject = (CPDF_Stream*)pResObj;
if (pXObject->GetDict()->GetString(FX_BSTRC("Subtype")) != FX_BSTRC("Form")) {
return NULL;
}
return pXObject;
}
static int InsertDeletePDFPage(CPDF_Document* pDoc, CPDF_Dictionary* pPages,
int nPagesToGo, CPDF_Dictionary* pPage, FX_BOOL bInsert, CFX_PtrArray& stackList)
{
CPDF_Array* pKidList = pPages->GetArray("Kids");
if (!pKidList) {
return -1;
}
int nKids = pKidList->GetCount();
for (int i = 0; i < nKids; i ++) {
CPDF_Dictionary* pKid = pKidList->GetDict(i);
if (pKid->GetString("Type") == FX_BSTRC("Page")) {
if (nPagesToGo == 0) {
if (bInsert) {
pKidList->InsertAt(i, CPDF_Reference::Create(pDoc, pPage->GetObjNum()));
pPage->SetAtReference("Parent", pDoc, pPages->GetObjNum());
} else {
pKidList->RemoveAt(i);
}
pPages->SetAtInteger("Count", pPages->GetInteger("Count") + (bInsert ? 1 : -1));
return 1;
}
nPagesToGo --;
} else {
int nPages = pKid->GetInteger("Count");
if (nPagesToGo < nPages) {
int stackCount = stackList.GetSize();
for (int j = 0; j < stackCount; ++j) {
if (pKid == stackList[j]) {
return -1;
}
}
stackList.Add(pKid);
if (InsertDeletePDFPage(pDoc, pKid, nPagesToGo, pPage, bInsert, stackList) < 0) {
return -1;
}
stackList.RemoveAt(stackCount);
pPages->SetAtInteger("Count", pPages->GetInteger("Count") + (bInsert ? 1 : -1));
return 1;
}
nPagesToGo -= nPages;
}
}
return 0;
}
static int InsertNewPage(CPDF_Document* pDoc, int iPage, CPDF_Dictionary* pPageDict, CFX_DWordArray &pageList)
{
CPDF_Dictionary* pRoot = pDoc->GetRoot();
if (!pRoot) {
return -1;
}
CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
if (!pPages) {
return -1;
}
int nPages = pDoc->GetPageCount();
if (iPage < 0 || iPage > nPages) {
return -1;
}
if (iPage == nPages) {
CPDF_Array* pPagesList = pPages->GetArray(FX_BSTRC("Kids"));
if (!pPagesList) {
pPagesList = FX_NEW CPDF_Array;
pPages->SetAt(FX_BSTRC("Kids"), pPagesList);
}
pPagesList->Add(pPageDict, pDoc);
pPages->SetAtInteger(FX_BSTRC("Count"), nPages + 1);
pPageDict->SetAtReference(FX_BSTRC("Parent"), pDoc, pPages->GetObjNum());
} else {
CFX_PtrArray stack;
stack.Add(pPages);
if (InsertDeletePDFPage(pDoc, pPages, iPage, pPageDict, TRUE, stack) < 0) {
return -1;
}
}
pageList.InsertAt(iPage, pPageDict->GetObjNum());
return iPage;
}
CPDF_Dictionary* CPDF_Document::CreateNewPage(int iPage)
{
CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
pDict->SetAtName("Type", "Page");
FX_DWORD dwObjNum = AddIndirectObject(pDict);
if (InsertNewPage(this, iPage, pDict, m_PageList) < 0) {
ReleaseIndirectObject(dwObjNum);
return NULL;
}
return pDict;
}
int _PDF_GetStandardFontName(CFX_ByteString& name);
CPDF_Font* CPDF_Document::AddStandardFont(FX_LPCSTR font, CPDF_FontEncoding* pEncoding)
{
CFX_ByteString name(font, -1);
if (_PDF_GetStandardFontName(name) < 0) {
return NULL;
}
return GetPageData()->GetStandardFont(name, pEncoding);
}
void CPDF_Document::DeletePage(int iPage)
{
CPDF_Dictionary* pRoot = GetRoot();
if (pRoot == NULL) {
return;
}
CPDF_Dictionary* pPages = pRoot->GetDict("Pages");
if (pPages == NULL) {
return;
}
int nPages = pPages->GetInteger("Count");
if (iPage < 0 || iPage >= nPages) {
return;
}
CFX_PtrArray stack;
stack.Add(pPages);
if (InsertDeletePDFPage(this, pPages, iPage, NULL, FALSE, stack) < 0) {
return;
}
m_PageList.RemoveAt(iPage);
}
CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name);
void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name)
{
if (pPageDict->KeyExist(name)) {
return;
}
CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name);
if (pObj) {
pPageDict->SetAt(name, pObj->Clone());
}
}
| {
"pile_set_name": "Github"
} |
There is a ppro flag in cast-586 which turns on/off
generation of pentium pro/II friendly code
This flag makes the inner loop one cycle longer, but generates
code that runs %30 faster on the pentium pro/II, while only %7 slower
on the pentium. By default, this flag is on.
| {
"pile_set_name": "Github"
} |
<?php declare(strict_types = 1);
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
class ParamTagValueNode implements PhpDocTagValueNode
{
/** @var TypeNode */
public $type;
/** @var bool */
public $isVariadic;
/** @var string */
public $parameterName;
/** @var string (may be empty) */
public $description;
public function __construct(TypeNode $type, bool $isVariadic, string $parameterName, string $description)
{
$this->type = $type;
$this->isVariadic = $isVariadic;
$this->parameterName = $parameterName;
$this->description = $description;
}
public function __toString(): string
{
$variadic = $this->isVariadic ? '...' : '';
return trim("{$this->type} {$variadic}{$this->parameterName} {$this->description}");
}
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayCommerceTransportOfflinepayUserblacklistQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayCommerceTransportOfflinepayUserblacklistQueryResponse, self).__init__()
self._black_list = None
@property
def black_list(self):
return self._black_list
@black_list.setter
def black_list(self, value):
if isinstance(value, list):
self._black_list = list()
for i in value:
self._black_list.append(i)
def parse_response_content(self, response_content):
response = super(AlipayCommerceTransportOfflinepayUserblacklistQueryResponse, self).parse_response_content(response_content)
if 'black_list' in response:
self.black_list = response['black_list']
| {
"pile_set_name": "Github"
} |
from rlpyt.utils.launching.affinity import encode_affinity
from rlpyt.utils.launching.exp_launcher import run_experiments
from rlpyt.utils.launching.variant import make_variants, VariantLevel
script = "rlpyt/experiments/scripts/atari/dqn/train/atari_r2d1_async_alt.py"
affinity_code = encode_affinity(
n_cpu_core=24,
n_gpu=4,
async_sample=True,
gpu_per_run=1,
sample_gpu_per_run=2,
# hyperthread_offset=24,
# optim_sample_share_gpu=True,
n_socket=1, # Force this.
alternating=True,
)
runs_per_setting = 1
experiment_title = "atari_r2d1_async_alt"
variant_levels = list()
games = ["gravitar"]
values = list(zip(games))
dir_names = ["{}".format(*v) for v in values]
keys = [("env", "game")]
variant_levels.append(VariantLevel(keys, values, dir_names))
variants, log_dirs = make_variants(*variant_levels)
default_config_key = "async_alt_pabti"
run_experiments(
script=script,
affinity_code=affinity_code,
experiment_title=experiment_title,
runs_per_setting=runs_per_setting,
variants=variants,
log_dirs=log_dirs,
common_args=(default_config_key,),
)
| {
"pile_set_name": "Github"
} |
FUTURE
StringBuilderCapLen03
--max-nondet-string-length 1000
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
--
^warning: ignoring
| {
"pile_set_name": "Github"
} |
@model AddPhoneNumberViewModel
@{
ViewData["Title"] = "Add Phone Number";
}
<h2>@ViewData["Title"].</h2>
<form asp-controller="Manage" asp-action="AddPhoneNumber" method="post" class="form-horizontal" role="form">
<h4>Add a phone number.</h4>
<hr />
<div asp-validation-summary="ValidationSummary.All" class="text-danger"></div>
<div class="form-group">
<label asp-for="PhoneNumber" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="PhoneNumber" class="form-control" />
<span asp-validation-for="PhoneNumber" class="text-danger"></span>
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<button type="submit" class="btn btn-default">Send verification code</button>
</div>
</div>
</form>
@section Scripts {
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
}
| {
"pile_set_name": "Github"
} |
angular.module('Bastion.routing', ['ui.router', 'ui.router.state.events']);
(function () {
'use strict';
/**
* @ngdoc config
* @name Bastion.routing.config
*
* @requires $urlRouterProvider
* @requires $locationProvider
*
* @description
* Routing configuration for Bastion.
*/
function bastionRouting($stateProvider, $urlRouterProvider, $locationProvider) {
var oldBrowserBastionPath = '/bastion#', getRootPath, shouldRemoveTrailingSlash;
getRootPath = function (path) {
var rootPath = null;
if (path && angular.isString(path)) {
rootPath = path.replace('_', '-').split('/')[1];
}
return rootPath;
};
shouldRemoveTrailingSlash = function (path) {
var whiteList = ['pulp'], remove = true;
if (path.split('/')[1] && whiteList.indexOf(path.split('/')[1]) >= 0) {
remove = false;
}
return remove;
};
$stateProvider.state('404', {
permission: null,
templateUrl: 'layouts/404.html'
});
$urlRouterProvider.rule(function ($injector, $location) {
var $sniffer = $injector.get('$sniffer'),
$window = $injector.get('$window'),
path = $location.path();
if (!$sniffer.history) {
$window.location.href = oldBrowserBastionPath + $location.path();
}
// removing trailing slash to prevent endless redirect if not in ignore list
if (path[path.length - 1] === '/' && shouldRemoveTrailingSlash(path)) {
return path.slice(0, -1);
}
});
$urlRouterProvider.otherwise(function ($injector, $location) {
var $window = $injector.get('$window'),
$state = $injector.get('$state'),
rootPath = getRootPath($location.path()),
url = $location.url(),
foundParentState;
// ensure we don't double encode +s
url = url.replace(/%2B/g, "+");
// Remove the old browser path if present
url = url.replace(oldBrowserBastionPath, '');
if (rootPath) {
foundParentState = _.find($state.get(), function (state) {
var found = false,
stateUrl = $state.href(state);
if (stateUrl) {
found = getRootPath(stateUrl) === rootPath;
}
return found;
});
}
if (foundParentState) {
$state.go('404');
} else {
$window.location.href = url;
}
return $location.url();
});
$locationProvider.html5Mode({enabled: true, requireBase: false});
}
angular.module('Bastion.routing').config(bastionRouting);
bastionRouting.$inject = ['$stateProvider', '$urlRouterProvider', '$locationProvider'];
})();
| {
"pile_set_name": "Github"
} |
<!-- Place the following snippet at the bottom of the deck container. -->
<div aria-role="navigation">
<a href="#" class="deck-prev-link" title="Previous">←</a>
<a href="#" class="deck-next-link" title="Next">→</a>
</div>
| {
"pile_set_name": "Github"
} |
{
"enabled": 1,
"hidden": true,
"description": "Jobsets",
"nixexprinput": "src",
"nixexprpath": "jobsets.nix",
"checkinterval": 300,
"schedulingshares": 100,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"src": {
"type": "git",
"value": "https://github.com/haskell-nix/hnix.git master 1",
"emailresponsible": false
},
"nixpkgs": {
"type": "git",
"value": "https://github.com/NixOS/nixpkgs-channels nixos-unstable",
"emailresponsible": false
},
"prs": {
"type": "githubpulls",
"value": "haskell-nix hnix",
"emailresponsible": false
}
}
}
| {
"pile_set_name": "Github"
} |
# Version 1.5.0beta2: Sandboxed, Hardened & Notarized
<span style="font-weight: bold; color: red;">Please disable <em>Start at login</em> in <em>Preferences</em> before you update. You can also check <a target="_blank" href="https://github.com/newmarcel/KeepingYouAwake/wiki/1.5:-Start-at-Login-Problems">this wiki page</a> for troubleshooting help.</span>
- added an _Updates_ tab to preferences ([#107](https://github.com/newmarcel/KeepingYouAwake/pull/107))
- enabled the _Hardened Runtime_ security feature ([#111](https://github.com/newmarcel/KeepingYouAwake/pull/111))
- enabled the _App Sandbox_ security feature ([#112](https://github.com/newmarcel/KeepingYouAwake/pull/112))
- custom icons need to be placed in `~/Library/Containers/info.marcel-dierkes.KeepingYouAwake/Data/Documents` now and will be migrated during the app update
- _Start at login_ uses a launcher helper app now ([#110](https://github.com/newmarcel/KeepingYouAwake/pull/110))
- the previous login item is not compatible anymore and **it is recommended to disable _Start at login_ before updating**!
- please check [this wiki page](https://github.com/newmarcel/KeepingYouAwake/wiki/1.5:-Start-at-Login-Problems) if you encounter problems
- updated Sparkle to the `ui-separation-and-xpc` version ([#109](https://github.com/newmarcel/KeepingYouAwake/pull/109)) ([#113](https://github.com/newmarcel/KeepingYouAwake/pull/113))
**Beta 2 fixes a bug that prevents 1.5.0 Beta 1 from downloading updates. Please manually re-download Beta 2 from GitHub if you experience any issues.**
| {
"pile_set_name": "Github"
} |
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
6435A457251C89F400A6167A /* ModifyRecordsOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6435A456251C89F400A6167A /* ModifyRecordsOperation.swift */; };
648D93E522CBEF4D00C01529 /* FetchDatabaseChangesOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93E222CBEF4D00C01529 /* FetchDatabaseChangesOperation.swift */; };
648D93E622CBEF4D00C01529 /* FetchZoneChangesOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93E322CBEF4D00C01529 /* FetchZoneChangesOperation.swift */; };
648D93E722CBEF4D00C01529 /* CloudKitSynchronizerOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93E422CBEF4D00C01529 /* CloudKitSynchronizerOperation.swift */; };
648D93F522CBEF5600C01529 /* QSCoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93E822CBEF5600C01529 /* QSCoder.swift */; };
648D93F622CBEF5600C01529 /* CloudKitSynchronizer+Private.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93E922CBEF5600C01529 /* CloudKitSynchronizer+Private.swift */; };
648D93F722CBEF5600C01529 /* SyncedEntityState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93EA22CBEF5600C01529 /* SyncedEntityState.swift */; };
648D93F822CBEF5600C01529 /* CloudKitSynchronizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93EB22CBEF5600C01529 /* CloudKitSynchronizer.swift */; };
648D93F922CBEF5600C01529 /* PrimaryKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93EC22CBEF5600C01529 /* PrimaryKey.swift */; };
648D93FA22CBEF5600C01529 /* CloudKitSynchronizer+Sharing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93ED22CBEF5600C01529 /* CloudKitSynchronizer+Sharing.swift */; };
648D93FB22CBEF5600C01529 /* CloudKitSynchronizer+Subscriptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93EE22CBEF5600C01529 /* CloudKitSynchronizer+Subscriptions.swift */; };
648D93FC22CBEF5600C01529 /* BackupDetection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93EF22CBEF5600C01529 /* BackupDetection.swift */; };
648D93FD22CBEF5600C01529 /* CloudKitDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93F022CBEF5600C01529 /* CloudKitDatabase.swift */; };
648D93FE22CBEF5600C01529 /* TempFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93F122CBEF5600C01529 /* TempFileManager.swift */; };
648D93FF22CBEF5600C01529 /* KeyValueStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93F222CBEF5600C01529 /* KeyValueStore.swift */; };
648D940022CBEF5600C01529 /* CloudKitSynchronizer+Sync.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93F322CBEF5600C01529 /* CloudKitSynchronizer+Sync.swift */; };
648D940122CBEF5600C01529 /* ModelAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648D93F422CBEF5600C01529 /* ModelAdapter.swift */; };
649236E722C7C1430074A142 /* CloudKitSynchronizer+CoreData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B3FF22C006CF00EAC16C /* CloudKitSynchronizer+CoreData.swift */; };
649236E822C7C1430074A142 /* CoreDataAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B41622C006D100EAC16C /* CoreDataAdapter.swift */; };
649236E922C7C1430074A142 /* CoreDataAdapter+ModelAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40922C006D000EAC16C /* CoreDataAdapter+ModelAdapter.swift */; };
649236EA22C7C1430074A142 /* CoreDataAdapter+Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40022C006D000EAC16C /* CoreDataAdapter+Notifications.swift */; };
649236EB22C7C1430074A142 /* CoreDataAdapter+Private.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40122C006D000EAC16C /* CoreDataAdapter+Private.swift */; };
649236EC22C7C1430074A142 /* CoreDataMultiFetchedResultsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B41222C006D100EAC16C /* CoreDataMultiFetchedResultsController.swift */; };
649236ED22C7C1430074A142 /* CoreDataStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40622C006D000EAC16C /* CoreDataStack.swift */; };
649236EE22C7C1430074A142 /* DefaultCoreDataAdapterDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B41322C006D100EAC16C /* DefaultCoreDataAdapterDelegate.swift */; };
649236EF22C7C1430074A142 /* DefaultCoreDataAdapterProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40822C006D000EAC16C /* DefaultCoreDataAdapterProvider.swift */; };
649236F022C7C1430074A142 /* DefaultCoreDataStackProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B41422C006D100EAC16C /* DefaultCoreDataStackProvider.swift */; };
649236F122C7C1430074A142 /* NSManagedObjectContext+Fetch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B41522C006D100EAC16C /* NSManagedObjectContext+Fetch.swift */; };
649236F222C7C1460074A142 /* QSManagedObjectContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40722C006D000EAC16C /* QSManagedObjectContext.swift */; };
649236F322C7C1460074A142 /* QSPendingRelationship+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40222C006D000EAC16C /* QSPendingRelationship+CoreDataClass.swift */; };
649236F422C7C1460074A142 /* QSPendingRelationship+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40D22C006D000EAC16C /* QSPendingRelationship+CoreDataProperties.swift */; };
649236F522C7C1460074A142 /* QSRecord+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40B22C006D000EAC16C /* QSRecord+CoreDataClass.swift */; };
649236F622C7C1460074A142 /* QSRecord+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40322C006D000EAC16C /* QSRecord+CoreDataProperties.swift */; };
649236F722C7C1460074A142 /* QSServerToken+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40422C006D000EAC16C /* QSServerToken+CoreDataClass.swift */; };
649236F822C7C1460074A142 /* QSServerToken+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40A22C006D000EAC16C /* QSServerToken+CoreDataProperties.swift */; };
649236F922C7C1460074A142 /* QSSyncedEntity+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40522C006D000EAC16C /* QSSyncedEntity+CoreDataClass.swift */; };
649236FA22C7C1460074A142 /* QSSyncedEntity+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40C22C006D000EAC16C /* QSSyncedEntity+CoreDataProperties.swift */; };
649236FB22C7C14D0074A142 /* QSCloudKitSyncModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 6433B40E22C006D100EAC16C /* QSCloudKitSyncModel.xcdatamodeld */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
6433B37F22C001D200EAC16C /* SyncKitCoreDataOSX.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SyncKitCoreDataOSX.h; sourceTree = "<group>"; };
6433B38022C001D200EAC16C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6433B3FF22C006CF00EAC16C /* CloudKitSynchronizer+CoreData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CloudKitSynchronizer+CoreData.swift"; path = "../../../../../SyncKit/Classes/CoreData/CloudKitSynchronizer+CoreData.swift"; sourceTree = "<group>"; };
6433B40022C006D000EAC16C /* CoreDataAdapter+Notifications.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CoreDataAdapter+Notifications.swift"; path = "../../../../../SyncKit/Classes/CoreData/CoreDataAdapter+Notifications.swift"; sourceTree = "<group>"; };
6433B40122C006D000EAC16C /* CoreDataAdapter+Private.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CoreDataAdapter+Private.swift"; path = "../../../../../SyncKit/Classes/CoreData/CoreDataAdapter+Private.swift"; sourceTree = "<group>"; };
6433B40222C006D000EAC16C /* QSPendingRelationship+CoreDataClass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "QSPendingRelationship+CoreDataClass.swift"; path = "../../../../../SyncKit/Classes/CoreData/QSPendingRelationship+CoreDataClass.swift"; sourceTree = "<group>"; };
6433B40322C006D000EAC16C /* QSRecord+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "QSRecord+CoreDataProperties.swift"; path = "../../../../../SyncKit/Classes/CoreData/QSRecord+CoreDataProperties.swift"; sourceTree = "<group>"; };
6433B40422C006D000EAC16C /* QSServerToken+CoreDataClass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "QSServerToken+CoreDataClass.swift"; path = "../../../../../SyncKit/Classes/CoreData/QSServerToken+CoreDataClass.swift"; sourceTree = "<group>"; };
6433B40522C006D000EAC16C /* QSSyncedEntity+CoreDataClass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "QSSyncedEntity+CoreDataClass.swift"; path = "../../../../../SyncKit/Classes/CoreData/QSSyncedEntity+CoreDataClass.swift"; sourceTree = "<group>"; };
6433B40622C006D000EAC16C /* CoreDataStack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CoreDataStack.swift; path = ../../../../../SyncKit/Classes/CoreData/CoreDataStack.swift; sourceTree = "<group>"; };
6433B40722C006D000EAC16C /* QSManagedObjectContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = QSManagedObjectContext.swift; path = ../../../../../SyncKit/Classes/CoreData/QSManagedObjectContext.swift; sourceTree = "<group>"; };
6433B40822C006D000EAC16C /* DefaultCoreDataAdapterProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DefaultCoreDataAdapterProvider.swift; path = ../../../../../SyncKit/Classes/CoreData/DefaultCoreDataAdapterProvider.swift; sourceTree = "<group>"; };
6433B40922C006D000EAC16C /* CoreDataAdapter+ModelAdapter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CoreDataAdapter+ModelAdapter.swift"; path = "../../../../../SyncKit/Classes/CoreData/CoreDataAdapter+ModelAdapter.swift"; sourceTree = "<group>"; };
6433B40A22C006D000EAC16C /* QSServerToken+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "QSServerToken+CoreDataProperties.swift"; path = "../../../../../SyncKit/Classes/CoreData/QSServerToken+CoreDataProperties.swift"; sourceTree = "<group>"; };
6433B40B22C006D000EAC16C /* QSRecord+CoreDataClass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "QSRecord+CoreDataClass.swift"; path = "../../../../../SyncKit/Classes/CoreData/QSRecord+CoreDataClass.swift"; sourceTree = "<group>"; };
6433B40C22C006D000EAC16C /* QSSyncedEntity+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "QSSyncedEntity+CoreDataProperties.swift"; path = "../../../../../SyncKit/Classes/CoreData/QSSyncedEntity+CoreDataProperties.swift"; sourceTree = "<group>"; };
6433B40D22C006D000EAC16C /* QSPendingRelationship+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "QSPendingRelationship+CoreDataProperties.swift"; path = "../../../../../SyncKit/Classes/CoreData/QSPendingRelationship+CoreDataProperties.swift"; sourceTree = "<group>"; };
6433B40F22C006D100EAC16C /* QSCloudKitSyncModel 2.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "QSCloudKitSyncModel 2.xcdatamodel"; sourceTree = "<group>"; };
6433B41022C006D100EAC16C /* QSCloudKitSyncModel.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = QSCloudKitSyncModel.xcdatamodel; sourceTree = "<group>"; };
6433B41122C006D100EAC16C /* QSCloudKitSyncModel 3.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "QSCloudKitSyncModel 3.xcdatamodel"; sourceTree = "<group>"; };
6433B41222C006D100EAC16C /* CoreDataMultiFetchedResultsController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CoreDataMultiFetchedResultsController.swift; path = ../../../../../SyncKit/Classes/CoreData/CoreDataMultiFetchedResultsController.swift; sourceTree = "<group>"; };
6433B41322C006D100EAC16C /* DefaultCoreDataAdapterDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DefaultCoreDataAdapterDelegate.swift; path = ../../../../../SyncKit/Classes/CoreData/DefaultCoreDataAdapterDelegate.swift; sourceTree = "<group>"; };
6433B41422C006D100EAC16C /* DefaultCoreDataStackProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DefaultCoreDataStackProvider.swift; path = ../../../../../SyncKit/Classes/CoreData/DefaultCoreDataStackProvider.swift; sourceTree = "<group>"; };
6433B41522C006D100EAC16C /* NSManagedObjectContext+Fetch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "NSManagedObjectContext+Fetch.swift"; path = "../../../../../SyncKit/Classes/CoreData/NSManagedObjectContext+Fetch.swift"; sourceTree = "<group>"; };
6433B41622C006D100EAC16C /* CoreDataAdapter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CoreDataAdapter.swift; path = ../../../../../SyncKit/Classes/CoreData/CoreDataAdapter.swift; sourceTree = "<group>"; };
6435A456251C89F400A6167A /* ModifyRecordsOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ModifyRecordsOperation.swift; path = ../../../../../SyncKit/Classes/QSSynchronizer/Operations/ModifyRecordsOperation.swift; sourceTree = "<group>"; };
648D93E222CBEF4D00C01529 /* FetchDatabaseChangesOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FetchDatabaseChangesOperation.swift; path = ../../../../../SyncKit/Classes/QSSynchronizer/Operations/FetchDatabaseChangesOperation.swift; sourceTree = "<group>"; };
648D93E322CBEF4D00C01529 /* FetchZoneChangesOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FetchZoneChangesOperation.swift; path = ../../../../../SyncKit/Classes/QSSynchronizer/Operations/FetchZoneChangesOperation.swift; sourceTree = "<group>"; };
648D93E422CBEF4D00C01529 /* CloudKitSynchronizerOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CloudKitSynchronizerOperation.swift; path = ../../../../../SyncKit/Classes/QSSynchronizer/Operations/CloudKitSynchronizerOperation.swift; sourceTree = "<group>"; };
648D93E822CBEF5600C01529 /* QSCoder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = QSCoder.swift; path = ../../../../../SyncKit/Classes/QSSynchronizer/QSCoder.swift; sourceTree = "<group>"; };
648D93E922CBEF5600C01529 /* CloudKitSynchronizer+Private.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CloudKitSynchronizer+Private.swift"; path = "../../../../../SyncKit/Classes/QSSynchronizer/CloudKitSynchronizer+Private.swift"; sourceTree = "<group>"; };
648D93EA22CBEF5600C01529 /* SyncedEntityState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SyncedEntityState.swift; path = ../../../../../SyncKit/Classes/QSSynchronizer/SyncedEntityState.swift; sourceTree = "<group>"; };
648D93EB22CBEF5600C01529 /* CloudKitSynchronizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CloudKitSynchronizer.swift; path = ../../../../../SyncKit/Classes/QSSynchronizer/CloudKitSynchronizer.swift; sourceTree = "<group>"; };
648D93EC22CBEF5600C01529 /* PrimaryKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PrimaryKey.swift; path = ../../../../../SyncKit/Classes/QSSynchronizer/PrimaryKey.swift; sourceTree = "<group>"; };
648D93ED22CBEF5600C01529 /* CloudKitSynchronizer+Sharing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CloudKitSynchronizer+Sharing.swift"; path = "../../../../../SyncKit/Classes/QSSynchronizer/CloudKitSynchronizer+Sharing.swift"; sourceTree = "<group>"; };
648D93EE22CBEF5600C01529 /* CloudKitSynchronizer+Subscriptions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CloudKitSynchronizer+Subscriptions.swift"; path = "../../../../../SyncKit/Classes/QSSynchronizer/CloudKitSynchronizer+Subscriptions.swift"; sourceTree = "<group>"; };
648D93EF22CBEF5600C01529 /* BackupDetection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BackupDetection.swift; path = ../../../../../SyncKit/Classes/QSSynchronizer/BackupDetection.swift; sourceTree = "<group>"; };
648D93F022CBEF5600C01529 /* CloudKitDatabase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CloudKitDatabase.swift; path = ../../../../../SyncKit/Classes/QSSynchronizer/CloudKitDatabase.swift; sourceTree = "<group>"; };
648D93F122CBEF5600C01529 /* TempFileManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TempFileManager.swift; path = ../../../../../SyncKit/Classes/QSSynchronizer/TempFileManager.swift; sourceTree = "<group>"; };
648D93F222CBEF5600C01529 /* KeyValueStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = KeyValueStore.swift; path = ../../../../../SyncKit/Classes/QSSynchronizer/KeyValueStore.swift; sourceTree = "<group>"; };
648D93F322CBEF5600C01529 /* CloudKitSynchronizer+Sync.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CloudKitSynchronizer+Sync.swift"; path = "../../../../../SyncKit/Classes/QSSynchronizer/CloudKitSynchronizer+Sync.swift"; sourceTree = "<group>"; };
648D93F422CBEF5600C01529 /* ModelAdapter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ModelAdapter.swift; path = ../../../../../SyncKit/Classes/QSSynchronizer/ModelAdapter.swift; sourceTree = "<group>"; };
649236DF22C7C1230074A142 /* SyncKitCoreDataOSX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SyncKitCoreDataOSX.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
649236DC22C7C1230074A142 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6433B37222C001D200EAC16C = {
isa = PBXGroup;
children = (
6433B37E22C001D200EAC16C /* SyncKitCoreDataOSX */,
6433B37D22C001D200EAC16C /* Products */,
);
sourceTree = "<group>";
};
6433B37D22C001D200EAC16C /* Products */ = {
isa = PBXGroup;
children = (
649236DF22C7C1230074A142 /* SyncKitCoreDataOSX.framework */,
);
name = Products;
sourceTree = "<group>";
};
6433B37E22C001D200EAC16C /* SyncKitCoreDataOSX */ = {
isa = PBXGroup;
children = (
648D93E122CBEF4700C01529 /* Core */,
6433B3D022C0027000EAC16C /* CoreData */,
6433B37F22C001D200EAC16C /* SyncKitCoreDataOSX.h */,
6433B38022C001D200EAC16C /* Info.plist */,
);
path = SyncKitCoreDataOSX;
sourceTree = "<group>";
};
6433B3D022C0027000EAC16C /* CoreData */ = {
isa = PBXGroup;
children = (
6433B3FF22C006CF00EAC16C /* CloudKitSynchronizer+CoreData.swift */,
6433B41622C006D100EAC16C /* CoreDataAdapter.swift */,
6433B40922C006D000EAC16C /* CoreDataAdapter+ModelAdapter.swift */,
6433B40022C006D000EAC16C /* CoreDataAdapter+Notifications.swift */,
6433B40122C006D000EAC16C /* CoreDataAdapter+Private.swift */,
6433B41222C006D100EAC16C /* CoreDataMultiFetchedResultsController.swift */,
6433B40622C006D000EAC16C /* CoreDataStack.swift */,
6433B41322C006D100EAC16C /* DefaultCoreDataAdapterDelegate.swift */,
6433B40822C006D000EAC16C /* DefaultCoreDataAdapterProvider.swift */,
6433B41422C006D100EAC16C /* DefaultCoreDataStackProvider.swift */,
6433B41522C006D100EAC16C /* NSManagedObjectContext+Fetch.swift */,
6433B40E22C006D100EAC16C /* QSCloudKitSyncModel.xcdatamodeld */,
6433B40722C006D000EAC16C /* QSManagedObjectContext.swift */,
6433B40222C006D000EAC16C /* QSPendingRelationship+CoreDataClass.swift */,
6433B40D22C006D000EAC16C /* QSPendingRelationship+CoreDataProperties.swift */,
6433B40B22C006D000EAC16C /* QSRecord+CoreDataClass.swift */,
6433B40322C006D000EAC16C /* QSRecord+CoreDataProperties.swift */,
6433B40422C006D000EAC16C /* QSServerToken+CoreDataClass.swift */,
6433B40A22C006D000EAC16C /* QSServerToken+CoreDataProperties.swift */,
6433B40522C006D000EAC16C /* QSSyncedEntity+CoreDataClass.swift */,
6433B40C22C006D000EAC16C /* QSSyncedEntity+CoreDataProperties.swift */,
);
path = CoreData;
sourceTree = "<group>";
};
648D93E122CBEF4700C01529 /* Core */ = {
isa = PBXGroup;
children = (
648D93E422CBEF4D00C01529 /* CloudKitSynchronizerOperation.swift */,
648D93E222CBEF4D00C01529 /* FetchDatabaseChangesOperation.swift */,
648D93E322CBEF4D00C01529 /* FetchZoneChangesOperation.swift */,
6435A456251C89F400A6167A /* ModifyRecordsOperation.swift */,
648D93EF22CBEF5600C01529 /* BackupDetection.swift */,
648D93F022CBEF5600C01529 /* CloudKitDatabase.swift */,
648D93EB22CBEF5600C01529 /* CloudKitSynchronizer.swift */,
648D93E922CBEF5600C01529 /* CloudKitSynchronizer+Private.swift */,
648D93ED22CBEF5600C01529 /* CloudKitSynchronizer+Sharing.swift */,
648D93EE22CBEF5600C01529 /* CloudKitSynchronizer+Subscriptions.swift */,
648D93F322CBEF5600C01529 /* CloudKitSynchronizer+Sync.swift */,
648D93F222CBEF5600C01529 /* KeyValueStore.swift */,
648D93F422CBEF5600C01529 /* ModelAdapter.swift */,
648D93EC22CBEF5600C01529 /* PrimaryKey.swift */,
648D93E822CBEF5600C01529 /* QSCoder.swift */,
648D93EA22CBEF5600C01529 /* SyncedEntityState.swift */,
648D93F122CBEF5600C01529 /* TempFileManager.swift */,
);
path = Core;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
649236DA22C7C1230074A142 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
649236DE22C7C1230074A142 /* SyncKitCoreDataOSX */ = {
isa = PBXNativeTarget;
buildConfigurationList = 649236E422C7C1230074A142 /* Build configuration list for PBXNativeTarget "SyncKitCoreDataOSX" */;
buildPhases = (
649236DA22C7C1230074A142 /* Headers */,
649236DB22C7C1230074A142 /* Sources */,
649236DC22C7C1230074A142 /* Frameworks */,
649236DD22C7C1230074A142 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = SyncKitCoreDataOSX;
productName = SyncKitCoreDataOSX;
productReference = 649236DF22C7C1230074A142 /* SyncKitCoreDataOSX.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
6433B37322C001D200EAC16C /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Manuel Entrena";
TargetAttributes = {
649236DE22C7C1230074A142 = {
CreatedOnToolsVersion = 10.2;
};
};
};
buildConfigurationList = 6433B37622C001D200EAC16C /* Build configuration list for PBXProject "SyncKitCoreDataOSX" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 6433B37222C001D200EAC16C;
productRefGroup = 6433B37D22C001D200EAC16C /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
649236DE22C7C1230074A142 /* SyncKitCoreDataOSX */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
649236DD22C7C1230074A142 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
649236DB22C7C1230074A142 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
648D93FF22CBEF5600C01529 /* KeyValueStore.swift in Sources */,
648D93FD22CBEF5600C01529 /* CloudKitDatabase.swift in Sources */,
6435A457251C89F400A6167A /* ModifyRecordsOperation.swift in Sources */,
649236FB22C7C14D0074A142 /* QSCloudKitSyncModel.xcdatamodeld in Sources */,
649236ED22C7C1430074A142 /* CoreDataStack.swift in Sources */,
649236F322C7C1460074A142 /* QSPendingRelationship+CoreDataClass.swift in Sources */,
648D940122CBEF5600C01529 /* ModelAdapter.swift in Sources */,
648D93FA22CBEF5600C01529 /* CloudKitSynchronizer+Sharing.swift in Sources */,
649236F722C7C1460074A142 /* QSServerToken+CoreDataClass.swift in Sources */,
648D93FC22CBEF5600C01529 /* BackupDetection.swift in Sources */,
649236E922C7C1430074A142 /* CoreDataAdapter+ModelAdapter.swift in Sources */,
649236E822C7C1430074A142 /* CoreDataAdapter.swift in Sources */,
648D93E622CBEF4D00C01529 /* FetchZoneChangesOperation.swift in Sources */,
649236EE22C7C1430074A142 /* DefaultCoreDataAdapterDelegate.swift in Sources */,
649236F222C7C1460074A142 /* QSManagedObjectContext.swift in Sources */,
648D93F922CBEF5600C01529 /* PrimaryKey.swift in Sources */,
648D93FE22CBEF5600C01529 /* TempFileManager.swift in Sources */,
648D940022CBEF5600C01529 /* CloudKitSynchronizer+Sync.swift in Sources */,
649236F022C7C1430074A142 /* DefaultCoreDataStackProvider.swift in Sources */,
648D93F822CBEF5600C01529 /* CloudKitSynchronizer.swift in Sources */,
648D93F722CBEF5600C01529 /* SyncedEntityState.swift in Sources */,
649236F522C7C1460074A142 /* QSRecord+CoreDataClass.swift in Sources */,
649236E722C7C1430074A142 /* CloudKitSynchronizer+CoreData.swift in Sources */,
648D93FB22CBEF5600C01529 /* CloudKitSynchronizer+Subscriptions.swift in Sources */,
648D93E722CBEF4D00C01529 /* CloudKitSynchronizerOperation.swift in Sources */,
649236EB22C7C1430074A142 /* CoreDataAdapter+Private.swift in Sources */,
649236EA22C7C1430074A142 /* CoreDataAdapter+Notifications.swift in Sources */,
648D93E522CBEF4D00C01529 /* FetchDatabaseChangesOperation.swift in Sources */,
649236EF22C7C1430074A142 /* DefaultCoreDataAdapterProvider.swift in Sources */,
649236F422C7C1460074A142 /* QSPendingRelationship+CoreDataProperties.swift in Sources */,
649236F822C7C1460074A142 /* QSServerToken+CoreDataProperties.swift in Sources */,
649236EC22C7C1430074A142 /* CoreDataMultiFetchedResultsController.swift in Sources */,
649236FA22C7C1460074A142 /* QSSyncedEntity+CoreDataProperties.swift in Sources */,
649236F922C7C1460074A142 /* QSSyncedEntity+CoreDataClass.swift in Sources */,
648D93F622CBEF5600C01529 /* CloudKitSynchronizer+Private.swift in Sources */,
648D93F522CBEF5600C01529 /* QSCoder.swift in Sources */,
649236F622C7C1460074A142 /* QSRecord+CoreDataProperties.swift in Sources */,
649236F122C7C1430074A142 /* NSManagedObjectContext+Fetch.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
6433B38222C001D200EAC16C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
6433B38322C001D200EAC16C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
649236E522C7C1230074A142 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = SyncKitCoreDataOSX/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_BUNDLE_IDENTIFIER = com.mentrena.SyncKitCoreDataOSX;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
649236E622C7C1230074A142 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = SyncKitCoreDataOSX/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_BUNDLE_IDENTIFIER = com.mentrena.SyncKitCoreDataOSX;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
6433B37622C001D200EAC16C /* Build configuration list for PBXProject "SyncKitCoreDataOSX" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6433B38222C001D200EAC16C /* Debug */,
6433B38322C001D200EAC16C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
649236E422C7C1230074A142 /* Build configuration list for PBXNativeTarget "SyncKitCoreDataOSX" */ = {
isa = XCConfigurationList;
buildConfigurations = (
649236E522C7C1230074A142 /* Debug */,
649236E622C7C1230074A142 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCVersionGroup section */
6433B40E22C006D100EAC16C /* QSCloudKitSyncModel.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
6433B40F22C006D100EAC16C /* QSCloudKitSyncModel 2.xcdatamodel */,
6433B41022C006D100EAC16C /* QSCloudKitSyncModel.xcdatamodel */,
6433B41122C006D100EAC16C /* QSCloudKitSyncModel 3.xcdatamodel */,
);
currentVersion = 6433B41122C006D100EAC16C /* QSCloudKitSyncModel 3.xcdatamodel */;
name = QSCloudKitSyncModel.xcdatamodeld;
path = ../../../../../SyncKit/Classes/CoreData/QSCloudKitSyncModel.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
};
rootObject = 6433B37322C001D200EAC16C /* Project object */;
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnDone.Text" xml:space="preserve">
<value>&Gereed</value>
</data>
<data name="btnScan.Text" xml:space="preserve">
<value>&Scannen</value>
</data>
<data name="lblStatus.Text" xml:space="preserve">
<value>Klaar voor scannen {0}.</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Volgende scan</value>
</data>
</root> | {
"pile_set_name": "Github"
} |
/*
* Copyright 2013-2016 consulo.io
*
* 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 consulo.unity3d.csharp.module.extension;
import consulo.annotation.access.RequiredReadAction;
import consulo.csharp.module.extension.BaseCSharpSimpleModuleExtension;
import consulo.csharp.module.extension.CSharpLanguageVersion;
import consulo.roots.ModuleRootLayer;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* @author VISTALL
* @since 27.10.14
*/
public class Unity3dCSharpModuleExtension extends BaseCSharpSimpleModuleExtension<Unity3dCSharpModuleExtension>
{
public Unity3dCSharpModuleExtension(@Nonnull String id, @Nonnull ModuleRootLayer module)
{
super(id, module);
}
@RequiredReadAction
@Nullable
@Override
public String getAssemblyTitle()
{
return getModule().getName();
}
@Override
public boolean isSupportedLanguageVersion(@Nonnull CSharpLanguageVersion languageVersion)
{
return false;
}
}
| {
"pile_set_name": "Github"
} |
#update {
margin:10px 40px;
}
.button {
display: inline-block;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 14px / 100% Arial, Helvetica, sans-serif;
padding: 0.5em 1em 0.55em;
text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3);
-webkit-border-radius: 0.5em;
-moz-border-radius: 0.5em;
border-radius: 0.5em;
-webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
}
.button:hover {
text-decoration: none;
}
.button:active {
position: relative;
top: 1px;
}
/* white */
.white {
color: #606060;
border: solid 1px #b7b7b7;
background: #fff;
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
background: -moz-linear-gradient(top, #fff, #ededed);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
}
.white:hover {
background: #ededed;
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc));
background: -moz-linear-gradient(top, #fff, #dcdcdc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc');
}
.white:active {
color: #999;
background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
background: -moz-linear-gradient(top, #ededed, #fff);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff');
}
.tip {
text-align: left;
width:auto;
max-width:500px;
}
.tip-title {
font-size: 11px;
text-align:center;
margin-bottom:2px;
}
#right-container {
display: none;
}
#center-container {
width:800px;
}
#infovis {
width:800px;
}
| {
"pile_set_name": "Github"
} |
#ifndef _TOWER_PANLE_LAYER_H_
#define _TOWER_PANLE_LAYER_H_
#include "cocos2d.h"
#include "Circle.h"
#include "Terrain.h"
#include "BaseBuildIcon.h"
USING_NS_CC;
class TowerPanleLayer: public Sprite
{
public:
virtual bool init() override;
CREATE_FUNC(TowerPanleLayer);
// 重载触摸回调函数
bool onTouchBegan(Touch *touch, Event *event);
void onTouchEnded(Touch* touch, Event* event);
CC_SYNTHESIZE(Terrain*, terrain, MyTerrain);
void inAnimation();
private:
void addIcons();
void addTempTower(int type);
void addTower(int type);
BaseBuildIcon* archerIcon;
BaseBuildIcon* artilleryIcon;
BaseBuildIcon* barracksIcon;
BaseBuildIcon* magicIcon;
Sprite* planesprite;
Circle* circle;
Sprite *tempTower;
bool isBuilt;
};
#endif | {
"pile_set_name": "Github"
} |
ܟܠ ܒܪܢܫܐ ܒܪܝܠܗ ܚܐܪܐ ܘܒܪܒܪ ܓܘ ܐܝܩܪܐ ܘܙܕܩܐ. ܘܦܝܫܝܠܗ ܝܗܒܐ ܗܘܢܐ ܘܐܢܝܬ. ܒܘܕ ܕܐܗܐ ܓܫܩܬܝ ܥܠ ܐܚܪܢܐ ܓܪܓ ܗܘܝܐ ܒܚܕ ܪܘܚܐ ܕܐܚܢܘܬܐ.
| {
"pile_set_name": "Github"
} |
#ifndef BOOST_MPL_VOID_FWD_HPP_INCLUDED
#define BOOST_MPL_VOID_FWD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2001-2004
//
// Distributed under 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)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#include <boost/mpl/aux_/adl_barrier.hpp>
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
struct void_;
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
BOOST_MPL_AUX_ADL_BARRIER_DECL(void_)
#endif // BOOST_MPL_VOID_FWD_HPP_INCLUDED
| {
"pile_set_name": "Github"
} |
package com.pinery.aidl.client;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
import com.pinery.aidl.IToastService;
import com.pinery.aidl.common.RemoteServiceUtil;
/**
* @author hesong
* @e-mail hes1335@13322.com
* @time 2018/4/4
* @desc
* @version: 3.1.2
*/
public class Client {
private static final String TAG = Client.class.getSimpleName();
private static final String SERVICE_PKG_NAME = "com.pinery.aidl.remote";
private static final String SERVICE_NAME = "com.pinery.aidl.remote.AIDLService";
private static final String SERVICE_ACTION_NAME = "com.pinery.aidl.action.AIDL_ACTION";
private Context mContext;
private IToastService toastService;
private boolean isConnect;
public Client(Context context){
mContext = context;
}
private ServiceConnection mServiceConnection = new ServiceConnection() {
@Override public void onServiceConnected(ComponentName name, IBinder service) {
Log.d(TAG, "onServiceConnected");
toastService = IToastService.Stub.asInterface(service);
isConnect = true;
}
@Override public void onServiceDisconnected(ComponentName name) {
Log.d(TAG, "onServiceDisconnected");
toastService = null;
}
};
public void open(){
try {
Intent intent = new Intent();
//跨应用启动和绑定服务,5.0版本以上不能设置隐式Intent来绑定服务了
//intent.setPackage(SERVICE_PKG_NAME);
//intent.setAction(SERVICE_ACTION_NAME);
intent.setClassName(SERVICE_PKG_NAME, SERVICE_NAME);
mContext.startService(intent);
}catch (Exception ex){
ex.printStackTrace();
}
}
public void close(){
try {
Intent intent = new Intent();
//跨应用启动和绑定服务,5.0版本以上不能设置隐式Intent来绑定服务了
//intent.setPackage(SERVICE_PKG_NAME);
//intent.setAction(SERVICE_ACTION_NAME);
intent.setClassName(SERVICE_PKG_NAME, SERVICE_NAME);
mContext.stopService(intent);
}catch (Exception ex){
ex.printStackTrace();
}
}
public void connect(){
try {
Intent intent = new Intent();
//跨应用启动和绑定服务,5.0版本以上不能设置隐式Intent来绑定服务了
//intent.setPackage(SERVICE_PKG_NAME);
//intent.setAction(SERVICE_ACTION_NAME);
intent.setClassName(SERVICE_PKG_NAME, SERVICE_NAME);
mContext.bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE);
isConnect = true;
}catch (Exception ex){
ex.printStackTrace();
}
}
public void disconnect(){
try {
mContext.unbindService(mServiceConnection);
isConnect = false;
}catch (Exception ex){
ex.printStackTrace();
}
}
public boolean isServiceRunning(){
//这是判断进程是否正在运行,判断服务是否正在运行的方法已经不可用了,所以暂时只能用变量判断了
//return ServiceUtil.isProcessRunning(mContext, "com.pinery.aidl.remote_service");
//return isConnect;
boolean isRunning = RemoteServiceUtil.isServiceRunning(mContext);
return isRunning;
}
public boolean isServiceConnected(){
return isConnect;
}
public void toogleOpen(){
if(isServiceRunning()){
disconnect();
close();
}else{
open();
}
}
public void showToast(String text) throws RemoteException {
if(toastService != null){
toastService.showToast(text);
}
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>publicmapping.redistricting.models.Region.Meta</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th> <a
href="publicmapping-module.html">Home</a> </th>
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a href="http://publicmapping.github.com/districtbuilder/">Publicmapping on GitHub</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="publicmapping-module.html">Package publicmapping</a> ::
<a href="publicmapping.redistricting-module.html">Package redistricting</a> ::
<a href="publicmapping.redistricting.models-module.html">Module models</a> ::
<a href="publicmapping.redistricting.models.Region-class.html">Class Region</a> ::
Class Meta
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>] | <a href="publicmapping.redistricting.models.Region.Meta-class.html"
target="_top">no frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Meta</h1><p class="nomargin-top"><span class="codelink"><a href="publicmapping.redistricting.models-pysrc.html#Region.Meta">source code</a></span></p>
<p>Additional information about the Region model.</p>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Class Variables</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-ClassVariables"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"> </span>
</td><td class="summary">
<a name="unique_together"></a><span class="summary-name">unique_together</span> = <code title="'name',">'name',</code>
</td>
</tr>
</table>
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th> <a
href="publicmapping-module.html">Home</a> </th>
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a href="http://publicmapping.github.com/districtbuilder/">Publicmapping on GitHub</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Mon Oct 1 16:33:49 2012
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
| {
"pile_set_name": "Github"
} |
v 0.000000 -1.000000 -1.000000
v 0.195090 -1.000000 -0.980785
v 0.382683 -1.000000 -0.923880
v 0.555570 -1.000000 -0.831470
v 0.707107 -1.000000 -0.707107
v 0.831470 -1.000000 -0.555570
v 0.923880 -1.000000 -0.382683
v 0.980785 -1.000000 -0.195090
v 1.000000 -1.000000 -0.000000
v 0.980785 -1.000000 0.195090
v 0.923880 -1.000000 0.382683
v 0.831470 -1.000000 0.555570
v 0.707107 -1.000000 0.707107
v 0.555570 -1.000000 0.831470
v 0.382683 -1.000000 0.923880
v 0.195090 -1.000000 0.980785
v -0.000000 -1.000000 1.000000
v -0.195091 -1.000000 0.980785
v -0.382684 -1.000000 0.923879
v -0.555571 -1.000000 0.831469
v -0.707107 -1.000000 0.707106
v -0.831470 -1.000000 0.555570
v -0.923880 -1.000000 0.382683
v 0.000000 1.000000 0.000000
v -0.980785 -1.000000 0.195089
v -1.000000 -1.000000 -0.000001
v -0.980785 -1.000000 -0.195091
v -0.923879 -1.000000 -0.382684
v -0.831469 -1.000000 -0.555571
v -0.707106 -1.000000 -0.707108
v -0.555569 -1.000000 -0.831470
v -0.382682 -1.000000 -0.923880
v -0.195089 -1.000000 -0.980786
f 1 24 2
f 2 24 3
f 3 24 4
f 4 24 5
f 5 24 6
f 6 24 7
f 7 24 8
f 8 24 9
f 9 24 10
f 10 24 11
f 11 24 12
f 12 24 13
f 13 24 14
f 14 24 15
f 15 24 16
f 16 24 17
f 17 24 18
f 18 24 19
f 19 24 20
f 20 24 21
f 21 24 22
f 22 24 23
f 23 24 25
f 25 24 26
f 26 24 27
f 27 24 28
f 28 24 29
f 29 24 30
f 30 24 31
f 31 24 32
f 32 24 33
f 33 24 1
f 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 26 27 28 29 30 31 32 33
| {
"pile_set_name": "Github"
} |
;; RUN: llc -mtriple=hexagon-unknown-elf -filetype=obj -disable-hsdr %s -o - \
;; RUN: | llvm-objdump -s - | FileCheck %s
define i64 @foo (i64 %a, i64 %b)
{
%1 = and i64 %a, %b
ret i64 %1
}
; CHECK: 0000 0042e0d3 00c09f52
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5C713DD1-D595-43DD-B543-6850802E9108}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>COMAddinRibbonExampleVB4</RootNamespace>
<AssemblyName>COMAddinRibbonExampleVB4</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<OptionExplicit>On</OptionExplicit>
<OptionCompare>Binary</OptionCompare>
<OptionStrict>Off</OptionStrict>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>COMAddinRibbonExampleVB4.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<RegisterForComInterop>true</RegisterForComInterop>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>COMAddinRibbonExampleVB4.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<RegisterForComInterop>true</RegisterForComInterop>
</PropertyGroup>
<ItemGroup>
<Reference Include="extensibility, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="NetOffice">
<HintPath>..\..\..\..\..\Assemblies\Any CPU\NetOffice.dll</HintPath>
</Reference>
<Reference Include="OfficeApi">
<HintPath>..\..\..\..\..\Assemblies\Any CPU\OfficeApi.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="VBIDEApi">
<HintPath>..\..\..\..\..\Assemblies\Any CPU\VBIDEApi.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="WordApi">
<HintPath>..\..\..\..\..\Assemblies\Any CPU\WordApi.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
</ItemGroup>
<ItemGroup>
<Import Include="Extensibility" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="Addin.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="RibbonUI.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project> | {
"pile_set_name": "Github"
} |
#import "TestHelper.h"
static int
beforeAllRan
, afterAllRan
;
SpecBegin(_PendingSpecTest5)
describe(@"group", ^{
beforeAll(^{
beforeAllRan ++;
});
pending(@"pending 1", ^{ });
pending(@"pending 2", ^{ });
it(@"example 1", ^{ });
it(@"example 2", ^{ });
pending(@"pending 3", ^{ });
pending(@"pending 4", ^{ });
afterAll(^{
afterAllRan ++;
});
});
SpecEnd
@interface PendingSpecTest5 : XCTestCase; @end
@implementation PendingSpecTest5
- (void)testPendingSpec {
beforeAllRan = afterAllRan = 0;
RunSpec(_PendingSpecTest5Spec);
assertEqual(beforeAllRan, 1);
assertEqual(afterAllRan, 1);
}
@end
| {
"pile_set_name": "Github"
} |
package org.infinispan.encoding.impl;
import static org.infinispan.commons.dataconversion.MediaType.APPLICATION_OBJECT;
import java.util.HashSet;
import java.util.Set;
import org.infinispan.commons.dataconversion.MediaType;
import org.infinispan.commons.dataconversion.Transcoder;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
/**
* <p>
* Performs conversions where there is no direct transcoder, but there are two transcoders available:
* <ul>
* <li>one from source media type to <b>application/x-java-object</b>
* <li>one from <b>application/x-java-object</b> to the destination media type
* </ul>
* </p>
*
* @since 11.0
*/
public class TwoStepTranscoder implements Transcoder {
private static final Log logger = LogFactory.getLog(TwoStepTranscoder.class, Log.class);
private final Transcoder transcoder1;
private final Transcoder transcoder2;
private final HashSet<MediaType> supportedMediaTypes;
public TwoStepTranscoder(Transcoder transcoder1, Transcoder transcoder2) {
this.transcoder1 = transcoder1;
this.transcoder2 = transcoder2;
supportedMediaTypes = new HashSet<>(this.transcoder1.getSupportedMediaTypes());
supportedMediaTypes.addAll(transcoder2.getSupportedMediaTypes());
}
@Override
public Object transcode(Object content, MediaType contentType, MediaType destinationType) {
if (transcoder1.supportsConversion(contentType, APPLICATION_OBJECT)
&& transcoder2.supportsConversion(APPLICATION_OBJECT, destinationType)) {
Object object = transcoder1.transcode(content, contentType, APPLICATION_OBJECT);
return transcoder2.transcode(object, APPLICATION_OBJECT, destinationType);
}
if (transcoder2.supportsConversion(contentType, APPLICATION_OBJECT)
&& transcoder1.supportsConversion(APPLICATION_OBJECT, destinationType)) {
Object object = transcoder2.transcode(content, contentType, APPLICATION_OBJECT);
return transcoder1.transcode(object, APPLICATION_OBJECT, destinationType);
}
throw logger.unsupportedContent(TwoStepTranscoder.class.getSimpleName(), content);
}
@Override
public Set<MediaType> getSupportedMediaTypes() {
return supportedMediaTypes;
}
@Override
public boolean supportsConversion(MediaType mediaType, MediaType other) {
return (transcoder1.supportsConversion(mediaType, APPLICATION_OBJECT) &&
transcoder2.supportsConversion(APPLICATION_OBJECT, other)) ||
(transcoder2.supportsConversion(mediaType, APPLICATION_OBJECT) &&
transcoder1.supportsConversion(APPLICATION_OBJECT, other));
}
}
| {
"pile_set_name": "Github"
} |
/// @description Insert description here
// You can write your code in this editor
// Inherit the parent event
event_inherited();
///Anti-Bug: Teleport If Inside Wall
if collision_point(x,y,obj_limit,false,true)
{
//Middle of Boss Room
x=mySpawnX;
y=mySpawnY;
} | {
"pile_set_name": "Github"
} |
//
// MIT License
//
// Copyright (c) 2014 Bob McCune http://bobmccune.com/
// Copyright (c) 2014 TapHarmonic, LLC http://tapharmonic.com/
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import "THTransitionButton.h"
@interface THTransitionCollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet THTransitionButton *button;
@end
| {
"pile_set_name": "Github"
} |
# Locally computed:
sha256 97c8b700b3fe73d48eacb259008f410d6567e5d7d1b8e96386f8cc2422135ca5 python-coherence-b7856985fd496689ca1f9024925ae737297c00d1.tar.gz
| {
"pile_set_name": "Github"
} |
lf
lf
lf
lf
lf
| {
"pile_set_name": "Github"
} |
/**
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
*
* The Apereo Foundation licenses this file to you under the Educational
* Community 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://opensource.org/licenses/ecl2.txt
*
* 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.opencastproject.silencedetection.impl;
import org.opencastproject.job.api.AbstractJobProducer;
import org.opencastproject.job.api.Job;
import org.opencastproject.mediapackage.MediaPackageElementParser;
import org.opencastproject.mediapackage.MediaPackageException;
import org.opencastproject.mediapackage.Track;
import org.opencastproject.security.api.OrganizationDirectoryService;
import org.opencastproject.security.api.SecurityService;
import org.opencastproject.security.api.UserDirectoryService;
import org.opencastproject.serviceregistry.api.ServiceRegistry;
import org.opencastproject.serviceregistry.api.ServiceRegistryException;
import org.opencastproject.silencedetection.api.MediaSegment;
import org.opencastproject.silencedetection.api.MediaSegments;
import org.opencastproject.silencedetection.api.SilenceDetectionFailedException;
import org.opencastproject.silencedetection.api.SilenceDetectionService;
import org.opencastproject.silencedetection.ffmpeg.FFmpegSilenceDetector;
import org.opencastproject.smil.api.SmilException;
import org.opencastproject.smil.api.SmilResponse;
import org.opencastproject.smil.api.SmilService;
import org.opencastproject.smil.entity.api.Smil;
import org.opencastproject.util.LoadUtil;
import org.opencastproject.workspace.api.Workspace;
import org.apache.commons.lang3.StringUtils;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedService;
import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Arrays;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
/**
* Implementation of SilenceDetectionService using FFmpeg.
*/
public class SilenceDetectionServiceImpl extends AbstractJobProducer implements SilenceDetectionService, ManagedService {
/**
* The logging instance
*/
private static final Logger logger = LoggerFactory.getLogger(SilenceDetectionServiceImpl.class);
public static final String JOB_LOAD_KEY = "job.load.videoeditor.silencedetection";
private static final float DEFAULT_JOB_LOAD = 0.2f;
private float jobload = DEFAULT_JOB_LOAD;
private enum Operation {
SILENCE_DETECTION
}
/**
* Reference to the workspace service
*/
private Workspace workspace = null;
/**
* Reference to the receipt service
*/
private ServiceRegistry serviceRegistry;
/**
* The organization directory service
*/
protected OrganizationDirectoryService organizationDirectoryService = null;
/**
* The security service
*/
protected SecurityService securityService = null;
/**
* The user directory service
*/
protected UserDirectoryService userDirectoryService = null;
protected SmilService smilService = null;
private Properties properties;
public SilenceDetectionServiceImpl() {
super(JOB_TYPE);
}
/**
* {@inheritDoc}
*
* @see org.opencastproject.silencedetection.api.SilenceDetectionService#detect(
* org.opencastproject.mediapackage.Track)
*/
@Override
public Job detect(Track sourceTrack) throws SilenceDetectionFailedException {
return detect(sourceTrack, null);
}
/**
* {@inheritDoc}
*
* @see org.opencastproject.silencedetection.api.SilenceDetectionService#detect(
* org.opencastproject.mediapackage.Track, org.opencastproject.mediapackage.Track[])
*/
@Override
public Job detect(Track sourceTrack, Track[] referenceTracks) throws SilenceDetectionFailedException {
try {
if (sourceTrack == null) {
throw new SilenceDetectionFailedException("Source track is null!");
}
List<String> arguments = new LinkedList<String>();
// put source track as job argument
arguments.add(0, MediaPackageElementParser.getAsXml(sourceTrack));
// put reference tracks as second argument
if (referenceTracks != null) {
arguments.add(1, MediaPackageElementParser.getArrayAsXml(Arrays.asList(referenceTracks)));
}
return serviceRegistry.createJob(
getJobType(),
Operation.SILENCE_DETECTION.toString(),
arguments,
jobload);
} catch (ServiceRegistryException ex) {
throw new SilenceDetectionFailedException("Unable to create job! " + ex.getMessage());
} catch (MediaPackageException ex) {
throw new SilenceDetectionFailedException("Unable to serialize track!");
}
}
@Override
protected String process(Job job) throws SilenceDetectionFailedException, SmilException, MediaPackageException {
if (Operation.SILENCE_DETECTION.toString().equals(job.getOperation())) {
// get source track
String sourceTrackXml = StringUtils.trimToNull(job.getArguments().get(0));
if (sourceTrackXml == null) {
throw new SilenceDetectionFailedException("Track not set!");
}
Track sourceTrack = (Track) MediaPackageElementParser.getFromXml(sourceTrackXml);
// run detection on source track
MediaSegments segments = runDetection(sourceTrack);
// get reference tracks if any
List<Track> referenceTracks = null;
if (job.getArguments().size() > 1) {
String referenceTracksXml = StringUtils.trimToNull(job.getArguments().get(1));
if (referenceTracksXml != null) {
referenceTracks = (List<Track>) MediaPackageElementParser.getArrayFromXml(referenceTracksXml);
}
}
if (referenceTracks == null) {
referenceTracks = Arrays.asList(sourceTrack);
}
// create smil XML as result
try {
return generateSmil(segments, referenceTracks).toXML();
} catch (Exception ex) {
throw new SmilException("Failed to create smil document.", ex);
}
}
throw new SilenceDetectionFailedException("Can't handle this operation: " + job.getOperation());
}
/**
* Run silence detection on the source track and returns
* {@link org.opencastproject.silencedetection.api.MediaSegments}
* XML as string. Source track should have an audio stream. All detected
* {@link org.opencastproject.silencedetection.api.MediaSegment}s
* (one or more) are non silent sequences.
*
* @param track track where to run silence detection
* @return {@link MediaSegments} Xml as String
* @throws SilenceDetectionFailedException if an error occures
*/
protected MediaSegments runDetection(Track track) throws SilenceDetectionFailedException {
try {
FFmpegSilenceDetector silenceDetector = new FFmpegSilenceDetector(properties, track, workspace);
return silenceDetector.getMediaSegments();
} catch (Exception ex) {
throw new SilenceDetectionFailedException(ex.getMessage());
}
}
/**
* Create a smil from given parameters.
*
* @param segments media segment list with timestamps
* @param referenceTracks tracks to put as media segment source files
* @return generated smil
* @throws SmilException if smil creation failed
*/
protected Smil generateSmil(MediaSegments segments, List<Track> referenceTracks) throws SmilException {
SmilResponse smilResponse = smilService.createNewSmil();
Track[] referenceTracksArr = referenceTracks.toArray(new Track[referenceTracks.size()]);
for (MediaSegment segment : segments.getMediaSegments()) {
smilResponse = smilService.addParallel(smilResponse.getSmil());
String parId = smilResponse.getEntity().getId();
smilResponse = smilService.addClips(smilResponse.getSmil(), parId, referenceTracksArr,
segment.getSegmentStart(), segment.getSegmentStop() - segment.getSegmentStart());
}
return smilResponse.getSmil();
}
@Override
protected ServiceRegistry getServiceRegistry() {
return serviceRegistry;
}
@Override
protected SecurityService getSecurityService() {
return securityService;
}
@Override
protected UserDirectoryService getUserDirectoryService() {
return userDirectoryService;
}
@Override
protected OrganizationDirectoryService getOrganizationDirectoryService() {
return organizationDirectoryService;
}
@Override
public void activate(ComponentContext context) {
logger.debug("activating...");
super.activate(context);
FFmpegSilenceDetector.init(context.getBundleContext());
}
protected void deactivate(ComponentContext context) {
logger.debug("deactivating...");
}
@Override
public void updated(Dictionary<String, ?> properties) throws ConfigurationException {
this.properties = new Properties();
if (properties == null) {
logger.info("No configuration available, using defaults");
return;
}
Enumeration<String> keys = properties.keys();
while (keys.hasMoreElements()) {
String key = keys.nextElement();
this.properties.put(key, properties.get(key));
}
logger.debug("Properties updated!");
jobload = LoadUtil.getConfiguredLoadValue(properties, JOB_LOAD_KEY, DEFAULT_JOB_LOAD, serviceRegistry);
}
public void setServiceRegistry(ServiceRegistry serviceRegistry) {
this.serviceRegistry = serviceRegistry;
}
public void setWorkspace(Workspace workspace) {
this.workspace = workspace;
}
public void setSecurityService(SecurityService securityService) {
this.securityService = securityService;
}
public void setUserDirectoryService(UserDirectoryService userDirectoryService) {
this.userDirectoryService = userDirectoryService;
}
public void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) {
this.organizationDirectoryService = organizationDirectoryService;
}
public void setSmilService(SmilService smilService) {
this.smilService = smilService;
}
}
| {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sensio\Bundle\FrameworkExtraBundle\Tests\Request\ParamConverter;
use Sensio\Bundle\FrameworkExtraBundle\Request\ArgumentNameConverter;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactoryInterface;
use Symfony\Component\HttpKernel\Event\FilterControllerArgumentsEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
class ArgumentNameConverterTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider getArgumentTests
*/
public function testGetControllerArguments(array $resolvedArguments, array $argumentMetadatas, array $requestAttributes, array $expectedArguments)
{
$metadataFactory = $this->getMockBuilder(ArgumentMetadataFactoryInterface::class)->getMock();
$metadataFactory->expects($this->any())
->method('createArgumentMetadata')
->will($this->returnValue($argumentMetadatas));
$request = new Request();
$request->attributes->add($requestAttributes);
$converter = new ArgumentNameConverter($metadataFactory);
$event = new FilterControllerArgumentsEvent($this->getMockBuilder(HttpKernelInterface::class)->getMock(), function () {
return new Response();
}, $resolvedArguments, $request, null);
$actualArguments = $converter->getControllerArguments($event);
$this->assertSame($expectedArguments, $actualArguments);
}
public function getArgumentTests()
{
// everything empty
yield [[], [], [], []];
// uses request attributes
yield [[], [], ['post' => 5], ['post' => 5]];
// resolves argument names correctly
$arg1Metadata = new ArgumentMetadata('arg1Name', 'string', false, false, null);
$arg2Metadata = new ArgumentMetadata('arg2Name', 'string', false, false, null);
yield [['arg1Value', 'arg2Value'], [$arg1Metadata, $arg2Metadata], ['post' => 5], ['post' => 5, 'arg1Name' => 'arg1Value', 'arg2Name' => 'arg2Value']];
// argument names have priority over request attributes
yield [['arg1Value', 'arg2Value'], [$arg1Metadata, $arg2Metadata], ['arg1Name' => 'differentValue'], ['arg1Name' => 'arg1Value', 'arg2Name' => 'arg2Value']];
// variadic arguments are resolved correctly
$arg1Metadata = new ArgumentMetadata('arg1Name', 'string', false, false, null);
$arg2VariadicMetadata = new ArgumentMetadata('arg2Name', 'string', true, false, null);
yield [['arg1Value', 'arg2Value', 'arg3Value'], [$arg1Metadata, $arg2VariadicMetadata], [], ['arg1Name' => 'arg1Value', 'arg2Name' => ['arg2Value', 'arg3Value']]];
// variadic argument receives no arguments, so becomes an empty array
yield [['arg1Value'], [$arg1Metadata, $arg2VariadicMetadata], [], ['arg1Name' => 'arg1Value', 'arg2Name' => []]];
// resolves nullable argument correctly
$arg1Metadata = new ArgumentMetadata('arg1Name', 'string', false, false, null);
$arg2NullableMetadata = new ArgumentMetadata('arg2Name', 'string', false, false, true);
yield [['arg1Value', null], [$arg1Metadata, $arg2Metadata], ['post' => 5], ['post' => 5, 'arg1Name' => 'arg1Value', 'arg2Name' => null]];
}
}
| {
"pile_set_name": "Github"
} |
<?php declare(strict_types=1);
namespace PhpParser;
class NodeTraverser implements NodeTraverserInterface
{
/**
* If NodeVisitor::enterNode() returns DONT_TRAVERSE_CHILDREN, child nodes
* of the current node will not be traversed for any visitors.
*
* For subsequent visitors enterNode() will still be called on the current
* node and leaveNode() will also be invoked for the current node.
*/
const DONT_TRAVERSE_CHILDREN = 1;
/**
* If NodeVisitor::enterNode() or NodeVisitor::leaveNode() returns
* STOP_TRAVERSAL, traversal is aborted.
*
* The afterTraverse() method will still be invoked.
*/
const STOP_TRAVERSAL = 2;
/**
* If NodeVisitor::leaveNode() returns REMOVE_NODE for a node that occurs
* in an array, it will be removed from the array.
*
* For subsequent visitors leaveNode() will still be invoked for the
* removed node.
*/
const REMOVE_NODE = 3;
/**
* If NodeVisitor::enterNode() returns DONT_TRAVERSE_CURRENT_AND_CHILDREN, child nodes
* of the current node will not be traversed for any visitors.
*
* For subsequent visitors enterNode() will not be called as well.
* leaveNode() will be invoked for visitors that has enterNode() method invoked.
*/
const DONT_TRAVERSE_CURRENT_AND_CHILDREN = 4;
/** @var NodeVisitor[] Visitors */
protected $visitors = [];
/** @var bool Whether traversal should be stopped */
protected $stopTraversal;
public function __construct() {
// for BC
}
/**
* Adds a visitor.
*
* @param NodeVisitor $visitor Visitor to add
*/
public function addVisitor(NodeVisitor $visitor) {
$this->visitors[] = $visitor;
}
/**
* Removes an added visitor.
*
* @param NodeVisitor $visitor
*/
public function removeVisitor(NodeVisitor $visitor) {
foreach ($this->visitors as $index => $storedVisitor) {
if ($storedVisitor === $visitor) {
unset($this->visitors[$index]);
break;
}
}
}
/**
* Traverses an array of nodes using the registered visitors.
*
* @param Node[] $nodes Array of nodes
*
* @return Node[] Traversed array of nodes
*/
public function traverse(array $nodes) : array {
$this->stopTraversal = false;
foreach ($this->visitors as $visitor) {
if (null !== $return = $visitor->beforeTraverse($nodes)) {
$nodes = $return;
}
}
$nodes = $this->traverseArray($nodes);
foreach ($this->visitors as $visitor) {
if (null !== $return = $visitor->afterTraverse($nodes)) {
$nodes = $return;
}
}
return $nodes;
}
/**
* Recursively traverse a node.
*
* @param Node $node Node to traverse.
*
* @return Node Result of traversal (may be original node or new one)
*/
protected function traverseNode(Node $node) : Node {
foreach ($node->getSubNodeNames() as $name) {
$subNode =& $node->$name;
if (\is_array($subNode)) {
$subNode = $this->traverseArray($subNode);
if ($this->stopTraversal) {
break;
}
} elseif ($subNode instanceof Node) {
$traverseChildren = true;
$breakVisitorIndex = null;
foreach ($this->visitors as $visitorIndex => $visitor) {
$return = $visitor->enterNode($subNode);
if (null !== $return) {
if ($return instanceof Node) {
$this->ensureReplacementReasonable($subNode, $return);
$subNode = $return;
} elseif (self::DONT_TRAVERSE_CHILDREN === $return) {
$traverseChildren = false;
} elseif (self::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) {
$traverseChildren = false;
$breakVisitorIndex = $visitorIndex;
break;
} elseif (self::STOP_TRAVERSAL === $return) {
$this->stopTraversal = true;
break 2;
} else {
throw new \LogicException(
'enterNode() returned invalid value of type ' . gettype($return)
);
}
}
}
if ($traverseChildren) {
$subNode = $this->traverseNode($subNode);
if ($this->stopTraversal) {
break;
}
}
foreach ($this->visitors as $visitorIndex => $visitor) {
$return = $visitor->leaveNode($subNode);
if (null !== $return) {
if ($return instanceof Node) {
$this->ensureReplacementReasonable($subNode, $return);
$subNode = $return;
} elseif (self::STOP_TRAVERSAL === $return) {
$this->stopTraversal = true;
break 2;
} elseif (\is_array($return)) {
throw new \LogicException(
'leaveNode() may only return an array ' .
'if the parent structure is an array'
);
} else {
throw new \LogicException(
'leaveNode() returned invalid value of type ' . gettype($return)
);
}
}
if ($breakVisitorIndex === $visitorIndex) {
break;
}
}
}
}
return $node;
}
/**
* Recursively traverse array (usually of nodes).
*
* @param array $nodes Array to traverse
*
* @return array Result of traversal (may be original array or changed one)
*/
protected function traverseArray(array $nodes) : array {
$doNodes = [];
foreach ($nodes as $i => &$node) {
if ($node instanceof Node) {
$traverseChildren = true;
$breakVisitorIndex = null;
foreach ($this->visitors as $visitorIndex => $visitor) {
$return = $visitor->enterNode($node);
if (null !== $return) {
if ($return instanceof Node) {
$this->ensureReplacementReasonable($node, $return);
$node = $return;
} elseif (self::DONT_TRAVERSE_CHILDREN === $return) {
$traverseChildren = false;
} elseif (self::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) {
$traverseChildren = false;
$breakVisitorIndex = $visitorIndex;
break;
} elseif (self::STOP_TRAVERSAL === $return) {
$this->stopTraversal = true;
break 2;
} else {
throw new \LogicException(
'enterNode() returned invalid value of type ' . gettype($return)
);
}
}
}
if ($traverseChildren) {
$node = $this->traverseNode($node);
if ($this->stopTraversal) {
break;
}
}
foreach ($this->visitors as $visitorIndex => $visitor) {
$return = $visitor->leaveNode($node);
if (null !== $return) {
if ($return instanceof Node) {
$this->ensureReplacementReasonable($node, $return);
$node = $return;
} elseif (\is_array($return)) {
$doNodes[] = [$i, $return];
break;
} elseif (self::REMOVE_NODE === $return) {
$doNodes[] = [$i, []];
break;
} elseif (self::STOP_TRAVERSAL === $return) {
$this->stopTraversal = true;
break 2;
} elseif (false === $return) {
throw new \LogicException(
'bool(false) return from leaveNode() no longer supported. ' .
'Return NodeTraverser::REMOVE_NODE instead'
);
} else {
throw new \LogicException(
'leaveNode() returned invalid value of type ' . gettype($return)
);
}
}
if ($breakVisitorIndex === $visitorIndex) {
break;
}
}
} elseif (\is_array($node)) {
throw new \LogicException('Invalid node structure: Contains nested arrays');
}
}
if (!empty($doNodes)) {
while (list($i, $replace) = array_pop($doNodes)) {
array_splice($nodes, $i, 1, $replace);
}
}
return $nodes;
}
private function ensureReplacementReasonable($old, $new) {
if ($old instanceof Node\Stmt && $new instanceof Node\Expr) {
throw new \LogicException(
"Trying to replace statement ({$old->getType()}) " .
"with expression ({$new->getType()}). Are you missing a " .
"Stmt_Expression wrapper?"
);
}
if ($old instanceof Node\Expr && $new instanceof Node\Stmt) {
throw new \LogicException(
"Trying to replace expression ({$old->getType()}) " .
"with statement ({$new->getType()})"
);
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* OPCODE - Optimized Collision Detection
* http://www.codercorner.com/Opcode.htm
*
* Copyright (c) 2001-2008 Pierre Terdiman, pierre@codercorner.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
//! This macro quickly finds the min & max values among 3 variables
#define FINDMINMAX(x0, x1, x2, min, max) \
min = max = x0; \
if(x1<min) min=x1; \
if(x1>max) max=x1; \
if(x2<min) min=x2; \
if(x2>max) max=x2;
//! TO BE DOCUMENTED
inline_ BOOL planeBoxOverlap(const Point& normal, const float d, const Point& maxbox)
{
Point vmin, vmax;
for(udword q=0;q<=2;q++)
{
if(normal[q]>0.0f) { vmin[q]=-maxbox[q]; vmax[q]=maxbox[q]; }
else { vmin[q]=maxbox[q]; vmax[q]=-maxbox[q]; }
}
if((normal|vmin)+d>0.0f) return FALSE;
if((normal|vmax)+d>=0.0f) return TRUE;
return FALSE;
}
//! TO BE DOCUMENTED
#define AXISTEST_X01(a, b, fa, fb) \
min = a*v0.y - b*v0.z; \
max = a*v2.y - b*v2.z; \
if(min>max) {const float tmp=max; max=min; min=tmp; } \
rad = fa * extents.y + fb * extents.z; \
if(min>rad || max<-rad) return FALSE;
//! TO BE DOCUMENTED
#define AXISTEST_X2(a, b, fa, fb) \
min = a*v0.y - b*v0.z; \
max = a*v1.y - b*v1.z; \
if(min>max) {const float tmp=max; max=min; min=tmp; } \
rad = fa * extents.y + fb * extents.z; \
if(min>rad || max<-rad) return FALSE;
//! TO BE DOCUMENTED
#define AXISTEST_Y02(a, b, fa, fb) \
min = b*v0.z - a*v0.x; \
max = b*v2.z - a*v2.x; \
if(min>max) {const float tmp=max; max=min; min=tmp; } \
rad = fa * extents.x + fb * extents.z; \
if(min>rad || max<-rad) return FALSE;
//! TO BE DOCUMENTED
#define AXISTEST_Y1(a, b, fa, fb) \
min = b*v0.z - a*v0.x; \
max = b*v1.z - a*v1.x; \
if(min>max) {const float tmp=max; max=min; min=tmp; } \
rad = fa * extents.x + fb * extents.z; \
if(min>rad || max<-rad) return FALSE;
//! TO BE DOCUMENTED
#define AXISTEST_Z12(a, b, fa, fb) \
min = a*v1.x - b*v1.y; \
max = a*v2.x - b*v2.y; \
if(min>max) {const float tmp=max; max=min; min=tmp; } \
rad = fa * extents.x + fb * extents.y; \
if(min>rad || max<-rad) return FALSE;
//! TO BE DOCUMENTED
#define AXISTEST_Z0(a, b, fa, fb) \
min = a*v0.x - b*v0.y; \
max = a*v1.x - b*v1.y; \
if(min>max) {const float tmp=max; max=min; min=tmp; } \
rad = fa * extents.x + fb * extents.y; \
if(min>rad || max<-rad) return FALSE;
// compute triangle edges
// - edges lazy evaluated to take advantage of early exits
// - fabs precomputed (half less work, possible since extents are always >0)
// - customized macros to take advantage of the null component
// - axis vector discarded, possibly saves useless movs
#define IMPLEMENT_CLASS3_TESTS \
float rad; \
float min, max; \
\
const float fey0 = fabsf(e0.y); \
const float fez0 = fabsf(e0.z); \
AXISTEST_X01(e0.z, e0.y, fez0, fey0); \
const float fex0 = fabsf(e0.x); \
AXISTEST_Y02(e0.z, e0.x, fez0, fex0); \
AXISTEST_Z12(e0.y, e0.x, fey0, fex0); \
\
const float fey1 = fabsf(e1.y); \
const float fez1 = fabsf(e1.z); \
AXISTEST_X01(e1.z, e1.y, fez1, fey1); \
const float fex1 = fabsf(e1.x); \
AXISTEST_Y02(e1.z, e1.x, fez1, fex1); \
AXISTEST_Z0(e1.y, e1.x, fey1, fex1); \
\
const Point e2 = mLeafVerts[0] - mLeafVerts[2]; \
const float fey2 = fabsf(e2.y); \
const float fez2 = fabsf(e2.z); \
AXISTEST_X2(e2.z, e2.y, fez2, fey2); \
const float fex2 = fabsf(e2.x); \
AXISTEST_Y1(e2.z, e2.x, fez2, fex2); \
AXISTEST_Z12(e2.y, e2.x, fey2, fex2);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Triangle-Box overlap test using the separating axis theorem.
* This is the code from Tomas Möller, a bit optimized:
* - with some more lazy evaluation (faster path on PC)
* - with a tiny bit of assembly
* - with "SAT-lite" applied if needed
* - and perhaps with some more minor modifs...
*
* \param center [in] box center
* \param extents [in] box extents
* \return true if triangle & box overlap
*/
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline_ BOOL AABBTreeCollider::TriBoxOverlap(const Point& center, const Point& extents)
{
// Stats
mNbBVPrimTests++;
// use separating axis theorem to test overlap between triangle and box
// need to test for overlap in these directions:
// 1) the {x,y,z}-directions (actually, since we use the AABB of the triangle
// we do not even need to test these)
// 2) normal of the triangle
// 3) crossproduct(edge from tri, {x,y,z}-directin)
// this gives 3x3=9 more tests
// move everything so that the boxcenter is in (0,0,0)
Point v0, v1, v2;
v0.x = mLeafVerts[0].x - center.x;
v1.x = mLeafVerts[1].x - center.x;
v2.x = mLeafVerts[2].x - center.x;
// First, test overlap in the {x,y,z}-directions
#ifdef OPC_USE_FCOMI
// find min, max of the triangle in x-direction, and test for overlap in X
if(FCMin3(v0.x, v1.x, v2.x)>extents.x) return FALSE;
if(FCMax3(v0.x, v1.x, v2.x)<-extents.x) return FALSE;
// same for Y
v0.y = mLeafVerts[0].y - center.y;
v1.y = mLeafVerts[1].y - center.y;
v2.y = mLeafVerts[2].y - center.y;
if(FCMin3(v0.y, v1.y, v2.y)>extents.y) return FALSE;
if(FCMax3(v0.y, v1.y, v2.y)<-extents.y) return FALSE;
// same for Z
v0.z = mLeafVerts[0].z - center.z;
v1.z = mLeafVerts[1].z - center.z;
v2.z = mLeafVerts[2].z - center.z;
if(FCMin3(v0.z, v1.z, v2.z)>extents.z) return FALSE;
if(FCMax3(v0.z, v1.z, v2.z)<-extents.z) return FALSE;
#else
float min,max;
// Find min, max of the triangle in x-direction, and test for overlap in X
FINDMINMAX(v0.x, v1.x, v2.x, min, max);
if(min>extents.x || max<-extents.x) return FALSE;
// Same for Y
v0.y = mLeafVerts[0].y - center.y;
v1.y = mLeafVerts[1].y - center.y;
v2.y = mLeafVerts[2].y - center.y;
FINDMINMAX(v0.y, v1.y, v2.y, min, max);
if(min>extents.y || max<-extents.y) return FALSE;
// Same for Z
v0.z = mLeafVerts[0].z - center.z;
v1.z = mLeafVerts[1].z - center.z;
v2.z = mLeafVerts[2].z - center.z;
FINDMINMAX(v0.z, v1.z, v2.z, min, max);
if(min>extents.z || max<-extents.z) return FALSE;
#endif
// 2) Test if the box intersects the plane of the triangle
// compute plane equation of triangle: normal*x+d=0
// ### could be precomputed since we use the same leaf triangle several times
const Point e0 = v1 - v0;
const Point e1 = v2 - v1;
const Point normal = e0 ^ e1;
const float d = -normal|v0;
if(!planeBoxOverlap(normal, d, extents)) return FALSE;
// 3) "Class III" tests
if(mFullPrimBoxTest)
{
IMPLEMENT_CLASS3_TESTS
}
return TRUE;
}
//! A dedicated version where the box is constant
inline_ BOOL OBBCollider::TriBoxOverlap()
{
// Stats
mNbVolumePrimTests++;
// Hook
const Point& extents = mBoxExtents;
const Point& v0 = mLeafVerts[0];
const Point& v1 = mLeafVerts[1];
const Point& v2 = mLeafVerts[2];
// use separating axis theorem to test overlap between triangle and box
// need to test for overlap in these directions:
// 1) the {x,y,z}-directions (actually, since we use the AABB of the triangle
// we do not even need to test these)
// 2) normal of the triangle
// 3) crossproduct(edge from tri, {x,y,z}-directin)
// this gives 3x3=9 more tests
// Box center is already in (0,0,0)
// First, test overlap in the {x,y,z}-directions
#ifdef OPC_USE_FCOMI
// find min, max of the triangle in x-direction, and test for overlap in X
if(FCMin3(v0.x, v1.x, v2.x)>mBoxExtents.x) return FALSE;
if(FCMax3(v0.x, v1.x, v2.x)<-mBoxExtents.x) return FALSE;
if(FCMin3(v0.y, v1.y, v2.y)>mBoxExtents.y) return FALSE;
if(FCMax3(v0.y, v1.y, v2.y)<-mBoxExtents.y) return FALSE;
if(FCMin3(v0.z, v1.z, v2.z)>mBoxExtents.z) return FALSE;
if(FCMax3(v0.z, v1.z, v2.z)<-mBoxExtents.z) return FALSE;
#else
float min,max;
// Find min, max of the triangle in x-direction, and test for overlap in X
FINDMINMAX(v0.x, v1.x, v2.x, min, max);
if(min>mBoxExtents.x || max<-mBoxExtents.x) return FALSE;
FINDMINMAX(v0.y, v1.y, v2.y, min, max);
if(min>mBoxExtents.y || max<-mBoxExtents.y) return FALSE;
FINDMINMAX(v0.z, v1.z, v2.z, min, max);
if(min>mBoxExtents.z || max<-mBoxExtents.z) return FALSE;
#endif
// 2) Test if the box intersects the plane of the triangle
// compute plane equation of triangle: normal*x+d=0
// ### could be precomputed since we use the same leaf triangle several times
const Point e0 = v1 - v0;
const Point e1 = v2 - v1;
const Point normal = e0 ^ e1;
const float d = -normal|v0;
if(!planeBoxOverlap(normal, d, mBoxExtents)) return FALSE;
// 3) "Class III" tests - here we always do full tests since the box is a primitive (not a BV)
{
IMPLEMENT_CLASS3_TESTS
}
return TRUE;
}
//! ...and another one, jeez
inline_ BOOL AABBCollider::TriBoxOverlap()
{
// Stats
mNbVolumePrimTests++;
// Hook
const Point& center = mBox.mCenter;
const Point& extents = mBox.mExtents;
// use separating axis theorem to test overlap between triangle and box
// need to test for overlap in these directions:
// 1) the {x,y,z}-directions (actually, since we use the AABB of the triangle
// we do not even need to test these)
// 2) normal of the triangle
// 3) crossproduct(edge from tri, {x,y,z}-directin)
// this gives 3x3=9 more tests
// move everything so that the boxcenter is in (0,0,0)
Point v0, v1, v2;
v0.x = mLeafVerts[0].x - center.x;
v1.x = mLeafVerts[1].x - center.x;
v2.x = mLeafVerts[2].x - center.x;
// First, test overlap in the {x,y,z}-directions
#ifdef OPC_USE_FCOMI
// find min, max of the triangle in x-direction, and test for overlap in X
if(FCMin3(v0.x, v1.x, v2.x)>extents.x) return FALSE;
if(FCMax3(v0.x, v1.x, v2.x)<-extents.x) return FALSE;
// same for Y
v0.y = mLeafVerts[0].y - center.y;
v1.y = mLeafVerts[1].y - center.y;
v2.y = mLeafVerts[2].y - center.y;
if(FCMin3(v0.y, v1.y, v2.y)>extents.y) return FALSE;
if(FCMax3(v0.y, v1.y, v2.y)<-extents.y) return FALSE;
// same for Z
v0.z = mLeafVerts[0].z - center.z;
v1.z = mLeafVerts[1].z - center.z;
v2.z = mLeafVerts[2].z - center.z;
if(FCMin3(v0.z, v1.z, v2.z)>extents.z) return FALSE;
if(FCMax3(v0.z, v1.z, v2.z)<-extents.z) return FALSE;
#else
float min,max;
// Find min, max of the triangle in x-direction, and test for overlap in X
FINDMINMAX(v0.x, v1.x, v2.x, min, max);
if(min>extents.x || max<-extents.x) return FALSE;
// Same for Y
v0.y = mLeafVerts[0].y - center.y;
v1.y = mLeafVerts[1].y - center.y;
v2.y = mLeafVerts[2].y - center.y;
FINDMINMAX(v0.y, v1.y, v2.y, min, max);
if(min>extents.y || max<-extents.y) return FALSE;
// Same for Z
v0.z = mLeafVerts[0].z - center.z;
v1.z = mLeafVerts[1].z - center.z;
v2.z = mLeafVerts[2].z - center.z;
FINDMINMAX(v0.z, v1.z, v2.z, min, max);
if(min>extents.z || max<-extents.z) return FALSE;
#endif
// 2) Test if the box intersects the plane of the triangle
// compute plane equation of triangle: normal*x+d=0
// ### could be precomputed since we use the same leaf triangle several times
const Point e0 = v1 - v0;
const Point e1 = v2 - v1;
const Point normal = e0 ^ e1;
const float d = -normal|v0;
if(!planeBoxOverlap(normal, d, extents)) return FALSE;
// 3) "Class III" tests - here we always do full tests since the box is a primitive (not a BV)
{
IMPLEMENT_CLASS3_TESTS
}
return TRUE;
}
| {
"pile_set_name": "Github"
} |
To get emoji support:
Go to https://github.com/github/gemoji/tree/master/images/emoji/unicode
and copy the images into this directory.
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env sh
# generated from catkin/cmake/template/setup.sh.in
# Sets various environment variables and sources additional environment hooks.
# It tries it's best to undo changes from a previously sourced setup file before.
# Supported command line options:
# --extend: skips the undoing of changes from a previously sourced setup file
# since this file is sourced either use the provided _CATKIN_SETUP_DIR
# or fall back to the destination set at configure time
: ${_CATKIN_SETUP_DIR:=/home/ericyanng/ROS_WORKSPACE/slamCourse/3_class/mono-slam/build/devel}
_SETUP_UTIL="$_CATKIN_SETUP_DIR/_setup_util.py"
unset _CATKIN_SETUP_DIR
if [ ! -f "$_SETUP_UTIL" ]; then
echo "Missing Python script: $_SETUP_UTIL"
return 22
fi
# detect if running on Darwin platform
_UNAME=`uname -s`
_IS_DARWIN=0
if [ "$_UNAME" = "Darwin" ]; then
_IS_DARWIN=1
fi
unset _UNAME
# make sure to export all environment variables
export CMAKE_PREFIX_PATH
export CPATH
if [ $_IS_DARWIN -eq 0 ]; then
export LD_LIBRARY_PATH
else
export DYLD_LIBRARY_PATH
fi
unset _IS_DARWIN
export PATH
export PKG_CONFIG_PATH
export PYTHONPATH
# remember type of shell if not already set
if [ -z "$CATKIN_SHELL" ]; then
CATKIN_SHELL=sh
fi
# invoke Python script to generate necessary exports of environment variables
# use TMPDIR if it exists, otherwise fall back to /tmp
if [ -d "${TMPDIR}" ]; then
_TMPDIR="${TMPDIR}"
else
_TMPDIR=/tmp
fi
_SETUP_TMP=`mktemp "${_TMPDIR}/setup.sh.XXXXXXXXXX"`
unset _TMPDIR
if [ $? -ne 0 -o ! -f "$_SETUP_TMP" ]; then
echo "Could not create temporary file: $_SETUP_TMP"
return 1
fi
CATKIN_SHELL=$CATKIN_SHELL "$_SETUP_UTIL" $@ >> "$_SETUP_TMP"
_RC=$?
if [ $_RC -ne 0 ]; then
if [ $_RC -eq 2 ]; then
echo "Could not write the output of '$_SETUP_UTIL' to temporary file '$_SETUP_TMP': may be the disk if full?"
else
echo "Failed to run '\"$_SETUP_UTIL\" $@': return code $_RC"
fi
unset _RC
unset _SETUP_UTIL
rm -f "$_SETUP_TMP"
unset _SETUP_TMP
return 1
fi
unset _RC
unset _SETUP_UTIL
. "$_SETUP_TMP"
rm -f "$_SETUP_TMP"
unset _SETUP_TMP
# source all environment hooks
_i=0
while [ $_i -lt $_CATKIN_ENVIRONMENT_HOOKS_COUNT ]; do
eval _envfile=\$_CATKIN_ENVIRONMENT_HOOKS_$_i
unset _CATKIN_ENVIRONMENT_HOOKS_$_i
eval _envfile_workspace=\$_CATKIN_ENVIRONMENT_HOOKS_${_i}_WORKSPACE
unset _CATKIN_ENVIRONMENT_HOOKS_${_i}_WORKSPACE
# set workspace for environment hook
CATKIN_ENV_HOOK_WORKSPACE=$_envfile_workspace
. "$_envfile"
unset CATKIN_ENV_HOOK_WORKSPACE
_i=$((_i + 1))
done
unset _i
unset _CATKIN_ENVIRONMENT_HOOKS_COUNT
| {
"pile_set_name": "Github"
} |
// --------------------------------------------------------------------------------------------
// <copyright file="CommandActionParameter.cs" company="Effort Team">
// Copyright (C) Effort Team
//
// 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.
// </copyright>
// --------------------------------------------------------------------------------------------
namespace Effort.Internal.CommandActions
{
internal class CommandActionParameter
{
public CommandActionParameter(string name, object value)
{
this.Name = name;
this.Value = value;
}
public string Name { get; private set; }
public object Value { get; private set; }
}
}
| {
"pile_set_name": "Github"
} |
src/backend/utils/misc/README
GUC Implementation Notes
========================
The GUC (Grand Unified Configuration) module implements configuration
variables of multiple types (currently boolean, enum, int, real, and string).
Variable settings can come from various places, with a priority ordering
determining which setting is used.
Per-Variable Hooks
------------------
Each variable known to GUC can optionally have a check_hook, an
assign_hook, and/or a show_hook to provide customized behavior.
Check hooks are used to perform validity checking on variable values
(above and beyond what GUC can do), to compute derived settings when
nontrivial work is needed to do that, and optionally to "canonicalize"
user-supplied values. Assign hooks are used to update any derived state
that needs to change when a GUC variable is set. Show hooks are used to
modify the default SHOW display for a variable.
If a check_hook is provided, it points to a function of the signature
bool check_hook(datatype *newvalue, void **extra, GucSource source)
The "newvalue" argument is of type bool *, int *, double *, or char **
for bool, int/enum, real, or string variables respectively. The check
function should validate the proposed new value, and return true if it is
OK or false if not. The function can optionally do a few other things:
* When rejecting a bad proposed value, it may be useful to append some
additional information to the generic "invalid value for parameter FOO"
complaint that guc.c will emit. To do that, call
void GUC_check_errdetail(const char *format, ...)
where the format string and additional arguments follow the rules for
errdetail() arguments. The resulting string will be emitted as the
DETAIL line of guc.c's error report, so it should follow the message style
guidelines for DETAIL messages. There is also
void GUC_check_errhint(const char *format, ...)
which can be used in the same way to append a HINT message.
Occasionally it may even be appropriate to override guc.c's generic primary
message or error code, which can be done with
void GUC_check_errcode(int sqlerrcode)
void GUC_check_errmsg(const char *format, ...)
In general, check_hooks should avoid throwing errors directly if possible,
though this may be impractical to avoid for some corner cases such as
out-of-memory.
* Since the newvalue is pass-by-reference, the function can modify it.
This might be used for example to canonicalize the spelling of a string
value, round off a buffer size to the nearest supported value, or replace
a special value such as "-1" with a computed default value. If the
function wishes to replace a string value, it must malloc (not palloc)
the replacement value, and be sure to free() the previous value.
* Derived information, such as the role OID represented by a user name,
can be stored for use by the assign hook. To do this, malloc (not palloc)
storage space for the information, and return its address at *extra.
guc.c will automatically free() this space when the associated GUC setting
is no longer of interest. *extra is initialized to NULL before call, so
it can be ignored if not needed.
The "source" argument indicates the source of the proposed new value,
If it is >= PGC_S_INTERACTIVE, then we are performing an interactive
assignment (e.g., a SET command). But when source < PGC_S_INTERACTIVE,
we are reading a non-interactive option source, such as postgresql.conf.
This is sometimes needed to determine whether a setting should be
allowed. The check_hook might also look at the current actual value of
the variable to determine what is allowed.
Note that check hooks are sometimes called just to validate a value,
without any intention of actually changing the setting. Therefore the
check hook must *not* take any action based on the assumption that an
assignment will occur.
If an assign_hook is provided, it points to a function of the signature
void assign_hook(datatype newvalue, void *extra)
where the type of "newvalue" matches the kind of variable, and "extra"
is the derived-information pointer returned by the check_hook (always
NULL if there is no check_hook). This function is called immediately
before actually setting the variable's value (so it can look at the actual
variable to determine the old value, for example to avoid doing work when
the value isn't really changing).
Note that there is no provision for a failure result code. assign_hooks
should never fail except under the most dire circumstances, since a failure
may for example result in GUC settings not being rolled back properly during
transaction abort. In general, try to do anything that could conceivably
fail in a check_hook instead, and pass along the results in an "extra"
struct, so that the assign hook has little to do beyond copying the data to
someplace. This applies particularly to catalog lookups: any required
lookups must be done in the check_hook, since the assign_hook may be
executed during transaction rollback when lookups will be unsafe.
Note that check_hooks are sometimes called outside any transaction, too.
This happens when processing the wired-in "bootstrap" value, values coming
from the postmaster command line or environment, or values coming from
postgresql.conf. Therefore, any catalog lookups done in a check_hook
should be guarded with an IsTransactionState() test, and there must be a
fallback path to allow derived values to be computed during the first
subsequent use of the GUC setting within a transaction. A typical
arrangement is for the catalog values computed by the check_hook and
installed by the assign_hook to be used only for the remainder of the
transaction in which the new setting is made. Each subsequent transaction
looks up the values afresh on first use. This arrangement is useful to
prevent use of stale catalog values, independently of the problem of
needing to check GUC values outside a transaction.
If a show_hook is provided, it points to a function of the signature
const char *show_hook(void)
This hook allows variable-specific computation of the value displayed
by SHOW (and other SQL features for showing GUC variable values).
The return value can point to a static buffer, since show functions are
not used reentrantly.
Saving/Restoring GUC Variable Values
------------------------------------
Prior values of configuration variables must be remembered in order to deal
with several special cases: RESET (a/k/a SET TO DEFAULT), rollback of SET
on transaction abort, rollback of SET LOCAL at transaction end (either
commit or abort), and save/restore around a function that has a SET option.
RESET is defined as selecting the value that would be effective had there
never been any SET commands in the current session.
To handle these cases we must keep track of many distinct values for each
variable. The primary values are:
* actual variable contents always the current effective value
* reset_val the value to use for RESET
(Each GUC entry also has a boot_val which is the wired-in default value.
This is assigned to the reset_val and the actual variable during
InitializeGUCOptions(). The boot_val is also consulted to restore the
correct reset_val if SIGHUP processing discovers that a variable formerly
specified in postgresql.conf is no longer set there.)
In addition to the primary values, there is a stack of former effective
values that might need to be restored in future. Stacking and unstacking
is controlled by the GUC "nest level", which is zero when outside any
transaction, one at top transaction level, and incremented for each
open subtransaction or function call with a SET option. A stack entry
is made whenever a GUC variable is first modified at a given nesting level.
(Note: the reset_val need not be stacked because it is only changed by
non-transactional operations.)
A stack entry has a state, a prior value of the GUC variable, a remembered
source of that prior value, and depending on the state may also have a
"masked" value. The masked value is needed when SET followed by SET LOCAL
occur at the same nest level: the SET's value is masked but must be
remembered to restore after transaction commit.
During initialization we set the actual value and reset_val based on
whichever non-interactive source has the highest priority. They will
have the same value.
The possible transactional operations on a GUC value are:
Entry to a function with a SET option:
Push a stack entry with the prior variable value and state SAVE,
then set the variable.
Plain SET command:
If no stack entry of current level:
Push new stack entry w/prior value and state SET
else if stack entry's state is SAVE, SET, or LOCAL:
change stack state to SET, don't change saved value
(here we are forgetting effects of prior set action)
else (entry must have state SET+LOCAL):
discard its masked value, change state to SET
(here we are forgetting effects of prior SET and SET LOCAL)
Now set new value.
SET LOCAL command:
If no stack entry of current level:
Push new stack entry w/prior value and state LOCAL
else if stack entry's state is SAVE or LOCAL or SET+LOCAL:
no change to stack entry
(in SAVE case, SET LOCAL will be forgotten at func exit)
else (entry must have state SET):
put current active into its masked slot, set state SET+LOCAL
Now set new value.
Transaction or subtransaction abort:
Pop stack entries, restoring prior value, until top < subxact depth
Transaction or subtransaction commit (incl. successful function exit):
While stack entry level >= subxact depth
if entry's state is SAVE:
pop, restoring prior value
else if level is 1 and entry's state is SET+LOCAL:
pop, restoring *masked* value
else if level is 1 and entry's state is SET:
pop, discarding old value
else if level is 1 and entry's state is LOCAL:
pop, restoring prior value
else if there is no entry of exactly level N-1:
decrement entry's level, no other state change
else
merge entries of level N-1 and N as specified below
The merged entry will have level N-1 and prior = older prior, so easiest
to keep older entry and free newer. There are 12 possibilities since
we already handled level N state = SAVE:
N-1 N
SAVE SET discard top prior, set state SET
SAVE LOCAL discard top prior, no change to stack entry
SAVE SET+LOCAL discard top prior, copy masked, state S+L
SET SET discard top prior, no change to stack entry
SET LOCAL copy top prior to masked, state S+L
SET SET+LOCAL discard top prior, copy masked, state S+L
LOCAL SET discard top prior, set state SET
LOCAL LOCAL discard top prior, no change to stack entry
LOCAL SET+LOCAL discard top prior, copy masked, state S+L
SET+LOCAL SET discard top prior and second masked, state SET
SET+LOCAL LOCAL discard top prior, no change to stack entry
SET+LOCAL SET+LOCAL discard top prior, copy masked, state S+L
RESET is executed like a SET, but using the reset_val as the desired new
value. (We do not provide a RESET LOCAL command, but SET LOCAL TO DEFAULT
has the same behavior that RESET LOCAL would.) The source associated with
the reset_val also becomes associated with the actual value.
If SIGHUP is received, the GUC code rereads the postgresql.conf
configuration file (this does not happen in the signal handler, but at
next return to main loop; note that it can be executed while within a
transaction). New values from postgresql.conf are assigned to actual
variable, reset_val, and stacked actual values, but only if each of
these has a current source priority <= PGC_S_FILE. (It is thus possible
for reset_val to track the config-file setting even if there is
currently a different interactive value of the actual variable.)
The check_hook, assign_hook and show_hook routines work only with the
actual variable, and are not directly aware of the additional values
maintained by GUC.
GUC Memory Handling
-------------------
String variable values are allocated with malloc/strdup, not with the
palloc/pstrdup mechanisms. We would need to keep them in a permanent
context anyway, and malloc gives us more control over handling
out-of-memory failures.
We allow a string variable's actual value, reset_val, boot_val, and stacked
values to point at the same storage. This makes it slightly harder to free
space (we must test whether a value to be freed isn't equal to any of the
other pointers in the GUC entry or associated stack items). The main
advantage is that we never need to malloc during transaction commit/abort,
so cannot cause an out-of-memory failure there.
"Extra" structs returned by check_hook routines are managed in the same
way as string values. Note that we support "extra" structs for all types
of GUC variables, although they are mainly useful with strings.
GUC and Null String Variables
-----------------------------
A GUC string variable can have a boot_val of NULL. guc.c handles this
unsurprisingly, assigning the NULL to the underlying C variable. Any code
using such a variable, as well as any hook functions for it, must then be
prepared to deal with a NULL value.
However, it is not possible to assign a NULL value to a GUC string
variable in any other way: values coming from SET, postgresql.conf, etc,
might be empty strings, but they'll never be NULL. And SHOW displays
a NULL the same as an empty string. It is therefore not appropriate to
treat a NULL value as a distinct user-visible setting. A typical use
for a NULL boot_val is to denote that a value hasn't yet been set for
a variable that will receive a real value later in startup.
If it's undesirable for code using the underlying C variable to have to
worry about NULL values ever, the variable can be given a non-null static
initializer as well as a non-null boot_val. guc.c will overwrite the
static initializer pointer with a copy of the boot_val during
InitializeGUCOptions, but the variable will never contain a NULL.
GUC Synchronization
-------------------
Due to distributed character of gpdb, each GUC needs to declare whether
it needs to sync value between master and primaries. If you want to
introduce a new GUC in guc.c or guc_gp.c, the GUC's name must be populated
into either sync_guc_name.h or unsync_guc_name.h. If not, gpdb will raise an
ERROR in run-time.
For custom GUC, if it has synchronization requirement, add GUC_GPDB_NEED_SYNC
bit into the GUC flag. Otherwise, system will default add GUC_GPDB_NO_SYNC
flag bit for it as it can not synchronize in cluster.
A GUC ought to be synchronized only if the scope is whole cluster as well as
the value must be same between master and primaries.
| {
"pile_set_name": "Github"
} |
! RUN: %f18 -E %s 2>&1 | FileCheck %s
! CHECK: res=((666)+111)
* FLM call split between name and (, clipped
integer function IFLM(x)
integer :: x
IFLM = x
end function IFLM
program main
#define IFLM(x) ((x)+111)
integer :: res
* 'comment' is in column 73
* 1 2 3 4 5 6 7
*234567890123456789012345678901234567890123456789012345678901234567890123
res = IFLM comment
+(666)
if (res .eq. 777) then
print *, 'pp015.F yes'
else
print *, 'pp015.F no: ', res
end if
end
| {
"pile_set_name": "Github"
} |
/**
* @file wm_wl_timers.h
*
* @brief task APIs
*
* @author dave
*
* Copyright (c) 2015 Winner Microelectronics Co., Ltd.
*/
#ifndef __TLS_WL_TIMERS_H__
#define __TLS_WL_TIMERS_H__
#include "wm_type_def.h"
#include "wm_wl_mbox.h"
/** callback function of time out */
typedef void (* tls_timeout_handler)(void *arg);
/**
* @defgroup System_APIs System APIs
* @brief System APIs
*/
/**
* @addtogroup System_APIs
* @{
*/
/**
* @defgroup Timer_APIs Timer APIs
* @brief Software timer APIs
*/
/**
* @addtogroup Timer_APIs
* @{
*/
/**
* @brief Create a one-shot timer (aka timeout)
*
* @param[in] timeo_assigned timer NO. by assigned
* @param[in] msecs time in milliseconds after that the timer should expire
* @param[in] handler callback function that would be called by the timeout
* @param[in] *arg callback argument that would be passed to handler
*
* @return None
*
* @note While waiting for a message using sys_timeouts_mbox_fetch()
*/
void tls_timeout_p(u8 timeo_assigned, u32 msecs, tls_timeout_handler handler, void *arg);
/**
* @brief Go through timeout list (for this task only) and remove the first
* matching entry, even though the timeout has not been triggered yet
*
* @param[in] timeo_assigned timer NO. by assigned
* @param[in] handler callback function that would be called by the timeout
* @param[in] *arg callback argument that would be passed to handler
*
* @return None
*
* @note None
*/
void tls_untimeout_p(u8 timeo_assigned, tls_timeout_handler handler, void *arg);
/**
* @brief Wait (forever) for a message to arrive in an mbox.
* While waiting, timeouts are processed
*
* @param[in] timeo_assigned timer NO. by assigned
* @param[in] mbox the mbox to fetch the message from
* @param[out] **msg the place to store the message
*
* @return None
*
* @note None
*/
void tls_timeouts_mbox_fetch_p(u8 timeo_assigned, tls_mbox_t mbox, void **msg);
/**
* @brief Initialize the timer
*
* @param None
*
* @retval 0 success
* @retval other failed
*
* @note None
*/
s8 tls_wl_timer_init(void);
/**
* @}
*/
/**
* @}
*/
#endif
| {
"pile_set_name": "Github"
} |
// -*- C++ -*-
// Copyright (C) 2005-2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library 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, or (at your option) any later
// version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
// Permission to use, copy, modify, sell, and distribute this software
// is hereby granted without fee, provided that the above copyright
// notice appears in all copies, and that both that copyright notice
// and this permission notice appear in supporting documentation. None
// of the above authors, nor IBM Haifa Research Laboratories, make any
// representation about the suitability of this software for any
// purpose. It is provided "as is" without express or implied
// warranty.
/**
* @file left_child_next_sibling_heap_/iterators_fn_imps.hpp
* Contains an implementation class for left_child_next_sibling_heap_.
*/
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::iterator
PB_DS_CLASS_C_DEC::
begin()
{
node_pointer p_nd = m_p_root;
if (p_nd == 0)
return (iterator(0));
while (p_nd->m_p_l_child != 0)
p_nd = p_nd->m_p_l_child;
return (iterator(p_nd));
}
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::const_iterator
PB_DS_CLASS_C_DEC::
begin() const
{
node_pointer p_nd = m_p_root;
if (p_nd == 0)
return (const_iterator(0));
while (p_nd->m_p_l_child != 0)
p_nd = p_nd->m_p_l_child;
return (const_iterator(p_nd));
}
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::iterator
PB_DS_CLASS_C_DEC::
end()
{
return (iterator(0));
}
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::const_iterator
PB_DS_CLASS_C_DEC::
end() const
{
return (const_iterator(0));
}
| {
"pile_set_name": "Github"
} |
#!/bin/sh
. $TOPDIR/include/site/linux
ac_cv_c_littleendian=${ac_cv_c_littleendian=no}
ac_cv_c_bigendian=${ac_cv_c_bigendian=yes}
ac_cv_sizeof___int64=0
ac_cv_sizeof_char=1
ac_cv_sizeof_int=4
ac_cv_sizeof_int16_t=2
ac_cv_sizeof_int32_t=4
ac_cv_sizeof_int64_t=8
ac_cv_sizeof_long_int=4
ac_cv_sizeof_long_long=8
ac_cv_sizeof_long=4
ac_cv_sizeof_off_t=8
ac_cv_sizeof_short_int=2
ac_cv_sizeof_short=2
ac_cv_sizeof_size_t=4
ac_cv_sizeof_ssize_t=4
ac_cv_sizeof_u_int16_t=2
ac_cv_sizeof_u_int32_t=4
ac_cv_sizeof_u_int64_t=8
ac_cv_sizeof_uint16_t=2
ac_cv_sizeof_uint32_t=4
ac_cv_sizeof_uint64_t=8
ac_cv_sizeof_unsigned_int=4
ac_cv_sizeof_unsigned_long=4
ac_cv_sizeof_unsigned_long_long=8
ac_cv_sizeof_unsigned_short=2
ac_cv_sizeof_void_p=4
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<resources name="en" flag="gb" title="English">
<string name="_bx_shopify"><![CDATA[Shopify]]></string>
<string name="_bx_shopify_cmts"><![CDATA[Shopify's Reviews]]></string>
<string name="_bx_shopify_option_per_page_browse"><![CDATA[Number of items per page]]></string>
<string name="_bx_shopify_option_per_page_profile"><![CDATA[Number of items on profile page]]></string>
<string name="_bx_shopify_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
<string name="_bx_shopify_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
<string name="_bx_shopify_form_entry"><![CDATA[Goods]]></string>
<string name="_bx_shopify_form_entry_display_add"><![CDATA[Add Goods]]></string>
<string name="_bx_shopify_form_entry_display_edit"><![CDATA[Edit Goods]]></string>
<string name="_bx_shopify_form_entry_display_delete"><![CDATA[Delete Goods]]></string>
<string name="_bx_shopify_form_entry_display_view"><![CDATA[View Goods]]></string>
<string name="_bx_shopify_form_entry_input_author"><![CDATA[Author]]></string>
<string name="_bx_shopify_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
<string name="_bx_shopify_form_entry_input_do_submit"><![CDATA[Submit]]></string>
<string name="_bx_shopify_form_entry_input_sys_do_publish"><![CDATA[Publish]]></string>
<string name="_bx_shopify_form_entry_input_do_publish"><![CDATA[Publish]]></string>
<string name="_bx_shopify_form_entry_input_sys_code"><![CDATA[Product handle]]></string>
<string name="_bx_shopify_form_entry_input_code"><![CDATA[Product handle]]></string>
<string name="_bx_shopify_form_entry_input_code_inf"><![CDATA[The Product handle can be found in 'Search engine listing preview' section when you are editing the product in Products section of your Shopify dashboard.]]></string>
<string name="_bx_shopify_form_entry_input_code_err"><![CDATA[Product ID is essential. Please, fill in this field.]]></string>
<string name="_bx_shopify_form_entry_input_sys_title"><![CDATA[Title]]></string>
<string name="_bx_shopify_form_entry_input_title"><![CDATA[Title]]></string>
<string name="_bx_shopify_form_entry_input_title_err"><![CDATA[Title is essential. Please, fill in this field]]></string>
<string name="_bx_shopify_form_entry_input_sys_cat"><![CDATA[Category]]></string>
<string name="_bx_shopify_form_entry_input_cat"><![CDATA[Category]]></string>
<string name="_bx_shopify_form_entry_input_cat_err"><![CDATA[Please select category]]></string>
<string name="_bx_shopify_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
<string name="_bx_shopify_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this product]]></string>
<string name="_bx_shopify_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
<string name="_bx_shopify_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the product]]></string>
<string name="_bx_shopify_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
<string name="_bx_shopify_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
<string name="_bx_shopify_form_entry_input_picture_use_as_thumb"><![CDATA[Cover Image]]></string>
<string name="_bx_shopify_form_entry_input_sys_date_added"><![CDATA[Created]]></string>
<string name="_bx_shopify_form_entry_input_date_added"><![CDATA[Created]]></string>
<string name="_bx_shopify_form_entry_input_sys_date_changed"><![CDATA[Updated]]></string>
<string name="_bx_shopify_form_entry_input_date_changed"><![CDATA[Updated]]></string>
<string name="_bx_shopify_form_settings"><![CDATA[Settings]]></string>
<string name="_bx_shopify_form_settings_display_edit"><![CDATA[Edit Settings]]></string>
<string name="_bx_shopify_form_settings_input_sys_domain"><![CDATA[Domain]]></string>
<string name="_bx_shopify_form_settings_input_domain"><![CDATA[Domain]]></string>
<string name="_bx_shopify_form_settings_input_domain_err"><![CDATA[This field can't be empty]]></string>
<string name="_bx_shopify_form_settings_input_sys_access_token"><![CDATA[Storefront access token]]></string>
<string name="_bx_shopify_form_settings_input_access_token"><![CDATA[Storefront access token]]></string>
<string name="_bx_shopify_form_settings_input_access_token_err"><![CDATA[This field can't be empty]]></string>
<string name="_bx_shopify_form_settings_input_sys_do_submit"><![CDATA[Submit]]></string>
<string name="_bx_shopify_form_settings_input_do_submit"><![CDATA[Submit]]></string>
<string name="_bx_shopify_acl_action_create_entry"><![CDATA[Create Goods]]></string>
<string name="_bx_shopify_acl_action_delete_entry"><![CDATA[Delete Goods]]></string>
<string name="_bx_shopify_acl_action_view_entry"><![CDATA[View Goods]]></string>
<string name="_bx_shopify_acl_action_set_thumb"><![CDATA[Set Goods Thumbnail]]></string>
<string name="_bx_shopify_acl_action_edit_any_entry"><![CDATA[Edit Any Goods]]></string>
<string name="_bx_shopify_page_title_sys_create_entry"><![CDATA[New Goods]]></string>
<string name="_bx_shopify_page_title_create_entry"><![CDATA[New Item]]></string>
<string name="_bx_shopify_page_block_title_create_entry"><![CDATA[New Item]]></string>
<string name="_bx_shopify_page_title_sys_edit_entry"><![CDATA[Edit]]></string>
<string name="_bx_shopify_page_title_edit_entry"><![CDATA[Edit]]></string>
<string name="_bx_shopify_page_block_title_edit_entry"><![CDATA[Edit]]></string>
<string name="_bx_shopify_page_title_sys_delete_entry"><![CDATA[Delete]]></string>
<string name="_bx_shopify_page_title_delete_entry"><![CDATA[Delete]]></string>
<string name="_bx_shopify_page_block_title_delete_entry"><![CDATA[Delete]]></string>
<string name="_bx_shopify_page_title_sys_view_entry"><![CDATA[View Goods]]></string>
<string name="_bx_shopify_page_title_view_entry"><![CDATA[{title}]]></string>
<string name="_bx_shopify_page_block_title_entry_text"><![CDATA[Item Text]]></string>
<string name="_bx_shopify_page_title_browse"><![CDATA[Goods]]></string>
<string name="_bx_shopify_page_title_search_results"><![CDATA[Goods matching "{0}"]]></string>
<string name="_bx_shopify_page_title_browse_by_author"><![CDATA[Goods of {display_name}]]></string>
<string name="_bx_shopify_page_title_browse_by_context"><![CDATA[Goods in {display_name}]]></string>
<string name="_bx_shopify_page_title_browse_featured"><![CDATA[Featured Goods]]></string>
<string name="_bx_shopify_page_title_browse_recent"><![CDATA[Latest Goods]]></string>
<string name="_bx_shopify_page_title_browse_popular"><![CDATA[Popular Goods]]></string>
<string name="_bx_shopify_page_title_browse_updated"><![CDATA[Updated Goods]]></string>
<string name="_bx_shopify_page_title_sys_home"><![CDATA[Goods Home]]></string>
<string name="_bx_shopify_page_title_home"><![CDATA[Goods]]></string>
<string name="_bx_shopify_page_block_title_featured_entries_view_extended"><![CDATA[Featured Goods]]></string>
<string name="_bx_shopify_page_block_title_recent_entries"><![CDATA[Latest Goods (Gallery View)]]></string>
<string name="_bx_shopify_page_block_title_recent_entries_view_extended"><![CDATA[Latest Goods]]></string>
<string name="_bx_shopify_page_block_title_recent_entries_view_full"><![CDATA[Latest Goods (Full View)]]></string>
<string name="_bx_shopify_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
<string name="_bx_shopify_page_block_title_entry_author"><![CDATA[Author]]></string>
<string name="_bx_shopify_page_block_title_entry_actions"><![CDATA[Actions]]></string>
<string name="_bx_shopify_page_block_title_entry_comments"><![CDATA[Comments]]></string>
<string name="_bx_shopify_page_block_title_entry_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
<string name="_bx_shopify_page_block_title_entry_location"><![CDATA[Location]]></string>
<string name="_bx_shopify_page_block_title_entry_attachments"><![CDATA[Attachments]]></string>
<string name="_bx_shopify_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
<string name="_bx_shopify_page_title_sys_entries_popular"><![CDATA[Popular Goods]]></string>
<string name="_bx_shopify_page_title_entries_popular"><![CDATA[Popular Goods]]></string>
<string name="_bx_shopify_page_title_sys_entries_updated"><![CDATA[Updated Goods]]></string>
<string name="_bx_shopify_page_title_entries_updated"><![CDATA[Updated Goods]]></string>
<string name="_bx_shopify_page_block_title_popular_entries"><![CDATA[Popular Goods]]></string>
<string name="_bx_shopify_page_block_title_popular_entries_view_extended"><![CDATA[Popular Goods (Extended View)]]></string>
<string name="_bx_shopify_page_block_title_popular_entries_view_full"><![CDATA[Popular Goods (Full View)]]></string>
<string name="_bx_shopify_page_block_title_updated_entries"><![CDATA[Updated Goods]]></string>
<string name="_bx_shopify_page_title_sys_view_entry_comments"><![CDATA[Goods Comments]]></string>
<string name="_bx_shopify_page_title_view_entry_comments"><![CDATA[Comments to {title}]]></string>
<string name="_bx_shopify_page_title_sys_entries_of_author"><![CDATA[Goods of author]]></string>
<string name="_bx_shopify_page_title_entries_of_author"><![CDATA[Goods by {display_name}]]></string>
<string name="_bx_shopify_page_title_sys_entries_in_context"><![CDATA[Goods in context]]></string>
<string name="_bx_shopify_page_title_entries_in_context"><![CDATA[Goods in {display_name}]]></string>
<string name="_bx_shopify_page_block_title_favorites_of_author"><![CDATA[Favorites by <a href="{profile_link}">{display_name}</a>]]></string>
<string name="_bx_shopify_page_block_title_sys_favorites_of_author"><![CDATA[Favorites of author]]></string>
<string name="_bx_shopify_page_block_title_entries_of_author"><![CDATA[Goods by <a href="{profile_link}">{display_name}</a>]]></string>
<string name="_bx_shopify_page_block_title_sys_entries_of_author"><![CDATA[Goods of author]]></string>
<string name="_bx_shopify_page_block_title_entries_in_context"><![CDATA[Goods in <a href="{profile_link}">{display_name}</a>]]></string>
<string name="_bx_shopify_page_block_title_sys_entries_in_context"><![CDATA[Goods in context]]></string>
<string name="_bx_shopify_page_block_title_entries_actions"><![CDATA[Goods actions]]></string>
<string name="_bx_shopify_page_block_title_browse_cmts"><![CDATA[Goods' Comments]]></string>
<string name="_bx_shopify_page_title_sys_manage"><![CDATA[Manage Own]]></string>
<string name="_bx_shopify_page_title_sys_manage_administration"><![CDATA[Manage All]]></string>
<string name="_bx_shopify_page_title_manage"><![CDATA[Manage]]></string>
<string name="_bx_shopify_page_block_title_system_manage"><![CDATA[Manage Own]]></string>
<string name="_bx_shopify_page_block_title_system_manage_administration"><![CDATA[Manage All]]></string>
<string name="_bx_shopify_page_block_title_manage"><![CDATA[Manage]]></string>
<string name="_bx_shopify_page_block_title_popular_keywords"><![CDATA[Popular Hashtags]]></string>
<string name="_bx_shopify_page_block_title_cats"><![CDATA[Goods Categories]]></string>
<string name="_bx_shopify_page_block_title_entry_info"><![CDATA[Info]]></string>
<string name="_bx_shopify_page_block_title_my_entries"><![CDATA[My Goods]]></string>
<string name="_bx_shopify_page_title_sys_settings"><![CDATA[Settings]]></string>
<string name="_bx_shopify_page_title_settings"><![CDATA[Settings]]></string>
<string name="_bx_shopify_page_block_title_system_settings"><![CDATA[Settings]]></string>
<string name="_bx_shopify_page_block_title_settings"><![CDATA[Settings]]></string>
<string name="_bx_shopify_page_title_sys_entries_search"><![CDATA[Search]]></string>
<string name="_bx_shopify_page_title_entries_search"><![CDATA[Search]]></string>
<string name="_bx_shopify_page_block_title_search_form"><![CDATA[Search Form]]></string>
<string name="_bx_shopify_page_block_title_search_results"><![CDATA[Search Results]]></string>
<string name="_bx_shopify_page_block_title_search_form_cmts"><![CDATA[Comments Search Form]]></string>
<string name="_bx_shopify_page_block_title_search_results_cmts"><![CDATA[Comments Search Results]]></string>
<string name="_bx_shopify_page_block_title_sys_recent_entries_view_showcase"><![CDATA[Latest Goods (Showcase View)]]></string>
<string name="_bx_shopify_page_block_title_recent_entries_view_showcase"><![CDATA[Latest Goods]]></string>
<string name="_bx_shopify_page_block_title_sys_popular_entries_view_showcase"><![CDATA[Popular Goods (Showcase View)]]></string>
<string name="_bx_shopify_page_block_title_popular_entries_view_showcase"><![CDATA[Popular Goods]]></string>
<string name="_bx_shopify_page_block_title_sys_featured_entries_view_showcase"><![CDATA[Featured Goods (Showcase View)]]></string>
<string name="_bx_shopify_page_block_title_featured_entries_view_showcase"><![CDATA[Featured Goods]]></string>
<string name="_bx_shopify_page_block_title_sys_entry_context"><![CDATA[Posted in]]></string>
<string name="_bx_shopify_page_block_title_entry_context"><![CDATA[Posted in]]></string>
<string name="_bx_shopify_menu_set_title_view_entry"><![CDATA[Goods Actions]]></string>
<string name="_bx_shopify_menu_title_view_entry"><![CDATA[Goods Actions]]></string>
<string name="_bx_shopify_menu_title_submenu"><![CDATA[Goods Submenu]]></string>
<string name="_bx_shopify_menu_set_title_submenu"><![CDATA[Goods Submenu]]></string>
<string name="_bx_shopify_menu_item_title_system_buy_entry"><![CDATA[Buy]]></string>
<string name="_bx_shopify_menu_item_title_buy_entry"><![CDATA[Buy]]></string>
<string name="_bx_shopify_menu_item_title_system_create_entry"><![CDATA[Goods]]></string>
<string name="_bx_shopify_menu_item_title_create_entry"><![CDATA[Goods]]></string>
<string name="_bx_shopify_menu_item_title_system_edit_entry"><![CDATA[Edit]]></string>
<string name="_bx_shopify_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
<string name="_bx_shopify_menu_item_title_system_delete_entry"><![CDATA[Delete]]></string>
<string name="_bx_shopify_menu_item_title_delete_entry"><![CDATA[Delete]]></string>
<string name="_bx_shopify_menu_item_title_system_view_entry"><![CDATA[View Goods]]></string>
<string name="_bx_shopify_menu_item_title_system_entries_home"><![CDATA[Shop]]></string>
<string name="_bx_shopify_menu_item_title_entries_home"><![CDATA[Shop]]></string>
<string name="_bx_shopify_menu_item_title_system_entries_public"><![CDATA[Latest]]></string>
<string name="_bx_shopify_menu_item_title_entries_public"><![CDATA[Latest]]></string>
<string name="_bx_shopify_menu_item_title_system_entries_search"><![CDATA[Search]]></string>
<string name="_bx_shopify_menu_item_title_entries_search"><![CDATA[Search]]></string>
<string name="_bx_shopify_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
<string name="_bx_shopify_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
<string name="_bx_shopify_menu_item_title_system_settings"><![CDATA[Settings]]></string>
<string name="_bx_shopify_menu_item_title_settings"><![CDATA[Settings]]></string>
<string name="_bx_shopify_menu_item_title_system_dashboard"><![CDATA[Dashboard]]></string>
<string name="_bx_shopify_menu_item_title_dashboard"><![CDATA[Dashboard]]></string>
<string name="_bx_shopify_menu_item_title_system_entries_popular"><![CDATA[Popular]]></string>
<string name="_bx_shopify_menu_item_title_entries_popular"><![CDATA[Popular]]></string>
<string name="_bx_shopify_menu_title_view_entry_submenu"><![CDATA[View Goods Submenu]]></string>
<string name="_bx_shopify_menu_set_title_view_entry_submenu"><![CDATA[View Goods Submenu]]></string>
<string name="_bx_shopify_menu_item_title_view_entry_submenu_entry"><![CDATA[Item]]></string>
<string name="_bx_shopify_menu_item_title_view_entry_submenu_comments"><![CDATA[Comments]]></string>
<string name="_bx_shopify_menu_item_title_system_view_entry_comments"><![CDATA[Goods Comments]]></string>
<string name="_bx_shopify_menu_item_title_system_view_entries_author"><![CDATA[Goods]]></string>
<string name="_bx_shopify_menu_item_title_view_entries_author"><![CDATA[Goods]]></string>
<string name="_bx_shopify_menu_item_title_system_view_entries_in_context"><![CDATA[Goods]]></string>
<string name="_bx_shopify_menu_item_title_view_entries_in_context"><![CDATA[Goods]]></string>
<string name="_bx_shopify_menu_title_entries_my"><![CDATA[My Goods Action Menu]]></string>
<string name="_bx_shopify_menu_set_title_entries_my"><![CDATA[My Goods Menu]]></string>
<string name="_bx_shopify_menu_item_title_system_manage_my_entries"><![CDATA[My goods]]></string>
<string name="_bx_shopify_menu_item_title_manage_my_entries"><![CDATA[Goods]]></string>
<string name="_bx_shopify_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
<string name="_bx_shopify_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
<string name="_bx_shopify_menu_item_title_system_manage_account"><![CDATA[Manage account]]></string>
<string name="_bx_shopify_menu_item_title_manage_account"><![CDATA[Manage account]]></string>
<string name="_bx_shopify_menu_item_title_system_admt_entries"><![CDATA[Goods]]></string>
<string name="_bx_shopify_menu_item_title_admt_entries"><![CDATA[Goods]]></string>
<string name="_bx_shopify_menu_item_title_manage_my"><![CDATA[My Goods]]></string>
<string name="_bx_shopify_menu_item_title_manage_all"><![CDATA[All Goods]]></string>
<string name="_bx_shopify_menu_item_title_buy_for"><![CDATA[Buy for {price}]]></string>
<string name="_bx_shopify_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
<string name="_bx_shopify_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
<string name="_bx_shopify_grid_filter_item_title_adm_hidden"><![CDATA[Hidden]]></string>
<string name="_bx_shopify_grid_column_title_adm_active"><![CDATA[Active]]></string>
<string name="_bx_shopify_grid_column_title_adm_title"><![CDATA[Title]]></string>
<string name="_bx_shopify_grid_column_title_adm_added"><![CDATA[Added]]></string>
<string name="_bx_shopify_grid_column_title_adm_author"><![CDATA[Author]]></string>
<string name="_bx_shopify_grid_action_title_adm_edit"><![CDATA[Edit]]></string>
<string name="_bx_shopify_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
<string name="_bx_shopify_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
<string name="_bx_shopify_grid_action_err_delete"><![CDATA[Cannot delete the selected product(s).]]></string>
<string name="_bx_shopify_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
<string name="_bx_shopify_chart_growth"><![CDATA[Shopify: Growth]]></string>
<string name="_bx_shopify_chart_growth_speed"><![CDATA[Shopify: Growth Speed]]></string>
<string name="_bx_shopify_search_extended"><![CDATA[Shopify Search]]></string>
<string name="_bx_shopify_search_extended_cmts"><![CDATA[Shopify Comments Search]]></string>
<string name="_bx_shopify_pre_lists_cats"><![CDATA[Goods categories]]></string>
<string name="_bx_shopify_cat_automotive_and_industrial"><![CDATA[Automotive & Industrial]]></string>
<string name="_bx_shopify_cat_beauty_health_food"><![CDATA[Beauty, Health & Food]]></string>
<string name="_bx_shopify_cat_books"><![CDATA[Books]]></string>
<string name="_bx_shopify_cat_clothing_shoes_jewelry"><![CDATA[Clothing, Shoes & Jewelry]]></string>
<string name="_bx_shopify_cat_electronics_and_computers"><![CDATA[Electronics & Computers]]></string>
<string name="_bx_shopify_cat_handmade"><![CDATA[Handmade]]></string>
<string name="_bx_shopify_cat_home_garden_tools"><![CDATA[Home, Garden & Tools]]></string>
<string name="_bx_shopify_cat_movies_music_games"><![CDATA[Movies, Music & Games]]></string>
<string name="_bx_shopify_cat_sports_and_outdoors"><![CDATA[Sports & Outdoors]]></string>
<string name="_bx_shopify_cat_toys_kids_baby"><![CDATA[Toys, Kids & Baby]]></string>
<string name="_bx_shopify_msg_save_settings"><![CDATA[Settings were successfully saved.]]></string>
<string name="_bx_shopify_err_save_settings"><![CDATA[Cannot save settings.]]></string>
<string name="_bx_shopify_err_not_configured"><![CDATA[You need to configure shop settings first. <a href="{0}">Click here</a>.]]></string>
<string name="_bx_shopify_err_load_product"><![CDATA[Cannot load product. Please check your shop settings and product handle.]]></string>
<string name="_bx_shopify_err_load_collection"><![CDATA[Cannot load collection. Please check your shop settings.]]></string>
<string name="_bx_shopify_err_purchase_product"><![CDATA[Cannot purchase the product.]]></string>
<string name="_bx_shopify_txt_all_entries_by"><![CDATA[{0} goods]]></string>
<string name="_bx_shopify_txt_all_entries_in"><![CDATA[<a href="{0}">All Goods in {1} ({2})</a>]]></string>
<string name="_bx_shopify_txt_sample_single"><![CDATA[shop item]]></string>
<string name="_bx_shopify_txt_sample_single_with_article"><![CDATA[a shop item]]></string>
<string name="_bx_shopify_txt_sample_comment_single"><![CDATA[comment to shop item]]></string>
<string name="_bx_shopify_txt_sample_vote_single"><![CDATA[vote to shop item]]></string>
<string name="_bx_shopify_txt_sample_reaction_single"><![CDATA['{0}' reaction to shop item]]></string>
<string name="_bx_shopify_txt_sample_score_up_single"><![CDATA[score up vote to shop item]]></string>
<string name="_bx_shopify_txt_sample_score_down_single"><![CDATA[score down vote to shop item]]></string>
</resources>
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.ark.container.session;
import com.alipay.sofa.ark.common.log.ArkLogger;
import com.alipay.sofa.ark.common.log.ArkLoggerFactory;
import com.alipay.sofa.ark.common.thread.CommonThreadPool;
import com.alipay.sofa.ark.common.thread.ThreadPoolManager;
import com.alipay.sofa.ark.common.util.AssertUtils;
import com.alipay.sofa.ark.common.util.EnvironmentUtils;
import com.alipay.sofa.ark.common.util.PortSelectUtils;
import com.alipay.sofa.ark.common.util.StringUtils;
import com.alipay.sofa.ark.exception.ArkRuntimeException;
import com.alipay.sofa.ark.spi.constant.Constants;
import com.alipay.sofa.ark.spi.service.session.TelnetServerService;
import com.google.inject.Singleton;
import java.util.concurrent.atomic.AtomicBoolean;
import static com.alipay.sofa.ark.spi.constant.Constants.DEFAULT_SELECT_PORT_SIZE;
import static com.alipay.sofa.ark.spi.constant.Constants.DEFAULT_TELNET_PORT;
import static com.alipay.sofa.ark.spi.constant.Constants.TELNET_PORT_ATTRIBUTE;
import static com.alipay.sofa.ark.spi.constant.Constants.TELNET_SERVER_ENABLE;
/**
* {@link TelnetServerService}
*
* @author qilong.zql
* @since 0.4.0
*/
@Singleton
public class StandardTelnetServerImpl implements TelnetServerService {
private static final ArkLogger LOGGER = ArkLoggerFactory.getDefaultLogger();
private static final int WORKER_THREAD_POOL_SIZE = 2;
private int port = -1;
private AtomicBoolean shutdown = new AtomicBoolean(false);
private boolean enableTelnetServer = EnvironmentUtils.getProperty(
TELNET_SERVER_ENABLE, "true")
.equalsIgnoreCase("true");
private NettyTelnetServer nettyTelnetServer;
public StandardTelnetServerImpl() {
if (enableTelnetServer) {
String telnetPort = EnvironmentUtils.getProperty(TELNET_PORT_ATTRIBUTE);
try {
if (!StringUtils.isEmpty(telnetPort)) {
port = Integer.parseInt(telnetPort);
} else {
port = PortSelectUtils.selectAvailablePort(DEFAULT_TELNET_PORT,
DEFAULT_SELECT_PORT_SIZE);
}
} catch (NumberFormatException e) {
LOGGER.error(String.format("Invalid port in %s", telnetPort), e);
throw new ArkRuntimeException(e);
}
}
}
@Override
public void run() {
AssertUtils.isTrue(port > 0, "Telnet port should be positive integer.");
try {
LOGGER.info("Listening on port: " + port);
CommonThreadPool workerPool = new CommonThreadPool()
.setCorePoolSize(WORKER_THREAD_POOL_SIZE).setDaemon(true)
.setThreadPoolName(Constants.TELNET_SERVER_WORKER_THREAD_POOL_NAME);
ThreadPoolManager.registerThreadPool(Constants.TELNET_SERVER_WORKER_THREAD_POOL_NAME,
workerPool);
nettyTelnetServer = new NettyTelnetServer(port, workerPool.getExecutor());
nettyTelnetServer.open();
} catch (InterruptedException e) {
LOGGER.error("Unable to open netty telnet server.", e);
throw new ArkRuntimeException(e);
}
}
@Override
public void shutdown() {
if (shutdown.compareAndSet(false, true)) {
try {
if (nettyTelnetServer != null) {
nettyTelnetServer.close();
nettyTelnetServer = null;
}
} catch (Throwable t) {
LOGGER.error("An error occurs when shutdown telnet server.", t);
throw new ArkRuntimeException(t);
}
}
}
@Override
public void init() throws ArkRuntimeException {
if (enableTelnetServer) {
run();
} else {
LOGGER.warn("Telnet server is disabled.");
}
}
@Override
public void dispose() throws ArkRuntimeException {
if (enableTelnetServer) {
shutdown();
}
}
@Override
public int getPriority() {
return HIGHEST_PRECEDENCE;
}
} | {
"pile_set_name": "Github"
} |
// Copyright 2015 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 "sql/sql_memory_dump_provider.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/process_memory_dump.h"
#include "third_party/sqlite/sqlite3.h"
namespace sql {
// static
SqlMemoryDumpProvider* SqlMemoryDumpProvider::GetInstance() {
return base::Singleton<
SqlMemoryDumpProvider,
base::LeakySingletonTraits<SqlMemoryDumpProvider>>::get();
}
SqlMemoryDumpProvider::SqlMemoryDumpProvider() {}
SqlMemoryDumpProvider::~SqlMemoryDumpProvider() {}
bool SqlMemoryDumpProvider::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) {
int memory_used = 0;
int memory_high_water = 0;
int status = sqlite3_status(SQLITE_STATUS_MEMORY_USED, &memory_used,
&memory_high_water, 1 /*resetFlag */);
if (status != SQLITE_OK)
return false;
base::trace_event::MemoryAllocatorDump* dump =
pmd->CreateAllocatorDump("sqlite");
dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
memory_used);
dump->AddScalar("malloc_high_wmark_size",
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
memory_high_water);
int dummy_high_water = -1;
int malloc_count = -1;
status = sqlite3_status(SQLITE_STATUS_MALLOC_COUNT, &malloc_count,
&dummy_high_water, 0 /* resetFlag */);
if (status == SQLITE_OK) {
dump->AddScalar("malloc_count",
base::trace_event::MemoryAllocatorDump::kUnitsObjects,
malloc_count);
}
const char* system_allocator_name =
base::trace_event::MemoryDumpManager::GetInstance()
->system_allocator_pool_name();
if (system_allocator_name) {
pmd->AddSuballocation(dump->guid(), system_allocator_name);
}
return true;
}
} // namespace sql
| {
"pile_set_name": "Github"
} |
from __future__ import print_function
from future.utils import viewitems
from miasm.arch.x86.arch import mn_x86
from miasm.expression.expression import get_rw
from miasm.arch.x86.ira import ir_a_x86_32
from miasm.core.locationdb import LocationDB
loc_db = LocationDB()
print("""
Simple expression manipulation demo.
Get read/written registers for a given instruction
""")
arch = mn_x86
ir_arch = ir_a_x86_32(loc_db)
ircfg = ir_arch.new_ircfg()
instr = arch.fromstring('LODSB', loc_db, 32)
instr.offset, instr.l = 0, 15
ir_arch.add_instr_to_ircfg(instr, ircfg)
print('*' * 80)
for lbl, irblock in viewitems(ircfg.blocks):
print(irblock)
for assignblk in irblock:
rw = assignblk.get_rw()
for dst, reads in viewitems(rw):
print('read: ', [str(x) for x in reads])
print('written:', dst)
print()
open('graph_instr.dot', 'w').write(ircfg.dot())
| {
"pile_set_name": "Github"
} |
-- This file should undo anything in `up.sql`
DROP TABLE likes;
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file contains utility functions for dealing with the local
// filesystem.
#ifndef BASE_FILES_FILE_UTIL_H_
#define BASE_FILES_FILE_UTIL_H_
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <limits>
#include <set>
#include <string>
#include <vector>
#if defined(OS_POSIX) || defined(OS_FUCHSIA)
#include <sys/stat.h>
#include <unistd.h>
#endif
#include "base/base_export.h"
#include "base/callback_forward.h"
#include "base/containers/span.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/scoped_file.h"
#include "base/strings/string16.h"
#include "build/build_config.h"
#if defined(OS_WIN)
#include "base/win/windows_types.h"
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
#include "base/file_descriptor_posix.h"
#include "base/posix/eintr_wrapper.h"
#endif
namespace base {
class Environment;
class Time;
//-----------------------------------------------------------------------------
// Functions that involve filesystem access or modification:
// Returns an absolute version of a relative path. Returns an empty path on
// error. On POSIX, this function fails if the path does not exist. This
// function can result in I/O so it can be slow.
BASE_EXPORT FilePath MakeAbsoluteFilePath(const FilePath& input);
// Returns the total number of bytes used by all the files under |root_path|.
// If the path does not exist the function returns 0.
//
// This function is implemented using the FileEnumerator class so it is not
// particularly speedy in any platform.
BASE_EXPORT int64_t ComputeDirectorySize(const FilePath& root_path);
// Deletes the given path, whether it's a file or a directory.
// If it's a directory, it's perfectly happy to delete all of the directory's
// contents, but it will not recursively delete subdirectories and their
// contents.
// Returns true if successful, false otherwise. It is considered successful to
// attempt to delete a file that does not exist.
//
// In POSIX environment and if |path| is a symbolic link, this deletes only
// the symlink. (even if the symlink points to a non-existent file)
BASE_EXPORT bool DeleteFile(const FilePath& path);
// Deletes the given path, whether it's a file or a directory.
// If it's a directory, it's perfectly happy to delete all of the
// directory's contents, including subdirectories and their contents.
// Returns true if successful, false otherwise. It is considered successful
// to attempt to delete a file that does not exist.
//
// In POSIX environment and if |path| is a symbolic link, this deletes only
// the symlink. (even if the symlink points to a non-existent file)
//
// WARNING: USING THIS EQUIVALENT TO "rm -rf", SO USE WITH CAUTION.
// TODO(thestig): Rename to DeletePathRecursively().
BASE_EXPORT bool DeleteFileRecursively(const FilePath& path);
// DEPRECATED. Please use the functions immediately above.
// https://crbug.com/1009837
//
// Deletes the given path, whether it's a file or a directory.
// If it's a directory, it's perfectly happy to delete all of the
// directory's contents. Passing true to recursively delete
// subdirectories and their contents as well.
// Returns true if successful, false otherwise. It is considered successful
// to attempt to delete a file that does not exist.
//
// In POSIX environment and if |path| is a symbolic link, this deletes only
// the symlink. (even if the symlink points to a non-existent file)
//
// WARNING: USING THIS WITH recursive==true IS EQUIVALENT
// TO "rm -rf", SO USE WITH CAUTION.
BASE_EXPORT bool DeleteFile(const FilePath& path, bool recursive);
// Simplified way to get a callback to do DeleteFile(path) and ignore the
// DeleteFile() result.
BASE_EXPORT OnceCallback<void(const FilePath&)> GetDeleteFileCallback();
// Simplified way to get a callback to do DeleteFileRecursively(path) and ignore
// the DeleteFileRecursively() result.
BASE_EXPORT OnceCallback<void(const FilePath&)>
GetDeletePathRecursivelyCallback();
#if defined(OS_WIN)
// Schedules to delete the given path, whether it's a file or a directory, until
// the operating system is restarted.
// Note:
// 1) The file/directory to be deleted should exist in a temp folder.
// 2) The directory to be deleted must be empty.
BASE_EXPORT bool DeleteFileAfterReboot(const FilePath& path);
#endif
// Moves the given path, whether it's a file or a directory.
// If a simple rename is not possible, such as in the case where the paths are
// on different volumes, this will attempt to copy and delete. Returns
// true for success.
// This function fails if either path contains traversal components ('..').
BASE_EXPORT bool Move(const FilePath& from_path, const FilePath& to_path);
// Renames file |from_path| to |to_path|. Both paths must be on the same
// volume, or the function will fail. Destination file will be created
// if it doesn't exist. Prefer this function over Move when dealing with
// temporary files. On Windows it preserves attributes of the target file.
// Returns true on success, leaving *error unchanged.
// Returns false on failure and sets *error appropriately, if it is non-NULL.
BASE_EXPORT bool ReplaceFile(const FilePath& from_path,
const FilePath& to_path,
File::Error* error);
// Copies a single file. Use CopyDirectory() to copy directories.
// This function fails if either path contains traversal components ('..').
// This function also fails if |to_path| is a directory.
//
// On POSIX, if |to_path| is a symlink, CopyFile() will follow the symlink. This
// may have security implications. Use with care.
//
// If |to_path| already exists and is a regular file, it will be overwritten,
// though its permissions will stay the same.
//
// If |to_path| does not exist, it will be created. The new file's permissions
// varies per platform:
//
// - This function keeps the metadata on Windows. The read only bit is not kept.
// - On Mac and iOS, |to_path| retains |from_path|'s permissions, except user
// read/write permissions are always set.
// - On Linux and Android, |to_path| has user read/write permissions only. i.e.
// Always 0600.
// - On ChromeOS, |to_path| has user read/write permissions and group/others
// read permissions. i.e. Always 0644.
BASE_EXPORT bool CopyFile(const FilePath& from_path, const FilePath& to_path);
// Copies the given path, and optionally all subdirectories and their contents
// as well.
//
// If there are files existing under to_path, always overwrite. Returns true
// if successful, false otherwise. Wildcards on the names are not supported.
//
// This function has the same metadata behavior as CopyFile().
//
// If you only need to copy a file use CopyFile, it's faster.
BASE_EXPORT bool CopyDirectory(const FilePath& from_path,
const FilePath& to_path,
bool recursive);
// Like CopyDirectory() except trying to overwrite an existing file will not
// work and will return false.
BASE_EXPORT bool CopyDirectoryExcl(const FilePath& from_path,
const FilePath& to_path,
bool recursive);
// Returns true if the given path exists on the local filesystem,
// false otherwise.
BASE_EXPORT bool PathExists(const FilePath& path);
// Returns true if the given path is writable by the user, false otherwise.
BASE_EXPORT bool PathIsWritable(const FilePath& path);
// Returns true if the given path exists and is a directory, false otherwise.
BASE_EXPORT bool DirectoryExists(const FilePath& path);
// Returns true if the contents of the two files given are equal, false
// otherwise. If either file can't be read, returns false.
BASE_EXPORT bool ContentsEqual(const FilePath& filename1,
const FilePath& filename2);
// Returns true if the contents of the two text files given are equal, false
// otherwise. This routine treats "\r\n" and "\n" as equivalent.
BASE_EXPORT bool TextContentsEqual(const FilePath& filename1,
const FilePath& filename2);
// Reads the file at |path| into |contents| and returns true on success and
// false on error. For security reasons, a |path| containing path traversal
// components ('..') is treated as a read error and |contents| is set to empty.
// In case of I/O error, |contents| holds the data that could be read from the
// file before the error occurred.
// |contents| may be NULL, in which case this function is useful for its side
// effect of priming the disk cache (could be used for unit tests).
BASE_EXPORT bool ReadFileToString(const FilePath& path, std::string* contents);
// Reads the file at |path| into |contents| and returns true on success and
// false on error. For security reasons, a |path| containing path traversal
// components ('..') is treated as a read error and |contents| is set to empty.
// In case of I/O error, |contents| holds the data that could be read from the
// file before the error occurred. When the file size exceeds |max_size|, the
// function returns false with |contents| holding the file truncated to
// |max_size|.
// |contents| may be NULL, in which case this function is useful for its side
// effect of priming the disk cache (could be used for unit tests).
BASE_EXPORT bool ReadFileToStringWithMaxSize(const FilePath& path,
std::string* contents,
size_t max_size);
// As ReadFileToString, but reading from an open stream after seeking to its
// start (if supported by the stream).
BASE_EXPORT bool ReadStreamToString(FILE* stream, std::string* contents);
// As ReadFileToStringWithMaxSize, but reading from an open stream after seeking
// to its start (if supported by the stream).
BASE_EXPORT bool ReadStreamToStringWithMaxSize(FILE* stream,
size_t max_size,
std::string* contents);
#if defined(OS_POSIX) || defined(OS_FUCHSIA)
// Read exactly |bytes| bytes from file descriptor |fd|, storing the result
// in |buffer|. This function is protected against EINTR and partial reads.
// Returns true iff |bytes| bytes have been successfully read from |fd|.
BASE_EXPORT bool ReadFromFD(int fd, char* buffer, size_t bytes);
// Performs the same function as CreateAndOpenTemporaryStreamInDir(), but
// returns the file-descriptor wrapped in a ScopedFD, rather than the stream
// wrapped in a ScopedFILE.
BASE_EXPORT ScopedFD CreateAndOpenFdForTemporaryFileInDir(const FilePath& dir,
FilePath* path);
#endif // defined(OS_POSIX) || defined(OS_FUCHSIA)
#if defined(OS_POSIX)
// ReadFileToStringNonBlocking is identical to ReadFileToString except it
// guarantees that it will not block. This guarantee is provided on POSIX by
// opening the file as O_NONBLOCK. This variant should only be used on files
// which are guaranteed not to block (such as kernel files). Or in situations
// where a partial read would be acceptable because the backing store returned
// EWOULDBLOCK.
BASE_EXPORT bool ReadFileToStringNonBlocking(const base::FilePath& file,
std::string* ret);
// Creates a symbolic link at |symlink| pointing to |target|. Returns
// false on failure.
BASE_EXPORT bool CreateSymbolicLink(const FilePath& target,
const FilePath& symlink);
// Reads the given |symlink| and returns where it points to in |target|.
// Returns false upon failure.
BASE_EXPORT bool ReadSymbolicLink(const FilePath& symlink, FilePath* target);
// Bits and masks of the file permission.
enum FilePermissionBits {
FILE_PERMISSION_MASK = S_IRWXU | S_IRWXG | S_IRWXO,
FILE_PERMISSION_USER_MASK = S_IRWXU,
FILE_PERMISSION_GROUP_MASK = S_IRWXG,
FILE_PERMISSION_OTHERS_MASK = S_IRWXO,
FILE_PERMISSION_READ_BY_USER = S_IRUSR,
FILE_PERMISSION_WRITE_BY_USER = S_IWUSR,
FILE_PERMISSION_EXECUTE_BY_USER = S_IXUSR,
FILE_PERMISSION_READ_BY_GROUP = S_IRGRP,
FILE_PERMISSION_WRITE_BY_GROUP = S_IWGRP,
FILE_PERMISSION_EXECUTE_BY_GROUP = S_IXGRP,
FILE_PERMISSION_READ_BY_OTHERS = S_IROTH,
FILE_PERMISSION_WRITE_BY_OTHERS = S_IWOTH,
FILE_PERMISSION_EXECUTE_BY_OTHERS = S_IXOTH,
};
// Reads the permission of the given |path|, storing the file permission
// bits in |mode|. If |path| is symbolic link, |mode| is the permission of
// a file which the symlink points to.
BASE_EXPORT bool GetPosixFilePermissions(const FilePath& path, int* mode);
// Sets the permission of the given |path|. If |path| is symbolic link, sets
// the permission of a file which the symlink points to.
BASE_EXPORT bool SetPosixFilePermissions(const FilePath& path, int mode);
// Returns true iff |executable| can be found in any directory specified by the
// environment variable in |env|.
BASE_EXPORT bool ExecutableExistsInPath(Environment* env,
const FilePath::StringType& executable);
#if defined(OS_LINUX) || defined(OS_AIX)
// Determine if files under a given |path| can be mapped and then mprotect'd
// PROT_EXEC. This depends on the mount options used for |path|, which vary
// among different Linux distributions and possibly local configuration. It also
// depends on details of kernel--ChromeOS uses the noexec option for /dev/shm
// but its kernel allows mprotect with PROT_EXEC anyway.
BASE_EXPORT bool IsPathExecutable(const FilePath& path);
#endif // OS_LINUX || OS_AIX
#endif // OS_POSIX
// Returns true if the given directory is empty
BASE_EXPORT bool IsDirectoryEmpty(const FilePath& dir_path);
// Get the temporary directory provided by the system.
//
// WARNING: In general, you should use CreateTemporaryFile variants below
// instead of this function. Those variants will ensure that the proper
// permissions are set so that other users on the system can't edit them while
// they're open (which can lead to security issues).
BASE_EXPORT bool GetTempDir(FilePath* path);
// Get the home directory. This is more complicated than just getenv("HOME")
// as it knows to fall back on getpwent() etc.
//
// You should not generally call this directly. Instead use DIR_HOME with the
// path service which will use this function but cache the value.
// Path service may also override DIR_HOME.
BASE_EXPORT FilePath GetHomeDir();
// Returns a new temporary file in |dir| with a unique name. The file is opened
// for exclusive read, write, and delete access (note: exclusivity is unique to
// Windows). On Windows, the returned file supports File::DeleteOnClose.
// On success, |temp_file| is populated with the full path to the created file.
BASE_EXPORT File CreateAndOpenTemporaryFileInDir(const FilePath& dir,
FilePath* temp_file);
// Creates a temporary file. The full path is placed in |path|, and the
// function returns true if was successful in creating the file. The file will
// be empty and all handles closed after this function returns.
BASE_EXPORT bool CreateTemporaryFile(FilePath* path);
// Same as CreateTemporaryFile but the file is created in |dir|.
BASE_EXPORT bool CreateTemporaryFileInDir(const FilePath& dir,
FilePath* temp_file);
// Create and open a temporary file stream for exclusive read, write, and delete
// access (note: exclusivity is unique to Windows). The full path is placed in
// |path|. Returns the opened file stream, or null in case of error.
BASE_EXPORT ScopedFILE CreateAndOpenTemporaryStream(FilePath* path);
// Similar to CreateAndOpenTemporaryStream, but the file is created in |dir|.
BASE_EXPORT ScopedFILE CreateAndOpenTemporaryStreamInDir(const FilePath& dir,
FilePath* path);
// Create a new directory. If prefix is provided, the new directory name is in
// the format of prefixyyyy.
// NOTE: prefix is ignored in the POSIX implementation.
// If success, return true and output the full path of the directory created.
BASE_EXPORT bool CreateNewTempDirectory(const FilePath::StringType& prefix,
FilePath* new_temp_path);
// Create a directory within another directory.
// Extra characters will be appended to |prefix| to ensure that the
// new directory does not have the same name as an existing directory.
BASE_EXPORT bool CreateTemporaryDirInDir(const FilePath& base_dir,
const FilePath::StringType& prefix,
FilePath* new_dir);
// Creates a directory, as well as creating any parent directories, if they
// don't exist. Returns 'true' on successful creation, or if the directory
// already exists. The directory is only readable by the current user.
// Returns true on success, leaving *error unchanged.
// Returns false on failure and sets *error appropriately, if it is non-NULL.
BASE_EXPORT bool CreateDirectoryAndGetError(const FilePath& full_path,
File::Error* error);
// Backward-compatible convenience method for the above.
BASE_EXPORT bool CreateDirectory(const FilePath& full_path);
// Returns the file size. Returns true on success.
BASE_EXPORT bool GetFileSize(const FilePath& file_path, int64_t* file_size);
// Sets |real_path| to |path| with symbolic links and junctions expanded.
// On windows, make sure the path starts with a lettered drive.
// |path| must reference a file. Function will fail if |path| points to
// a directory or to a nonexistent path. On windows, this function will
// fail if |real_path| would be longer than MAX_PATH characters.
BASE_EXPORT bool NormalizeFilePath(const FilePath& path, FilePath* real_path);
#if defined(OS_WIN)
// Given a path in NT native form ("\Device\HarddiskVolumeXX\..."),
// return in |drive_letter_path| the equivalent path that starts with
// a drive letter ("C:\..."). Return false if no such path exists.
BASE_EXPORT bool DevicePathToDriveLetterPath(const FilePath& device_path,
FilePath* drive_letter_path);
// Method that wraps the win32 GetLongPathName API, normalizing the specified
// path to its long form. An example where this is needed is when comparing
// temp file paths. If a username isn't a valid 8.3 short file name (even just a
// lengthy name like "user with long name"), Windows will set the TMP and TEMP
// environment variables to be 8.3 paths. ::GetTempPath (called in
// base::GetTempDir) just uses the value specified by TMP or TEMP, and so can
// return a short path. Returns an empty path on error.
BASE_EXPORT FilePath MakeLongFilePath(const FilePath& input);
// Creates a hard link named |to_file| to the file |from_file|. Both paths
// must be on the same volume, and |from_file| may not name a directory.
// Returns true if the hard link is created, false if it fails.
BASE_EXPORT bool CreateWinHardLink(const FilePath& to_file,
const FilePath& from_file);
#endif
// This function will return if the given file is a symlink or not.
BASE_EXPORT bool IsLink(const FilePath& file_path);
// Returns information about the given file path.
BASE_EXPORT bool GetFileInfo(const FilePath& file_path, File::Info* info);
// Sets the time of the last access and the time of the last modification.
BASE_EXPORT bool TouchFile(const FilePath& path,
const Time& last_accessed,
const Time& last_modified);
// Wrapper for fopen-like calls. Returns non-NULL FILE* on success. The
// underlying file descriptor (POSIX) or handle (Windows) is unconditionally
// configured to not be propagated to child processes.
BASE_EXPORT FILE* OpenFile(const FilePath& filename, const char* mode);
// Closes file opened by OpenFile. Returns true on success.
BASE_EXPORT bool CloseFile(FILE* file);
// Associates a standard FILE stream with an existing File. Note that this
// functions take ownership of the existing File.
BASE_EXPORT FILE* FileToFILE(File file, const char* mode);
// Returns a new handle to the file underlying |file_stream|.
BASE_EXPORT File FILEToFile(FILE* file_stream);
// Truncates an open file to end at the location of the current file pointer.
// This is a cross-platform analog to Windows' SetEndOfFile() function.
BASE_EXPORT bool TruncateFile(FILE* file);
// Reads at most the given number of bytes from the file into the buffer.
// Returns the number of read bytes, or -1 on error.
BASE_EXPORT int ReadFile(const FilePath& filename, char* data, int max_size);
// Writes the given buffer into the file, overwriting any data that was
// previously there. Returns the number of bytes written, or -1 on error.
// If file doesn't exist, it gets created with read/write permissions for all.
// Note that the other variants of WriteFile() below may be easier to use.
BASE_EXPORT int WriteFile(const FilePath& filename, const char* data,
int size);
// Writes |data| into the file, overwriting any data that was previously there.
// Returns true if and only if all of |data| was written. If the file does not
// exist, it gets created with read/write permissions for all.
BASE_EXPORT bool WriteFile(const FilePath& filename, span<const uint8_t> data);
// Another WriteFile() variant that takes a StringPiece so callers don't have to
// do manual conversions from a char span to a uint8_t span.
BASE_EXPORT bool WriteFile(const FilePath& filename, StringPiece data);
#if defined(OS_POSIX) || defined(OS_FUCHSIA)
// Appends |data| to |fd|. Does not close |fd| when done. Returns true iff
// |size| bytes of |data| were written to |fd|.
BASE_EXPORT bool WriteFileDescriptor(const int fd, const char* data, int size);
// Allocates disk space for the file referred to by |fd| for the byte range
// starting at |offset| and continuing for |size| bytes. The file size will be
// changed if |offset|+|len| is greater than the file size. Zeros will fill the
// new space.
// After a successful call, subsequent writes into the specified range are
// guaranteed not to fail because of lack of disk space.
BASE_EXPORT bool AllocateFileRegion(File* file, int64_t offset, size_t size);
#endif
// Appends |data| to |filename|. Returns true iff |size| bytes of |data| were
// written to |filename|.
BASE_EXPORT bool AppendToFile(const FilePath& filename,
const char* data,
int size);
// Gets the current working directory for the process.
BASE_EXPORT bool GetCurrentDirectory(FilePath* path);
// Sets the current working directory for the process.
BASE_EXPORT bool SetCurrentDirectory(const FilePath& path);
// The largest value attempted by GetUniquePath{Number,}.
enum { kMaxUniqueFiles = 100 };
// Returns the number N that makes |path| unique when formatted as " (N)" in a
// suffix to its basename before any file extension, where N is a number between
// 1 and 100 (inclusive). Returns 0 if |path| does not exist (meaning that it is
// unique as-is), or -1 if no such number can be found.
BASE_EXPORT int GetUniquePathNumber(const FilePath& path);
// Returns |path| if it does not exist. Otherwise, returns |path| with the
// suffix " (N)" appended to its basename before any file extension, where N is
// a number between 1 and 100 (inclusive). Returns an empty path if no such
// number can be found.
BASE_EXPORT FilePath GetUniquePath(const FilePath& path);
// Sets the given |fd| to non-blocking mode.
// Returns true if it was able to set it in the non-blocking mode, otherwise
// false.
BASE_EXPORT bool SetNonBlocking(int fd);
// Hints the OS to prefetch the first |max_bytes| of |file_path| into its cache.
//
// If called at the appropriate time, this can reduce the latency incurred by
// feature code that needs to read the file.
//
// |max_bytes| specifies how many bytes should be pre-fetched. It may exceed the
// file's size. Passing in std::numeric_limits<int64_t>::max() is a convenient
// way to get the entire file pre-fetched.
//
// |is_executable| specifies whether the file is to be prefetched as
// executable code or as data. Windows treats the file backed pages in RAM
// differently, and specifying the wrong value results in two copies in RAM.
//
// Returns false if prefetching definitely failed. A return value of true does
// not guarantee that the entire desired range was prefetched.
//
// Calling this before using ::LoadLibrary() on Windows is more efficient memory
// wise, but we must be sure no other threads try to LoadLibrary() the file
// while we are doing the mapping and prefetching, or the process will get a
// private copy of the DLL via COW.
BASE_EXPORT bool PreReadFile(
const FilePath& file_path,
bool is_executable,
int64_t max_bytes = std::numeric_limits<int64_t>::max());
#if defined(OS_POSIX) || defined(OS_FUCHSIA)
// Creates a pipe. Returns true on success, otherwise false.
// On success, |read_fd| will be set to the fd of the read side, and
// |write_fd| will be set to the one of write side. If |non_blocking|
// is set the pipe will be created with O_NONBLOCK|O_CLOEXEC flags set
// otherwise flag is set to zero (default).
BASE_EXPORT bool CreatePipe(ScopedFD* read_fd,
ScopedFD* write_fd,
bool non_blocking = false);
// Creates a non-blocking, close-on-exec pipe.
// This creates a non-blocking pipe that is not intended to be shared with any
// child process. This will be done atomically if the operating system supports
// it. Returns true if it was able to create the pipe, otherwise false.
BASE_EXPORT bool CreateLocalNonBlockingPipe(int fds[2]);
// Sets the given |fd| to close-on-exec mode.
// Returns true if it was able to set it in the close-on-exec mode, otherwise
// false.
BASE_EXPORT bool SetCloseOnExec(int fd);
// Test that |path| can only be changed by a given user and members of
// a given set of groups.
// Specifically, test that all parts of |path| under (and including) |base|:
// * Exist.
// * Are owned by a specific user.
// * Are not writable by all users.
// * Are owned by a member of a given set of groups, or are not writable by
// their group.
// * Are not symbolic links.
// This is useful for checking that a config file is administrator-controlled.
// |base| must contain |path|.
BASE_EXPORT bool VerifyPathControlledByUser(const base::FilePath& base,
const base::FilePath& path,
uid_t owner_uid,
const std::set<gid_t>& group_gids);
#endif // defined(OS_POSIX) || defined(OS_FUCHSIA)
#if defined(OS_MACOSX) && !defined(OS_IOS)
// Is |path| writable only by a user with administrator privileges?
// This function uses Mac OS conventions. The super user is assumed to have
// uid 0, and the administrator group is assumed to be named "admin".
// Testing that |path|, and every parent directory including the root of
// the filesystem, are owned by the superuser, controlled by the group
// "admin", are not writable by all users, and contain no symbolic links.
// Will return false if |path| does not exist.
BASE_EXPORT bool VerifyPathControlledByAdmin(const base::FilePath& path);
#endif // defined(OS_MACOSX) && !defined(OS_IOS)
// Returns the maximum length of path component on the volume containing
// the directory |path|, in the number of FilePath::CharType, or -1 on failure.
BASE_EXPORT int GetMaximumPathComponentLength(const base::FilePath& path);
#if defined(OS_LINUX) || defined(OS_AIX)
// Broad categories of file systems as returned by statfs() on Linux.
enum FileSystemType {
FILE_SYSTEM_UNKNOWN, // statfs failed.
FILE_SYSTEM_0, // statfs.f_type == 0 means unknown, may indicate AFS.
FILE_SYSTEM_ORDINARY, // on-disk filesystem like ext2
FILE_SYSTEM_NFS,
FILE_SYSTEM_SMB,
FILE_SYSTEM_CODA,
FILE_SYSTEM_MEMORY, // in-memory file system
FILE_SYSTEM_CGROUP, // cgroup control.
FILE_SYSTEM_OTHER, // any other value.
FILE_SYSTEM_TYPE_COUNT
};
// Attempts determine the FileSystemType for |path|.
// Returns false if |path| doesn't exist.
BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type);
#endif
#if defined(OS_POSIX) || defined(OS_FUCHSIA)
// Get a temporary directory for shared memory files. The directory may depend
// on whether the destination is intended for executable files, which in turn
// depends on how /dev/shmem was mounted. As a result, you must supply whether
// you intend to create executable shmem segments so this function can find
// an appropriate location.
BASE_EXPORT bool GetShmemTempDir(bool executable, FilePath* path);
#endif
// Internal --------------------------------------------------------------------
namespace internal {
// Same as Move but allows paths with traversal components.
// Use only with extreme care.
BASE_EXPORT bool MoveUnsafe(const FilePath& from_path,
const FilePath& to_path);
#if defined(OS_WIN)
// Copy from_path to to_path recursively and then delete from_path recursively.
// Returns true if all operations succeed.
// This function simulates Move(), but unlike Move() it works across volumes.
// This function is not transactional.
BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path,
const FilePath& to_path);
#endif // defined(OS_WIN)
// Used by PreReadFile() when no kernel support for prefetching is available.
bool PreReadFileSlow(const FilePath& file_path, int64_t max_bytes);
} // namespace internal
} // namespace base
#endif // BASE_FILES_FILE_UTIL_H_
| {
"pile_set_name": "Github"
} |
This project was automatically exported from code.google.com/p/go-uuid
# uuid 
The uuid package generates and inspects UUIDs based on [RFC 4122](http://tools.ietf.org/html/rfc4122) and DCE 1.1: Authentication and Security Services.
This package now leverages the github.com/google/uuid package (which is based off an earlier version of this package).
###### Install
`go get github.com/pborman/uuid`
###### Documentation
[](http://godoc.org/github.com/pborman/uuid)
Full `go doc` style documentation for the package can be viewed online without installing this package by using the GoDoc site here:
http://godoc.org/github.com/pborman/uuid
| {
"pile_set_name": "Github"
} |
<cfcomponent>
<cfproperty name="prop1">
<cfproperty name="prop2">
<cfset a = pro<caret>>
</cfcomponent> | {
"pile_set_name": "Github"
} |
#
# The art-fairs listing page
#
express = require 'express'
routes = require './routes'
app = module.exports = express()
app.set 'views', __dirname + '/templates'
app.set 'view engine', 'jade'
app.get '/art-fairs', routes.index
app.get '/fairs', routes.index
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.