text
stringlengths 2
100k
| meta
dict |
---|---|
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <objc/NSObject.h>
@class NSDictionary, NSTimer, NSURL;
@interface CIMDebugLogger : NSObject
{
int _mecabraInputMethodType;
NSURL *_dynamicDictionaryDirectoryURL;
NSDictionary *_activeSessionLog;
NSTimer *_dataFlushTimer;
}
- (void).cxx_destruct;
@property(retain) NSTimer *dataFlushTimer; // @synthesize dataFlushTimer=_dataFlushTimer;
@property(readonly) int mecabraInputMethodType; // @synthesize mecabraInputMethodType=_mecabraInputMethodType;
@property(copy) NSDictionary *activeSessionLog; // @synthesize activeSessionLog=_activeSessionLog;
- (void)startDynamicLogTimer;
- (void)flushDynamicLogs;
@property(readonly, copy) NSURL *dynamicDictionaryDirectoryURL; // @synthesize dynamicDictionaryDirectoryURL=_dynamicDictionaryDirectoryURL;
- (void)updateSessionLog;
- (struct __Mecabra *)mecabraEngine;
- (id)initWithMecabraInputMethodType:(int)arg1;
@end
| {
"pile_set_name": "Github"
} |
#include <list>
int main()
{
std::list<int> list;
for (int i = 0;
i < 1500;
i++)
list.push_back(i);
return list.size(); // break here
}
| {
"pile_set_name": "Github"
} |
namespace ClassLib081
{
public class Class051
{
public static string Property => "ClassLib081";
}
}
| {
"pile_set_name": "Github"
} |
#include <algorithm>
#include <iostream>
#include <cassert>
#include "RedisContext.h"
#define CRLF "\r\n"
const char* Strstr(const char* ptr, size_t nBytes, const char* pattern, size_t nBytes2) {
if (!pattern || *pattern == 0)
return nullptr;
const char* ret = std::search(ptr, ptr + nBytes, pattern, pattern + nBytes2);
return ret == ptr + nBytes ? nullptr : ret;
}
const char* SearchCRLF(const char* ptr, size_t nBytes) {
return Strstr(ptr, nBytes, CRLF, 2);
}
RedisContext::RedisContext(ananas::Connection* conn) : hostConn_(conn) {
_ResetResponse();
}
ananas::AnyPointer RedisContext::Get(const std::string& key) {
// Redis inline protocol request
std::string req_buf = BuildRedisRequest("get", key);
if (!hostConn_->SendPacket(req_buf.data(), req_buf.size()))
return ananas::AnyPointer();
RedisContext::Request req;
req.request.push_back("get");
req.request.push_back(key);
req.crt = current_;
pending_.push(std::move(req));
return ananas::AnyPointer((int*)0x1, [] (int* ) {});
}
size_t RedisContext::OnRecv(ananas::Connection* conn, const char* data, size_t len) {
// just for test.
if (type_ == None) {
switch (data[0]) {
case '+':
type_ = Fine;
break;
case '-':
type_ = Error;
break;
case '$':
type_ = String;
break;
default:
assert (!!!"wrong type");
break;
}
}
const char* res = SearchCRLF(data, len);
if (!res)
return 0; // waiting
bool ready = false;
switch (type_) {
case Fine:
content_.assign(data + 1, res - (data + 1));
ready = true;
break;
case Error:
content_.assign(data + 1, res - (data + 1));
ready = true;
break;
case String:
if (len_ == -1) {
std::string number(data + 1, res - (data + 1));
len_ = std::stoi(number);
if (len_ == -1) {
content_ = "(nil)";
len_ = 5;
ready = true;
}
} else {
content_.assign(data, res - data);
assert ((int)(content_.size()) == len_);
ready = true;
}
break;
default:
break;
}
if (ready) {
auto& req = pending_.front();
std::cout << "--- Request: [ ";
for (const auto& arg : req.request)
std::cout << arg << " ";
std::cout << "]\n--- Response: ";
ananas::Coroutine::Send(req.crt, std::make_shared<std::string>(content_));
pending_.pop();
_ResetResponse();
}
return res - data + 2;
}
void RedisContext::PrintResponse(const std::pair<ResponseType, std::string>& info) {
if (info.first == Error)
std::cout << "(Error): " << info.second << std::endl;
else if (info.first == Fine)
std::cout << "(Fine): " << info.second << std::endl;
else if (info.first == String)
std::cout << "(String): " << info.second << std::endl;
else
assert(false);
}
void RedisContext::_ResetResponse() {
type_ = None;
content_.clear();
len_ = -1;
}
| {
"pile_set_name": "Github"
} |
NewRelic::Agent.after_fork(:force_reconnect => true) if defined? Unicorn
| {
"pile_set_name": "Github"
} |
{% macro tag(tagName, size=1, classname="") %}
<button class="btn-inverse border-grey-light text-center no-border-radius padding-{{size}} no-text-wrap {{classname}} v-spacing-1 no-letter-spacing">
{{ tagName }}
</button>
{% endmacro %}
{% macro tags(allTags) %}
{% for tagName in allTags %}
{{ tag(tagName) }}
{% endfor %}
{% endmacro %} | {
"pile_set_name": "Github"
} |
package edu.stanford.nlp.mt.util;
import java.util.*;
/**
*
* @author danielcer
*
*/
public class DynamicIntegerArrayIndex implements Iterable<int[]>,
IntegerArrayIndex {
public static final long serialVersionUID = 127L;
static final int INIT_SZ = 1 << 10;
static final double MAX_LOAD = 0.60;
protected int[][] keys;
protected int[] values;
protected int mask;
protected int[] hashCodes;
protected int[] reverseIndex;
protected int maxIndex;
protected int load;
protected boolean locked = false;
public DynamicIntegerArrayIndex() {
keys = new int[INIT_SZ][];
values = new int[INIT_SZ];
hashCodes = new int[INIT_SZ];
reverseIndex = new int[INIT_SZ];
Arrays.fill(reverseIndex, -1);
mask = INIT_SZ - 1;
}
protected static int supplementalHash(int h) {
// use the same supplemental hash function used by HashMap
return ((h << 7) - h + (h >>> 9) + (h >>> 17));
}
@Override
public void lock() {
System.err.printf("%s locked.\n", this);
this.locked = true;
}
private int findPos(int[] e) {
int hashCode = supplementalHash(Arrays.hashCode(e));
int idealIdx = hashCode & mask;
for (int i = 0, idx = idealIdx; i < keys.length; i++, idx++) {
if (idx >= keys.length)
idx = 0;
if (keys[idx] == null)
return -idx - 1;
if (hashCodes[idx] != hashCode)
continue;
if (Arrays.equals(keys[idx], e))
return idx;
}
return -keys.length - 1;
}
@Override
public int[] get(int idx) {
if (locked)
return get_unsync(idx);
synchronized (this) {
return get_unsync(idx);
}
}
private int[] get_unsync(int idx) {
int pos = reverseIndex[idx];
if (pos == -1)
return null;
return keys[pos];
}
protected void sizeUp() {
int newSize = keys.length << 1;
mask = newSize - 1;
// System.err.printf("size up to: %d\n", newSize);
int[][] oldKeys = keys;
int[] oldValues = values;
int[] oldHashCodes = hashCodes;
keys = new int[newSize][];
values = new int[newSize];
reverseIndex = new int[newSize];
Arrays.fill(reverseIndex, -1);
hashCodes = new int[newSize];
for (int i = 0; i < oldKeys.length; i++) {
if (oldKeys[i] == null)
continue;
int pos = -findPos(oldKeys[i]) - 1;
keys[pos] = oldKeys[i];
values[pos] = oldValues[i];
reverseIndex[values[pos]] = pos;
hashCodes[pos] = oldHashCodes[i];
}
}
@SuppressWarnings("unused")
private int getSearchOffset(int pos, int[] key) {
int idealIdx = supplementalHash(Arrays.hashCode(key)) & mask;
int distance;
if (idealIdx < pos) {
distance = pos + keys.length - idealIdx;
} else {
distance = pos - idealIdx;
}
return distance;
}
private int add(int key[], int pos) {
if ((load++) / (double) keys.length > MAX_LOAD) {
sizeUp();
pos = -findPos(key) - 1;
}
keys[pos] = Arrays.copyOf(key, key.length);
values[pos] = maxIndex++;
reverseIndex[values[pos]] = pos;
hashCodes[pos] = supplementalHash(Arrays.hashCode(key));
return maxIndex - 1;
}
@Override
public int indexOf(int[] key) {
if (locked)
return indexOf_unsync(key);
synchronized (this) {
return indexOf_unsync(key);
}
}
private int indexOf_unsync(int[] key) {
int pos = findPos(key);
if (pos < 0)
return -1;
return values[pos];
}
/*
* public boolean contains(int[] key) { int pos = findPos(key); return pos >=
* 0; }
*/
/*
* @SuppressWarnings("unused") public synchronized int commonRepIndexOf(int[]
* key, boolean add) {//s int pos = findPos(key); if (pos >= 0) return
* values[pos]; if (!add) return -1; return add(key, -pos-1,true); }
*/
@Override
public int indexOf(int[] key, boolean add) {
if (locked) {
// if (add)
// throw new
// UnsupportedOperationException("Can't add key; index is locked.");
return indexOf_unsync(key, false);
}
synchronized (this) {
return indexOf_unsync(key, add);
}
}
private int indexOf_unsync(int[] key, boolean add) {
int pos = findPos(key);
if (pos >= 0)
return values[pos];
if (!add)
return -1;
return add(key, -pos - 1);
}
@Override
public int size() {
return load;
}
@Override
public Iterator<int[]> iterator() {
return new Itr();
}
private class Itr implements Iterator<int[]> {
int cursor = 0;
@Override
public boolean hasNext() {
return cursor < size();
}
@Override
public int[] next() {
return get(cursor++);
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
}
}
| {
"pile_set_name": "Github"
} |
define(["exports", "../polymer/polymer-legacy.js", "../iron-form-element-behavior/iron-form-element-behavior.js", "../iron-validatable-behavior/iron-validatable-behavior.js"], function (_exports, _polymerLegacy, _ironFormElementBehavior, _ironValidatableBehavior) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.IronCheckedElementBehavior = _exports.IronCheckedElementBehaviorImpl = void 0;
/**
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/
/**
* Use `IronCheckedElementBehavior` to implement a custom element that has a
* `checked` property, which can be used for validation if the element is also
* `required`. Element instances implementing this behavior will also be
* registered for use in an `iron-form` element.
*
* @demo demo/index.html
* @polymerBehavior IronCheckedElementBehavior
*/
var IronCheckedElementBehaviorImpl = {
properties: {
/**
* Fired when the checked state changes.
*
* @event iron-change
*/
/**
* Gets or sets the state, `true` is checked and `false` is unchecked.
*/
checked: {
type: Boolean,
value: false,
reflectToAttribute: true,
notify: true,
observer: '_checkedChanged'
},
/**
* If true, the button toggles the active state with each tap or press
* of the spacebar.
*/
toggles: {
type: Boolean,
value: true,
reflectToAttribute: true
},
/* Overriden from IronFormElementBehavior */
value: {
type: String,
value: 'on',
observer: '_valueChanged'
}
},
observers: ['_requiredChanged(required)'],
created: function created() {
// Used by `iron-form` to handle the case that an element with this behavior
// doesn't have a role of 'checkbox' or 'radio', but should still only be
// included when the form is serialized if `this.checked === true`.
this._hasIronCheckedElementBehavior = true;
},
/**
* Returns false if the element is required and not checked, and true
* otherwise.
* @param {*=} _value Ignored.
* @return {boolean} true if `required` is false or if `checked` is true.
*/
_getValidity: function _getValidity(_value) {
return this.disabled || !this.required || this.checked;
},
/**
* Update the aria-required label when `required` is changed.
*/
_requiredChanged: function _requiredChanged() {
if (this.required) {
this.setAttribute('aria-required', 'true');
} else {
this.removeAttribute('aria-required');
}
},
/**
* Fire `iron-changed` when the checked state changes.
*/
_checkedChanged: function _checkedChanged() {
this.active = this.checked;
this.fire('iron-change');
},
/**
* Reset value to 'on' if it is set to `undefined`.
*/
_valueChanged: function _valueChanged() {
if (this.value === undefined || this.value === null) {
this.value = 'on';
}
}
};
/** @polymerBehavior */
_exports.IronCheckedElementBehaviorImpl = IronCheckedElementBehaviorImpl;
var IronCheckedElementBehavior = [_ironFormElementBehavior.IronFormElementBehavior, _ironValidatableBehavior.IronValidatableBehavior, IronCheckedElementBehaviorImpl];
_exports.IronCheckedElementBehavior = IronCheckedElementBehavior;
}); | {
"pile_set_name": "Github"
} |
stdout of test '14a` in directory 'sql/benchmarks/tpcds` itself:
# 18:29:57 >
# 18:29:57 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=30709" "--set" "mapi_usock=/var/tmp/mtest-16393/.s.monetdb.30709" "--set" "monet_prompt=" "--forcemito" "--dbpath=/ufs/sjoerd/@Monet-devel/var/MonetDB/mTests_sql_benchmarks_tpcds" "--set" "embedded_c=true"
# 18:29:57 >
# MonetDB 5 server v11.32.0 (hg id: edafb9f9a3c6+79d16e518d38+)
# This is an unreleased version
# Serving database 'mTests_sql_benchmarks_tpcds', using 8 threads
# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers
# Found 62.694 GiB available main-memory.
# Copyright (c) 1993 - July 2008 CWI.
# Copyright (c) August 2008 - 2020 MonetDB B.V., all rights reserved
# Visit https://www.monetdb.org/ for further information
# Listening for connection requests on mapi:monetdb://methuselah.da.cwi.nl:30709/
# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-16393/.s.monetdb.30709
# MonetDB/GIS module loaded
# MonetDB/SQL module loaded
# 18:29:57 >
# 18:29:57 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-16393" "--port=30709"
# 18:29:57 >
#WITH cross_items AS
# (SELECT i_item_sk ss_item_sk
# FROM item,
# (SELECT iss.i_brand_id brand_id ,
# iss.i_class_id class_id ,
# iss.i_category_id category_id
# FROM store_sales ,
# item iss ,
# date_dim d1
# WHERE ss_item_sk = iss.i_item_sk
# AND ss_sold_date_sk = d1.d_date_sk
# AND d1.d_year BETWEEN 1999 AND 1999 + 2 INTERSECT
% .z, .z, .z, .z, .z, .z # table_name
% channel, i_brand_id, i_class_id, i_category_id, sum_sales, number_sales # name
% char, int, int, int, decimal, bigint # type
% 7, 7, 2, 2, 40, 6 # length
[ NULL, NULL, NULL, NULL, 674173362.5100, 155629 ]
[ "catalog", NULL, NULL, NULL, 237410857.4700, 46322 ]
[ "catalog", 1001001, NULL, NULL, 1697729.0200, 347 ]
[ "catalog", 1001001, 1, NULL, 855204.2400, 167 ]
[ "catalog", 1001001, 1, 1, 115019.6100, 20 ]
[ "catalog", 1001001, 1, 2, 146344.4700, 27 ]
[ "catalog", 1001001, 1, 3, 22597.1900, 3 ]
[ "catalog", 1001001, 1, 4, 107555.4300, 23 ]
[ "catalog", 1001001, 1, 5, 122521.3100, 25 ]
[ "catalog", 1001001, 1, 6, 16883.9700, 3 ]
[ "catalog", 1001001, 1, 7, 46329.7800, 9 ]
[ "catalog", 1001001, 1, 8, 77861.8500, 13 ]
[ "catalog", 1001001, 1, 9, 99985.3500, 21 ]
[ "catalog", 1001001, 1, 10, 100105.2800, 23 ]
[ "catalog", 1001001, 2, NULL, 125167.2200, 24 ]
[ "catalog", 1001001, 2, 2, 43967.9700, 7 ]
[ "catalog", 1001001, 2, 3, 68565.3800, 14 ]
[ "catalog", 1001001, 2, 5, 12633.8700, 3 ]
[ "catalog", 1001001, 3, NULL, 198685.0800, 43 ]
[ "catalog", 1001001, 3, 1, 11100.7900, 5 ]
[ "catalog", 1001001, 3, 2, 60551.6400, 14 ]
[ "catalog", 1001001, 3, 4, 28455.2300, 4 ]
[ "catalog", 1001001, 3, 6, 36821.6100, 7 ]
[ "catalog", 1001001, 3, 7, 17250.8200, 6 ]
[ "catalog", 1001001, 3, 8, 14426.9200, 4 ]
[ "catalog", 1001001, 3, 9, 30078.0700, 3 ]
[ "catalog", 1001001, 4, NULL, 109585.9700, 31 ]
[ "catalog", 1001001, 4, 2, 45473.8500, 13 ]
[ "catalog", 1001001, 4, 3, 16558.9200, 8 ]
[ "catalog", 1001001, 4, 4, 47553.2000, 10 ]
[ "catalog", 1001001, 5, NULL, 59790.6100, 17 ]
[ "catalog", 1001001, 5, 9, 30112.1100, 12 ]
[ "catalog", 1001001, 5, 10, 29678.5000, 5 ]
[ "catalog", 1001001, 6, NULL, 10261.8200, 3 ]
[ "catalog", 1001001, 6, 9, 10261.8200, 3 ]
[ "catalog", 1001001, 7, NULL, 18244.9400, 3 ]
[ "catalog", 1001001, 7, 7, 18244.9400, 3 ]
[ "catalog", 1001001, 8, NULL, 55768.4600, 13 ]
[ "catalog", 1001001, 8, 7, 28872.4900, 7 ]
[ "catalog", 1001001, 8, 10, 26895.9700, 6 ]
[ "catalog", 1001001, 9, NULL, 30944.1900, 5 ]
[ "catalog", 1001001, 9, 6, 30944.1900, 5 ]
[ "catalog", 1001001, 11, NULL, 82810.8700, 12 ]
[ "catalog", 1001001, 11, 9, 82810.8700, 12 ]
[ "catalog", 1001001, 12, NULL, 38427.5200, 9 ]
[ "catalog", 1001001, 12, 10, 38427.5200, 9 ]
[ "catalog", 1001001, 15, NULL, 112838.1000, 20 ]
[ "catalog", 1001001, 15, 9, 53508.7900, 7 ]
[ "catalog", 1001001, 15, 10, 59329.3100, 13 ]
[ "catalog", 1001002, NULL, NULL, 3527831.3300, 706 ]
[ "catalog", 1001002, 1, NULL, 2673969.8900, 530 ]
[ "catalog", 1001002, 1, 1, 2673969.8900, 530 ]
[ "catalog", 1001002, 2, NULL, 140831.9100, 29 ]
[ "catalog", 1001002, 2, 1, 140831.9100, 29 ]
[ "catalog", 1001002, 3, NULL, 320175.8700, 67 ]
[ "catalog", 1001002, 3, 1, 320175.8700, 67 ]
[ "catalog", 1001002, 4, NULL, 133287.9600, 21 ]
[ "catalog", 1001002, 4, 1, 133287.9600, 21 ]
[ "catalog", 1001002, 5, NULL, 16606.9000, 9 ]
[ "catalog", 1001002, 5, 1, 16606.9000, 9 ]
[ "catalog", 1001002, 6, NULL, 15133.0100, 4 ]
[ "catalog", 1001002, 6, 1, 15133.0100, 4 ]
[ "catalog", 1001002, 7, NULL, 24471.2600, 10 ]
[ "catalog", 1001002, 7, 1, 24471.2600, 10 ]
[ "catalog", 1001002, 8, NULL, 63773.0500, 12 ]
[ "catalog", 1001002, 8, 1, 63773.0500, 12 ]
[ "catalog", 1001002, 9, NULL, 9167.1900, 3 ]
[ "catalog", 1001002, 9, 1, 9167.1900, 3 ]
[ "catalog", 1001002, 12, NULL, 29108.4200, 7 ]
[ "catalog", 1001002, 12, 1, 29108.4200, 7 ]
[ "catalog", 1001002, 15, NULL, 31143.4500, 6 ]
[ "catalog", 1001002, 15, 1, 31143.4500, 6 ]
[ "catalog", 1001002, 16, NULL, 70162.4200, 8 ]
[ "catalog", 1001002, 16, 1, 70162.4200, 8 ]
[ "catalog", 1002001, NULL, NULL, 2114110.7200, 380 ]
[ "catalog", 1002001, 1, NULL, 348693.9700, 55 ]
[ "catalog", 1002001, 1, 1, 76392.1300, 14 ]
[ "catalog", 1002001, 1, 2, 118394.3300, 21 ]
[ "catalog", 1002001, 1, 4, 29395.7900, 5 ]
[ "catalog", 1002001, 1, 5, 35541.9700, 4 ]
[ "catalog", 1002001, 1, 6, 26104.3600, 3 ]
[ "catalog", 1002001, 1, 9, 18793.9700, 4 ]
[ "catalog", 1002001, 1, 10, 44071.4200, 4 ]
[ "catalog", 1002001, 2, NULL, 1233961.7000, 225 ]
[ "catalog", 1002001, 2, 1, 239511.0200, 51 ]
[ "catalog", 1002001, 2, 2, 147993.1400, 26 ]
[ "catalog", 1002001, 2, 3, 100086.9300, 17 ]
[ "catalog", 1002001, 2, 4, 53524.4200, 13 ]
[ "catalog", 1002001, 2, 5, 48494.0600, 10 ]
[ "catalog", 1002001, 2, 6, 142857.0400, 20 ]
[ "catalog", 1002001, 2, 7, 116557.9800, 16 ]
[ "catalog", 1002001, 2, 8, 92743.9300, 24 ]
[ "catalog", 1002001, 2, 9, 203943.9900, 38 ]
[ "catalog", 1002001, 2, 10, 88249.1900, 10 ]
[ "catalog", 1002001, 3, NULL, 91054.3200, 17 ]
[ "catalog", 1002001, 3, 2, 25171.1300, 6 ]
[ "catalog", 1002001, 3, 7, 27766.7000, 3 ]
[ "catalog", 1002001, 3, 8, 38116.4900, 8 ]
[ "catalog", 1002001, 4, NULL, 182427.6900, 32 ]
[ "catalog", 1002001, 4, 1, 66896.6800, 15 ]
# 18:29:57 >
# 18:29:57 > "Done."
# 18:29:57 >
| {
"pile_set_name": "Github"
} |
"""
__file__
param_config.py
__description__
This file provides global parameter configurations for the project.
__author__
Chenglong Chen < [email protected] >
"""
import os
import numpy as np
############
## Config ##
############
class ParamConfig:
def __init__(self,
feat_folder,
drop_html_flag,
basic_tfidf_ngram_range=(1,3),
basic_tfidf_vocabulary_type="common",
cooccurrence_tfidf_ngram_range=(1,1),
cooccurrence_word_exclude_stopword=False,
stemmer_type="snowball",
count_feat_transform=np.sqrt):
self.n_classes = 4
## CV params
self.n_runs = 3
self.n_folds = 3
self.stratified_label = "query"
## path
self.data_folder = "../../Data"
self.feat_folder = feat_folder
self.original_train_data_path = "%s/train.csv" % self.data_folder
self.original_test_data_path = "%s/test.csv" % self.data_folder
self.processed_train_data_path = "%s/train.processed.csv.pkl" % self.feat_folder
self.processed_test_data_path = "%s/test.processed.csv.pkl" % self.feat_folder
self.pos_tagged_train_data_path = "%s/train.pos_tagged.csv.pkl" % self.feat_folder
self.pos_tagged_test_data_path = "%s/test.pos_tagged.csv.pkl" % self.feat_folder
## nlp related
self.drop_html_flag = drop_html_flag
self.basic_tfidf_ngram_range = basic_tfidf_ngram_range
self.basic_tfidf_vocabulary_type = basic_tfidf_vocabulary_type
self.cooccurrence_tfidf_ngram_range = cooccurrence_tfidf_ngram_range
self.cooccurrence_word_exclude_stopword = cooccurrence_word_exclude_stopword
self.stemmer_type = stemmer_type
## transform for count features
self.count_feat_transform = count_feat_transform
## create feat folder
if not os.path.exists(self.feat_folder):
os.makedirs(self.feat_folder)
## creat folder for the training and testing feat
if not os.path.exists("%s/All" % self.feat_folder):
os.makedirs("%s/All" % self.feat_folder)
## creat folder for each run and fold
for run in range(1,self.n_runs+1):
for fold in range(1,self.n_folds+1):
path = "%s/Run%d/Fold%d" % (self.feat_folder, run, fold)
if not os.path.exists(path):
os.makedirs(path)
## initialize a param config
config = ParamConfig(feat_folder="../../Feat/solution",
drop_html_flag=True,
stemmer_type="porter",
cooccurrence_word_exclude_stopword=False) | {
"pile_set_name": "Github"
} |
.Language=Russian,Russian (Русский)
// Plugin title
"ConEmu Background"
"Плагин &включен"
"&Путь к файлу настроек (Background.xml)"
"&Следить за изменениями xml-файла"
"OK"
"Отмена"
| {
"pile_set_name": "Github"
} |
5607a8c4601a737daadd1f470bde3142aff57026
| {
"pile_set_name": "Github"
} |
.example {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none; /* unprefixed */
}
| {
"pile_set_name": "Github"
} |
[Sleep]
SuspendMode=false
HibernateMode=false
| {
"pile_set_name": "Github"
} |
//===- DWARFUnit.h ----------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_DEBUGINFO_DWARF_DWARFUNIT_H
#define LLVM_DEBUGINFO_DWARF_DWARFUNIT_H
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugLoc.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugRangeList.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugRnglists.h"
#include "llvm/DebugInfo/DWARF/DWARFDie.h"
#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
#include "llvm/DebugInfo/DWARF/DWARFRelocMap.h"
#include "llvm/DebugInfo/DWARF/DWARFSection.h"
#include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h"
#include "llvm/Support/DataExtractor.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>
#include <utility>
#include <vector>
namespace llvm {
class DWARFAbbreviationDeclarationSet;
class DWARFContext;
class DWARFDebugAbbrev;
class DWARFUnit;
/// Base class describing the header of any kind of "unit." Some information
/// is specific to certain unit types. We separate this class out so we can
/// parse the header before deciding what specific kind of unit to construct.
class DWARFUnitHeader {
// Offset within section.
uint64_t Offset = 0;
// Version, address size, and DWARF format.
dwarf::FormParams FormParams;
uint64_t Length = 0;
uint64_t AbbrOffset = 0;
// For DWO units only.
const DWARFUnitIndex::Entry *IndexEntry = nullptr;
// For type units only.
uint64_t TypeHash = 0;
uint64_t TypeOffset = 0;
// For v5 split or skeleton compile units only.
Optional<uint64_t> DWOId;
// Unit type as parsed, or derived from the section kind.
uint8_t UnitType = 0;
// Size as parsed. uint8_t for compactness.
uint8_t Size = 0;
public:
/// Parse a unit header from \p debug_info starting at \p offset_ptr.
bool extract(DWARFContext &Context, const DWARFDataExtractor &debug_info,
uint64_t *offset_ptr, DWARFSectionKind Kind = DW_SECT_INFO,
const DWARFUnitIndex *Index = nullptr,
const DWARFUnitIndex::Entry *Entry = nullptr);
uint64_t getOffset() const { return Offset; }
const dwarf::FormParams &getFormParams() const { return FormParams; }
uint16_t getVersion() const { return FormParams.Version; }
dwarf::DwarfFormat getFormat() const { return FormParams.Format; }
uint8_t getAddressByteSize() const { return FormParams.AddrSize; }
uint8_t getRefAddrByteSize() const { return FormParams.getRefAddrByteSize(); }
uint8_t getDwarfOffsetByteSize() const {
return FormParams.getDwarfOffsetByteSize();
}
uint64_t getLength() const { return Length; }
uint64_t getAbbrOffset() const { return AbbrOffset; }
Optional<uint64_t> getDWOId() const { return DWOId; }
void setDWOId(uint64_t Id) {
assert((!DWOId || *DWOId == Id) && "setting DWOId to a different value");
DWOId = Id;
}
const DWARFUnitIndex::Entry *getIndexEntry() const { return IndexEntry; }
uint64_t getTypeHash() const { return TypeHash; }
uint64_t getTypeOffset() const { return TypeOffset; }
uint8_t getUnitType() const { return UnitType; }
bool isTypeUnit() const {
return UnitType == dwarf::DW_UT_type || UnitType == dwarf::DW_UT_split_type;
}
uint8_t getSize() const { return Size; }
uint8_t getUnitLengthFieldByteSize() const {
return dwarf::getUnitLengthFieldByteSize(FormParams.Format);
}
uint64_t getNextUnitOffset() const {
return Offset + Length + getUnitLengthFieldByteSize();
}
};
const DWARFUnitIndex &getDWARFUnitIndex(DWARFContext &Context,
DWARFSectionKind Kind);
/// Describe a collection of units. Intended to hold all units either from
/// .debug_info and .debug_types, or from .debug_info.dwo and .debug_types.dwo.
class DWARFUnitVector final : public SmallVector<std::unique_ptr<DWARFUnit>, 1> {
std::function<std::unique_ptr<DWARFUnit>(uint64_t, DWARFSectionKind,
const DWARFSection *,
const DWARFUnitIndex::Entry *)>
Parser;
int NumInfoUnits = -1;
public:
using UnitVector = SmallVectorImpl<std::unique_ptr<DWARFUnit>>;
using iterator = typename UnitVector::iterator;
using iterator_range = llvm::iterator_range<typename UnitVector::iterator>;
DWARFUnit *getUnitForOffset(uint64_t Offset) const;
DWARFUnit *getUnitForIndexEntry(const DWARFUnitIndex::Entry &E);
/// Read units from a .debug_info or .debug_types section. Calls made
/// before finishedInfoUnits() are assumed to be for .debug_info sections,
/// calls after finishedInfoUnits() are for .debug_types sections. Caller
/// must not mix calls to addUnitsForSection and addUnitsForDWOSection.
void addUnitsForSection(DWARFContext &C, const DWARFSection &Section,
DWARFSectionKind SectionKind);
/// Read units from a .debug_info.dwo or .debug_types.dwo section. Calls
/// made before finishedInfoUnits() are assumed to be for .debug_info.dwo
/// sections, calls after finishedInfoUnits() are for .debug_types.dwo
/// sections. Caller must not mix calls to addUnitsForSection and
/// addUnitsForDWOSection.
void addUnitsForDWOSection(DWARFContext &C, const DWARFSection &DWOSection,
DWARFSectionKind SectionKind, bool Lazy = false);
/// Add an existing DWARFUnit to this UnitVector. This is used by the DWARF
/// verifier to process unit separately.
DWARFUnit *addUnit(std::unique_ptr<DWARFUnit> Unit);
/// Returns number of all units held by this instance.
unsigned getNumUnits() const { return size(); }
/// Returns number of units from all .debug_info[.dwo] sections.
unsigned getNumInfoUnits() const {
return NumInfoUnits == -1 ? size() : NumInfoUnits;
}
/// Returns number of units from all .debug_types[.dwo] sections.
unsigned getNumTypesUnits() const { return size() - NumInfoUnits; }
/// Indicate that parsing .debug_info[.dwo] is done, and remaining units
/// will be from .debug_types[.dwo].
void finishedInfoUnits() { NumInfoUnits = size(); }
private:
void addUnitsImpl(DWARFContext &Context, const DWARFObject &Obj,
const DWARFSection &Section, const DWARFDebugAbbrev *DA,
const DWARFSection *RS, const DWARFSection *LocSection,
StringRef SS, const DWARFSection &SOS,
const DWARFSection *AOS, const DWARFSection &LS, bool LE,
bool IsDWO, bool Lazy, DWARFSectionKind SectionKind);
};
/// Represents base address of the CU.
/// Represents a unit's contribution to the string offsets table.
struct StrOffsetsContributionDescriptor {
uint64_t Base = 0;
/// The contribution size not including the header.
uint64_t Size = 0;
/// Format and version.
dwarf::FormParams FormParams = {0, 0, dwarf::DwarfFormat::DWARF32};
StrOffsetsContributionDescriptor(uint64_t Base, uint64_t Size,
uint8_t Version, dwarf::DwarfFormat Format)
: Base(Base), Size(Size), FormParams({Version, 0, Format}) {}
StrOffsetsContributionDescriptor() = default;
uint8_t getVersion() const { return FormParams.Version; }
dwarf::DwarfFormat getFormat() const { return FormParams.Format; }
uint8_t getDwarfOffsetByteSize() const {
return FormParams.getDwarfOffsetByteSize();
}
/// Determine whether a contribution to the string offsets table is
/// consistent with the relevant section size and that its length is
/// a multiple of the size of one of its entries.
Expected<StrOffsetsContributionDescriptor>
validateContributionSize(DWARFDataExtractor &DA);
};
class DWARFUnit {
DWARFContext &Context;
/// Section containing this DWARFUnit.
const DWARFSection &InfoSection;
DWARFUnitHeader Header;
const DWARFDebugAbbrev *Abbrev;
const DWARFSection *RangeSection;
uint64_t RangeSectionBase;
const DWARFSection *LocSection;
uint64_t LocSectionBase;
/// Location table of this unit.
std::unique_ptr<DWARFLocationTable> LocTable;
const DWARFSection &LineSection;
StringRef StringSection;
const DWARFSection &StringOffsetSection;
const DWARFSection *AddrOffsetSection;
Optional<uint64_t> AddrOffsetSectionBase;
bool isLittleEndian;
bool IsDWO;
const DWARFUnitVector &UnitVector;
/// Start, length, and DWARF format of the unit's contribution to the string
/// offsets table (DWARF v5).
Optional<StrOffsetsContributionDescriptor> StringOffsetsTableContribution;
/// A table of range lists (DWARF v5 and later).
Optional<DWARFDebugRnglistTable> RngListTable;
Optional<DWARFListTableHeader> LoclistTableHeader;
mutable const DWARFAbbreviationDeclarationSet *Abbrevs;
llvm::Optional<object::SectionedAddress> BaseAddr;
/// The compile unit debug information entry items.
std::vector<DWARFDebugInfoEntry> DieArray;
/// Map from range's start address to end address and corresponding DIE.
/// IntervalMap does not support range removal, as a result, we use the
/// std::map::upper_bound for address range lookup.
std::map<uint64_t, std::pair<uint64_t, DWARFDie>> AddrDieMap;
using die_iterator_range =
iterator_range<std::vector<DWARFDebugInfoEntry>::iterator>;
std::shared_ptr<DWARFUnit> DWO;
uint32_t getDIEIndex(const DWARFDebugInfoEntry *Die) {
auto First = DieArray.data();
assert(Die >= First && Die < First + DieArray.size());
return Die - First;
}
protected:
const DWARFUnitHeader &getHeader() const { return Header; }
/// Size in bytes of the parsed unit header.
uint32_t getHeaderSize() const { return Header.getSize(); }
/// Find the unit's contribution to the string offsets table and determine its
/// length and form. The given offset is expected to be derived from the unit
/// DIE's DW_AT_str_offsets_base attribute.
Expected<Optional<StrOffsetsContributionDescriptor>>
determineStringOffsetsTableContribution(DWARFDataExtractor &DA);
/// Find the unit's contribution to the string offsets table and determine its
/// length and form. The given offset is expected to be 0 in a dwo file or,
/// in a dwp file, the start of the unit's contribution to the string offsets
/// table section (as determined by the index table).
Expected<Optional<StrOffsetsContributionDescriptor>>
determineStringOffsetsTableContributionDWO(DWARFDataExtractor &DA);
public:
DWARFUnit(DWARFContext &Context, const DWARFSection &Section,
const DWARFUnitHeader &Header, const DWARFDebugAbbrev *DA,
const DWARFSection *RS, const DWARFSection *LocSection,
StringRef SS, const DWARFSection &SOS, const DWARFSection *AOS,
const DWARFSection &LS, bool LE, bool IsDWO,
const DWARFUnitVector &UnitVector);
virtual ~DWARFUnit();
bool isDWOUnit() const { return IsDWO; }
DWARFContext& getContext() const { return Context; }
const DWARFSection &getInfoSection() const { return InfoSection; }
uint64_t getOffset() const { return Header.getOffset(); }
const dwarf::FormParams &getFormParams() const {
return Header.getFormParams();
}
uint16_t getVersion() const { return Header.getVersion(); }
uint8_t getAddressByteSize() const { return Header.getAddressByteSize(); }
uint8_t getRefAddrByteSize() const { return Header.getRefAddrByteSize(); }
uint8_t getDwarfOffsetByteSize() const {
return Header.getDwarfOffsetByteSize();
}
uint64_t getLength() const { return Header.getLength(); }
uint8_t getUnitType() const { return Header.getUnitType(); }
bool isTypeUnit() const { return Header.isTypeUnit(); }
uint64_t getNextUnitOffset() const { return Header.getNextUnitOffset(); }
const DWARFSection &getLineSection() const { return LineSection; }
StringRef getStringSection() const { return StringSection; }
const DWARFSection &getStringOffsetSection() const {
return StringOffsetSection;
}
void setAddrOffsetSection(const DWARFSection *AOS, uint32_t Base) {
AddrOffsetSection = AOS;
AddrOffsetSectionBase = Base;
}
/// Recursively update address to Die map.
void updateAddressDieMap(DWARFDie Die);
void setRangesSection(const DWARFSection *RS, uint64_t Base) {
RangeSection = RS;
RangeSectionBase = Base;
}
void setLocSection(const DWARFSection *LS, uint64_t Base) {
LocSection = LS;
LocSectionBase = Base;
}
uint64_t getLocSectionBase() const {
return LocSectionBase;
}
Optional<object::SectionedAddress>
getAddrOffsetSectionItem(uint32_t Index) const;
Optional<uint64_t> getStringOffsetSectionItem(uint32_t Index) const;
DWARFDataExtractor getDebugInfoExtractor() const;
DataExtractor getStringExtractor() const {
return DataExtractor(StringSection, false, 0);
}
const DWARFLocationTable &getLocationTable() { return *LocTable; }
/// Extract the range list referenced by this compile unit from the
/// .debug_ranges section. If the extraction is unsuccessful, an error
/// is returned. Successful extraction requires that the compile unit
/// has already been extracted.
Error extractRangeList(uint64_t RangeListOffset,
DWARFDebugRangeList &RangeList) const;
void clear();
const Optional<StrOffsetsContributionDescriptor> &
getStringOffsetsTableContribution() const {
return StringOffsetsTableContribution;
}
uint8_t getDwarfStringOffsetsByteSize() const {
assert(StringOffsetsTableContribution);
return StringOffsetsTableContribution->getDwarfOffsetByteSize();
}
uint64_t getStringOffsetsBase() const {
assert(StringOffsetsTableContribution);
return StringOffsetsTableContribution->Base;
}
const DWARFAbbreviationDeclarationSet *getAbbreviations() const;
static bool isMatchingUnitTypeAndTag(uint8_t UnitType, dwarf::Tag Tag) {
switch (UnitType) {
case dwarf::DW_UT_compile:
return Tag == dwarf::DW_TAG_compile_unit;
case dwarf::DW_UT_type:
return Tag == dwarf::DW_TAG_type_unit;
case dwarf::DW_UT_partial:
return Tag == dwarf::DW_TAG_partial_unit;
case dwarf::DW_UT_skeleton:
return Tag == dwarf::DW_TAG_skeleton_unit;
case dwarf::DW_UT_split_compile:
case dwarf::DW_UT_split_type:
return dwarf::isUnitType(Tag);
}
return false;
}
/// Return the number of bytes for the header of a unit of
/// UnitType type.
///
/// This function must be called with a valid unit type which in
/// DWARF5 is defined as one of the following six types.
static uint32_t getDWARF5HeaderSize(uint8_t UnitType) {
switch (UnitType) {
case dwarf::DW_UT_compile:
case dwarf::DW_UT_partial:
return 12;
case dwarf::DW_UT_skeleton:
case dwarf::DW_UT_split_compile:
return 20;
case dwarf::DW_UT_type:
case dwarf::DW_UT_split_type:
return 24;
}
llvm_unreachable("Invalid UnitType.");
}
llvm::Optional<object::SectionedAddress> getBaseAddress();
DWARFDie getUnitDIE(bool ExtractUnitDIEOnly = true) {
extractDIEsIfNeeded(ExtractUnitDIEOnly);
if (DieArray.empty())
return DWARFDie();
return DWARFDie(this, &DieArray[0]);
}
DWARFDie getNonSkeletonUnitDIE(bool ExtractUnitDIEOnly = true) {
parseDWO();
if (DWO)
return DWO->getUnitDIE(ExtractUnitDIEOnly);
return getUnitDIE(ExtractUnitDIEOnly);
}
const char *getCompilationDir();
Optional<uint64_t> getDWOId() {
extractDIEsIfNeeded(/*CUDieOnly*/ true);
return getHeader().getDWOId();
}
void setDWOId(uint64_t NewID) { Header.setDWOId(NewID); }
/// Return a vector of address ranges resulting from a (possibly encoded)
/// range list starting at a given offset in the appropriate ranges section.
Expected<DWARFAddressRangesVector> findRnglistFromOffset(uint64_t Offset);
/// Return a vector of address ranges retrieved from an encoded range
/// list whose offset is found via a table lookup given an index (DWARF v5
/// and later).
Expected<DWARFAddressRangesVector> findRnglistFromIndex(uint32_t Index);
/// Return a rangelist's offset based on an index. The index designates
/// an entry in the rangelist table's offset array and is supplied by
/// DW_FORM_rnglistx.
Optional<uint64_t> getRnglistOffset(uint32_t Index) {
if (!RngListTable)
return None;
if (Optional<uint64_t> Off = RngListTable->getOffsetEntry(Index))
return *Off + RangeSectionBase;
return None;
}
Optional<uint64_t> getLoclistOffset(uint32_t Index) {
if (!LoclistTableHeader)
return None;
if (Optional<uint64_t> Off = LoclistTableHeader->getOffsetEntry(Index))
return *Off + getLocSectionBase();
return None;
}
Expected<DWARFAddressRangesVector> collectAddressRanges();
Expected<DWARFLocationExpressionsVector>
findLoclistFromOffset(uint64_t Offset);
/// Returns subprogram DIE with address range encompassing the provided
/// address. The pointer is alive as long as parsed compile unit DIEs are not
/// cleared.
DWARFDie getSubroutineForAddress(uint64_t Address);
/// getInlinedChainForAddress - fetches inlined chain for a given address.
/// Returns empty chain if there is no subprogram containing address. The
/// chain is valid as long as parsed compile unit DIEs are not cleared.
void getInlinedChainForAddress(uint64_t Address,
SmallVectorImpl<DWARFDie> &InlinedChain);
/// Return the DWARFUnitVector containing this unit.
const DWARFUnitVector &getUnitVector() const { return UnitVector; }
/// Returns the number of DIEs in the unit. Parses the unit
/// if necessary.
unsigned getNumDIEs() {
extractDIEsIfNeeded(false);
return DieArray.size();
}
/// Return the index of a DIE inside the unit's DIE vector.
///
/// It is illegal to call this method with a DIE that hasn't be
/// created by this unit. In other word, it's illegal to call this
/// method on a DIE that isn't accessible by following
/// children/sibling links starting from this unit's getUnitDIE().
uint32_t getDIEIndex(const DWARFDie &D) {
return getDIEIndex(D.getDebugInfoEntry());
}
/// Return the DIE object at the given index.
DWARFDie getDIEAtIndex(unsigned Index) {
assert(Index < DieArray.size());
return DWARFDie(this, &DieArray[Index]);
}
DWARFDie getParent(const DWARFDebugInfoEntry *Die);
DWARFDie getSibling(const DWARFDebugInfoEntry *Die);
DWARFDie getPreviousSibling(const DWARFDebugInfoEntry *Die);
DWARFDie getFirstChild(const DWARFDebugInfoEntry *Die);
DWARFDie getLastChild(const DWARFDebugInfoEntry *Die);
/// Return the DIE object for a given offset inside the
/// unit's DIE vector.
///
/// The unit needs to have its DIEs extracted for this method to work.
DWARFDie getDIEForOffset(uint64_t Offset) {
extractDIEsIfNeeded(false);
assert(!DieArray.empty());
auto It =
llvm::partition_point(DieArray, [=](const DWARFDebugInfoEntry &DIE) {
return DIE.getOffset() < Offset;
});
if (It != DieArray.end() && It->getOffset() == Offset)
return DWARFDie(this, &*It);
return DWARFDie();
}
uint32_t getLineTableOffset() const {
if (auto IndexEntry = Header.getIndexEntry())
if (const auto *Contrib = IndexEntry->getOffset(DW_SECT_LINE))
return Contrib->Offset;
return 0;
}
die_iterator_range dies() {
extractDIEsIfNeeded(false);
return die_iterator_range(DieArray.begin(), DieArray.end());
}
virtual void dump(raw_ostream &OS, DIDumpOptions DumpOpts) = 0;
Error tryExtractDIEsIfNeeded(bool CUDieOnly);
private:
/// Size in bytes of the .debug_info data associated with this compile unit.
size_t getDebugInfoSize() const {
return Header.getLength() + Header.getUnitLengthFieldByteSize() -
getHeaderSize();
}
/// extractDIEsIfNeeded - Parses a compile unit and indexes its DIEs if it
/// hasn't already been done
void extractDIEsIfNeeded(bool CUDieOnly);
/// extractDIEsToVector - Appends all parsed DIEs to a vector.
void extractDIEsToVector(bool AppendCUDie, bool AppendNonCUDIEs,
std::vector<DWARFDebugInfoEntry> &DIEs) const;
/// clearDIEs - Clear parsed DIEs to keep memory usage low.
void clearDIEs(bool KeepCUDie);
/// parseDWO - Parses .dwo file for current compile unit. Returns true if
/// it was actually constructed.
bool parseDWO();
};
} // end namespace llvm
#endif // LLVM_DEBUGINFO_DWARF_DWARFUNIT_H
| {
"pile_set_name": "Github"
} |
---
title: "caf"
layout: formula
---
{{ content }}
| {
"pile_set_name": "Github"
} |
/* Copyright (C) 2008 Miguel Rojas <[email protected]>
*
* Contact: [email protected]
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.openscience.cdk.reaction;
import org.junit.Assert;
import org.junit.Test;
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.CDKTestCase;
/**
* Tests for IReactionProcess implementations.
*
* @cdk.module test-reaction
*/
public abstract class ReactionMechanismTest extends CDKTestCase {
protected static IReactionMechanism reactionMechanism;
/**
* Defining reaction mechanism.
*
* @param descriptorClass
* @throws Exception
*/
public static void setMechanism(Class<?> descriptorClass) throws Exception {
if (ReactionMechanismTest.reactionMechanism == null) {
Object descriptor = (Object) descriptorClass.newInstance();
if (!(descriptor instanceof IReactionMechanism)) {
throw new CDKException("The passed reaction class must be a IReactionMechanism");
}
ReactionMechanismTest.reactionMechanism = (IReactionMechanism) descriptor;
}
}
/**
* Makes sure that the extending class has set the super.descriptor.
* Each extending class should have this bit of code (JUnit3 formalism):
* <pre>
* public void setUp() {
* // Pass a Class, not an Object!
* setDescriptor(SomeDescriptor.class);
* }
*
* <p>The unit tests in the extending class may use this instance, but
* are not required.
*
* </pre>
*/
@Test
public void testHasSetSuperDotDescriptor() {
Assert.assertNotNull("The extending class must set the super.descriptor in its setUp() method.",
reactionMechanism);
}
}
| {
"pile_set_name": "Github"
} |
.. title:: clang-tidy - openmp-use-default-none
openmp-use-default-none
=======================
Finds OpenMP directives that are allowed to contain a ``default`` clause,
but either don't specify it or the clause is specified but with the kind
other than ``none``, and suggests to use the ``default(none)`` clause.
Using ``default(none)`` clause forces developers to explicitly specify data
sharing attributes for the variables referenced in the construct,
thus making it obvious which variables are referenced, and what is their
data sharing attribute, thus increasing readability and possibly making errors
easier to spot.
Example
-------
.. code-block:: c++
// ``for`` directive can not have ``default`` clause, no diagnostics.
void n0(const int a) {
#pragma omp for
for (int b = 0; b < a; b++)
;
}
// ``parallel`` directive.
// ``parallel`` directive can have ``default`` clause, but said clause is not
// specified, diagnosed.
void p0_0() {
#pragma omp parallel
;
// WARNING: OpenMP directive ``parallel`` does not specify ``default``
// clause. Consider specifying ``default(none)`` clause.
}
// ``parallel`` directive can have ``default`` clause, and said clause is
// specified, with ``none`` kind, all good.
void p0_1() {
#pragma omp parallel default(none)
;
}
// ``parallel`` directive can have ``default`` clause, and said clause is
// specified, but with ``shared`` kind, which is not ``none``, diagnose.
void p0_2() {
#pragma omp parallel default(shared)
;
// WARNING: OpenMP directive ``parallel`` specifies ``default(shared)``
// clause. Consider using ``default(none)`` clause instead.
}
// ``parallel`` directive can have ``default`` clause, and said clause is
// specified, but with ``firstprivate`` kind, which is not ``none``, diagnose.
void p0_3() {
#pragma omp parallel default(firstprivate)
;
// WARNING: OpenMP directive ``parallel`` specifies ``default(firstprivate)``
// clause. Consider using ``default(none)`` clause instead.
}
| {
"pile_set_name": "Github"
} |
# This file is distributed under the same license as the Django package.
#
# Translators:
# Aitzol Naberan <[email protected]>, 2011-2013.
# Jannis Leidel <[email protected]>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-12-15 23:27+0100\n"
"PO-Revision-Date: 2013-01-07 13:41+0000\n"
"Last-Translator: Aitzol Naberan <[email protected]>\n"
"Language-Team: Basque (http://www.transifex.com/projects/p/django/language/"
"eu/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: eu\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: admin.py:41
msgid "Personal info"
msgstr "Informazio pertsonala"
#: admin.py:42
msgid "Permissions"
msgstr "Baimenak"
#: admin.py:44
msgid "Important dates"
msgstr "Data garrantzitsuak"
#: admin.py:126
msgid "Password changed successfully."
msgstr "Ondo aldatu da pasahitza."
#: admin.py:136
#, python-format
msgid "Change password: %s"
msgstr "Pasahitza aldatu: %s"
#: forms.py:31 tests/forms.py:251 tests/forms.py:256 tests/forms.py:384
msgid "No password set."
msgstr "Pasahitza ezarri gabe."
#: forms.py:37 tests/forms.py:261 tests/forms.py:267
msgid "Invalid password format or unknown hashing algorithm."
msgstr "Pasahitz formatu baliogabea edo hash algoritmo ezezaguna."
#: forms.py:67
msgid "A user with that username already exists."
msgstr "Erabiltzaile izen hori ez dago eskuragarri."
#: forms.py:68 forms.py:269 forms.py:329
msgid "The two password fields didn't match."
msgstr "Pasahitzak ez datoz bat."
#: forms.py:70 forms.py:115
msgid "Username"
msgstr "Erabiltzaile izena"
#: forms.py:72 forms.py:116
msgid "Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."
msgstr ""
"Beharrezkoa. 30 karaktere edo gutxiago. Hizki, zenbaki eta @/./+/-/_ "
"bakarrik."
#: forms.py:75 forms.py:119
msgid "This value may contain only letters, numbers and @/./+/-/_ characters."
msgstr "Hizki, zenbaki eta @/./+/-/_ karaktereak bakarrik izan ditzazke"
#: forms.py:77 forms.py:121 forms.py:148 forms.py:331
msgid "Password"
msgstr "Pasahitza"
#: forms.py:79
msgid "Password confirmation"
msgstr "Pasahitza berretsi"
#: forms.py:81
msgid "Enter the same password as above, for verification."
msgstr "Idatzi berriro pasahitza."
#: forms.py:122
msgid ""
"Raw passwords are not stored, so there is no way to see this user's "
"password, but you can change the password using <a href=\"password/\">this "
"form</a>."
msgstr ""
"Pasahitzak zifratuta gordetzen direnez ez dago erabiltzaile pasahitza "
"ikusterik, baina pasahitza aldatu dezakezu <a href=\"password/\">hemen</a>"
#: forms.py:151
#, python-format
msgid ""
"Please enter a correct %(username)s and password. Note that both fields may "
"be case-sensitive."
msgstr ""
"Mesedez idatzi %(username)s eta pasahitz egokiak. Maiskula eta minuskulak "
"ondo bereiztu."
#: forms.py:153
msgid ""
"Your Web browser doesn't appear to have cookies enabled. Cookies are "
"required for logging in."
msgstr ""
"Zure nabigatzaileak ez ditu cookiak onartzen. Cookia-k beharrezkoak dira "
"sisteman sartzeko."
#: forms.py:155
msgid "This account is inactive."
msgstr "Kontu hau az dago aktibo."
#: forms.py:206
msgid ""
"That email address doesn't have an associated user account. Are you sure "
"you've registered?"
msgstr ""
"Helbide elektroniko honek ez dauka erabiltzailerik esleituta. Ziur zaude "
"erregistratu duzula?"
#: forms.py:208 tests/forms.py:374
msgid ""
"The user account associated with this email address cannot reset the "
"password."
msgstr ""
"E-mail helbide honekin lotutako erabiltzaile kontuan ezin da pasahitza "
"berrezarri."
#: forms.py:211
msgid "Email"
msgstr "Eposta"
#: forms.py:271
msgid "New password"
msgstr "Pasahitz berria"
#: forms.py:273
msgid "New password confirmation"
msgstr "Pasahitz berria berretsi"
#: forms.py:302
msgid "Your old password was entered incorrectly. Please enter it again."
msgstr "Zure pasahitz zaharra ez da zuzena. Idatzi ezazu berriro."
#: forms.py:305
msgid "Old password"
msgstr "Pasahitz zaharra"
#: forms.py:333
msgid "Password (again)"
msgstr "Pasahitza (berriro)"
#: hashers.py:241 hashers.py:292 hashers.py:321 hashers.py:349 hashers.py:378
#: hashers.py:412
msgid "algorithm"
msgstr "algoritmoak"
#: hashers.py:242
msgid "iterations"
msgstr "begiztak"
#: hashers.py:243 hashers.py:294 hashers.py:322 hashers.py:350 hashers.py:413
msgid "salt"
msgstr "salt"
#: hashers.py:244 hashers.py:323 hashers.py:351 hashers.py:379 hashers.py:414
msgid "hash"
msgstr "hash"
#: hashers.py:293
msgid "work factor"
msgstr "work factor"
#: hashers.py:295
msgid "checksum"
msgstr "checksum"
#: models.py:72 models.py:121
msgid "name"
msgstr "izena"
#: models.py:74
msgid "codename"
msgstr "kode izena"
#: models.py:78
msgid "permission"
msgstr "baimena"
#: models.py:79 models.py:123
msgid "permissions"
msgstr "baimenak"
#: models.py:128
msgid "group"
msgstr "taldea"
#: models.py:129 models.py:301
msgid "groups"
msgstr "taldeak"
#: models.py:200
msgid "password"
msgstr "pasahitza"
#: models.py:201
msgid "last login"
msgstr "azken sarrera"
#: models.py:298
msgid "superuser status"
msgstr "Erabiltzaile nagusia"
#: models.py:299
msgid ""
"Designates that this user has all permissions without explicitly assigning "
"them."
msgstr ""
"Erabiltzaileari baimen guztiak esleitzeko banan-banan aukeratu behar izan "
"gabe."
#: models.py:302
msgid ""
"The groups this user belongs to. A user will get all permissions granted to "
"each of his/her group."
msgstr ""
"Erabiltzailea zein taldetakoa den. Erabiltzaileak taldeari emandako baimen "
"guztiak jasoko ditu."
#: models.py:306
msgid "user permissions"
msgstr "Erabiltzailearen baimenak"
#: models.py:377
msgid "username"
msgstr "erabiltzaile izena"
#: models.py:378
msgid ""
"Required. 30 characters or fewer. Letters, numbers and @/./+/-/_ characters"
msgstr ""
"Beharrezkoa. 30 karaktere edo gutxiago. Hizki, zenbaki eta @/./+/-/_ "
"karaktereak"
#: models.py:381
msgid "Enter a valid username."
msgstr "Sartu baleko erabiltzaile izen bat."
#: models.py:383
msgid "first name"
msgstr "izena"
#: models.py:384
msgid "last name"
msgstr "abizena"
#: models.py:385
msgid "email address"
msgstr "e-mail helbidea"
#: models.py:386
msgid "staff status"
msgstr "Arduradun egoera"
#: models.py:387
msgid "Designates whether the user can log into this admin site."
msgstr ""
"Erabiltzaileak kudeaketa gune honetan sartzeko baimena duen edo ez "
"adierazten du."
#: models.py:389
msgid "active"
msgstr "Aktiboa"
#: models.py:390
msgid ""
"Designates whether this user should be treated as active. Unselect this "
"instead of deleting accounts."
msgstr ""
"Erabiltzaile bat aktibo gisa tratatu edo ez zehazten du. Ezgaitu hau kontuak "
"ezabatu beharrean."
#: models.py:392
msgid "date joined"
msgstr "erregistro eguna"
#: models.py:400
msgid "user"
msgstr "Erabiltzailea"
#: models.py:401
msgid "users"
msgstr "Erabiltzaileak"
#: views.py:94
msgid "Logged out"
msgstr "Sesiotik kanpo"
#: templates/registration/password_reset_subject.txt:2
#, python-format
msgid "Password reset on %(site_name)s"
msgstr "Pasahitza berrezarri %(site_name)s webgunean"
| {
"pile_set_name": "Github"
} |
# vim:set ft= ts=4 sw=4 et fdm=marker:
use Test::Nginx::Socket 'no_plan';
run_tests();
__DATA__
=== TEST 1: ngx_request
ngx_request
--- config
location = /ngx_request {
content_by_php '
var_dump(ngx_request::document_uri());
';
}
--- request
GET /ngx_request
--- response_body
string(12) "/ngx_request"
| {
"pile_set_name": "Github"
} |
# Alias OBJ Model File
# Exported from SketchUp, (c) 2000-2012 Trimble Navigation Limited
# File units = meters
mtllib Grey_Arch_01.mtl
g Mesh1 Grey_Arch Model
usemtl Light_Stone
v 0.5 0 -3
vt -0.227273 0
vn 0 0 -1
v 0 0 -3
vt 0 0
v 0 2.2 -3
vt 0 1
v 0.5 2.2 -3
vt -0.227273 1
f 1/1/1 2/2/1 3/3/1 4/4/1
v 0.5 0 -2.5
vt -0.227273 1.13636
vn 0 -1 -0
v 0.4 0 -2.5
vt -0.181818 1.13636
v 0.1 0 -2.5
vt -0.0454545 1.13636
v 0 0 -2.5
vt 0 1.13636
vt 0 1.36364
vt -0.227273 1.36364
f 5/5/2 6/6/2 7/7/2 8/8/2 2/9/2 1/10/2
vt 0.227273 0
vn 0 0 1
v 0.5 2.2 -2.5
vt 0.227273 1
v 0.4 2.2 -2.5
vt 0.181818 1
vt 0.181818 0
f 5/11/3 9/12/3 10/13/3 6/14/3
vt 1.36364 1
vn 1 0 -0
vt 1.13636 1
vt 1.13636 0
vt 1.36364 0
f 4/15/4 9/16/4 5/17/4 1/18/4
vn 0 1 -0
v 0 2.2 -2.5
v 0.1 2.2 -2.5
vt 0.0454545 1.13636
vt 0.181818 1.13636
vt 0.227273 1.13636
vt 0.227273 1.36364
f 3/9/5 11/8/5 12/19/5 10/20/5 9/21/5 4/22/5
vt -1.36364 0
vn -1 0 -0
vt -1.13636 0
vt -1.13636 1
vt -1.36364 1
f 2/23/6 8/24/6 11/25/6 3/26/6
vt 0.0454545 0
vt 0.0454545 1
f 11/3/3 8/2/3 7/27/3 12/28/3
usemtl Dark_Stone
v 0.1 0 -2.49
vt -1.13182 0
v 0.1 0.76154 -2.33852
vt -1.06296 0.346155
v 0.1 1.40714 -1.90714
vt -0.866883 0.63961
v 0.1 1.83852 -1.26154
vt -0.573427 0.835691
v 0.1 1.99 -0.5
vt -0.227273 0.904545
v 0.1 1.99 1.15506e-014
vt 5.25026e-015 0.904545
v 0.1 2.2 1.15506e-014
vt 5.25026e-015 1
f 7/24/6 13/29/6 14/30/6 15/31/6 16/32/6 17/33/6 18/34/6 19/35/6 12/25/6
v 0.4 0 -2.49
vt -0.181818 1.13182
vt -0.0454545 1.13182
f 20/36/2 13/37/2 7/7/2 6/6/2
vt 0.181818 -0.220807
vn -4.54349e-029 -0.19509 0.980785
v 0.4 0.76154 -2.33852
vt 0.181818 0.132129
vt 0.0454545 0.132129
vt 0.0454545 -0.220807
f 20/38/7 21/39/7 14/40/7 13/41/7
v 0.4 2.2 1.15506e-014
vt -5.25026e-015 1
v 0.4 1.99 1.15506e-014
vt -5.25026e-015 0.904545
v 0.4 1.99 -0.5
vt 0.227273 0.904545
v 0.4 1.83852 -1.26154
vt 0.573427 0.835691
v 0.4 1.40714 -1.90714
vt 0.866883 0.63961
vt 1.06296 0.346155
vt 1.13182 0
f 10/16/4 22/42/4 23/43/4 24/44/4 25/45/4 26/46/4 21/47/4 20/48/4 6/17/4
vt 0.0454545 -5.25026e-015
vt 0.181818 -5.25026e-015
f 10/20/5 12/19/5 19/49/5 22/50/5
usemtl Light_Stone
vt 0.0454545 0.904545
vt 0.181818 0.904545
f 22/13/3 19/28/3 18/51/3 23/52/3
vt -0.0454545 0.227273
vn 9.98498e-018 -0.995185 0.0980171
vt -0.181818 0.227273
vt -0.181818 -5.25026e-015
vt -0.0454545 -5.25026e-015
f 17/53/8 24/54/8 23/55/2 18/56/2
usemtl Dark_Stone
vt 0.181818 -0.399374
vn 1.98738e-017 -0.980785 0.19509
vt 0.181818 -0.0464377
vt 0.0454545 -0.0464377
vt 0.0454545 -0.399374
f 25/57/9 24/58/8 17/59/8 16/60/9
vt 0.181818 -0.365438
vn 0 -0.83147 0.55557
vt 0.181818 -0.0125023
vt 0.0454545 -0.0125023
vt 0.0454545 -0.365438
f 26/61/10 25/62/10 16/63/10 15/64/10
vt 0.181818 -0.302734
vn 0 -0.55557 0.83147
vt 0.181818 0.0502021
vt 0.0454545 0.0502021
vt 0.0454545 -0.302734
f 21/65/11 26/66/11 15/67/11 14/68/11
| {
"pile_set_name": "Github"
} |
#!/bin/sh
run_testsuite=true
test -d "$1" || { echo "'$1' is not a directory"; exit 1; }
test -x "$1/scripts/randomtest" || { echo "No scripts/randomtest in '$1'"; exit 1; }
export LIBC="uclibc"
export CROSS_COMPILER_PREFIX="i686-"
export MAKEOPTS="-j9"
cnt=0
fail=0
while sleep 1; do
echo "Passes: $cnt Failures: $fail"
dir="test.$$"
while test -e "$dir" -o -e "failed.$dir"; do
dir="test.$$.$RANDOM"
done
echo "Running randconfig test in $dir..."
if ! "$1/scripts/randomtest" "$1" "$dir" >/dev/null; then
mv -- "$dir" "failed.$dir"
echo "Failed build in: failed.$dir"
exit 1 # you may comment this out...
let fail++
continue
fi
if $run_testsuite; then
(
cd -- "$dir/testsuite" || exit 1
echo "Running testsuite in $dir..."
SKIP_KNOWN_BUGS=1 SKIP_INTERNET_TESTS=1 ./runtest -v >runtest.log 2>&1
)
if test $? != 0; then
echo "Failed runtest in $dir"
exit 1 # you may comment this out...
let fail++
continue
fi
tail -n10 -- "$dir/testsuite/runtest.log"
fi
rm -rf -- "$dir"
let cnt++
done
| {
"pile_set_name": "Github"
} |
namespace WowPacketParser.Enums
{
public enum GarrisonMissionResult
{
Success,
Failure
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ALIGNED_ARRAY_
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ALIGNED_ARRAY_
#include "webrtc/rtc_base/checks.h"
#include "webrtc/system_wrappers/include/aligned_malloc.h"
namespace webrtc {
// Wrapper class for aligned arrays. Every row (and the first dimension) are
// aligned to the given byte alignment.
template<typename T> class AlignedArray {
public:
AlignedArray(size_t rows, size_t cols, size_t alignment)
: rows_(rows),
cols_(cols) {
RTC_CHECK_GT(alignment, 0);
head_row_ = static_cast<T**>(AlignedMalloc(rows_ * sizeof(*head_row_),
alignment));
for (size_t i = 0; i < rows_; ++i) {
head_row_[i] = static_cast<T*>(AlignedMalloc(cols_ * sizeof(**head_row_),
alignment));
}
}
~AlignedArray() {
for (size_t i = 0; i < rows_; ++i) {
AlignedFree(head_row_[i]);
}
AlignedFree(head_row_);
}
T* const* Array() {
return head_row_;
}
const T* const* Array() const {
return head_row_;
}
T* Row(size_t row) {
RTC_CHECK_LE(row, rows_);
return head_row_[row];
}
const T* Row(size_t row) const {
RTC_CHECK_LE(row, rows_);
return head_row_[row];
}
T& At(size_t row, size_t col) {
RTC_CHECK_LE(col, cols_);
return Row(row)[col];
}
const T& At(size_t row, size_t col) const {
RTC_CHECK_LE(col, cols_);
return Row(row)[col];
}
size_t rows() const {
return rows_;
}
size_t cols() const {
return cols_;
}
private:
size_t rows_;
size_t cols_;
T** head_row_;
};
} // namespace webrtc
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ALIGNED_ARRAY_
| {
"pile_set_name": "Github"
} |
-- <<geturls
import Control.Concurrent
import Data.ByteString as B
import GetURL
main = do
m1 <- newEmptyMVar -- <1>
m2 <- newEmptyMVar -- <1>
forkIO $ do -- <2>
r <- getURL "http://www.wikipedia.org/wiki/Shovel"
putMVar m1 r
forkIO $ do -- <3>
r <- getURL "http://www.wikipedia.org/wiki/Spade"
putMVar m2 r
r1 <- takeMVar m1 -- <4>
r2 <- takeMVar m2 -- <5>
print (B.length r1, B.length r2) -- <6>
-- >>
| {
"pile_set_name": "Github"
} |
/*
Gruvbox style (dark) (c) Pavel Pertsev (original style at https://github.com/morhetz/gruvbox)
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #282828;
}
.hljs,
.hljs-subst {
color: #ebdbb2;
}
/* Gruvbox Red */
.hljs-deletion,
.hljs-formula,
.hljs-keyword,
.hljs-link,
.hljs-selector-tag {
color: #fb4934;
}
/* Gruvbox Blue */
.hljs-built_in,
.hljs-emphasis,
.hljs-name,
.hljs-quote,
.hljs-strong,
.hljs-title,
.hljs-variable {
color: #83a598;
}
/* Gruvbox Yellow */
.hljs-attr,
.hljs-params,
.hljs-template-tag,
.hljs-type {
color: #fabd2f;
}
/* Gruvbox Purple */
.hljs-builtin-name,
.hljs-doctag,
.hljs-literal,
.hljs-number {
color: #8f3f71;
}
/* Gruvbox Orange */
.hljs-code,
.hljs-meta,
.hljs-regexp,
.hljs-selector-id,
.hljs-template-variable {
color: #fe8019;
}
/* Gruvbox Green */
.hljs-addition,
.hljs-meta-string,
.hljs-section,
.hljs-selector-attr,
.hljs-selector-class,
.hljs-string,
.hljs-symbol {
color: #b8bb26;
}
/* Gruvbox Aqua */
.hljs-attribute,
.hljs-bullet,
.hljs-class,
.hljs-function,
.hljs-function .hljs-keyword,
.hljs-meta-keyword,
.hljs-selector-pseudo,
.hljs-tag {
color: #8ec07c;
}
/* Gruvbox Gray */
.hljs-comment {
color: #928374;
}
/* Gruvbox Purple */
.hljs-link_label,
.hljs-literal,
.hljs-number {
color: #d3869b;
}
.hljs-comment,
.hljs-emphasis {
font-style: italic;
}
.hljs-section,
.hljs-strong,
.hljs-tag {
font-weight: bold;
}
| {
"pile_set_name": "Github"
} |
---
Title: Sonderbestimmungen für Auslandsdienstreisen der Reichsbeamten
jurabk: RAuslDRBest
layout: default
origslug: rausldrbest
slug: rausldrbest
---
# Sonderbestimmungen für Auslandsdienstreisen der Reichsbeamten (RAuslDRBest)
Ausfertigungsdatum
: 1933-12-22
Fundstelle
: RBesBl: 1934, 1
| {
"pile_set_name": "Github"
} |
package service
import (
"context"
"net"
"strings"
"go-common/app/service/main/identify/conf"
"go-common/app/service/main/identify/dao"
"go-common/library/cache"
"go-common/library/log"
"go-common/library/queue/databus"
"github.com/pkg/errors"
)
var (
emptyStringArray = []string{""}
)
// Service is a identify service.
type Service struct {
c *conf.Config
d *dao.Dao
// cache proc
cache *cache.Cache
// login log
loginlogchan chan func()
// loginLogDataBus
loginLogDataBus *databus.Databus
// loginCacheExpires
loginCacheExpires int32
// intranetCIDR
intranetCIDR []*net.IPNet
}
// New new a identify service.
func New(c *conf.Config) (s *Service) {
s = &Service{
c: c,
d: dao.New(c),
cache: cache.New(1, 1024),
// login log chan
loginlogchan: make(chan func(), 10240),
loginLogDataBus: databus.New(c.DataBus.UserLog),
// loginCacheExpires
loginCacheExpires: 3600,
}
cidrs := make([]*net.IPNet, 0, len(c.Identify.IntranetCIDR))
for _, raw := range c.Identify.IntranetCIDR {
_, inet, err := net.ParseCIDR(raw)
if err != nil {
panic(errors.Wrapf(err, "Invalid CIDR: %s", raw))
}
cidrs = append(cidrs, inet)
}
s.intranetCIDR = cidrs
if c.Identify.LoginCacheExpires > 0 {
s.loginCacheExpires = c.Identify.LoginCacheExpires
}
for i := 0; i < s.c.Identify.LoginLogConsumerSize; i++ {
go func() {
for f := range s.loginlogchan {
f()
}
}()
}
return
}
// Close dao.
func (s *Service) Close() {
s.d.Close()
}
// Ping check server ok.
func (s *Service) Ping(c context.Context) (err error) {
return s.d.Ping(c)
}
func (s *Service) addLoginLog(f func()) {
select {
case s.loginlogchan <- f:
default:
log.Warn("loginlogchan chan full")
}
}
// readCookiesVal parses all "Cookie" values from the input line and
// returns the successfully parsed values.
//
// if filter isn't empty, only cookies of that name are returned
func readCookiesVal(line, filter string) []string {
if line == "" {
return emptyStringArray
}
var cookies []string
parts := strings.Split(strings.TrimSpace(line), ";")
if len(parts) == 1 && parts[0] == "" {
return emptyStringArray
}
// Per-line attributes
for i := 0; i < len(parts); i++ {
parts[i] = strings.TrimSpace(parts[i])
if len(parts[i]) == 0 {
continue
}
name, val := parts[i], ""
if j := strings.Index(name, "="); j >= 0 {
name, val = name[:j], name[j+1:]
}
// if !isCookieNameValid(name) {
// continue
// }
if filter != "" && filter != name {
continue
}
val, ok := parseCookieValue(val, true)
if !ok {
continue
}
cookies = append(cookies, val)
}
if len(cookies) == 0 {
return emptyStringArray
}
return cookies
}
func parseCookieValue(raw string, allowDoubleQuote bool) (string, bool) {
// Strip the quotes, if present.
if allowDoubleQuote && len(raw) > 1 && raw[0] == '"' && raw[len(raw)-1] == '"' {
raw = raw[1 : len(raw)-1]
}
// for i := 0; i < len(raw); i++ {
// if !validCookieValueByte(raw[i]) {
// return "", false
// }
// }
return raw, true
}
func (s *Service) isIntranetIP(ip string) (exists bool) {
for _, c := range s.intranetCIDR {
if c.Contains(net.ParseIP(ip)) {
exists = true
return
}
}
return
}
| {
"pile_set_name": "Github"
} |
// Copyright (C) 2013 Vicente J. Botet Escriba
//
// 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)
//
// 2013/10 Vicente J. Botet Escriba
// Creation.
#ifndef BOOST_CSBL_TUPLE_HPP
#define BOOST_CSBL_TUPLE_HPP
#include <boost/config.hpp>
#if defined BOOST_THREAD_USES_BOOST_TUPLE || defined BOOST_NO_CXX11_HDR_TUPLE || defined BOOST_NO_CXX11_RVALUE_REFERENCES
#include <boost/tuple/tuple.hpp>
#ifndef BOOST_THREAD_USES_BOOST_TUPLE
#define BOOST_THREAD_USES_BOOST_TUPLE
#endif
#else
#include <tuple>
#endif
namespace boost
{
namespace csbl
{
#if defined BOOST_THREAD_USES_BOOST_TUPLE
using ::boost::tuple;
using ::boost::get;
using ::boost::make_tuple;
//using ::boost::tuple_size;
#else
// 20.4.2, class template tuple:
using ::std::tuple;
using ::std::get;
using ::std::make_tuple;
using ::std::tuple_size;
// 20.4.2.4, tuple creation functions:
// 20.4.2.5, tuple helper classes:
// 20.4.2.6, element access:
// 20.4.2.7, relational operators:
// 20.4.2.8, allocator-related traits
// 20.4.2.9, specialized algorithms:
#endif
}
}
#endif // header
| {
"pile_set_name": "Github"
} |
import * as DynamoDB from 'aws-sdk/clients/dynamodb'
import { ComplexModel } from '../../../../test/models'
import { DynamoDbWrapper } from '../../dynamo-db-wrapper'
import { ReadManyRequest } from '../read-many.request'
import { ScanRequest } from './scan.request'
describe('scan request', () => {
let request: MyScanRequest
let scanSpy: jasmine.Spy
class MyScanRequest extends ScanRequest<ComplexModel> {
constructor(dynamoDBWrapper: DynamoDbWrapper) {
super(dynamoDBWrapper, ComplexModel)
}
get theLogger() {
return this.logger
}
}
beforeEach(() => {
scanSpy = jasmine.createSpy().and.returnValue(Promise.resolve({ Count: 1 }))
request = new MyScanRequest(<any>{ scan: scanSpy })
})
it('extends ReadManyRequest', () => {
expect(request instanceof ReadManyRequest).toBeTruthy()
})
it('default params', () => {
expect(request.params).toEqual(<DynamoDB.ScanInput>{ TableName: 'complex_model' })
})
it('execSingle', async () => {
await request.execSingle()
expect(scanSpy).toHaveBeenCalled()
expect(scanSpy.calls.mostRecent().args[0]).toBeDefined()
expect(scanSpy.calls.mostRecent().args[0].Limit).toBe(1)
})
it('constructor creates logger', () => {
expect(request.theLogger).toBeDefined()
})
it('doRequest uses dynamoDBWrapper.scan', async () => {
await request.exec()
expect(scanSpy).toHaveBeenCalled()
})
})
| {
"pile_set_name": "Github"
} |
div.phpdebugbar-widgets-mails span.phpdebugbar-widgets-subject {
display: block;
}
div.phpdebugbar-widgets-mails li.phpdebugbar-widgets-list-item pre.phpdebugbar-widgets-headers {
display: none;
margin: 10px;
padding: 5px;
border: 1px solid #ddd;
font-family: monospace;
}
| {
"pile_set_name": "Github"
} |
/*
https://github.com/uxsolutions/bootstrap-datepicker/pull/2431 tracks contribution of this file to bootstrap-datepicker
*/
/* eslint-disable */
/**
* Bamanankan (bm) translation for bootstrap-datepicker
* Fatou Fall <[email protected]>
*/
;(function($){
$.fn.datepicker.dates['bm'] = {
days: ["Kari","Ntɛnɛn","Tarata","Araba","Alamisa","Juma","Sibiri"],
daysShort: ["Kar","Ntɛ","Tar","Ara","Ala","Jum","Sib"],
daysMin: ["Ka","Nt","Ta","Ar","Al","Ju","Si"],
months: ["Zanwuyekalo","Fewuruyekalo","Marisikalo","Awirilikalo","Mɛkalo","Zuwɛnkalo","Zuluyekalo","Utikalo","Sɛtanburukalo","ɔkutɔburukalo","Nowanburukalo","Desanburukalo"],
monthsShort: ["Zan","Few","Mar","Awi","Mɛ","Zuw","Zul","Uti","Sɛt","ɔku","Now","Des"],
today: "Bi",
monthsTitle: "Kalo",
clear: "Ka jɔsi",
weekStart: 1,
format: "dd/mm/yyyy"
};
}(jQuery));
| {
"pile_set_name": "Github"
} |
name: NetSuite
wfh: Required
travel: Restricted
visitors: N/A
events: Postponed
last_update: 2020-03-16
| {
"pile_set_name": "Github"
} |
RazorDocument - [0..28)::28 - [<p class="btn bar="foo"></p>]
MarkupBlock - [0..28)::28
MarkupTagHelperElement - [0..28)::28 - p[StartTagAndEndTag] - ptaghelper
MarkupTagHelperStartTag - [0..24)::24
MarkupTextLiteral - [0..2)::2 - [<p] - Gen<Markup> - SpanEditHandler;Accepts:Any
OpenAngle;[<];
Text;[p];
MarkupTagHelperAttribute - [2..19)::17 - class - DoubleQuotes - Unbound - [ class="btn bar="]
MarkupTextLiteral - [2..3)::1 - [ ] - Gen<Markup> - SpanEditHandler;Accepts:Any
Whitespace;[ ];
MarkupTextLiteral - [3..8)::5 - [class] - Gen<Markup> - SpanEditHandler;Accepts:Any
Text;[class];
Equals;[=];
MarkupTextLiteral - [9..10)::1 - ["] - Gen<None> - SpanEditHandler;Accepts:Any
DoubleQuote;["];
MarkupTagHelperAttributeValue - [10..18)::8
MarkupLiteralAttributeValue - [10..13)::3 - [btn]
MarkupTextLiteral - [10..13)::3 - [btn] - Gen<Markup> - SpanEditHandler;Accepts:Any
Text;[btn];
MarkupLiteralAttributeValue - [13..18)::5 - [ bar=]
MarkupTextLiteral - [13..14)::1 - [ ] - Gen<Markup> - SpanEditHandler;Accepts:Any
Whitespace;[ ];
MarkupTextLiteral - [14..18)::4 - [bar=] - Gen<Markup> - SpanEditHandler;Accepts:Any
Text;[bar];
Equals;[=];
MarkupTextLiteral - [18..19)::1 - ["] - Gen<None> - SpanEditHandler;Accepts:Any
DoubleQuote;["];
MarkupMinimizedTagHelperAttribute - [19..23)::4 - foo" - Minimized - Unbound - [foo"]
MarkupTextLiteral - [19..23)::4 - [foo"] - Gen<Markup> - SpanEditHandler;Accepts:Any
Text;[foo];
DoubleQuote;["];
MarkupTextLiteral - [23..24)::1 - [>] - Gen<Markup> - SpanEditHandler;Accepts:Any
CloseAngle;[>];
MarkupTagHelperEndTag - [24..28)::4
MarkupTextLiteral - [24..28)::4 - [</p>] - Gen<Markup> - SpanEditHandler;Accepts:Any
OpenAngle;[<];
ForwardSlash;[/];
Text;[p];
CloseAngle;[>];
| {
"pile_set_name": "Github"
} |
{% extends "account/base.html" %}
{% load i18n %}
{% block title %}{% trans "Sign Out" %}{% endblock %}
{% block header %}{% trans "Sign Out" %}{% endblock %}
{% block inner %}
<p>{% trans 'Are you sure you want to sign out?' %}</p>
<form method="post" action="{% url 'account_logout' %}">
{% csrf_token %}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
{% endif %}
<button class="btn-u btn-sm" type="submit">{% trans 'Sign Out' %}</button>
<button class="btn-u btn-sm btn-l cancel" type="submit" name="action">{% trans "Cancel" %}</button>
</form>
{% endblock %}
| {
"pile_set_name": "Github"
} |
{
"CVE_data_meta": {
"ASSIGNER": "[email protected]",
"ID": "CVE-2008-3111",
"STATE": "PUBLIC"
},
"affects": {
"vendor": {
"vendor_data": [
{
"product": {
"product_data": [
{
"product_name": "n/a",
"version": {
"version_data": [
{
"version_value": "n/a"
}
]
}
}
]
},
"vendor_name": "n/a"
}
]
}
},
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "eng",
"value": "Multiple buffer overflows in Sun Java Web Start in JDK and JRE 6 before Update 4, JDK and JRE 5.0 before Update 16, and SDK and JRE 1.4.x before 1.4.2_18 allow context-dependent attackers to gain privileges via an untrusted application, as demonstrated by (a) an application that grants itself privileges to (1) read local files, (2) write to local files, or (3) execute local programs; and as demonstrated by (b) a long value associated with a java-vm-args attribute in a j2se tag in a JNLP file, which triggers a stack-based buffer overflow in the GetVMArgsOption function; aka CR 6557220."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "n/a"
}
]
}
]
},
"references": {
"reference_data": [
{
"name": "APPLE-SA-2008-09-24",
"refsource": "APPLE",
"url": "http://lists.apple.com/archives/security-announce//2008/Sep/msg00008.html"
},
{
"name": "20081004 VMSA-2008-0016 VMware Hosted products, VirtualCenter Update 3 and",
"refsource": "BUGTRAQ",
"url": "http://marc.info/?l=bugtraq&m=122331139823057&w=2"
},
{
"name": "31600",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/31600"
},
{
"name": "SUSE-SA:2008:042",
"refsource": "SUSE",
"url": "http://lists.opensuse.org/opensuse-security-announce/2008-08/msg00005.html"
},
{
"name": "32018",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/32018"
},
{
"name": "GLSA-200911-02",
"refsource": "GENTOO",
"url": "http://security.gentoo.org/glsa/glsa-200911-02.xml"
},
{
"name": "32179",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/32179"
},
{
"name": "ADV-2008-2740",
"refsource": "VUPEN",
"url": "http://www.vupen.com/english/advisories/2008/2740"
},
{
"name": "31320",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/31320"
},
{
"name": "SUSE-SA:2008:043",
"refsource": "SUSE",
"url": "http://lists.opensuse.org/opensuse-security-announce/2008-09/msg00000.html"
},
{
"name": "sun-javawebstart-unspecified-bo(43664)",
"refsource": "XF",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/43664"
},
{
"name": "ADV-2008-2056",
"refsource": "VUPEN",
"url": "http://www.vupen.com/english/advisories/2008/2056/references"
},
{
"name": "238905",
"refsource": "SUNALERT",
"url": "http://sunsolve.sun.com/search/document.do?assetkey=1-66-238905-1"
},
{
"name": "31055",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/31055"
},
{
"name": "32180",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/32180"
},
{
"name": "http://www.vmware.com/security/advisories/VMSA-2008-0016.html",
"refsource": "CONFIRM",
"url": "http://www.vmware.com/security/advisories/VMSA-2008-0016.html"
},
{
"name": "31736",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/31736"
},
{
"name": "oval:org.mitre.oval:def:10541",
"refsource": "OVAL",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10541"
},
{
"name": "http://support.apple.com/kb/HT3178",
"refsource": "CONFIRM",
"url": "http://support.apple.com/kb/HT3178"
},
{
"name": "1020452",
"refsource": "SECTRACK",
"url": "http://www.securitytracker.com/id?1020452"
},
{
"name": "30148",
"refsource": "BID",
"url": "http://www.securityfocus.com/bid/30148"
},
{
"name": "31497",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/31497"
},
{
"name": "http://www.zerodayinitiative.com/advisories/ZDI-08-043/",
"refsource": "MISC",
"url": "http://www.zerodayinitiative.com/advisories/ZDI-08-043/"
},
{
"name": "20081004 VMSA-2008-0016 VMware Hosted products, VirtualCenter Update 3 and patches for ESX and ESXi resolve multiple security issues",
"refsource": "BUGTRAQ",
"url": "http://www.securityfocus.com/archive/1/497041/100/0/threaded"
},
{
"name": "20080717 ZDI-08-043: Sun Java Web Start vm args Stack Buffer Overflow",
"refsource": "BUGTRAQ",
"url": "http://www.securityfocus.com/archive/1/494505/100/0/threaded"
},
{
"name": "SUSE-SA:2008:045",
"refsource": "SUSE",
"url": "http://lists.opensuse.org/opensuse-security-announce/2008-09/msg00002.html"
},
{
"name": "RHSA-2008:0790",
"refsource": "REDHAT",
"url": "http://www.redhat.com/support/errata/RHSA-2008-0790.html"
},
{
"name": "TA08-193A",
"refsource": "CERT",
"url": "http://www.us-cert.gov/cas/techalerts/TA08-193A.html"
},
{
"name": "37386",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/37386"
},
{
"name": "http://support.apple.com/kb/HT3179",
"refsource": "CONFIRM",
"url": "http://support.apple.com/kb/HT3179"
},
{
"name": "RHSA-2008:0595",
"refsource": "REDHAT",
"url": "http://www.redhat.com/support/errata/RHSA-2008-0595.html"
},
{
"name": "31010",
"refsource": "SECUNIA",
"url": "http://secunia.com/advisories/31010"
}
]
}
} | {
"pile_set_name": "Github"
} |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2011-2014 Gael Guennebaud <[email protected]>
// Copyright (C) 2010 Daniel Lowengrub <[email protected]>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_SPARSEVIEW_H
#define EIGEN_SPARSEVIEW_H
namespace Eigen {
namespace internal {
template<typename MatrixType>
struct traits<SparseView<MatrixType> > : traits<MatrixType>
{
typedef typename MatrixType::StorageIndex StorageIndex;
typedef Sparse StorageKind;
enum {
Flags = int(traits<MatrixType>::Flags) & (RowMajorBit)
};
};
} // end namespace internal
/** \ingroup SparseCore_Module
* \class SparseView
*
* \brief Expression of a dense or sparse matrix with zero or too small values removed
*
* \tparam MatrixType the type of the object of which we are removing the small entries
*
* This class represents an expression of a given dense or sparse matrix with
* entries smaller than \c reference * \c epsilon are removed.
* It is the return type of MatrixBase::sparseView() and SparseMatrixBase::pruned()
* and most of the time this is the only way it is used.
*
* \sa MatrixBase::sparseView(), SparseMatrixBase::pruned()
*/
template<typename MatrixType>
class SparseView : public SparseMatrixBase<SparseView<MatrixType> >
{
typedef typename MatrixType::Nested MatrixTypeNested;
typedef typename internal::remove_all<MatrixTypeNested>::type _MatrixTypeNested;
typedef SparseMatrixBase<SparseView > Base;
public:
EIGEN_SPARSE_PUBLIC_INTERFACE(SparseView)
typedef typename internal::remove_all<MatrixType>::type NestedExpression;
explicit SparseView(const MatrixType& mat, const Scalar& reference = Scalar(0),
const RealScalar &epsilon = NumTraits<Scalar>::dummy_precision())
: m_matrix(mat), m_reference(reference), m_epsilon(epsilon) {}
inline Index rows() const { return m_matrix.rows(); }
inline Index cols() const { return m_matrix.cols(); }
inline Index innerSize() const { return m_matrix.innerSize(); }
inline Index outerSize() const { return m_matrix.outerSize(); }
/** \returns the nested expression */
const typename internal::remove_all<MatrixTypeNested>::type&
nestedExpression() const { return m_matrix; }
Scalar reference() const { return m_reference; }
RealScalar epsilon() const { return m_epsilon; }
protected:
MatrixTypeNested m_matrix;
Scalar m_reference;
RealScalar m_epsilon;
};
namespace internal {
// TODO find a way to unify the two following variants
// This is tricky because implementing an inner iterator on top of an IndexBased evaluator is
// not easy because the evaluators do not expose the sizes of the underlying expression.
template<typename ArgType>
struct unary_evaluator<SparseView<ArgType>, IteratorBased>
: public evaluator_base<SparseView<ArgType> >
{
typedef typename evaluator<ArgType>::InnerIterator EvalIterator;
public:
typedef SparseView<ArgType> XprType;
class InnerIterator : public EvalIterator
{
typedef typename XprType::Scalar Scalar;
public:
EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator& sve, Index outer)
: EvalIterator(sve.m_argImpl,outer), m_view(sve.m_view)
{
incrementToNonZero();
}
EIGEN_STRONG_INLINE InnerIterator& operator++()
{
EvalIterator::operator++();
incrementToNonZero();
return *this;
}
using EvalIterator::value;
protected:
const XprType &m_view;
private:
void incrementToNonZero()
{
while((bool(*this)) && internal::isMuchSmallerThan(value(), m_view.reference(), m_view.epsilon()))
{
EvalIterator::operator++();
}
}
};
enum {
CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
Flags = XprType::Flags
};
explicit unary_evaluator(const XprType& xpr) : m_argImpl(xpr.nestedExpression()), m_view(xpr) {}
protected:
evaluator<ArgType> m_argImpl;
const XprType &m_view;
};
template<typename ArgType>
struct unary_evaluator<SparseView<ArgType>, IndexBased>
: public evaluator_base<SparseView<ArgType> >
{
public:
typedef SparseView<ArgType> XprType;
protected:
enum { IsRowMajor = (XprType::Flags&RowMajorBit)==RowMajorBit };
typedef typename XprType::Scalar Scalar;
typedef typename XprType::StorageIndex StorageIndex;
public:
class InnerIterator
{
public:
EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator& sve, Index outer)
: m_sve(sve), m_inner(0), m_outer(outer), m_end(sve.m_view.innerSize())
{
incrementToNonZero();
}
EIGEN_STRONG_INLINE InnerIterator& operator++()
{
m_inner++;
incrementToNonZero();
return *this;
}
EIGEN_STRONG_INLINE Scalar value() const
{
return (IsRowMajor) ? m_sve.m_argImpl.coeff(m_outer, m_inner)
: m_sve.m_argImpl.coeff(m_inner, m_outer);
}
EIGEN_STRONG_INLINE StorageIndex index() const { return m_inner; }
inline Index row() const { return IsRowMajor ? m_outer : index(); }
inline Index col() const { return IsRowMajor ? index() : m_outer; }
EIGEN_STRONG_INLINE operator bool() const { return m_inner < m_end && m_inner>=0; }
protected:
const unary_evaluator &m_sve;
Index m_inner;
const Index m_outer;
const Index m_end;
private:
void incrementToNonZero()
{
while((bool(*this)) && internal::isMuchSmallerThan(value(), m_sve.m_view.reference(), m_sve.m_view.epsilon()))
{
m_inner++;
}
}
};
enum {
CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
Flags = XprType::Flags
};
explicit unary_evaluator(const XprType& xpr) : m_argImpl(xpr.nestedExpression()), m_view(xpr) {}
protected:
evaluator<ArgType> m_argImpl;
const XprType &m_view;
};
} // end namespace internal
/** \ingroup SparseCore_Module
*
* \returns a sparse expression of the dense expression \c *this with values smaller than
* \a reference * \a epsilon removed.
*
* This method is typically used when prototyping to convert a quickly assembled dense Matrix \c D to a SparseMatrix \c S:
* \code
* MatrixXd D(n,m);
* SparseMatrix<double> S;
* S = D.sparseView(); // suppress numerical zeros (exact)
* S = D.sparseView(reference);
* S = D.sparseView(reference,epsilon);
* \endcode
* where \a reference is a meaningful non zero reference value,
* and \a epsilon is a tolerance factor defaulting to NumTraits<Scalar>::dummy_precision().
*
* \sa SparseMatrixBase::pruned(), class SparseView */
template<typename Derived>
const SparseView<Derived> MatrixBase<Derived>::sparseView(const Scalar& reference,
const typename NumTraits<Scalar>::Real& epsilon) const
{
return SparseView<Derived>(derived(), reference, epsilon);
}
/** \returns an expression of \c *this with values smaller than
* \a reference * \a epsilon removed.
*
* This method is typically used in conjunction with the product of two sparse matrices
* to automatically prune the smallest values as follows:
* \code
* C = (A*B).pruned(); // suppress numerical zeros (exact)
* C = (A*B).pruned(ref);
* C = (A*B).pruned(ref,epsilon);
* \endcode
* where \c ref is a meaningful non zero reference value.
* */
template<typename Derived>
const SparseView<Derived>
SparseMatrixBase<Derived>::pruned(const Scalar& reference,
const RealScalar& epsilon) const
{
return SparseView<Derived>(derived(), reference, epsilon);
}
} // end namespace Eigen
#endif
| {
"pile_set_name": "Github"
} |
---
title: Debug a .NET Core console application using Visual Studio Code
description: Learn how to debug a .NET Core console app using Visual Studio Code.
ms.date: 05/26/2020
---
# Tutorial: Debug a .NET Core console application using Visual Studio Code
This tutorial introduces the debugging tools available in Visual Studio Code for working with .NET Core apps.
## Prerequisites
- This tutorial works with the console app that you create in [Create a .NET Core console application using Visual Studio Code](with-visual-studio-code.md).
## Use Debug build configuration
*Debug* and *Release* are .NET Core's built-in build configurations. You use the Debug build configuration for debugging and the Release configuration for the final release distribution.
In the Debug configuration, a program compiles with full symbolic debug information and no optimization. Optimization complicates debugging, because the relationship between source code and generated instructions is more complex. The release configuration of a program has no symbolic debug information and is fully optimized.
By default, Visual Studio Code launch settings use the Debug build configuration, so you don't need to change it before debugging.
1. Start Visual Studio Code.
1. Open the folder of the project that you created in [Create a .NET Core console application using Visual Studio Code](with-visual-studio-code.md).
## Set a breakpoint
A *breakpoint* temporarily interrupts the execution of the application before the line with the breakpoint is executed.
1. Open the *Program.cs* file.
1. Set a *breakpoint* on the line that displays the name, date, and time, by clicking in the left margin of the code window. The left margin is to the left of the line numbers. Other ways to set a breakpoint are by pressing <kbd>F9</kbd> or choosing **Run** > **Toggle Breakpoint** from the menu while the line of code is selected.
Visual Studio Code indicates the line on which the breakpoint is set by displaying a red dot in the left margin.
:::image type="content" source="media/debugging-with-visual-studio-code/breakpoint-set.png" alt-text="Breakpoint set":::
## Set up for terminal input
The breakpoint is located after a `Console.ReadLine` method call. The **Debug Console** doesn't accept terminal input for a running program. To handle terminal input while debugging, you can use the integrated terminal (one of the Visual Studio Code windows) or an external terminal. For this tutorial, you use the integrated terminal.
1. Open *.vscode/launch.json*.
1. Change the `console` setting to `integratedTerminal`.
From:
```json
"console": "internalConsole",
```
To:
```json
"console": "integratedTerminal",
```
1. Save your changes.
## Start debugging
1. Open the Debug view by selecting the Debugging icon on the left side menu.
:::image type="content" source="media/debugging-with-visual-studio-code/select-debug-pane.png" alt-text="Open the Debug tab in Visual Studio Code":::
1. Select the green arrow at the top of the pane, next to **.NET Core Launch (console)**. Other ways to start the program in debugging mode are by pressing <kbd>F5</kbd> or choosing **Run** > **Start Debugging** from the menu.
:::image type="content" source="media/debugging-with-visual-studio-code/start-debugging.png" alt-text="Start debugging":::
1. Select the **Terminal** tab to see the "What is your name?" prompt that the program displays before waiting for a response.
:::image type="content" source="media/debugging-with-visual-studio-code/select-terminal.png" alt-text="Select the Terminal tab":::
1. Enter a string in the **Terminal** window in response to the prompt for a name, and then press <kbd>Enter</kbd>.
Program execution stops when it reaches the breakpoint and before the `Console.WriteLine` method executes. The **Locals** section of the **Variables** window displays the values of variables that are defined in the currently executing method.
:::image type="content" source="media/debugging-with-visual-studio-code/breakpoint-hit.png" alt-text="Breakpoint hit, showing Locals":::
## Use the Debug Console
The **Debug Console** window lets you interact with the application you're debugging. You can change the value of variables to see how it affects your program.
1. Select the **Debug Console** tab.
1. Enter `name = "Gracie"` at the prompt at the bottom of the **Debug Console** window and press the <kbd>Enter</kbd> key.
:::image type="content" source="media/debugging-with-visual-studio-code/change-variable-values.png" alt-text="Change variable values":::
1. Enter `date = DateTime.Parse("2019-11-16T17:25:00Z").ToUniversalTime()` at the bottom of the **Debug Console** window and press the <kbd>Enter</kbd> key.
The **Variables** window displays the new values of the `name` and `date` variables.
1. Continue program execution by selecting the **Continue** button in the toolbar. Another way to continue is by pressing <kbd>F5</kbd>.
:::image type="content" source="media/debugging-with-visual-studio-code/continue-debugging.png" alt-text="Continue debugging":::
1. Select the **Terminal** tab again.
The values displayed in the console window correspond to the changes you made in the **Debug Console**.
:::image type="content" source="media/debugging-with-visual-studio-code/changed-variable-values.png" alt-text="Terminal showing the entered values":::
1. Press any key to exit the application and stop debugging.
## Set a conditional breakpoint
The program displays the string that the user enters. What happens if the user doesn't enter anything? You can test this with a useful debugging feature called a *conditional breakpoint*.
1. Right-click (<kbd>Ctrl</kbd>-click on macOS) on the red dot that represents the breakpoint. In the context menu, select **Edit Breakpoint** to open a dialog that lets you enter a conditional expression.
:::image type="content" source="media/debugging-with-visual-studio-code/breakpoint-context-menu.png" alt-text="Breakpoint context menu":::
1. Select `Expression` in the drop-down, enter the following conditional expression, and press <kbd>Enter</kbd>.
```csharp
String.IsNullOrEmpty(name)
```
:::image type="content" source="media/debugging-with-visual-studio-code/conditional-expression.png" alt-text="Enter a conditional expression":::
Each time the breakpoint is hit, the debugger calls the `String.IsNullOrEmpty(name)` method, and it breaks on this line only if the method call returns `true`.
Instead of a conditional expression, you can specify a *hit count*, which interrupts program execution before a statement is executed a specified number of times. Another option is to specify a *filter condition*, which interrupts program execution based on such attributes as a thread identifier, process name, or thread name.
1. Start the program with debugging by pressing <kbd>F5</kbd>.
1. In the **Terminal** tab, press the <kbd>Enter</kbd> key when prompted to enter your name.
Because the condition you specified (`name` is either `null` or <xref:System.String.Empty?displayProperty=nameWithType>) has been satisfied, program execution stops when it reaches the breakpoint and before the `Console.WriteLine` method executes.
The **Variables** window shows that the value of the `name` variable is `""`, or <xref:System.String.Empty?displayProperty=nameWithType>.
1. Confirm the value is an empty string by entering the following statement at the **Debug Console** prompt and pressing <kbd>Enter</kbd>. The result is `true`.
```csharp
name == String.Empty
```
:::image type="content" source="media/debugging-with-visual-studio-code/expression-in-debug-console.png" alt-text="Debug Console returning a value of true after the statement is executed":::
1. Select the **Continue** button on the toolbar to continue program execution.
1. Select the **Terminal** tab, and press any key to exit the program and stop debugging.
1. Clear the breakpoint by clicking on the dot in the left margin of the code window. Other ways to clear a breakpoint are by pressing <kbd>F9</kbd> or choosing **Run > Toggle Breakpoint** from the menu while the line of code is selected.
1. If you get a warning that the breakpoint condition will be lost, select **Remove Breakpoint**.
## Step through a program
Visual Studio Code also allows you to step line by line through a program and monitor its execution. Ordinarily, you'd set a breakpoint and follow program flow through a small part of your program code. Since this program is small, you can step through the entire program.
1. Set a breakpoint on the opening curly brace of the `Main` method.
1. Press <kbd>F5</kbd> to start debugging.
Visual Studio Code highlights the breakpoint line.
At this point, the **Variables** window shows that the `args` array is empty, and `name` and `date` have default values.
1. Select **Run** > **Step Into** or press <kbd>F11</kbd>.
:::image type="content" source="media/debugging-with-visual-studio-code/step-into.png" alt-text="Step-Into button":::
Visual Studio Code highlights the next line.
1. Select **Run** > **Step Into** or press <kbd>F11</kbd>.
Visual Studio Code executes the `Console.WriteLine` for the name prompt and highlights the next line of execution. The next line is the `Console.ReadLine` for the `name`. The **Variables** window is unchanged, and the **Terminal** tab shows the "What is your name?" prompt.
1. Select **Run** > **Step Into** or press <kbd>F11</kbd>.
Visual Studio highlights the `name` variable assignment. The **Variables** window shows that `name` is still `null`.
1. Respond to the prompt by entering a string in the Terminal tab and pressing <kbd>Enter</kbd>.
The **Terminal** tab might not display the string you enter while you're entering it, but the <xref:System.Console.ReadLine%2A?displayProperty=nameWithType> method will capture your input.
1. Select **Run** > **Step Into** or press <kbd>F11</kbd>.
Visual Studio Code highlights the `date` variable assignment. The **Variables** window shows the value returned by the call to the <xref:System.Console.ReadLine%2A?displayProperty=nameWithType> method. The **Terminal** tab displays the string you entered at the prompt.
1. Select **Run** > **Step Into** or press <kbd>F11</kbd>.
The **Variables** window shows the value of the `date` variable after the assignment from the <xref:System.DateTime.Now?displayProperty=nameWithType> property.
1. Select **Run** > **Step Into** or press <kbd>F11</kbd>.
Visual Studio Code calls the <xref:System.Console.WriteLine(System.String,System.Object,System.Object)?displayProperty=nameWithType> method. The console window displays the formatted string.
1. Select **Run** > **Step Out** or press <kbd>Shift</kbd>+<kbd>F11</kbd>.
:::image type="content" source="media/debugging-with-visual-studio-code/step-out.png" alt-text="Step-Out button":::
1. Select the **Terminal** tab.
The terminal displays "Press any key to exit..."
1. Press any key to exit the program.
## Use Release build configuration
Once you've tested the Debug version of your application, you should also compile and test the Release version. The Release version incorporates compiler optimizations that can affect the behavior of an application. For example, compiler optimizations that are designed to improve performance can create race conditions in multithreaded applications.
To build and test the Release version of your console application, open the **Terminal** and run the following command:
```dotnetcli
dotnet run --configuration Release
```
## Additional resources
* [Debugging in Visual Studio Code](https://code.visualstudio.com/docs/editor/debugging)
## Next steps
In this tutorial, you used Visual Studio Code debugging tools. In the next tutorial, you publish a deployable version of the app.
> [!div class="nextstepaction"]
> [Publish a .NET Core console application using Visual Studio Code](publishing-with-visual-studio-code.md)
| {
"pile_set_name": "Github"
} |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.ContractsLight;
using System.Linq.Expressions;
namespace BuildXL.Cache.ContentStore.Interfaces.Results
{
/// <summary>
/// Result of a failed operation.
/// </summary>
public class ErrorResult : ResultBase, IEquatable<ErrorResult>
{
/// <summary>
/// Original optional message provided via constructor.
/// </summary>
public string? Message { get; }
/// <summary>
/// Initializes a new instance of the <see cref="ErrorResult"/> class.
/// </summary>
public ErrorResult(string errorMessage, string? diagnostics = null)
: base(errorMessage, diagnostics)
{
Contract.RequiresNotNullOrEmpty(errorMessage);
Message = errorMessage;
}
/// <summary>
/// Initializes a new instance of the <see cref="ErrorResult" /> class.
/// </summary>
public ErrorResult(Exception exception, string? message = null)
: base(exception, message)
{
Message = message;
}
/// <summary>
/// Initializes a new instance of the <see cref="ErrorResult" /> class.
/// </summary>
public ErrorResult(ResultBase other, string? message = null)
: base(other, message)
{
Message = message;
}
/// <inheritdoc />
public override bool Succeeded => false;
/// <inheritdoc />
public bool Equals(ErrorResult other)
{
return EqualsBase(other) && other != null;
}
/// <inheritdoc />
public override bool Equals(object? obj)
{
return obj is ErrorResult other && Equals(other);
}
/// <inheritdoc />
public override int GetHashCode()
{
return ErrorMessage?.GetHashCode() ?? 0;
}
/// <inheritdoc />
public override string ToString()
{
return GetErrorString();
}
/// <summary>
/// Overloads & operator to behave as AND operator.
/// </summary>
public static ErrorResult operator &(ErrorResult result1, ErrorResult result2)
{
return new ErrorResult(
Merge(result1.ErrorMessage, result2.ErrorMessage, ", "),
Merge(result1.Diagnostics, result2.Diagnostics, ", "));
}
/// <summary>
/// Overloads | operator to behave as OR operator.
/// </summary>
public static ErrorResult operator |(ErrorResult result1, ErrorResult result2)
{
return new ErrorResult(
Merge(result1.ErrorMessage, result2.ErrorMessage, ", "),
Merge(result1.Diagnostics, result2.Diagnostics, ", "));
}
/// <summary>
/// Converts the error result to the given result type.
/// </summary>
public TResult AsResult<TResult>() where TResult : ResultBase
{
if (ErrorResultConverter<TResult>.TryGetConverter(out var converter, out string? error))
{
return converter(this);
}
throw new InvalidOperationException(error);
}
private static class ErrorResultConverter<TResult>
where TResult : ResultBase
{
private static readonly Func<ErrorResult, TResult>? Convert;
private static readonly string? ErrorMessage;
static ErrorResultConverter()
{
// It is important to call this method from a static constructor
// and have another method that will just get the data from the fields
// to avoid expression generation every time.
TryGenerateConverter(out Convert, out ErrorMessage);
}
public static bool TryGetConverter([NotNullWhen(true)]out Func<ErrorResult, TResult>? result, [NotNullWhen(false)]out string? errorMessage)
{
result = Convert;
errorMessage = ErrorMessage;
#pragma warning disable CS8762 // Parameter must have a non-null value when exiting in some condition.
return result != null;
#pragma warning restore CS8762 // Parameter must have a non-null value when exiting in some condition.
}
private static bool TryGenerateConverter([NotNullWhen(true)]out Func<ErrorResult, TResult>? result, [NotNullWhen(false)]out string? errorMessage)
{
var errorResultParameter = Expression.Parameter(typeof(ErrorResult));
var type = typeof(TResult).Name;
// Generating the following constructor invocation:
// new TResult(other: errorResult)
var constructorInfo = typeof(TResult).GetConstructor(new[] { typeof(ResultBase), typeof(string) });
if (constructorInfo == null)
{
result = null;
errorMessage = $"Constructor '{type}(ResultBase, string)' is not defined for type '{type}'.";
return false;
}
try
{
var convertExpression = Expression.Lambda<Func<ErrorResult, TResult>>(
body: Expression.New(
constructor: constructorInfo,
arguments: new Expression[]
{
errorResultParameter,
Expression.Constant(null, typeof(string)),
}),
parameters: new[] { errorResultParameter });
result = convertExpression.Compile();
errorMessage = null;
return true;
}
catch (Exception e)
{
result = null;
errorMessage = $"Failed creating type converter to '{type}'. Exception: {e}";
return false;
}
}
}
}
}
| {
"pile_set_name": "Github"
} |
/*
Copyright (c) 2005-2020 Intel Corporation
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.
*/
typedef float Value;
struct TreeNode {
//! Pointer to left subtree
TreeNode* left;
//! Pointer to right subtree
TreeNode* right;
//! Number of nodes in this subtree, including this node.
long node_count;
//! Value associated with the node.
Value value;
};
Value SerialSumTree( TreeNode* root );
Value SimpleParallelSumTree( TreeNode* root );
Value OptimizedParallelSumTree( TreeNode* root );
| {
"pile_set_name": "Github"
} |
---
-api-id: P:Windows.UI.Xaml.Controls.TreeView.ItemContainerStyleProperty
-api-type: winrt property
ms.custom: RS5
---
<!-- Property syntax.
public DependencyProperty ItemContainerStyleProperty { get; }
-->
# Windows.UI.Xaml.Controls.TreeView.ItemContainerStyleProperty
## -description
Identifies the ItemContainerStyle dependency property.
## -property-value
The identifier for the ItemContainerStyle dependency property.
## -remarks
## -see-also
## -examples
| {
"pile_set_name": "Github"
} |
#
# Makefile for the Microchip network device drivers.
#
obj-$(CONFIG_ENC28J60) += enc28j60.o
| {
"pile_set_name": "Github"
} |
package restful
// Copyright 2013 Ernest Micklei. All rights reserved.
// Use of this source code is governed by a license
// that can be found in the LICENSE file.
import (
"errors"
"fmt"
"net/http"
"sort"
)
// RouterJSR311 implements the flow for matching Requests to Routes (and consequently Resource Functions)
// as specified by the JSR311 http://jsr311.java.net/nonav/releases/1.1/spec/spec.html.
// RouterJSR311 implements the Router interface.
// Concept of locators is not implemented.
type RouterJSR311 struct{}
// SelectRoute is part of the Router interface and returns the best match
// for the WebService and its Route for the given Request.
func (r RouterJSR311) SelectRoute(
webServices []*WebService,
httpRequest *http.Request) (selectedService *WebService, selectedRoute *Route, err error) {
// Identify the root resource class (WebService)
dispatcher, finalMatch, err := r.detectDispatcher(httpRequest.URL.Path, webServices)
if err != nil {
return nil, nil, NewError(http.StatusNotFound, "")
}
// Obtain the set of candidate methods (Routes)
routes := r.selectRoutes(dispatcher, finalMatch)
if len(routes) == 0 {
return dispatcher, nil, NewError(http.StatusNotFound, "404: Page Not Found")
}
// Identify the method (Route) that will handle the request
route, ok := r.detectRoute(routes, httpRequest)
return dispatcher, route, ok
}
// ExtractParameters is used to obtain the path parameters from the route using the same matching
// engine as the JSR 311 router.
func (r RouterJSR311) ExtractParameters(route *Route, webService *WebService, urlPath string) map[string]string {
webServiceExpr := webService.pathExpr
webServiceMatches := webServiceExpr.Matcher.FindStringSubmatch(urlPath)
pathParameters := r.extractParams(webServiceExpr, webServiceMatches)
routeExpr := route.pathExpr
routeMatches := routeExpr.Matcher.FindStringSubmatch(webServiceMatches[len(webServiceMatches)-1])
routeParams := r.extractParams(routeExpr, routeMatches)
for key, value := range routeParams {
pathParameters[key] = value
}
return pathParameters
}
func (RouterJSR311) extractParams(pathExpr *pathExpression, matches []string) map[string]string {
params := map[string]string{}
for i := 1; i < len(matches); i++ {
if len(pathExpr.VarNames) >= i {
params[pathExpr.VarNames[i-1]] = matches[i]
}
}
return params
}
// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2
func (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*Route, error) {
candidates := make([]*Route, 0, 8)
for i, each := range routes {
ok := true
for _, fn := range each.If {
if !fn(httpRequest) {
ok = false
break
}
}
if ok {
candidates = append(candidates, &routes[i])
}
}
if len(candidates) == 0 {
if trace {
traceLogger.Printf("no Route found (from %d) that passes conditional checks", len(routes))
}
return nil, NewError(http.StatusNotFound, "404: Not Found")
}
// http method
previous := candidates
candidates = candidates[:0]
for _, each := range previous {
if httpRequest.Method == each.Method {
candidates = append(candidates, each)
}
}
if len(candidates) == 0 {
if trace {
traceLogger.Printf("no Route found (in %d routes) that matches HTTP method %s\n", len(previous), httpRequest.Method)
}
return nil, NewError(http.StatusMethodNotAllowed, "405: Method Not Allowed")
}
// content-type
contentType := httpRequest.Header.Get(HEADER_ContentType)
previous = candidates
candidates = candidates[:0]
for _, each := range previous {
if each.matchesContentType(contentType) {
candidates = append(candidates, each)
}
}
if len(candidates) == 0 {
if trace {
traceLogger.Printf("no Route found (from %d) that matches HTTP Content-Type: %s\n", len(previous), contentType)
}
if httpRequest.ContentLength > 0 {
return nil, NewError(http.StatusUnsupportedMediaType, "415: Unsupported Media Type")
}
}
// accept
previous = candidates
candidates = candidates[:0]
accept := httpRequest.Header.Get(HEADER_Accept)
if len(accept) == 0 {
accept = "*/*"
}
for _, each := range previous {
if each.matchesAccept(accept) {
candidates = append(candidates, each)
}
}
if len(candidates) == 0 {
if trace {
traceLogger.Printf("no Route found (from %d) that matches HTTP Accept: %s\n", len(previous), accept)
}
return nil, NewError(http.StatusNotAcceptable, "406: Not Acceptable")
}
// return r.bestMatchByMedia(outputMediaOk, contentType, accept), nil
return candidates[0], nil
}
// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2
// n/m > n/* > */*
func (r RouterJSR311) bestMatchByMedia(routes []Route, contentType string, accept string) *Route {
// TODO
return &routes[0]
}
// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 (step 2)
func (r RouterJSR311) selectRoutes(dispatcher *WebService, pathRemainder string) []Route {
filtered := &sortableRouteCandidates{}
for _, each := range dispatcher.Routes() {
pathExpr := each.pathExpr
matches := pathExpr.Matcher.FindStringSubmatch(pathRemainder)
if matches != nil {
lastMatch := matches[len(matches)-1]
if len(lastMatch) == 0 || lastMatch == "/" { // do not include if value is neither empty nor ‘/’.
filtered.candidates = append(filtered.candidates,
routeCandidate{each, len(matches) - 1, pathExpr.LiteralCount, pathExpr.VarCount})
}
}
}
if len(filtered.candidates) == 0 {
if trace {
traceLogger.Printf("WebService on path %s has no routes that match URL path remainder:%s\n", dispatcher.rootPath, pathRemainder)
}
return []Route{}
}
sort.Sort(sort.Reverse(filtered))
// select other routes from candidates whoes expression matches rmatch
matchingRoutes := []Route{filtered.candidates[0].route}
for c := 1; c < len(filtered.candidates); c++ {
each := filtered.candidates[c]
if each.route.pathExpr.Matcher.MatchString(pathRemainder) {
matchingRoutes = append(matchingRoutes, each.route)
}
}
return matchingRoutes
}
// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 (step 1)
func (r RouterJSR311) detectDispatcher(requestPath string, dispatchers []*WebService) (*WebService, string, error) {
filtered := &sortableDispatcherCandidates{}
for _, each := range dispatchers {
matches := each.pathExpr.Matcher.FindStringSubmatch(requestPath)
if matches != nil {
filtered.candidates = append(filtered.candidates,
dispatcherCandidate{each, matches[len(matches)-1], len(matches), each.pathExpr.LiteralCount, each.pathExpr.VarCount})
}
}
if len(filtered.candidates) == 0 {
if trace {
traceLogger.Printf("no WebService was found to match URL path:%s\n", requestPath)
}
return nil, "", errors.New("not found")
}
sort.Sort(sort.Reverse(filtered))
return filtered.candidates[0].dispatcher, filtered.candidates[0].finalMatch, nil
}
// Types and functions to support the sorting of Routes
type routeCandidate struct {
route Route
matchesCount int // the number of capturing groups
literalCount int // the number of literal characters (means those not resulting from template variable substitution)
nonDefaultCount int // the number of capturing groups with non-default regular expressions (i.e. not ‘([^ /]+?)’)
}
func (r routeCandidate) expressionToMatch() string {
return r.route.pathExpr.Source
}
func (r routeCandidate) String() string {
return fmt.Sprintf("(m=%d,l=%d,n=%d)", r.matchesCount, r.literalCount, r.nonDefaultCount)
}
type sortableRouteCandidates struct {
candidates []routeCandidate
}
func (rcs *sortableRouteCandidates) Len() int {
return len(rcs.candidates)
}
func (rcs *sortableRouteCandidates) Swap(i, j int) {
rcs.candidates[i], rcs.candidates[j] = rcs.candidates[j], rcs.candidates[i]
}
func (rcs *sortableRouteCandidates) Less(i, j int) bool {
ci := rcs.candidates[i]
cj := rcs.candidates[j]
// primary key
if ci.literalCount < cj.literalCount {
return true
}
if ci.literalCount > cj.literalCount {
return false
}
// secundary key
if ci.matchesCount < cj.matchesCount {
return true
}
if ci.matchesCount > cj.matchesCount {
return false
}
// tertiary key
if ci.nonDefaultCount < cj.nonDefaultCount {
return true
}
if ci.nonDefaultCount > cj.nonDefaultCount {
return false
}
// quaternary key ("source" is interpreted as Path)
return ci.route.Path < cj.route.Path
}
// Types and functions to support the sorting of Dispatchers
type dispatcherCandidate struct {
dispatcher *WebService
finalMatch string
matchesCount int // the number of capturing groups
literalCount int // the number of literal characters (means those not resulting from template variable substitution)
nonDefaultCount int // the number of capturing groups with non-default regular expressions (i.e. not ‘([^ /]+?)’)
}
type sortableDispatcherCandidates struct {
candidates []dispatcherCandidate
}
func (dc *sortableDispatcherCandidates) Len() int {
return len(dc.candidates)
}
func (dc *sortableDispatcherCandidates) Swap(i, j int) {
dc.candidates[i], dc.candidates[j] = dc.candidates[j], dc.candidates[i]
}
func (dc *sortableDispatcherCandidates) Less(i, j int) bool {
ci := dc.candidates[i]
cj := dc.candidates[j]
// primary key
if ci.matchesCount < cj.matchesCount {
return true
}
if ci.matchesCount > cj.matchesCount {
return false
}
// secundary key
if ci.literalCount < cj.literalCount {
return true
}
if ci.literalCount > cj.literalCount {
return false
}
// tertiary key
return ci.nonDefaultCount < cj.nonDefaultCount
}
| {
"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.
-->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
<title>Delete Task</title>
</head>
<body>
<h2><a name="delete">Delete</a></h2>
<h3>Description</h3>
<p>Deletes a single file, a specified directory and all its files and
subdirectories, or a set of files specified by one or more
<a href="../Types/resources.html#collection">resource collection</a>s.
The literal implication of <code><fileset></code> is that
directories are not included; however the removal of empty directories can
be triggered when using nested filesets by setting the
<code>includeEmptyDirs</code> attribute to <i>true</i>. Note that this
attribute is meaningless in the context of any of the various resource
collection types that <i>do</i> include directories, but that no attempt
will be made to delete non-empty directories in any case. Whether a
directory is empty or not is decided by looking into the filesystem -
include or exclude patterns don't apply here.</p>
<p>
If you use this task to delete temporary files created by editors
and it doesn't seem to work, read up on the
<a href="../dirtasks.html#defaultexcludes">default exclusion set</a>
in <strong>Directory-based Tasks</strong>, and see the
<code>defaultexcludes</code> attribute below.
<p>For historical reasons <code><delete dir="x"/></code> is
different from <code><delete><fileset
dir="x"/></delete></code>, it will try to remove everything
inside "x" including "x" itself, not taking default excludes into
account, blindly following all symbolic links. If you need more
control, use a nested <code><fileset></code>.</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">The file to delete, specified as either the simple
filename (if the file exists in the current base directory), a
relative-path filename, or a full-path filename.</td>
<td align="center" valign="middle" rowspan="2">At least one of the two,
unless nested resource collections are specified
</tr>
<tr>
<td valign="top">dir</td>
<td valign="top">The directory to delete, including all its files and
subdirectories.<br>
<b>Note:</b> <code>dir</code> is <em>not</em> used
to specify a directory name for <code>file</code>; <code>file</code>
and <code>dir</code> are independent of each other.<br>
<b>WARNING:</b> Do <b>not</b> set <code>dir</code> to
<code>"."</code>, <code>"${basedir}"</code>,
or the full-pathname equivalent unless you truly <em>intend</em> to
recursively remove the entire contents of the current base directory
(and the base directory itself, if different from the current working
directory).</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">Whether to show the name of each deleted file.</td>
<td align="center" valign="top">No, default "false"</i></td>
</tr>
<tr>
<td valign="top">quiet</td>
<td valign="top">If the specified file or directory does not exist,
do not display a diagnostic message (unless Apache Ant
has been invoked with the <code>-verbose</code> or
<code>-debug</code> switches) or modify the exit status to
reflect an error.
When set to "true", if a file or directory cannot be deleted,
no error is reported. This setting emulates the
<code>-f</code> option to the Unix <em>rm</em> command.
Setting this to "true" implies setting
<code>failonerror</code> to "false".
</td>
<td align="center" valign="top">No, default "false"</td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Controls whether an error (such as a failure to
delete a file) stops the build or is merely reported to the screen.
Only relevant if <code>quiet</code> is "false".</td>
<td align="center" valign="top">No, default "true"</td>
</tr>
<tr>
<td valign="top">includeemptydirs</td>
<td valign="top">Whether to delete empty directories
when using filesets.</td>
<td align="center" valign="top">No, default "false"</td>
</tr>
<tr>
<td valign="top">includes</td>
<td valign="top"><em>Deprecated.</em> Use resource collections.
Comma- or space-separated list of patterns of
files that must be deleted. All files are relative to the directory
specified in <code>dir</code>.</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">includesfile</td>
<td valign="top"><em>Deprecated.</em> Use resource collections.
The name of a file. Each line of
this file is taken to be an include pattern.</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">excludes</td>
<td valign="top"><em>Deprecated.</em> Use resource collections.
Comma- or space-separated list of patterns of
files that must be excluded from the deletion list.
All files are relative to the directory specified in <code>dir</code>.
No files (except default excludes) are excluded when omitted.</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">excludesfile</td>
<td valign="top"><em>Deprecated.</em> Use resource collections.
The name of a file. Each line of
this file is taken to be an exclude pattern</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">defaultexcludes</td>
<td valign="top"><em>Deprecated.</em> Use resource collections.
Whether to use <a href="../dirtasks.html#defaultexcludes">
default excludes.</a></td>
<td align="center" valign="top">No, default "true"</td>
</tr>
<tr>
<td valign="top">deleteonexit</td>
<td valign="top">
Indicates whether to use File#deleteOnExit() if there is a
failure to delete a file, this causes the jvm to attempt
to delete the file when the jvm process is terminating.
<em>Since Ant 1.6.2</em></td>
<td align="center" valign="top">No, default "false"</td>
</tr>
<tr>
<td valign="top">removeNotFollowedSymlinks</td>
<td valign="top">
Whether symbolic links (not the files/directories they link to)
should be removed if they haven't been followed because
followSymlinks was false or the maximum number of symbolic links
was too big.
<em>Since Ant 1.8.0</em></td>
<td align="center" valign="top">No, default "false"</td>
</tr>
<tr>
<td valign="top">performGCOnFailedDelete</td>
<td valign="top">
If Ant fails to delete a file or directory it will retry the
operation once. If this flag is set to true it will perform a
garbage collection before retrying the delete.<br/>
Setting this flag to true is known to resolve some problems on
Windows (where it defaults to true) but also for directory trees
residing on an NFS share.
<em>Since Ant 1.8.3</em></td>
<td align="center" valign="top">No, default "true" on
Windows and "true" on any other OS.</td>
</tr>
</table>
<h3>Examples</h3>
<pre> <delete file="/lib/ant.jar"/></pre>
<p>deletes the file <code>/lib/ant.jar</code>.</p>
<pre> <delete dir="lib"/></pre>
<p>deletes the <code>lib</code> directory, including all files
and subdirectories of <code>lib</code>.</p>
<pre> <delete>
<fileset dir="." includes="**/*.bak"/>
</delete>
</pre>
<p>deletes all files with the extension <code>.bak</code> from the current directory
and any subdirectories.</p>
<pre> <delete includeEmptyDirs="true">
<fileset dir="build"/>
</delete>
</pre>
<p>deletes all files and subdirectories of <code>build</code>, including
<code>build</code> itself.</p>
<pre> <delete includeemptydirs="true">
<fileset dir="build" includes="**/*"/>
</delete>
</pre>
<p>deletes all files and subdirectories of <code>build</code>, without
<code>build</code> itself.</p>
<pre> <delete includeemptydirs="true">
<fileset dir="src" includes="**/.svn/" defaultexcludes="false"/>
</delete>
</pre>
<p>deletes the subversion metadata directories under <code>src</code>. Because <code>.svn</code>
is on of the <a href="../dirtasks.html#defaultexcludes">default excludes</a> you have to use the
<code>defaultexcludes</code> flag, otherwise Ant wont delete these directories and the files in it.</p>
</body>
</html>
| {
"pile_set_name": "Github"
} |
Title: More verbose error output for SNMP errors on the command line
Level: 1
Component: core
Version: 1.2.3i7
Date: 1384939712
Class: fix
In the past, in non-inline SNMP mode, the stderr output of all
SNMP related commands was completely suppressed. It was hard
to find out the source of problems in some cases, for example
timeouts. The execution of those programs has been changed to
output stderr messages for walks in all cases and for gets only
when -v is given.
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2010 Red Hat Inc.
*
* 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
*
* Authors: Ben Skeggs
*/
#include "ctxgf100.h"
#include <subdev/fb.h>
#include <subdev/mc.h>
#include <subdev/timer.h>
/*******************************************************************************
* PGRAPH context register lists
******************************************************************************/
static const struct gf100_gr_init
gf100_grctx_init_icmd_0[] = {
{ 0x001000, 1, 0x01, 0x00000004 },
{ 0x0000a9, 1, 0x01, 0x0000ffff },
{ 0x000038, 1, 0x01, 0x0fac6881 },
{ 0x00003d, 1, 0x01, 0x00000001 },
{ 0x0000e8, 8, 0x01, 0x00000400 },
{ 0x000078, 8, 0x01, 0x00000300 },
{ 0x000050, 1, 0x01, 0x00000011 },
{ 0x000058, 8, 0x01, 0x00000008 },
{ 0x000208, 8, 0x01, 0x00000001 },
{ 0x000081, 1, 0x01, 0x00000001 },
{ 0x000085, 1, 0x01, 0x00000004 },
{ 0x000088, 1, 0x01, 0x00000400 },
{ 0x000090, 1, 0x01, 0x00000300 },
{ 0x000098, 1, 0x01, 0x00001001 },
{ 0x0000e3, 1, 0x01, 0x00000001 },
{ 0x0000da, 1, 0x01, 0x00000001 },
{ 0x0000f8, 1, 0x01, 0x00000003 },
{ 0x0000fa, 1, 0x01, 0x00000001 },
{ 0x00009f, 4, 0x01, 0x0000ffff },
{ 0x0000b1, 1, 0x01, 0x00000001 },
{ 0x0000b2, 40, 0x01, 0x00000000 },
{ 0x000210, 8, 0x01, 0x00000040 },
{ 0x000218, 8, 0x01, 0x0000c080 },
{ 0x0000ad, 1, 0x01, 0x0000013e },
{ 0x0000e1, 1, 0x01, 0x00000010 },
{ 0x000290, 16, 0x01, 0x00000000 },
{ 0x0003b0, 16, 0x01, 0x00000000 },
{ 0x0002a0, 16, 0x01, 0x00000000 },
{ 0x000420, 16, 0x01, 0x00000000 },
{ 0x0002b0, 16, 0x01, 0x00000000 },
{ 0x000430, 16, 0x01, 0x00000000 },
{ 0x0002c0, 16, 0x01, 0x00000000 },
{ 0x0004d0, 16, 0x01, 0x00000000 },
{ 0x000720, 16, 0x01, 0x00000000 },
{ 0x0008c0, 16, 0x01, 0x00000000 },
{ 0x000890, 16, 0x01, 0x00000000 },
{ 0x0008e0, 16, 0x01, 0x00000000 },
{ 0x0008a0, 16, 0x01, 0x00000000 },
{ 0x0008f0, 16, 0x01, 0x00000000 },
{ 0x00094c, 1, 0x01, 0x000000ff },
{ 0x00094d, 1, 0x01, 0xffffffff },
{ 0x00094e, 1, 0x01, 0x00000002 },
{ 0x0002ec, 1, 0x01, 0x00000001 },
{ 0x000303, 1, 0x01, 0x00000001 },
{ 0x0002e6, 1, 0x01, 0x00000001 },
{ 0x000466, 1, 0x01, 0x00000052 },
{ 0x000301, 1, 0x01, 0x3f800000 },
{ 0x000304, 1, 0x01, 0x30201000 },
{ 0x000305, 1, 0x01, 0x70605040 },
{ 0x000306, 1, 0x01, 0xb8a89888 },
{ 0x000307, 1, 0x01, 0xf8e8d8c8 },
{ 0x00030a, 1, 0x01, 0x00ffff00 },
{ 0x00030b, 1, 0x01, 0x0000001a },
{ 0x00030c, 1, 0x01, 0x00000001 },
{ 0x000318, 1, 0x01, 0x00000001 },
{ 0x000340, 1, 0x01, 0x00000000 },
{ 0x000375, 1, 0x01, 0x00000001 },
{ 0x000351, 1, 0x01, 0x00000100 },
{ 0x00037d, 1, 0x01, 0x00000006 },
{ 0x0003a0, 1, 0x01, 0x00000002 },
{ 0x0003aa, 1, 0x01, 0x00000001 },
{ 0x0003a9, 1, 0x01, 0x00000001 },
{ 0x000380, 1, 0x01, 0x00000001 },
{ 0x000360, 1, 0x01, 0x00000040 },
{ 0x000366, 2, 0x01, 0x00000000 },
{ 0x000368, 1, 0x01, 0x00001fff },
{ 0x000370, 2, 0x01, 0x00000000 },
{ 0x000372, 1, 0x01, 0x003fffff },
{ 0x00037a, 1, 0x01, 0x00000012 },
{ 0x0005e0, 5, 0x01, 0x00000022 },
{ 0x000619, 1, 0x01, 0x00000003 },
{ 0x000811, 1, 0x01, 0x00000003 },
{ 0x000812, 1, 0x01, 0x00000004 },
{ 0x000813, 1, 0x01, 0x00000006 },
{ 0x000814, 1, 0x01, 0x00000008 },
{ 0x000815, 1, 0x01, 0x0000000b },
{ 0x000800, 6, 0x01, 0x00000001 },
{ 0x000632, 1, 0x01, 0x00000001 },
{ 0x000633, 1, 0x01, 0x00000002 },
{ 0x000634, 1, 0x01, 0x00000003 },
{ 0x000635, 1, 0x01, 0x00000004 },
{ 0x000654, 1, 0x01, 0x3f800000 },
{ 0x000657, 1, 0x01, 0x3f800000 },
{ 0x000655, 2, 0x01, 0x3f800000 },
{ 0x0006cd, 1, 0x01, 0x3f800000 },
{ 0x0007f5, 1, 0x01, 0x3f800000 },
{ 0x0007dc, 1, 0x01, 0x39291909 },
{ 0x0007dd, 1, 0x01, 0x79695949 },
{ 0x0007de, 1, 0x01, 0xb9a99989 },
{ 0x0007df, 1, 0x01, 0xf9e9d9c9 },
{ 0x0007e8, 1, 0x01, 0x00003210 },
{ 0x0007e9, 1, 0x01, 0x00007654 },
{ 0x0007ea, 1, 0x01, 0x00000098 },
{ 0x0007ec, 1, 0x01, 0x39291909 },
{ 0x0007ed, 1, 0x01, 0x79695949 },
{ 0x0007ee, 1, 0x01, 0xb9a99989 },
{ 0x0007ef, 1, 0x01, 0xf9e9d9c9 },
{ 0x0007f0, 1, 0x01, 0x00003210 },
{ 0x0007f1, 1, 0x01, 0x00007654 },
{ 0x0007f2, 1, 0x01, 0x00000098 },
{ 0x0005a5, 1, 0x01, 0x00000001 },
{ 0x000980, 128, 0x01, 0x00000000 },
{ 0x000468, 1, 0x01, 0x00000004 },
{ 0x00046c, 1, 0x01, 0x00000001 },
{ 0x000470, 96, 0x01, 0x00000000 },
{ 0x000510, 16, 0x01, 0x3f800000 },
{ 0x000520, 1, 0x01, 0x000002b6 },
{ 0x000529, 1, 0x01, 0x00000001 },
{ 0x000530, 16, 0x01, 0xffff0000 },
{ 0x000585, 1, 0x01, 0x0000003f },
{ 0x000576, 1, 0x01, 0x00000003 },
{ 0x000586, 1, 0x01, 0x00000040 },
{ 0x000582, 2, 0x01, 0x00000080 },
{ 0x0005c2, 1, 0x01, 0x00000001 },
{ 0x000638, 2, 0x01, 0x00000001 },
{ 0x00063a, 1, 0x01, 0x00000002 },
{ 0x00063b, 2, 0x01, 0x00000001 },
{ 0x00063d, 1, 0x01, 0x00000002 },
{ 0x00063e, 1, 0x01, 0x00000001 },
{ 0x0008b8, 8, 0x01, 0x00000001 },
{ 0x000900, 8, 0x01, 0x00000001 },
{ 0x000908, 8, 0x01, 0x00000002 },
{ 0x000910, 16, 0x01, 0x00000001 },
{ 0x000920, 8, 0x01, 0x00000002 },
{ 0x000928, 8, 0x01, 0x00000001 },
{ 0x000648, 9, 0x01, 0x00000001 },
{ 0x000658, 1, 0x01, 0x0000000f },
{ 0x0007ff, 1, 0x01, 0x0000000a },
{ 0x00066a, 1, 0x01, 0x40000000 },
{ 0x00066b, 1, 0x01, 0x10000000 },
{ 0x00066c, 2, 0x01, 0xffff0000 },
{ 0x0007af, 2, 0x01, 0x00000008 },
{ 0x0007f6, 1, 0x01, 0x00000001 },
{ 0x0006b2, 1, 0x01, 0x00000055 },
{ 0x0007ad, 1, 0x01, 0x00000003 },
{ 0x000937, 1, 0x01, 0x00000001 },
{ 0x000971, 1, 0x01, 0x00000008 },
{ 0x000972, 1, 0x01, 0x00000040 },
{ 0x000973, 1, 0x01, 0x0000012c },
{ 0x00097c, 1, 0x01, 0x00000040 },
{ 0x000979, 1, 0x01, 0x00000003 },
{ 0x000975, 1, 0x01, 0x00000020 },
{ 0x000976, 1, 0x01, 0x00000001 },
{ 0x000977, 1, 0x01, 0x00000020 },
{ 0x000978, 1, 0x01, 0x00000001 },
{ 0x000957, 1, 0x01, 0x00000003 },
{ 0x00095e, 1, 0x01, 0x20164010 },
{ 0x00095f, 1, 0x01, 0x00000020 },
{ 0x000683, 1, 0x01, 0x00000006 },
{ 0x000685, 1, 0x01, 0x003fffff },
{ 0x000687, 1, 0x01, 0x00000c48 },
{ 0x0006a0, 1, 0x01, 0x00000005 },
{ 0x000840, 1, 0x01, 0x00300008 },
{ 0x000841, 1, 0x01, 0x04000080 },
{ 0x000842, 1, 0x01, 0x00300008 },
{ 0x000843, 1, 0x01, 0x04000080 },
{ 0x000818, 8, 0x01, 0x00000000 },
{ 0x000848, 16, 0x01, 0x00000000 },
{ 0x000738, 1, 0x01, 0x00000000 },
{ 0x0006aa, 1, 0x01, 0x00000001 },
{ 0x0006ab, 1, 0x01, 0x00000002 },
{ 0x0006ac, 1, 0x01, 0x00000080 },
{ 0x0006ad, 2, 0x01, 0x00000100 },
{ 0x0006b1, 1, 0x01, 0x00000011 },
{ 0x0006bb, 1, 0x01, 0x000000cf },
{ 0x0006ce, 1, 0x01, 0x2a712488 },
{ 0x000739, 1, 0x01, 0x4085c000 },
{ 0x00073a, 1, 0x01, 0x00000080 },
{ 0x000786, 1, 0x01, 0x80000100 },
{ 0x00073c, 1, 0x01, 0x00010100 },
{ 0x00073d, 1, 0x01, 0x02800000 },
{ 0x000787, 1, 0x01, 0x000000cf },
{ 0x00078c, 1, 0x01, 0x00000008 },
{ 0x000792, 1, 0x01, 0x00000001 },
{ 0x000794, 3, 0x01, 0x00000001 },
{ 0x000797, 1, 0x01, 0x000000cf },
{ 0x000836, 1, 0x01, 0x00000001 },
{ 0x00079a, 1, 0x01, 0x00000002 },
{ 0x000833, 1, 0x01, 0x04444480 },
{ 0x0007a1, 1, 0x01, 0x00000001 },
{ 0x0007a3, 3, 0x01, 0x00000001 },
{ 0x000831, 1, 0x01, 0x00000004 },
{ 0x00080c, 1, 0x01, 0x00000002 },
{ 0x00080d, 2, 0x01, 0x00000100 },
{ 0x00080f, 1, 0x01, 0x00000001 },
{ 0x000823, 1, 0x01, 0x00000002 },
{ 0x000824, 2, 0x01, 0x00000100 },
{ 0x000826, 1, 0x01, 0x00000001 },
{ 0x00095d, 1, 0x01, 0x00000001 },
{ 0x00082b, 1, 0x01, 0x00000004 },
{ 0x000942, 1, 0x01, 0x00010001 },
{ 0x000943, 1, 0x01, 0x00000001 },
{ 0x000944, 1, 0x01, 0x00000022 },
{ 0x0007c5, 1, 0x01, 0x00010001 },
{ 0x000834, 1, 0x01, 0x00000001 },
{ 0x0007c7, 1, 0x01, 0x00000001 },
{ 0x00c1b0, 8, 0x01, 0x0000000f },
{ 0x00c1b8, 1, 0x01, 0x0fac6881 },
{ 0x00c1b9, 1, 0x01, 0x00fac688 },
{ 0x01e100, 1, 0x01, 0x00000001 },
{ 0x001000, 1, 0x01, 0x00000002 },
{ 0x0006aa, 1, 0x01, 0x00000001 },
{ 0x0006ad, 2, 0x01, 0x00000100 },
{ 0x0006b1, 1, 0x01, 0x00000011 },
{ 0x00078c, 1, 0x01, 0x00000008 },
{ 0x000792, 1, 0x01, 0x00000001 },
{ 0x000794, 3, 0x01, 0x00000001 },
{ 0x000797, 1, 0x01, 0x000000cf },
{ 0x00079a, 1, 0x01, 0x00000002 },
{ 0x000833, 1, 0x01, 0x04444480 },
{ 0x0007a1, 1, 0x01, 0x00000001 },
{ 0x0007a3, 3, 0x01, 0x00000001 },
{ 0x000831, 1, 0x01, 0x00000004 },
{ 0x01e100, 1, 0x01, 0x00000001 },
{ 0x001000, 1, 0x01, 0x00000014 },
{ 0x000351, 1, 0x01, 0x00000100 },
{ 0x000957, 1, 0x01, 0x00000003 },
{ 0x00095d, 1, 0x01, 0x00000001 },
{ 0x00082b, 1, 0x01, 0x00000004 },
{ 0x000942, 1, 0x01, 0x00010001 },
{ 0x000943, 1, 0x01, 0x00000001 },
{ 0x0007c5, 1, 0x01, 0x00010001 },
{ 0x000834, 1, 0x01, 0x00000001 },
{ 0x0007c7, 1, 0x01, 0x00000001 },
{ 0x01e100, 1, 0x01, 0x00000001 },
{ 0x001000, 1, 0x01, 0x00000001 },
{ 0x00080c, 1, 0x01, 0x00000002 },
{ 0x00080d, 2, 0x01, 0x00000100 },
{ 0x00080f, 1, 0x01, 0x00000001 },
{ 0x000823, 1, 0x01, 0x00000002 },
{ 0x000824, 2, 0x01, 0x00000100 },
{ 0x000826, 1, 0x01, 0x00000001 },
{ 0x01e100, 1, 0x01, 0x00000001 },
{}
};
const struct gf100_gr_pack
gf100_grctx_pack_icmd[] = {
{ gf100_grctx_init_icmd_0 },
{}
};
static const struct gf100_gr_init
gf100_grctx_init_9097_0[] = {
{ 0x000800, 8, 0x40, 0x00000000 },
{ 0x000804, 8, 0x40, 0x00000000 },
{ 0x000808, 8, 0x40, 0x00000400 },
{ 0x00080c, 8, 0x40, 0x00000300 },
{ 0x000810, 1, 0x04, 0x000000cf },
{ 0x000850, 7, 0x40, 0x00000000 },
{ 0x000814, 8, 0x40, 0x00000040 },
{ 0x000818, 8, 0x40, 0x00000001 },
{ 0x00081c, 8, 0x40, 0x00000000 },
{ 0x000820, 8, 0x40, 0x00000000 },
{ 0x002700, 8, 0x20, 0x00000000 },
{ 0x002704, 8, 0x20, 0x00000000 },
{ 0x002708, 8, 0x20, 0x00000000 },
{ 0x00270c, 8, 0x20, 0x00000000 },
{ 0x002710, 8, 0x20, 0x00014000 },
{ 0x002714, 8, 0x20, 0x00000040 },
{ 0x001c00, 16, 0x10, 0x00000000 },
{ 0x001c04, 16, 0x10, 0x00000000 },
{ 0x001c08, 16, 0x10, 0x00000000 },
{ 0x001c0c, 16, 0x10, 0x00000000 },
{ 0x001d00, 16, 0x10, 0x00000000 },
{ 0x001d04, 16, 0x10, 0x00000000 },
{ 0x001d08, 16, 0x10, 0x00000000 },
{ 0x001d0c, 16, 0x10, 0x00000000 },
{ 0x001f00, 16, 0x08, 0x00000000 },
{ 0x001f04, 16, 0x08, 0x00000000 },
{ 0x001f80, 16, 0x08, 0x00000000 },
{ 0x001f84, 16, 0x08, 0x00000000 },
{ 0x002200, 5, 0x10, 0x00000022 },
{ 0x002000, 1, 0x04, 0x00000000 },
{ 0x002040, 1, 0x04, 0x00000011 },
{ 0x002080, 1, 0x04, 0x00000020 },
{ 0x0020c0, 1, 0x04, 0x00000030 },
{ 0x002100, 1, 0x04, 0x00000040 },
{ 0x002140, 1, 0x04, 0x00000051 },
{ 0x00200c, 6, 0x40, 0x00000001 },
{ 0x002010, 1, 0x04, 0x00000000 },
{ 0x002050, 1, 0x04, 0x00000000 },
{ 0x002090, 1, 0x04, 0x00000001 },
{ 0x0020d0, 1, 0x04, 0x00000002 },
{ 0x002110, 1, 0x04, 0x00000003 },
{ 0x002150, 1, 0x04, 0x00000004 },
{ 0x000380, 4, 0x20, 0x00000000 },
{ 0x000384, 4, 0x20, 0x00000000 },
{ 0x000388, 4, 0x20, 0x00000000 },
{ 0x00038c, 4, 0x20, 0x00000000 },
{ 0x000700, 4, 0x10, 0x00000000 },
{ 0x000704, 4, 0x10, 0x00000000 },
{ 0x000708, 4, 0x10, 0x00000000 },
{ 0x002800, 128, 0x04, 0x00000000 },
{ 0x000a00, 16, 0x20, 0x00000000 },
{ 0x000a04, 16, 0x20, 0x00000000 },
{ 0x000a08, 16, 0x20, 0x00000000 },
{ 0x000a0c, 16, 0x20, 0x00000000 },
{ 0x000a10, 16, 0x20, 0x00000000 },
{ 0x000a14, 16, 0x20, 0x00000000 },
{ 0x000c00, 16, 0x10, 0x00000000 },
{ 0x000c04, 16, 0x10, 0x00000000 },
{ 0x000c08, 16, 0x10, 0x00000000 },
{ 0x000c0c, 16, 0x10, 0x3f800000 },
{ 0x000d00, 8, 0x08, 0xffff0000 },
{ 0x000d04, 8, 0x08, 0xffff0000 },
{ 0x000e00, 16, 0x10, 0x00000000 },
{ 0x000e04, 16, 0x10, 0xffff0000 },
{ 0x000e08, 16, 0x10, 0xffff0000 },
{ 0x000d40, 4, 0x08, 0x00000000 },
{ 0x000d44, 4, 0x08, 0x00000000 },
{ 0x001e00, 8, 0x20, 0x00000001 },
{ 0x001e04, 8, 0x20, 0x00000001 },
{ 0x001e08, 8, 0x20, 0x00000002 },
{ 0x001e0c, 8, 0x20, 0x00000001 },
{ 0x001e10, 8, 0x20, 0x00000001 },
{ 0x001e14, 8, 0x20, 0x00000002 },
{ 0x001e18, 8, 0x20, 0x00000001 },
{ 0x003400, 128, 0x04, 0x00000000 },
{ 0x00030c, 1, 0x04, 0x00000001 },
{ 0x001944, 1, 0x04, 0x00000000 },
{ 0x001514, 1, 0x04, 0x00000000 },
{ 0x000d68, 1, 0x04, 0x0000ffff },
{ 0x00121c, 1, 0x04, 0x0fac6881 },
{ 0x000fac, 1, 0x04, 0x00000001 },
{ 0x001538, 1, 0x04, 0x00000001 },
{ 0x000fe0, 2, 0x04, 0x00000000 },
{ 0x000fe8, 1, 0x04, 0x00000014 },
{ 0x000fec, 1, 0x04, 0x00000040 },
{ 0x000ff0, 1, 0x04, 0x00000000 },
{ 0x00179c, 1, 0x04, 0x00000000 },
{ 0x001228, 1, 0x04, 0x00000400 },
{ 0x00122c, 1, 0x04, 0x00000300 },
{ 0x001230, 1, 0x04, 0x00010001 },
{ 0x0007f8, 1, 0x04, 0x00000000 },
{ 0x0015b4, 1, 0x04, 0x00000001 },
{ 0x0015cc, 1, 0x04, 0x00000000 },
{ 0x001534, 1, 0x04, 0x00000000 },
{ 0x000fb0, 1, 0x04, 0x00000000 },
{ 0x0015d0, 1, 0x04, 0x00000000 },
{ 0x00153c, 1, 0x04, 0x00000000 },
{ 0x0016b4, 1, 0x04, 0x00000003 },
{ 0x000fbc, 4, 0x04, 0x0000ffff },
{ 0x000df8, 2, 0x04, 0x00000000 },
{ 0x001948, 1, 0x04, 0x00000000 },
{ 0x001970, 1, 0x04, 0x00000001 },
{ 0x00161c, 1, 0x04, 0x000009f0 },
{ 0x000dcc, 1, 0x04, 0x00000010 },
{ 0x00163c, 1, 0x04, 0x00000000 },
{ 0x0015e4, 1, 0x04, 0x00000000 },
{ 0x001160, 32, 0x04, 0x25e00040 },
{ 0x001880, 32, 0x04, 0x00000000 },
{ 0x000f84, 2, 0x04, 0x00000000 },
{ 0x0017c8, 2, 0x04, 0x00000000 },
{ 0x0017d0, 1, 0x04, 0x000000ff },
{ 0x0017d4, 1, 0x04, 0xffffffff },
{ 0x0017d8, 1, 0x04, 0x00000002 },
{ 0x0017dc, 1, 0x04, 0x00000000 },
{ 0x0015f4, 2, 0x04, 0x00000000 },
{ 0x001434, 2, 0x04, 0x00000000 },
{ 0x000d74, 1, 0x04, 0x00000000 },
{ 0x000dec, 1, 0x04, 0x00000001 },
{ 0x0013a4, 1, 0x04, 0x00000000 },
{ 0x001318, 1, 0x04, 0x00000001 },
{ 0x001644, 1, 0x04, 0x00000000 },
{ 0x000748, 1, 0x04, 0x00000000 },
{ 0x000de8, 1, 0x04, 0x00000000 },
{ 0x001648, 1, 0x04, 0x00000000 },
{ 0x0012a4, 1, 0x04, 0x00000000 },
{ 0x001120, 4, 0x04, 0x00000000 },
{ 0x001118, 1, 0x04, 0x00000000 },
{ 0x00164c, 1, 0x04, 0x00000000 },
{ 0x001658, 1, 0x04, 0x00000000 },
{ 0x001910, 1, 0x04, 0x00000290 },
{ 0x001518, 1, 0x04, 0x00000000 },
{ 0x00165c, 1, 0x04, 0x00000001 },
{ 0x001520, 1, 0x04, 0x00000000 },
{ 0x001604, 1, 0x04, 0x00000000 },
{ 0x001570, 1, 0x04, 0x00000000 },
{ 0x0013b0, 2, 0x04, 0x3f800000 },
{ 0x00020c, 1, 0x04, 0x00000000 },
{ 0x001670, 1, 0x04, 0x30201000 },
{ 0x001674, 1, 0x04, 0x70605040 },
{ 0x001678, 1, 0x04, 0xb8a89888 },
{ 0x00167c, 1, 0x04, 0xf8e8d8c8 },
{ 0x00166c, 1, 0x04, 0x00000000 },
{ 0x001680, 1, 0x04, 0x00ffff00 },
{ 0x0012d0, 1, 0x04, 0x00000003 },
{ 0x0012d4, 1, 0x04, 0x00000002 },
{ 0x001684, 2, 0x04, 0x00000000 },
{ 0x000dac, 2, 0x04, 0x00001b02 },
{ 0x000db4, 1, 0x04, 0x00000000 },
{ 0x00168c, 1, 0x04, 0x00000000 },
{ 0x0015bc, 1, 0x04, 0x00000000 },
{ 0x00156c, 1, 0x04, 0x00000000 },
{ 0x00187c, 1, 0x04, 0x00000000 },
{ 0x001110, 1, 0x04, 0x00000001 },
{ 0x000dc0, 3, 0x04, 0x00000000 },
{ 0x001234, 1, 0x04, 0x00000000 },
{ 0x001690, 1, 0x04, 0x00000000 },
{ 0x0012ac, 1, 0x04, 0x00000001 },
{ 0x0002c4, 1, 0x04, 0x00000000 },
{ 0x000790, 5, 0x04, 0x00000000 },
{ 0x00077c, 1, 0x04, 0x00000000 },
{ 0x001000, 1, 0x04, 0x00000010 },
{ 0x0010fc, 1, 0x04, 0x00000000 },
{ 0x001290, 1, 0x04, 0x00000000 },
{ 0x000218, 1, 0x04, 0x00000010 },
{ 0x0012d8, 1, 0x04, 0x00000000 },
{ 0x0012dc, 1, 0x04, 0x00000010 },
{ 0x000d94, 1, 0x04, 0x00000001 },
{ 0x00155c, 2, 0x04, 0x00000000 },
{ 0x001564, 1, 0x04, 0x00001fff },
{ 0x001574, 2, 0x04, 0x00000000 },
{ 0x00157c, 1, 0x04, 0x003fffff },
{ 0x001354, 1, 0x04, 0x00000000 },
{ 0x001664, 1, 0x04, 0x00000000 },
{ 0x001610, 1, 0x04, 0x00000012 },
{ 0x001608, 2, 0x04, 0x00000000 },
{ 0x00162c, 1, 0x04, 0x00000003 },
{ 0x000210, 1, 0x04, 0x00000000 },
{ 0x000320, 1, 0x04, 0x00000000 },
{ 0x000324, 6, 0x04, 0x3f800000 },
{ 0x000750, 1, 0x04, 0x00000000 },
{ 0x000760, 1, 0x04, 0x39291909 },
{ 0x000764, 1, 0x04, 0x79695949 },
{ 0x000768, 1, 0x04, 0xb9a99989 },
{ 0x00076c, 1, 0x04, 0xf9e9d9c9 },
{ 0x000770, 1, 0x04, 0x30201000 },
{ 0x000774, 1, 0x04, 0x70605040 },
{ 0x000778, 1, 0x04, 0x00009080 },
{ 0x000780, 1, 0x04, 0x39291909 },
{ 0x000784, 1, 0x04, 0x79695949 },
{ 0x000788, 1, 0x04, 0xb9a99989 },
{ 0x00078c, 1, 0x04, 0xf9e9d9c9 },
{ 0x0007d0, 1, 0x04, 0x30201000 },
{ 0x0007d4, 1, 0x04, 0x70605040 },
{ 0x0007d8, 1, 0x04, 0x00009080 },
{ 0x00037c, 1, 0x04, 0x00000001 },
{ 0x000740, 2, 0x04, 0x00000000 },
{ 0x002600, 1, 0x04, 0x00000000 },
{ 0x001918, 1, 0x04, 0x00000000 },
{ 0x00191c, 1, 0x04, 0x00000900 },
{ 0x001920, 1, 0x04, 0x00000405 },
{ 0x001308, 1, 0x04, 0x00000001 },
{ 0x001924, 1, 0x04, 0x00000000 },
{ 0x0013ac, 1, 0x04, 0x00000000 },
{ 0x00192c, 1, 0x04, 0x00000001 },
{ 0x00193c, 1, 0x04, 0x00002c1c },
{ 0x000d7c, 1, 0x04, 0x00000000 },
{ 0x000f8c, 1, 0x04, 0x00000000 },
{ 0x0002c0, 1, 0x04, 0x00000001 },
{ 0x001510, 1, 0x04, 0x00000000 },
{ 0x001940, 1, 0x04, 0x00000000 },
{ 0x000ff4, 2, 0x04, 0x00000000 },
{ 0x00194c, 2, 0x04, 0x00000000 },
{ 0x001968, 1, 0x04, 0x00000000 },
{ 0x001590, 1, 0x04, 0x0000003f },
{ 0x0007e8, 4, 0x04, 0x00000000 },
{ 0x00196c, 1, 0x04, 0x00000011 },
{ 0x00197c, 1, 0x04, 0x00000000 },
{ 0x000fcc, 2, 0x04, 0x00000000 },
{ 0x0002d8, 1, 0x04, 0x00000040 },
{ 0x001980, 1, 0x04, 0x00000080 },
{ 0x001504, 1, 0x04, 0x00000080 },
{ 0x001984, 1, 0x04, 0x00000000 },
{ 0x000300, 1, 0x04, 0x00000001 },
{ 0x0013a8, 1, 0x04, 0x00000000 },
{ 0x0012ec, 1, 0x04, 0x00000000 },
{ 0x001310, 1, 0x04, 0x00000000 },
{ 0x001314, 1, 0x04, 0x00000001 },
{ 0x001380, 1, 0x04, 0x00000000 },
{ 0x001384, 4, 0x04, 0x00000001 },
{ 0x001394, 1, 0x04, 0x00000000 },
{ 0x00139c, 1, 0x04, 0x00000000 },
{ 0x001398, 1, 0x04, 0x00000000 },
{ 0x001594, 1, 0x04, 0x00000000 },
{ 0x001598, 4, 0x04, 0x00000001 },
{ 0x000f54, 3, 0x04, 0x00000000 },
{ 0x0019bc, 1, 0x04, 0x00000000 },
{ 0x000f9c, 2, 0x04, 0x00000000 },
{ 0x0012cc, 1, 0x04, 0x00000000 },
{ 0x0012e8, 1, 0x04, 0x00000000 },
{ 0x00130c, 1, 0x04, 0x00000001 },
{ 0x001360, 8, 0x04, 0x00000000 },
{ 0x00133c, 2, 0x04, 0x00000001 },
{ 0x001344, 1, 0x04, 0x00000002 },
{ 0x001348, 2, 0x04, 0x00000001 },
{ 0x001350, 1, 0x04, 0x00000002 },
{ 0x001358, 1, 0x04, 0x00000001 },
{ 0x0012e4, 1, 0x04, 0x00000000 },
{ 0x00131c, 4, 0x04, 0x00000000 },
{ 0x0019c0, 1, 0x04, 0x00000000 },
{ 0x001140, 1, 0x04, 0x00000000 },
{ 0x0019c4, 1, 0x04, 0x00000000 },
{ 0x0019c8, 1, 0x04, 0x00001500 },
{ 0x00135c, 1, 0x04, 0x00000000 },
{ 0x000f90, 1, 0x04, 0x00000000 },
{ 0x0019e0, 8, 0x04, 0x00000001 },
{ 0x0019cc, 1, 0x04, 0x00000001 },
{ 0x0015b8, 1, 0x04, 0x00000000 },
{ 0x001a00, 1, 0x04, 0x00001111 },
{ 0x001a04, 7, 0x04, 0x00000000 },
{ 0x000d6c, 2, 0x04, 0xffff0000 },
{ 0x0010f8, 1, 0x04, 0x00001010 },
{ 0x000d80, 5, 0x04, 0x00000000 },
{ 0x000da0, 1, 0x04, 0x00000000 },
{ 0x001508, 1, 0x04, 0x80000000 },
{ 0x00150c, 1, 0x04, 0x40000000 },
{ 0x001668, 1, 0x04, 0x00000000 },
{ 0x000318, 2, 0x04, 0x00000008 },
{ 0x000d9c, 1, 0x04, 0x00000001 },
{ 0x0007dc, 1, 0x04, 0x00000000 },
{ 0x00074c, 1, 0x04, 0x00000055 },
{ 0x001420, 1, 0x04, 0x00000003 },
{ 0x0017bc, 2, 0x04, 0x00000000 },
{ 0x0017c4, 1, 0x04, 0x00000001 },
{ 0x001008, 1, 0x04, 0x00000008 },
{ 0x00100c, 1, 0x04, 0x00000040 },
{ 0x001010, 1, 0x04, 0x0000012c },
{ 0x000d60, 1, 0x04, 0x00000040 },
{ 0x00075c, 1, 0x04, 0x00000003 },
{ 0x001018, 1, 0x04, 0x00000020 },
{ 0x00101c, 1, 0x04, 0x00000001 },
{ 0x001020, 1, 0x04, 0x00000020 },
{ 0x001024, 1, 0x04, 0x00000001 },
{ 0x001444, 3, 0x04, 0x00000000 },
{ 0x000360, 1, 0x04, 0x20164010 },
{ 0x000364, 1, 0x04, 0x00000020 },
{ 0x000368, 1, 0x04, 0x00000000 },
{ 0x000de4, 1, 0x04, 0x00000000 },
{ 0x000204, 1, 0x04, 0x00000006 },
{ 0x000208, 1, 0x04, 0x00000000 },
{ 0x0002cc, 1, 0x04, 0x003fffff },
{ 0x0002d0, 1, 0x04, 0x00000c48 },
{ 0x001220, 1, 0x04, 0x00000005 },
{ 0x000fdc, 1, 0x04, 0x00000000 },
{ 0x000f98, 1, 0x04, 0x00300008 },
{ 0x001284, 1, 0x04, 0x04000080 },
{ 0x001450, 1, 0x04, 0x00300008 },
{ 0x001454, 1, 0x04, 0x04000080 },
{ 0x000214, 1, 0x04, 0x00000000 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_902d_0[] = {
{ 0x000200, 1, 0x04, 0x000000cf },
{ 0x000204, 1, 0x04, 0x00000001 },
{ 0x000208, 1, 0x04, 0x00000020 },
{ 0x00020c, 1, 0x04, 0x00000001 },
{ 0x000210, 1, 0x04, 0x00000000 },
{ 0x000214, 1, 0x04, 0x00000080 },
{ 0x000218, 2, 0x04, 0x00000100 },
{ 0x000220, 2, 0x04, 0x00000000 },
{ 0x000230, 1, 0x04, 0x000000cf },
{ 0x000234, 1, 0x04, 0x00000001 },
{ 0x000238, 1, 0x04, 0x00000020 },
{ 0x00023c, 1, 0x04, 0x00000001 },
{ 0x000244, 1, 0x04, 0x00000080 },
{ 0x000248, 2, 0x04, 0x00000100 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_9039_0[] = {
{ 0x00030c, 3, 0x04, 0x00000000 },
{ 0x000320, 1, 0x04, 0x00000000 },
{ 0x000238, 2, 0x04, 0x00000000 },
{ 0x000318, 2, 0x04, 0x00000000 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_90c0_0[] = {
{ 0x00270c, 8, 0x20, 0x00000000 },
{ 0x00030c, 1, 0x04, 0x00000001 },
{ 0x001944, 1, 0x04, 0x00000000 },
{ 0x000758, 1, 0x04, 0x00000100 },
{ 0x0002c4, 1, 0x04, 0x00000000 },
{ 0x000790, 5, 0x04, 0x00000000 },
{ 0x00077c, 1, 0x04, 0x00000000 },
{ 0x000204, 3, 0x04, 0x00000000 },
{ 0x000214, 1, 0x04, 0x00000000 },
{ 0x00024c, 1, 0x04, 0x00000000 },
{ 0x000d94, 1, 0x04, 0x00000001 },
{ 0x001608, 2, 0x04, 0x00000000 },
{ 0x001664, 1, 0x04, 0x00000000 },
{}
};
const struct gf100_gr_pack
gf100_grctx_pack_mthd[] = {
{ gf100_grctx_init_9097_0, 0x9097 },
{ gf100_grctx_init_902d_0, 0x902d },
{ gf100_grctx_init_9039_0, 0x9039 },
{ gf100_grctx_init_90c0_0, 0x90c0 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_main_0[] = {
{ 0x400204, 2, 0x04, 0x00000000 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_fe_0[] = {
{ 0x404004, 11, 0x04, 0x00000000 },
{ 0x404044, 1, 0x04, 0x00000000 },
{ 0x404094, 13, 0x04, 0x00000000 },
{ 0x4040c8, 1, 0x04, 0xf0000087 },
{ 0x4040d0, 6, 0x04, 0x00000000 },
{ 0x4040e8, 1, 0x04, 0x00001000 },
{ 0x4040f8, 1, 0x04, 0x00000000 },
{ 0x404130, 2, 0x04, 0x00000000 },
{ 0x404138, 1, 0x04, 0x20000040 },
{ 0x404150, 1, 0x04, 0x0000002e },
{ 0x404154, 1, 0x04, 0x00000400 },
{ 0x404158, 1, 0x04, 0x00000200 },
{ 0x404164, 1, 0x04, 0x00000055 },
{ 0x404168, 1, 0x04, 0x00000000 },
{ 0x404174, 3, 0x04, 0x00000000 },
{ 0x404200, 8, 0x04, 0x00000000 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_pri_0[] = {
{ 0x404404, 14, 0x04, 0x00000000 },
{ 0x404460, 2, 0x04, 0x00000000 },
{ 0x404468, 1, 0x04, 0x00ffffff },
{ 0x40446c, 1, 0x04, 0x00000000 },
{ 0x404480, 1, 0x04, 0x00000001 },
{ 0x404498, 1, 0x04, 0x00000001 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_memfmt_0[] = {
{ 0x404604, 1, 0x04, 0x00000015 },
{ 0x404608, 1, 0x04, 0x00000000 },
{ 0x40460c, 1, 0x04, 0x00002e00 },
{ 0x404610, 1, 0x04, 0x00000100 },
{ 0x404618, 8, 0x04, 0x00000000 },
{ 0x404638, 1, 0x04, 0x00000004 },
{ 0x40463c, 8, 0x04, 0x00000000 },
{ 0x40465c, 1, 0x04, 0x007f0100 },
{ 0x404660, 7, 0x04, 0x00000000 },
{ 0x40467c, 1, 0x04, 0x00000002 },
{ 0x404680, 8, 0x04, 0x00000000 },
{ 0x4046a0, 1, 0x04, 0x007f0080 },
{ 0x4046a4, 18, 0x04, 0x00000000 },
{ 0x4046f0, 2, 0x04, 0x00000000 },
{ 0x404700, 13, 0x04, 0x00000000 },
{ 0x404734, 1, 0x04, 0x00000100 },
{ 0x404738, 8, 0x04, 0x00000000 },
{}
};
static const struct gf100_gr_init
gf100_grctx_init_ds_0[] = {
{ 0x405800, 1, 0x04, 0x078000bf },
{ 0x405830, 1, 0x04, 0x02180000 },
{ 0x405834, 2, 0x04, 0x00000000 },
{ 0x405854, 1, 0x04, 0x00000000 },
{ 0x405870, 4, 0x04, 0x00000001 },
{ 0x405a00, 2, 0x04, 0x00000000 },
{ 0x405a18, 1, 0x04, 0x00000000 },
{}
};
static const struct gf100_gr_init
gf100_grctx_init_pd_0[] = {
{ 0x406020, 1, 0x04, 0x000103c1 },
{ 0x406028, 4, 0x04, 0x00000001 },
{ 0x4064a8, 1, 0x04, 0x00000000 },
{ 0x4064ac, 1, 0x04, 0x00003fff },
{ 0x4064b4, 2, 0x04, 0x00000000 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_rstr2d_0[] = {
{ 0x407804, 1, 0x04, 0x00000023 },
{ 0x40780c, 1, 0x04, 0x0a418820 },
{ 0x407810, 1, 0x04, 0x062080e6 },
{ 0x407814, 1, 0x04, 0x020398a4 },
{ 0x407818, 1, 0x04, 0x0e629062 },
{ 0x40781c, 1, 0x04, 0x0a418820 },
{ 0x407820, 1, 0x04, 0x000000e6 },
{ 0x4078bc, 1, 0x04, 0x00000103 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_scc_0[] = {
{ 0x408000, 2, 0x04, 0x00000000 },
{ 0x408008, 1, 0x04, 0x00000018 },
{ 0x40800c, 2, 0x04, 0x00000000 },
{ 0x408014, 1, 0x04, 0x00000069 },
{ 0x408018, 1, 0x04, 0xe100e100 },
{ 0x408064, 1, 0x04, 0x00000000 },
{}
};
static const struct gf100_gr_init
gf100_grctx_init_be_0[] = {
{ 0x408800, 1, 0x04, 0x02802a3c },
{ 0x408804, 1, 0x04, 0x00000040 },
{ 0x408808, 1, 0x04, 0x0003e00d },
{ 0x408900, 1, 0x04, 0x3080b801 },
{ 0x408904, 1, 0x04, 0x02000001 },
{ 0x408908, 1, 0x04, 0x00c80929 },
{ 0x408980, 1, 0x04, 0x0000011d },
{}
};
const struct gf100_gr_pack
gf100_grctx_pack_hub[] = {
{ gf100_grctx_init_main_0 },
{ gf100_grctx_init_fe_0 },
{ gf100_grctx_init_pri_0 },
{ gf100_grctx_init_memfmt_0 },
{ gf100_grctx_init_ds_0 },
{ gf100_grctx_init_pd_0 },
{ gf100_grctx_init_rstr2d_0 },
{ gf100_grctx_init_scc_0 },
{ gf100_grctx_init_be_0 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_gpc_unk_0[] = {
{ 0x418380, 1, 0x04, 0x00000016 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_prop_0[] = {
{ 0x418400, 1, 0x04, 0x38004e00 },
{ 0x418404, 1, 0x04, 0x71e0ffff },
{ 0x418408, 1, 0x04, 0x00000000 },
{ 0x41840c, 1, 0x04, 0x00001008 },
{ 0x418410, 1, 0x04, 0x0fff0fff },
{ 0x418414, 1, 0x04, 0x00200fff },
{ 0x418450, 6, 0x04, 0x00000000 },
{ 0x418468, 1, 0x04, 0x00000001 },
{ 0x41846c, 2, 0x04, 0x00000000 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_gpc_unk_1[] = {
{ 0x418600, 1, 0x04, 0x0000001f },
{ 0x418684, 1, 0x04, 0x0000000f },
{ 0x418700, 1, 0x04, 0x00000002 },
{ 0x418704, 1, 0x04, 0x00000080 },
{ 0x418708, 1, 0x04, 0x00000000 },
{ 0x41870c, 1, 0x04, 0x07c80000 },
{ 0x418710, 1, 0x04, 0x00000000 },
{}
};
static const struct gf100_gr_init
gf100_grctx_init_setup_0[] = {
{ 0x418800, 1, 0x04, 0x0006860a },
{ 0x418808, 3, 0x04, 0x00000000 },
{ 0x418828, 1, 0x04, 0x00008442 },
{ 0x418830, 1, 0x04, 0x00000001 },
{ 0x4188d8, 1, 0x04, 0x00000008 },
{ 0x4188e0, 1, 0x04, 0x01000000 },
{ 0x4188e8, 5, 0x04, 0x00000000 },
{ 0x4188fc, 1, 0x04, 0x00100000 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_zcull_0[] = {
{ 0x41891c, 1, 0x04, 0x00ff00ff },
{ 0x418924, 1, 0x04, 0x00000000 },
{ 0x418928, 1, 0x04, 0x00ffff00 },
{ 0x41892c, 1, 0x04, 0x0000ff00 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_crstr_0[] = {
{ 0x418b00, 1, 0x04, 0x00000000 },
{ 0x418b08, 1, 0x04, 0x0a418820 },
{ 0x418b0c, 1, 0x04, 0x062080e6 },
{ 0x418b10, 1, 0x04, 0x020398a4 },
{ 0x418b14, 1, 0x04, 0x0e629062 },
{ 0x418b18, 1, 0x04, 0x0a418820 },
{ 0x418b1c, 1, 0x04, 0x000000e6 },
{ 0x418bb8, 1, 0x04, 0x00000103 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_gpm_0[] = {
{ 0x418c08, 1, 0x04, 0x00000001 },
{ 0x418c10, 8, 0x04, 0x00000000 },
{ 0x418c80, 1, 0x04, 0x20200004 },
{ 0x418c8c, 1, 0x04, 0x00000001 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_gcc_0[] = {
{ 0x419000, 1, 0x04, 0x00000780 },
{ 0x419004, 2, 0x04, 0x00000000 },
{ 0x419014, 1, 0x04, 0x00000004 },
{}
};
const struct gf100_gr_pack
gf100_grctx_pack_gpc_0[] = {
{ gf100_grctx_init_gpc_unk_0 },
{ gf100_grctx_init_prop_0 },
{ gf100_grctx_init_gpc_unk_1 },
{ gf100_grctx_init_setup_0 },
{ gf100_grctx_init_zcull_0 },
{}
};
const struct gf100_gr_pack
gf100_grctx_pack_gpc_1[] = {
{ gf100_grctx_init_crstr_0 },
{ gf100_grctx_init_gpm_0 },
{ gf100_grctx_init_gcc_0 },
{}
};
static const struct gf100_gr_init
gf100_grctx_init_zcullr_0[] = {
{ 0x418a00, 3, 0x04, 0x00000000 },
{ 0x418a0c, 1, 0x04, 0x00010000 },
{ 0x418a10, 3, 0x04, 0x00000000 },
{ 0x418a20, 3, 0x04, 0x00000000 },
{ 0x418a2c, 1, 0x04, 0x00010000 },
{ 0x418a30, 3, 0x04, 0x00000000 },
{ 0x418a40, 3, 0x04, 0x00000000 },
{ 0x418a4c, 1, 0x04, 0x00010000 },
{ 0x418a50, 3, 0x04, 0x00000000 },
{ 0x418a60, 3, 0x04, 0x00000000 },
{ 0x418a6c, 1, 0x04, 0x00010000 },
{ 0x418a70, 3, 0x04, 0x00000000 },
{ 0x418a80, 3, 0x04, 0x00000000 },
{ 0x418a8c, 1, 0x04, 0x00010000 },
{ 0x418a90, 3, 0x04, 0x00000000 },
{ 0x418aa0, 3, 0x04, 0x00000000 },
{ 0x418aac, 1, 0x04, 0x00010000 },
{ 0x418ab0, 3, 0x04, 0x00000000 },
{ 0x418ac0, 3, 0x04, 0x00000000 },
{ 0x418acc, 1, 0x04, 0x00010000 },
{ 0x418ad0, 3, 0x04, 0x00000000 },
{ 0x418ae0, 3, 0x04, 0x00000000 },
{ 0x418aec, 1, 0x04, 0x00010000 },
{ 0x418af0, 3, 0x04, 0x00000000 },
{}
};
const struct gf100_gr_pack
gf100_grctx_pack_zcull[] = {
{ gf100_grctx_init_zcullr_0 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_pe_0[] = {
{ 0x419818, 1, 0x04, 0x00000000 },
{ 0x41983c, 1, 0x04, 0x00038bc7 },
{ 0x419848, 1, 0x04, 0x00000000 },
{ 0x419864, 1, 0x04, 0x0000012a },
{ 0x419888, 1, 0x04, 0x00000000 },
{}
};
static const struct gf100_gr_init
gf100_grctx_init_tex_0[] = {
{ 0x419a00, 1, 0x04, 0x000001f0 },
{ 0x419a04, 1, 0x04, 0x00000001 },
{ 0x419a08, 1, 0x04, 0x00000023 },
{ 0x419a0c, 1, 0x04, 0x00020000 },
{ 0x419a10, 1, 0x04, 0x00000000 },
{ 0x419a14, 1, 0x04, 0x00000200 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_wwdx_0[] = {
{ 0x419b00, 1, 0x04, 0x0a418820 },
{ 0x419b04, 1, 0x04, 0x062080e6 },
{ 0x419b08, 1, 0x04, 0x020398a4 },
{ 0x419b0c, 1, 0x04, 0x0e629062 },
{ 0x419b10, 1, 0x04, 0x0a418820 },
{ 0x419b14, 1, 0x04, 0x000000e6 },
{ 0x419bd0, 1, 0x04, 0x00900103 },
{ 0x419be0, 1, 0x04, 0x00000001 },
{ 0x419be4, 1, 0x04, 0x00000000 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_mpc_0[] = {
{ 0x419c00, 1, 0x04, 0x00000002 },
{ 0x419c04, 1, 0x04, 0x00000006 },
{ 0x419c08, 1, 0x04, 0x00000002 },
{ 0x419c20, 1, 0x04, 0x00000000 },
{}
};
static const struct gf100_gr_init
gf100_grctx_init_l1c_0[] = {
{ 0x419cb0, 1, 0x04, 0x00060048 },
{ 0x419ce8, 1, 0x04, 0x00000000 },
{ 0x419cf4, 1, 0x04, 0x00000183 },
{}
};
const struct gf100_gr_init
gf100_grctx_init_tpccs_0[] = {
{ 0x419d20, 1, 0x04, 0x02180000 },
{ 0x419d24, 1, 0x04, 0x00001fff },
{}
};
static const struct gf100_gr_init
gf100_grctx_init_sm_0[] = {
{ 0x419e04, 3, 0x04, 0x00000000 },
{ 0x419e10, 1, 0x04, 0x00000002 },
{ 0x419e44, 1, 0x04, 0x001beff2 },
{ 0x419e48, 1, 0x04, 0x00000000 },
{ 0x419e4c, 1, 0x04, 0x0000000f },
{ 0x419e50, 17, 0x04, 0x00000000 },
{ 0x419e98, 1, 0x04, 0x00000000 },
{ 0x419f50, 2, 0x04, 0x00000000 },
{}
};
const struct gf100_gr_pack
gf100_grctx_pack_tpc[] = {
{ gf100_grctx_init_pe_0 },
{ gf100_grctx_init_tex_0 },
{ gf100_grctx_init_wwdx_0 },
{ gf100_grctx_init_mpc_0 },
{ gf100_grctx_init_l1c_0 },
{ gf100_grctx_init_tpccs_0 },
{ gf100_grctx_init_sm_0 },
{}
};
/*******************************************************************************
* PGRAPH context implementation
******************************************************************************/
int
gf100_grctx_mmio_data(struct gf100_grctx *info, u32 size, u32 align, bool priv)
{
if (info->data) {
info->buffer[info->buffer_nr] = round_up(info->addr, align);
info->addr = info->buffer[info->buffer_nr] + size;
info->data->size = size;
info->data->align = align;
info->data->priv = priv;
info->data++;
return info->buffer_nr++;
}
return -1;
}
void
gf100_grctx_mmio_item(struct gf100_grctx *info, u32 addr, u32 data,
int shift, int buffer)
{
struct nvkm_device *device = info->gr->base.engine.subdev.device;
if (info->data) {
if (shift >= 0) {
info->mmio->addr = addr;
info->mmio->data = data;
info->mmio->shift = shift;
info->mmio->buffer = buffer;
if (buffer >= 0)
data |= info->buffer[buffer] >> shift;
info->mmio++;
} else
return;
} else {
if (buffer >= 0)
return;
}
nvkm_wr32(device, addr, data);
}
void
gf100_grctx_generate_r419cb8(struct gf100_gr *gr)
{
struct nvkm_device *device = gr->base.engine.subdev.device;
nvkm_mask(device, 0x419cb8, 0x00007c00, 0x00000000);
}
void
gf100_grctx_generate_bundle(struct gf100_grctx *info)
{
const struct gf100_grctx_func *grctx = info->gr->func->grctx;
const int s = 8;
const int b = mmio_vram(info, grctx->bundle_size, (1 << s), true);
mmio_refn(info, 0x408004, 0x00000000, s, b);
mmio_wr32(info, 0x408008, 0x80000000 | (grctx->bundle_size >> s));
mmio_refn(info, 0x418808, 0x00000000, s, b);
mmio_wr32(info, 0x41880c, 0x80000000 | (grctx->bundle_size >> s));
}
void
gf100_grctx_generate_pagepool(struct gf100_grctx *info)
{
const struct gf100_grctx_func *grctx = info->gr->func->grctx;
const int s = 8;
const int b = mmio_vram(info, grctx->pagepool_size, (1 << s), true);
mmio_refn(info, 0x40800c, 0x00000000, s, b);
mmio_wr32(info, 0x408010, 0x80000000);
mmio_refn(info, 0x419004, 0x00000000, s, b);
mmio_wr32(info, 0x419008, 0x00000000);
}
void
gf100_grctx_generate_attrib(struct gf100_grctx *info)
{
struct gf100_gr *gr = info->gr;
const struct gf100_grctx_func *grctx = gr->func->grctx;
const u32 attrib = grctx->attrib_nr;
const u32 size = 0x20 * (grctx->attrib_nr_max + grctx->alpha_nr_max);
const int s = 12;
const int b = mmio_vram(info, size * gr->tpc_total, (1 << s), false);
int gpc, tpc;
u32 bo = 0;
mmio_refn(info, 0x418810, 0x80000000, s, b);
mmio_refn(info, 0x419848, 0x10000000, s, b);
mmio_wr32(info, 0x405830, (attrib << 16));
for (gpc = 0; gpc < gr->gpc_nr; gpc++) {
for (tpc = 0; tpc < gr->tpc_nr[gpc]; tpc++) {
const u32 o = TPC_UNIT(gpc, tpc, 0x0520);
mmio_skip(info, o, (attrib << 16) | ++bo);
mmio_wr32(info, o, (attrib << 16) | --bo);
bo += grctx->attrib_nr_max;
}
}
}
void
gf100_grctx_generate_unkn(struct gf100_gr *gr)
{
}
void
gf100_grctx_generate_r4060a8(struct gf100_gr *gr)
{
struct nvkm_device *device = gr->base.engine.subdev.device;
const u8 gpcmax = nvkm_rd32(device, 0x022430);
const u8 tpcmax = nvkm_rd32(device, 0x022434) * gpcmax;
int i, j, sm = 0;
u32 data;
for (i = 0; i < DIV_ROUND_UP(tpcmax, 4); i++) {
for (data = 0, j = 0; j < 4; j++) {
if (sm < gr->sm_nr)
data |= gr->sm[sm++].gpc << (j * 8);
else
data |= 0x1f << (j * 8);
}
nvkm_wr32(device, 0x4060a8 + (i * 4), data);
}
}
void
gf100_grctx_generate_rop_mapping(struct gf100_gr *gr)
{
struct nvkm_device *device = gr->base.engine.subdev.device;
u32 data[6] = {}, data2[2] = {};
u8 shift, ntpcv;
int i;
/* Pack tile map into register format. */
for (i = 0; i < 32; i++)
data[i / 6] |= (gr->tile[i] & 0x07) << ((i % 6) * 5);
/* Magic. */
shift = 0;
ntpcv = gr->tpc_total;
while (!(ntpcv & (1 << 4))) {
ntpcv <<= 1;
shift++;
}
data2[0] = (ntpcv << 16);
data2[0] |= (shift << 21);
data2[0] |= (((1 << (0 + 5)) % ntpcv) << 24);
for (i = 1; i < 7; i++)
data2[1] |= ((1 << (i + 5)) % ntpcv) << ((i - 1) * 5);
/* GPC_BROADCAST */
nvkm_wr32(device, 0x418bb8, (gr->tpc_total << 8) |
gr->screen_tile_row_offset);
for (i = 0; i < 6; i++)
nvkm_wr32(device, 0x418b08 + (i * 4), data[i]);
/* GPC_BROADCAST.TP_BROADCAST */
nvkm_wr32(device, 0x419bd0, (gr->tpc_total << 8) |
gr->screen_tile_row_offset | data2[0]);
nvkm_wr32(device, 0x419be4, data2[1]);
for (i = 0; i < 6; i++)
nvkm_wr32(device, 0x419b00 + (i * 4), data[i]);
/* UNK78xx */
nvkm_wr32(device, 0x4078bc, (gr->tpc_total << 8) |
gr->screen_tile_row_offset);
for (i = 0; i < 6; i++)
nvkm_wr32(device, 0x40780c + (i * 4), data[i]);
}
void
gf100_grctx_generate_max_ways_evict(struct gf100_gr *gr)
{
struct nvkm_device *device = gr->base.engine.subdev.device;
u32 fbps = nvkm_rd32(device, 0x121c74);
if (fbps == 1)
nvkm_mask(device, 0x17e91c, 0x001f0000, 0x00090000);
}
static const u32
gf100_grctx_alpha_beta_map[17][32] = {
[1] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
},
[2] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
},
//XXX: 3
[4] = {
1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3,
},
//XXX: 5
//XXX: 6
[7] = {
1, 1, 1, 1,
2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5,
6, 6, 6, 6,
},
[8] = {
1, 1, 1,
2, 2, 2, 2, 2,
3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5,
6, 6, 6, 6, 6,
7, 7, 7,
},
//XXX: 9
//XXX: 10
[11] = {
1, 1,
2, 2, 2, 2,
3, 3, 3,
4, 4, 4, 4,
5, 5, 5,
6, 6, 6,
7, 7, 7, 7,
8, 8, 8,
9, 9, 9, 9,
10, 10,
},
//XXX: 12
//XXX: 13
[14] = {
1, 1,
2, 2,
3, 3, 3,
4, 4, 4,
5, 5,
6, 6, 6,
7, 7,
8, 8, 8,
9, 9,
10, 10, 10,
11, 11, 11,
12, 12,
13, 13,
},
[15] = {
1, 1,
2, 2,
3, 3,
4, 4, 4,
5, 5,
6, 6, 6,
7, 7,
8, 8,
9, 9, 9,
10, 10,
11, 11, 11,
12, 12,
13, 13,
14, 14,
},
[16] = {
1, 1,
2, 2,
3, 3,
4, 4,
5, 5,
6, 6, 6,
7, 7,
8, 8,
9, 9,
10, 10, 10,
11, 11,
12, 12,
13, 13,
14, 14,
15, 15,
},
};
void
gf100_grctx_generate_alpha_beta_tables(struct gf100_gr *gr)
{
struct nvkm_subdev *subdev = &gr->base.engine.subdev;
struct nvkm_device *device = subdev->device;
int i, gpc;
for (i = 0; i < 32; i++) {
u32 atarget = gf100_grctx_alpha_beta_map[gr->tpc_total][i];
u32 abits[GPC_MAX] = {}, amask = 0, bmask = 0;
if (!atarget) {
nvkm_warn(subdev, "missing alpha/beta mapping table\n");
atarget = max_t(u32, gr->tpc_total * i / 32, 1);
}
while (atarget) {
for (gpc = 0; atarget && gpc < gr->gpc_nr; gpc++) {
if (abits[gpc] < gr->tpc_nr[gpc]) {
abits[gpc]++;
atarget--;
}
}
}
for (gpc = 0; gpc < gr->gpc_nr; gpc++) {
u32 bbits = gr->tpc_nr[gpc] - abits[gpc];
amask |= ((1 << abits[gpc]) - 1) << (gpc * 8);
bmask |= ((1 << bbits) - 1) << abits[gpc] << (gpc * 8);
}
nvkm_wr32(device, 0x406800 + (i * 0x20), amask);
nvkm_wr32(device, 0x406c00 + (i * 0x20), bmask);
}
}
void
gf100_grctx_generate_tpc_nr(struct gf100_gr *gr, int gpc)
{
struct nvkm_device *device = gr->base.engine.subdev.device;
nvkm_wr32(device, GPC_UNIT(gpc, 0x0c08), gr->tpc_nr[gpc]);
nvkm_wr32(device, GPC_UNIT(gpc, 0x0c8c), gr->tpc_nr[gpc]);
}
void
gf100_grctx_generate_sm_id(struct gf100_gr *gr, int gpc, int tpc, int sm)
{
struct nvkm_device *device = gr->base.engine.subdev.device;
nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x698), sm);
nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x4e8), sm);
nvkm_wr32(device, GPC_UNIT(gpc, 0x0c10 + tpc * 4), sm);
nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x088), sm);
}
void
gf100_grctx_generate_floorsweep(struct gf100_gr *gr)
{
const struct gf100_grctx_func *func = gr->func->grctx;
int sm;
for (sm = 0; sm < gr->sm_nr; sm++) {
func->sm_id(gr, gr->sm[sm].gpc, gr->sm[sm].tpc, sm);
if (func->tpc_nr)
func->tpc_nr(gr, gr->sm[sm].gpc);
}
gf100_gr_init_num_tpc_per_gpc(gr, false, true);
if (!func->skip_pd_num_tpc_per_gpc)
gf100_gr_init_num_tpc_per_gpc(gr, true, false);
if (func->r4060a8)
func->r4060a8(gr);
func->rop_mapping(gr);
if (func->alpha_beta_tables)
func->alpha_beta_tables(gr);
if (func->max_ways_evict)
func->max_ways_evict(gr);
if (func->dist_skip_table)
func->dist_skip_table(gr);
if (func->r406500)
func->r406500(gr);
if (func->gpc_tpc_nr)
func->gpc_tpc_nr(gr);
if (func->r419f78)
func->r419f78(gr);
if (func->tpc_mask)
func->tpc_mask(gr);
if (func->smid_config)
func->smid_config(gr);
}
void
gf100_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
{
struct nvkm_device *device = gr->base.engine.subdev.device;
const struct gf100_grctx_func *grctx = gr->func->grctx;
u32 idle_timeout;
nvkm_mc_unk260(device, 0);
if (!gr->sw_ctx) {
gf100_gr_mmio(gr, grctx->hub);
gf100_gr_mmio(gr, grctx->gpc_0);
gf100_gr_mmio(gr, grctx->zcull);
gf100_gr_mmio(gr, grctx->gpc_1);
gf100_gr_mmio(gr, grctx->tpc);
gf100_gr_mmio(gr, grctx->ppc);
} else {
gf100_gr_mmio(gr, gr->sw_ctx);
}
gf100_gr_wait_idle(gr);
idle_timeout = nvkm_mask(device, 0x404154, 0xffffffff, 0x00000000);
grctx->pagepool(info);
grctx->bundle(info);
grctx->attrib(info);
if (grctx->patch_ltc)
grctx->patch_ltc(info);
grctx->unkn(gr);
gf100_grctx_generate_floorsweep(gr);
gf100_gr_wait_idle(gr);
if (grctx->r400088) grctx->r400088(gr, false);
if (gr->bundle)
gf100_gr_icmd(gr, gr->bundle);
else
gf100_gr_icmd(gr, grctx->icmd);
if (grctx->sw_veid_bundle_init)
gf100_gr_icmd(gr, grctx->sw_veid_bundle_init);
if (grctx->r400088) grctx->r400088(gr, true);
nvkm_wr32(device, 0x404154, idle_timeout);
if (gr->method)
gf100_gr_mthd(gr, gr->method);
else
gf100_gr_mthd(gr, grctx->mthd);
nvkm_mc_unk260(device, 1);
if (grctx->r419cb8)
grctx->r419cb8(gr);
if (grctx->r418800)
grctx->r418800(gr);
if (grctx->r419eb0)
grctx->r419eb0(gr);
if (grctx->r419e00)
grctx->r419e00(gr);
if (grctx->r418e94)
grctx->r418e94(gr);
if (grctx->r419a3c)
grctx->r419a3c(gr);
if (grctx->r408840)
grctx->r408840(gr);
if (grctx->r419c0c)
grctx->r419c0c(gr);
}
#define CB_RESERVED 0x80000
int
gf100_grctx_generate(struct gf100_gr *gr)
{
const struct gf100_grctx_func *grctx = gr->func->grctx;
struct nvkm_subdev *subdev = &gr->base.engine.subdev;
struct nvkm_device *device = subdev->device;
struct nvkm_memory *inst = NULL;
struct nvkm_memory *data = NULL;
struct nvkm_vmm *vmm = NULL;
struct nvkm_vma *ctx = NULL;
struct gf100_grctx info;
int ret, i;
u64 addr;
/* NV_PGRAPH_FE_PWR_MODE_FORCE_ON. */
nvkm_wr32(device, 0x404170, 0x00000012);
nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x404170) & 0x00000010))
break;
);
if (grctx->unkn88c)
grctx->unkn88c(gr, true);
/* Reset FECS. */
nvkm_wr32(device, 0x409614, 0x00000070);
nvkm_usec(device, 10, NVKM_DELAY);
nvkm_mask(device, 0x409614, 0x00000700, 0x00000700);
nvkm_usec(device, 10, NVKM_DELAY);
nvkm_rd32(device, 0x409614);
if (grctx->unkn88c)
grctx->unkn88c(gr, false);
/* NV_PGRAPH_FE_PWR_MODE_AUTO. */
nvkm_wr32(device, 0x404170, 0x00000010);
/* Init SCC RAM. */
nvkm_wr32(device, 0x40802c, 0x00000001);
/* Allocate memory to for a "channel", which we'll use to generate
* the default context values.
*/
ret = nvkm_memory_new(device, NVKM_MEM_TARGET_INST,
0x1000, 0x1000, true, &inst);
if (ret)
goto done;
ret = nvkm_vmm_new(device, 0, 0, NULL, 0, NULL, "grctx", &vmm);
if (ret)
goto done;
vmm->debug = subdev->debug;
ret = nvkm_vmm_join(vmm, inst);
if (ret)
goto done;
ret = nvkm_memory_new(device, NVKM_MEM_TARGET_INST,
CB_RESERVED + gr->size, 0, true, &data);
if (ret)
goto done;
ret = nvkm_vmm_get(vmm, 0, nvkm_memory_size(data), &ctx);
if (ret)
goto done;
ret = nvkm_memory_map(data, 0, vmm, ctx, NULL, 0);
if (ret)
goto done;
/* Setup context pointer. */
nvkm_kmap(inst);
nvkm_wo32(inst, 0x0210, lower_32_bits(ctx->addr + CB_RESERVED) | 4);
nvkm_wo32(inst, 0x0214, upper_32_bits(ctx->addr + CB_RESERVED));
nvkm_done(inst);
/* Setup default state for mmio list construction. */
info.gr = gr;
info.data = gr->mmio_data;
info.mmio = gr->mmio_list;
info.addr = ctx->addr;
info.buffer_nr = 0;
/* Make channel current. */
addr = nvkm_memory_addr(inst) >> 12;
if (gr->firmware) {
ret = gf100_gr_fecs_bind_pointer(gr, 0x80000000 | addr);
if (ret)
goto done;
nvkm_kmap(data);
nvkm_wo32(data, 0x1c, 1);
nvkm_wo32(data, 0x20, 0);
nvkm_wo32(data, 0x28, 0);
nvkm_wo32(data, 0x2c, 0);
nvkm_done(data);
} else {
nvkm_wr32(device, 0x409840, 0x80000000);
nvkm_wr32(device, 0x409500, 0x80000000 | addr);
nvkm_wr32(device, 0x409504, 0x00000001);
nvkm_msec(device, 2000,
if (nvkm_rd32(device, 0x409800) & 0x80000000)
break;
);
}
grctx->main(gr, &info);
/* Trigger a context unload by unsetting the "next channel valid" bit
* and faking a context switch interrupt.
*/
nvkm_mask(device, 0x409b04, 0x80000000, 0x00000000);
nvkm_wr32(device, 0x409000, 0x00000100);
if (nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x409b00) & 0x80000000))
break;
) < 0) {
ret = -EBUSY;
goto done;
}
gr->data = kmalloc(gr->size, GFP_KERNEL);
if (gr->data) {
nvkm_kmap(data);
for (i = 0; i < gr->size; i += 4)
gr->data[i / 4] = nvkm_ro32(data, CB_RESERVED + i);
nvkm_done(data);
ret = 0;
} else {
ret = -ENOMEM;
}
done:
nvkm_vmm_put(vmm, &ctx);
nvkm_memory_unref(&data);
nvkm_vmm_part(vmm, inst);
nvkm_vmm_unref(&vmm);
nvkm_memory_unref(&inst);
return ret;
}
const struct gf100_grctx_func
gf100_grctx = {
.main = gf100_grctx_generate_main,
.unkn = gf100_grctx_generate_unkn,
.hub = gf100_grctx_pack_hub,
.gpc_0 = gf100_grctx_pack_gpc_0,
.gpc_1 = gf100_grctx_pack_gpc_1,
.zcull = gf100_grctx_pack_zcull,
.tpc = gf100_grctx_pack_tpc,
.icmd = gf100_grctx_pack_icmd,
.mthd = gf100_grctx_pack_mthd,
.bundle = gf100_grctx_generate_bundle,
.bundle_size = 0x1800,
.pagepool = gf100_grctx_generate_pagepool,
.pagepool_size = 0x8000,
.attrib = gf100_grctx_generate_attrib,
.attrib_nr_max = 0x324,
.attrib_nr = 0x218,
.sm_id = gf100_grctx_generate_sm_id,
.tpc_nr = gf100_grctx_generate_tpc_nr,
.r4060a8 = gf100_grctx_generate_r4060a8,
.rop_mapping = gf100_grctx_generate_rop_mapping,
.alpha_beta_tables = gf100_grctx_generate_alpha_beta_tables,
.max_ways_evict = gf100_grctx_generate_max_ways_evict,
.r419cb8 = gf100_grctx_generate_r419cb8,
};
| {
"pile_set_name": "Github"
} |
using System.Threading.Tasks;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Display.ContentDisplay;
using OrchardCore.ContentManagement.Display.ViewModels;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.Deployment;
using OrchardCore.DisplayManagement.Views;
namespace OrchardCore.Contents.Deployment.AddToDeploymentPlan
{
public class AddToDeploymentPlanContentDriver : ContentDisplayDriver
{
private readonly IDeploymentPlanService _deploymentPlanService;
public AddToDeploymentPlanContentDriver(IDeploymentPlanService deploymentPlanService)
{
_deploymentPlanService = deploymentPlanService;
}
public override async Task<IDisplayResult> DisplayAsync(ContentItem model, BuildDisplayContext context)
{
if (await _deploymentPlanService.DoesUserHavePermissionsAsync())
{
return Combine(
Dynamic("AddToDeploymentPlan_Modal__ActionDeploymentPlan").Location("SummaryAdmin", "ActionsMenu:30"),
Shape("AddToDeploymentPlan_SummaryAdmin__Button__Actions", new ContentItemViewModel(model)).Location("SummaryAdmin", "ActionsMenu:30")
);
}
return null;
}
}
}
| {
"pile_set_name": "Github"
} |
<?php
namespace Alchemy\Phrasea\SearchEngine\Elastic\Structure;
interface Typed
{
/**
* Get the type of the object
*
* @return string One of Mapping::TYPE_* constants
*/
public function getType();
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
BuildableName = "16.Quake3MapShader.app"
BlueprintName = "16.Quake3MapShader"
ReferencedContainer = "container:Quake3MapShader.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
BuildableName = "16.Quake3MapShader.app"
BlueprintName = "16.Quake3MapShader"
ReferencedContainer = "container:Quake3MapShader.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
BuildableName = "16.Quake3MapShader.app"
BlueprintName = "16.Quake3MapShader"
ReferencedContainer = "container:Quake3MapShader.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
BuildableName = "16.Quake3MapShader.app"
BlueprintName = "16.Quake3MapShader"
ReferencedContainer = "container:Quake3MapShader.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
| {
"pile_set_name": "Github"
} |
main: ./cmd
runtime: go112 # replace with go111 for Go 1.11
| {
"pile_set_name": "Github"
} |
#include <assert.h>
#include <stdio.h>
extern int userfunc1(int x);
extern int userfunc2(int x);
int main(int argc, char **argv) {
// The order these are opened is very important. It must match the
// manager.
FILE *in = fopen(argv[1], "r");
FILE *out = fopen(argv[2], "w");
setvbuf(out, NULL, _IONBF, 0);
while (1) {
int n;
int ret = fscanf(in, "%d", &n);
assert(ret == 1);
if (n == 0)
break;
if(argv[3][0] == '0')
fprintf(out, "correct %d\n", userfunc1(n));
else
fprintf(out, "correct %d\n", userfunc2(n));
}
return 0;
}
| {
"pile_set_name": "Github"
} |
require 'abstract_unit'
class ConnectionTest < Test::Unit::TestCase
ResponseCodeStub = Struct.new(:code)
def setup
@conn = ActiveResource::Connection.new('http://localhost')
@matz = { :id => 1, :name => 'Matz' }
@david = { :id => 2, :name => 'David' }
@people = [ @matz, @david ].to_xml(:root => 'people')
@people_single = [ @matz ].to_xml(:root => 'people-single-elements')
@people_empty = [ ].to_xml(:root => 'people-empty-elements')
@matz = @matz.to_xml(:root => 'person')
@david = @david.to_xml(:root => 'person')
@header = {'key' => 'value'}.freeze
@default_request_headers = { 'Content-Type' => 'application/xml' }
ActiveResource::HttpMock.respond_to do |mock|
mock.get "/people/2.xml", @header, @david
mock.get "/people.xml", {}, @people
mock.get "/people_single_elements.xml", {}, @people_single
mock.get "/people_empty_elements.xml", {}, @people_empty
mock.get "/people/1.xml", {}, @matz
mock.put "/people/1.xml", {}, nil, 204
mock.put "/people/2.xml", {}, @header, 204
mock.delete "/people/1.xml", {}, nil, 200
mock.delete "/people/2.xml", @header, nil, 200
mock.post "/people.xml", {}, nil, 201, 'Location' => '/people/5.xml'
mock.post "/members.xml", {}, @header, 201, 'Location' => '/people/6.xml'
mock.head "/people/1.xml", {}, nil, 200
end
end
def test_handle_response
# 2xx and 3xx are valid responses.
[200, 299, 300, 399].each do |code|
expected = ResponseCodeStub.new(code)
assert_equal expected, handle_response(expected)
end
# 400 is a bad request (e.g. malformed URI or missing request parameter)
assert_response_raises ActiveResource::BadRequest, 400
# 401 is an unauthorized request
assert_response_raises ActiveResource::UnauthorizedAccess, 401
# 403 is a forbidden requst (and authorizing will not help)
assert_response_raises ActiveResource::ForbiddenAccess, 403
# 404 is a missing resource.
assert_response_raises ActiveResource::ResourceNotFound, 404
# 405 is a missing not allowed error
assert_response_raises ActiveResource::MethodNotAllowed, 405
# 409 is an optimistic locking error
assert_response_raises ActiveResource::ResourceConflict, 409
# 422 is a validation error
assert_response_raises ActiveResource::ResourceInvalid, 422
# 4xx are client errors.
[402, 499].each do |code|
assert_response_raises ActiveResource::ClientError, code
end
# 5xx are server errors.
[500, 599].each do |code|
assert_response_raises ActiveResource::ServerError, code
end
# Others are unknown.
[199, 600].each do |code|
assert_response_raises ActiveResource::ConnectionError, code
end
end
ResponseHeaderStub = Struct.new(:code, :message, 'Allow')
def test_should_return_allowed_methods_for_method_no_allowed_exception
begin
handle_response ResponseHeaderStub.new(405, "HTTP Failed...", "GET, POST")
rescue ActiveResource::MethodNotAllowed => e
assert_equal "Failed with 405 HTTP Failed...", e.message
assert_equal [:get, :post], e.allowed_methods
end
end
def test_initialize_raises_argument_error_on_missing_site
assert_raise(ArgumentError) { ActiveResource::Connection.new(nil) }
end
def test_site_accessor_accepts_uri_or_string_argument
site = URI.parse("http://localhost")
assert_raise(URI::InvalidURIError) { @conn.site = nil }
assert_nothing_raised { @conn.site = "http://localhost" }
assert_equal site, @conn.site
assert_nothing_raised { @conn.site = site }
assert_equal site, @conn.site
end
def test_timeout_accessor
@conn.timeout = 5
assert_equal 5, @conn.timeout
end
def test_get
matz = @conn.get("/people/1.xml")
assert_equal "Matz", matz["name"]
end
def test_head
response = @conn.head("/people/1.xml")
assert response.body.blank?
assert_equal 200, response.code
end
def test_get_with_header
david = @conn.get("/people/2.xml", @header)
assert_equal "David", david["name"]
end
def test_get_collection
people = @conn.get("/people.xml")
assert_equal "Matz", people[0]["name"]
assert_equal "David", people[1]["name"]
end
def test_get_collection_single
people = @conn.get("/people_single_elements.xml")
assert_equal "Matz", people[0]["name"]
end
def test_get_collection_empty
people = @conn.get("/people_empty_elements.xml")
assert_equal [], people
end
def test_post
response = @conn.post("/people.xml")
assert_equal "/people/5.xml", response["Location"]
end
def test_post_with_header
response = @conn.post("/members.xml", @header)
assert_equal "/people/6.xml", response["Location"]
end
def test_put
response = @conn.put("/people/1.xml")
assert_equal 204, response.code
end
def test_put_with_header
response = @conn.put("/people/2.xml", @header)
assert_equal 204, response.code
end
def test_delete
response = @conn.delete("/people/1.xml")
assert_equal 200, response.code
end
def test_delete_with_header
response = @conn.delete("/people/2.xml", @header)
assert_equal 200, response.code
end
uses_mocha('test_timeout, test_accept_http_header') do
def test_timeout
@http = mock('new Net::HTTP')
@conn.expects(:http).returns(@http)
@http.expects(:get).raises(Timeout::Error, 'execution expired')
assert_raise(ActiveResource::TimeoutError) { @conn.get('/people_timeout.xml') }
end
def test_accept_http_header
@http = mock('new Net::HTTP')
@conn.expects(:http).returns(@http)
path = '/people/1.xml'
@http.expects(:get).with(path, {'Accept' => 'application/xhtml+xml'}).returns(ActiveResource::Response.new(@matz, 200, {'Content-Type' => 'text/xhtml'}))
assert_nothing_raised(Mocha::ExpectationError) { @conn.get(path, {'Accept' => 'application/xhtml+xml'}) }
end
end
protected
def assert_response_raises(klass, code)
assert_raise(klass, "Expected response code #{code} to raise #{klass}") do
handle_response ResponseCodeStub.new(code)
end
end
def handle_response(response)
@conn.__send__(:handle_response, response)
end
end
| {
"pile_set_name": "Github"
} |
{************************************
******* Submit Extra Fields ********
*************************************}
<!-- submit_extra_fields.tpl -->
{if $Enable_Extra_Field_1 eq 1}
<p><label>{$Field_1_Title}:</label>{$Field_1_Instructions}<br />
<input type="text" name="link_field1" class="form-control" id="link_field1" value="{$submit_link_field1}" size="60" />
</p>
{/if}
{if $Enable_Extra_Field_2 eq 1}
<p><label>{$Field_2_Title}:</label>{$Field_2_Instructions}<br />
<input type="text" name="link_field2" class="form-control" id="link_field2" value="{$submit_link_field2}" size="60"/>
</p>
{/if}
{if $Enable_Extra_Field_3 eq 1}
<p><label>{$Field_3_Title}:</label>{$Field_3_Instructions}<br />
<input type="text" name="link_field3" class="form-control" id="link_field3" value="{$submit_link_field3}" size="60"/>
</p>
{/if}
{if $Enable_Extra_Field_4 eq 1}
<p><label>{$Field_4_Title}:</label>{$Field_4_Instructions}<br />
<input type="text" name="link_field4" class="form-control" id="link_field4" value="{$submit_link_field4}" size="60"/>
</p>
{/if}
{if $Enable_Extra_Field_5 eq 1}
<p><label for="trackback">{$Field_5_Title}:</label>{$Field_5_Instructions}<br />
<input type="text" name="link_field5" class="form-control" id="link_field5" value="{$submit_link_field5}" size="60"/>
</p>
{/if}
{if $Enable_Extra_Field_6 eq 1}
<p><label for="trackback">{$Field_6_Title}:</label>{$Field_6_Instructions}<br />
<input type="text" name="link_field6" class="form-control" id="link_field6" value="{$submit_link_field6}" size="60"/>
</p>
{/if}
{if $Enable_Extra_Field_7 eq 1}
<p><label for="trackback">{$Field_7_Title}:</label>{$Field_7_Instructions}<br />
<input type="text" name="link_field7" class="form-control" id="link_field7" value="{$submit_link_field7}" size="60"/>
</p>
{/if}
{if $Enable_Extra_Field_8 eq 1}
<p><label for="trackback">{$Field_8_Title}:</label>{$Field_8_Instructions}<br />
<input type="text" name="link_field8" class="form-control" id="link_field8" value="{$submit_link_field8}" size="60"/>
</p>
{/if}
{if $Enable_Extra_Field_9 eq 1}
<p><label for="trackback">{$Field_9_Title}:</label>{$Field_9_Instructions}<br />
<input type="text" name="link_field9" class="form-control" id="link_field9" value="{$submit_link_field9}" size="60"/>
</p>
{/if}
{if $Enable_Extra_Field_10 eq 1}
<p><label for="trackback">{$Field_10_Title}:</label>{$Field_10_Instructions}<br />
<input type="text" name="link_field10" class="form-control" id="link_field10" value="{$submit_link_field10}" size="60"/>
</p>
{/if}
{if $Enable_Extra_Field_11 eq 1}
<p><label for="trackback">{$Field_11_Title}:</label>{$Field_11_Instructions}<br />
<input type="text" name="link_field11" class="form-control" id="link_field11" value="{$submit_link_field11}" size="60"/>
</p>
{/if}
{if $Enable_Extra_Field_12 eq 1}
<p><label for="trackback">{$Field_12_Title}:</label>{$Field_12_Instructions}<br />
<input type="text" name="link_field12" class="form-control" id="link_field12" value="{$submit_link_field12}" size="60"/>
</p>
{/if}
{if $Enable_Extra_Field_13 eq 1}
<p><label for="trackback">{$Field_13_Title}:</label>{$Field_13_Instructions}</span><br />
<input type="text" name="link_field13" class="form-control" id="link_field13" value="{$submit_link_field13}" size="60"/>
</p>
{/if}
{if $Enable_Extra_Field_14 eq 1}
<p><label for="trackback">{$Field_14_Title}:</label>{$Field_14_Instructions}<br />
<input type="text" name="link_field14" class="form-control" id="link_field14" value="{$submit_link_field14}" size="60"/>
</p>
{/if}
{if $Enable_Extra_Field_15 eq 1}
<p><label for="trackback">{$Field_15_Title}:</label>{$Field_15_Instructions}<br />
<input type="text" name="link_field15" class="form-control" id="link_field15" value="{$submit_link_field15}" size="60"/>
</p>
{/if}
<!--/submit_extra_fields.tpl --> | {
"pile_set_name": "Github"
} |
const babel = require('rollup-plugin-babel');
const commonjs = require('rollup-plugin-commonjs');
const nodeResolve = require('rollup-plugin-node-resolve');
module.exports = {
entry: 'src/js/index.js',
targets: [
{
dest: 'dist/cropper.js',
},
{
dest: 'dist/cropper.common.js',
format: 'cjs',
},
{
dest: 'dist/cropper.esm.js',
format: 'es',
},
{
dest: 'docs/js/cropper.js',
},
],
format: 'umd',
moduleName: 'Cropper',
external: ['jquery'],
globals: {
jquery: 'jQuery',
},
plugins: [
commonjs(),
nodeResolve({
jsnext: true,
}),
babel({
exclude: '/node_modules/**',
}),
],
};
| {
"pile_set_name": "Github"
} |
/*
Copyright 2014 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 watch
import (
"io"
"sync"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/net"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/klog"
)
// Decoder allows StreamWatcher to watch any stream for which a Decoder can be written.
type Decoder interface {
// Decode should return the type of event, the decoded object, or an error.
// An error will cause StreamWatcher to call Close(). Decode should block until
// it has data or an error occurs.
Decode() (action EventType, object runtime.Object, err error)
// Close should close the underlying io.Reader, signalling to the source of
// the stream that it is no longer being watched. Close() must cause any
// outstanding call to Decode() to return with an error of some sort.
Close()
}
// StreamWatcher turns any stream for which you can write a Decoder interface
// into a watch.Interface.
type StreamWatcher struct {
sync.Mutex
source Decoder
result chan Event
stopped bool
}
// NewStreamWatcher creates a StreamWatcher from the given decoder.
func NewStreamWatcher(d Decoder) *StreamWatcher {
sw := &StreamWatcher{
source: d,
// It's easy for a consumer to add buffering via an extra
// goroutine/channel, but impossible for them to remove it,
// so nonbuffered is better.
result: make(chan Event),
}
go sw.receive()
return sw
}
// ResultChan implements Interface.
func (sw *StreamWatcher) ResultChan() <-chan Event {
return sw.result
}
// Stop implements Interface.
func (sw *StreamWatcher) Stop() {
// Call Close() exactly once by locking and setting a flag.
sw.Lock()
defer sw.Unlock()
if !sw.stopped {
sw.stopped = true
sw.source.Close()
}
}
// stopping returns true if Stop() was called previously.
func (sw *StreamWatcher) stopping() bool {
sw.Lock()
defer sw.Unlock()
return sw.stopped
}
// receive reads result from the decoder in a loop and sends down the result channel.
func (sw *StreamWatcher) receive() {
defer close(sw.result)
defer sw.Stop()
defer utilruntime.HandleCrash()
for {
action, obj, err := sw.source.Decode()
if err != nil {
// Ignore expected error.
if sw.stopping() {
return
}
switch err {
case io.EOF:
// watch closed normally
case io.ErrUnexpectedEOF:
klog.V(1).Infof("Unexpected EOF during watch stream event decoding: %v", err)
default:
msg := "Unable to decode an event from the watch stream: %v"
if net.IsProbableEOF(err) {
klog.V(5).Infof(msg, err)
} else {
klog.Errorf(msg, err)
}
}
return
}
sw.result <- Event{
Type: action,
Object: obj,
}
}
}
| {
"pile_set_name": "Github"
} |
require 'xmpp4r'
require 'oauth/request_proxy/base'
module OAuth
module RequestProxy
class JabberRequest < OAuth::RequestProxy::Base
proxies Jabber::Iq
proxies Jabber::Presence
proxies Jabber::Message
def parameters
return @params if @params
@params = {}
oauth = @request.get_elements('//oauth').first
return @params unless oauth
%w( oauth_token oauth_consumer_key oauth_signature_method oauth_signature
oauth_timestamp oauth_nonce oauth_version ).each do |param|
next unless element = oauth.first_element(param)
@params[param] = element.text
end
@params
end
def method
@request.name
end
def uri
[@request.from.strip.to_s, @request.to.strip.to_s].join("&")
end
def normalized_uri
uri
end
end
end
end
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2015-2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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.hawkular.apm.api.model;
/**
* This class provides constant definitions.
*
* @author gbrown
*/
public class Constants {
private Constants() {}
/**
* Where trace activity begins within a client application, with the
* invocation of a URI, any information derived from that activity
* needs to be distinguished from the data derived from the server
* trace fragment which is also associated with the same URI. Therefore
* this constant defines a prefix that should be added to the URI when
* deriving information about the client activity.
*/
public static final String URI_CLIENT_PREFIX = "client:";
/**
* Property key representing the service name
* {@link org.hawkular.apm.api.model.Property#name}
*/
public static final String PROP_SERVICE_NAME = "service";
/**
* Property key representing the build stamp, like a build serial number
* {@link org.hawkular.apm.api.model.Property#name}
*/
public static final String PROP_BUILD_STAMP = "buildStamp";
/**
* Property key representing the transaction name
* {@link org.hawkular.apm.api.model.Property#name}
*/
public static final String PROP_TRANSACTION_NAME = "transaction";
/**
* Property key representing the principal
* {@link org.hawkular.apm.api.model.Property#name}
*/
public static final String PROP_PRINCIPAL = "principal";
/**
* Property key representing the fault. A 'fault' will represent
* the non-normal result of a call to a business service. For example,
* if requesting a user's account, then a fault may be "Account Not Found".
* Communication protocol errors will be recorded in protocol specific
* tags, such as "http.status_code".
* {@link org.hawkular.apm.api.model.Property#name}
*/
public static final String PROP_FAULT = "fault";
/**
* Property key representing the database statement
* {@link org.hawkular.apm.api.model.Property#name}
*/
public static final String PROP_DATABASE_STATEMENT = "database.statement";
/**
* Property key representing the HTTP query string
* {@link org.hawkular.apm.api.model.Property#name}
*/
public static final String PROP_HTTP_QUERY = "http.query";
/**
* Property key representing the HTTP URL template string
* {@link org.hawkular.apm.api.model.Property#name}
*/
public static final String PROP_HTTP_URL_TEMPLATE = "http.url_template";
/**
* Represents database component type of
* {@link org.hawkular.apm.api.model.trace.Component#componentType}
*/
public static final String COMPONENT_DATABASE = "Database";
/**
* Represents EJB component type of
* {@link org.hawkular.apm.api.model.trace.Component#componentType}
*/
public static final String COMPONENT_EJB = "EJB";
/**
* This constant represents the prefix used by all Hawkular APM state transferred between
* communication services.
*/
public static final String HAWKULAR_APM_PREFIX = "HWKAPM";
/**
* This constant represents the interaction id transferred between a sender and receiver
* usually as a header property on the exchanged message.
*/
public static final String HAWKULAR_APM_ID = HAWKULAR_APM_PREFIX + "ID";
/**
* This constant represents the trace id transferred between a sender and receiver
* usually as a header property on the exchanged message.
*/
public static final String HAWKULAR_APM_TRACEID = HAWKULAR_APM_PREFIX + "TRACEID";
/**
* This constant represents the transaction name transferred between a sender and receiver
* usually as a header property on the exchanged message.
*/
public static final String HAWKULAR_APM_TXN = HAWKULAR_APM_PREFIX + "TXN";
/**
* This constant represents the reporting level transferred between a sender and receiver
* usually as a header property on the exchanged message.
*/
public static final String HAWKULAR_APM_LEVEL = HAWKULAR_APM_PREFIX + "LEVEL";
/**
* Binary annotation key for HTTP URL.
*
* The entire URL, including the scheme, host and query parameters if available. See zipkinCoreConstants.
*/
public static final String ZIPKIN_BIN_ANNOTATION_HTTP_URL = "http.url";
/**
* Binary annotation key for HTTP URL path.
*
* The absolute http path, without any query parameters. Ex. "/objects/abcd-ff"
* Historical note: This was commonly expressed as "http.uri" in zipkin, eventhough it was most
* often just a path. See zipkinCoreConstants.
*/
public static final String ZIPKIN_BIN_ANNOTATION_HTTP_PATH = "http.path";
/**
* Binary annotation key for HTTP URL.
*
* See @{@link Constants#ZIPKIN_BIN_ANNOTATION_HTTP_PATH}.
*
* See zipkinCoreConstants
*/
public static final String ZIPKIN_BIN_ANNOTATION_HTTP_URI = "http.uri";
/**
* The HTTP status code, when not in 2xx range. Ex. "503". See zipkinCoreConstants.
*/
public static final String ZIPKIN_BIN_ANNOTATION_HTTP_STATUS_CODE = "http.status_code";
}
| {
"pile_set_name": "Github"
} |
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\QuoteGraphQl\Model\CartItem\DataProvider;
use Magento\Catalog\Model\Product\Option;
use Magento\Quote\Model\Quote\Item as QuoteItem;
use Magento\Quote\Model\Quote\Item\Option as SelectedOption;
/**
* Customizable Option Value Data provider
*/
interface CustomizableOptionValueInterface
{
/**
* Customizable Option Value Data Provider
*
* @param QuoteItem $cartItem
* @param Option $option
* @param SelectedOption $selectedOption
* @return array
*/
public function getData(
QuoteItem $cartItem,
Option $option,
SelectedOption $selectedOption
): array;
}
| {
"pile_set_name": "Github"
} |
*** Data left in option list when processing environment ('asdf'). Exiting
| {
"pile_set_name": "Github"
} |
#!/bin/sh
#
# dex2jar - Tools to work with android .dex and java .class files
# Copyright (c) 2009-2013 Panxiaobo
#
# 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.
#
# copy from $Tomcat/bin/startup.sh
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
#
_classpath="."
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath};`cygpath -w ${k}`"
done
else
for k in "$PRGDIR"/lib/*.jar
do
_classpath="${_classpath}:${k}"
done
fi
java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.d2j.smali.BaksmaliCmd" "$@"
| {
"pile_set_name": "Github"
} |
/*
Copyright 2020 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 clusteraddons
import (
"fmt"
"net/url"
"k8s.io/klog/v2"
"k8s.io/kops/pkg/kubemanifest"
"k8s.io/kops/util/pkg/vfs"
)
type ClusterAddon struct {
Raw string
Objects kubemanifest.ObjectList
}
// LoadClusterAddon loads a set of objects from the specified VFS location
func LoadClusterAddon(location string) (*ClusterAddon, error) {
u, err := url.Parse(location)
if err != nil {
return nil, fmt.Errorf("invalid addon location: %q", location)
}
// TODO: Should we support relative paths for "standard" addons? See equivalent code in LoadChannel
resolved := u.String()
klog.V(2).Infof("Loading addon from %q", resolved)
addonBytes, err := vfs.Context.ReadFile(resolved)
if err != nil {
return nil, fmt.Errorf("error reading addon %q: %v", resolved, err)
}
addon, err := ParseClusterAddon(addonBytes)
if err != nil {
return nil, fmt.Errorf("error parsing addon %q: %v", resolved, err)
}
klog.V(4).Infof("Addon contents: %s", string(addonBytes))
return addon, nil
}
// ParseClusterAddon parses a ClusterAddon object
func ParseClusterAddon(raw []byte) (*ClusterAddon, error) {
objects, err := kubemanifest.LoadObjectsFrom(raw)
if err != nil {
return nil, fmt.Errorf("error parsing addon %v", err)
}
return &ClusterAddon{Raw: string(raw), Objects: objects}, nil
}
| {
"pile_set_name": "Github"
} |
<?php
namespace App\Repositories\Frontend\Social;
use App\Models\Auth\User;
use App\Models\Social\MediaCards;
use Illuminate\Support\Facades\DB;
use App\Repositories\BaseRepository;
use App\Exceptions\GeneralException;
/**
* Class MediaCardsRepository.
*/
class MediaCardsRepository extends BaseRepository
{
/**
* MediaCardsRepository constructor.
*
* @param MediaCards $model
*/
public function __construct(MediaCards $model)
{
$this->model = $model;
}
/**
* @param $id
*
* @throws GeneralException
* @return mixed
*/
public function findByCardId($id, $type, $connections)
{
$media = $this->model
->active()
->where('card_id', $id)
->where('social_type', $type)
->where('social_connections', $connections)
->first();
if ($media instanceof $this->model) {
return $media;
}
throw new GeneralException(__('exceptions.frontend.social.media.cards.not_found'));
}
/**
* @param array $data
*
* @throws \Exception
* @throws \Throwable
* @return MediaCards
*/
public function create(array $data) : MediaCards
{
return DB::transaction(function () use ($data) {
$media = $this->model::create([
'card_id' => $data['card_id'],
'model_type' => isset($data['model_type'])? $data['model_type'] : User::class,
'model_id' => $data['model_id'],
'social_type' => $data['social_type'],
'social_connections' => $data['social_connections'],
'social_card_id' => $data['social_card_id'],
]);
if ($media) {
// event(new MediaCardsCreated($media));
return $media;
}
throw new GeneralException(__('exceptions.frontend.social.media.cards.create_error'));
});
}
}
| {
"pile_set_name": "Github"
} |
1
292
490
588
777
965
1171
1366
1666
1834
2017
2150
2450
2635
2731
2815
2980
3244
3395
3498
3611
3710
4010
4127
4297
4437
4737
4822
5085
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 5ac626607f7db7447bb046f85cd59e4b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName: ui/login.prefab.k
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="iso-8859-1"?>
<!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>
<title>[#427826] Script source needs escaping/CDATA
section</title>
<script type="application/ecmascript">
<![CDATA[
<!--
function isLessThan()
{
var a = 2, b = 3;
if (a < b) alert("a less than b");
return ( a < b );
}
-->
]]>
</script>
<script type="text/javascript"
language='JavaScript'>
//<![CDATA[
<!--
alert("...");
//-->
//]]>
</script>
<script type="text/javascript"
language='JavaScript'>
//<![CDATA[
function loop_de_loop()
{
for ( ix=0; ix < 5; ++ix )
{
alert( "Bob's yer uncle " + ix );
}
}
//]]>
</script>
<script type="text/javascript"
language='JavaScript'>
//<![CDATA[
function round_again()
{
for ( ix=0; ix < 5; ++ix )
{
alert( "Shivver me timbers " + ix );
}
}
//]]>
</script>
</head>
<body onload="isLessThan()">
<p>If converted to XML/XHTML, the < in the javascript source
above causes problems for XML tools.</p>
</body>
</html>
| {
"pile_set_name": "Github"
} |
## XMall-Front
### 基于Vue开发的XMall商城前台页面
### [宣传视频](https://www.bilibili.com/video/av23121122/)
- 作者亲自制作 [点我观看](https://www.bilibili.com/video/av23121122/)
### 项目已部署,在线Demo
- 前台商城:http://xmall.exrick.cn/
- 后台管理系统:http://xmadmin.exrick.cn/
### 感谢 [yucccc](https://github.com/yucccc) 的开源 [vue-mall](https://github.com/yucccc/vue-mall) 项目提供前端页面及框架支持
### 后端全部重新开发接口,实现后台系统管理,后端接口项目请跳转至 [xmall](https://github.com/Exrick/xmall) 项目仓库查看
### 新增与优化
- [x] 优化页脚、增加商品搜索框组件
- [x] 优化登录注册界面
- [x] 新增搜索页面,实现高亮分页搜索
- [x] 新增捐赠页面,捐赠列表显示
- [x] 全部商品页面实现分页
- [x] 优化订单详情,实现查看订单进度,可对订单进行处理
- [x] 实现生成订单接口、优化地址管理编辑选择
- [x] 实现查看个人订单分页
- [x] 接入[XPay个人免签收款支付系统](https://github.com/Exrick/xpay)
- [x] 首页升级!重构首页,后台可配置,包括3D轮播图
- [x] 新增分类查看品牌周边等
- [极验验证码移除文档](https://github.com/Exrick/xmall/wiki/%E6%9E%81%E9%AA%8C%E7%A7%BB%E9%99%A4%E6%96%87%E6%A1%A3)








### 所用技术
- Vue 2.x
- Vuex
- Vue Router
- [Element UI](http://element.eleme.io/#/zh-CN)
- ES6
- webpack
- axios
- Node.js
- 第三方SDK
- ~~[极验Test-button人机验证码](http://www.geetest.com/Test-button.html)~~ 因其收费详见[极验验证码移除文档](https://github.com/Exrick/xmall/wiki/%E6%9E%81%E9%AA%8C%E7%A7%BB%E9%99%A4%E6%96%87%E6%A1%A3)
- 第三方插件
- [hotjar](https://github.com/Exrick/xmall/blob/master/study/hotjar.md):一体化分析和反馈
- ~~[搜狐畅言评论插件](http://changyan.kuaizhan.com/)~~ 垃圾广告评论插件 现已更换 [Gitment](https://github.com/imsun/gitment)
### 本地开发运行
- 启动后端 [xmall](https://github.com/Exrick/xmall) 项目后,在 `config/index.js` 中修改你的后端接口地址配置
- Gitment评论配置见 [Gitment](https://github.com/imsun/gitment) 使用到的页面为 `thanks.vue`
- `index.html` 中复制粘贴替换你的 [hotjar](https://github.com/Exrick/xmall/blob/master/study/hotjar.md) 代码
- 在项目根文件夹下先后执行命令 `npm install` 、 `npm run dev`
- 商城前台端口默认9999 http://localhost:9999
## 部署
- 先后执行命令 `npm install` 、 `npm run build` 将打包生成的 `dist` 静态文件放置服务器中,若使用Nginx等涉及跨域请配置路由代理
### 技术疑问交流
- QQ交流群 `475743731(付费)`,可获取各项目详细图文文档、疑问解答 [](http://shang.qq.com/wpa/qunwpa?idkey=7b60cec12ba93ebed7568b0a63f22e6e034c0d1df33125ac43ed753342ec6ce7)
- 免费交流群 `562962309` [](http://shang.qq.com/wpa/qunwpa?idkey=52f6003e230b26addeed0ba6cf343fcf3ba5d97829d17f5b8fa5b151dba7e842)
- 个人博客:[http://blog.exrick.cn](http://blog.exrick.cn)
### 开源协议
- 请遵循原作者MIT开源协议
### 作者其他项目推荐
- [XMall微信小程序APP前端 现已开源!](https://github.com/Exrick/xmall-weapp)
[![[email protected]](https://s2.ax1x.com/2019/10/06/ucEsBD.md.png)](https://www.bilibili.com/video/av70226175)
- [X-Boot前后端分离开发平台](https://github.com/Exrick/x-boot)

- [XPay个人免签收款支付系统](https://github.com/Exrick/xpay) 无需挂机App 自动回调
- 个人机器学习笔记
- [Machine-Learning](https://github.com/Exrick/Machine-Learning)
### [捐赠](http://xmall.exrick.cn)
| {
"pile_set_name": "Github"
} |
#
# Mellanox driver configuration
#
config MLX4_EN
tristate "Mellanox Technologies 1/10/40Gbit Ethernet support"
depends on MAY_USE_DEVLINK
depends on PCI
select MLX4_CORE
imply PTP_1588_CLOCK
---help---
This driver supports Mellanox Technologies ConnectX Ethernet
devices.
config MLX4_EN_DCB
bool "Data Center Bridging (DCB) Support"
default y
depends on MLX4_EN && DCB
---help---
Say Y here if you want to use Data Center Bridging (DCB) in the
driver.
If set to N, will not be able to configure QoS and ratelimit attributes.
This flag is depended on the kernel's DCB support.
If unsure, set to Y
config MLX4_CORE
tristate
depends on PCI
default n
config MLX4_DEBUG
bool "Verbose debugging output" if (MLX4_CORE && EXPERT)
depends on MLX4_CORE
default y
---help---
This option causes debugging code to be compiled into the
mlx4_core driver. The output can be turned on via the
debug_level module parameter (which can also be set after
the driver is loaded through sysfs).
config MLX4_CORE_GEN2
bool "Support for old gen2 Mellanox PCI IDs" if (MLX4_CORE)
depends on MLX4_CORE
default y
---help---
Say Y here if you want to use old gen2 Mellanox devices in the
driver.
| {
"pile_set_name": "Github"
} |
#define ASI_PNF 0x82
#define ASI_BLK_P 0xf0
#define XCC icc
#include <sparc64/strspn.S>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2020 Grakn Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
package grakn.core.graql.reasoner.atom.task.convert;
import grakn.core.graql.reasoner.ReasoningContext;
import grakn.core.graql.reasoner.atom.binary.IsaAtom;
import grakn.core.graql.reasoner.atom.binary.RelationAtom;
public class RelationAtomConverter implements AtomConverter<RelationAtom> {
@Override
public IsaAtom toIsaAtom(RelationAtom atom, ReasoningContext ctx) {
return atom.isaAtom();
}
}
| {
"pile_set_name": "Github"
} |
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2017, Image Engine Design Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * 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 John Haddon nor the names of
// any other contributors to this software may be used to endorse or
// promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////
#include "GafferUI/NoduleLayout.h"
#include "GafferUI/PlugAdder.h"
#include "GafferUI/StandardNodeGadget.h"
#include "Gaffer/Box.h"
#include "Gaffer/BoxIn.h"
#include "Gaffer/BoxOut.h"
#include "Gaffer/ScriptNode.h"
#include "Gaffer/UndoScope.h"
#include "boost/bind.hpp"
using namespace IECore;
using namespace Gaffer;
using namespace GafferUI;
namespace
{
class BoxPlugAdder : public PlugAdder
{
public :
BoxPlugAdder( BoxPtr box )
: m_box( box )
{
}
protected :
bool canCreateConnection( const Plug *endpoint ) const override
{
if( !PlugAdder::canCreateConnection( endpoint ) )
{
return false;
}
if( endpoint->node() == m_box )
{
return false;
}
return true;
}
void createConnection( Plug *endpoint ) override
{
BoxIOPtr boxIO;
if( endpoint->direction() == Plug::In )
{
boxIO = new BoxOut;
}
else
{
boxIO = new BoxIn;
}
m_box->addChild( boxIO );
boxIO->setup( endpoint );
if( endpoint->direction() == Plug::In )
{
endpoint->setInput( boxIO->promotedPlug() );
}
else
{
boxIO->promotedPlug()->setInput( endpoint );
}
applyEdgeMetadata( boxIO->promotedPlug() );
applyEdgeMetadata( boxIO->plug(), /* opposite = */ true );
}
private :
BoxPtr m_box;
};
struct Registration
{
Registration()
{
NoduleLayout::registerCustomGadget( "GafferUI.BoxUI.PlugAdder", boost::bind( &create, ::_1 ) );
}
private :
static GadgetPtr create( GraphComponentPtr parent )
{
if( BoxPtr box = runTimeCast<Box>( parent ) )
{
return new BoxPlugAdder( box );
}
throw IECore::Exception( "Expected a Box" );
}
};
Registration g_registration;
} // namespace
| {
"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 bandwidth
import (
"fmt"
"k8s.io/apimachinery/pkg/api/resource"
)
var minRsrc = resource.MustParse("1k")
var maxRsrc = resource.MustParse("1P")
func validateBandwidthIsReasonable(rsrc *resource.Quantity) error {
if rsrc.Value() < minRsrc.Value() {
return fmt.Errorf("resource is unreasonably small (< 1kbit)")
}
if rsrc.Value() > maxRsrc.Value() {
return fmt.Errorf("resoruce is unreasonably large (> 1Pbit)")
}
return nil
}
func ExtractPodBandwidthResources(podAnnotations map[string]string) (ingress, egress *resource.Quantity, err error) {
if podAnnotations == nil {
return nil, nil, nil
}
str, found := podAnnotations["kubernetes.io/ingress-bandwidth"]
if found {
ingressValue, err := resource.ParseQuantity(str)
if err != nil {
return nil, nil, err
}
ingress = &ingressValue
if err := validateBandwidthIsReasonable(ingress); err != nil {
return nil, nil, err
}
}
str, found = podAnnotations["kubernetes.io/egress-bandwidth"]
if found {
egressValue, err := resource.ParseQuantity(str)
if err != nil {
return nil, nil, err
}
egress = &egressValue
if err := validateBandwidthIsReasonable(egress); err != nil {
return nil, nil, err
}
}
return ingress, egress, nil
}
| {
"pile_set_name": "Github"
} |
[[script-processor]]
=== Script Processor
Allows inline and stored scripts to be executed within ingest pipelines.
See <<modules-scripting-using, How to use scripts>> to learn more about writing scripts. The Script Processor
leverages caching of compiled scripts for improved performance. Since the
script specified within the processor is potentially re-compiled per document, it is important
to understand how script caching works. To learn more about
caching see <<modules-scripting-using-caching, Script Caching>>.
[[script-options]]
.Script Options
[options="header"]
|======
| Name | Required | Default | Description
| `lang` | no | "painless" | The scripting language
| `id` | no | - | The stored script id to refer to
| `source` | no | - | An inline script to be executed
| `params` | no | - | Script Parameters
include::common-options.asciidoc[]
|======
One of `id` or `source` options must be provided in order to properly reference a script to execute.
You can access the current ingest document from within the script context by using the `ctx` variable.
The following example sets a new field called `field_a_plus_b_times_c` to be the sum of two existing
numeric fields `field_a` and `field_b` multiplied by the parameter param_c:
[source,js]
--------------------------------------------------
{
"script": {
"lang": "painless",
"source": "ctx.field_a_plus_b_times_c = (ctx.field_a + ctx.field_b) * params.param_c",
"params": {
"param_c": 10
}
}
}
--------------------------------------------------
// NOTCONSOLE
It is possible to use the Script Processor to manipulate document metadata like `_index` and `_type` during
ingestion. Here is an example of an Ingest Pipeline that renames the index and type to `my_index` no matter what
was provided in the original index request:
[source,js]
--------------------------------------------------
PUT _ingest/pipeline/my_index
{
"description": "use index:my_index and type:_doc",
"processors": [
{
"script": {
"source": """
ctx._index = 'my_index';
ctx._type = '_doc';
"""
}
}
]
}
--------------------------------------------------
// CONSOLE
Using the above pipeline, we can attempt to index a document into the `any_index` index.
[source,js]
--------------------------------------------------
PUT any_index/_doc/1?pipeline=my_index
{
"message": "text"
}
--------------------------------------------------
// CONSOLE
// TEST[continued]
The response from the above index request:
[source,js]
--------------------------------------------------
{
"_index": "my_index",
"_type": "_doc",
"_id": "1",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"_seq_no": 89,
"_primary_term": 1,
}
--------------------------------------------------
// TESTRESPONSE[s/"_seq_no": \d+/"_seq_no" : $body._seq_no/ s/"_primary_term" : 1/"_primary_term" : $body._primary_term/]
In the above response, you can see that our document was actually indexed into `my_index` instead of
`any_index`. This type of manipulation is often convenient in pipelines that have various branches of transformation,
and depending on the progress made, indexed into different indices.
[[set-processor]]
=== Set Processor
Sets one field and associates it with the specified value. If the field already exists,
its value will be replaced with the provided one.
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: abaf2020b803b6847b5c081ed22c05c5
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
/*
Uniform Theme: Uniform Default
Version: 1.8
By: Josh Pyles
License: MIT License
---
For use with the Uniform plugin:
http://uniformjs.com/
*/
/* General settings */
div.selector, div.selector span, div.checker span, div.radio span, div.uploader, div.uploader span.action, div.button, div.button span {
background-image: url("../../img/uniform/sprite.png");
background-repeat: no-repeat;
-webkit-font-smoothing: antialiased; }
div.selector, div.checker, div.button, div.radio, div.uploader {
display: -moz-inline-box;
display: inline-block;
*display: inline;
zoom: 1;
vertical-align: middle;
/* Keeping this as :focus to remove browser styles */ }
div.selector:focus, div.checker:focus, div.button:focus, div.radio:focus, div.uploader:focus {
outline: 0; }
div.selector, div.selector *, div.radio, div.radio *, div.checker, div.checker *, div.uploader, div.uploader *, div.button, div.button * {
margin: 0;
padding: 0; }
.highContrastDetect {
background: url("../../img/uniform/bg-input.png") repeat-x 0 0;
width: 0px;
height: 0px; }
/* Input & Textarea */
input.uniform-input,
select.uniform-multiselect,
textarea.uniform {
padding: 3px;
background: url("../../img/uniform/bg-input.png") repeat-x 0 0;
outline: 0; }
input.uniform-input.active,
select.uniform-multiselect.active,
textarea.uniform.active {
background: url("../../img/uniform/bg-input-focus.png") repeat-x 0 0; }
/* Remove default webkit and possible mozilla .search styles.
* Keeping this as :active to remove browser styles */
div.checker input,
input[type="search"],
input[type="search"]:active {
-moz-appearance: none;
-webkit-appearance: none; }
/* Select */
div.selector {
background-position: 0 -130px;
line-height: 26px;
height: 26px;
padding: 0 0 0 10px;
position: relative;
overflow: hidden; }
div.selector span {
text-overflow: ellipsis;
display: block;
overflow: hidden;
white-space: nowrap;
background-position: right 0;
height: 26px;
line-height: 26px;
padding-right: 25px;
cursor: pointer;
width: 100%;
display: block; }
div.selector.fixedWidth {
width: 190px; }
div.selector.fixedWidth span {
width: 155px; }
div.selector select {
opacity: 0;
filter: alpha(opacity=0);
-moz-opacity: 0;
border: none;
background: none;
position: absolute;
height: 22px;
top: 2px;
left: 0px;
width: 100%; }
div.selector.active {
background-position: 0 -156px; }
div.selector.active span {
background-position: right -26px; }
div.selector.hover, div.selector.focus {
background-position: 0 -182px; }
div.selector.hover span, div.selector.focus span {
background-position: right -52px; }
div.selector.hover.active, div.selector.focus.active {
background-position: 0 -208px; }
div.selector.hover.active span, div.selector.focus.active span {
background-position: right -78px; }
div.selector.disabled, div.selector.disabled.active {
background-position: 0 -234px; }
div.selector.disabled span, div.selector.disabled.active span {
background-position: right -104px; }
/* Checkbox */
div.checker {
position: relative; }
div.checker, div.checker span, div.checker input {
width: 19px;
height: 19px; }
div.checker span {
display: -moz-inline-box;
display: inline-block;
*display: inline;
zoom: 1;
text-align: center;
background-position: 0 -260px; }
div.checker span.checked {
background-position: -76px -260px; }
div.checker input {
opacity: 0;
filter: alpha(opacity=0);
-moz-opacity: 0;
border: none;
background: none;
display: -moz-inline-box;
display: inline-block;
*display: inline;
zoom: 1; }
div.checker.active span {
background-position: -19px -260px; }
div.checker.active span.checked {
background-position: -95px -260px; }
div.checker.hover span, div.checker.focus span {
background-position: -38px -260px; }
div.checker.hover span.checked, div.checker.focus span.checked {
background-position: -114px -260px; }
div.checker.hover.active span, div.checker.focus.active span {
background-position: -57px -260px; }
div.checker.hover.active span.checked, div.checker.focus.active span.checked {
background-position: -133px -260px; }
div.checker.disabled, div.checker.disabled.active {
background-position: -152px -260px; }
div.checker.disabled span.checked, div.checker.disabled.active span.checked {
background-position: -171px -260px; }
/* Radio */
div.radio {
position: relative; }
div.radio, div.radio span, div.radio input {
width: 18px;
height: 18px; }
div.radio span {
display: -moz-inline-box;
display: inline-block;
*display: inline;
zoom: 1;
text-align: center;
background-position: 0 -279px; }
div.radio span.checked {
background-position: -72px -279px; }
div.radio input {
opacity: 0;
filter: alpha(opacity=0);
-moz-opacity: 0;
border: none;
background: none;
display: -moz-inline-box;
display: inline-block;
*display: inline;
zoom: 1;
text-align: center; }
div.radio.active span {
background-position: -18px -18px -279px; }
div.radio.active span.checked {
background-position: -90px -279px; }
div.radio.hover span, div.radio.focus span {
background-position: -36px -36px -279px; }
div.radio.hover span.checked, div.radio.focus span.checked {
background-position: -108px -279px; }
div.radio.hover.active span, div.radio.focus.active span {
background-position: -54px -279px; }
div.radio.hover.active span.checked, div.radio.focus.active span.checked {
background-position: -126px -279px; }
div.radio.disabled span, div.radio.disabled.active span {
background-position: -144px -279px; }
div.radio.disabled span.checked, div.radio.disabled.active span.checked {
background-position: -162px -279px; }
/* Uploader */
div.uploader {
background-position: 0 -297px;
height: 28px;
width: 190px;
cursor: pointer;
position: relative;
overflow: hidden; }
div.uploader span.action {
background-position: right -409px;
height: 28px;
line-height: 28px;
width: 82px;
text-align: center;
float: left;
display: inline;
overflow: hidden;
cursor: pointer; }
div.uploader span.filename {
text-overflow: ellipsis;
display: block;
overflow: hidden;
white-space: nowrap;
float: left;
cursor: default;
height: 24px;
margin: 2px 0 2px 2px;
line-height: 24px;
width: 85px;
padding: 0 10px; }
div.uploader input {
opacity: 0;
filter: alpha(opacity=0);
-moz-opacity: 0;
border: none;
background: none;
position: absolute;
top: 0;
right: 0;
float: right;
cursor: default;
width: 100%;
height: 100%; }
div.uploader.active span.action {
background-position: right -465px; }
div.uploader.hover, div.uploader.focus {
background-position: 0 -353px; }
div.uploader.hover span.action, div.uploader.focus span.action {
background-position: right -437px; }
div.uploader.hover.active span.action, div.uploader.focus.active span.action {
background-position: right -493px; }
div.uploader.disabled, div.uploader.disabled.active {
background-position: 0 -325px; }
div.uploader.disabled span.action, div.uploader.disabled.active span.action {
background-position: right -381px; }
/* Buttons */
div.button {
background-position: 0 -641px;
height: 30px;
cursor: pointer;
position: relative;
/* Keep buttons barely visible so they can get focus */ }
div.button a, div.button button, div.button input {
opacity: 0.01;
filter: alpha(opacity=1);
-moz-opacity: 0.01;
display: block;
top: 0;
left: 0;
right: 0;
bottom: 0;
position: absolute; }
div.button span {
display: -moz-inline-box;
display: inline-block;
*display: inline;
zoom: 1;
line-height: 22px;
text-align: center;
background-position: right -521px;
height: 22px;
margin-left: 13px;
padding: 8px 15px 0 2px; }
div.button.active {
background-position: 0 -671px; }
div.button.active span {
background-position: right -551px;
cursor: default; }
div.button.hover, div.button.focus {
background-position: 0 -701px; }
div.button.hover span, div.button.focus span {
background-position: right -581px; }
div.button.disabled, div.button.disabled.active {
background-position: 0 -731px; }
div.button.disabled span, div.button.disabled.active span {
background-position: right -611px;
cursor: default; }
/* INPUT & TEXTAREA */
input.uniform-input,
select.uniform-multiselect,
textarea.uniform {
font-size: 12px;
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
font-weight: normal;
color: #777;
border-top: solid 1px #aaaaaa;
border-left: solid 1px #aaaaaa;
border-bottom: solid 1px #cccccc;
border-right: solid 1px #cccccc;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px; }
input.uniform-input.hover, input.uniform-input.focus,
select.uniform-multiselect.hover,
select.uniform-multiselect.focus,
textarea.uniform.hover,
textarea.uniform.focus {
-webkit-box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.3);
border-color: #999; }
/* PRESENTATION */
/* Buttons */
div.button span {
font-weight: bold;
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
font-size: 12px;
letter-spacing: 1px;
text-transform: uppercase; }
div.button.hover span, div.button.focus span {
color: #555; }
div.button.disabled span, div.button.disabled.active span {
color: #bbb; }
/* Select */
div.selector {
font-size: 12px; }
div.selector span {
color: #666;
text-shadow: 0 1px 0 white; }
div.selector select {
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
font-size: 12px; }
div.selector.disabled span, div.selector.disabled.active span {
color: #bbb; }
/* Checker */
div.checker {
margin-right: 5px; }
/* Radio */
div.radio {
margin-right: 3px; }
/* Uploader */
div.uploader span.action {
text-shadow: white 0px 1px 0px;
background-color: #fff;
font-size: 11px;
font-weight: bold; }
div.uploader span.filename {
color: #777;
border-right: solid 1px #bbbbbb;
font-size: 11px; }
div.uploader.disabled span.action, div.uploader.disabled.active span.action {
color: #aaa; }
div.uploader.disabled span.filename, div.uploader.disabled.active span.filename {
border-color: #ddd;
color: #aaa; }
input.uniform-input, input.uniform-input:focus {
background-color: #fff; }
| {
"pile_set_name": "Github"
} |
Controllers found: 1
Current operation : None
Command completed successfully.
| {
"pile_set_name": "Github"
} |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!159 &1
EditorSettings:
m_ObjectHideFlags: 0
serializedVersion: 3
m_ExternalVersionControlSupport: Visible Meta Files
m_SerializationMode: 2
m_WebSecurityEmulationEnabled: 0
m_WebSecurityEmulationHostUrl: http://www.mydomain.com/mygame.unity3d
m_DefaultBehaviorMode: 0
m_SpritePackerMode: 2
m_SpritePackerPaddingPower: 1
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd
m_ProjectGenerationRootNamespace:
| {
"pile_set_name": "Github"
} |
package com.code.library.view;
import android.graphics.Camera;
import android.graphics.Matrix;
import android.view.animation.Animation;
import android.view.animation.Transformation;
/**
* Created by Wxcily on 15/10/29.
* 图片翻转动画
*/
public class RotateAnimation extends Animation {
private Camera mCamera;
private float mCenterX;
private float mCenterY;
private Mode mMode;
public RotateAnimation(float centerX, float centerY, Mode mode) {
mCenterX = centerX;
mCenterY = centerY;
mMode = mode;
}
@Override
public void initialize(int width, int height, int parentWidth,
int parentHeight) {
super.initialize(width, height, parentWidth, parentHeight);
mCamera = new Camera();
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
float deg = 0.0F + 360.0F * interpolatedTime;
Matrix matrix = t.getMatrix();
mCamera.save();
if (mMode == Mode.X)
mCamera.rotateX(deg);
if (mMode == Mode.Y)
mCamera.rotateY(deg);
if (mMode == Mode.Z)
mCamera.rotateZ(deg);
mCamera.getMatrix(matrix);
mCamera.restore();
matrix.preTranslate(-mCenterX, -mCenterY);
matrix.postTranslate(mCenterX, mCenterY);
}
public enum Mode {
X, Y, Z;
}
}
| {
"pile_set_name": "Github"
} |
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2015 by Chunwei Chen. All rights reserved.
*/
#ifndef _ZFS_KMAP_H
#define _ZFS_KMAP_H
#include <linux/highmem.h>
#ifdef HAVE_1ARG_KMAP_ATOMIC
/* 2.6.37 API change */
#define zfs_kmap_atomic(page, km_type) kmap_atomic(page)
#define zfs_kunmap_atomic(addr, km_type) kunmap_atomic(addr)
#else
#define zfs_kmap_atomic(page, km_type) kmap_atomic(page, km_type)
#define zfs_kunmap_atomic(addr, km_type) kunmap_atomic(addr, km_type)
#endif
#endif /* _ZFS_KMAP_H */
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
* Copyright (C) 2009-2010 Company 100, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "DragController.h"
#include "DragData.h"
namespace WebCore {
// FIXME: These values are straight out of DragControllerMac, so probably have
// little correlation with BREW standards...
const int DragController::LinkDragBorderInset = 2;
const int DragController::MaxOriginalImageArea = 1500 * 1500;
const int DragController::DragIconRightInset = 7;
const int DragController::DragIconBottomInset = 3;
const float DragController::DragImageAlpha = 0.75f;
bool DragController::isCopyKeyDown(DragData*)
{
return false;
}
DragOperation DragController::dragOperation(DragData* dragData)
{
// FIXME: This logic is incomplete
if (dragData->containsURL())
return DragOperationCopy;
return DragOperationNone;
}
const IntSize& DragController::maxDragImageSize()
{
static const IntSize maxDragImageSize(400, 400);
return maxDragImageSize;
}
void DragController::cleanupAfterSystemDrag()
{
}
} // namespace WebCore
| {
"pile_set_name": "Github"
} |
package indicators
import (
"errors"
"fmt"
"math"
"strings"
objects "github.com/d5/tengo/v2"
"github.com/thrasher-corp/gct-ta/indicators"
"github.com/thrasher-corp/gocryptotrader/gctscript/modules"
"github.com/thrasher-corp/gocryptotrader/gctscript/wrappers/validator"
)
// MACDModule MACD indicator commands
var MACDModule = map[string]objects.Object{
"calculate": &objects.UserFunction{Name: "calculate", Value: macd},
}
// MovingAverageConvergenceDivergence is the string constant
const MovingAverageConvergenceDivergence = "Moving Average Convergence Divergence"
// MACD defines a custom Moving Average Convergence Divergence tengo indicator
// object type
type MACD struct {
objects.Array
Period, PeriodSlow, PeriodFast int
}
// TypeName returns the name of the custom type.
func (o *MACD) TypeName() string {
return MovingAverageConvergenceDivergence
}
func macd(args ...objects.Object) (objects.Object, error) {
if len(args) != 4 {
return nil, objects.ErrWrongNumArguments
}
r := new(MACD)
if validator.IsTestExecution.Load() == true {
return r, nil
}
ohlcvInput := objects.ToInterface(args[0])
ohlcvInputData, valid := ohlcvInput.([]interface{})
if !valid {
return nil, fmt.Errorf(modules.ErrParameterConvertFailed, OHLCV)
}
var ohlcvClose []float64
var allErrors []string
for x := range ohlcvInputData {
t := ohlcvInputData[x].([]interface{})
value, err := toFloat64(t[4])
if err != nil {
allErrors = append(allErrors, err.Error())
}
ohlcvClose = append(ohlcvClose, value)
}
inFastPeriod, ok := objects.ToInt(args[1])
if !ok {
allErrors = append(allErrors, fmt.Sprintf(modules.ErrParameterConvertFailed, inFastPeriod))
}
inSlowPeriod, ok := objects.ToInt(args[2])
if !ok {
allErrors = append(allErrors, fmt.Sprintf(modules.ErrParameterConvertFailed, inSlowPeriod))
}
inTimePeriod, ok := objects.ToInt(args[3])
if !ok {
allErrors = append(allErrors, fmt.Sprintf(modules.ErrParameterConvertFailed, inTimePeriod))
}
if len(allErrors) > 0 {
return nil, errors.New(strings.Join(allErrors, ", "))
}
r.Period = inTimePeriod
r.PeriodFast = inFastPeriod
r.PeriodSlow = inSlowPeriod
macd, macdSignal, macdHist := indicators.MACD(ohlcvClose, inFastPeriod, inSlowPeriod, inTimePeriod)
for x := range macdHist {
tempMACD := &objects.Array{}
tempMACD.Value = append(tempMACD.Value, &objects.Float{Value: math.Round(macdHist[x]*100) / 100})
if macd != nil {
tempMACD.Value = append(tempMACD.Value, &objects.Float{Value: math.Round(macd[x]*100) / 100})
}
if macdSignal != nil {
tempMACD.Value = append(tempMACD.Value, &objects.Float{Value: math.Round(macdSignal[x]*100) / 100})
}
r.Value = append(r.Value, tempMACD)
}
return r, nil
}
| {
"pile_set_name": "Github"
} |
BDEPEND=dev-qt/linguist-tools:5 virtual/pkgconfig
DEFINED_PHASES=configure install postinst postrm setup
DEPEND=app-arch/zstd:= >=dev-qt/qtcore-5.14:5 >=dev-qt/qtdeclarative-5.14:5 >=dev-qt/qtgui-5.14:5 >=dev-qt/qtnetwork-5.14:5 >=dev-qt/qtwidgets-5.14:5 sys-libs/zlib python? ( python_single_target_python3_6? ( dev-lang/python:3.6 >=dev-lang/python-exec-2:=[python_targets_python3_6] ) python_single_target_python3_7? ( dev-lang/python:3.7 >=dev-lang/python-exec-2:=[python_targets_python3_7] ) )
DESCRIPTION=A general purpose tile map editor
EAPI=7
HOMEPAGE=https://www.mapeditor.org/
IUSE=examples python python_single_target_python3_6 python_single_target_python3_7
KEYWORDS=~amd64
LICENSE=BSD BSD-2 GPL-2+
RDEPEND=app-arch/zstd:= >=dev-qt/qtcore-5.14:5 >=dev-qt/qtdeclarative-5.14:5 >=dev-qt/qtgui-5.14:5 >=dev-qt/qtnetwork-5.14:5 >=dev-qt/qtwidgets-5.14:5 sys-libs/zlib python? ( python_single_target_python3_6? ( dev-lang/python:3.6 >=dev-lang/python-exec-2:=[python_targets_python3_6] ) python_single_target_python3_7? ( dev-lang/python:3.7 >=dev-lang/python-exec-2:=[python_targets_python3_7] ) )
REQUIRED_USE=python? ( ^^ ( python_single_target_python3_6 python_single_target_python3_7 ) )
SLOT=0
SRC_URI=https://github.com/bjorn/tiled/archive/v1.4.2/tiled-1.4.2.tar.gz
_eclasses_=estack 686eaab303305a908fd57b2fd7617800 multilib 98584e405e2b0264d37e8f728327fed1 python-single-r1 d3100de905f978df912135806cf27188 python-utils-r1 e41e32d357e5bdd388b5be2ce24f3883 qmake-utils 4eb5e05ef7ee630c003e3f0edc094135 toolchain-funcs 605c126bed8d87e4378d5ff1645330cb xdg-utils ff2ff954e6b17929574eee4efc5152ba
_md5_=d3c06f82baeb98b771a05f9b9b0187db
| {
"pile_set_name": "Github"
} |
export default {
submission: [],
loadingSubmission: null,
getSubmission(slug) {
return new Promise((resolve, reject) => {
// if landed on a submission page
if (preload.submission && preload.channel) {
this.submission = preload.submission;
Store.page.channel.temp = preload.channel;
this.loadingSubmission = false;
delete preload.submission;
delete preload.channel;
resolve();
return;
}
axios
.get('/submissions', {
params: {
slug,
with_channel: 1
}
})
.then((response) => {
this.submission = response.data.data;
Store.page.channel.temp = response.data.data.channel;
this.loadingSubmission = false;
resolve(response.data);
})
.catch((error) => {
this.loadingSubmission = false;
reject(error);
});
});
},
clearSubmission() {
this.submission = [];
this.loadingSubmission = null;
}
};
| {
"pile_set_name": "Github"
} |
package blueeyes.core.service
import blueeyes.bkka._
import blueeyes.core.data._
import blueeyes.core.http.{HttpRequest, HttpResponse, HttpHeaders}
import blueeyes.parsers.W3ExtendedLogAST.FieldIdentifier
import blueeyes.util.Clock
import akka.dispatch.Future
import akka.dispatch.Promise
import java.net.InetAddress
import org.joda.time.format.DateTimeFormat
/** A request logger is a function from (request/future of response) to future
* of log line. Request loggers do not have side effects.
*/
trait HttpRequestLogger[T, S] extends ((HttpRequest[T], Future[HttpResponse[S]]) => Future[List[(FieldIdentifier, Either[String, Array[Byte]])]]) { self =>
/** Combines this logger with the specified logger to produce another logger.
* If necessary, the items are separated by a single space character.
*/
def :+ (logger: HttpRequestLogger[T, S]): HttpRequestLogger[T, S] = new CompositeHttpRequestLogger(logger)
private[HttpRequestLogger] class CompositeHttpRequestLogger(logger: HttpRequestLogger[T, S]) extends HttpRequestLogger[T, S]{
def apply(request: HttpRequest[T], response: Future[HttpResponse[S]]): Future[List[(FieldIdentifier, Either[String, Array[Byte]])]] = {
(self(request, response) zip logger(request, response)).map {
case (prefix, suffix) => prefix ::: suffix
}
}
}
}
//TODO: get rid of AkkaDefaults
object HttpRequestLogger extends AkkaDefaults {
import blueeyes.parsers.W3ExtendedLogGrammar._
import blueeyes.parsers.W3ExtendedLogAST._
// <date> = 4<digit> "-" 2<digit> "-" 2<digit> YYYY-MM-DD
private val DateFormatter = DateTimeFormat.forPattern("yyyy-MM-dd")
// <time> = 2<digit> ":" 2<digit> [":" 2<digit> ["." *<digit>] HH-MM-SS
private val TimeFormatter = DateTimeFormat.forPattern("HH:mm:ss.S")
private val IpIdentifierValue = try {
InetAddress.getLocalHost.getHostAddress
} catch {
case error: Throwable => "127.0.0.1"
}
private val DnsNameIdentifierValue = try {
InetAddress.getLocalHost.getHostName
} catch {
case error: Throwable => "localhost"
}
/** Creates a logger from a W3 Extended Log fields directive. e.g.:
*
* #Fields: time cs-method cs-uri
*/
def apply[T, S](fieldsDirective: FieldsDirective)(implicit clock: Clock, req2c: T => ByteChunk, resp2c: S => ByteChunk): HttpRequestLogger[T, S] = new HttpRequestLogger[T, S] {
def apply(request: HttpRequest[T], response: Future[HttpResponse[S]]): Future[List[(FieldIdentifier, Either[String, Array[Byte]])]] = {
Future.sequence(fieldsDirective.identifiers.map(log(_, request, response)))
}
}
private def log[T, S](fieldIdentifier: FieldIdentifier, request: HttpRequest[T], response: Future[HttpResponse[S]])(implicit clock: Clock, req2c: T => ByteChunk, resp2c: S => ByteChunk): Future[(FieldIdentifier, Either[String, Array[Byte]])] = {
def aggregate(chunk: Option[ByteChunk]): Future[Either[String, Array[Byte]]] = {
chunk map { c =>
DefaultBijections.futureByteArrayToChunk.unapply(c) map { Right(_) }
} getOrElse {
Future(Right(Array[Byte]()))
}
}
val value: Future[Either[String, Array[Byte]]] = fieldIdentifier match {
case DateIdentifier =>
Promise.successful(Left(DateFormatter.print(clock.now())))
case TimeIdentifier =>
Promise.successful(Left(TimeFormatter.print(clock.now())))
case TimeTakenIdentifier =>
val start = clock.now().getMillis
response.map[Either[String, Array[Byte]]] { _ =>
val deltaSeconds = (clock.now().getMillis - start) / 1000.0
Left(deltaSeconds.toString)
}
case BytesIdentifier =>
import HttpHeaders._
response.map[Either[String, Array[Byte]]] { response =>
val contentLength = (for (`Content-Length`(length) <- response.headers.raw) yield length).headOption.getOrElse(0L)
Left(contentLength.toString)
} recover {
case ex => Left(ex.getMessage)
}
case CachedIdentifier =>
import HttpHeaders._
response.map[Either[String, Array[Byte]]] { response =>
val cached = (for (Age(age) <- response.headers.raw) yield age).headOption.getOrElse(0.0) > 0
Left(if (cached) "1" else "0")
} recover {
case ex => Left(ex.getMessage)
}
case IpIdentifier(prefix) => prefix match {
case ClientPrefix => Promise.successful(Left(request.remoteHost.map(_.getHostAddress).getOrElse("")))
case ServerPrefix => Promise.successful(Left(IpIdentifierValue))
case _ => Promise.successful(Left(""))
}
case DnsNameIdentifier(prefix) => prefix match {
case ClientPrefix => Promise.successful(Left(request.remoteHost.map(_.getHostName).getOrElse("")))
case ServerPrefix => Promise.successful(Left(DnsNameIdentifierValue))
case _ => Promise.successful(Left(""))
}
case ContentIdentifier(prefix) => prefix match {
case ClientToServerPrefix => aggregate(request.content.map(req2c(_)))
case ServerToClientPrefix =>
response.flatMap[Either[String, Array[Byte]]] {
response => aggregate(response.content.map(resp2c(_)))
} recover {
case ex => Left(ex.getMessage)
}
case _ => Promise.successful(Left(""))
}
case StatusIdentifier(prefix) => prefix match {
case ServerToClientPrefix =>
response.map[Either[String, Array[Byte]]] {
response => Left(response.status.code.name)
} recover {
case ex => Left(ex.getMessage)
}
case _ => Promise.successful(Left(""))
}
case CommentIdentifier(prefix) => prefix match {
case ServerToClientPrefix =>
response.map[Either[String, Array[Byte]]] {
response => Left(response.status.reason)
} recover {
case ex => Left(ex.getMessage)
}
case _ => Promise.successful(Left(""))
}
case MethodIdentifier(prefix) => prefix match {
case ClientToServerPrefix => Promise.successful(Left(request.method.value))
case _ => Promise.successful(Left(""))
}
case UriIdentifier(prefix) => prefix match {
case ClientToServerPrefix => Promise.successful(Left(request.uri.toString))
case _ => Promise.successful(Left(""))
}
case UriStemIdentifier(prefix) => prefix match {
case ClientToServerPrefix => Promise.successful(Left(request.uri.path.getOrElse("")))
case _ => Promise.successful(Left(""))
}
case UriQueryIdentifier(prefix) => prefix match {
case ClientToServerPrefix => Promise.successful(Left(request.uri.query.getOrElse("")))
case _ => Promise.successful(Left(""))
}
case HeaderIdentifier(prefix, header) =>
def find(key: String, headers: Map[String, String]) = headers find {keyValue => keyValue._1.toLowerCase == key.toLowerCase} map {keyValue => keyValue._2} getOrElse ("")
prefix match {
case ClientToServerPrefix => Promise.successful(Left(find(header, request.headers.raw)))
case ServerToClientPrefix =>
response.map[Either[String, Array[Byte]]] {
response => Left(find(header, response.headers.raw))
} recover {
case ex => Left(ex.getMessage)
}
case _ => Promise.successful(Left(""))
}
case CustomIdentifier(value) =>
Promise.successful(Left(""))
}
value.map((fieldIdentifier, _))
}
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env bash
#
# Build php in WSL(Debian Ubuntu)
#
# $ lnmp-wsl-php-builder 5.6.35 [--skipbuild] [tar] [deb] [--ci] [arm64] [arm32]
#
# help info
_print_help_info(){
echo "
Build php in WSL Debian by shell script
Usage:
$ lnmp-wsl-builder-php 7.3.0 7.3.0beta1 7.3.0RC1 nightly
$ lnmp-wsl-builder-php [ apt | apt-dev ]
$ lnmp-wsl-builder-php 7.3.0 [ tar | deb ] [--skipbuild] [--ci]
# echo \"--with-xxx --enable-xxx\" > /tmp/EXT_REAL_NAME.configure.options
$ lnmp-wsl-builder-php 7.3.0 enable-ext [EXT_NAME@EXT_REAL_NAME]
$ lnmp-wsl-builder-php 7.3.0 [ arm64 | arm32 ] tar [TODO]
"
exit 0
}
################################################################################
_sudo(){
command -v sudo > /dev/null && echo "sudo" || true
}
command -v apt > /dev/null
if ! [ 0 -eq $? ];then echo "Only Support Debian"; exit ; fi
source /etc/os-release
################################################################################
PHP_TIMEZONE=PRC
PHP_URL=https://www.php.net/distributions
PHP_GIT=https://github.com/php/php-src
host=x86_64-linux-gnu
if [ "${LNMP_CN_ENV}" != 'false' ];then
PHP_URL=https://mirrors.sohu.com/php
PHP_GIT=https://gitee.com/mirrors_trending/php-src
fi
PHP_INSTALL_LOG=/tmp/php-builder/$(date +%s).install.log
export COMPOSER_VERSION=1.10.13
export COMPOSER_ALLOW_SUPERUSER=1
export COMPOSER_HOME=/tmp/composer
export TZ=Asia/Shanghai
# export CC=clang CXX=clang
export CC=gcc CXX=g++
################################################################################
for command in "$@"
do
test $command = 'arm64' && host=aarch64-linux-gnu
test $command = 'arm32' && host=arm-linux-gnueabihf
done
test $host = 'aarch64-linux-gnu' && \
export CC=aarch64-linux-gnu-gcc \
CXX=aarch64-linux-gnu-g++ \
armMake="ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-"
test $host = 'arm-linux-gnueabihf' && \
export CC=arm-linux-gnueabihf-gcc \
CXX=arm-linux-gnueabihf-g++ \
armMake="ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-"
################################################################################
#
# https://github.com/docker-library/php/issues/272
#
PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2"
PHP_CPPFLAGS="$PHP_CFLAGS"
PHP_LDFLAGS="-Wl,-O1 -pie"
################################################################################
_get_phpnum(){
case "$1" in
5.6.* )
export PHP_NUM=56
;;
7.0.* )
export PHP_NUM=70
;;
7.1.* )
export PHP_NUM=71
;;
7.2.* )
export PHP_NUM=72
;;
7.3.* )
export PHP_NUM=73
;;
7.4.* )
export PHP_NUM=74
;;
# 8.0.* )
# export PHP_NUM=80
# export BUILD_FROM_GIT=1
# export PHP_SRC_BRANCH=PHP-8.0
# ;;
nightly )
export PHP_NUM=80
export BUILD_FROM_GIT=1
;;
* )
echo "ONLY SUPPORT 5.6 7.0 7.1 7.2 7.3 7.4 nightly"
exit 1
esac
}
################################################################################
# download php src
_download_src(){
$(_sudo) mkdir -p /usr/local/src
$(_sudo) chmod -R 777 /usr/local/src
if ! [ -z "$BUILD_FROM_GIT" ];then
$(_sudo) apt install bison git -y
git clone --depth=1 -b ${PHP_SRC_BRANCH:-master} ${PHP_GIT} /usr/local/src/php-${PHP_VERSION} || \
( git -C /usr/local/src/php-${PHP_VERSION} fetch --depth=1 origin master ; \
git -C /usr/local/src/php-${PHP_VERSION} reset --hard origin/master ;
)
return
fi
if ! [ -d /usr/local/src/php-${PHP_VERSION} ];then
echo -e "Download php src ...\n\n"
cd /usr/local/src ; $(_sudo) chmod 777 /usr/local/src
wget ${PHP_URL}/php-${PHP_VERSION}.tar.gz
echo -e "Untar ...\n\n"
tar -zxvf php-${PHP_VERSION}.tar.gz > /dev/null 2>&1
fi
}
################################################################################
# install packages
_build_arm_php_build_dep(){
################################################################################
DEP_PREFIX=/opt/${host}
ZLIB_VERSION=1.2.11
LIBXML2_VERSION=2.9.8
################################################################################
_buildlib(){
if [ -f /opt/${host}/$LIB_NAME ];then return 0 ; fi
cd /tmp ; test ! -d $TAR_FILE && ( wget $URL ; tar -zxvf $TAR )
cd $TAR_FILE && ./configure $CONFIGURES && make && $(_sudo) make install
}
################################################################################
LIB_NAME=
URL=
TAR=
TAR_FILE=
CONFIGURES="--prefix=${DEP_PREFIX}/zlib"
# _buildlib
################################################################################
LIB_NAME=zlib/lib/libz.so.${ZLIB_VERSION}
URL=http://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz
TAR=zlib-${ZLIB_VERSION}.tar.gz
TAR_FILE=zlib-${ZLIB_VERSION}
CONFIGURES="--prefix=${DEP_PREFIX}/zlib"
_buildlib
################################################################################
command -v python-config > /dev/null || pip install python-config
LIB_NAME=libxm2/lib/libxml2.so.${LIBXML2_VERSION}
URL=ftp://xmlsoft.org/libxml2/libxml2-${LIBXML2_VERSION}.tar.gz
TAR=libxml2-${LIBXML2_VERSION}.tar.gz
TAR_FILE=libxml2-${LIBXML2_VERSION}
CONFIGURES="--prefix=${DEP_PREFIX}/libxm2 \
--host=${host} \
--with-zlib=${DEP_PREFIX}/zlib \
--with-python=/tmp/$TAR_FILE/python"
_buildlib
################################################################################
}
buster_pkg(){
if ! [ "${VERSION_CODENAME}" = 'buster' ];then
return
fi
echo ""
}
stretch_pkg(){
if ! [ "${VERSION_CODENAME}" = 'stretch' ];then
return
fi
echo ""
}
ubuntu_xenial_pkg(){
if ! [ "${UBUNTU_CODENAME}" = 'xenial' ];then
return
fi
echo ""
}
ubuntu_bionic_pkg(){
if ! [ "${UBUNTU_CODENAME}" = 'xenial' ];then
return
fi
echo ""
}
_install_php_run_dep(){
test $host != 'x86_64-linux-gnu' && _build_arm_php_build_dep && return 0
export PHP_RUN_DEP="libedit2 \
zlib1g \
libxml2 \
openssl \
libsqlite3-0 \
libxslt1.1 \
libpq5 \
libmemcached11 \
libmemcachedutil2 \
libsasl2-2 \
libfreetype6 \
libpng16-16 \
$( $(_sudo) apt install -y libjpeg62-turbo > /dev/null 2>&1 && echo libjpeg62-turbo ) \
$( $(_sudo) apt install -y libjpeg-turbo8 > /dev/null 2>&1 && echo libjpeg-turbo8 ) \
$( if [ $PHP_NUM -ge "72" ];then \
echo $( if ! [ "${ARGON2}" = 'false' ];then \
echo "libargon2-0";
fi ); \
echo $( $(_sudo) apt install -y libsodium18 > /dev/null 2>&1 && echo libsodium18) ;\
echo $( $(_sudo) apt install -y libsodium23 > /dev/null 2>&1 && echo libsodium23) ;\
echo $( $(_sudo) apt install -y libzip4 > /dev/null 2>&1 && echo libzip4) ;\
echo $( $(_sudo) apt install -y libzip5 > /dev/null 2>&1 && echo libzip5) ;\
fi ) \
libyaml-0-2 \
libbz2-1.0 \
libexif12 \
libgmp10 \
libc-client2007e \
libkrb5-3 \
libxpm4 \
$( $(_sudo) apt install -y libwebp5 > /dev/null 2>&1 && echo libwebp5 ) \
$( $(_sudo) apt install -y libwebp6 > /dev/null 2>&1 && echo libwebp6 ) \
libenchant1c2a \
libssl1.1 \
$( $(_sudo) apt install -y libicu55 > /dev/null 2>&1 && echo libicu55) \
$( $(_sudo) apt install -y libicu57 > /dev/null 2>&1 && echo libicu57) \
$( $(_sudo) apt install -y libicu60 > /dev/null 2>&1 && echo libicu60) \
$( $(_sudo) apt install -y libicu63 > /dev/null 2>&1 && echo libicu63) \
libldap-2.4-2 \
$( $(_sudo) apt install -y libffi6 > /dev/null 2>&1 && echo libffi6) \
$( $(_sudo) apt install -y libffi7 > /dev/null 2>&1 && echo libffi7) \
$( $(_sudo) apt install -y libonig4 > /dev/null 2>&1 && echo libonig4) \
$( $(_sudo) apt install -y libonig5 > /dev/null 2>&1 && echo libonig5) \
libc6 \
tzdata \
"
# $( $(_sudo) apt install -y libtidy-0.99-0 > /dev/null 2>&1 && echo libtidy-0.99-0 ) \
# $( $(_sudo) apt install -y libtidy5 > /dev/null 2>&1 && echo libtidy5 ) \
# $( $(_sudo) apt install -y libtidy5deb1 > /dev/null 2>&1 && echo libtidy5deb1 ) \
$(_sudo) apt install -y $PHP_RUN_DEP > /dev/null
}
################################################################################
_install_php_build_dep(){
export DEP_SOFTS="autoconf \
curl \
lsb-release \
dpkg-dev \
file \
$( test ${CC:-gcc} = 'gcc' && echo "gcc g++ libc6-dev" ) \
$( test "$CC" = 'clang' && echo "clang" ) \
$( test "$host" = 'aarch64-linux-gnu' && echo "gcc-aarch64-linux-gnu g++-aarch64-linux-gnu" ) \
$( test "$host" = 'arm-linux-gnueabihf' && echo "gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf" ) \
make \
pkg-config \
re2c \
libedit-dev \
zlib1g-dev \
libxml2-dev \
libssl-dev \
libsqlite3-dev \
libxslt1-dev \
libcurl4-openssl-dev \
libpq-dev \
libmemcached-dev \
libsasl2-dev \
libfreetype6-dev \
libpng-dev \
$( $(_sudo) apt install -y libjpeg62-turbo-dev > /dev/null 2>&1 && echo libjpeg62-turbo-dev ) \
$( $(_sudo) apt install -y libjpeg-turbo8-dev > /dev/null 2>&1 && echo libjpeg-turbo8-dev ) \
\
$( test $PHP_NUM = "56" && echo "" ) \
$( test $PHP_NUM = "70" && echo "" ) \
$( test $PHP_NUM = "71" && echo "" ) \
$( if [ $PHP_NUM -ge "72" ];then \
echo "libsodium-dev libzip-dev"; \
fi ) \
\
libyaml-dev \
libbz2-dev \
libexif-dev \
libgmp-dev \
libc-client2007e-dev \
libkrb5-dev \
\
libxpm-dev \
libwebp-dev \
libenchant-dev \
libldap2-dev \
libpspell-dev \
libicu-dev \
libffi-dev \
libonig-dev \
"
# libtidy-dev \
for soft in ${DEP_SOFTS} ; do echo $soft | tee -a ${PHP_INSTALL_LOG} ; done
$(_sudo) apt install -y --no-install-recommends ${DEP_SOFTS}
}
################################################################################
_test(){
${PHP_PREFIX}/bin/php -v
${PHP_PREFIX}/bin/php -i | grep .ini
${PHP_PREFIX}/sbin/php-fpm -v
set +x
for ext in `ls /usr/local/src/php-${PHP_VERSION}/ext`; \
do echo '*' $( ${PHP_PREFIX}/bin/php -r "if(extension_loaded('$ext')){echo '[x] $ext';}else{echo '[ ] $ext';}" ); done
set -x
}
################################################################################
_builder(){
# fix bug
export gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"
_fix_bug(){
#
# https://bugs.php.net/bug.php?id=74125
#
if [ ! -d /usr/include/curl ]; then
$(_sudo) ln -sTf "/usr/include/$debMultiarch/curl" /usr/local/include/curl
fi
#
# https://stackoverflow.com/questions/34272444/compiling-php7-error
#
$(_sudo) ln -sf /usr/lib/libc-client.so.2007e.0 /usr/lib/$debMultiarch/libc-client.a
#
# debian 9 php56 configure: error: Unable to locate gmp.h
#
$(_sudo) ln -sf /usr/include/$debMultiarch/gmp.h /usr/include/gmp.h
#
# https://stackoverflow.com/questions/43617752/docker-php-and-freetds-cannot-find-freetds-in-know-installation-directories
#
# $(_sudo) ln -sf /usr/lib/x86_64-linux-gnu/libsybdb.so /usr/lib/
#
# configure: error: Cannot find ldap libraries in /usr/lib.
#
# @link https://blog.csdn.net/ei__nino/article/details/8598490
$(_sudo) cp -frp /usr/lib/$debMultiarch/libldap* /usr/lib/
}
test $host = 'x86_64-linux-gnu' && _fix_bug
################################################################################
set +e
# configure
CONFIGURE="--prefix=${PHP_PREFIX} \
--sysconfdir=${PHP_INI_DIR} \
\
--build="$gnuArch" \
--host=${host:-x86_64-linux-gnu} \
\
--with-config-file-path=${PHP_INI_DIR} \
--with-config-file-scan-dir=${PHP_INI_DIR}/conf.d \
--enable-fpm \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
\
--with-curl \
--with-gettext \
--with-kerberos \
--with-libedit \
--with-openssl \
--with-system-ciphers \
--with-pdo-mysql \
--with-pdo-pgsql=shared \
--with-xsl=shared \
--with-zlib \
--with-mhash \
$( test $PHP_NUM -ge "74" && \
echo "--enable-gd=shared \
--with-freetype \
--with-jpeg \
--with-webp \
--with-xpm \
--with-ffi=shared \
--with-zip" \
|| echo "--with-pcre-regex \
--with-gd=shared \
--with-freetype-dir=/usr/lib \
--with-jpeg-dir=/usr/lib \
--with-png-dir=/usr/lib \
--with-xpm-dir=/usr/lib \
--enable-zip") \
--disable-gd-jis-conv \
--enable-ftp \
--enable-mysqlnd \
--enable-bcmath \
--enable-mbstring \
--enable-pcntl=shared \
--enable-soap=shared \
--enable-sockets=shared \
--enable-sysvmsg=shared \
--enable-sysvsem=shared \
--enable-sysvshm=shared \
--enable-calendar=shared \
--enable-intl=shared \
--enable-embed=shared \
--enable-option-checking=fatal \
--with-mysqli=shared \
--with-pgsql=shared \
\
$( test $PHP_NUM = "56" && echo "--enable-opcache --enable-gd-native-ttf" ) \
$( test $PHP_NUM = "70" && echo "--enable-gd-native-ttf --with-webp-dir=/usr/lib" ) \
$( test $PHP_NUM = "71" && echo "--enable-gd-native-ttf --with-webp-dir=/usr/lib" ) \
\
$( if [ $PHP_NUM -ge "72" ];then \
echo $( if ! [ "${ARGON2}" = 'false' ];then \
echo "--with-password-argon2"; \
fi ); \
echo "--with-sodium \
--with-pcre-jit"; \
if [ $PHP_NUM -lt "74" ];then \
echo "--with-webp-dir=/usr/lib --with-libzip"; \
fi; \
fi ) \
--enable-exif \
--with-bz2 \
--with-gmp \
--with-imap=shared \
--with-imap-ssl \
\
--with-pic \
--with-enchant=shared \
--enable-fileinfo=shared \
--with-ldap=shared \
--with-ldap-sasl \
--with-pspell=shared \
--enable-shmop=shared \
$( test "$host" != 'x86_64-linux-gnu' && echo "--with-libxml-dir=/opt/${host}/libxml2 \
--with-zlib-dir=/opt/${host}/zlib" ) \
"
# --with-tidy \
set -e
for item in ${CONFIGURE}; do echo $item | tee -a ${PHP_INSTALL_LOG}; done
cd /usr/local/src/php-${PHP_VERSION}
export CFLAGS="$PHP_CFLAGS"
export CPPFLAGS="$PHP_CPPFLAGS"
export LDFLAGS="$PHP_LDFLAGS"
buster_patch(){
if ! [ "${VERSION_CODENAME}" = 'buster' ];then
return
fi
if [ "${PHP_NUM}" -le "73" ];then
curl -O https://salsa.debian.org/php-team/php/raw/debian/7.3.9-1/debian/patches/0047-Use-pkg-config-for-FreeType2-detection.patch
patch -p1 < 0047-Use-pkg-config-for-FreeType2-detection.patch
./buildconf --force
fi
}
buster_patch
if ! [ -f configure ];then ./buildconf --force; fi
./configure ${CONFIGURE}
# make
make -j "$(nproc)"
find -type f -name '*.a' -delete
# make install
$(_sudo) rm -rf ${PHP_PREFIX}
if [ -d ${PHP_INI_DIR} ];then $(_sudo) mv ${PHP_INI_DIR} ${PHP_INI_DIR}.$( date +%s ).backup; fi
$(_sudo) make install
$(_sudo) mkdir -p ${PHP_INI_DIR}/conf.d
$(_sudo) cp /usr/local/src/php-${PHP_VERSION}/php.ini-development ${PHP_INI_DIR}/php.ini
$(_sudo) cp /usr/local/src/php-${PHP_VERSION}/php.ini-development ${PHP_INI_DIR}/php.ini-development
$(_sudo) cp /usr/local/src/php-${PHP_VERSION}/php.ini-production ${PHP_INI_DIR}/php.ini-production
# php5 not have php-fpm.d
cd ${PHP_INI_DIR}
if ! [ -d php-fpm.d ]; then
# php5
$(_sudo) mkdir php-fpm.d
$(_sudo) cp php-fpm.conf.default php-fpm.d/www.conf
{ \
echo '[global]'; \
echo "include=${PHP_INI_DIR}/php-fpm.d/*.conf"; \
} | $(_sudo) tee php-fpm.conf
else
$(_sudo) cp php-fpm.d/www.conf.default php-fpm.d/www.conf
$(_sudo) cp php-fpm.conf.default php-fpm.conf
fi
echo "
;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;
[global]
pid = /var/run/php${PHP_NUM}-fpm.pid
error_log = /var/log/php${PHP_NUM}-fpm.error.log
;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;
[www]
access.log = /var/log/php${PHP_NUM}-fpm.access.log
user = nginx
group = nginx
request_slowlog_timeout = 5
slowlog = /var/log/php${PHP_NUM}-fpm.slow.log
clear_env = no
catch_workers_output = yes
; listen = 9000
; env[APP_ENV] = development
;
; wsl
;
; WSL1 not support listen ip:port
; listen = 127.0.0.1:9000
; WSL1 please use sock
listen = /var/run/php${PHP_NUM}-fpm.sock
listen.owner = nginx
listen.group = nginx
listen.mode = 0660
env[APP_ENV] = wsl
" | $(_sudo) tee ${PHP_INI_DIR}/php-fpm.d/zz-${ID}.conf
}
_install_pecl_ext_by_pickle(){
export PATH=${PHP_PREFIX}/bin:$PATH
$(_sudo) chmod 777 $(${PHP_PREFIX}/bin/php-config --extension-dir)
if [ ${PHP_NUM} -ge "80" ];then set +e; fi
PICKLE_OPTIONS="-n --php=${PHP_PREFIX}/bin/php -vvv"
if [ $# -ne 0 ];then
for extension in $@
do
local extension_real_name=$(echo $extension | cut -d "@" -f 2)
local extension=$(echo $extension | cut -d "@" -f 1)
$(_sudo) pickle install $extension ${PICKLE_OPTIONS} --defaults
${PHP_PREFIX}/bin/php -m > /dev/null 2>&1 \
|| $(_sudo) mv ${PHP_INI_DIR}/conf.d/php-ext-${extension_real_name}.ini \
${PHP_INI_DIR}/conf.d/php-ext-${extension_real_name}.ini.notwork
done
$(_sudo) chmod 755 $(${PHP_PREFIX}/bin/php-config --extension-dir)
set -e
return
fi
echo "--enable-redis-igbinary" > /tmp/redis.configure.options
echo "--enable-memcached-igbinary" > /tmp/memcached.configure.options
if [ ${PHP_NUM} -ge "80" ];then
_install_pecl_ext_by_pickle \
https://github.com/igbinary/igbinary/archive/master.tar.gz@igbinary \
https://github.com/phpredis/phpredis/archive/develop.tar.gz@redis \
https://github.com/xdebug/xdebug/archive/master.tar.gz@xdebug \
https://github.com/tideways/php-xhprof-extension/archive/master.tar.gz@tideways_xhprof \
https://github.com/swoole/swoole-src/archive/master.tar.gz@swoole \
mongodb \
memcached
else
$(_sudo) pickle install igbinary --defaults ${PICKLE_OPTIONS}
$(_sudo) pickle install redis --defaults ${PICKLE_OPTIONS}
$(_sudo) pickle install xdebug --defaults ${PICKLE_OPTIONS}
$(_sudo) pickle install swoole --defaults ${PICKLE_OPTIONS}
$(_sudo) pickle install memcached --defaults ${PICKLE_OPTIONS}
$(_sudo) pickle install mongodb --defaults ${PICKLE_OPTIONS}
fi
$(_sudo) chmod 755 $(${PHP_PREFIX}/bin/php-config --extension-dir)
set -e
}
_install_pecl_ext(){
command -v ${PHP_PREFIX}/bin/pecl && pecl=1 || pecl=0
$(_sudo) mkdir -p /usr/local/sbin
$(_sudo) ln -s ${PHP_PREFIX}/bin/php /usr/local/sbin
$(_sudo) ln -s ${PHP_PREFIX}/bin/phpize /usr/local/sbin
$(_sudo) ln -s ${PHP_PREFIX}/bin/php-config /usr/local/sbin
if [ $pecl -eq 0 ];then
_install_pecl_ext_by_pickle $@
# $(_sudo) rm -rf /usr/local/sbin/{php,phpize,php-config}
$(_sudo) rm -rf /usr/local/sbin/php*
return
fi
#
# https://github.com/docker-library/php/issues/443
#
$(_sudo) ${PHP_PREFIX}/bin/pecl update-channels
PHP_EXTENSION="igbinary \
redis \
$( if [ $PHP_NUM = "56" ];then echo "memcached-2.2.0"; else echo "memcached"; fi ) \
$( if [ $PHP_NUM = "56" ];then echo "xdebug-2.5.5"; else echo "xdebug"; fi ) \
$( if [ $PHP_NUM = "56" ];then echo "yaml-1.3.1"; else echo "yaml"; fi ) \
$( if ! [ $PHP_NUM = "56" ];then echo "swoole"; else echo ""; fi ) \
mongodb"
if [ $# -ne 0 ];then PHP_EXTENSION=$@;fi
for extension in ${PHP_EXTENSION}
do
echo $extension | tee -a ${PHP_INSTALL_LOG}
$(_sudo) ${PHP_PREFIX}/bin/pecl install $extension || echo "install $extension error" | tee -a ${PHP_INSTALL_LOG}
done
$(_sudo) rm -rf /usr/local/sbin/php*
}
_php_ext_enable(){
echo "date.timezone=${PHP_TIMEZONE:-PRC}" | $(_sudo) tee ${PHP_INI_DIR}/conf.d/date_timezone.ini
echo "error_log=/var/log/php${PHP_NUM}.error.log" | $(_sudo) tee ${PHP_INI_DIR}/conf.d/error_log.ini
echo "session.save_path = \"/tmp\"" | $(_sudo) tee ${PHP_INI_DIR}/conf.d/session.ini
if [ $# -ne 0 ];then
wsl-php-ext-enable.sh $@
return
fi
set +e
exts=" pdo_pgsql \
xsl \
pcntl \
shmop \
soap \
sockets \
sysvmsg \
sysvsem \
sysvshm \
calendar \
fileinfo \
intl \
imap \
enchant \
ldap \
pspell \
\
mongodb \
igbinary \
redis \
memcached \
xdebug \
$( test $PHP_NUM != '56' && echo 'swoole' ) \
opcache \
mysqli \
$( test $PHP_NUM -ge "74" && echo ffi ) \
pgsql \
gd "
set -e
for ext in $exts
do
wsl-php-ext-enable.sh $ext || echo "$ext install error" | tee -a ${PHP_INSTALL_LOG}
done
# config opcache
# echo 'opcache.enable_cli=1' | $(_sudo) tee -a ${PHP_INI_DIR}/conf.d/wsl-php-ext-opcache.ini
echo 'opcache.file_cache=/tmp' | $(_sudo) tee -a ${PHP_INI_DIR}/conf.d/wsl-php-ext-opcache.ini
}
_create_log_file(){
cd /var/log
if ! [ -f php${PHP_NUM}-fpm.error.log ];then $(_sudo) touch php${PHP_NUM}-fpm.error.log ; fi
if ! [ -f php${PHP_NUM}-fpm.access.log ];then $(_sudo) touch php${PHP_NUM}-fpm.access.log ; fi
if ! [ -f php${PHP_NUM}-fpm.slow.log ];then $(_sudo) touch php${PHP_NUM}-fpm.slow.log; fi
$(_sudo) chmod 777 php${PHP_NUM}-*
}
_pickle(){
# composer global require friendsofphp/pickle
$(_sudo) curl -sfL -o /usr/local/bin/pickle \
https://github.com/khs1994-php/pickle/releases/download/nightly/pickle-debug.phar
}
_composer(){
$(_sudo) curl -sfL -o /usr/local/bin/composer \
https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar
# curl -sfL -o /tmp/installer.php \
# https://raw.githubusercontent.com/composer/getcomposer.org/cb19f2aa3aeaa2006c0cd69a7ef011eb31463067/web/installer
#
# # https://github.com/khs1994-docker/lnmp/issues/630
# $(_sudo) apt show libssl1.1=1.1.0f-3+deb9u2 && $(_sudo) apt install -y --allow-downgrades libssl1.1=1.1.0f-3+deb9u2 || true
# ${PHP_PREFIX}/bin/php -r " \
# \$signature = '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5'; \
# \$hash = hash('sha384', file_get_contents('/tmp/installer.php')); \
# if (!hash_equals(\$signature, \$hash)) { \
# unlink('/tmp/installer.php'); \
# echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
# exit(1); \
# }" \
# && $(_sudo) ${PHP_PREFIX}/bin/php /tmp/installer.php --no-ansi --install-dir=${PHP_PREFIX}/bin --filename=composer --version=${COMPOSER_VERSION}
}
################################################################################
_write_version_to_file(){
echo "\`\`\`bash" | $(_sudo) tee -a ${PHP_PREFIX}/README.md
${PHP_PREFIX}/bin/php -v | $(_sudo) tee -a ${PHP_PREFIX}/README.md
echo "\`\`\`" | $(_sudo) tee -a ${PHP_PREFIX}/README.md
echo "\`\`\`bash" | $(_sudo) tee -a ${PHP_PREFIX}/README.md
${PHP_PREFIX}/bin/php -i | grep .ini | $(_sudo) tee -a ${PHP_PREFIX}/README.md
echo "\`\`\`" | $(_sudo) tee -a ${PHP_PREFIX}/README.md
echo "\`\`\`bash" | $(_sudo) tee -a ${PHP_PREFIX}/README.md
${PHP_PREFIX}/sbin/php-fpm -v | $(_sudo) tee -a ${PHP_PREFIX}/README.md
echo "\`\`\`" | $(_sudo) tee -a ${PHP_PREFIX}/README.md
echo "\`\`\`bash" | $(_sudo) tee -a ${PHP_PREFIX}/README.md
cat ${PHP_INSTALL_LOG} | $(_sudo) tee -a ${PHP_PREFIX}/README.md
echo "\`\`\`" | $(_sudo) tee -a ${PHP_PREFIX}/README.md
set +x
for ext in `ls /usr/local/src/php-${PHP_VERSION}/ext`; \
do echo '*' $( ${PHP_PREFIX}/bin/php -r "if(extension_loaded('$ext')){echo '[x] $ext';}else{echo '[ ] $ext';}" ) | $(_sudo) tee -a ${PHP_PREFIX}/README.md ; done
set -x
cat ${PHP_PREFIX}/README.md
}
################################################################################
_tar(){
rm -rf /tmp/php${PHP_NUM}_ROOT/
mkdir -p /tmp/php${PHP_NUM}_ROOT/etc
cd /usr/local/
cp -a php${PHP_NUM} /tmp/php${PHP_NUM}_ROOT/
cp -a etc/php${PHP_NUM} /tmp/php${PHP_NUM}_ROOT/etc
cd /tmp/php${PHP_NUM}_ROOT/
$(_sudo) tar -zcvf /php${PHP_NUM}.tar.gz .
}
################################################################################
_deb(){
PHP_PKG_VERSION=${PHP_VERSION}
test $PHP_VERSION = 'nightly' && PHP_PKG_VERSION=0.0.0 || true
cd /tmp; $(_sudo) rm -rf khs1994-wsl-php${PHP_NUM}-${PHP_PKG_VERSION} ; mkdir -p khs1994-wsl-php${PHP_NUM}-${PHP_PKG_VERSION}/DEBIAN ; cd khs1994-wsl-php${PHP_NUM}-${PHP_PKG_VERSION}
################################################################################
echo "Package: khs1994-wsl-php${PHP_NUM}
Version: ${PHP_PKG_VERSION}
Prioritt: optional
Section: php
Architecture: amd64
Maintainer: khs1994 <[email protected]>
Bugs: https://github.com/khs1994-docker/lnmp/issues
Depends: $( echo ${PHP_RUN_DEP} | sed "s# #, #g" )
Homepage: https://lnmp.khs1994.com
Description: server-side, HTML-embedded scripting language (default)
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
" > DEBIAN/control
echo "#!/bin/bash
# log
cd /var/log
if ! [ -f php${PHP_NUM}.error.log ];then touch php${PHP_NUM}.error.log ; fi
if ! [ -f php${PHP_NUM}-fpm.error.log ];then touch php${PHP_NUM}-fpm.error.log ; fi
if ! [ -f php${PHP_NUM}-fpm.access.log ];then touch php${PHP_NUM}-fpm.access.log ; fi
if ! [ -f php${PHP_NUM}-fpm.slow.log ];then touch php${PHP_NUM}-fpm.slow.log; fi
chmod 777 php${PHP_NUM}*
# bin sbin
for file in \$( ls ${PHP_PREFIX}/bin ); do ln -sf ${PHP_PREFIX}/bin/\$file /usr/local/bin/ ; done
ln -sf ${PHP_PREFIX}/sbin/php-fpm /usr/local/sbin/
" > DEBIAN/postinst
echo "#!/bin/bash
echo
echo \"Meet issue? Please see https://github.com/khs1994-docker/lnmp/issues \"
echo
" > DEBIAN/postrm
echo "#!/bin/bash
if [ -d ${PHP_INI_DIR} ];then
mv ${PHP_INI_DIR} ${PHP_INI_DIR}.\$( date +%s ).backup
fi
echo -e \"
----------------------------------------------------------------------
Thanks for using khs1994-wsl-php${PHP_NUM} !
Please find the official documentation for khs1994-wsl-php${PHP_NUM} here:
* https://github.com/khs1994-docker/lnmp/tree/master/wsl
Meet issue? please see:
* https://github.com/khs1994-docker/lnmp/issues
----------------------------------------------------------------------
\"
" > DEBIAN/preinst
################################################################################
chmod -R 755 DEBIAN ; mkdir -p usr/local/etc
$(_sudo) cp -a ${PHP_PREFIX} usr/local/php${PHP_NUM} ; $(_sudo) cp -a ${PHP_INI_DIR} usr/local/etc/
cd ..
DEB_NAME=khs1994-wsl-php${PHP_NUM}_${PHP_PKG_VERSION}-${ID}-$( lsb_release -cs )_amd64.deb
$(_sudo) dpkg-deb -b khs1994-wsl-php${PHP_NUM}-${PHP_PKG_VERSION} $DEB_NAME
$(_sudo) cp -a /tmp/${DEB_NAME} /
echo "\$ $(_sudo) dpkg -i ${DEB_NAME}"
$(_sudo) rm -rf $PHP_PREFIX ; $(_sudo) rm -rf $PHP_INI_DIR
$(_sudo) dpkg -i /${DEB_NAME}
# test
test $host = 'x86_64-linux-gnu' && _test
}
################################################################################
if [ -z "$1" ];then _print_help_info ; else PHP_VERSION=$1 ; fi
set -ex
$(_sudo) apt update
command -v wget > /dev/null || $(_sudo) apt install wget -y
mkdir -p /tmp/php-builder
test "$PHP_VERSION" = 'apt' && PHP_VERSION=7.4.10
test "$PHP_VERSION" = 'apt-dev' && PHP_VERSION=7.4.10
_get_phpnum $PHP_VERSION
export PHP_PREFIX=/usr/local/php${PHP_NUM}
export PHP_INI_DIR=/usr/local/etc/php${PHP_NUM}
test $host = 'aarch64-linux-gnu' && \
export PHP_PREFIX=/usr/local/arm64/php${PHP_NUM} \
PHP_INI_DIR=/usr/local/arm64/etc/php${PHP_NUM}
test $host = 'arm-linux-gnueabihf' && \
export PHP_PREFIX=/usr/local/arm32/php${PHP_NUM} \
PHP_INI_DIR=/usr/local/arm32/etc/php${PHP_NUM}
# verify os
. /etc/os-release
#
# ID=debian
# VERSION_ID="9"
#
# ID=ubuntu
# VERSION_ID="16.04"
#
# debian9 notsupport php56
if [ "$ID" = 'debian' ] && [ "$VERSION_ID" = "9" ] && [ $PHP_NUM = "56" ];then \
echo "debian9 notsupport php56" ; exit 1 ; fi
$(_sudo) apt install -y libargon2-0-dev > /dev/null 2>&1 || export ARGON2=false
if [ "$ID" = 'debian' ] && [ "$VERSION_ID" = "9" ];then
##<argon2>##
sed -e 's/stretch/buster/g' /etc/apt/sources.list | $(_sudo) tee /etc/apt/sources.list.d/buster.list; \
{ \
echo 'Package: *'; \
echo 'Pin: release n=buster'; \
echo 'Pin-Priority: -10'; \
echo; \
echo 'Package: libargon2*'; \
echo 'Pin: release n=buster'; \
echo 'Pin-Priority: 990'; \
} | $(_sudo) tee /etc/apt/preferences.d/argon2-buster
$(_sudo) apt update
$(_sudo) apt install -y --no-install-recommends libargon2-dev
export ARGON2=true
fi
$(_sudo) apt install -y curl
command -v /usr/local/bin/pickle > /dev/null || _pickle
command -v /usr/local/bin/composer > /dev/null || _composer
$(_sudo) chmod +x /usr/local/bin/pickle /usr/local/bin/composer
if [ "$2" = 'enable-ext' ];then
( shift 2 ; _install_pecl_ext $@; _php_ext_enable $@; _create_log_file ; \
( test $host = 'x86_64-linux-gnu' && \
_test \
${PHP_PREFIX}/bin/php-config | $(_sudo) tee -a ${PHP_INSTALL_LOG} \
) ; _write_version_to_file )
exit
fi
_install_php_run_dep
if [ "$1" = 'apt' ];then exit 0;fi
if [ "$1" = 'apt-dev' ];then _install_php_build_dep ; exit $? ; fi
_install_php_build_dep
for command in "$@"
do
test $command = '--skipbuild' && export SKIP_BUILD=1
test $command = '--ci' && export PHP_URL=https://www.php.net/distributions
done
test "${SKIP_BUILD}" != 1 && \
( _download_src ; \
_builder ; \
_install_pecl_ext ; \
_php_ext_enable ; \
_create_log_file ; \
( test $host = 'x86_64-linux-gnu' && \
_test ; \
${PHP_PREFIX}/bin/php-config | $(_sudo) tee -a ${PHP_INSTALL_LOG} \
) ; \
_write_version_to_file )
for command in "$@"
do
test $command = 'tar' && _tar
test $command = 'deb' && _deb
done
ls -lah /*.tar.gz /*.deb || true
| {
"pile_set_name": "Github"
} |
/*
* AutoRefactor - Eclipse plugin to automatically refactor Java code bases.
*
* Copyright (C) 2017 Fabrice Tiercelin - Initial API and implementation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program under LICENSE-GNUGPL. If not, see
* <http://www.gnu.org/licenses/>.
*
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution under LICENSE-ECLIPSE, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.autorefactor.jdt.internal.ui.fix.samples_out;
import java.util.List;
public class DoWhileRatherThanDuplicateCodeSample {
public void replaceWhileByDoWhile(int i) {
// Keep this comment
do {
System.out.println("Statement 1");
System.out.println("Statement 2");
} while (i-- > 0);
}
public void replaceWhileWithoutBlock(int i) {
// Keep this comment
do i--;
while (i > 0);
}
public void doNotReplaceWhileByDoWhile(int i) {
System.out.println("A statement");
while (i-- > 0) {
System.out.println("Another statement");
}
}
public void doNotReplaceWithMissingStatement(int i) {
System.out.println("A statement");
while (i-- > 0) {
System.out.println("A statement");
System.out.println("A statement");
}
}
public void doNotRemoveVariableDeclaration(int i) {
System.out.println("A statement");
int j = 0;
while (i-- > 0) {
System.out.println("A statement");
j = 0;
}
}
public void doNotRemoveEmptyLoop(List listToEmpty) {
while (listToEmpty.remove("foo")) {
}
}
}
| {
"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.qihoo.qsql.org.apache.calcite.rel.rules;
import com.qihoo.qsql.org.apache.calcite.plan.Contexts;
import com.qihoo.qsql.org.apache.calcite.plan.RelOptPredicateList;
import com.qihoo.qsql.org.apache.calcite.plan.RelOptRule;
import com.qihoo.qsql.org.apache.calcite.plan.RelOptRuleCall;
import com.qihoo.qsql.org.apache.calcite.rel.RelNode;
import com.qihoo.qsql.org.apache.calcite.rel.core.Join;
import com.qihoo.qsql.org.apache.calcite.rel.core.RelFactories;
import com.qihoo.qsql.org.apache.calcite.rel.metadata.RelMetadataQuery;
import com.qihoo.qsql.org.apache.calcite.rex.RexBuilder;
import com.qihoo.qsql.org.apache.calcite.tools.RelBuilder;
import com.qihoo.qsql.org.apache.calcite.tools.RelBuilderFactory;
/**
* Planner rule that infers predicates from on a
* {@link com.qihoo.qsql.org.apache.calcite.rel.core.Join} and creates
* {@link com.qihoo.qsql.org.apache.calcite.rel.core.Filter}s if those predicates can be pushed
* to its inputs.
*
* <p>Uses {@link com.qihoo.qsql.org.apache.calcite.rel.metadata.RelMdPredicates} to infer
* the predicates,
* returns them in a {@link com.qihoo.qsql.org.apache.calcite.plan.RelOptPredicateList}
* and applies them appropriately.
*/
public class JoinPushTransitivePredicatesRule extends RelOptRule {
/** The singleton. */
public static final JoinPushTransitivePredicatesRule INSTANCE =
new JoinPushTransitivePredicatesRule(Join.class,
RelFactories.LOGICAL_BUILDER);
/** Creates a JoinPushTransitivePredicatesRule. */
public JoinPushTransitivePredicatesRule(Class<? extends Join> clazz,
RelBuilderFactory relBuilderFactory) {
super(operand(clazz, any()), relBuilderFactory, null);
}
@Deprecated // to be removed before 2.0
public JoinPushTransitivePredicatesRule(Class<? extends Join> clazz,
RelFactories.FilterFactory filterFactory) {
this(clazz, RelBuilder.proto(Contexts.of(filterFactory)));
}
@Override public void onMatch(RelOptRuleCall call) {
Join join = call.rel(0);
final RelMetadataQuery mq = call.getMetadataQuery();
RelOptPredicateList preds = mq.getPulledUpPredicates(join);
if (preds.leftInferredPredicates.isEmpty()
&& preds.rightInferredPredicates.isEmpty()) {
return;
}
final RexBuilder rexBuilder = join.getCluster().getRexBuilder();
final RelBuilder relBuilder = call.builder();
RelNode lChild = join.getLeft();
if (preds.leftInferredPredicates.size() > 0) {
RelNode curr = lChild;
lChild = relBuilder.push(lChild)
.filter(preds.leftInferredPredicates).build();
call.getPlanner().onCopy(curr, lChild);
}
RelNode rChild = join.getRight();
if (preds.rightInferredPredicates.size() > 0) {
RelNode curr = rChild;
rChild = relBuilder.push(rChild)
.filter(preds.rightInferredPredicates).build();
call.getPlanner().onCopy(curr, rChild);
}
RelNode newRel = join.copy(join.getTraitSet(), join.getCondition(),
lChild, rChild, join.getJoinType(), join.isSemiJoinDone());
call.getPlanner().onCopy(join, newRel);
call.transformTo(newRel);
}
}
// End JoinPushTransitivePredicatesRule.java
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Rgaa32017 Test.10.15.4 NMI 01</title>
</head>
<body class="NMI">
<div>
<h1>Rgaa32017 Test.10.15.4 NMI 01</h1>
<!-- START [test-detail] -->
<div class="test-detail" lang="fr">
Dans chaque page web, pour chaque <a href="http://references.modernisation.gouv.fr/rgaa-accessibilite/glossaire.html#mdia-non-temporel">média non temporel</a>, l'information ne doit pas être donnée <a href="http://references.modernisation.gouv.fr/rgaa-accessibilite/glossaire.html#indication-forme-taille-position">par la forme, taille ou position</a> uniquement. Cette règle est-elle implémentée de façon pertinente ?
</div>
<!-- END [test-detail] -->
<div class="testcase">
</div>
<div class="test-explanation">
NMI.
</div>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
CREATE TABLE list (id VARCHAR(10) NOT NULL, value VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "list" ("id", "value") VALUES ('AFN', 'Afghan Afghani');
INSERT INTO "list" ("id", "value") VALUES ('AFA', 'Afghan Afghani (1927–2002)');
INSERT INTO "list" ("id", "value") VALUES ('ALL', 'Albanian Lek');
INSERT INTO "list" ("id", "value") VALUES ('ALK', 'Albanian Lek (1946–1965)');
INSERT INTO "list" ("id", "value") VALUES ('ADP', 'Andorran Peseta');
INSERT INTO "list" ("id", "value") VALUES ('AOK', 'Angolan Kwanza (1977–1991)');
INSERT INTO "list" ("id", "value") VALUES ('AON', 'Angolan New Kwanza (1990–2000)');
INSERT INTO "list" ("id", "value") VALUES ('AOR', 'Angolan Readjusted Kwanza (1995–1999)');
INSERT INTO "list" ("id", "value") VALUES ('ARA', 'Argentine Austral');
INSERT INTO "list" ("id", "value") VALUES ('ARS', 'Argentine Peso');
INSERT INTO "list" ("id", "value") VALUES ('ARM', 'Argentine Peso (1881–1970)');
INSERT INTO "list" ("id", "value") VALUES ('ARP', 'Argentine Peso (1983–1985)');
INSERT INTO "list" ("id", "value") VALUES ('ARL', 'Argentine Peso Ley (1970–1983)');
INSERT INTO "list" ("id", "value") VALUES ('AMD', 'Armenian Dram');
INSERT INTO "list" ("id", "value") VALUES ('AWG', 'Aruban Florin');
INSERT INTO "list" ("id", "value") VALUES ('ATS', 'Austrian Schilling');
INSERT INTO "list" ("id", "value") VALUES ('AZN', 'Azerbaijani Manat');
INSERT INTO "list" ("id", "value") VALUES ('AZM', 'Azerbaijani Manat (1993–2006)');
INSERT INTO "list" ("id", "value") VALUES ('BSD', 'Bahamian Dollar');
INSERT INTO "list" ("id", "value") VALUES ('BDT', 'Bangladeshi Taka');
INSERT INTO "list" ("id", "value") VALUES ('BBD', 'Barbadian Dollar');
INSERT INTO "list" ("id", "value") VALUES ('BYN', 'Belarusian Ruble');
INSERT INTO "list" ("id", "value") VALUES ('BYB', 'Belarusian Ruble (1994–1999)');
INSERT INTO "list" ("id", "value") VALUES ('BYR', 'Belarusian Ruble (2000–2016)');
INSERT INTO "list" ("id", "value") VALUES ('BEF', 'Belgian Franc');
INSERT INTO "list" ("id", "value") VALUES ('BEC', 'Belgian Franc (convertible)');
INSERT INTO "list" ("id", "value") VALUES ('BEL', 'Belgian Franc (financial)');
INSERT INTO "list" ("id", "value") VALUES ('BZD', 'Belize Dollar');
INSERT INTO "list" ("id", "value") VALUES ('BMD', 'Bermudan Dollar');
INSERT INTO "list" ("id", "value") VALUES ('BTN', 'Bhutanese Ngultrum');
INSERT INTO "list" ("id", "value") VALUES ('BOB', 'Bolivian Boliviano');
INSERT INTO "list" ("id", "value") VALUES ('BOL', 'Bolivian Boliviano (1863–1963)');
INSERT INTO "list" ("id", "value") VALUES ('BOV', 'Bolivian Mvdol');
INSERT INTO "list" ("id", "value") VALUES ('BOP', 'Bolivian Peso');
INSERT INTO "list" ("id", "value") VALUES ('BAM', 'Bosnia-Herzegovina Convertible Mark');
INSERT INTO "list" ("id", "value") VALUES ('BAD', 'Bosnia-Herzegovina Dinar (1992–1994)');
INSERT INTO "list" ("id", "value") VALUES ('BAN', 'Bosnia-Herzegovina New Dinar (1994–1997)');
INSERT INTO "list" ("id", "value") VALUES ('BRC', 'Brazilian Cruzado (1986–1989)');
INSERT INTO "list" ("id", "value") VALUES ('BRZ', 'Brazilian Cruzeiro (1942–1967)');
INSERT INTO "list" ("id", "value") VALUES ('BRE', 'Brazilian Cruzeiro (1990–1993)');
INSERT INTO "list" ("id", "value") VALUES ('BRR', 'Brazilian Cruzeiro (1993–1994)');
INSERT INTO "list" ("id", "value") VALUES ('BRN', 'Brazilian New Cruzado (1989–1990)');
INSERT INTO "list" ("id", "value") VALUES ('BRB', 'Brazilian New Cruzeiro (1967–1986)');
INSERT INTO "list" ("id", "value") VALUES ('BRL', 'Brazilian Real');
INSERT INTO "list" ("id", "value") VALUES ('BND', 'Brunei Dollar');
INSERT INTO "list" ("id", "value") VALUES ('BGL', 'Bulgarian Hard Lev');
INSERT INTO "list" ("id", "value") VALUES ('BGN', 'Bulgarian Lev');
INSERT INTO "list" ("id", "value") VALUES ('BGO', 'Bulgarian Lev (1879–1952)');
INSERT INTO "list" ("id", "value") VALUES ('BGM', 'Bulgarian Socialist Lev');
INSERT INTO "list" ("id", "value") VALUES ('BUK', 'Burmese Kyat');
INSERT INTO "list" ("id", "value") VALUES ('XPF', 'CFP Franc');
INSERT INTO "list" ("id", "value") VALUES ('KHR', 'Cambodian Riel');
INSERT INTO "list" ("id", "value") VALUES ('KYD', 'Cayman Islands Dollar');
INSERT INTO "list" ("id", "value") VALUES ('GHC', 'Cedi');
INSERT INTO "list" ("id", "value") VALUES ('CLE', 'Chilean Escudo');
INSERT INTO "list" ("id", "value") VALUES ('CLP', 'Chilean Peso');
INSERT INTO "list" ("id", "value") VALUES ('CLF', 'Chilean Unit of Account (UF)');
INSERT INTO "list" ("id", "value") VALUES ('CNX', 'Chinese People’s Bank Dollar');
INSERT INTO "list" ("id", "value") VALUES ('COP', 'Colombian Peso');
INSERT INTO "list" ("id", "value") VALUES ('COU', 'Colombian Real Value Unit');
INSERT INTO "list" ("id", "value") VALUES ('CRC', 'Costa Rican Colón');
INSERT INTO "list" ("id", "value") VALUES ('HRD', 'Croatian Dinar');
INSERT INTO "list" ("id", "value") VALUES ('HRK', 'Croatian Kuna');
INSERT INTO "list" ("id", "value") VALUES ('CUC', 'Cuban Convertible Peso');
INSERT INTO "list" ("id", "value") VALUES ('CUP', 'Cuban Peso');
INSERT INTO "list" ("id", "value") VALUES ('CYP', 'Cypriot Pound');
INSERT INTO "list" ("id", "value") VALUES ('CZK', 'Czech Koruna');
INSERT INTO "list" ("id", "value") VALUES ('CSK', 'Czechoslovak Hard Koruna');
INSERT INTO "list" ("id", "value") VALUES ('USD', 'Dalar Amurka');
INSERT INTO "list" ("id", "value") VALUES ('CAD', 'Dalar Kanada');
INSERT INTO "list" ("id", "value") VALUES ('LRD', 'Dalar Laberiya');
INSERT INTO "list" ("id", "value") VALUES ('NAD', 'Dalar Namibiya');
INSERT INTO "list" ("id", "value") VALUES ('AUD', 'Dalar Ostareliya');
INSERT INTO "list" ("id", "value") VALUES ('ZWD', 'Dalar zimbabuwe');
INSERT INTO "list" ("id", "value") VALUES ('DKK', 'Danish Krone');
INSERT INTO "list" ("id", "value") VALUES ('DOP', 'Dominican Peso');
INSERT INTO "list" ("id", "value") VALUES ('NLG', 'Dutch Guilder');
INSERT INTO "list" ("id", "value") VALUES ('XCD', 'East Caribbean Dollar');
INSERT INTO "list" ("id", "value") VALUES ('DDM', 'East German Mark');
INSERT INTO "list" ("id", "value") VALUES ('ECS', 'Ecuadorian Sucre');
INSERT INTO "list" ("id", "value") VALUES ('ECV', 'Ecuadorian Unit of Constant Value');
INSERT INTO "list" ("id", "value") VALUES ('GQE', 'Equatorial Guinean Ekwele');
INSERT INTO "list" ("id", "value") VALUES ('EEK', 'Estonian Kroon');
INSERT INTO "list" ("id", "value") VALUES ('XEU', 'European Currency Unit');
INSERT INTO "list" ("id", "value") VALUES ('FKP', 'Falkland Islands Pound');
INSERT INTO "list" ("id", "value") VALUES ('GBP', 'Fam kin Ingila');
INSERT INTO "list" ("id", "value") VALUES ('EGP', 'Fam kin Masar');
INSERT INTO "list" ("id", "value") VALUES ('SHP', 'Fam kin San Helena');
INSERT INTO "list" ("id", "value") VALUES ('SDG', 'Fam kin Sudan');
INSERT INTO "list" ("id", "value") VALUES ('FJD', 'Fijian Dollar');
INSERT INTO "list" ("id", "value") VALUES ('FIM', 'Finnish Markka');
INSERT INTO "list" ("id", "value") VALUES ('FRF', 'French Franc');
INSERT INTO "list" ("id", "value") VALUES ('XFO', 'French Gold Franc');
INSERT INTO "list" ("id", "value") VALUES ('XFU', 'French UIC-Franc');
INSERT INTO "list" ("id", "value") VALUES ('GHS', 'GHS');
INSERT INTO "list" ("id", "value") VALUES ('GEK', 'Georgian Kupon Larit');
INSERT INTO "list" ("id", "value") VALUES ('GEL', 'Georgian Lari');
INSERT INTO "list" ("id", "value") VALUES ('DEM', 'German Mark');
INSERT INTO "list" ("id", "value") VALUES ('GIP', 'Gibraltar Pound');
INSERT INTO "list" ("id", "value") VALUES ('GRD', 'Greek Drachma');
INSERT INTO "list" ("id", "value") VALUES ('GTQ', 'Guatemalan Quetzal');
INSERT INTO "list" ("id", "value") VALUES ('GWP', 'Guinea-Bissau Peso');
INSERT INTO "list" ("id", "value") VALUES ('GNF', 'Guinean Franc');
INSERT INTO "list" ("id", "value") VALUES ('GYD', 'Guyanaese Dollar');
INSERT INTO "list" ("id", "value") VALUES ('HTG', 'Haitian Gourde');
INSERT INTO "list" ("id", "value") VALUES ('HNL', 'Honduran Lempira');
INSERT INTO "list" ("id", "value") VALUES ('HKD', 'Hong Kong Dollar');
INSERT INTO "list" ("id", "value") VALUES ('HUF', 'Hungarian Forint');
INSERT INTO "list" ("id", "value") VALUES ('ISK', 'Icelandic Króna');
INSERT INTO "list" ("id", "value") VALUES ('ISJ', 'Icelandic Króna (1918–1981)');
INSERT INTO "list" ("id", "value") VALUES ('IDR', 'Indonesian Rupiah');
INSERT INTO "list" ("id", "value") VALUES ('IRR', 'Iranian Rial');
INSERT INTO "list" ("id", "value") VALUES ('IQD', 'Iraqi Dinar');
INSERT INTO "list" ("id", "value") VALUES ('IEP', 'Irish Pound');
INSERT INTO "list" ("id", "value") VALUES ('ILS', 'Israeli New Shekel');
INSERT INTO "list" ("id", "value") VALUES ('ILP', 'Israeli Pound');
INSERT INTO "list" ("id", "value") VALUES ('ILR', 'Israeli Shekel (1980–1985)');
INSERT INTO "list" ("id", "value") VALUES ('ITL', 'Italian Lira');
INSERT INTO "list" ("id", "value") VALUES ('JMD', 'Jamaican Dollar');
INSERT INTO "list" ("id", "value") VALUES ('JOD', 'Jordanian Dinar');
INSERT INTO "list" ("id", "value") VALUES ('KZT', 'Kazakhstani Tenge');
INSERT INTO "list" ("id", "value") VALUES ('KWD', 'Kuwaiti Dinar');
INSERT INTO "list" ("id", "value") VALUES ('ZAR', 'Kuɗin Afirka Ta Kudu');
INSERT INTO "list" ("id", "value") VALUES ('DZD', 'Kuɗin Aljeriya');
INSERT INTO "list" ("id", "value") VALUES ('AOA', 'Kuɗin Angola');
INSERT INTO "list" ("id", "value") VALUES ('BHD', 'Kuɗin Baharan');
INSERT INTO "list" ("id", "value") VALUES ('BWP', 'Kuɗin Baswana');
INSERT INTO "list" ("id", "value") VALUES ('BIF', 'Kuɗin Burundi');
INSERT INTO "list" ("id", "value") VALUES ('CNY', 'Kuɗin Caina/Sin');
INSERT INTO "list" ("id", "value") VALUES ('ERN', 'Kuɗin Eritireya');
INSERT INTO "list" ("id", "value") VALUES ('GMD', 'Kuɗin Gambiya');
INSERT INTO "list" ("id", "value") VALUES ('GNS', 'Kuɗin Gini');
INSERT INTO "list" ("id", "value") VALUES ('ETB', 'Kuɗin Habasha');
INSERT INTO "list" ("id", "value") VALUES ('AED', 'Kuɗin Haɗaɗɗiyar Daular Larabawa');
INSERT INTO "list" ("id", "value") VALUES ('INR', 'Kuɗin Indiya');
INSERT INTO "list" ("id", "value") VALUES ('JPY', 'Kuɗin Japan');
INSERT INTO "list" ("id", "value") VALUES ('DJF', 'Kuɗin Jibuti');
INSERT INTO "list" ("id", "value") VALUES ('CDF', 'Kuɗin Kongo');
INSERT INTO "list" ("id", "value") VALUES ('KMF', 'Kuɗin Kwamoras');
INSERT INTO "list" ("id", "value") VALUES ('LSL', 'Kuɗin Lesoto');
INSERT INTO "list" ("id", "value") VALUES ('LYD', 'Kuɗin Libiya');
INSERT INTO "list" ("id", "value") VALUES ('SZL', 'Kuɗin Lilangeni');
INSERT INTO "list" ("id", "value") VALUES ('MGA', 'Kuɗin Madagaskar');
INSERT INTO "list" ("id", "value") VALUES ('MWK', 'Kuɗin Malawi');
INSERT INTO "list" ("id", "value") VALUES ('MAD', 'Kuɗin Maroko');
INSERT INTO "list" ("id", "value") VALUES ('MRO', 'Kuɗin Moritaniya');
INSERT INTO "list" ("id", "value") VALUES ('MUR', 'Kuɗin Moritus');
INSERT INTO "list" ("id", "value") VALUES ('MZM', 'Kuɗin Mozambik');
INSERT INTO "list" ("id", "value") VALUES ('RWF', 'Kuɗin Ruwanda');
INSERT INTO "list" ("id", "value") VALUES ('SCR', 'Kuɗin Saishal');
INSERT INTO "list" ("id", "value") VALUES ('SLL', 'Kuɗin Salewo');
INSERT INTO "list" ("id", "value") VALUES ('STD', 'Kuɗin Sawo Tome da Paransip');
INSERT INTO "list" ("id", "value") VALUES ('XAF', 'Kuɗin Sefa na Afirka Ta Tsakiya');
INSERT INTO "list" ("id", "value") VALUES ('XOF', 'Kuɗin Sefa na Afirka Ta Yamma');
INSERT INTO "list" ("id", "value") VALUES ('CHF', 'Kuɗin Suwizalan');
INSERT INTO "list" ("id", "value") VALUES ('CVE', 'Kuɗin Tsibiran Kap Barde');
INSERT INTO "list" ("id", "value") VALUES ('TND', 'Kuɗin Tunisiya');
INSERT INTO "list" ("id", "value") VALUES ('ZMW', 'Kuɗin Zambiya');
INSERT INTO "list" ("id", "value") VALUES ('ZMK', 'Kuɗin Zambiya (1968–2012)');
INSERT INTO "list" ("id", "value") VALUES ('KGS', 'Kyrgystani Som');
INSERT INTO "list" ("id", "value") VALUES ('LAK', 'Laotian Kip');
INSERT INTO "list" ("id", "value") VALUES ('LVL', 'Latvian Lats');
INSERT INTO "list" ("id", "value") VALUES ('LVR', 'Latvian Ruble');
INSERT INTO "list" ("id", "value") VALUES ('LBP', 'Lebanese Pound');
INSERT INTO "list" ("id", "value") VALUES ('LTL', 'Lithuanian Litas');
INSERT INTO "list" ("id", "value") VALUES ('LTT', 'Lithuanian Talonas');
INSERT INTO "list" ("id", "value") VALUES ('LUL', 'Luxembourg Financial Franc');
INSERT INTO "list" ("id", "value") VALUES ('LUC', 'Luxembourgian Convertible Franc');
INSERT INTO "list" ("id", "value") VALUES ('LUF', 'Luxembourgian Franc');
INSERT INTO "list" ("id", "value") VALUES ('MOP', 'Macanese Pataca');
INSERT INTO "list" ("id", "value") VALUES ('MKD', 'Macedonian Denar');
INSERT INTO "list" ("id", "value") VALUES ('MKN', 'Macedonian Denar (1992–1993)');
INSERT INTO "list" ("id", "value") VALUES ('MGF', 'Malagasy Franc');
INSERT INTO "list" ("id", "value") VALUES ('MYR', 'Malaysian Ringgit');
INSERT INTO "list" ("id", "value") VALUES ('MVR', 'Maldivian Rufiyaa');
INSERT INTO "list" ("id", "value") VALUES ('MVP', 'Maldivian Rupee (1947–1981)');
INSERT INTO "list" ("id", "value") VALUES ('MLF', 'Malian Franc');
INSERT INTO "list" ("id", "value") VALUES ('MTL', 'Maltese Lira');
INSERT INTO "list" ("id", "value") VALUES ('MTP', 'Maltese Pound');
INSERT INTO "list" ("id", "value") VALUES ('MXV', 'Mexican Investment Unit');
INSERT INTO "list" ("id", "value") VALUES ('MXN', 'Mexican Peso');
INSERT INTO "list" ("id", "value") VALUES ('MXP', 'Mexican Silver Peso (1861–1992)');
INSERT INTO "list" ("id", "value") VALUES ('MDC', 'Moldovan Cupon');
INSERT INTO "list" ("id", "value") VALUES ('MDL', 'Moldovan Leu');
INSERT INTO "list" ("id", "value") VALUES ('MCF', 'Monegasque Franc');
INSERT INTO "list" ("id", "value") VALUES ('MNT', 'Mongolian Tugrik');
INSERT INTO "list" ("id", "value") VALUES ('MAF', 'Moroccan Franc');
INSERT INTO "list" ("id", "value") VALUES ('MZE', 'Mozambican Escudo');
INSERT INTO "list" ("id", "value") VALUES ('MZN', 'Mozambican Metical');
INSERT INTO "list" ("id", "value") VALUES ('MMK', 'Myanmar Kyat');
INSERT INTO "list" ("id", "value") VALUES ('NGN', 'Naira');
INSERT INTO "list" ("id", "value") VALUES ('NPR', 'Nepalese Rupee');
INSERT INTO "list" ("id", "value") VALUES ('ANG', 'Netherlands Antillean Guilder');
INSERT INTO "list" ("id", "value") VALUES ('TWD', 'New Taiwan Dollar');
INSERT INTO "list" ("id", "value") VALUES ('NZD', 'New Zealand Dollar');
INSERT INTO "list" ("id", "value") VALUES ('NIO', 'Nicaraguan Córdoba');
INSERT INTO "list" ("id", "value") VALUES ('NIC', 'Nicaraguan Córdoba (1988–1991)');
INSERT INTO "list" ("id", "value") VALUES ('KPW', 'North Korean Won');
INSERT INTO "list" ("id", "value") VALUES ('NOK', 'Norwegian Krone');
INSERT INTO "list" ("id", "value") VALUES ('OMR', 'Omani Rial');
INSERT INTO "list" ("id", "value") VALUES ('PKR', 'Pakistani Rupee');
INSERT INTO "list" ("id", "value") VALUES ('PAB', 'Panamanian Balboa');
INSERT INTO "list" ("id", "value") VALUES ('PGK', 'Papua New Guinean Kina');
INSERT INTO "list" ("id", "value") VALUES ('PYG', 'Paraguayan Guarani');
INSERT INTO "list" ("id", "value") VALUES ('PEI', 'Peruvian Inti');
INSERT INTO "list" ("id", "value") VALUES ('PEN', 'Peruvian Sol');
INSERT INTO "list" ("id", "value") VALUES ('PES', 'Peruvian Sol (1863–1965)');
INSERT INTO "list" ("id", "value") VALUES ('PHP', 'Philippine Peso');
INSERT INTO "list" ("id", "value") VALUES ('PLN', 'Polish Zloty');
INSERT INTO "list" ("id", "value") VALUES ('PLZ', 'Polish Zloty (1950–1995)');
INSERT INTO "list" ("id", "value") VALUES ('PTE', 'Portuguese Escudo');
INSERT INTO "list" ("id", "value") VALUES ('GWE', 'Portuguese Guinea Escudo');
INSERT INTO "list" ("id", "value") VALUES ('QAR', 'Qatari Rial');
INSERT INTO "list" ("id", "value") VALUES ('XRE', 'RINET Funds');
INSERT INTO "list" ("id", "value") VALUES ('RHD', 'Rhodesian Dollar');
INSERT INTO "list" ("id", "value") VALUES ('SAR', 'Riyal');
INSERT INTO "list" ("id", "value") VALUES ('RON', 'Romanian Leu');
INSERT INTO "list" ("id", "value") VALUES ('ROL', 'Romanian Leu (1952–2006)');
INSERT INTO "list" ("id", "value") VALUES ('RUB', 'Russian Ruble');
INSERT INTO "list" ("id", "value") VALUES ('RUR', 'Russian Ruble (1991–1998)');
INSERT INTO "list" ("id", "value") VALUES ('SVC', 'Salvadoran Colón');
INSERT INTO "list" ("id", "value") VALUES ('WST', 'Samoan Tala');
INSERT INTO "list" ("id", "value") VALUES ('RSD', 'Serbian Dinar');
INSERT INTO "list" ("id", "value") VALUES ('CSD', 'Serbian Dinar (2002–2006)');
INSERT INTO "list" ("id", "value") VALUES ('SGD', 'Singapore Dollar');
INSERT INTO "list" ("id", "value") VALUES ('SKK', 'Slovak Koruna');
INSERT INTO "list" ("id", "value") VALUES ('SIT', 'Slovenian Tolar');
INSERT INTO "list" ("id", "value") VALUES ('SBD', 'Solomon Islands Dollar');
INSERT INTO "list" ("id", "value") VALUES ('ZAL', 'South African Rand (financial)');
INSERT INTO "list" ("id", "value") VALUES ('KRH', 'South Korean Hwan (1953–1962)');
INSERT INTO "list" ("id", "value") VALUES ('KRW', 'South Korean Won');
INSERT INTO "list" ("id", "value") VALUES ('KRO', 'South Korean Won (1945–1953)');
INSERT INTO "list" ("id", "value") VALUES ('SSP', 'South Sudanese Pound');
INSERT INTO "list" ("id", "value") VALUES ('SUR', 'Soviet Rouble');
INSERT INTO "list" ("id", "value") VALUES ('ESP', 'Spanish Peseta');
INSERT INTO "list" ("id", "value") VALUES ('ESA', 'Spanish Peseta (A account)');
INSERT INTO "list" ("id", "value") VALUES ('ESB', 'Spanish Peseta (convertible account)');
INSERT INTO "list" ("id", "value") VALUES ('LKR', 'Sri Lankan Rupee');
INSERT INTO "list" ("id", "value") VALUES ('SDD', 'Sudanese Dinar (1992–2007)');
INSERT INTO "list" ("id", "value") VALUES ('SDP', 'Sudanese Pound (1957–1998)');
INSERT INTO "list" ("id", "value") VALUES ('UGX', 'Sule Yuganda');
INSERT INTO "list" ("id", "value") VALUES ('KES', 'Sulen Kenya');
INSERT INTO "list" ("id", "value") VALUES ('SOS', 'Sulen Somaliya');
INSERT INTO "list" ("id", "value") VALUES ('TZS', 'Sulen Tanzaniya');
INSERT INTO "list" ("id", "value") VALUES ('SRD', 'Surinamese Dollar');
INSERT INTO "list" ("id", "value") VALUES ('SRG', 'Surinamese Guilder');
INSERT INTO "list" ("id", "value") VALUES ('SEK', 'Swedish Krona');
INSERT INTO "list" ("id", "value") VALUES ('SYP', 'Syrian Pound');
INSERT INTO "list" ("id", "value") VALUES ('TJR', 'Tajikistani Ruble');
INSERT INTO "list" ("id", "value") VALUES ('TJS', 'Tajikistani Somoni');
INSERT INTO "list" ("id", "value") VALUES ('THB', 'Thai Baht');
INSERT INTO "list" ("id", "value") VALUES ('TPE', 'Timorese Escudo');
INSERT INTO "list" ("id", "value") VALUES ('TOP', 'Tongan Paʻanga');
INSERT INTO "list" ("id", "value") VALUES ('TTD', 'Trinidad & Tobago Dollar');
INSERT INTO "list" ("id", "value") VALUES ('TRY', 'Turkish Lira');
INSERT INTO "list" ("id", "value") VALUES ('TRL', 'Turkish Lira (1922–2005)');
INSERT INTO "list" ("id", "value") VALUES ('TMT', 'Turkmenistani Manat');
INSERT INTO "list" ("id", "value") VALUES ('TMM', 'Turkmenistani Manat (1993–2009)');
INSERT INTO "list" ("id", "value") VALUES ('USN', 'US Dollar (Next day)');
INSERT INTO "list" ("id", "value") VALUES ('USS', 'US Dollar (Same day)');
INSERT INTO "list" ("id", "value") VALUES ('UGS', 'Ugandan Shilling (1966–1987)');
INSERT INTO "list" ("id", "value") VALUES ('UAH', 'Ukrainian Hryvnia');
INSERT INTO "list" ("id", "value") VALUES ('UAK', 'Ukrainian Karbovanets');
INSERT INTO "list" ("id", "value") VALUES ('UYU', 'Uruguayan Peso');
INSERT INTO "list" ("id", "value") VALUES ('UYP', 'Uruguayan Peso (1975–1993)');
INSERT INTO "list" ("id", "value") VALUES ('UYI', 'Uruguayan Peso (Indexed Units)');
INSERT INTO "list" ("id", "value") VALUES ('UZS', 'Uzbekistani Som');
INSERT INTO "list" ("id", "value") VALUES ('VUV', 'Vanuatu Vatu');
INSERT INTO "list" ("id", "value") VALUES ('VEF', 'Venezuelan Bolívar');
INSERT INTO "list" ("id", "value") VALUES ('VEB', 'Venezuelan Bolívar (1871–2008)');
INSERT INTO "list" ("id", "value") VALUES ('VND', 'Vietnamese Dong');
INSERT INTO "list" ("id", "value") VALUES ('VNN', 'Vietnamese Dong (1978–1985)');
INSERT INTO "list" ("id", "value") VALUES ('CHE', 'WIR Euro');
INSERT INTO "list" ("id", "value") VALUES ('CHW', 'WIR Franc');
INSERT INTO "list" ("id", "value") VALUES ('YDD', 'Yemeni Dinar');
INSERT INTO "list" ("id", "value") VALUES ('YER', 'Yemeni Rial');
INSERT INTO "list" ("id", "value") VALUES ('YUN', 'Yugoslavian Convertible Dinar (1990–1992)');
INSERT INTO "list" ("id", "value") VALUES ('YUD', 'Yugoslavian Hard Dinar (1966–1990)');
INSERT INTO "list" ("id", "value") VALUES ('YUM', 'Yugoslavian New Dinar (1994–2002)');
INSERT INTO "list" ("id", "value") VALUES ('YUR', 'Yugoslavian Reformed Dinar (1992–1993)');
INSERT INTO "list" ("id", "value") VALUES ('EUR', 'Yuro');
INSERT INTO "list" ("id", "value") VALUES ('ZRN', 'Zairean New Zaire (1993–1998)');
INSERT INTO "list" ("id", "value") VALUES ('ZRZ', 'Zairean Zaire (1971–1993)');
INSERT INTO "list" ("id", "value") VALUES ('ZWR', 'Zimbabwean Dollar (2008)');
INSERT INTO "list" ("id", "value") VALUES ('ZWL', 'Zimbabwean Dollar (2009)');
| {
"pile_set_name": "Github"
} |
---
version: 0.0.1
author: xuld <[email protected]>
---
# 文字特效
文字特效
| {
"pile_set_name": "Github"
} |
/*=============================================================================
Copyright (c) 2001-2014 Joel de Guzman
Copyright (c) 2001-2011 Hartmut Kaiser
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)
=============================================================================*/
#if !defined(SPIRIT_KLEENE_JANUARY_07_2007_0818AM)
#define SPIRIT_KLEENE_JANUARY_07_2007_0818AM
#include <boost/spirit/home/x3/core/parser.hpp>
#include <boost/spirit/home/x3/support/traits/container_traits.hpp>
#include <boost/spirit/home/x3/support/traits/attribute_of.hpp>
#include <boost/spirit/home/x3/core/detail/parse_into_container.hpp>
namespace boost { namespace spirit { namespace x3
{
template <typename Subject>
struct kleene : unary_parser<Subject, kleene<Subject>>
{
typedef unary_parser<Subject, kleene<Subject>> base_type;
static bool const handles_container = true;
kleene(Subject const& subject)
: base_type(subject) {}
template <typename Iterator, typename Context
, typename RContext, typename Attribute>
bool parse(Iterator& first, Iterator const& last
, Context const& context, RContext& rcontext, Attribute& attr) const
{
while (detail::parse_into_container(
this->subject, first, last, context, rcontext, attr))
;
return true;
}
};
template <typename Subject>
inline kleene<typename extension::as_parser<Subject>::value_type>
operator*(Subject const& subject)
{
return { as_parser(subject) };
}
}}}
namespace boost { namespace spirit { namespace x3 { namespace traits
{
template <typename Subject, typename Context>
struct attribute_of<x3::kleene<Subject>, Context>
: build_container<
typename attribute_of<Subject, Context>::type> {};
}}}}
#endif
| {
"pile_set_name": "Github"
} |
/*
* sha1.cpp
*
* Copyright (C) 1998, 2009
* Paul E. Jones <[email protected]>
* All Rights Reserved.
*
*****************************************************************************
* $Id$
*****************************************************************************
*
* Description:
* This class implements the Secure Hashing Standard as defined
* in FIPS PUB 180-1 published April 17, 1995.
*
* The Secure Hashing Standard, which uses the Secure Hashing
* Algorithm (SHA), produces a 160-bit message digest for a
* given data stream. In theory, it is highly improbable that
* two messages will produce the same message digest. Therefore,
* this algorithm can serve as a means of providing a "fingerprint"
* for a message.
*
* Portability Issues:
* SHA-1 is defined in terms of 32-bit "words". This code was
* written with the expectation that the processor has at least
* a 32-bit machine word size. If the machine word size is larger,
* the code should still function properly. One caveat to that
* is that the input functions taking characters and character arrays
* assume that only 8 bits of information are stored in each character.
*
* Caveats:
* SHA-1 is designed to work with messages less than 2^64 bits long.
* Although SHA-1 allows a message digest to be generated for
* messages of any number of bits less than 2^64, this implementation
* only works with messages with a length that is a multiple of 8
* bits.
*
*/
#include "sha1.hpp"
/*
* SHA1
*
* Description:
* This is the constructor for the sha1 class.
*
* Parameters:
* None.
*
* Returns:
* Nothing.
*
* Comments:
*
*/
SHA1::SHA1()
: Length_Low(0)
, Length_High(0)
, Message_Block()
, Message_Block_Index(0)
, Computed(false)
, Corrupted(false)
{
Reset();
}
/*
* ~SHA1
*
* Description:
* This is the destructor for the sha1 class
*
* Parameters:
* None.
*
* Returns:
* Nothing.
*
* Comments:
*
*/
SHA1::~SHA1()
{
// The destructor does nothing
}
/*
* Reset
*
* Description:
* This function will initialize the sha1 class member variables
* in preparation for computing a new message digest.
*
* Parameters:
* None.
*
* Returns:
* Nothing.
*
* Comments:
*
*/
void SHA1::Reset()
{
Length_Low = 0;
Length_High = 0;
Message_Block_Index = 0;
H[0] = 0x67452301;
H[1] = 0xEFCDAB89;
H[2] = 0x98BADCFE;
H[3] = 0x10325476;
H[4] = 0xC3D2E1F0;
Computed = false;
Corrupted = false;
}
/*
* Result
*
* Description:
* This function will return the 160-bit message digest into the
* array provided.
*
* Parameters:
* message_digest_array: [out]
* This is an array of five unsigned integers which will be filled
* with the message digest that has been computed.
*
* Returns:
* True if successful, false if it failed.
*
* Comments:
*
*/
bool SHA1::Result(unsigned *message_digest_array)
{
int i; // Counter
if (Corrupted)
{
return false;
}
if (!Computed)
{
PadMessage();
Computed = true;
}
for(i = 0; i < 5; i++)
{
message_digest_array[i] = H[i];
}
return true;
}
/*
* Input
*
* Description:
* This function accepts an array of octets as the next portion of
* the message.
*
* Parameters:
* message_array: [in]
* An array of characters representing the next portion of the
* message.
*
* Returns:
* Nothing.
*
* Comments:
*
*/
void SHA1::Input( const unsigned char *message_array,
unsigned length)
{
if (!length)
{
return;
}
if (Computed || Corrupted)
{
Corrupted = true;
return;
}
while(length-- && !Corrupted)
{
Message_Block[Message_Block_Index++] = (*message_array & 0xFF);
Length_Low += 8;
Length_Low &= 0xFFFFFFFF; // Force it to 32 bits
if (Length_Low == 0)
{
Length_High++;
Length_High &= 0xFFFFFFFF; // Force it to 32 bits
if (Length_High == 0)
{
Corrupted = true; // Message is too long
}
}
if (Message_Block_Index == 64)
{
ProcessMessageBlock();
}
message_array++;
}
}
/*
* Input
*
* Description:
* This function accepts an array of octets as the next portion of
* the message.
*
* Parameters:
* message_array: [in]
* An array of characters representing the next portion of the
* message.
* length: [in]
* The length of the message_array
*
* Returns:
* Nothing.
*
* Comments:
*
*/
void SHA1::Input( const char *message_array,
unsigned length)
{
Input((unsigned char *) message_array, length);
}
/*
* Input
*
* Description:
* This function accepts a single octets as the next message element.
*
* Parameters:
* message_element: [in]
* The next octet in the message.
*
* Returns:
* Nothing.
*
* Comments:
*
*/
void SHA1::Input(unsigned char message_element)
{
Input(&message_element, 1);
}
/*
* Input
*
* Description:
* This function accepts a single octet as the next message element.
*
* Parameters:
* message_element: [in]
* The next octet in the message.
*
* Returns:
* Nothing.
*
* Comments:
*
*/
void SHA1::Input(char message_element)
{
Input((unsigned char *) &message_element, 1);
}
/*
* operator<<
*
* Description:
* This operator makes it convenient to provide character strings to
* the SHA1 object for processing.
*
* Parameters:
* message_array: [in]
* The character array to take as input.
*
* Returns:
* A reference to the SHA1 object.
*
* Comments:
* Each character is assumed to hold 8 bits of information.
*
*/
SHA1& SHA1::operator<<(const char *message_array)
{
const char *p = message_array;
while(*p)
{
Input(*p);
p++;
}
return *this;
}
/*
* operator<<
*
* Description:
* This operator makes it convenient to provide character strings to
* the SHA1 object for processing.
*
* Parameters:
* message_array: [in]
* The character array to take as input.
*
* Returns:
* A reference to the SHA1 object.
*
* Comments:
* Each character is assumed to hold 8 bits of information.
*
*/
SHA1& SHA1::operator<<(const unsigned char *message_array)
{
const unsigned char *p = message_array;
while(*p)
{
Input(*p);
p++;
}
return *this;
}
/*
* operator<<
*
* Description:
* This function provides the next octet in the message.
*
* Parameters:
* message_element: [in]
* The next octet in the message
*
* Returns:
* A reference to the SHA1 object.
*
* Comments:
* The character is assumed to hold 8 bits of information.
*
*/
SHA1& SHA1::operator<<(const char message_element)
{
Input((unsigned char *) &message_element, 1);
return *this;
}
/*
* operator<<
*
* Description:
* This function provides the next octet in the message.
*
* Parameters:
* message_element: [in]
* The next octet in the message
*
* Returns:
* A reference to the SHA1 object.
*
* Comments:
* The character is assumed to hold 8 bits of information.
*
*/
SHA1& SHA1::operator<<(const unsigned char message_element)
{
Input(&message_element, 1);
return *this;
}
/*
* ProcessMessageBlock
*
* Description:
* This function will process the next 512 bits of the message
* stored in the Message_Block array.
*
* Parameters:
* None.
*
* Returns:
* Nothing.
*
* Comments:
* Many of the variable names in this function, especially the single
* character names, were used because those were the names used
* in the publication.
*
*/
void SHA1::ProcessMessageBlock()
{
const unsigned K[] = { // Constants defined for SHA-1
0x5A827999,
0x6ED9EBA1,
0x8F1BBCDC,
0xCA62C1D6
};
int t; // Loop counter
unsigned temp; // Temporary word value
unsigned W[80]; // Word sequence
unsigned A, B, C, D, E; // Word buffers
/*
* Initialize the first 16 words in the array W
*/
for(t = 0; t < 16; t++)
{
W[t] = ((unsigned) Message_Block[t * 4]) << 24;
W[t] |= ((unsigned) Message_Block[t * 4 + 1]) << 16;
W[t] |= ((unsigned) Message_Block[t * 4 + 2]) << 8;
W[t] |= ((unsigned) Message_Block[t * 4 + 3]);
}
for(t = 16; t < 80; t++)
{
W[t] = CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]);
}
A = H[0];
B = H[1];
C = H[2];
D = H[3];
E = H[4];
for(t = 0; t < 20; t++)
{
temp = CircularShift(5,A) + ((B & C) | ((~B) & D)) + E + W[t] + K[0];
temp &= 0xFFFFFFFF;
E = D;
D = C;
C = CircularShift(30,B);
B = A;
A = temp;
}
for(t = 20; t < 40; t++)
{
temp = CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[1];
temp &= 0xFFFFFFFF;
E = D;
D = C;
C = CircularShift(30,B);
B = A;
A = temp;
}
for(t = 40; t < 60; t++)
{
temp = CircularShift(5,A) +
((B & C) | (B & D) | (C & D)) + E + W[t] + K[2];
temp &= 0xFFFFFFFF;
E = D;
D = C;
C = CircularShift(30,B);
B = A;
A = temp;
}
for(t = 60; t < 80; t++)
{
temp = CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[3];
temp &= 0xFFFFFFFF;
E = D;
D = C;
C = CircularShift(30,B);
B = A;
A = temp;
}
H[0] = (H[0] + A) & 0xFFFFFFFF;
H[1] = (H[1] + B) & 0xFFFFFFFF;
H[2] = (H[2] + C) & 0xFFFFFFFF;
H[3] = (H[3] + D) & 0xFFFFFFFF;
H[4] = (H[4] + E) & 0xFFFFFFFF;
Message_Block_Index = 0;
}
/*
* PadMessage
*
* Description:
* According to the standard, the message must be padded to an even
* 512 bits. The first padding bit must be a '1'. The last 64 bits
* represent the length of the original message. All bits in between
* should be 0. This function will pad the message according to those
* rules by filling the message_block array accordingly. It will also
* call ProcessMessageBlock() appropriately. When it returns, it
* can be assumed that the message digest has been computed.
*
* Parameters:
* None.
*
* Returns:
* Nothing.
*
* Comments:
*
*/
void SHA1::PadMessage()
{
/*
* Check to see if the current message block is too small to hold
* the initial padding bits and length. If so, we will pad the
* block, process it, and then continue padding into a second block.
*/
if (Message_Block_Index > 55)
{
Message_Block[Message_Block_Index++] = 0x80;
while(Message_Block_Index < 64)
{
Message_Block[Message_Block_Index++] = 0;
}
ProcessMessageBlock();
while(Message_Block_Index < 56)
{
Message_Block[Message_Block_Index++] = 0;
}
}
else
{
Message_Block[Message_Block_Index++] = 0x80;
while(Message_Block_Index < 56)
{
Message_Block[Message_Block_Index++] = 0;
}
}
/*
* Store the message length as the last 8 octets
*/
Message_Block[56] = (Length_High >> 24) & 0xFF;
Message_Block[57] = (Length_High >> 16) & 0xFF;
Message_Block[58] = (Length_High >> 8) & 0xFF;
Message_Block[59] = (Length_High) & 0xFF;
Message_Block[60] = (Length_Low >> 24) & 0xFF;
Message_Block[61] = (Length_Low >> 16) & 0xFF;
Message_Block[62] = (Length_Low >> 8) & 0xFF;
Message_Block[63] = (Length_Low) & 0xFF;
ProcessMessageBlock();
}
/*
* CircularShift
*
* Description:
* This member function will perform a circular shifting operation.
*
* Parameters:
* bits: [in]
* The number of bits to shift (1-31)
* word: [in]
* The value to shift (assumes a 32-bit integer)
*
* Returns:
* The shifted value.
*
* Comments:
*
*/
unsigned SHA1::CircularShift(int bits, unsigned word)
{
return ((word << bits) & 0xFFFFFFFF) | ((word & 0xFFFFFFFF) >> (32-bits));
}
| {
"pile_set_name": "Github"
} |
// AFSecurityPolicy.m
// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// 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 "AFSecurityPolicy.h"
#import <AssertMacros.h>
#if !TARGET_OS_IOS && !TARGET_OS_WATCH && !TARGET_OS_TV
static NSData * AFSecKeyGetData(SecKeyRef key) {
CFDataRef data = NULL;
__Require_noErr_Quiet(SecItemExport(key, kSecFormatUnknown, kSecItemPemArmour, NULL, &data), _out);
return (__bridge_transfer NSData *)data;
_out:
if (data) {
CFRelease(data);
}
return nil;
}
#endif
static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) {
#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV
return [(__bridge id)key1 isEqual:(__bridge id)key2];
#else
return [AFSecKeyGetData(key1) isEqual:AFSecKeyGetData(key2)];
#endif
}
static id AFPublicKeyForCertificate(NSData *certificate) {
id allowedPublicKey = nil;
SecCertificateRef allowedCertificate;
SecCertificateRef allowedCertificates[1];
CFArrayRef tempCertificates = nil;
SecPolicyRef policy = nil;
SecTrustRef allowedTrust = nil;
SecTrustResultType result;
allowedCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificate);
__Require_Quiet(allowedCertificate != NULL, _out);
allowedCertificates[0] = allowedCertificate;
tempCertificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 1, NULL);
policy = SecPolicyCreateBasicX509();
__Require_noErr_Quiet(SecTrustCreateWithCertificates(tempCertificates, policy, &allowedTrust), _out);
__Require_noErr_Quiet(SecTrustEvaluate(allowedTrust, &result), _out);
allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust);
_out:
if (allowedTrust) {
CFRelease(allowedTrust);
}
if (policy) {
CFRelease(policy);
}
if (tempCertificates) {
CFRelease(tempCertificates);
}
if (allowedCertificate) {
CFRelease(allowedCertificate);
}
return allowedPublicKey;
}
static BOOL AFServerTrustIsValid(SecTrustRef serverTrust) {
BOOL isValid = NO;
SecTrustResultType result;
__Require_noErr_Quiet(SecTrustEvaluate(serverTrust, &result), _out);
isValid = (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed);
_out:
return isValid;
}
static NSArray * AFCertificateTrustChainForServerTrust(SecTrustRef serverTrust) {
CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust);
NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount];
for (CFIndex i = 0; i < certificateCount; i++) {
SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i);
[trustChain addObject:(__bridge_transfer NSData *)SecCertificateCopyData(certificate)];
}
return [NSArray arrayWithArray:trustChain];
}
static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
SecPolicyRef policy = SecPolicyCreateBasicX509();
CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust);
NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount];
for (CFIndex i = 0; i < certificateCount; i++) {
SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i);
SecCertificateRef someCertificates[] = {certificate};
CFArrayRef certificates = CFArrayCreate(NULL, (const void **)someCertificates, 1, NULL);
SecTrustRef trust;
__Require_noErr_Quiet(SecTrustCreateWithCertificates(certificates, policy, &trust), _out);
SecTrustResultType result;
__Require_noErr_Quiet(SecTrustEvaluate(trust, &result), _out);
[trustChain addObject:(__bridge_transfer id)SecTrustCopyPublicKey(trust)];
_out:
if (trust) {
CFRelease(trust);
}
if (certificates) {
CFRelease(certificates);
}
continue;
}
CFRelease(policy);
return [NSArray arrayWithArray:trustChain];
}
#pragma mark -
@interface AFSecurityPolicy()
@property (readwrite, nonatomic, assign) AFSSLPinningMode SSLPinningMode;
@property (readwrite, nonatomic, strong) NSSet *pinnedPublicKeys;
@end
@implementation AFSecurityPolicy
+ (NSSet *)certificatesInBundle:(NSBundle *)bundle {
NSArray *paths = [bundle pathsForResourcesOfType:@"cer" inDirectory:@"."];
NSMutableSet *certificates = [NSMutableSet setWithCapacity:[paths count]];
for (NSString *path in paths) {
NSData *certificateData = [NSData dataWithContentsOfFile:path];
[certificates addObject:certificateData];
}
return [NSSet setWithSet:certificates];
}
+ (NSSet *)defaultPinnedCertificates {
static NSSet *_defaultPinnedCertificates = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
_defaultPinnedCertificates = [self certificatesInBundle:bundle];
});
return _defaultPinnedCertificates;
}
+ (instancetype)defaultPolicy {
AFSecurityPolicy *securityPolicy = [[self alloc] init];
securityPolicy.SSLPinningMode = AFSSLPinningModeNone;
return securityPolicy;
}
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode {
return [self policyWithPinningMode:pinningMode withPinnedCertificates:[self defaultPinnedCertificates]];
}
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates {
AFSecurityPolicy *securityPolicy = [[self alloc] init];
securityPolicy.SSLPinningMode = pinningMode;
[securityPolicy setPinnedCertificates:pinnedCertificates];
return securityPolicy;
}
- (instancetype)init {
self = [super init];
if (!self) {
return nil;
}
self.validatesDomainName = YES;
return self;
}
- (void)setPinnedCertificates:(NSSet *)pinnedCertificates {
_pinnedCertificates = pinnedCertificates;
if (self.pinnedCertificates) {
NSMutableSet *mutablePinnedPublicKeys = [NSMutableSet setWithCapacity:[self.pinnedCertificates count]];
for (NSData *certificate in self.pinnedCertificates) {
id publicKey = AFPublicKeyForCertificate(certificate);
if (!publicKey) {
continue;
}
[mutablePinnedPublicKeys addObject:publicKey];
}
self.pinnedPublicKeys = [NSSet setWithSet:mutablePinnedPublicKeys];
} else {
self.pinnedPublicKeys = nil;
}
}
#pragma mark -
- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust
forDomain:(NSString *)domain
{
if (domain && self.allowInvalidCertificates && self.validatesDomainName && (self.SSLPinningMode == AFSSLPinningModeNone || [self.pinnedCertificates count] == 0)) {
// https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/OverridingSSLChainValidationCorrectly.html
// According to the docs, you should only trust your provided certs for evaluation.
// Pinned certificates are added to the trust. Without pinned certificates,
// there is nothing to evaluate against.
//
// From Apple Docs:
// "Do not implicitly trust self-signed certificates as anchors (kSecTrustOptionImplicitAnchors).
// Instead, add your own (self-signed) CA certificate to the list of trusted anchors."
NSLog(@"In order to validate a domain name for self signed certificates, you MUST use pinning.");
return NO;
}
NSMutableArray *policies = [NSMutableArray array];
if (self.validatesDomainName) {
[policies addObject:(__bridge_transfer id)SecPolicyCreateSSL(true, (__bridge CFStringRef)domain)];
} else {
[policies addObject:(__bridge_transfer id)SecPolicyCreateBasicX509()];
}
SecTrustSetPolicies(serverTrust, (__bridge CFArrayRef)policies);
if (self.SSLPinningMode == AFSSLPinningModeNone) {
return self.allowInvalidCertificates || AFServerTrustIsValid(serverTrust);
} else if (!AFServerTrustIsValid(serverTrust) && !self.allowInvalidCertificates) {
return NO;
}
switch (self.SSLPinningMode) {
case AFSSLPinningModeNone:
default:
return NO;
case AFSSLPinningModeCertificate: {
NSMutableArray *pinnedCertificates = [NSMutableArray array];
for (NSData *certificateData in self.pinnedCertificates) {
[pinnedCertificates addObject:(__bridge_transfer id)SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificateData)];
}
SecTrustSetAnchorCertificates(serverTrust, (__bridge CFArrayRef)pinnedCertificates);
if (!AFServerTrustIsValid(serverTrust)) {
return NO;
}
// obtain the chain after being validated, which *should* contain the pinned certificate in the last position (if it's the Root CA)
NSArray *serverCertificates = AFCertificateTrustChainForServerTrust(serverTrust);
for (NSData *trustChainCertificate in [serverCertificates reverseObjectEnumerator]) {
if ([self.pinnedCertificates containsObject:trustChainCertificate]) {
return YES;
}
}
return NO;
}
case AFSSLPinningModePublicKey: {
NSUInteger trustedPublicKeyCount = 0;
NSArray *publicKeys = AFPublicKeyTrustChainForServerTrust(serverTrust);
for (id trustChainPublicKey in publicKeys) {
for (id pinnedPublicKey in self.pinnedPublicKeys) {
if (AFSecKeyIsEqualToKey((__bridge SecKeyRef)trustChainPublicKey, (__bridge SecKeyRef)pinnedPublicKey)) {
trustedPublicKeyCount += 1;
}
}
}
return trustedPublicKeyCount > 0;
}
}
return NO;
}
#pragma mark - NSKeyValueObserving
+ (NSSet *)keyPathsForValuesAffectingPinnedPublicKeys {
return [NSSet setWithObject:@"pinnedCertificates"];
}
#pragma mark - NSSecureCoding
+ (BOOL)supportsSecureCoding {
return YES;
}
- (instancetype)initWithCoder:(NSCoder *)decoder {
self = [self init];
if (!self) {
return nil;
}
self.SSLPinningMode = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(SSLPinningMode))] unsignedIntegerValue];
self.allowInvalidCertificates = [decoder decodeBoolForKey:NSStringFromSelector(@selector(allowInvalidCertificates))];
self.validatesDomainName = [decoder decodeBoolForKey:NSStringFromSelector(@selector(validatesDomainName))];
self.pinnedCertificates = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(pinnedCertificates))];
return self;
}
- (void)encodeWithCoder:(NSCoder *)coder {
[coder encodeObject:[NSNumber numberWithUnsignedInteger:self.SSLPinningMode] forKey:NSStringFromSelector(@selector(SSLPinningMode))];
[coder encodeBool:self.allowInvalidCertificates forKey:NSStringFromSelector(@selector(allowInvalidCertificates))];
[coder encodeBool:self.validatesDomainName forKey:NSStringFromSelector(@selector(validatesDomainName))];
[coder encodeObject:self.pinnedCertificates forKey:NSStringFromSelector(@selector(pinnedCertificates))];
}
#pragma mark - NSCopying
- (instancetype)copyWithZone:(NSZone *)zone {
AFSecurityPolicy *securityPolicy = [[[self class] allocWithZone:zone] init];
securityPolicy.SSLPinningMode = self.SSLPinningMode;
securityPolicy.allowInvalidCertificates = self.allowInvalidCertificates;
securityPolicy.validatesDomainName = self.validatesDomainName;
securityPolicy.pinnedCertificates = [self.pinnedCertificates copyWithZone:zone];
return securityPolicy;
}
@end
| {
"pile_set_name": "Github"
} |
// mkerrors.sh -m32
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build 386,freebsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m32 _const.go
package unix
import "syscall"
const (
AF_APPLETALK = 0x10
AF_ARP = 0x23
AF_ATM = 0x1e
AF_BLUETOOTH = 0x24
AF_CCITT = 0xa
AF_CHAOS = 0x5
AF_CNT = 0x15
AF_COIP = 0x14
AF_DATAKIT = 0x9
AF_DECnet = 0xc
AF_DLI = 0xd
AF_E164 = 0x1a
AF_ECMA = 0x8
AF_HYLINK = 0xf
AF_IEEE80211 = 0x25
AF_IMPLINK = 0x3
AF_INET = 0x2
AF_INET6 = 0x1c
AF_INET6_SDP = 0x2a
AF_INET_SDP = 0x28
AF_IPX = 0x17
AF_ISDN = 0x1a
AF_ISO = 0x7
AF_LAT = 0xe
AF_LINK = 0x12
AF_LOCAL = 0x1
AF_MAX = 0x2a
AF_NATM = 0x1d
AF_NETBIOS = 0x6
AF_NETGRAPH = 0x20
AF_OSI = 0x7
AF_PUP = 0x4
AF_ROUTE = 0x11
AF_SCLUSTER = 0x22
AF_SIP = 0x18
AF_SLOW = 0x21
AF_SNA = 0xb
AF_UNIX = 0x1
AF_UNSPEC = 0x0
AF_VENDOR00 = 0x27
AF_VENDOR01 = 0x29
AF_VENDOR02 = 0x2b
AF_VENDOR03 = 0x2d
AF_VENDOR04 = 0x2f
AF_VENDOR05 = 0x31
AF_VENDOR06 = 0x33
AF_VENDOR07 = 0x35
AF_VENDOR08 = 0x37
AF_VENDOR09 = 0x39
AF_VENDOR10 = 0x3b
AF_VENDOR11 = 0x3d
AF_VENDOR12 = 0x3f
AF_VENDOR13 = 0x41
AF_VENDOR14 = 0x43
AF_VENDOR15 = 0x45
AF_VENDOR16 = 0x47
AF_VENDOR17 = 0x49
AF_VENDOR18 = 0x4b
AF_VENDOR19 = 0x4d
AF_VENDOR20 = 0x4f
AF_VENDOR21 = 0x51
AF_VENDOR22 = 0x53
AF_VENDOR23 = 0x55
AF_VENDOR24 = 0x57
AF_VENDOR25 = 0x59
AF_VENDOR26 = 0x5b
AF_VENDOR27 = 0x5d
AF_VENDOR28 = 0x5f
AF_VENDOR29 = 0x61
AF_VENDOR30 = 0x63
AF_VENDOR31 = 0x65
AF_VENDOR32 = 0x67
AF_VENDOR33 = 0x69
AF_VENDOR34 = 0x6b
AF_VENDOR35 = 0x6d
AF_VENDOR36 = 0x6f
AF_VENDOR37 = 0x71
AF_VENDOR38 = 0x73
AF_VENDOR39 = 0x75
AF_VENDOR40 = 0x77
AF_VENDOR41 = 0x79
AF_VENDOR42 = 0x7b
AF_VENDOR43 = 0x7d
AF_VENDOR44 = 0x7f
AF_VENDOR45 = 0x81
AF_VENDOR46 = 0x83
AF_VENDOR47 = 0x85
ALTWERASE = 0x200
B0 = 0x0
B110 = 0x6e
B115200 = 0x1c200
B1200 = 0x4b0
B134 = 0x86
B14400 = 0x3840
B150 = 0x96
B1800 = 0x708
B19200 = 0x4b00
B200 = 0xc8
B230400 = 0x38400
B2400 = 0x960
B28800 = 0x7080
B300 = 0x12c
B38400 = 0x9600
B460800 = 0x70800
B4800 = 0x12c0
B50 = 0x32
B57600 = 0xe100
B600 = 0x258
B7200 = 0x1c20
B75 = 0x4b
B76800 = 0x12c00
B921600 = 0xe1000
B9600 = 0x2580
BIOCFEEDBACK = 0x8004427c
BIOCFLUSH = 0x20004268
BIOCGBLEN = 0x40044266
BIOCGDIRECTION = 0x40044276
BIOCGDLT = 0x4004426a
BIOCGDLTLIST = 0xc0084279
BIOCGETBUFMODE = 0x4004427d
BIOCGETIF = 0x4020426b
BIOCGETZMAX = 0x4004427f
BIOCGHDRCMPLT = 0x40044274
BIOCGRSIG = 0x40044272
BIOCGRTIMEOUT = 0x4008426e
BIOCGSEESENT = 0x40044276
BIOCGSTATS = 0x4008426f
BIOCGTSTAMP = 0x40044283
BIOCIMMEDIATE = 0x80044270
BIOCLOCK = 0x2000427a
BIOCPROMISC = 0x20004269
BIOCROTZBUF = 0x400c4280
BIOCSBLEN = 0xc0044266
BIOCSDIRECTION = 0x80044277
BIOCSDLT = 0x80044278
BIOCSETBUFMODE = 0x8004427e
BIOCSETF = 0x80084267
BIOCSETFNR = 0x80084282
BIOCSETIF = 0x8020426c
BIOCSETWF = 0x8008427b
BIOCSETZBUF = 0x800c4281
BIOCSHDRCMPLT = 0x80044275
BIOCSRSIG = 0x80044273
BIOCSRTIMEOUT = 0x8008426d
BIOCSSEESENT = 0x80044277
BIOCSTSTAMP = 0x80044284
BIOCVERSION = 0x40044271
BPF_A = 0x10
BPF_ABS = 0x20
BPF_ADD = 0x0
BPF_ALIGNMENT = 0x4
BPF_ALU = 0x4
BPF_AND = 0x50
BPF_B = 0x10
BPF_BUFMODE_BUFFER = 0x1
BPF_BUFMODE_ZBUF = 0x2
BPF_DIV = 0x30
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
BPF_JA = 0x0
BPF_JEQ = 0x10
BPF_JGE = 0x30
BPF_JGT = 0x20
BPF_JMP = 0x5
BPF_JSET = 0x40
BPF_K = 0x0
BPF_LD = 0x0
BPF_LDX = 0x1
BPF_LEN = 0x80
BPF_LSH = 0x60
BPF_MAJOR_VERSION = 0x1
BPF_MAXBUFSIZE = 0x80000
BPF_MAXINSNS = 0x200
BPF_MEM = 0x60
BPF_MEMWORDS = 0x10
BPF_MINBUFSIZE = 0x20
BPF_MINOR_VERSION = 0x1
BPF_MISC = 0x7
BPF_MOD = 0x90
BPF_MSH = 0xa0
BPF_MUL = 0x20
BPF_NEG = 0x80
BPF_OR = 0x40
BPF_RELEASE = 0x30bb6
BPF_RET = 0x6
BPF_RSH = 0x70
BPF_ST = 0x2
BPF_STX = 0x3
BPF_SUB = 0x10
BPF_TAX = 0x0
BPF_TXA = 0x80
BPF_T_BINTIME = 0x2
BPF_T_BINTIME_FAST = 0x102
BPF_T_BINTIME_MONOTONIC = 0x202
BPF_T_BINTIME_MONOTONIC_FAST = 0x302
BPF_T_FAST = 0x100
BPF_T_FLAG_MASK = 0x300
BPF_T_FORMAT_MASK = 0x3
BPF_T_MICROTIME = 0x0
BPF_T_MICROTIME_FAST = 0x100
BPF_T_MICROTIME_MONOTONIC = 0x200
BPF_T_MICROTIME_MONOTONIC_FAST = 0x300
BPF_T_MONOTONIC = 0x200
BPF_T_MONOTONIC_FAST = 0x300
BPF_T_NANOTIME = 0x1
BPF_T_NANOTIME_FAST = 0x101
BPF_T_NANOTIME_MONOTONIC = 0x201
BPF_T_NANOTIME_MONOTONIC_FAST = 0x301
BPF_T_NONE = 0x3
BPF_T_NORMAL = 0x0
BPF_W = 0x0
BPF_X = 0x8
BPF_XOR = 0xa0
BRKINT = 0x2
CAP_ACCEPT = 0x200000020000000
CAP_ACL_CHECK = 0x400000000010000
CAP_ACL_DELETE = 0x400000000020000
CAP_ACL_GET = 0x400000000040000
CAP_ACL_SET = 0x400000000080000
CAP_ALL0 = 0x20007ffffffffff
CAP_ALL1 = 0x4000000001fffff
CAP_BIND = 0x200000040000000
CAP_BINDAT = 0x200008000000400
CAP_CHFLAGSAT = 0x200000000001400
CAP_CONNECT = 0x200000080000000
CAP_CONNECTAT = 0x200010000000400
CAP_CREATE = 0x200000000000040
CAP_EVENT = 0x400000000000020
CAP_EXTATTR_DELETE = 0x400000000001000
CAP_EXTATTR_GET = 0x400000000002000
CAP_EXTATTR_LIST = 0x400000000004000
CAP_EXTATTR_SET = 0x400000000008000
CAP_FCHDIR = 0x200000000000800
CAP_FCHFLAGS = 0x200000000001000
CAP_FCHMOD = 0x200000000002000
CAP_FCHMODAT = 0x200000000002400
CAP_FCHOWN = 0x200000000004000
CAP_FCHOWNAT = 0x200000000004400
CAP_FCNTL = 0x200000000008000
CAP_FCNTL_ALL = 0x78
CAP_FCNTL_GETFL = 0x8
CAP_FCNTL_GETOWN = 0x20
CAP_FCNTL_SETFL = 0x10
CAP_FCNTL_SETOWN = 0x40
CAP_FEXECVE = 0x200000000000080
CAP_FLOCK = 0x200000000010000
CAP_FPATHCONF = 0x200000000020000
CAP_FSCK = 0x200000000040000
CAP_FSTAT = 0x200000000080000
CAP_FSTATAT = 0x200000000080400
CAP_FSTATFS = 0x200000000100000
CAP_FSYNC = 0x200000000000100
CAP_FTRUNCATE = 0x200000000000200
CAP_FUTIMES = 0x200000000200000
CAP_FUTIMESAT = 0x200000000200400
CAP_GETPEERNAME = 0x200000100000000
CAP_GETSOCKNAME = 0x200000200000000
CAP_GETSOCKOPT = 0x200000400000000
CAP_IOCTL = 0x400000000000080
CAP_IOCTLS_ALL = 0x7fffffff
CAP_KQUEUE = 0x400000000100040
CAP_KQUEUE_CHANGE = 0x400000000100000
CAP_KQUEUE_EVENT = 0x400000000000040
CAP_LINKAT_SOURCE = 0x200020000000400
CAP_LINKAT_TARGET = 0x200000000400400
CAP_LISTEN = 0x200000800000000
CAP_LOOKUP = 0x200000000000400
CAP_MAC_GET = 0x400000000000001
CAP_MAC_SET = 0x400000000000002
CAP_MKDIRAT = 0x200000000800400
CAP_MKFIFOAT = 0x200000001000400
CAP_MKNODAT = 0x200000002000400
CAP_MMAP = 0x200000000000010
CAP_MMAP_R = 0x20000000000001d
CAP_MMAP_RW = 0x20000000000001f
CAP_MMAP_RWX = 0x20000000000003f
CAP_MMAP_RX = 0x20000000000003d
CAP_MMAP_W = 0x20000000000001e
CAP_MMAP_WX = 0x20000000000003e
CAP_MMAP_X = 0x20000000000003c
CAP_PDGETPID = 0x400000000000200
CAP_PDKILL = 0x400000000000800
CAP_PDWAIT = 0x400000000000400
CAP_PEELOFF = 0x200001000000000
CAP_POLL_EVENT = 0x400000000000020
CAP_PREAD = 0x20000000000000d
CAP_PWRITE = 0x20000000000000e
CAP_READ = 0x200000000000001
CAP_RECV = 0x200000000000001
CAP_RENAMEAT_SOURCE = 0x200000004000400
CAP_RENAMEAT_TARGET = 0x200040000000400
CAP_RIGHTS_VERSION = 0x0
CAP_RIGHTS_VERSION_00 = 0x0
CAP_SEEK = 0x20000000000000c
CAP_SEEK_TELL = 0x200000000000004
CAP_SEM_GETVALUE = 0x400000000000004
CAP_SEM_POST = 0x400000000000008
CAP_SEM_WAIT = 0x400000000000010
CAP_SEND = 0x200000000000002
CAP_SETSOCKOPT = 0x200002000000000
CAP_SHUTDOWN = 0x200004000000000
CAP_SOCK_CLIENT = 0x200007780000003
CAP_SOCK_SERVER = 0x200007f60000003
CAP_SYMLINKAT = 0x200000008000400
CAP_TTYHOOK = 0x400000000000100
CAP_UNLINKAT = 0x200000010000400
CAP_UNUSED0_44 = 0x200080000000000
CAP_UNUSED0_57 = 0x300000000000000
CAP_UNUSED1_22 = 0x400000000200000
CAP_UNUSED1_57 = 0x500000000000000
CAP_WRITE = 0x200000000000002
CFLUSH = 0xf
CLOCAL = 0x8000
CLOCK_MONOTONIC = 0x4
CLOCK_MONOTONIC_FAST = 0xc
CLOCK_MONOTONIC_PRECISE = 0xb
CLOCK_PROCESS_CPUTIME_ID = 0xf
CLOCK_PROF = 0x2
CLOCK_REALTIME = 0x0
CLOCK_REALTIME_FAST = 0xa
CLOCK_REALTIME_PRECISE = 0x9
CLOCK_SECOND = 0xd
CLOCK_THREAD_CPUTIME_ID = 0xe
CLOCK_UPTIME = 0x5
CLOCK_UPTIME_FAST = 0x8
CLOCK_UPTIME_PRECISE = 0x7
CLOCK_VIRTUAL = 0x1
CREAD = 0x800
CRTSCTS = 0x30000
CS5 = 0x0
CS6 = 0x100
CS7 = 0x200
CS8 = 0x300
CSIZE = 0x300
CSTART = 0x11
CSTATUS = 0x14
CSTOP = 0x13
CSTOPB = 0x400
CSUSP = 0x1a
CTL_HW = 0x6
CTL_KERN = 0x1
CTL_MAXNAME = 0x18
CTL_NET = 0x4
DIOCGATTR = 0xc144648e
DIOCGDELETE = 0x80106488
DIOCGFLUSH = 0x20006487
DIOCGFRONTSTUFF = 0x40086486
DIOCGFWHEADS = 0x40046483
DIOCGFWSECTORS = 0x40046482
DIOCGIDENT = 0x41006489
DIOCGMEDIASIZE = 0x40086481
DIOCGPHYSPATH = 0x4400648d
DIOCGPROVIDERNAME = 0x4400648a
DIOCGSECTORSIZE = 0x40046480
DIOCGSTRIPEOFFSET = 0x4008648c
DIOCGSTRIPESIZE = 0x4008648b
DIOCSKERNELDUMP = 0x804c6490
DIOCSKERNELDUMP_FREEBSD11 = 0x80046485
DIOCZONECMD = 0xc06c648f
DLT_A429 = 0xb8
DLT_A653_ICM = 0xb9
DLT_AIRONET_HEADER = 0x78
DLT_AOS = 0xde
DLT_APPLE_IP_OVER_IEEE1394 = 0x8a
DLT_ARCNET = 0x7
DLT_ARCNET_LINUX = 0x81
DLT_ATM_CLIP = 0x13
DLT_ATM_RFC1483 = 0xb
DLT_AURORA = 0x7e
DLT_AX25 = 0x3
DLT_AX25_KISS = 0xca
DLT_BACNET_MS_TP = 0xa5
DLT_BLUETOOTH_BREDR_BB = 0xff
DLT_BLUETOOTH_HCI_H4 = 0xbb
DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9
DLT_BLUETOOTH_LE_LL = 0xfb
DLT_BLUETOOTH_LE_LL_WITH_PHDR = 0x100
DLT_BLUETOOTH_LINUX_MONITOR = 0xfe
DLT_CAN20B = 0xbe
DLT_CAN_SOCKETCAN = 0xe3
DLT_CHAOS = 0x5
DLT_CHDLC = 0x68
DLT_CISCO_IOS = 0x76
DLT_CLASS_NETBSD_RAWAF = 0x2240000
DLT_C_HDLC = 0x68
DLT_C_HDLC_WITH_DIR = 0xcd
DLT_DBUS = 0xe7
DLT_DECT = 0xdd
DLT_DISPLAYPORT_AUX = 0x113
DLT_DOCSIS = 0x8f
DLT_DOCSIS31_XRA31 = 0x111
DLT_DVB_CI = 0xeb
DLT_ECONET = 0x73
DLT_EN10MB = 0x1
DLT_EN3MB = 0x2
DLT_ENC = 0x6d
DLT_EPON = 0x103
DLT_ERF = 0xc5
DLT_ERF_ETH = 0xaf
DLT_ERF_POS = 0xb0
DLT_ETHERNET_MPACKET = 0x112
DLT_FC_2 = 0xe0
DLT_FC_2_WITH_FRAME_DELIMS = 0xe1
DLT_FDDI = 0xa
DLT_FLEXRAY = 0xd2
DLT_FRELAY = 0x6b
DLT_FRELAY_WITH_DIR = 0xce
DLT_GCOM_SERIAL = 0xad
DLT_GCOM_T1E1 = 0xac
DLT_GPF_F = 0xab
DLT_GPF_T = 0xaa
DLT_GPRS_LLC = 0xa9
DLT_GSMTAP_ABIS = 0xda
DLT_GSMTAP_UM = 0xd9
DLT_IBM_SN = 0x92
DLT_IBM_SP = 0x91
DLT_IEEE802 = 0x6
DLT_IEEE802_11 = 0x69
DLT_IEEE802_11_RADIO = 0x7f
DLT_IEEE802_11_RADIO_AVS = 0xa3
DLT_IEEE802_15_4 = 0xc3
DLT_IEEE802_15_4_LINUX = 0xbf
DLT_IEEE802_15_4_NOFCS = 0xe6
DLT_IEEE802_15_4_NONASK_PHY = 0xd7
DLT_IEEE802_16_MAC_CPS = 0xbc
DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1
DLT_INFINIBAND = 0xf7
DLT_IPFILTER = 0x74
DLT_IPMB = 0xc7
DLT_IPMB_LINUX = 0xd1
DLT_IPMI_HPM_2 = 0x104
DLT_IPNET = 0xe2
DLT_IPOIB = 0xf2
DLT_IPV4 = 0xe4
DLT_IPV6 = 0xe5
DLT_IP_OVER_FC = 0x7a
DLT_ISO_14443 = 0x108
DLT_JUNIPER_ATM1 = 0x89
DLT_JUNIPER_ATM2 = 0x87
DLT_JUNIPER_ATM_CEMIC = 0xee
DLT_JUNIPER_CHDLC = 0xb5
DLT_JUNIPER_ES = 0x84
DLT_JUNIPER_ETHER = 0xb2
DLT_JUNIPER_FIBRECHANNEL = 0xea
DLT_JUNIPER_FRELAY = 0xb4
DLT_JUNIPER_GGSN = 0x85
DLT_JUNIPER_ISM = 0xc2
DLT_JUNIPER_MFR = 0x86
DLT_JUNIPER_MLFR = 0x83
DLT_JUNIPER_MLPPP = 0x82
DLT_JUNIPER_MONITOR = 0xa4
DLT_JUNIPER_PIC_PEER = 0xae
DLT_JUNIPER_PPP = 0xb3
DLT_JUNIPER_PPPOE = 0xa7
DLT_JUNIPER_PPPOE_ATM = 0xa8
DLT_JUNIPER_SERVICES = 0x88
DLT_JUNIPER_SRX_E2E = 0xe9
DLT_JUNIPER_ST = 0xc8
DLT_JUNIPER_VP = 0xb7
DLT_JUNIPER_VS = 0xe8
DLT_LAPB_WITH_DIR = 0xcf
DLT_LAPD = 0xcb
DLT_LIN = 0xd4
DLT_LINUX_EVDEV = 0xd8
DLT_LINUX_IRDA = 0x90
DLT_LINUX_LAPD = 0xb1
DLT_LINUX_PPP_WITHDIRECTION = 0xa6
DLT_LINUX_SLL = 0x71
DLT_LOOP = 0x6c
DLT_LORATAP = 0x10e
DLT_LTALK = 0x72
DLT_MATCHING_MAX = 0x113
DLT_MATCHING_MIN = 0x68
DLT_MFR = 0xb6
DLT_MOST = 0xd3
DLT_MPEG_2_TS = 0xf3
DLT_MPLS = 0xdb
DLT_MTP2 = 0x8c
DLT_MTP2_WITH_PHDR = 0x8b
DLT_MTP3 = 0x8d
DLT_MUX27010 = 0xec
DLT_NETANALYZER = 0xf0
DLT_NETANALYZER_TRANSPARENT = 0xf1
DLT_NETLINK = 0xfd
DLT_NFC_LLCP = 0xf5
DLT_NFLOG = 0xef
DLT_NG40 = 0xf4
DLT_NORDIC_BLE = 0x110
DLT_NULL = 0x0
DLT_OPENFLOW = 0x10b
DLT_PCI_EXP = 0x7d
DLT_PFLOG = 0x75
DLT_PFSYNC = 0x79
DLT_PKTAP = 0x102
DLT_PPI = 0xc0
DLT_PPP = 0x9
DLT_PPP_BSDOS = 0xe
DLT_PPP_ETHER = 0x33
DLT_PPP_PPPD = 0xa6
DLT_PPP_SERIAL = 0x32
DLT_PPP_WITH_DIR = 0xcc
DLT_PPP_WITH_DIRECTION = 0xa6
DLT_PRISM_HEADER = 0x77
DLT_PROFIBUS_DL = 0x101
DLT_PRONET = 0x4
DLT_RAIF1 = 0xc6
DLT_RAW = 0xc
DLT_RDS = 0x109
DLT_REDBACK_SMARTEDGE = 0x20
DLT_RIO = 0x7c
DLT_RTAC_SERIAL = 0xfa
DLT_SCCP = 0x8e
DLT_SCTP = 0xf8
DLT_SDLC = 0x10c
DLT_SITA = 0xc4
DLT_SLIP = 0x8
DLT_SLIP_BSDOS = 0xd
DLT_STANAG_5066_D_PDU = 0xed
DLT_SUNATM = 0x7b
DLT_SYMANTEC_FIREWALL = 0x63
DLT_TI_LLN_SNIFFER = 0x10d
DLT_TZSP = 0x80
DLT_USB = 0xba
DLT_USBPCAP = 0xf9
DLT_USB_DARWIN = 0x10a
DLT_USB_FREEBSD = 0xba
DLT_USB_LINUX = 0xbd
DLT_USB_LINUX_MMAPPED = 0xdc
DLT_USER0 = 0x93
DLT_USER1 = 0x94
DLT_USER10 = 0x9d
DLT_USER11 = 0x9e
DLT_USER12 = 0x9f
DLT_USER13 = 0xa0
DLT_USER14 = 0xa1
DLT_USER15 = 0xa2
DLT_USER2 = 0x95
DLT_USER3 = 0x96
DLT_USER4 = 0x97
DLT_USER5 = 0x98
DLT_USER6 = 0x99
DLT_USER7 = 0x9a
DLT_USER8 = 0x9b
DLT_USER9 = 0x9c
DLT_VSOCK = 0x10f
DLT_WATTSTOPPER_DLM = 0x107
DLT_WIHART = 0xdf
DLT_WIRESHARK_UPPER_PDU = 0xfc
DLT_X2E_SERIAL = 0xd5
DLT_X2E_XORAYA = 0xd6
DLT_ZWAVE_R1_R2 = 0x105
DLT_ZWAVE_R3 = 0x106
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
DT_FIFO = 0x1
DT_LNK = 0xa
DT_REG = 0x8
DT_SOCK = 0xc
DT_UNKNOWN = 0x0
DT_WHT = 0xe
ECHO = 0x8
ECHOCTL = 0x40
ECHOE = 0x2
ECHOK = 0x4
ECHOKE = 0x1
ECHONL = 0x10
ECHOPRT = 0x20
EVFILT_AIO = -0x3
EVFILT_EMPTY = -0xd
EVFILT_FS = -0x9
EVFILT_LIO = -0xa
EVFILT_PROC = -0x5
EVFILT_PROCDESC = -0x8
EVFILT_READ = -0x1
EVFILT_SENDFILE = -0xc
EVFILT_SIGNAL = -0x6
EVFILT_SYSCOUNT = 0xd
EVFILT_TIMER = -0x7
EVFILT_USER = -0xb
EVFILT_VNODE = -0x4
EVFILT_WRITE = -0x2
EVNAMEMAP_NAME_SIZE = 0x40
EV_ADD = 0x1
EV_CLEAR = 0x20
EV_DELETE = 0x2
EV_DISABLE = 0x8
EV_DISPATCH = 0x80
EV_DROP = 0x1000
EV_ENABLE = 0x4
EV_EOF = 0x8000
EV_ERROR = 0x4000
EV_FLAG1 = 0x2000
EV_FLAG2 = 0x4000
EV_FORCEONESHOT = 0x100
EV_ONESHOT = 0x10
EV_RECEIPT = 0x40
EV_SYSFLAGS = 0xf000
EXTA = 0x4b00
EXTATTR_MAXNAMELEN = 0xff
EXTATTR_NAMESPACE_EMPTY = 0x0
EXTATTR_NAMESPACE_SYSTEM = 0x2
EXTATTR_NAMESPACE_USER = 0x1
EXTB = 0x9600
EXTPROC = 0x800
FD_CLOEXEC = 0x1
FD_SETSIZE = 0x400
FLUSHO = 0x800000
F_CANCEL = 0x5
F_DUP2FD = 0xa
F_DUP2FD_CLOEXEC = 0x12
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x11
F_GETFD = 0x1
F_GETFL = 0x3
F_GETLK = 0xb
F_GETOWN = 0x5
F_OGETLK = 0x7
F_OK = 0x0
F_OSETLK = 0x8
F_OSETLKW = 0x9
F_RDAHEAD = 0x10
F_RDLCK = 0x1
F_READAHEAD = 0xf
F_SETFD = 0x2
F_SETFL = 0x4
F_SETLK = 0xc
F_SETLKW = 0xd
F_SETLK_REMOTE = 0xe
F_SETOWN = 0x6
F_UNLCK = 0x2
F_UNLCKSYS = 0x4
F_WRLCK = 0x3
HUPCL = 0x4000
HW_MACHINE = 0x1
ICANON = 0x100
ICMP6_FILTER = 0x12
ICRNL = 0x100
IEXTEN = 0x400
IFAN_ARRIVAL = 0x0
IFAN_DEPARTURE = 0x1
IFCAP_WOL_MAGIC = 0x2000
IFF_ALLMULTI = 0x200
IFF_ALTPHYS = 0x4000
IFF_BROADCAST = 0x2
IFF_CANTCHANGE = 0x218f52
IFF_CANTCONFIG = 0x10000
IFF_DEBUG = 0x4
IFF_DRV_OACTIVE = 0x400
IFF_DRV_RUNNING = 0x40
IFF_DYING = 0x200000
IFF_LINK0 = 0x1000
IFF_LINK1 = 0x2000
IFF_LINK2 = 0x4000
IFF_LOOPBACK = 0x8
IFF_MONITOR = 0x40000
IFF_MULTICAST = 0x8000
IFF_NOARP = 0x80
IFF_NOGROUP = 0x800000
IFF_OACTIVE = 0x400
IFF_POINTOPOINT = 0x10
IFF_PPROMISC = 0x20000
IFF_PROMISC = 0x100
IFF_RENAMING = 0x400000
IFF_RUNNING = 0x40
IFF_SIMPLEX = 0x800
IFF_STATICARP = 0x80000
IFF_UP = 0x1
IFNAMSIZ = 0x10
IFT_BRIDGE = 0xd1
IFT_CARP = 0xf8
IFT_IEEE1394 = 0x90
IFT_INFINIBAND = 0xc7
IFT_L2VLAN = 0x87
IFT_L3IPVLAN = 0x88
IFT_PPP = 0x17
IFT_PROPVIRTUAL = 0x35
IGNBRK = 0x1
IGNCR = 0x80
IGNPAR = 0x4
IMAXBEL = 0x2000
INLCR = 0x40
INPCK = 0x10
IN_CLASSA_HOST = 0xffffff
IN_CLASSA_MAX = 0x80
IN_CLASSA_NET = 0xff000000
IN_CLASSA_NSHIFT = 0x18
IN_CLASSB_HOST = 0xffff
IN_CLASSB_MAX = 0x10000
IN_CLASSB_NET = 0xffff0000
IN_CLASSB_NSHIFT = 0x10
IN_CLASSC_HOST = 0xff
IN_CLASSC_NET = 0xffffff00
IN_CLASSC_NSHIFT = 0x8
IN_CLASSD_HOST = 0xfffffff
IN_CLASSD_NET = 0xf0000000
IN_CLASSD_NSHIFT = 0x1c
IN_LOOPBACKNET = 0x7f
IN_RFC3021_MASK = 0xfffffffe
IPPROTO_3PC = 0x22
IPPROTO_ADFS = 0x44
IPPROTO_AH = 0x33
IPPROTO_AHIP = 0x3d
IPPROTO_APES = 0x63
IPPROTO_ARGUS = 0xd
IPPROTO_AX25 = 0x5d
IPPROTO_BHA = 0x31
IPPROTO_BLT = 0x1e
IPPROTO_BRSATMON = 0x4c
IPPROTO_CARP = 0x70
IPPROTO_CFTP = 0x3e
IPPROTO_CHAOS = 0x10
IPPROTO_CMTP = 0x26
IPPROTO_CPHB = 0x49
IPPROTO_CPNX = 0x48
IPPROTO_DDP = 0x25
IPPROTO_DGP = 0x56
IPPROTO_DIVERT = 0x102
IPPROTO_DONE = 0x101
IPPROTO_DSTOPTS = 0x3c
IPPROTO_EGP = 0x8
IPPROTO_EMCON = 0xe
IPPROTO_ENCAP = 0x62
IPPROTO_EON = 0x50
IPPROTO_ESP = 0x32
IPPROTO_ETHERIP = 0x61
IPPROTO_FRAGMENT = 0x2c
IPPROTO_GGP = 0x3
IPPROTO_GMTP = 0x64
IPPROTO_GRE = 0x2f
IPPROTO_HELLO = 0x3f
IPPROTO_HIP = 0x8b
IPPROTO_HMP = 0x14
IPPROTO_HOPOPTS = 0x0
IPPROTO_ICMP = 0x1
IPPROTO_ICMPV6 = 0x3a
IPPROTO_IDP = 0x16
IPPROTO_IDPR = 0x23
IPPROTO_IDRP = 0x2d
IPPROTO_IGMP = 0x2
IPPROTO_IGP = 0x55
IPPROTO_IGRP = 0x58
IPPROTO_IL = 0x28
IPPROTO_INLSP = 0x34
IPPROTO_INP = 0x20
IPPROTO_IP = 0x0
IPPROTO_IPCOMP = 0x6c
IPPROTO_IPCV = 0x47
IPPROTO_IPEIP = 0x5e
IPPROTO_IPIP = 0x4
IPPROTO_IPPC = 0x43
IPPROTO_IPV4 = 0x4
IPPROTO_IPV6 = 0x29
IPPROTO_IRTP = 0x1c
IPPROTO_KRYPTOLAN = 0x41
IPPROTO_LARP = 0x5b
IPPROTO_LEAF1 = 0x19
IPPROTO_LEAF2 = 0x1a
IPPROTO_MAX = 0x100
IPPROTO_MEAS = 0x13
IPPROTO_MH = 0x87
IPPROTO_MHRP = 0x30
IPPROTO_MICP = 0x5f
IPPROTO_MOBILE = 0x37
IPPROTO_MPLS = 0x89
IPPROTO_MTP = 0x5c
IPPROTO_MUX = 0x12
IPPROTO_ND = 0x4d
IPPROTO_NHRP = 0x36
IPPROTO_NONE = 0x3b
IPPROTO_NSP = 0x1f
IPPROTO_NVPII = 0xb
IPPROTO_OLD_DIVERT = 0xfe
IPPROTO_OSPFIGP = 0x59
IPPROTO_PFSYNC = 0xf0
IPPROTO_PGM = 0x71
IPPROTO_PIGP = 0x9
IPPROTO_PIM = 0x67
IPPROTO_PRM = 0x15
IPPROTO_PUP = 0xc
IPPROTO_PVP = 0x4b
IPPROTO_RAW = 0xff
IPPROTO_RCCMON = 0xa
IPPROTO_RDP = 0x1b
IPPROTO_RESERVED_253 = 0xfd
IPPROTO_RESERVED_254 = 0xfe
IPPROTO_ROUTING = 0x2b
IPPROTO_RSVP = 0x2e
IPPROTO_RVD = 0x42
IPPROTO_SATEXPAK = 0x40
IPPROTO_SATMON = 0x45
IPPROTO_SCCSP = 0x60
IPPROTO_SCTP = 0x84
IPPROTO_SDRP = 0x2a
IPPROTO_SEND = 0x103
IPPROTO_SEP = 0x21
IPPROTO_SHIM6 = 0x8c
IPPROTO_SKIP = 0x39
IPPROTO_SPACER = 0x7fff
IPPROTO_SRPC = 0x5a
IPPROTO_ST = 0x7
IPPROTO_SVMTP = 0x52
IPPROTO_SWIPE = 0x35
IPPROTO_TCF = 0x57
IPPROTO_TCP = 0x6
IPPROTO_TLSP = 0x38
IPPROTO_TP = 0x1d
IPPROTO_TPXX = 0x27
IPPROTO_TRUNK1 = 0x17
IPPROTO_TRUNK2 = 0x18
IPPROTO_TTP = 0x54
IPPROTO_UDP = 0x11
IPPROTO_UDPLITE = 0x88
IPPROTO_VINES = 0x53
IPPROTO_VISA = 0x46
IPPROTO_VMTP = 0x51
IPPROTO_WBEXPAK = 0x4f
IPPROTO_WBMON = 0x4e
IPPROTO_WSN = 0x4a
IPPROTO_XNET = 0xf
IPPROTO_XTP = 0x24
IPV6_AUTOFLOWLABEL = 0x3b
IPV6_BINDANY = 0x40
IPV6_BINDMULTI = 0x41
IPV6_BINDV6ONLY = 0x1b
IPV6_CHECKSUM = 0x1a
IPV6_DEFAULT_MULTICAST_HOPS = 0x1
IPV6_DEFAULT_MULTICAST_LOOP = 0x1
IPV6_DEFHLIM = 0x40
IPV6_DONTFRAG = 0x3e
IPV6_DSTOPTS = 0x32
IPV6_FLOWID = 0x43
IPV6_FLOWINFO_MASK = 0xffffff0f
IPV6_FLOWLABEL_LEN = 0x14
IPV6_FLOWLABEL_MASK = 0xffff0f00
IPV6_FLOWTYPE = 0x44
IPV6_FRAGTTL = 0x78
IPV6_FW_ADD = 0x1e
IPV6_FW_DEL = 0x1f
IPV6_FW_FLUSH = 0x20
IPV6_FW_GET = 0x22
IPV6_FW_ZERO = 0x21
IPV6_HLIMDEC = 0x1
IPV6_HOPLIMIT = 0x2f
IPV6_HOPOPTS = 0x31
IPV6_IPSEC_POLICY = 0x1c
IPV6_JOIN_GROUP = 0xc
IPV6_LEAVE_GROUP = 0xd
IPV6_MAXHLIM = 0xff
IPV6_MAXOPTHDR = 0x800
IPV6_MAXPACKET = 0xffff
IPV6_MAX_GROUP_SRC_FILTER = 0x200
IPV6_MAX_MEMBERSHIPS = 0xfff
IPV6_MAX_SOCK_SRC_FILTER = 0x80
IPV6_MMTU = 0x500
IPV6_MSFILTER = 0x4a
IPV6_MULTICAST_HOPS = 0xa
IPV6_MULTICAST_IF = 0x9
IPV6_MULTICAST_LOOP = 0xb
IPV6_NEXTHOP = 0x30
IPV6_ORIGDSTADDR = 0x48
IPV6_PATHMTU = 0x2c
IPV6_PKTINFO = 0x2e
IPV6_PORTRANGE = 0xe
IPV6_PORTRANGE_DEFAULT = 0x0
IPV6_PORTRANGE_HIGH = 0x1
IPV6_PORTRANGE_LOW = 0x2
IPV6_PREFER_TEMPADDR = 0x3f
IPV6_RECVDSTOPTS = 0x28
IPV6_RECVFLOWID = 0x46
IPV6_RECVHOPLIMIT = 0x25
IPV6_RECVHOPOPTS = 0x27
IPV6_RECVORIGDSTADDR = 0x48
IPV6_RECVPATHMTU = 0x2b
IPV6_RECVPKTINFO = 0x24
IPV6_RECVRSSBUCKETID = 0x47
IPV6_RECVRTHDR = 0x26
IPV6_RECVTCLASS = 0x39
IPV6_RSSBUCKETID = 0x45
IPV6_RSS_LISTEN_BUCKET = 0x42
IPV6_RTHDR = 0x33
IPV6_RTHDRDSTOPTS = 0x23
IPV6_RTHDR_LOOSE = 0x0
IPV6_RTHDR_STRICT = 0x1
IPV6_RTHDR_TYPE_0 = 0x0
IPV6_SOCKOPT_RESERVED1 = 0x3
IPV6_TCLASS = 0x3d
IPV6_UNICAST_HOPS = 0x4
IPV6_USE_MIN_MTU = 0x2a
IPV6_V6ONLY = 0x1b
IPV6_VERSION = 0x60
IPV6_VERSION_MASK = 0xf0
IP_ADD_MEMBERSHIP = 0xc
IP_ADD_SOURCE_MEMBERSHIP = 0x46
IP_BINDANY = 0x18
IP_BINDMULTI = 0x19
IP_BLOCK_SOURCE = 0x48
IP_DEFAULT_MULTICAST_LOOP = 0x1
IP_DEFAULT_MULTICAST_TTL = 0x1
IP_DF = 0x4000
IP_DONTFRAG = 0x43
IP_DROP_MEMBERSHIP = 0xd
IP_DROP_SOURCE_MEMBERSHIP = 0x47
IP_DUMMYNET3 = 0x31
IP_DUMMYNET_CONFIGURE = 0x3c
IP_DUMMYNET_DEL = 0x3d
IP_DUMMYNET_FLUSH = 0x3e
IP_DUMMYNET_GET = 0x40
IP_FLOWID = 0x5a
IP_FLOWTYPE = 0x5b
IP_FW3 = 0x30
IP_FW_ADD = 0x32
IP_FW_DEL = 0x33
IP_FW_FLUSH = 0x34
IP_FW_GET = 0x36
IP_FW_NAT_CFG = 0x38
IP_FW_NAT_DEL = 0x39
IP_FW_NAT_GET_CONFIG = 0x3a
IP_FW_NAT_GET_LOG = 0x3b
IP_FW_RESETLOG = 0x37
IP_FW_TABLE_ADD = 0x28
IP_FW_TABLE_DEL = 0x29
IP_FW_TABLE_FLUSH = 0x2a
IP_FW_TABLE_GETSIZE = 0x2b
IP_FW_TABLE_LIST = 0x2c
IP_FW_ZERO = 0x35
IP_HDRINCL = 0x2
IP_IPSEC_POLICY = 0x15
IP_MAXPACKET = 0xffff
IP_MAX_GROUP_SRC_FILTER = 0x200
IP_MAX_MEMBERSHIPS = 0xfff
IP_MAX_SOCK_MUTE_FILTER = 0x80
IP_MAX_SOCK_SRC_FILTER = 0x80
IP_MF = 0x2000
IP_MINTTL = 0x42
IP_MSFILTER = 0x4a
IP_MSS = 0x240
IP_MULTICAST_IF = 0x9
IP_MULTICAST_LOOP = 0xb
IP_MULTICAST_TTL = 0xa
IP_MULTICAST_VIF = 0xe
IP_OFFMASK = 0x1fff
IP_ONESBCAST = 0x17
IP_OPTIONS = 0x1
IP_ORIGDSTADDR = 0x1b
IP_PORTRANGE = 0x13
IP_PORTRANGE_DEFAULT = 0x0
IP_PORTRANGE_HIGH = 0x1
IP_PORTRANGE_LOW = 0x2
IP_RECVDSTADDR = 0x7
IP_RECVFLOWID = 0x5d
IP_RECVIF = 0x14
IP_RECVOPTS = 0x5
IP_RECVORIGDSTADDR = 0x1b
IP_RECVRETOPTS = 0x6
IP_RECVRSSBUCKETID = 0x5e
IP_RECVTOS = 0x44
IP_RECVTTL = 0x41
IP_RETOPTS = 0x8
IP_RF = 0x8000
IP_RSSBUCKETID = 0x5c
IP_RSS_LISTEN_BUCKET = 0x1a
IP_RSVP_OFF = 0x10
IP_RSVP_ON = 0xf
IP_RSVP_VIF_OFF = 0x12
IP_RSVP_VIF_ON = 0x11
IP_SENDSRCADDR = 0x7
IP_TOS = 0x3
IP_TTL = 0x4
IP_UNBLOCK_SOURCE = 0x49
ISIG = 0x80
ISTRIP = 0x20
IXANY = 0x800
IXOFF = 0x400
IXON = 0x200
KERN_HOSTNAME = 0xa
KERN_OSRELEASE = 0x2
KERN_OSTYPE = 0x1
KERN_VERSION = 0x4
LOCK_EX = 0x2
LOCK_NB = 0x4
LOCK_SH = 0x1
LOCK_UN = 0x8
MADV_AUTOSYNC = 0x7
MADV_CORE = 0x9
MADV_DONTNEED = 0x4
MADV_FREE = 0x5
MADV_NOCORE = 0x8
MADV_NORMAL = 0x0
MADV_NOSYNC = 0x6
MADV_PROTECT = 0xa
MADV_RANDOM = 0x1
MADV_SEQUENTIAL = 0x2
MADV_WILLNEED = 0x3
MAP_ALIGNED_SUPER = 0x1000000
MAP_ALIGNMENT_MASK = -0x1000000
MAP_ALIGNMENT_SHIFT = 0x18
MAP_ANON = 0x1000
MAP_ANONYMOUS = 0x1000
MAP_COPY = 0x2
MAP_EXCL = 0x4000
MAP_FILE = 0x0
MAP_FIXED = 0x10
MAP_GUARD = 0x2000
MAP_HASSEMAPHORE = 0x200
MAP_NOCORE = 0x20000
MAP_NOSYNC = 0x800
MAP_PREFAULT_READ = 0x40000
MAP_PRIVATE = 0x2
MAP_RESERVED0020 = 0x20
MAP_RESERVED0040 = 0x40
MAP_RESERVED0080 = 0x80
MAP_RESERVED0100 = 0x100
MAP_SHARED = 0x1
MAP_STACK = 0x400
MCAST_BLOCK_SOURCE = 0x54
MCAST_EXCLUDE = 0x2
MCAST_INCLUDE = 0x1
MCAST_JOIN_GROUP = 0x50
MCAST_JOIN_SOURCE_GROUP = 0x52
MCAST_LEAVE_GROUP = 0x51
MCAST_LEAVE_SOURCE_GROUP = 0x53
MCAST_UNBLOCK_SOURCE = 0x55
MCAST_UNDEFINED = 0x0
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MNT_ACLS = 0x8000000
MNT_ASYNC = 0x40
MNT_AUTOMOUNTED = 0x200000000
MNT_BYFSID = 0x8000000
MNT_CMDFLAGS = 0xd0f0000
MNT_DEFEXPORTED = 0x200
MNT_DELEXPORT = 0x20000
MNT_EXKERB = 0x800
MNT_EXPORTANON = 0x400
MNT_EXPORTED = 0x100
MNT_EXPUBLIC = 0x20000000
MNT_EXRDONLY = 0x80
MNT_FORCE = 0x80000
MNT_GJOURNAL = 0x2000000
MNT_IGNORE = 0x800000
MNT_LAZY = 0x3
MNT_LOCAL = 0x1000
MNT_MULTILABEL = 0x4000000
MNT_NFS4ACLS = 0x10
MNT_NOATIME = 0x10000000
MNT_NOCLUSTERR = 0x40000000
MNT_NOCLUSTERW = 0x80000000
MNT_NOEXEC = 0x4
MNT_NONBUSY = 0x4000000
MNT_NOSUID = 0x8
MNT_NOSYMFOLLOW = 0x400000
MNT_NOWAIT = 0x2
MNT_QUOTA = 0x2000
MNT_RDONLY = 0x1
MNT_RELOAD = 0x40000
MNT_ROOTFS = 0x4000
MNT_SNAPSHOT = 0x1000000
MNT_SOFTDEP = 0x200000
MNT_SUIDDIR = 0x100000
MNT_SUJ = 0x100000000
MNT_SUSPEND = 0x4
MNT_SYNCHRONOUS = 0x2
MNT_UNION = 0x20
MNT_UNTRUSTED = 0x800000000
MNT_UPDATE = 0x10000
MNT_UPDATEMASK = 0xad8d0807e
MNT_USER = 0x8000
MNT_VERIFIED = 0x400000000
MNT_VISFLAGMASK = 0xffef0ffff
MNT_WAIT = 0x1
MSG_CMSG_CLOEXEC = 0x40000
MSG_COMPAT = 0x8000
MSG_CTRUNC = 0x20
MSG_DONTROUTE = 0x4
MSG_DONTWAIT = 0x80
MSG_EOF = 0x100
MSG_EOR = 0x8
MSG_NBIO = 0x4000
MSG_NOSIGNAL = 0x20000
MSG_NOTIFICATION = 0x2000
MSG_OOB = 0x1
MSG_PEEK = 0x2
MSG_TRUNC = 0x10
MSG_WAITALL = 0x40
MSG_WAITFORONE = 0x80000
MS_ASYNC = 0x1
MS_INVALIDATE = 0x2
MS_SYNC = 0x0
NAME_MAX = 0xff
NET_RT_DUMP = 0x1
NET_RT_FLAGS = 0x2
NET_RT_IFLIST = 0x3
NET_RT_IFLISTL = 0x5
NET_RT_IFMALIST = 0x4
NFDBITS = 0x20
NOFLSH = 0x80000000
NOKERNINFO = 0x2000000
NOTE_ABSTIME = 0x10
NOTE_ATTRIB = 0x8
NOTE_CHILD = 0x4
NOTE_CLOSE = 0x100
NOTE_CLOSE_WRITE = 0x200
NOTE_DELETE = 0x1
NOTE_EXEC = 0x20000000
NOTE_EXIT = 0x80000000
NOTE_EXTEND = 0x4
NOTE_FFAND = 0x40000000
NOTE_FFCOPY = 0xc0000000
NOTE_FFCTRLMASK = 0xc0000000
NOTE_FFLAGSMASK = 0xffffff
NOTE_FFNOP = 0x0
NOTE_FFOR = 0x80000000
NOTE_FILE_POLL = 0x2
NOTE_FORK = 0x40000000
NOTE_LINK = 0x10
NOTE_LOWAT = 0x1
NOTE_MSECONDS = 0x2
NOTE_NSECONDS = 0x8
NOTE_OPEN = 0x80
NOTE_PCTRLMASK = 0xf0000000
NOTE_PDATAMASK = 0xfffff
NOTE_READ = 0x400
NOTE_RENAME = 0x20
NOTE_REVOKE = 0x40
NOTE_SECONDS = 0x1
NOTE_TRACK = 0x1
NOTE_TRACKERR = 0x2
NOTE_TRIGGER = 0x1000000
NOTE_USECONDS = 0x4
NOTE_WRITE = 0x2
OCRNL = 0x10
ONLCR = 0x2
ONLRET = 0x40
ONOCR = 0x20
ONOEOT = 0x8
OPOST = 0x1
OXTABS = 0x4
O_ACCMODE = 0x3
O_APPEND = 0x8
O_ASYNC = 0x40
O_CLOEXEC = 0x100000
O_CREAT = 0x200
O_DIRECT = 0x10000
O_DIRECTORY = 0x20000
O_EXCL = 0x800
O_EXEC = 0x40000
O_EXLOCK = 0x20
O_FSYNC = 0x80
O_NDELAY = 0x4
O_NOCTTY = 0x8000
O_NOFOLLOW = 0x100
O_NONBLOCK = 0x4
O_RDONLY = 0x0
O_RDWR = 0x2
O_SHLOCK = 0x10
O_SYNC = 0x80
O_TRUNC = 0x400
O_TTY_INIT = 0x80000
O_VERIFY = 0x200000
O_WRONLY = 0x1
PARENB = 0x1000
PARMRK = 0x8
PARODD = 0x2000
PENDIN = 0x20000000
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
PROT_EXEC = 0x4
PROT_NONE = 0x0
PROT_READ = 0x1
PROT_WRITE = 0x2
RLIMIT_AS = 0xa
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
RLIMIT_DATA = 0x2
RLIMIT_FSIZE = 0x1
RLIMIT_MEMLOCK = 0x6
RLIMIT_NOFILE = 0x8
RLIMIT_NPROC = 0x7
RLIMIT_RSS = 0x5
RLIMIT_STACK = 0x3
RLIM_INFINITY = 0x7fffffffffffffff
RTAX_AUTHOR = 0x6
RTAX_BRD = 0x7
RTAX_DST = 0x0
RTAX_GATEWAY = 0x1
RTAX_GENMASK = 0x3
RTAX_IFA = 0x5
RTAX_IFP = 0x4
RTAX_MAX = 0x8
RTAX_NETMASK = 0x2
RTA_AUTHOR = 0x40
RTA_BRD = 0x80
RTA_DST = 0x1
RTA_GATEWAY = 0x2
RTA_GENMASK = 0x8
RTA_IFA = 0x20
RTA_IFP = 0x10
RTA_NETMASK = 0x4
RTF_BLACKHOLE = 0x1000
RTF_BROADCAST = 0x400000
RTF_DONE = 0x40
RTF_DYNAMIC = 0x10
RTF_FIXEDMTU = 0x80000
RTF_FMASK = 0x1004d808
RTF_GATEWAY = 0x2
RTF_GWFLAG_COMPAT = 0x80000000
RTF_HOST = 0x4
RTF_LLDATA = 0x400
RTF_LLINFO = 0x400
RTF_LOCAL = 0x200000
RTF_MODIFIED = 0x20
RTF_MULTICAST = 0x800000
RTF_PINNED = 0x100000
RTF_PROTO1 = 0x8000
RTF_PROTO2 = 0x4000
RTF_PROTO3 = 0x40000
RTF_REJECT = 0x8
RTF_RNH_LOCKED = 0x40000000
RTF_STATIC = 0x800
RTF_STICKY = 0x10000000
RTF_UP = 0x1
RTF_XRESOLVE = 0x200
RTM_ADD = 0x1
RTM_CHANGE = 0x3
RTM_DELADDR = 0xd
RTM_DELETE = 0x2
RTM_DELMADDR = 0x10
RTM_GET = 0x4
RTM_IEEE80211 = 0x12
RTM_IFANNOUNCE = 0x11
RTM_IFINFO = 0xe
RTM_LOCK = 0x8
RTM_LOSING = 0x5
RTM_MISS = 0x7
RTM_NEWADDR = 0xc
RTM_NEWMADDR = 0xf
RTM_REDIRECT = 0x6
RTM_RESOLVE = 0xb
RTM_RTTUNIT = 0xf4240
RTM_VERSION = 0x5
RTV_EXPIRE = 0x4
RTV_HOPCOUNT = 0x2
RTV_MTU = 0x1
RTV_RPIPE = 0x8
RTV_RTT = 0x40
RTV_RTTVAR = 0x80
RTV_SPIPE = 0x10
RTV_SSTHRESH = 0x20
RTV_WEIGHT = 0x100
RT_ALL_FIBS = -0x1
RT_BLACKHOLE = 0x40
RT_DEFAULT_FIB = 0x0
RT_HAS_GW = 0x80
RT_HAS_HEADER = 0x10
RT_HAS_HEADER_BIT = 0x4
RT_L2_ME = 0x4
RT_L2_ME_BIT = 0x2
RT_LLE_CACHE = 0x100
RT_MAY_LOOP = 0x8
RT_MAY_LOOP_BIT = 0x3
RT_REJECT = 0x20
RUSAGE_CHILDREN = -0x1
RUSAGE_SELF = 0x0
RUSAGE_THREAD = 0x1
SCM_BINTIME = 0x4
SCM_CREDS = 0x3
SCM_MONOTONIC = 0x6
SCM_REALTIME = 0x5
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
SCM_TIME_INFO = 0x7
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
SIOCADDMULTI = 0x80206931
SIOCAIFADDR = 0x8040691a
SIOCAIFGROUP = 0x80246987
SIOCATMARK = 0x40047307
SIOCDELMULTI = 0x80206932
SIOCDIFADDR = 0x80206919
SIOCDIFGROUP = 0x80246989
SIOCDIFPHYADDR = 0x80206949
SIOCGDRVSPEC = 0xc01c697b
SIOCGETSGCNT = 0xc0147210
SIOCGETVIFCNT = 0xc014720f
SIOCGHIWAT = 0x40047301
SIOCGHWADDR = 0xc020693e
SIOCGI2C = 0xc020693d
SIOCGIFADDR = 0xc0206921
SIOCGIFBRDADDR = 0xc0206923
SIOCGIFCAP = 0xc020691f
SIOCGIFCONF = 0xc0086924
SIOCGIFDESCR = 0xc020692a
SIOCGIFDSTADDR = 0xc0206922
SIOCGIFFIB = 0xc020695c
SIOCGIFFLAGS = 0xc0206911
SIOCGIFGENERIC = 0xc020693a
SIOCGIFGMEMB = 0xc024698a
SIOCGIFGROUP = 0xc0246988
SIOCGIFINDEX = 0xc0206920
SIOCGIFMAC = 0xc0206926
SIOCGIFMEDIA = 0xc0286938
SIOCGIFMETRIC = 0xc0206917
SIOCGIFMTU = 0xc0206933
SIOCGIFNETMASK = 0xc0206925
SIOCGIFPDSTADDR = 0xc0206948
SIOCGIFPHYS = 0xc0206935
SIOCGIFPSRCADDR = 0xc0206947
SIOCGIFRSSHASH = 0xc0186997
SIOCGIFRSSKEY = 0xc0946996
SIOCGIFSTATUS = 0xc331693b
SIOCGIFXMEDIA = 0xc028698b
SIOCGLANPCP = 0xc0206998
SIOCGLOWAT = 0x40047303
SIOCGPGRP = 0x40047309
SIOCGPRIVATE_0 = 0xc0206950
SIOCGPRIVATE_1 = 0xc0206951
SIOCGTUNFIB = 0xc020695e
SIOCIFCREATE = 0xc020697a
SIOCIFCREATE2 = 0xc020697c
SIOCIFDESTROY = 0x80206979
SIOCIFGCLONERS = 0xc00c6978
SIOCSDRVSPEC = 0x801c697b
SIOCSHIWAT = 0x80047300
SIOCSIFADDR = 0x8020690c
SIOCSIFBRDADDR = 0x80206913
SIOCSIFCAP = 0x8020691e
SIOCSIFDESCR = 0x80206929
SIOCSIFDSTADDR = 0x8020690e
SIOCSIFFIB = 0x8020695d
SIOCSIFFLAGS = 0x80206910
SIOCSIFGENERIC = 0x80206939
SIOCSIFLLADDR = 0x8020693c
SIOCSIFMAC = 0x80206927
SIOCSIFMEDIA = 0xc0206937
SIOCSIFMETRIC = 0x80206918
SIOCSIFMTU = 0x80206934
SIOCSIFNAME = 0x80206928
SIOCSIFNETMASK = 0x80206916
SIOCSIFPHYADDR = 0x80406946
SIOCSIFPHYS = 0x80206936
SIOCSIFRVNET = 0xc020695b
SIOCSIFVNET = 0xc020695a
SIOCSLANPCP = 0x80206999
SIOCSLOWAT = 0x80047302
SIOCSPGRP = 0x80047308
SIOCSTUNFIB = 0x8020695f
SOCK_CLOEXEC = 0x10000000
SOCK_DGRAM = 0x2
SOCK_MAXADDRLEN = 0xff
SOCK_NONBLOCK = 0x20000000
SOCK_RAW = 0x3
SOCK_RDM = 0x4
SOCK_SEQPACKET = 0x5
SOCK_STREAM = 0x1
SOL_SOCKET = 0xffff
SOMAXCONN = 0x80
SO_ACCEPTCONN = 0x2
SO_ACCEPTFILTER = 0x1000
SO_BINTIME = 0x2000
SO_BROADCAST = 0x20
SO_DEBUG = 0x1
SO_DOMAIN = 0x1019
SO_DONTROUTE = 0x10
SO_ERROR = 0x1007
SO_KEEPALIVE = 0x8
SO_LABEL = 0x1009
SO_LINGER = 0x80
SO_LISTENINCQLEN = 0x1013
SO_LISTENQLEN = 0x1012
SO_LISTENQLIMIT = 0x1011
SO_MAX_PACING_RATE = 0x1018
SO_NOSIGPIPE = 0x800
SO_NO_DDP = 0x8000
SO_NO_OFFLOAD = 0x4000
SO_OOBINLINE = 0x100
SO_PEERLABEL = 0x1010
SO_PROTOCOL = 0x1016
SO_PROTOTYPE = 0x1016
SO_RCVBUF = 0x1002
SO_RCVLOWAT = 0x1004
SO_RCVTIMEO = 0x1006
SO_REUSEADDR = 0x4
SO_REUSEPORT = 0x200
SO_REUSEPORT_LB = 0x10000
SO_SETFIB = 0x1014
SO_SNDBUF = 0x1001
SO_SNDLOWAT = 0x1003
SO_SNDTIMEO = 0x1005
SO_TIMESTAMP = 0x400
SO_TS_BINTIME = 0x1
SO_TS_CLOCK = 0x1017
SO_TS_CLOCK_MAX = 0x3
SO_TS_DEFAULT = 0x0
SO_TS_MONOTONIC = 0x3
SO_TS_REALTIME = 0x2
SO_TS_REALTIME_MICRO = 0x0
SO_TYPE = 0x1008
SO_USELOOPBACK = 0x40
SO_USER_COOKIE = 0x1015
SO_VENDOR = 0x80000000
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
S_IFCHR = 0x2000
S_IFDIR = 0x4000
S_IFIFO = 0x1000
S_IFLNK = 0xa000
S_IFMT = 0xf000
S_IFREG = 0x8000
S_IFSOCK = 0xc000
S_IFWHT = 0xe000
S_IREAD = 0x100
S_IRGRP = 0x20
S_IROTH = 0x4
S_IRUSR = 0x100
S_IRWXG = 0x38
S_IRWXO = 0x7
S_IRWXU = 0x1c0
S_ISGID = 0x400
S_ISTXT = 0x200
S_ISUID = 0x800
S_ISVTX = 0x200
S_IWGRP = 0x10
S_IWOTH = 0x2
S_IWRITE = 0x80
S_IWUSR = 0x80
S_IXGRP = 0x8
S_IXOTH = 0x1
S_IXUSR = 0x40
TAB0 = 0x0
TAB3 = 0x4
TABDLY = 0x4
TCIFLUSH = 0x1
TCIOFF = 0x3
TCIOFLUSH = 0x3
TCION = 0x4
TCOFLUSH = 0x2
TCOOFF = 0x1
TCOON = 0x2
TCP_BBR_ACK_COMP_ALG = 0x448
TCP_BBR_DRAIN_INC_EXTRA = 0x43c
TCP_BBR_DRAIN_PG = 0x42e
TCP_BBR_EXTRA_GAIN = 0x449
TCP_BBR_IWINTSO = 0x42b
TCP_BBR_LOWGAIN_FD = 0x436
TCP_BBR_LOWGAIN_HALF = 0x435
TCP_BBR_LOWGAIN_THRESH = 0x434
TCP_BBR_MAX_RTO = 0x439
TCP_BBR_MIN_RTO = 0x438
TCP_BBR_ONE_RETRAN = 0x431
TCP_BBR_PACE_CROSS = 0x442
TCP_BBR_PACE_DEL_TAR = 0x43f
TCP_BBR_PACE_PER_SEC = 0x43e
TCP_BBR_PACE_SEG_MAX = 0x440
TCP_BBR_PACE_SEG_MIN = 0x441
TCP_BBR_PROBE_RTT_GAIN = 0x44d
TCP_BBR_PROBE_RTT_INT = 0x430
TCP_BBR_PROBE_RTT_LEN = 0x44e
TCP_BBR_RACK_RTT_USE = 0x44a
TCP_BBR_RECFORCE = 0x42c
TCP_BBR_REC_OVER_HPTS = 0x43a
TCP_BBR_RETRAN_WTSO = 0x44b
TCP_BBR_RWND_IS_APP = 0x42f
TCP_BBR_STARTUP_EXIT_EPOCH = 0x43d
TCP_BBR_STARTUP_LOSS_EXIT = 0x432
TCP_BBR_STARTUP_PG = 0x42d
TCP_BBR_UNLIMITED = 0x43b
TCP_BBR_USEDEL_RATE = 0x437
TCP_BBR_USE_LOWGAIN = 0x433
TCP_CA_NAME_MAX = 0x10
TCP_CCALGOOPT = 0x41
TCP_CONGESTION = 0x40
TCP_DATA_AFTER_CLOSE = 0x44c
TCP_DELACK = 0x48
TCP_FASTOPEN = 0x401
TCP_FASTOPEN_MAX_COOKIE_LEN = 0x10
TCP_FASTOPEN_MIN_COOKIE_LEN = 0x4
TCP_FASTOPEN_PSK_LEN = 0x10
TCP_FUNCTION_BLK = 0x2000
TCP_FUNCTION_NAME_LEN_MAX = 0x20
TCP_INFO = 0x20
TCP_KEEPCNT = 0x400
TCP_KEEPIDLE = 0x100
TCP_KEEPINIT = 0x80
TCP_KEEPINTVL = 0x200
TCP_LOG = 0x22
TCP_LOGBUF = 0x23
TCP_LOGDUMP = 0x25
TCP_LOGDUMPID = 0x26
TCP_LOGID = 0x24
TCP_LOG_ID_LEN = 0x40
TCP_MAXBURST = 0x4
TCP_MAXHLEN = 0x3c
TCP_MAXOLEN = 0x28
TCP_MAXSEG = 0x2
TCP_MAXWIN = 0xffff
TCP_MAX_SACK = 0x4
TCP_MAX_WINSHIFT = 0xe
TCP_MD5SIG = 0x10
TCP_MINMSS = 0xd8
TCP_MSS = 0x218
TCP_NODELAY = 0x1
TCP_NOOPT = 0x8
TCP_NOPUSH = 0x4
TCP_PCAP_IN = 0x1000
TCP_PCAP_OUT = 0x800
TCP_RACK_EARLY_RECOV = 0x423
TCP_RACK_EARLY_SEG = 0x424
TCP_RACK_IDLE_REDUCE_HIGH = 0x444
TCP_RACK_MIN_PACE = 0x445
TCP_RACK_MIN_PACE_SEG = 0x446
TCP_RACK_MIN_TO = 0x422
TCP_RACK_PACE_ALWAYS = 0x41f
TCP_RACK_PACE_MAX_SEG = 0x41e
TCP_RACK_PACE_REDUCE = 0x41d
TCP_RACK_PKT_DELAY = 0x428
TCP_RACK_PROP = 0x41b
TCP_RACK_PROP_RATE = 0x420
TCP_RACK_PRR_SENDALOT = 0x421
TCP_RACK_REORD_FADE = 0x426
TCP_RACK_REORD_THRESH = 0x425
TCP_RACK_SESS_CWV = 0x42a
TCP_RACK_TLP_INC_VAR = 0x429
TCP_RACK_TLP_REDUCE = 0x41c
TCP_RACK_TLP_THRESH = 0x427
TCP_RACK_TLP_USE = 0x447
TCP_VENDOR = 0x80000000
TCSAFLUSH = 0x2
TIMER_ABSTIME = 0x1
TIMER_RELTIME = 0x0
TIOCCBRK = 0x2000747a
TIOCCDTR = 0x20007478
TIOCCONS = 0x80047462
TIOCDRAIN = 0x2000745e
TIOCEXCL = 0x2000740d
TIOCEXT = 0x80047460
TIOCFLUSH = 0x80047410
TIOCGDRAINWAIT = 0x40047456
TIOCGETA = 0x402c7413
TIOCGETD = 0x4004741a
TIOCGPGRP = 0x40047477
TIOCGPTN = 0x4004740f
TIOCGSID = 0x40047463
TIOCGWINSZ = 0x40087468
TIOCMBIC = 0x8004746b
TIOCMBIS = 0x8004746c
TIOCMGDTRWAIT = 0x4004745a
TIOCMGET = 0x4004746a
TIOCMSDTRWAIT = 0x8004745b
TIOCMSET = 0x8004746d
TIOCM_CAR = 0x40
TIOCM_CD = 0x40
TIOCM_CTS = 0x20
TIOCM_DCD = 0x40
TIOCM_DSR = 0x100
TIOCM_DTR = 0x2
TIOCM_LE = 0x1
TIOCM_RI = 0x80
TIOCM_RNG = 0x80
TIOCM_RTS = 0x4
TIOCM_SR = 0x10
TIOCM_ST = 0x8
TIOCNOTTY = 0x20007471
TIOCNXCL = 0x2000740e
TIOCOUTQ = 0x40047473
TIOCPKT = 0x80047470
TIOCPKT_DATA = 0x0
TIOCPKT_DOSTOP = 0x20
TIOCPKT_FLUSHREAD = 0x1
TIOCPKT_FLUSHWRITE = 0x2
TIOCPKT_IOCTL = 0x40
TIOCPKT_NOSTOP = 0x10
TIOCPKT_START = 0x8
TIOCPKT_STOP = 0x4
TIOCPTMASTER = 0x2000741c
TIOCSBRK = 0x2000747b
TIOCSCTTY = 0x20007461
TIOCSDRAINWAIT = 0x80047457
TIOCSDTR = 0x20007479
TIOCSETA = 0x802c7414
TIOCSETAF = 0x802c7416
TIOCSETAW = 0x802c7415
TIOCSETD = 0x8004741b
TIOCSIG = 0x2004745f
TIOCSPGRP = 0x80047476
TIOCSTART = 0x2000746e
TIOCSTAT = 0x20007465
TIOCSTI = 0x80017472
TIOCSTOP = 0x2000746f
TIOCSWINSZ = 0x80087467
TIOCTIMESTAMP = 0x40087459
TIOCUCNTL = 0x80047466
TOSTOP = 0x400000
UTIME_NOW = -0x1
UTIME_OMIT = -0x2
VDISCARD = 0xf
VDSUSP = 0xb
VEOF = 0x0
VEOL = 0x1
VEOL2 = 0x2
VERASE = 0x3
VERASE2 = 0x7
VINTR = 0x8
VKILL = 0x5
VLNEXT = 0xe
VMIN = 0x10
VM_BCACHE_SIZE_MAX = 0x70e0000
VM_SWZONE_SIZE_MAX = 0x2280000
VQUIT = 0x9
VREPRINT = 0x6
VSTART = 0xc
VSTATUS = 0x12
VSTOP = 0xd
VSUSP = 0xa
VTIME = 0x11
VWERASE = 0x4
WCONTINUED = 0x4
WCOREFLAG = 0x80
WEXITED = 0x10
WLINUXCLONE = 0x80000000
WNOHANG = 0x1
WNOWAIT = 0x8
WSTOPPED = 0x2
WTRAPPED = 0x20
WUNTRACED = 0x2
)
// Errors
const (
E2BIG = syscall.Errno(0x7)
EACCES = syscall.Errno(0xd)
EADDRINUSE = syscall.Errno(0x30)
EADDRNOTAVAIL = syscall.Errno(0x31)
EAFNOSUPPORT = syscall.Errno(0x2f)
EAGAIN = syscall.Errno(0x23)
EALREADY = syscall.Errno(0x25)
EAUTH = syscall.Errno(0x50)
EBADF = syscall.Errno(0x9)
EBADMSG = syscall.Errno(0x59)
EBADRPC = syscall.Errno(0x48)
EBUSY = syscall.Errno(0x10)
ECANCELED = syscall.Errno(0x55)
ECAPMODE = syscall.Errno(0x5e)
ECHILD = syscall.Errno(0xa)
ECONNABORTED = syscall.Errno(0x35)
ECONNREFUSED = syscall.Errno(0x3d)
ECONNRESET = syscall.Errno(0x36)
EDEADLK = syscall.Errno(0xb)
EDESTADDRREQ = syscall.Errno(0x27)
EDOM = syscall.Errno(0x21)
EDOOFUS = syscall.Errno(0x58)
EDQUOT = syscall.Errno(0x45)
EEXIST = syscall.Errno(0x11)
EFAULT = syscall.Errno(0xe)
EFBIG = syscall.Errno(0x1b)
EFTYPE = syscall.Errno(0x4f)
EHOSTDOWN = syscall.Errno(0x40)
EHOSTUNREACH = syscall.Errno(0x41)
EIDRM = syscall.Errno(0x52)
EILSEQ = syscall.Errno(0x56)
EINPROGRESS = syscall.Errno(0x24)
EINTR = syscall.Errno(0x4)
EINVAL = syscall.Errno(0x16)
EIO = syscall.Errno(0x5)
EISCONN = syscall.Errno(0x38)
EISDIR = syscall.Errno(0x15)
ELAST = syscall.Errno(0x60)
ELOOP = syscall.Errno(0x3e)
EMFILE = syscall.Errno(0x18)
EMLINK = syscall.Errno(0x1f)
EMSGSIZE = syscall.Errno(0x28)
EMULTIHOP = syscall.Errno(0x5a)
ENAMETOOLONG = syscall.Errno(0x3f)
ENEEDAUTH = syscall.Errno(0x51)
ENETDOWN = syscall.Errno(0x32)
ENETRESET = syscall.Errno(0x34)
ENETUNREACH = syscall.Errno(0x33)
ENFILE = syscall.Errno(0x17)
ENOATTR = syscall.Errno(0x57)
ENOBUFS = syscall.Errno(0x37)
ENODEV = syscall.Errno(0x13)
ENOENT = syscall.Errno(0x2)
ENOEXEC = syscall.Errno(0x8)
ENOLCK = syscall.Errno(0x4d)
ENOLINK = syscall.Errno(0x5b)
ENOMEM = syscall.Errno(0xc)
ENOMSG = syscall.Errno(0x53)
ENOPROTOOPT = syscall.Errno(0x2a)
ENOSPC = syscall.Errno(0x1c)
ENOSYS = syscall.Errno(0x4e)
ENOTBLK = syscall.Errno(0xf)
ENOTCAPABLE = syscall.Errno(0x5d)
ENOTCONN = syscall.Errno(0x39)
ENOTDIR = syscall.Errno(0x14)
ENOTEMPTY = syscall.Errno(0x42)
ENOTRECOVERABLE = syscall.Errno(0x5f)
ENOTSOCK = syscall.Errno(0x26)
ENOTSUP = syscall.Errno(0x2d)
ENOTTY = syscall.Errno(0x19)
ENXIO = syscall.Errno(0x6)
EOPNOTSUPP = syscall.Errno(0x2d)
EOVERFLOW = syscall.Errno(0x54)
EOWNERDEAD = syscall.Errno(0x60)
EPERM = syscall.Errno(0x1)
EPFNOSUPPORT = syscall.Errno(0x2e)
EPIPE = syscall.Errno(0x20)
EPROCLIM = syscall.Errno(0x43)
EPROCUNAVAIL = syscall.Errno(0x4c)
EPROGMISMATCH = syscall.Errno(0x4b)
EPROGUNAVAIL = syscall.Errno(0x4a)
EPROTO = syscall.Errno(0x5c)
EPROTONOSUPPORT = syscall.Errno(0x2b)
EPROTOTYPE = syscall.Errno(0x29)
ERANGE = syscall.Errno(0x22)
EREMOTE = syscall.Errno(0x47)
EROFS = syscall.Errno(0x1e)
ERPCMISMATCH = syscall.Errno(0x49)
ESHUTDOWN = syscall.Errno(0x3a)
ESOCKTNOSUPPORT = syscall.Errno(0x2c)
ESPIPE = syscall.Errno(0x1d)
ESRCH = syscall.Errno(0x3)
ESTALE = syscall.Errno(0x46)
ETIMEDOUT = syscall.Errno(0x3c)
ETOOMANYREFS = syscall.Errno(0x3b)
ETXTBSY = syscall.Errno(0x1a)
EUSERS = syscall.Errno(0x44)
EWOULDBLOCK = syscall.Errno(0x23)
EXDEV = syscall.Errno(0x12)
)
// Signals
const (
SIGABRT = syscall.Signal(0x6)
SIGALRM = syscall.Signal(0xe)
SIGBUS = syscall.Signal(0xa)
SIGCHLD = syscall.Signal(0x14)
SIGCONT = syscall.Signal(0x13)
SIGEMT = syscall.Signal(0x7)
SIGFPE = syscall.Signal(0x8)
SIGHUP = syscall.Signal(0x1)
SIGILL = syscall.Signal(0x4)
SIGINFO = syscall.Signal(0x1d)
SIGINT = syscall.Signal(0x2)
SIGIO = syscall.Signal(0x17)
SIGIOT = syscall.Signal(0x6)
SIGKILL = syscall.Signal(0x9)
SIGLIBRT = syscall.Signal(0x21)
SIGLWP = syscall.Signal(0x20)
SIGPIPE = syscall.Signal(0xd)
SIGPROF = syscall.Signal(0x1b)
SIGQUIT = syscall.Signal(0x3)
SIGSEGV = syscall.Signal(0xb)
SIGSTOP = syscall.Signal(0x11)
SIGSYS = syscall.Signal(0xc)
SIGTERM = syscall.Signal(0xf)
SIGTHR = syscall.Signal(0x20)
SIGTRAP = syscall.Signal(0x5)
SIGTSTP = syscall.Signal(0x12)
SIGTTIN = syscall.Signal(0x15)
SIGTTOU = syscall.Signal(0x16)
SIGURG = syscall.Signal(0x10)
SIGUSR1 = syscall.Signal(0x1e)
SIGUSR2 = syscall.Signal(0x1f)
SIGVTALRM = syscall.Signal(0x1a)
SIGWINCH = syscall.Signal(0x1c)
SIGXCPU = syscall.Signal(0x18)
SIGXFSZ = syscall.Signal(0x19)
)
// Error table
var errorList = [...]struct {
num syscall.Errno
name string
desc string
}{
{1, "EPERM", "operation not permitted"},
{2, "ENOENT", "no such file or directory"},
{3, "ESRCH", "no such process"},
{4, "EINTR", "interrupted system call"},
{5, "EIO", "input/output error"},
{6, "ENXIO", "device not configured"},
{7, "E2BIG", "argument list too long"},
{8, "ENOEXEC", "exec format error"},
{9, "EBADF", "bad file descriptor"},
{10, "ECHILD", "no child processes"},
{11, "EDEADLK", "resource deadlock avoided"},
{12, "ENOMEM", "cannot allocate memory"},
{13, "EACCES", "permission denied"},
{14, "EFAULT", "bad address"},
{15, "ENOTBLK", "block device required"},
{16, "EBUSY", "device busy"},
{17, "EEXIST", "file exists"},
{18, "EXDEV", "cross-device link"},
{19, "ENODEV", "operation not supported by device"},
{20, "ENOTDIR", "not a directory"},
{21, "EISDIR", "is a directory"},
{22, "EINVAL", "invalid argument"},
{23, "ENFILE", "too many open files in system"},
{24, "EMFILE", "too many open files"},
{25, "ENOTTY", "inappropriate ioctl for device"},
{26, "ETXTBSY", "text file busy"},
{27, "EFBIG", "file too large"},
{28, "ENOSPC", "no space left on device"},
{29, "ESPIPE", "illegal seek"},
{30, "EROFS", "read-only file system"},
{31, "EMLINK", "too many links"},
{32, "EPIPE", "broken pipe"},
{33, "EDOM", "numerical argument out of domain"},
{34, "ERANGE", "result too large"},
{35, "EAGAIN", "resource temporarily unavailable"},
{36, "EINPROGRESS", "operation now in progress"},
{37, "EALREADY", "operation already in progress"},
{38, "ENOTSOCK", "socket operation on non-socket"},
{39, "EDESTADDRREQ", "destination address required"},
{40, "EMSGSIZE", "message too long"},
{41, "EPROTOTYPE", "protocol wrong type for socket"},
{42, "ENOPROTOOPT", "protocol not available"},
{43, "EPROTONOSUPPORT", "protocol not supported"},
{44, "ESOCKTNOSUPPORT", "socket type not supported"},
{45, "EOPNOTSUPP", "operation not supported"},
{46, "EPFNOSUPPORT", "protocol family not supported"},
{47, "EAFNOSUPPORT", "address family not supported by protocol family"},
{48, "EADDRINUSE", "address already in use"},
{49, "EADDRNOTAVAIL", "can't assign requested address"},
{50, "ENETDOWN", "network is down"},
{51, "ENETUNREACH", "network is unreachable"},
{52, "ENETRESET", "network dropped connection on reset"},
{53, "ECONNABORTED", "software caused connection abort"},
{54, "ECONNRESET", "connection reset by peer"},
{55, "ENOBUFS", "no buffer space available"},
{56, "EISCONN", "socket is already connected"},
{57, "ENOTCONN", "socket is not connected"},
{58, "ESHUTDOWN", "can't send after socket shutdown"},
{59, "ETOOMANYREFS", "too many references: can't splice"},
{60, "ETIMEDOUT", "operation timed out"},
{61, "ECONNREFUSED", "connection refused"},
{62, "ELOOP", "too many levels of symbolic links"},
{63, "ENAMETOOLONG", "file name too long"},
{64, "EHOSTDOWN", "host is down"},
{65, "EHOSTUNREACH", "no route to host"},
{66, "ENOTEMPTY", "directory not empty"},
{67, "EPROCLIM", "too many processes"},
{68, "EUSERS", "too many users"},
{69, "EDQUOT", "disc quota exceeded"},
{70, "ESTALE", "stale NFS file handle"},
{71, "EREMOTE", "too many levels of remote in path"},
{72, "EBADRPC", "RPC struct is bad"},
{73, "ERPCMISMATCH", "RPC version wrong"},
{74, "EPROGUNAVAIL", "RPC prog. not avail"},
{75, "EPROGMISMATCH", "program version wrong"},
{76, "EPROCUNAVAIL", "bad procedure for program"},
{77, "ENOLCK", "no locks available"},
{78, "ENOSYS", "function not implemented"},
{79, "EFTYPE", "inappropriate file type or format"},
{80, "EAUTH", "authentication error"},
{81, "ENEEDAUTH", "need authenticator"},
{82, "EIDRM", "identifier removed"},
{83, "ENOMSG", "no message of desired type"},
{84, "EOVERFLOW", "value too large to be stored in data type"},
{85, "ECANCELED", "operation canceled"},
{86, "EILSEQ", "illegal byte sequence"},
{87, "ENOATTR", "attribute not found"},
{88, "EDOOFUS", "programming error"},
{89, "EBADMSG", "bad message"},
{90, "EMULTIHOP", "multihop attempted"},
{91, "ENOLINK", "link has been severed"},
{92, "EPROTO", "protocol error"},
{93, "ENOTCAPABLE", "capabilities insufficient"},
{94, "ECAPMODE", "not permitted in capability mode"},
{95, "ENOTRECOVERABLE", "state not recoverable"},
{96, "EOWNERDEAD", "previous owner died"},
}
// Signal table
var signalList = [...]struct {
num syscall.Signal
name string
desc string
}{
{1, "SIGHUP", "hangup"},
{2, "SIGINT", "interrupt"},
{3, "SIGQUIT", "quit"},
{4, "SIGILL", "illegal instruction"},
{5, "SIGTRAP", "trace/BPT trap"},
{6, "SIGIOT", "abort trap"},
{7, "SIGEMT", "EMT trap"},
{8, "SIGFPE", "floating point exception"},
{9, "SIGKILL", "killed"},
{10, "SIGBUS", "bus error"},
{11, "SIGSEGV", "segmentation fault"},
{12, "SIGSYS", "bad system call"},
{13, "SIGPIPE", "broken pipe"},
{14, "SIGALRM", "alarm clock"},
{15, "SIGTERM", "terminated"},
{16, "SIGURG", "urgent I/O condition"},
{17, "SIGSTOP", "suspended (signal)"},
{18, "SIGTSTP", "suspended"},
{19, "SIGCONT", "continued"},
{20, "SIGCHLD", "child exited"},
{21, "SIGTTIN", "stopped (tty input)"},
{22, "SIGTTOU", "stopped (tty output)"},
{23, "SIGIO", "I/O possible"},
{24, "SIGXCPU", "cputime limit exceeded"},
{25, "SIGXFSZ", "filesize limit exceeded"},
{26, "SIGVTALRM", "virtual timer expired"},
{27, "SIGPROF", "profiling timer expired"},
{28, "SIGWINCH", "window size changes"},
{29, "SIGINFO", "information request"},
{30, "SIGUSR1", "user defined signal 1"},
{31, "SIGUSR2", "user defined signal 2"},
{32, "SIGTHR", "unknown signal"},
{33, "SIGLIBRT", "unknown signal"},
}
| {
"pile_set_name": "Github"
} |
using System;
namespace PowerApps.Samples.Metadata
{
//Modified to reflect changes to EntityMetadata for Web API
[Flags]
public enum EntityFilters
{
EntityOnly = 0,
Keys = 2,
Attributes = 4,
ManyToManyRelationships = 8,
ManyToOneRelationships = 16,
OneToManyRelationships = 32,
AllRelationships = 64,
All = 128
}
} | {
"pile_set_name": "Github"
} |
export { default } from "liquid-fire/components/liquid-container";
| {
"pile_set_name": "Github"
} |
#include QMK_KEYBOARD_H
#include "keymap_jp.h"
#ifdef RGBLIGHT_ENABLE
//Following line allows macro to read current RGB settings
extern rgblight_config_t rgblight_config;
#endif
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
enum layer_number {
_BASE = 0,
_LOWER,
_RAISE,
_ADJUST,
};
enum custom_keycodes {
RGBRST = SAFE_RANGE,
LOWER,
RAISE,
KANJI,
};
// enum tapdances{
// TD_CODO = 0,
// TD_SLRO,
// };
// Layer Mode aliases
#define KC_MLAD MO(_ADJUST)
// Base layer mod tap
#define KC_A_SF LSFT_T(KC_A)
#define KC_Z_CT LCTL_T(KC_Z)
#define KC_X_AL LALT_T(KC_X)
#define KC_C_GU LGUI_T(KC_C)
#define KC_SSCT RCTL_T(KC_SLSH)
#define KC_ENSF RSFT_T(KC_ENT)
// Lower layer mod tap
#define KC_F6SF LSFT_T(KC_F6)
#define KC_QUSF RSFT_T(KC_QUOT)
#define KC_11CT LCTL_T(KC_F11)
#define KC_12AL LALT_T(KC_F12)
// Layer tap
#define KC_BSLO LT(_LOWER, KC_BSPC)
#define KC_SPRA LT(_RAISE, KC_SPC)
// Tap dance
// #define KC_CODO TD(TD_CODO)
// #define KC_SLRO TD(TD_SLRO)
// qk_tap_dance_action_t tap_dance_actions[] = {
// [TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT),
// [TD_SLRO] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_RO),
// };
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT(
//,---------------------------------------------------------------------------------------------------.
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
//|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------|
KC_A_SF, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENSF,
//|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------|
KC_Z_CT, KC_X_AL, KC_C_GU, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SSCT,
//`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------'
KC_BSLO, KC_SPRA
// `---------|---------'
),
[_LOWER] = LAYOUT(
//,---------------------------------------------------------------------------------------------------.
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
//|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------|
KC_F6SF, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, XXXXXXX, KC_SCLN, KC_QUSF,
//|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------|
KC_11CT, KC_12AL, KC_ESC, KC_TAB, KANJI, KC_DEL, XXXXXXX, XXXXXXX, KC_RO, KC_GRV,
//`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------'
_______, KC_MLAD
// `---------|---------'
),
[_RAISE] = LAYOUT(
//,---------------------------------------------------------------------------------------------------.
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
//|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------|
KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_LSFT,
//|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------|
KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, KC_MINS, KC_RO, KC_COMM, KC_DOT, KC_SSCT,
//`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------'
_______, _______
// `---------|---------'
),
[_ADJUST] = LAYOUT(
//,---------------------------------------------------------------------------------------------------.
RESET, RGBRST, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, KC_PSCR,
//|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------|
RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_NLCK,
//|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------|
RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX,
//`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------'
_______, _______
// `---------|---------'
)
};
uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_BSLO:
return TAPPING_LAYER_TERM;
case KC_SPRA:
return TAPPING_LAYER_TERM;
default:
return TAPPING_TERM;
}
}
int RGB_current_mode;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
bool result = false;
switch (keycode) {
case KANJI:
if (record->event.pressed) {
if (keymap_config.swap_lalt_lgui == false) {
register_code(KC_LANG2);
} else {
SEND_STRING(SS_LALT("`"));
}
} else {
unregister_code(KC_LANG2);
}
break;
#ifdef RGBLIGHT_ENABLE
//led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released
case RGB_MOD:
if (record->event.pressed) {
rgblight_mode(RGB_current_mode);
rgblight_step();
RGB_current_mode = rgblight_config.mode;
}
break;
case RGBRST:
if (record->event.pressed) {
eeconfig_update_rgblight_default();
rgblight_enable();
RGB_current_mode = rgblight_config.mode;
}
break;
#endif
default:
result = true;
break;
}
return result;
}
void keyboard_post_init_user(void) {
#ifdef RGBLIGHT_ENABLE
RGB_current_mode = rgblight_config.mode;
#endif
}
| {
"pile_set_name": "Github"
} |
/*
Copyright 2019 The Knative 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 zipkin adds Zipkin tracing support that can be used in conjunction with
SpoofingClient to log zipkin traces for requests that have encountered server errors
i.e HTTP request that have HTTP status between 500 to 600.
This package exposes following methods:
SetupZipkinTracing(*kubernetes.Clientset) error
SetupZipkinTracing sets up zipkin tracing by setting up port-forwarding from
localhost to zipkin pod on the cluster. On successful setup this method sets
an internal flag zipkinTracingEnabled to true.
CleanupZipkinTracingSetup() error
CleanupZipkinTracingSetup cleans up zipkin tracing setup by cleaning up the
port-forwarding setup by call to SetupZipkinTracing. This method also sets
zipkinTracingEnabled flag to false.
A general flow for a Test Suite to use Zipkin Tracing support is as follows:
1. Call SetupZipkinTracing(*kubernetes.Clientset) in TestMain.
2. Use SpoofingClient to make HTTP requests.
3. Call CleanupZipkinTracingSetup on cleanup after tests are executed.
*/
package zipkin
| {
"pile_set_name": "Github"
} |
using System;
using Android.Hardware.Camera2;
namespace Xamarin.CommunityToolkit.UI.Views
{
class CameraCaptureStateListener : CameraCaptureSession.StateCallback
{
public Action<CameraCaptureSession> OnConfigureFailedAction;
public Action<CameraCaptureSession> OnConfiguredAction;
public override void OnConfigureFailed(CameraCaptureSession session) => OnConfigureFailedAction?.Invoke(session);
public override void OnConfigured(CameraCaptureSession session) => OnConfiguredAction?.Invoke(session);
}
} | {
"pile_set_name": "Github"
} |
{
"gas_remaining": "7980",
"errors": [
{
"error_message": "Expected string, got int",
"start_location": { "file": "", "line": 0, "column": 0 },
"end_location": { "file": "", "line": 0, "column": 0 }
},
{
"error_message":
"Failed to parse json tests/runner/helloWorld/state_10.json:\n",
"start_location": { "file": "", "line": 0, "column": 0 },
"end_location": { "file": "", "line": 0, "column": 0 }
}
],
"warnings": []
} | {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/beagle_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:menu="@menu/gallery" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/beagle_content_padding"
android:paddingLeft="@dimen/beagle_content_padding"
android:paddingEnd="@dimen/beagle_content_padding"
android:paddingRight="@dimen/beagle_content_padding"
android:paddingBottom="@dimen/beagle_content_padding">
<ImageView
android:id="@+id/beagle_image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:importantForAccessibility="no"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<VideoView
android:id="@+id/beagle_video_view"
android:layout_width="0dp"
android:layout_height="0dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/beagle_image_view"
app:layout_constraintEnd_toEndOf="@+id/beagle_image_view"
app:layout_constraintLeft_toLeftOf="@+id/beagle_image_view"
app:layout_constraintRight_toRightOf="@+id/beagle_image_view"
app:layout_constraintStart_toStartOf="@+id/beagle_image_view"
app:layout_constraintTop_toTopOf="@+id/beagle_image_view" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout> | {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.