text
stringlengths
2
99.7k
meta
dict
<component name="libraryTable"> <library name="Maven: org.springframework:spring-context:4.1.7.RELEASE"> <CLASSES> <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/4.1.7.RELEASE/spring-context-4.1.7.RELEASE.jar!/" /> </CLASSES> <JAVADOC> <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/4.1.7.RELEASE/spring-context-4.1.7.RELEASE-javadoc.jar!/" /> </JAVADOC> <SOURCES> <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/4.1.7.RELEASE/spring-context-4.1.7.RELEASE-sources.jar!/" /> </SOURCES> </library> </component>
{ "pile_set_name": "Github" }
{ "_args": [ [ { "raw": "qs@~6.3.0", "scope": null, "escapedName": "qs", "name": "qs", "rawSpec": "~6.3.0", "spec": ">=6.3.0 <6.4.0", "type": "range" }, "D:\\Users\\aakash.h\\Desktop\\Ang5\\mat\\node_modules\\node-sass\\node_modules\\request" ] ], "_from": "qs@>=6.3.0 <6.4.0", "_id": "qs@6.3.2", "_inCache": true, "_location": "/node-sass/qs", "_nodeVersion": "7.7.1", "_npmOperationalInternal": { "host": "packages-18-east.internal.npmjs.com", "tmp": "tmp/qs-6.3.2.tgz_1488790933355_0.4183437137398869" }, "_npmUser": { "name": "ljharb", "email": "ljharb@gmail.com" }, "_npmVersion": "4.1.2", "_phantomChildren": {}, "_requested": { "raw": "qs@~6.3.0", "scope": null, "escapedName": "qs", "name": "qs", "rawSpec": "~6.3.0", "spec": ">=6.3.0 <6.4.0", "type": "range" }, "_requiredBy": [ "/node-sass/request" ], "_resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", "_shasum": "e75bd5f6e268122a2a0e0bda630b2550c166502c", "_shrinkwrap": null, "_spec": "qs@~6.3.0", "_where": "D:\\Users\\aakash.h\\Desktop\\Ang5\\mat\\node_modules\\node-sass\\node_modules\\request", "bugs": { "url": "https://github.com/ljharb/qs/issues" }, "contributors": [ { "name": "Jordan Harband", "email": "ljharb@gmail.com", "url": "http://ljharb.codes" } ], "dependencies": {}, "description": "A querystring parser that supports nesting and arrays, with a depth limit", "devDependencies": { "@ljharb/eslint-config": "^11.0.0", "browserify": "^14.1.0", "covert": "^1.1.0", "eslint": "^3.17.0", "evalmd": "^0.0.17", "iconv-lite": "^0.4.15", "mkdirp": "^0.5.1", "parallelshell": "^2.0.0", "qs-iconv": "^1.0.4", "safe-publish-latest": "^1.1.1", "tape": "^4.6.3" }, "directories": {}, "dist": { "shasum": "e75bd5f6e268122a2a0e0bda630b2550c166502c", "tarball": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz" }, "engines": { "node": ">=0.6" }, "gitHead": "9ee56121311dac6b6014bfe56b3df0ebbf4ed048", "homepage": "https://github.com/ljharb/qs", "keywords": [ "querystring", "qs" ], "license": "BSD-3-Clause", "main": "lib/index.js", "maintainers": [ { "name": "hueniverse", "email": "eran@hammer.io" }, { "name": "ljharb", "email": "ljharb@gmail.com" }, { "name": "nlf", "email": "quitlahok@gmail.com" } ], "name": "qs", "optionalDependencies": {}, "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/ljharb/qs.git" }, "scripts": { "coverage": "covert test", "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js", "lint": "eslint lib/*.js test/*.js", "prepublish": "safe-publish-latest && npm run dist", "pretest": "npm run --silent readme && npm run --silent lint", "readme": "evalmd README.md", "test": "npm run --silent coverage", "tests-only": "node test" }, "version": "6.3.2" }
{ "pile_set_name": "Github" }
#!/bin/sh # Copyright 2009 The Go Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. COMMAND="mksysnum_plan9.sh $@" cat <<EOF // $COMMAND // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT package plan9 const( EOF SP='[ ]' # space or tab sed "s/^#define${SP}\\([A-Z0-9_][A-Z0-9_]*\\)${SP}${SP}*\\([0-9][0-9]*\\)/SYS_\\1=\\2/g" \ < $1 | grep -v SYS__ cat <<EOF ) EOF
{ "pile_set_name": "Github" }
from ctypes import * from OpenGL.GL import * from .util import _PYSPACE_GLOBAL_VARS, to_vec3, to_str from . import camera import os class Shader: def __init__(self, obj): self.obj = obj self.keys = {} def set(self, key, val): if key in _PYSPACE_GLOBAL_VARS: cur_val = _PYSPACE_GLOBAL_VARS[key] if type(val) is float and type(cur_val) is not float: val = to_vec3(val) _PYSPACE_GLOBAL_VARS[key] = val if key in self.keys: key_id = self.keys[key] if type(val) is float: glUniform1f(key_id, val) else: glUniform3fv(key_id, 1, val) def get(self, key): if key in _PYSPACE_GLOBAL_VARS: return _PYSPACE_GLOBAL_VARS[key] return None def compile(self, cam): #Open the shader source vert_dir = os.path.join(os.path.dirname(__file__), 'vert.glsl') frag_dir = os.path.join(os.path.dirname(__file__), 'frag.glsl') v_shader = open(vert_dir).read() f_shader = open(frag_dir).read() #Create code for all defines define_code = '' for k in cam.params: param = to_str(cam.params[k]) define_code += '#define ' + k + ' ' + param + '\n' define_code += '#define DE de_' + self.obj.name + '\n' define_code += '#define COL col_' + self.obj.name + '\n' split_ix = f_shader.index('// [/pydefine]') f_shader = f_shader[:split_ix] + define_code + f_shader[split_ix:] #Create code for all keys var_code = '' for k in _PYSPACE_GLOBAL_VARS: typ = 'float' if type(_PYSPACE_GLOBAL_VARS[k]) is float else 'vec3' var_code += 'uniform ' + typ + ' _' + k + ';\n' split_ix = f_shader.index('// [/pyvars]') f_shader = f_shader[:split_ix] + var_code + f_shader[split_ix:] #Create code for all pyspace nested_refs = {} space_code = self.obj.compiled(nested_refs) #Also add forward declarations forwared_decl_code = '' for k in nested_refs: forwared_decl_code += nested_refs[k].forwared_decl() space_code = forwared_decl_code + space_code split_ix = f_shader.index('// [/pyspace]') f_shader = f_shader[:split_ix] + space_code + f_shader[split_ix:] #Debugging the shader #open('frag_gen.glsl', 'w').write(f_shader) #Compile program program = self.compile_program(v_shader, f_shader) #Get variable ids for each uniform for k in _PYSPACE_GLOBAL_VARS: self.keys[k] = glGetUniformLocation(program, '_' + k); #Return the program return program def compile_shader(self, source, shader_type): shader = glCreateShader(shader_type) glShaderSource(shader, source) glCompileShader(shader) status = c_int() glGetShaderiv(shader, GL_COMPILE_STATUS, byref(status)) if not status.value: self.print_log(shader) glDeleteShader(shader) raise ValueError('Shader compilation failed') return shader def compile_program(self, vertex_source, fragment_source): vertex_shader = None fragment_shader = None program = glCreateProgram() if vertex_source: print("Compiling Vertex Shader...") vertex_shader = self.compile_shader(vertex_source, GL_VERTEX_SHADER) glAttachShader(program, vertex_shader) if fragment_source: print("Compiling Fragment Shader...") fragment_shader = self.compile_shader(fragment_source, GL_FRAGMENT_SHADER) glAttachShader(program, fragment_shader) glBindAttribLocation(program, 0, "vPosition") glLinkProgram(program) if vertex_shader: glDeleteShader(vertex_shader) if fragment_shader: glDeleteShader(fragment_shader) return program def print_log(self, shader): length = c_int() glGetShaderiv(shader, GL_INFO_LOG_LENGTH, byref(length)) if length.value > 0: log = create_string_buffer(length.value) print(glGetShaderInfoLog(shader))
{ "pile_set_name": "Github" }
--- description: "Automatically generated file. DO NOT MODIFY" --- ```javascript const options = { authProvider, }; const client = Client.init(options); const educationClass = { description: "History - World History 1", displayName: "World History Level 1", }; let res = await client.api('/education/classes/11014') .version('beta') .update(educationClass); ```
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- """ Created on 2017 10.17 @author: liupeng wechat: lp9628 blog: http://blog.csdn.net/u014365862/article/details/78422372 """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf slim = tf.contrib.slim def inception_arg_scope(weight_decay=0.00004, use_batch_norm=True, batch_norm_decay=0.9997, batch_norm_epsilon=0.001): """Defines the default arg scope for inception models. Args: weight_decay: The weight decay to use for regularizing the model. use_batch_norm: "If `True`, batch_norm is applied after each convolution. batch_norm_decay: Decay for batch norm moving average. batch_norm_epsilon: Small float added to variance to avoid dividing by zero in batch norm. Returns: An `arg_scope` to use for the inception models. """ batch_norm_params = { # Decay for the moving averages. 'decay': batch_norm_decay, # epsilon to prevent 0s in variance. 'epsilon': batch_norm_epsilon, # collection containing update_ops. 'updates_collections': tf.GraphKeys.UPDATE_OPS, } if use_batch_norm: normalizer_fn = slim.batch_norm normalizer_params = batch_norm_params else: normalizer_fn = None normalizer_params = {} # Set weight_decay for weights in Conv and FC layers. with slim.arg_scope([slim.conv2d, slim.fully_connected], weights_regularizer=slim.l2_regularizer(weight_decay)): with slim.arg_scope( [slim.conv2d], weights_initializer=slim.variance_scaling_initializer(), activation_fn=tf.nn.relu, normalizer_fn=normalizer_fn, normalizer_params=normalizer_params) as sc: return sc
{ "pile_set_name": "Github" }
// // UIImageViewTap.m // Momento // // Created by Michael Waterfall on 04/11/2009. // Copyright 2009 d3i. All rights reserved. // #import "MWTapDetectingImageView.h" @implementation MWTapDetectingImageView - (id)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) { self.userInteractionEnabled = YES; } return self; } - (id)initWithImage:(UIImage *)image { if ((self = [super initWithImage:image])) { self.userInteractionEnabled = YES; } return self; } - (id)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage { if ((self = [super initWithImage:image highlightedImage:highlightedImage])) { self.userInteractionEnabled = YES; } return self; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; NSUInteger tapCount = touch.tapCount; switch (tapCount) { case 1: [self handleSingleTap:touch]; break; case 2: [self handleDoubleTap:touch]; break; case 3: [self handleTripleTap:touch]; break; default: break; } [[self nextResponder] touchesEnded:touches withEvent:event]; } - (void)handleSingleTap:(UITouch *)touch { if ([_tapDelegate respondsToSelector:@selector(imageView:singleTapDetected:)]) [_tapDelegate imageView:self singleTapDetected:touch]; } - (void)handleDoubleTap:(UITouch *)touch { if ([_tapDelegate respondsToSelector:@selector(imageView:doubleTapDetected:)]) [_tapDelegate imageView:self doubleTapDetected:touch]; } - (void)handleTripleTap:(UITouch *)touch { if ([_tapDelegate respondsToSelector:@selector(imageView:tripleTapDetected:)]) [_tapDelegate imageView:self tripleTapDetected:touch]; } @end
{ "pile_set_name": "Github" }
#version 450 layout(local_size_x = 1) in; #define T mat4 #define PACKING std430 layout(set = 0, binding = 0, PACKING) buffer SSBOCol { layout(column_major) T col_major0; layout(column_major) T col_major1; }; layout(set = 0, binding = 1, PACKING) buffer SSBORow { layout(row_major) T row_major0; layout(row_major) T row_major1; }; void load_store_to_variable_col_major() { // Load to variable. T loaded = col_major0; // Store from variable. col_major1 = loaded; } void load_store_to_variable_row_major() { // Load to variable. T loaded = row_major0; // Store to variable. row_major0 = loaded; } void copy_col_major_to_col_major() { // Copy col -> col col_major0 = col_major1; } void copy_row_major_to_col_major() { // Copy row -> col col_major0 = row_major0; } void copy_col_major_to_row_major() { // Copy col -> row row_major0 = col_major0; } void copy_row_major_to_row_major() { // Copy row -> row row_major0 = row_major1; } void copy_columns() { // Copy columns/rows. col_major0[1] = row_major0[1]; row_major0[1] = col_major0[1]; } void copy_elements() { // Copy individual elements. col_major0[0][1] = row_major0[0][1]; row_major0[0][1] = col_major0[0][1]; } void main() { load_store_to_variable_col_major(); load_store_to_variable_row_major(); copy_col_major_to_col_major(); copy_col_major_to_row_major(); copy_row_major_to_col_major(); copy_row_major_to_row_major(); copy_columns(); copy_elements(); }
{ "pile_set_name": "Github" }
# promise-inflight One promise for multiple requests in flight to avoid async duplication ## USAGE ```javascript const inflight = require('promise-inflight') // some request that does some stuff function req(key) { // key is any random string. like a url or filename or whatever. return inflight(key, () => { // this is where you'd fetch the url or whatever return Promise.delay(100) }) } // only assigns a single setTimeout // when it dings, all thens get called with the same result. (There's only // one underlying promise.) req('foo').then(…) req('foo').then(…) req('foo').then(…) req('foo').then(…) ``` ## SEE ALSO * [inflight](https://npmjs.com/package/inflight) - For the callback based function on which this is based. ## STILL NEEDS Tests!
{ "pile_set_name": "Github" }
/*! * is-data-descriptor <https://github.com/jonschlinkert/is-data-descriptor> * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. */ 'use strict'; var typeOf = require('kind-of'); module.exports = function isDataDescriptor(obj, prop) { // data descriptor properties var data = { configurable: 'boolean', enumerable: 'boolean', writable: 'boolean' }; if (typeOf(obj) !== 'object') { return false; } if (typeof prop === 'string') { var val = Object.getOwnPropertyDescriptor(obj, prop); return typeof val !== 'undefined'; } if (!('value' in obj) && !('writable' in obj)) { return false; } for (var key in obj) { if (key === 'value') continue; if (!data.hasOwnProperty(key)) { continue; } if (typeOf(obj[key]) === data[key]) { continue; } if (typeof obj[key] !== 'undefined') { return false; } } return true; };
{ "pile_set_name": "Github" }
{ "name": "meteor-theme-hexo", "version": "1.0.15", "description": "[Read the docs docs.](https://docs-docs.netlify.com/docs/docs/)", "main": "index.js", "scripts": { "test": "node ./tests/index.js" }, "repository": { "type": "git", "url": "git+https://github.com/meteor/meteor-theme-hexo.git" }, "keywords": [], "author": "", "license": "MIT", "bugs": { "url": "https://github.com/meteor/meteor-hexo-theme/issues" }, "homepage": "https://github.com/meteor/meteor-hexo-theme#readme", "devDependencies": { "fs-extra": "^5.0.0", "hanabi": "^0.4.0", "js-yaml": "^3.10.0", "shelljs": "^0.8.1", "simple-git": "^1.89.0", "tarball-extract": "0.0.6", "tmp-promise": "^1.0.4" }, "dependencies": {} }
{ "pile_set_name": "Github" }
/* --------------------------- MINI BROWSER --------------------------- */ var MiniBrowser = Base.extend({ constructor: function() { this.viewStack = []; // A view for each page in the browser this.setupHandlers(); this.viewWidth = $('#browser').width() + 50; $('.iPhoneHeader').disableSelection(); }, setupHandlers: function() { // View links $('a[rel~="view"]').live('click', function(event) { event.preventDefault(); browser.pushView({ path: $(this).attr('href'), type: $(this).attr('rel'), title: $(this).attr('title'), linkElem: $(this) }); }); // Mini-browser back button $('a[href="#back"]').live('click', function(event) { // Not sure why, but without stopPropagation(), clicking back causes two pops. event.preventDefault(); event.stopPropagation(); browser.pop(); }); }, getTopView: function() { return this.viewStack[this.viewStack.length - 1]; }, // Fetch a view from the server, push it onto the minibrowser. pushView: function(config) { var view; switch(config.type) { case 'view search': view = new SearchView(config); break; case 'view artist': view = new ArtistView(config); break; case 'view album': view = new AlbumView(config); break; case 'view playlist': view = new PlaylistView(config); break; case 'view profile': view = new ProfileView(config); break; case 'view static': // all static views view = new View(config); break; default: view = new View(config); log('Warning: All views must create a view and push it onto the viewStack. Did you define a createView function? ('+config.title+')'); break; } // Don't push duplicate views. var topPath = this.getTopView() && this.getTopView().config.path; if (topPath && topPath == config.path) { return; } $.get(view.getStaticPath(), null, function(data, textStatus, xhr) { var elem = $(data); browser.push(elem, view); }); }, // Push a new element onto the browser. push: function(elem, view) { var prevView = this.getTopView(); prevView && prevView.willSleep(); $(elem).appendTo('#views'); view.content = elem; this.viewStack.push(view); view.willSlide(); // Tell the view to do anything it has to now that content is in DOM this._slideTo(this.viewStack.length, function() { prevView && prevView.didSleep(); view && view.didSlide(); }); }, // Pop the top-most page off of the browser. pop: function() { if (!this.getTopView() || this.viewStack.length <= 1) { return; } // Tell the view controller it's going to be popped, then pop it var view = this.getTopView(); view.willPop(); this.viewStack.pop(); // Tell the new top view that it's about to be awoken this.getTopView().willAwake(); this._slideTo(this.viewStack.length, function() { view.didPop(); browser.getTopView().didAwake(); $(view.content).remove(); }); }, // Private function used to animate the transition between pages in the browser. _slideTo: function(viewNum, callback) { callback = callback || $.noop; var pixels = this.viewWidth * (viewNum - 1); $('#views').animate({ left: '-'+pixels }, 300, callback); }, updateHeader: function(title) { var title = title || ''; $('#browserHeader .title') .empty() .append( renderConditionalText(title, 'h1', function(elem) { elem.shorten({width: 275}); }) ); var leftButton; if (this.viewStack.length > 1) { var prevTitle = this.viewStack[this.viewStack.length-2].config.title; var prevTitleElem = renderConditionalText(prevTitle, 'span', function(elem) { elem.shorten({width: 100}); }); leftButton = $('<a class="left" href="#back"></a>').html('&larr; Back'); //.append(htmlEncode(prevTitleElem.text())); } else { leftButton = $('<span class="left"></span>'); } $('#browserHeader .left').replaceWith(leftButton); }, updateRightButtonText: function(text) { $('#browserHeader .right') .empty() .append( renderConditionalText(text, 'span', function(elem) { elem.shorten({width: 125}); }) ); } });
{ "pile_set_name": "Github" }
import smart_imports smart_imports.all() impacts_client = impacts.Client(entry_point=game_conf.settings.TT_IMPACTS_PERSONAL_ENTRY_POINT, impact_type=game_tt_services.IMPACT_TYPE.FAME, impact_class=game_tt_services.PowerImpact) class ImpactsTests(utils_testcase.TestCase): def setUp(self): super().setUp() impacts_client.cmd_debug_clear_service() self.transaction_1 = uuid.uuid4() self.transaction_2 = uuid.uuid4() self.impacts = [game_tt_services.PowerImpact.hero_2_person(type=impacts_client.impact_type, hero_id=666, person_id=1, amount=100, turn=1, transaction=self.transaction_1), game_tt_services.PowerImpact.hero_2_person(type=impacts_client.impact_type, hero_id=777, person_id=2, amount=-200, turn=1, transaction=self.transaction_1), game_tt_services.PowerImpact.hero_2_person(type=impacts_client.impact_type, hero_id=777, person_id=1, amount=300, turn=2, transaction=self.transaction_2), game_tt_services.PowerImpact.hero_2_place(type=impacts_client.impact_type, hero_id=888, place_id=2, amount=-400, turn=3, transaction=self.transaction_2)] def test_add_power_impacts(self): impacts_client.cmd_add_power_impacts(impacts=self.impacts[:2]) impacts_client.cmd_add_power_impacts(impacts=self.impacts[2:]) # add excluded impacts impacts_client.cmd_add_power_impacts(impacts=[game_tt_services.PowerImpact.hero_2_place(type=impacts_client.impact_type, hero_id=888, place_id=2, amount=-0.5, turn=3, transaction=self.transaction_2), game_tt_services.PowerImpact.hero_2_place(type=impacts_client.impact_type, hero_id=888, place_id=2, amount=0.5, turn=3, transaction=self.transaction_2), game_tt_services.PowerImpact.hero_2_place(type=impacts_client.impact_type, hero_id=888, place_id=2, amount=0, turn=3, transaction=self.transaction_2)]) last_impacts = impacts_client.cmd_get_last_power_impacts(limit=100) for impact in last_impacts: impact.time = None self.assertCountEqual(last_impacts, self.impacts) def test_get_last_power_impacts__limit(self): for impact in self.impacts: impacts_client.cmd_add_power_impacts(impacts=[impact]) last_impacts = impacts_client.cmd_get_last_power_impacts(limit=3) for impact in last_impacts: impact.time = None self.assertCountEqual(last_impacts, self.impacts[1:]) def test_get_last_power_impacts(self): for impact in self.impacts: impacts_client.cmd_add_power_impacts(impacts=[impact]) last_impacts = impacts_client.cmd_get_last_power_impacts(limit=100) for impact in last_impacts: impact.time = None self.assertCountEqual(last_impacts, self.impacts) def test_get_last_power_impacts__actor_filter(self): for impact in self.impacts: impacts_client.cmd_add_power_impacts(impacts=[impact]) last_impacts = impacts_client.cmd_get_last_power_impacts(limit=100, actor_type=impacts.OBJECT_TYPE.HERO, actor_id=777) for impact in last_impacts: impact.time = None self.assertCountEqual(last_impacts, [self.impacts[1], self.impacts[2]]) def test_get_last_power_impacts__target_filter(self): for impact in self.impacts: impacts_client.cmd_add_power_impacts(impacts=[impact]) last_impacts = impacts_client.cmd_get_last_power_impacts(limit=100, target_type=impacts.OBJECT_TYPE.PERSON, target_id=1) for impact in last_impacts: impact.time = None self.assertCountEqual(last_impacts, [self.impacts[0], self.impacts[2]]) def test_get_last_power_impacts__actor_target_filter(self): for impact in self.impacts: impacts_client.cmd_add_power_impacts(impacts=[impact]) last_impacts = impacts_client.cmd_get_last_power_impacts(limit=100, actor_type=impacts.OBJECT_TYPE.HERO, actor_id=777, target_type=impacts.OBJECT_TYPE.PERSON, target_id=1) for impact in last_impacts: impact.time = None self.assertCountEqual(last_impacts, [self.impacts[2]]) def test_get_targets_impacts(self): impacts_client.cmd_add_power_impacts(impacts=self.impacts) last_impacts = impacts_client.cmd_get_targets_impacts(targets=[(impacts.OBJECT_TYPE.PERSON, 1), (impacts.OBJECT_TYPE.PLACE, 2)]) self.assertCountEqual(last_impacts, [game_tt_services.PowerImpact(type=impacts_client.impact_type, actor_type=None, actor_id=None, target_type=impacts.OBJECT_TYPE.PERSON, target_id=1, amount=400), game_tt_services.PowerImpact(type=impacts_client.impact_type, actor_type=None, actor_id=None, target_type=impacts.OBJECT_TYPE.PLACE, target_id=2, amount=-400)]) def test_get_actor_impacts(self): impacts_client.cmd_add_power_impacts(impacts=self.impacts) last_impacts = impacts_client.cmd_get_actor_impacts(actor_type=impacts.OBJECT_TYPE.HERO, actor_id=777, target_types=[impacts.OBJECT_TYPE.PERSON]) self.assertCountEqual(last_impacts, [game_tt_services.PowerImpact(type=impacts_client.impact_type, actor_type=impacts.OBJECT_TYPE.HERO, actor_id=777, target_type=impacts.OBJECT_TYPE.PERSON, target_id=2, amount=-200), game_tt_services.PowerImpact(type=impacts_client.impact_type, actor_type=impacts.OBJECT_TYPE.HERO, actor_id=777, target_type=impacts.OBJECT_TYPE.PERSON, target_id=1, amount=300)]) def test_get_impacters_ratings(self): impacts_client.cmd_add_power_impacts(impacts=self.impacts) ratings = impacts_client.cmd_get_impacters_ratings(targets=[(impacts.OBJECT_TYPE.PERSON, 1), (impacts.OBJECT_TYPE.PLACE, 2), (impacts.OBJECT_TYPE.PLACE, 3124)], actor_types=[impacts.OBJECT_TYPE.HERO], limit=100) self.assertCountEqual(ratings.keys(), [(impacts.OBJECT_TYPE.PERSON, 1), (impacts.OBJECT_TYPE.PLACE, 2), (impacts.OBJECT_TYPE.PLACE, 3124)]) self.assertEqual(ratings[(impacts.OBJECT_TYPE.PERSON, 1)], [game_tt_services.PowerImpact(type=impacts_client.impact_type, actor_type=impacts.OBJECT_TYPE.HERO, actor_id=777, target_type=impacts.OBJECT_TYPE.PERSON, target_id=1, amount=300), game_tt_services.PowerImpact(type=impacts_client.impact_type, actor_type=impacts.OBJECT_TYPE.HERO, actor_id=666, target_type=impacts.OBJECT_TYPE.PERSON, target_id=1, amount=100)]) def test_scale_impacts(self): impacts_client.cmd_add_power_impacts(impacts=self.impacts) scale = 1.5 impacts_client.cmd_scale_impacts(target_types=[impacts.OBJECT_TYPE.PERSON], scale=scale) last_impacts = impacts_client.cmd_get_targets_impacts(targets=[(impacts.OBJECT_TYPE.PERSON, 1), (impacts.OBJECT_TYPE.PERSON, 2), (impacts.OBJECT_TYPE.PLACE, 2)]) self.assertCountEqual(last_impacts, [game_tt_services.PowerImpact(type=impacts_client.impact_type, actor_type=None, actor_id=None, target_type=impacts.OBJECT_TYPE.PERSON, target_id=1, amount=400 * scale), game_tt_services.PowerImpact(type=impacts_client.impact_type, actor_type=None, actor_id=None, target_type=impacts.OBJECT_TYPE.PERSON, target_id=2, amount=-200 * scale), game_tt_services.PowerImpact(type=impacts_client.impact_type, actor_type=None, actor_id=None, target_type=impacts.OBJECT_TYPE.PLACE, target_id=2, amount=-400)])
{ "pile_set_name": "Github" }
{ "Activate desktop notifications": { "other": "Activar notificacions d'escriptori" }, "Choose the plugin": { "other": "Seleccioneu el plugin" }, "Desktop Notifications": { "other": "Notificacions d'escriptori" }, "Display Workspaces Activity": { "other": "Display Workspaces Activity" }, "Display a new entry with all events happening on a user workspaces, and alerts. An SQL database must be setup for the FEED_DRIVER configuration.": { "other": "Mostrar una nova entrada amb tots els esdeveniments que succeeixen en un repositori d'usuari, i alertes. Una base de dades SQL ha de ser configurada per a la configuració de FEED_DRIVER." }, "Display workspaces activity to the users in the right-hand information panel": { "other": "Display workspaces activity to the users in the right-hand information panel" }, "Feed Instance": { "other": "Instància de feed" }, "Handle users watches and notifications": { "other": "Manipular vistes d'usuaris i notificacions" }, "Instance Params": { "other": "Paràmetres d'instància" }, "Notification Center": { "other": "Centre de notificacions" }, "User events and alerts": { "other": "Events i alertes d'usuari" } }
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; using DotnetSpider.DataFlow.Storage; using DotnetSpider.Http; using DotnetSpider.Infrastructure; using DotnetSpider.Selector; using Microsoft.Extensions.Logging; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace DotnetSpider.DataFlow.Parser { /// <summary> /// 数据解析器 /// </summary> public abstract class DataParser : AbstractDataFlow { private readonly List<Func<DataContext, IEnumerable<Request>>> _followRequestQueriers; private readonly List<Func<Request, bool>> _requiredValidator; /// <summary> /// 选择器的生成方法 /// </summary> public Func<DataContext, ISelectable> SelectableBuilder { get; protected set; } /// <summary> /// 数据解析 /// </summary> /// <param name="context">处理上下文</param> /// <returns></returns> protected abstract Task Parse(DataContext context); protected DataParser() { _followRequestQueriers = new List<Func<DataContext, IEnumerable<Request>>>(); _requiredValidator = new List<Func<Request, bool>>(); } public void AddFollowRequestQuerier(ISelector selector) { _followRequestQueriers.Add(context => { var requests = context.Selectable.SelectList(selector) .Where(x => x != null) .SelectMany(x => x.Links()) .Select(x => { var request = context.CreateNewRequest(x); request.RequestedTimes = 0; return request; }); return requests; }); } public void AddRequiredValidator(Func<Request, bool> requiredValidator) { _requiredValidator.Add(requiredValidator); } public void AddRequiredValidator(string pattern) { _requiredValidator.Add(request => Regex.IsMatch(request.Url.ToString(), pattern)); } protected virtual void AddParsedResult<T>(DataContext context, IEnumerable<T> results) where T : EntityBase<T>, new() { if (results != null) { var type = typeof(T); var items = context.GetData(type); if (items == null) { var list = new List<T>(); list.AddRange(results); context.AddData(type, list); } else { items.AddRange(results); } } } internal void SetHtmlSelectableBuilder() { ISelectable Builder(DataContext context) { var text = context.Response.ReadAsString().TrimStart(); return GetHtmlSelectable(context, text); } SelectableBuilder = Builder; } private ISelectable GetHtmlSelectable(DataContext context, string text) { var request = context.Request; var uri = new Uri(request.Url); var domain = uri.Port == 80 || uri.Port == 443 ? $"{uri.Scheme}://{uri.Host}" : $"{uri.Scheme}://{uri.Host}:{uri.Port}"; return new HtmlSelectable(text, domain, context.Options.RemoveOutboundLinks); } /// <summary> /// 数据解析 /// </summary> /// <param name="context">处理上下文</param> /// <returns></returns> public override async Task HandleAsync(DataContext context) { context.NotNull(nameof(context)); context.Response.NotNull(nameof(context.Response)); if (!IsValidRequest(context.Request)) { Logger.LogInformation($"{GetType().Name} ignore request {context.Request.Url}"); return; } var request = context.Request; if (context.Selectable == null) { if (SelectableBuilder != null) { context.Selectable = SelectableBuilder(context); } else { var text = context.Response.ReadAsString().TrimStart(); if (text.StartsWith("<!DOCTYPE html>") || text.StartsWith("<html>")) { context.Selectable = GetHtmlSelectable(context, text); } else { try { var token = (JObject)JsonConvert.DeserializeObject(text); context.Selectable = new JsonSelectable(token); } catch { context.Selectable = new TextSelectable(text); } } } } await Parse(context); var requests = new List<Request>(); if (_followRequestQueriers != null) { foreach (var followRequestQuerier in _followRequestQueriers) { var followRequests = followRequestQuerier(context); if (followRequests != null) { requests.AddRange(followRequests); } } } foreach (var followRequest in requests) { if (IsValidRequest(followRequest)) { // 在此强制设制 Owner, 防止用户忘记导致出错 followRequest.Owner = request.Owner; followRequest.Agent = context.Response.Agent; context.AddFollowRequests(followRequest); } } } private bool IsValidRequest(Request request) { return _requiredValidator.Count <= 0 || _requiredValidator.Any(validator => validator(request)); } } }
{ "pile_set_name": "Github" }
@once-set-sdf = 0 sdf 1, 0 msg -1, -1, -1 pic 0, 4 ex1 -1, -1, -1 ex2 -1, -1, -1 goto 1 @change-ter = 1 sdf -1, -1 msg -1, -1, -1 pic 0, 4 ex1 7, 40, -1 ex2 147, -1, -1 goto -1 @once-set-sdf = 2 sdf 1, 0 msg -1, -1, -1 pic 0, 4 ex1 -1, -1, -1 ex2 -1, -1, -1 goto 3 @change-ter = 3 sdf -1, -1 msg -1, -1, -1 pic 0, 4 ex1 41, 39, -1 ex2 147, -1, -1 goto -1 @once-town-encounter = 4 sdf 1, 1 msg 0, -1, -1 pic 0, 4 ex1 1, -1, -1 ex2 -1, -1, -1 goto -1 @once-town-encounter = 5 sdf 1, 2 msg 1, -1, -1 pic 0, 4 ex1 2, -1, -1 ex2 -1, -1, -1 goto -1 @once-trap = 6 sdf 1, 3 msg 2, -1, -1 pic 27, 4 ex1 1, 2, -1 ex2 20, -1, -1 goto -1 @once-trap = 7 sdf 1, 4 msg 2, -1, -1 pic 27, 4 ex1 2, 2, -1 ex2 30, -1, -1 goto -1 @once-trap = 8 sdf 1, 5 msg 2, -1, -1 pic 27, 4 ex1 3, 1, -1 ex2 40, -1, -1 goto -1 @lever-generic = 9 sdf -1, -1 msg -1, -1, -1 pic 0, 4 ex1 -1, 10, -1 ex2 -1, -1, -1 goto -1 @if-sdf = 10 sdf 1, 6 msg -1, -1, -1 pic 0, 4 ex1 1, 11, -1 ex2 -1, -1, -1 goto 12 @disp-msg = 11 sdf -1, -1 msg 3, -1, -1 pic 0, 4 ex1 -1, -1, -1 ex2 -1, -1, -1 goto -1 @play-sound = 12 sdf -1, -1 msg -1, -1, -1 pic 0, 4 ex1 5, -1, -1 ex2 -1, -1, -1 goto 13 @once-town-encounter = 13 sdf 1, 6 msg 4, -1, -1 pic 0, 4 ex1 3, -1, -1 ex2 -1, -1, -1 goto 14 @rect-change-ter = 14 sdf 84, 100 msg -1, -1, -1 pic 0, 4 ex1 16, 34, -1 ex2 16, 36, -1 goto -1 @if-sdf = 15 sdf 1, 6 msg -1, -1, -1 pic 0, 4 ex1 1, 14, -1 ex2 -1, -1, -1 goto -1 @if-sdf = 16 sdf 1, 7 msg -1, -1, -1 pic 0, 4 ex1 -1, -1, -1 ex2 1, 17, -1 goto -1 @block-move = 17 sdf -1, -1 msg 5, -1, -1 pic 0, 4 ex1 1, -1, -1 ex2 0, -1, -1 goto 18 @damage = 18 sdf -1, -1 msg -1, -1, -1 pic 0, 4 ex1 6, 6, -1 ex2 0, 5, -1 goto -1 @if-context = 19 sdf -1, -1 msg -1, -1, -1 pic 0, 4 ex1 16, 108, 21 ex2 -1, -1, -1 goto -1 @once-town-encounter = 20 sdf 1, 7 msg 6, 8, -1 pic 0, 4 ex1 4, -1, -1 ex2 -1, -1, -1 goto 23 @if-sdf = 21 sdf 1, 7 msg -1, -1, -1 pic 0, 4 ex1 1, 22, -1 ex2 -1, -1, -1 goto 20 @disp-msg = 22 sdf -1, -1 msg 7, -1, -1 pic 0, 4 ex1 -1, -1, -1 ex2 -1, -1, -1 goto -1 @xp = 23 sdf -1, -1 msg -1, -1, -1 pic 0, 4 ex1 25, 0, -1 ex2 -1, -1, -1 goto -1 @once-give-spec-item = 24 sdf 1, 8 msg 9, -1, -1 pic 0, 4 ex1 4, 0, -1 ex2 -1, -1, -1 goto -1 @portal = 25 sdf -1, -1 msg 10, -1, -1 pic 0, 4 ex1 35, 15, -1 ex2 -1, -1, -1 goto 26 @hp = 26 sdf -1, -1 msg 16, -1, -1 pic 0, 4 ex1 50, 1, -1 ex2 -1, -1, -1 goto -1 @move-party = 27 sdf -1, -1 msg -1, -1, -1 pic 0, 4 ex1 35, 15, -1 ex2 1, -1, -1 goto -1 @once-dlog = 28 sdf -1, -1 msg 17, -1, 1 pic 170, 1 ex1 23, 29, -1 ex2 -1, -1, -1 goto -1 @change-time = 29 sdf -1, -1 msg 23, 24, -1 pic 0, 4 ex1 3000, -1, -1 ex2 -1, -1, -1 goto -1 @once-dlog = 30 sdf -1, -1 msg 17, -1, 1 pic 165, 1 ex1 23, 31, -1 ex2 -1, -1, -1 goto -1 @disp-msg = 31 sdf -1, -1 msg 25, 26, -1 pic 0, 4 ex1 -1, -1, -1 ex2 -1, -1, -1 goto -1 @once-dlog = 32 sdf 1, 9 msg 27, -1, 1 pic 208, 1 ex1 -1, -1, -1 ex2 -1, -1, -1 goto -1 @disp-msg = 33 sdf -1, -1 msg 33, 34, -1 pic 0, 4 ex1 -1, -1, -1 ex2 -1, -1, -1 goto -1
{ "pile_set_name": "Github" }
{ "uuid" : "d3b1840b01464b54b1840b0146cb54f5", "creator" : { "firstName" : "Joe", "lastName" : "Doe", "uuid" : "589319933be24ec79319933be24ec7fe" }, "created" : "2018-10-12T14:15:06.024Z", "editor" : { "firstName" : "Joe", "lastName" : "Doe", "uuid" : "589319933be24ec79319933be24ec7fe" }, "edited" : "2018-11-20T20:12:01.084Z", "name" : "New project name", "rootNode" : { "uuid" : "adaf48da8c124049af48da8c12a0493e" }, "permissions" : { "create" : true, "read" : true, "update" : false, "delete" : true, "publish" : false, "readPublished" : false } }
{ "pile_set_name": "Github" }
{ "name": "js2xmlparser", "description": "Parses JavaScript objects into XML", "keywords": [ "convert", "converter", "js", "json", "object", "objects", "parse", "parser", "xml" ], "homepage": "http://www.kourlas.net", "version": "0.1.7", "author": { "name": "Michael Kourlas", "email": "michael@kourlas.net" }, "main": "./lib/js2xmlparser.js", "repository": { "type": "git", "url": "git://github.com/michaelkourlas/node-js2xmlparser.git" }, "devDependencies": { "mocha": "*", "should": "*" }, "license": "MIT", "gitHead": "787d4a0f624f805a24fe334ad79d6cf127b0c146", "bugs": { "url": "https://github.com/michaelkourlas/node-js2xmlparser/issues" }, "_id": "js2xmlparser@0.1.7", "scripts": {}, "_shasum": "c8a4bf9ba00577c4b2ce0bd6e714ee8341a586ae", "_from": "js2xmlparser@~0.1.0", "_npmVersion": "1.4.28", "_npmUser": { "name": "michaelkourlas", "email": "michael@kourlas.net" }, "maintainers": [ { "name": "michaelkourlas", "email": "michaelkourlas@gmail.com" } ], "dist": { "shasum": "c8a4bf9ba00577c4b2ce0bd6e714ee8341a586ae", "tarball": "http://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.7.tgz" }, "directories": {}, "_resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.7.tgz" }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the license found in the LICENSE file in * the root directory of this source tree. */ /** * This command copies all the initial project files into the current working * directory. The user can choose between multiple options in case the file * already exists. */ exports.command = 'copy-defaults'; exports.describe = 'copy the initial project files into the current directory. Can also be ' + 'used to update files after (local) exerslide was updated.'; exports.builder = function(yargs) { return yargs .options({ name: { describe: 'Presentation name to use in templates.', nargs: 1, requiresArg: true, type: 'string', }, 'overwrite-all': { alias: ['a'], describe: 'Overwrite existing files (DANGER: Only use this option if you '+ 'have a backup of your current files or use a version control system', type: 'boolean', default: false, }, confirm: { alias: ['c'], describe: 'Ask what to do if file already exists. ' + 'If set to false, keep the existing file.', type: 'boolean', default: true, }, 'ignore-hash': { describe: 'Don\'t compare file hashes of existing files. If set to ' + 'true, you will asked for any existing file that differs from the ' + 'template file.', type: 'boolean', default: false, }, }) .example('$0 copy-files --name myPresentation'); }; exports.handler = function(argv) { const scaffolder = require('../lib/scaffolder'); const utils = require('./utils'); scaffolder(process.cwd(), argv, error => { if (error) { utils.logError(`Unable to copy defaults: ${error.message}`); process.exit(1); } utils.log( 'All files updated! You may have to run `npm install` if "package.json"' + ' has changed.' ); }); };
{ "pile_set_name": "Github" }
(* Modified by TrustInSoft *) (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2015 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* 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, version 2.1. *) (* *) (* It 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. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil open Cil_datatype open Locations module StmtToZone = Stmt.Hashtbl.Make(Zone) module PathdepsData = Kernel_function.Make_Table (StmtToZone) (struct let name = "Path dependencies" let size = 13 let dependencies = [ Db.Value.self ] end) type analysis_state = { current_function : Kernel_function.t; callsite : Kinstr.t; table_for_calls : Zone.t Stmt.Hashtbl.t Kernel_function.Hashtbl.t Kinstr.Hashtbl.t } let analysis_stack : analysis_state list ref = ref [] let merge_stmt_zone dest src = Stmt.Hashtbl.iter (fun stmt zone -> try Stmt.Hashtbl.replace dest stmt (Zone.join zone (Stmt.Hashtbl.find dest stmt)) with Not_found -> Stmt.Hashtbl.add dest stmt zone ) src let merge_pathdeps kf_tbl = Kernel_function.Hashtbl.iter (fun kf stmt_tbl -> try let old = PathdepsData.find kf in merge_stmt_zone old stmt_tbl with Not_found -> PathdepsData.add kf (Cil_datatype.Stmt.Hashtbl.copy stmt_tbl) ) kf_tbl let merge_kernel_functions dest src = Kernel_function.Hashtbl.iter (fun kf stmt_tbl -> try let old = Kernel_function.Hashtbl.find dest kf in merge_stmt_zone old stmt_tbl with Not_found -> Kernel_function.Hashtbl.add dest kf stmt_tbl ) src let add_to_table_for_calls table_for_calls callsite data = try let prev = Kinstr.Hashtbl.find table_for_calls callsite in merge_kernel_functions prev data with Not_found -> Kinstr.Hashtbl.add table_for_calls callsite data let make_kf_tbl kf stmt_tbl = let tbl = Kernel_function.Hashtbl.create 1 in Kernel_function.Hashtbl.add tbl kf stmt_tbl; tbl class do_pathdeps froms get_stmt_state callwise_state_with_formals callstack_table = object(self) inherit Cil.nopCilVisitor val mutable inputs : Zone.t Stmt.Hashtbl.t = Stmt.Hashtbl.create 13 method result = inputs method join stmt zone = if not (Zone.is_bottom zone) then begin let table = Stmt.Hashtbl.create 13 in Stmt.Hashtbl.add table stmt zone; merge_stmt_zone self#result table end method! vstmt s = if Db.Value.is_reachable (get_stmt_state (Extlib.the self#current_stmt)) then begin match s.skind with | UnspecifiedSequence seq -> List.iter (fun (stmt,_,_,_,_) -> ignore (visitCilStmt (self:>cilVisitor) stmt)) seq; SkipChildren (* do not visit the additional lvals *) | If (_cond, _th, _el, _) -> DoChildren (* for _cond and for the statements in _th, _el *) | Loop _ | Block _ -> DoChildren (* for the statements *) | Switch _ -> DoChildren (* for the statements and the expression *) | Instr _ -> DoChildren (* for Calls *) | Return _ | Goto _ | Break _ | Continue _ | Throw _ -> SkipChildren | TryExcept _ | TryFinally _ | TryCatch _ -> assert false end else SkipChildren method stmt_froms = let stmt = Extlib.the (self#current_stmt) in Stmt.Hashtbl.find froms stmt method! vlval lv = let stmt = Extlib.the self#current_stmt in let state = get_stmt_state stmt in let deps, z, _exact = !Db.Value.lval_to_zone_with_deps_state ~for_writing:false ~deps:(Some Zone.bottom) state lv in let all = Zone.join z deps in begin try let froms = self#stmt_froms in let all_f = Function_Froms.Memory.find froms all in self#join stmt all_f; with Not_found -> () end; SkipChildren method! vinst i = let current_stmt = Extlib.the self#current_stmt in let stmt_state = get_stmt_state current_stmt in if Db.Value.is_reachable stmt_state then begin match i with | Call (_, expr, _, _) -> let deps_callees, _kfset = !Db.Value.expr_to_kernel_function_state ~deps:(Some Zone.bottom) stmt_state expr in let froms_state = Stmt.Hashtbl.find froms current_stmt in let deps_callees = Function_Froms.Memory.find froms_state deps_callees in let dependencies_by_function = Stmt.Hashtbl.find callwise_state_with_formals current_stmt in let kf_tbl = Kinstr.Hashtbl.find callstack_table (Kstmt current_stmt) in List.iter (fun (kf, state) -> if not (!Db.Value.use_spec_instead_of_definition kf) then begin let stmt_tbl = Kernel_function.Hashtbl.find kf_tbl kf in Stmt.Hashtbl.iter (fun stmt zone -> self#join stmt (Function_Froms.Memory.find state zone) ) stmt_tbl end else Format.printf "Assuming library function %a has no path dependencies@." Kernel_function.pretty kf ) dependencies_by_function; self#join current_stmt deps_callees; SkipChildren | _ -> SkipChildren end else SkipChildren method! vexpr exp = match exp.enode with | AddrOf lv | StartOf lv -> let current_stmt = Extlib.the self#current_stmt in let deps, _loc = !Db.Value.lval_to_loc_with_deps (* loc ignored *) ~with_alarms:CilE.warn_none_mode ~deps:Zone.bottom (Kstmt current_stmt) lv in let froms = self#stmt_froms in let deps_f = Function_Froms.Memory.find froms deps in self#join current_stmt deps_f; SkipChildren | _ -> DoChildren end let is_constant c = c = (false, true) || c = (true, false) (* Use by from_register before writing the log. *) let finalize () = PathdepsData.iter (fun kf tbl -> Stmt.Hashtbl.iter (fun stmt _ -> if (is_constant (Db.Value.condition_truth_value stmt)) then Stmt.Hashtbl.remove tbl stmt ) tbl; if Stmt.Hashtbl.length tbl = 0 then PathdepsData.remove kf ); PathdepsData.mark_as_computed () let register_in_stack (_, callstack) = let current_function, callsite = List.hd callstack in if not (!Db.Value.use_spec_instead_of_definition current_function) && Kernel_function.is_definition current_function then analysis_stack := { current_function; callsite; table_for_calls = Kinstr.Hashtbl.create 3 } :: !analysis_stack else match !analysis_stack with | { table_for_calls } :: _ -> (* Add declaration with empty table to table avoids some Not_found exception when calling the visitor. *) Kinstr.Hashtbl.add table_for_calls callsite (Kernel_function.Hashtbl.create 0) | _ -> () (* main function is not defined. *) let compute_pathdeps (stack, froms, callwise_state_with_formals, get_stmt_state) = let kf = Stack.top stack in match !analysis_stack with | { current_function; callsite; table_for_calls } :: ({ table_for_calls = table } :: _ as tail) -> assert (Kernel_function.compare kf current_function = 0); analysis_stack := tail; begin match kf.fundec with | Definition (f, _) -> let computer = new do_pathdeps froms get_stmt_state callwise_state_with_formals table_for_calls in ignore (visitCilFunction (computer :> cilVisitor) f); let data = computer#result in let kf_table = make_kf_tbl kf data in add_to_table_for_calls table callsite kf_table; merge_pathdeps kf_table | Declaration _ -> assert false end | _ -> analysis_stack := [] let () = Cmdline.run_after_configuring_stage (fun () -> if From_parameters.PathDeps.get () then begin Db.Value.Call_Value_Callbacks.extend_once register_in_stack; Db.From.Record_From_Callbacks.extend_once compute_pathdeps; Db.From.PathDeps.iter := PathdepsData.iter; Db.From.PathDeps.find := PathdepsData.find; end ) (* Local Variables: compile-command: "make -C ../../.." End: *)
{ "pile_set_name": "Github" }
(* Modified by TrustInSoft *) (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2015 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* 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, version 2.1. *) (* *) (* It 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. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype module DomKernel = Plugin.Register (struct let name = "dominators" let shortname = "dominators" let help = "Compute postdominators of statements" end) module DomSet = struct type domset = Value of Stmt.Hptset.t | Top let inter a b = match a,b with | Top,Top -> Top | Value v, Top | Top, Value v -> Value v | Value v, Value v' -> Value (Stmt.Hptset.inter v v') let add v d = match d with | Top -> Top | Value d -> Value (Stmt.Hptset.add v d) let mem v = function | Top -> true | Value d -> Stmt.Hptset.mem v d let map f = function | Top -> Top | Value set -> Value (f set) include Datatype.Make (struct include Datatype.Serializable_undefined type t = domset let name = "dominator_set" let reprs = Top :: List.map (fun s -> Value s) Stmt.Hptset.reprs let structural_descr = Structural_descr.t_sum [| [| Stmt.Hptset.packed_descr |] |] let pretty fmt = function | Top -> Format.fprintf fmt "Top" | Value d -> Pretty_utils.pp_iter ~pre:"@[{" ~sep:",@," ~suf:"}@]" Stmt.Hptset.iter (fun fmt s -> Format.fprintf fmt "%d" s.sid) fmt d let equal a b = match a,b with | Top,Top -> true | Value _v, Top | Top, Value _v -> false | Value v, Value v' -> Stmt.Hptset.equal v v' let copy = map Cil_datatype.Stmt.Hptset.copy let mem_project = Datatype.never_any_project end) end (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) module type MakePostDomArg = sig val is_accessible: stmt -> bool (* Evaluation of an expression which is supposed to be the condition of an 'if'. The first boolean (resp. second) represents the possibility that the expression can be non-zero (resp. zero), ie. true (resp. false). *) val eval_cond: stmt -> exp -> bool * bool val dependencies: State.t list val name: string end module MakePostDom(X: MakePostDomArg) = struct module PostDom = Cil_state_builder.Stmt_hashtbl (DomSet) (struct let name = "postdominator." ^ X.name let dependencies = Ast.self :: X.dependencies let size = 503 end) module PostComputer = struct let name = "postdominator" let debug = false type t = DomSet.t module StmtStartData = PostDom let pretty = DomSet.pretty let combineStmtStartData _stmt ~old new_ = if DomSet.equal old new_ then None else Some new_ let combineSuccessors = DomSet.inter let doStmt stmt = !Db.progress (); Postdominators_parameters.debug ~level:2 "doStmt: %d" stmt.sid; match stmt.skind with | Return _ -> Dataflow2.Done (DomSet.Value (Stmt.Hptset.singleton stmt)) | _ -> Dataflow2.Post (fun data -> DomSet.add stmt data) let doInstr _ _ _ = Dataflow2.Default (* We make special tests for 'if' statements without a 'then' or 'else' branch. It can lead to better precision if we can evaluate the condition of the 'if' with always the same truth value *) let filterIf ifstmt next = match ifstmt.skind with | If (e, { bstmts = sthen :: _ }, { bstmts = [] }, _) when not (Stmt.equal sthen next) -> (* [next] is the syntactic successor of the 'if', ie the 'else' branch. If the condition is never false, then [sthen] postdominates [next]. We must not follow the edge from [ifstmt] to [next] *) snd (X.eval_cond ifstmt e) | If (e, { bstmts = [] }, { bstmts = selse :: _ }, _) when not (Stmt.equal selse next) -> (* dual case *) fst (X.eval_cond ifstmt e) | _ -> true let filterStmt pred next = X.is_accessible pred && filterIf pred next let funcExitData = DomSet.Value Stmt.Hptset.empty end module PostCompute = Dataflow2.Backwards(PostComputer) let compute_postdom kf = let return = try Kernel_function.find_return kf with Kernel_function.No_Statement -> Postdominators_parameters.abort "No return statement for a function with body %a" Kernel_function.pretty kf in try let _ = PostDom.find return in Postdominators_parameters.feedback ~level:2 "computed for function %a" Kernel_function.pretty kf with Not_found -> Postdominators_parameters.feedback ~level:2 "computing for function %a" Kernel_function.pretty kf; let f = kf.fundec in match f with | Definition (f,_) -> let stmts = f.sallstmts in List.iter (fun s -> PostDom.add s DomSet.Top) stmts; PostCompute.compute [return]; Postdominators_parameters.feedback ~level:2 "done for function %a" Kernel_function.pretty kf | Declaration _ -> () let get_stmt_postdominators f stmt = let do_it () = PostDom.find stmt in try do_it () with Not_found -> compute_postdom f; do_it () (** @raise Db.PostdominatorsTypes.Top when the statement postdominators * have not been computed ie neither the return statement is reachable, * nor the statement is in a natural loop. *) let stmt_postdominators f stmt = match get_stmt_postdominators f stmt with | DomSet.Value s -> Postdominators_parameters.debug ~level:1 "Postdom for %d are %a" stmt.sid Stmt.Hptset.pretty s; s | DomSet.Top -> raise Db.PostdominatorsTypes.Top let is_postdominator f ~opening ~closing = let open_postdominators = get_stmt_postdominators f opening in DomSet.mem closing open_postdominators let display_postdom () = let disp_all fmt = PostDom.iter (fun k v -> Format.fprintf fmt "Stmt:%d -> @[%a@]\n" k.sid PostComputer.pretty v) in Postdominators_parameters.result "%t" disp_all let print_dot_postdom basename kf = let filename = basename ^ "." ^ Kernel_function.get_name kf ^ ".dot" in Print.build_dot filename kf; Postdominators_parameters.result "dot file generated in %s" filename end module PostDomDb(X: MakePostDomArg)(DbPostDom: Db.PostdominatorsTypes.Sig) = struct include MakePostDom(X) let () = DbPostDom.compute := compute_postdom let () = DbPostDom.is_postdominator := is_postdominator let () = DbPostDom.stmt_postdominators := stmt_postdominators let () = DbPostDom.display := display_postdom let () = DbPostDom.print_dot := print_dot_postdom end module PostDomBasic = PostDomDb( struct let is_accessible _ = true let dependencies = [] let name = "basic" let eval_cond _ _ = true, true end) (Db.Postdominators) let output () = let dot_postdom = Postdominators_parameters.DotPostdomBasename.get () in if dot_postdom <> "" then ( Ast.compute (); Globals.Functions.iter (fun kf -> if Kernel_function.is_definition kf then !Db.Postdominators.print_dot dot_postdom kf) ) let output, _ = State_builder.apply_once "Postdominators.Compute.output" [PostDomBasic.PostDom.self] output let () = Db.Main.extend output module PostDomVal = PostDomDb( struct let is_accessible = Db.Value.is_reachable_stmt let dependencies = [ Db.Value.self ] let name = "value" let eval_cond stmt _e = Db.Value.condition_truth_value stmt end) (Db.PostdominatorsValue) (* Local Variables: compile-command: "make -C ../../.." End: *)
{ "pile_set_name": "Github" }
(* Modified by TrustInSoft *) (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2015 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* 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, version 2.1. *) (* *) (* It 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. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S module Analysis: Parameter_sig.Bool (** Whether to perform spare code detection or not. *) module Annot : Parameter_sig.Bool (** keep more things to keep all reachable annotations. *) module GlobDecl : Parameter_sig.Bool (** remove unused global types and variables *) (* Local Variables: compile-command: "make -C ../../.." End: *)
{ "pile_set_name": "Github" }
/* * drivers/pcmcia/sa1100_cerf.c * * PCMCIA implementation routines for CerfBoard * Based off the Assabet. * */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/device.h> #include <linux/init.h> #include <linux/delay.h> #include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/irq.h> #include <mach/cerf.h> #include "sa1100_generic.h" #define CERF_SOCKET 1 static struct pcmcia_irqs irqs[] = { { CERF_SOCKET, CERF_IRQ_GPIO_CF_CD, "CF_CD" }, { CERF_SOCKET, CERF_IRQ_GPIO_CF_BVD2, "CF_BVD2" }, { CERF_SOCKET, CERF_IRQ_GPIO_CF_BVD1, "CF_BVD1" } }; static int cerf_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { skt->irq = CERF_IRQ_GPIO_CF_IRQ; return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); } static void cerf_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) { soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); } static void cerf_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { unsigned long levels = GPLR; state->detect = (levels & CERF_GPIO_CF_CD) ?0:1; state->ready = (levels & CERF_GPIO_CF_IRQ) ?1:0; state->bvd1 = (levels & CERF_GPIO_CF_BVD1)?1:0; state->bvd2 = (levels & CERF_GPIO_CF_BVD2)?1:0; state->wrprot = 0; state->vs_3v = 1; state->vs_Xv = 0; } static int cerf_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state) { switch (state->Vcc) { case 0: case 50: case 33: break; default: printk(KERN_ERR "%s(): unrecognized Vcc %u\n", __func__, state->Vcc); return -1; } if (state->flags & SS_RESET) { GPSR = CERF_GPIO_CF_RESET; } else { GPCR = CERF_GPIO_CF_RESET; } return 0; } static void cerf_pcmcia_socket_init(struct soc_pcmcia_socket *skt) { soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs)); } static void cerf_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) { soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs)); } static struct pcmcia_low_level cerf_pcmcia_ops = { .owner = THIS_MODULE, .hw_init = cerf_pcmcia_hw_init, .hw_shutdown = cerf_pcmcia_hw_shutdown, .socket_state = cerf_pcmcia_socket_state, .configure_socket = cerf_pcmcia_configure_socket, .socket_init = cerf_pcmcia_socket_init, .socket_suspend = cerf_pcmcia_socket_suspend, }; int __init pcmcia_cerf_init(struct device *dev) { int ret = -ENODEV; if (machine_is_cerf()) ret = sa11xx_drv_pcmcia_probe(dev, &cerf_pcmcia_ops, CERF_SOCKET, 1); return ret; }
{ "pile_set_name": "Github" }
{ "display": { "icon": { "item": "tfc:ore/garnierite" }, "frame": "goal", "title": { "translate": "advancements.tfc.world.find_nickel.title" }, "description": { "translate": "advancements.tfc.world.find_nickel.description" } }, "parent": "tfc:world/make_propick", "criteria": { "find_ore": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "item": "tfc:ore/garnierite" } ] } } }, "rewards": { "experience": 25 } }
{ "pile_set_name": "Github" }
DPATH := $($(DOCKER_PLATFORM_MONITOR)_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-platform-monitor.mk rules/docker-platform-monitor.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files $(DPATH)) $(DOCKER_PLATFORM_MONITOR)_CACHE_MODE := GIT_CONTENT_SHA $(DOCKER_PLATFORM_MONITOR)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(DOCKER_PLATFORM_MONITOR)_DEP_FILES := $(DEP_FILES) $(eval $(call add_dbg_docker,$(DOCKER_PLATFORM_MONITOR),$(DOCKER_PLATFORM_MONITOR_DBG)))
{ "pile_set_name": "Github" }
define( [ "../var/class2type", "../var/toString" ], function( class2type, toString ) { "use strict"; function toType( obj ) { if ( obj == null ) { return obj + ""; } // Support: Android <=2.3 only (functionish RegExp) return typeof obj === "object" || typeof obj === "function" ? class2type[ toString.call( obj ) ] || "object" : typeof obj; } return toType; } );
{ "pile_set_name": "Github" }
# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompanying this file. This file 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. from s3transfer.tasks import Task from s3transfer.tasks import SubmissionTask class DeleteSubmissionTask(SubmissionTask): """Task for submitting tasks to execute an object deletion.""" def _submit(self, client, request_executor, transfer_future, **kwargs): """ :param client: The client associated with the transfer manager :type config: s3transfer.manager.TransferConfig :param config: The transfer config associated with the transfer manager :type osutil: s3transfer.utils.OSUtil :param osutil: The os utility associated to the transfer manager :type request_executor: s3transfer.futures.BoundedExecutor :param request_executor: The request executor associated with the transfer manager :type transfer_future: s3transfer.futures.TransferFuture :param transfer_future: The transfer future associated with the transfer request that tasks are being submitted for """ call_args = transfer_future.meta.call_args self._transfer_coordinator.submit( request_executor, DeleteObjectTask( transfer_coordinator=self._transfer_coordinator, main_kwargs={ 'client': client, 'bucket': call_args.bucket, 'key': call_args.key, 'extra_args': call_args.extra_args, }, is_final=True ) ) class DeleteObjectTask(Task): def _main(self, client, bucket, key, extra_args): """ :param client: The S3 client to use when calling DeleteObject :type bucket: str :param bucket: The name of the bucket. :type key: str :param key: The name of the object to delete. :type extra_args: dict :param extra_args: Extra arguments to pass to the DeleteObject call. """ client.delete_object(Bucket=bucket, Key=key, **extra_args)
{ "pile_set_name": "Github" }
.chart, .speed-car, .overall { display: inline-block; height: 60px; position: relative; text-align: center; width: 60px; } .chart canvas, .speed-car canvas, .overall canvas { position: absolute; top: 0; left: 0; height: 60px; width: 60px; } .percent { display: inline-block; line-height: 60px; z-index: 2; color: #FFFFFF; } .percent:after { content:'%'; margin-left: 0.1em; font-size: .8em; } .percent2 { display: inline-block; line-height: 60px; z-index: 2; color: #FFFFFF; margin-top: -5px; } .percent2:after { content:'KM/h'; margin-top: -48px; font-size: .8em; display: block; } .chart3 { display: inline-block; height: 110px; margin-bottom: 75px; margin-top: 15px; padding-bottom: 27px; position: relative; text-align: center; width: 110px; } .chart3 canvas { position: absolute; top: 0; left: 0; } .percent3 { display: none; line-height: 110px; z-index: 2; } .percent3:after { content:'Views'; margin-left: 0.1em; font-size: .8em; } .percentage { color: #FFFFFF; font-size: 1em; font-weight: 100; padding: 8px; text-align: center; } .angular { margin-top: 100px; } .angular .chart { margin-top: 0; }
{ "pile_set_name": "Github" }
# ======== # captured on: Thu Aug 17 14:14:43 2017 # hostname : bgregg-lgud2 # os release : 4.13.0-rc1 # perf version : 4.13.0-rc1 # arch : x86_64 # nrcpus online : 8 # nrcpus avail : 8 # cpudesc : Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz # cpuid : GenuineIntel,6,94,3 # total memory : 8058796 kB # cmdline : /usr/bin/perf record -e cycles -e instructions -c 100000000 -a --call-graph=lbr -- sleep 1 # event : name = cycles, , id = { 550, 551, 552, 553, 554, 555, 556, 557 }, size = 112, { sample_period, sample_freq } = 100000000, sample_type = IP|TID|TIME|CALLCHAIN|ID|CPU|BRANCH_STACK, read_format = ID, disabled = 1, inherit = 1, mmap = 1, comm = 1, task = 1, sample_id_all = 1, exclude_guest = 1, mmap2 = 1, comm_exec = 1, branch_sample_type = USER|CALL_STACK|NO_FLAGS|NO_CYCLES # event : name = instructions, , id = { 558, 559, 560, 561, 562, 563, 564, 565 }, size = 112, config = 0x1, { sample_period, sample_freq } = 100000000, sample_type = IP|TID|TIME|CALLCHAIN|ID|CPU|BRANCH_STACK, read_format = ID, disabled = 1, inherit = 1, sample_id_all = 1, exclude_guest = 1, branch_sample_type = USER|CALL_STACK|NO_FLAGS|NO_CYCLES # HEADER_CPU_TOPOLOGY info available, use -I to display # HEADER_NUMA_TOPOLOGY info available, use -I to display # pmu mappings: intel_pt = 7, intel_bts = 6, uncore_arb = 13, uncore_cbox_3 = 12, cstate_pkg = 16, breakpoint = 5, uncore_cbox_1 = 10, power = 14, cpu = 4, software = 1, uncore_cbox_2 = 11, uncore_cbox_0 = 9, cstate_core = 15, tracepoint = 2, msr = 8 # HEADER_CACHE info available, use -I to display # missing features: HEADER_TRACING_DATA HEADER_BRANCH_STACK HEADER_GROUP_DESC HEADER_AUXTRACE HEADER_STAT # ======== # noploop 21796 [001] 1410597.984841: instructions: 993 main (/root/noploop) noploop 21797 [002] 1410597.984850: instructions: 69b main (/root/noploop) noploop 21796 [001] 1410597.992030: instructions: 7df main (/root/noploop) noploop 21797 [002] 1410597.992037: instructions: 883 main (/root/noploop) cksum 21804 [000] 1410597.994832: instructions: 1ad1 cksum (/usr/bin/cksum) noploop 21796 [001] 1410597.999214: instructions: 6e7 main (/root/noploop) noploop 21797 [002] 1410597.999221: instructions: 917 main (/root/noploop) cksum 21804 [000] 1410598.006198: cycles: 1ad1 cksum (/usr/bin/cksum) noploop 21796 [001] 1410598.006210: cycles: 6a7 main (/root/noploop) noploop 21797 [002] 1410598.006219: cycles: 68f main (/root/noploop) noploop 21796 [001] 1410598.006401: instructions: 7a7 main (/root/noploop) noploop 21797 [002] 1410598.006407: instructions: 78f main (/root/noploop) cksum 21804 [000] 1410598.011998: instructions: 1ad1 cksum (/usr/bin/cksum) noploop 21796 [001] 1410598.013586: instructions: 797 main (/root/noploop) noploop 21797 [002] 1410598.013593: instructions: 857 main (/root/noploop) noploop 21796 [001] 1410598.020771: instructions: 6d7 main (/root/noploop) noploop 21797 [002] 1410598.020778: instructions: 763 main (/root/noploop) noploop 21796 [001] 1410598.027957: instructions: 7bb main (/root/noploop) noploop 21797 [002] 1410598.027963: instructions: 817 main (/root/noploop) cksum 21804 [000] 1410598.029069: instructions: 1ad1 cksum (/usr/bin/cksum) cksum 21804 [000] 1410598.034839: cycles: 4e85d9 ext4_file_read_iter (/lib/modules/4.13.0-rc1/build/vmlinux) noploop 21796 [001] 1410598.034851: cycles: 9e7 main (/root/noploop) noploop 21797 [002] 1410598.034861: cycles: 8df main (/root/noploop) noploop 21796 [001] 1410598.035143: instructions: 7c7 main (/root/noploop) noploop 21797 [002] 1410598.035148: instructions: 7fb main (/root/noploop) noploop 21796 [001] 1410598.042328: instructions: 89f main (/root/noploop) noploop 21797 [002] 1410598.042333: instructions: 98b main (/root/noploop) cksum 21804 [000] 1410598.046169: instructions: 4e85d9 ext4_file_read_iter (/lib/modules/4.13.0-rc1/build/vmlinux) 44b0fe __vfs_read (/lib/modules/4.13.0-rc1/build/vmlinux) 44bd56 vfs_read (/lib/modules/4.13.0-rc1/build/vmlinux) 44d495 sys_read (/lib/modules/4.13.0-rc1/build/vmlinux) af30bb entry_SYSCALL_64_fastpath (/lib/modules/4.13.0-rc1/build/vmlinux) 7afe0 _IO_file_read (/lib/x86_64-linux-gnu/libc-2.24.so) 7ad41 _IO_file_xsgetn (/lib/x86_64-linux-gnu/libc-2.24.so) 79b8f __GI___fread_unlocked (/lib/x86_64-linux-gnu/libc-2.24.so) 1b23 cksum (/usr/bin/cksum) noploop 21796 [001] 1410598.049514: instructions: 907 main (/root/noploop) noploop 21797 [002] 1410598.049518: instructions: 9ff main (/root/noploop) noploop 21796 [001] 1410598.056699: instructions: 87b main (/root/noploop) noploop 21797 [002] 1410598.056703: instructions: 743 main (/root/noploop) cksum 21804 [000] 1410598.063350: instructions: 1ad4 cksum (/usr/bin/cksum) cksum 21804 [000] 1410598.063483: cycles: 1ab5 cksum (/usr/bin/cksum) noploop 21796 [001] 1410598.063493: cycles: 773 main (/root/noploop) noploop 21797 [002] 1410598.063503: cycles: 6e3 main (/root/noploop) noploop 21796 [001] 1410598.063886: instructions: 6ff main (/root/noploop) noploop 21797 [002] 1410598.063890: instructions: 8d3 main (/root/noploop) noploop 21796 [001] 1410598.071069: instructions: 6eb main (/root/noploop) noploop 21797 [002] 1410598.071074: instructions: 67b main (/root/noploop) noploop 21796 [001] 1410598.078254: instructions: 8a3 main (/root/noploop) noploop 21797 [002] 1410598.078259: instructions: 80b main (/root/noploop) cksum 21804 [000] 1410598.080529: instructions: 1ad1 cksum (/usr/bin/cksum) noploop 21796 [001] 1410598.085439: instructions: 823 main (/root/noploop) noploop 21797 [002] 1410598.085444: instructions: 6f7 main (/root/noploop) cksum 21804 [000] 1410598.092123: cycles: 552c0000552c [unknown] ([unknown]) noploop 21796 [001] 1410598.092134: cycles: 81f main (/root/noploop) noploop 21797 [002] 1410598.092144: cycles: 6ff main (/root/noploop) noploop 21796 [001] 1410598.092625: instructions: 8ff main (/root/noploop) noploop 21797 [002] 1410598.092630: instructions: 74b main (/root/noploop) noploop 21796 [001] 1410598.099811: instructions: 6e7 main (/root/noploop) noploop 21797 [002] 1410598.099816: instructions: 75f main (/root/noploop) noploop 21796 [001] 1410598.106996: instructions: 8b3 main (/root/noploop) noploop 21797 [002] 1410598.107000: instructions: 847 main (/root/noploop) noploop 21796 [001] 1410598.114182: instructions: 7f3 main (/root/noploop) noploop 21797 [002] 1410598.114186: instructions: 7ff main (/root/noploop) cksum 21807 [004] 1410598.116168: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21796 [001] 1410598.120777: cycles: a23 main (/root/noploop) noploop 21797 [002] 1410598.120786: cycles: 6ff main (/root/noploop) noploop 21796 [001] 1410598.121368: instructions: 91b main (/root/noploop) noploop 21797 [002] 1410598.121372: instructions: 893 main (/root/noploop) cksum 21807 [004] 1410598.127157: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21796 [001] 1410598.128553: instructions: 8f3 main (/root/noploop) noploop 21797 [002] 1410598.128557: instructions: a53 main (/root/noploop) cksum 21807 [004] 1410598.133347: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21796 [001] 1410598.135738: instructions: 90b main (/root/noploop) noploop 21797 [002] 1410598.135743: instructions: 9cf main (/root/noploop) noploop 21796 [001] 1410598.142921: instructions: 6fb main (/root/noploop) noploop 21797 [002] 1410598.142926: instructions: 823 main (/root/noploop) noploop 21796 [001] 1410598.149418: cycles: 9ef main (/root/noploop) noploop 21797 [002] 1410598.149428: cycles: 94f main (/root/noploop) noploop 21796 [001] 1410598.150108: instructions: 8f3 main (/root/noploop) noploop 21797 [002] 1410598.150113: instructions: 9cf main (/root/noploop) cksum 21807 [004] 1410598.150509: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) cksum 21807 [004] 1410598.155801: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21796 [001] 1410598.157294: instructions: 69b main (/root/noploop) noploop 21797 [002] 1410598.157298: instructions: 8e3 main (/root/noploop) noploop 21796 [001] 1410598.164479: instructions: 673 main (/root/noploop) noploop 21797 [002] 1410598.164483: instructions: 97b main (/root/noploop) cksum 21807 [004] 1410598.167744: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21796 [001] 1410598.171664: instructions: 6e7 main (/root/noploop) noploop 21797 [002] 1410598.171668: instructions: 977 main (/root/noploop) noploop 21796 [001] 1410598.178060: cycles: a4b main (/root/noploop) noploop 21797 [002] 1410598.178069: cycles: 79f main (/root/noploop) noploop 21796 [001] 1410598.178849: instructions: 73f main (/root/noploop) noploop 21797 [002] 1410598.178853: instructions: 96f main (/root/noploop) cksum 21807 [004] 1410598.184443: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) cksum 21807 [004] 1410598.184923: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21796 [001] 1410598.186034: instructions: 723 main (/root/noploop) noploop 21797 [002] 1410598.186038: instructions: a17 main (/root/noploop) noploop 21796 [001] 1410598.193219: instructions: 70b main (/root/noploop) noploop 21797 [002] 1410598.193223: instructions: 8af main (/root/noploop) noploop 21796 [001] 1410598.200405: instructions: 9c7 main (/root/noploop) noploop 21797 [002] 1410598.200408: instructions: 83f main (/root/noploop) cksum 21807 [004] 1410598.202111: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21796 [001] 1410598.206701: cycles: 76b main (/root/noploop) noploop 21797 [002] 1410598.206711: cycles: 807 main (/root/noploop) noploop 21796 [001] 1410598.207592: instructions: 78b main (/root/noploop) noploop 21797 [002] 1410598.207595: instructions: 7fb main (/root/noploop) cksum 21807 [004] 1410598.213085: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21796 [001] 1410598.214776: instructions: 6d7 main (/root/noploop) noploop 21797 [002] 1410598.214779: instructions: 6ef main (/root/noploop) cksum 21807 [004] 1410598.219228: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21796 [001] 1410598.221961: instructions: 7eb main (/root/noploop) noploop 21797 [002] 1410598.221964: instructions: 86f main (/root/noploop) noploop 21797 [002] 1410598.229149: instructions: 96f main (/root/noploop) noploop 21796 [001] 1410598.229155: instructions: 87f main (/root/noploop) noploop 21796 [001] 1410598.235343: cycles: 8e7 main (/root/noploop) noploop 21797 [002] 1410598.235353: cycles: 76b main (/root/noploop) cksum 21807 [004] 1410598.236321: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.236337: instructions: 95f main (/root/noploop) noploop 21796 [001] 1410598.236342: instructions: 8db main (/root/noploop) cksum 21807 [004] 1410598.241728: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.243521: instructions: 993 main (/root/noploop) noploop 21796 [001] 1410598.243527: instructions: 74b main (/root/noploop) noploop 21797 [002] 1410598.250705: instructions: 8cf main (/root/noploop) noploop 21796 [001] 1410598.250711: instructions: 74f main (/root/noploop) cksum 21807 [004] 1410598.253484: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.257890: instructions: 937 main (/root/noploop) noploop 21796 [001] 1410598.257896: instructions: 6ef main (/root/noploop) noploop 21796 [001] 1410598.263985: cycles: 937 main (/root/noploop) noploop 21797 [002] 1410598.263994: cycles: 867 main (/root/noploop) noploop 21797 [002] 1410598.265076: instructions: 9b3 main (/root/noploop) noploop 21796 [001] 1410598.265082: instructions: 953 main (/root/noploop) cksum 21807 [004] 1410598.270369: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) cksum 21807 [004] 1410598.270672: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.272261: instructions: 6d7 main (/root/noploop) noploop 21796 [001] 1410598.272267: instructions: 8ff main (/root/noploop) noploop 21797 [002] 1410598.279446: instructions: 6c7 main (/root/noploop) noploop 21796 [001] 1410598.279452: instructions: 91f main (/root/noploop) noploop 21797 [002] 1410598.286631: instructions: 76f main (/root/noploop) noploop 21796 [001] 1410598.286636: instructions: 813 main (/root/noploop) cksum 21807 [004] 1410598.287836: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21796 [001] 1410598.292627: cycles: 973 main (/root/noploop) noploop 21797 [002] 1410598.292636: cycles: 6cf main (/root/noploop) noploop 21797 [002] 1410598.293818: instructions: 86b main (/root/noploop) noploop 21796 [001] 1410598.293823: instructions: 953 main (/root/noploop) cksum 21807 [004] 1410598.299012: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.301003: instructions: 85b main (/root/noploop) noploop 21796 [001] 1410598.301008: instructions: 85b main (/root/noploop) cksum 21807 [004] 1410598.304899: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.308188: instructions: 853 main (/root/noploop) noploop 21796 [001] 1410598.308194: instructions: a4f main (/root/noploop) noploop 21797 [002] 1410598.315372: instructions: 80b main (/root/noploop) noploop 21796 [001] 1410598.315377: instructions: 8a7 main (/root/noploop) noploop 21796 [001] 1410598.321268: cycles: 923 main (/root/noploop) noploop 21797 [002] 1410598.321278: cycles: 943 main (/root/noploop) cksum 21807 [004] 1410598.322082: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.322558: instructions: 7ab main (/root/noploop) noploop 21796 [001] 1410598.322564: instructions: 9a3 main (/root/noploop) cksum 21807 [004] 1410598.327656: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.329743: instructions: 93b main (/root/noploop) noploop 21796 [001] 1410598.329749: instructions: 973 main (/root/noploop) noploop 21797 [002] 1410598.336927: instructions: 6ab main (/root/noploop) noploop 21796 [001] 1410598.336934: instructions: 8c7 main (/root/noploop) cksum 21807 [004] 1410598.339259: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.344113: instructions: 7e3 main (/root/noploop) noploop 21796 [001] 1410598.344119: instructions: 8cb main (/root/noploop) noploop 21796 [001] 1410598.349909: cycles: 6d3 main (/root/noploop) noploop 21797 [002] 1410598.349919: cycles: 877 main (/root/noploop) noploop 21797 [002] 1410598.351297: instructions: 9b7 main (/root/noploop) noploop 21796 [001] 1410598.351304: instructions: 68b main (/root/noploop) cksum 21807 [004] 1410598.356297: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) cksum 21807 [004] 1410598.356460: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.358482: instructions: 75f main (/root/noploop) noploop 21796 [001] 1410598.358489: instructions: a3b main (/root/noploop) noploop 21797 [002] 1410598.365667: instructions: 8f3 main (/root/noploop) noploop 21796 [001] 1410598.365674: instructions: a13 main (/root/noploop) noploop 21797 [002] 1410598.372852: instructions: a3f main (/root/noploop) noploop 21796 [001] 1410598.372859: instructions: 737 main (/root/noploop) cksum 21807 [004] 1410598.373647: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21796 [001] 1410598.378550: cycles: 7d3 main (/root/noploop) noploop 21797 [002] 1410598.378560: cycles: 873 main (/root/noploop) noploop 21797 [002] 1410598.380038: instructions: 74f main (/root/noploop) noploop 21796 [001] 1410598.380045: instructions: 91b main (/root/noploop) cksum 21807 [004] 1410598.384940: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.387221: instructions: 8c7 main (/root/noploop) noploop 21796 [001] 1410598.387229: instructions: 72f main (/root/noploop) cksum 21807 [004] 1410598.390867: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.394407: instructions: 66b main (/root/noploop) noploop 21796 [001] 1410598.394414: instructions: a23 main (/root/noploop) noploop 21797 [002] 1410598.401592: instructions: 85f main (/root/noploop) noploop 21796 [001] 1410598.401598: instructions: 7b7 main (/root/noploop) noploop 21796 [001] 1410598.407192: cycles: 77f main (/root/noploop) noploop 21797 [002] 1410598.407201: cycles: 9a7 main (/root/noploop) cksum 21807 [004] 1410598.408043: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.408778: instructions: 757 main (/root/noploop) noploop 21796 [001] 1410598.408784: instructions: 73f main (/root/noploop) cksum 21807 [004] 1410598.413583: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.415963: instructions: 6c3 main (/root/noploop) noploop 21796 [001] 1410598.415969: instructions: 75f main (/root/noploop) noploop 21797 [002] 1410598.423147: instructions: 85b main (/root/noploop) noploop 21796 [001] 1410598.423153: instructions: 953 main (/root/noploop) cksum 21807 [004] 1410598.425233: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.430332: instructions: a17 main (/root/noploop) noploop 21796 [001] 1410598.430338: instructions: a1f main (/root/noploop) noploop 21796 [001] 1410598.435833: cycles: a4f main (/root/noploop) noploop 21797 [002] 1410598.435843: cycles: 7e3 main (/root/noploop) noploop 21797 [002] 1410598.437519: instructions: 8eb main (/root/noploop) noploop 21796 [001] 1410598.437525: instructions: a17 main (/root/noploop) cksum 21807 [004] 1410598.442225: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) cksum 21807 [004] 1410598.442373: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.444704: instructions: 7e7 main (/root/noploop) noploop 21796 [001] 1410598.444710: instructions: 87f main (/root/noploop) noploop 21797 [002] 1410598.451889: instructions: 6c7 main (/root/noploop) noploop 21796 [001] 1410598.451912: instructions: 99f main (/root/noploop) noploop 21797 [002] 1410598.459073: instructions: 87b main (/root/noploop) noploop 21796 [001] 1410598.459096: instructions: 9cb main (/root/noploop) cksum 21807 [004] 1410598.459586: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21796 [001] 1410598.464475: cycles: 6cf main (/root/noploop) noploop 21797 [002] 1410598.464485: cycles: 76f main (/root/noploop) noploop 21797 [002] 1410598.466259: instructions: 90b main (/root/noploop) noploop 21796 [001] 1410598.466283: instructions: 9db main (/root/noploop) cksum 21807 [004] 1410598.470867: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.473443: instructions: 877 main (/root/noploop) noploop 21796 [001] 1410598.473468: instructions: a37 main (/root/noploop) cksum 21807 [004] 1410598.476672: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.480628: instructions: 6f3 main (/root/noploop) noploop 21796 [001] 1410598.480652: instructions: 9df main (/root/noploop) noploop 21797 [002] 1410598.487813: instructions: 93b main (/root/noploop) noploop 21796 [001] 1410598.487837: instructions: 9b7 main (/root/noploop) noploop 21796 [001] 1410598.493116: cycles: 7ef main (/root/noploop) noploop 21797 [002] 1410598.493126: cycles: 89b main (/root/noploop) cksum 21807 [004] 1410598.493741: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.494998: instructions: 6db main (/root/noploop) noploop 21796 [001] 1410598.495022: instructions: 7cf main (/root/noploop) cksum 21807 [004] 1410598.499510: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.502183: instructions: 8c3 main (/root/noploop) noploop 21796 [001] 1410598.502207: instructions: 797 main (/root/noploop) noploop 21797 [002] 1410598.509368: instructions: 70f main (/root/noploop) noploop 21796 [001] 1410598.509392: instructions: 987 main (/root/noploop) cksum 21807 [004] 1410598.510883: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.516553: instructions: 70b main (/root/noploop) noploop 21796 [001] 1410598.516577: instructions: a07 main (/root/noploop) noploop 21796 [001] 1410598.521758: cycles: 9c7 main (/root/noploop) noploop 21797 [002] 1410598.521768: cycles: 78f main (/root/noploop) noploop 21797 [002] 1410598.523740: instructions: 8c3 main (/root/noploop) noploop 21796 [001] 1410598.523763: instructions: 793 main (/root/noploop) cksum 21807 [004] 1410598.528071: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) cksum 21807 [004] 1410598.528153: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.530923: instructions: 673 main (/root/noploop) noploop 21796 [001] 1410598.530947: instructions: 8cb main (/root/noploop) noploop 21797 [002] 1410598.538108: instructions: 7fb main (/root/noploop) noploop 21796 [001] 1410598.538132: instructions: 887 main (/root/noploop) cksum 21807 [004] 1410598.545275: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.545293: instructions: 703 main (/root/noploop) noploop 21796 [001] 1410598.545317: instructions: 7db main (/root/noploop) noploop 21796 [001] 1410598.550399: cycles: 9ab main (/root/noploop) noploop 21797 [002] 1410598.550409: cycles: 9e7 main (/root/noploop) noploop 21797 [002] 1410598.552479: instructions: 89f main (/root/noploop) noploop 21796 [001] 1410598.552503: instructions: 9c7 main (/root/noploop) cksum 21807 [004] 1410598.556794: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.559664: instructions: 9bf main (/root/noploop) noploop 21796 [001] 1410598.559688: instructions: 947 main (/root/noploop) cksum 21807 [004] 1410598.562462: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.566847: instructions: a13 main (/root/noploop) noploop 21796 [001] 1410598.566871: instructions: 9af main (/root/noploop) noploop 21797 [002] 1410598.574032: instructions: 7fb main (/root/noploop) noploop 21796 [001] 1410598.574056: instructions: 8f0 main (/root/noploop) noploop 21796 [001] 1410598.579040: cycles: 7af main (/root/noploop) noploop 21797 [002] 1410598.579050: cycles: 75f main (/root/noploop) cksum 21807 [004] 1410598.579636: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.581218: instructions: 8d7 main (/root/noploop) noploop 21796 [001] 1410598.581604: instructions: 717 main (/root/noploop) cksum 21807 [004] 1410598.585437: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.588402: instructions: 8db main (/root/noploop) noploop 21796 [001] 1410598.589229: instructions: 9e4 main (/root/noploop) noploop 21797 [002] 1410598.595587: instructions: 8d3 main (/root/noploop) cksum 21807 [004] 1410598.596815: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21796 [001] 1410598.596855: instructions: 6ef main (/root/noploop) noploop 21797 [002] 1410598.602771: instructions: 947 main (/root/noploop) swapper 0 [005] 1410598.603979: cycles: af2bfe poll_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 956752 cpuidle_enter_state (/lib/modules/4.13.0-rc1/build/vmlinux) 956957 cpuidle_enter (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8623 call_cpuidle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c88c9 do_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8b13 cpu_startup_entry (/lib/modules/4.13.0-rc1/build/vmlinux) 252886 start_secondary (/lib/modules/4.13.0-rc1/build/vmlinux) 2000cf verify_cpu (/lib/modules/4.13.0-rc1/build/vmlinux) noploop 21796 [001] 1410598.604482: instructions: 928 main (/root/noploop) noploop 21796 [001] 1410598.607682: cycles: 6c4 main (/root/noploop) noploop 21797 [002] 1410598.607691: cycles: 893 main (/root/noploop) noploop 21797 [002] 1410598.609957: instructions: 733 main (/root/noploop) noploop 21796 [001] 1410598.612110: instructions: 67f main (/root/noploop) cksum 21807 [004] 1410598.613988: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) cksum 21807 [004] 1410598.614079: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.617142: instructions: 75b main (/root/noploop) noploop 21796 [001] 1410598.619736: instructions: 6b3 main (/root/noploop) noploop 21797 [002] 1410598.624328: instructions: 8f7 main (/root/noploop) noploop 21796 [001] 1410598.627360: instructions: a18 main (/root/noploop) cksum 21807 [004] 1410598.631186: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.631513: instructions: a0b main (/root/noploop) swapper 0 [005] 1410598.632619: cycles: af2bfe poll_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 956752 cpuidle_enter_state (/lib/modules/4.13.0-rc1/build/vmlinux) 956957 cpuidle_enter (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8623 call_cpuidle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c88c9 do_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8b13 cpu_startup_entry (/lib/modules/4.13.0-rc1/build/vmlinux) 252886 start_secondary (/lib/modules/4.13.0-rc1/build/vmlinux) 2000cf verify_cpu (/lib/modules/4.13.0-rc1/build/vmlinux) noploop 21796 [001] 1410598.634987: instructions: 66b main (/root/noploop) noploop 21796 [001] 1410598.636324: cycles: 92c main (/root/noploop) noploop 21797 [002] 1410598.636333: cycles: 6e7 main (/root/noploop) noploop 21797 [002] 1410598.638698: instructions: 8a3 main (/root/noploop) noploop 21796 [001] 1410598.642614: instructions: 8ef main (/root/noploop) cksum 21807 [004] 1410598.642721: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) 203ef __libc_start_main (/lib/x86_64-linux-gnu/libc-2.24.so) 1724 _start (/usr/bin/cksum) noploop 21797 [002] 1410598.645883: instructions: 7e7 main (/root/noploop) cksum 21807 [004] 1410598.648405: instructions: 1adb cksum (/usr/bin/cksum) noploop 21796 [001] 1410598.650240: instructions: 9c4 main (/root/noploop) noploop 21797 [002] 1410598.653067: instructions: 94b main (/root/noploop) noploop 21796 [001] 1410598.657866: instructions: 9e0 main (/root/noploop) noploop 21797 [002] 1410598.660253: instructions: 957 main (/root/noploop) swapper 0 [005] 1410598.661259: cycles: af2bfe poll_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 956752 cpuidle_enter_state (/lib/modules/4.13.0-rc1/build/vmlinux) 956957 cpuidle_enter (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8623 call_cpuidle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c88c9 do_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8b13 cpu_startup_entry (/lib/modules/4.13.0-rc1/build/vmlinux) 252886 start_secondary (/lib/modules/4.13.0-rc1/build/vmlinux) 2000cf verify_cpu (/lib/modules/4.13.0-rc1/build/vmlinux) noploop 21796 [001] 1410598.664965: cycles: 717 main (/root/noploop) noploop 21797 [002] 1410598.664975: cycles: 69b main (/root/noploop) noploop 21796 [001] 1410598.665495: instructions: a0c main (/root/noploop) cksum 21807 [004] 1410598.665552: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21797 [002] 1410598.667440: instructions: 697 main (/root/noploop) cksum 21807 [004] 1410598.671379: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.673121: instructions: 677 main (/root/noploop) noploop 21797 [002] 1410598.674624: instructions: 837 main (/root/noploop) noploop 21796 [001] 1410598.680736: instructions: a48 main (/root/noploop) noploop 21797 [002] 1410598.681808: instructions: 6eb main (/root/noploop) cksum 21807 [004] 1410598.682522: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.688362: instructions: 79b main (/root/noploop) noploop 21797 [002] 1410598.688994: instructions: 94b main (/root/noploop) swapper 0 [005] 1410598.689898: cycles: af2bfe poll_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 956752 cpuidle_enter_state (/lib/modules/4.13.0-rc1/build/vmlinux) 956957 cpuidle_enter (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8623 call_cpuidle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c88c9 do_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8b13 cpu_startup_entry (/lib/modules/4.13.0-rc1/build/vmlinux) 252886 start_secondary (/lib/modules/4.13.0-rc1/build/vmlinux) 2000cf verify_cpu (/lib/modules/4.13.0-rc1/build/vmlinux) noploop 21796 [001] 1410598.693606: cycles: 96f main (/root/noploop) noploop 21797 [002] 1410598.693617: cycles: 87b main (/root/noploop) noploop 21796 [001] 1410598.695990: instructions: 7c0 main (/root/noploop) noploop 21797 [002] 1410598.696180: instructions: 86f main (/root/noploop) cksum 21807 [004] 1410598.699700: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) cksum 21807 [004] 1410598.700021: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21797 [002] 1410598.703364: instructions: 737 main (/root/noploop) noploop 21796 [001] 1410598.703616: instructions: 9c0 main (/root/noploop) noploop 21797 [002] 1410598.710549: instructions: 867 main (/root/noploop) noploop 21796 [001] 1410598.711241: instructions: 70b main (/root/noploop) cksum 21807 [004] 1410598.716851: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21797 [002] 1410598.717736: instructions: 85b main (/root/noploop) swapper 0 [005] 1410598.718538: cycles: af2c01 poll_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 956752 cpuidle_enter_state (/lib/modules/4.13.0-rc1/build/vmlinux) 956957 cpuidle_enter (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8623 call_cpuidle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c88c9 do_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8b13 cpu_startup_entry (/lib/modules/4.13.0-rc1/build/vmlinux) 252886 start_secondary (/lib/modules/4.13.0-rc1/build/vmlinux) 2000cf verify_cpu (/lib/modules/4.13.0-rc1/build/vmlinux) noploop 21796 [001] 1410598.718864: instructions: 71c main (/root/noploop) noploop 21796 [001] 1410598.722248: cycles: 76b main (/root/noploop) noploop 21797 [002] 1410598.722259: cycles: 99f main (/root/noploop) noploop 21797 [002] 1410598.724923: instructions: 683 main (/root/noploop) noploop 21796 [001] 1410598.726493: instructions: 6df main (/root/noploop) cksum 21807 [004] 1410598.728663: cycles: ae2d1e copy_user_enhanced_fast_string (/lib/modules/4.13.0-rc1/build/vmlinux) 651824 copy_page_to_iter (/lib/modules/4.13.0-rc1/build/vmlinux) 3b5d64 generic_file_read_iter (/lib/modules/4.13.0-rc1/build/vmlinux) 4e8626 ext4_file_read_iter (/lib/modules/4.13.0-rc1/build/vmlinux) 44b0fe __vfs_read (/lib/modules/4.13.0-rc1/build/vmlinux) 44bd56 vfs_read (/lib/modules/4.13.0-rc1/build/vmlinux) 44d495 sys_read (/lib/modules/4.13.0-rc1/build/vmlinux) af30bb entry_SYSCALL_64_fastpath (/lib/modules/4.13.0-rc1/build/vmlinux) 7afe0 _IO_file_read (/lib/x86_64-linux-gnu/libc-2.24.so) 7ad41 _IO_file_xsgetn (/lib/x86_64-linux-gnu/libc-2.24.so) 79b8f __GI___fread_unlocked (/lib/x86_64-linux-gnu/libc-2.24.so) 1b23 cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21797 [002] 1410598.732108: instructions: 7cf main (/root/noploop) cksum 21807 [004] 1410598.733868: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.734119: instructions: 8a8 main (/root/noploop) noploop 21797 [002] 1410598.739299: instructions: 6a3 main (/root/noploop) noploop 21796 [001] 1410598.741746: instructions: a1c main (/root/noploop) noploop 21797 [002] 1410598.746484: instructions: 77f main (/root/noploop) swapper 0 [005] 1410598.747178: cycles: af2bfe poll_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 956752 cpuidle_enter_state (/lib/modules/4.13.0-rc1/build/vmlinux) 956957 cpuidle_enter (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8623 call_cpuidle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c88c9 do_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8b13 cpu_startup_entry (/lib/modules/4.13.0-rc1/build/vmlinux) 252886 start_secondary (/lib/modules/4.13.0-rc1/build/vmlinux) 2000cf verify_cpu (/lib/modules/4.13.0-rc1/build/vmlinux) noploop 21796 [001] 1410598.749373: instructions: a44 main (/root/noploop) cksum 21807 [004] 1410598.750821: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.750890: cycles: 7eb main (/root/noploop) noploop 21797 [002] 1410598.750900: cycles: 98f main (/root/noploop) noploop 21797 [002] 1410598.753670: instructions: 73f main (/root/noploop) noploop 21796 [001] 1410598.757000: instructions: a4c main (/root/noploop) cksum 21807 [004] 1410598.757306: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21797 [002] 1410598.760856: instructions: 8c7 main (/root/noploop) noploop 21796 [001] 1410598.764626: instructions: 95b main (/root/noploop) cksum 21807 [004] 1410598.767889: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21797 [002] 1410598.768041: instructions: 9fb main (/root/noploop) noploop 21796 [001] 1410598.771989: instructions: 69b main (/root/noploop) noploop 21797 [002] 1410598.775226: instructions: 727 main (/root/noploop) noploop 21796 [001] 1410598.779173: instructions: 7ef main (/root/noploop) noploop 21796 [001] 1410598.779532: cycles: 78b main (/root/noploop) noploop 21797 [002] 1410598.779543: cycles: 853 main (/root/noploop) noploop 21797 [002] 1410598.782412: instructions: 77f main (/root/noploop) cksum 21807 [004] 1410598.785060: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) cksum 21807 [004] 1410598.785948: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.786362: instructions: 9fb main (/root/noploop) noploop 21797 [002] 1410598.789597: instructions: 8e3 main (/root/noploop) noploop 21796 [001] 1410598.793547: instructions: a1b main (/root/noploop) noploop 21797 [002] 1410598.796782: instructions: 887 main (/root/noploop) noploop 21796 [001] 1410598.800732: instructions: 923 main (/root/noploop) cksum 21807 [004] 1410598.802246: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21797 [002] 1410598.803967: instructions: 93f main (/root/noploop) noploop 21796 [001] 1410598.807917: instructions: 887 main (/root/noploop) noploop 21796 [001] 1410598.808173: cycles: 913 main (/root/noploop) noploop 21797 [002] 1410598.808184: cycles: a53 main (/root/noploop) noploop 21797 [002] 1410598.811152: instructions: 807 main (/root/noploop) cksum 21807 [004] 1410598.814589: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.815102: instructions: 72f main (/root/noploop) noploop 21797 [002] 1410598.818337: instructions: 99f main (/root/noploop) cksum 21807 [004] 1410598.819414: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.822287: instructions: 703 main (/root/noploop) noploop 21797 [002] 1410598.825521: instructions: 73b main (/root/noploop) noploop 21796 [001] 1410598.829472: instructions: a23 main (/root/noploop) noploop 21797 [002] 1410598.832706: instructions: 803 main (/root/noploop) cksum 21807 [004] 1410598.836558: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.836657: instructions: 7d3 main (/root/noploop) noploop 21796 [001] 1410598.836815: cycles: 8d7 main (/root/noploop) noploop 21797 [002] 1410598.836825: cycles: 95f main (/root/noploop) noploop 21797 [002] 1410598.839892: instructions: 8cf main (/root/noploop) cksum 21807 [004] 1410598.843232: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.843843: instructions: 89f main (/root/noploop) noploop 21797 [002] 1410598.847076: instructions: a3f main (/root/noploop) noploop 21796 [001] 1410598.851027: instructions: 76b main (/root/noploop) cksum 21807 [004] 1410598.853729: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21797 [002] 1410598.854261: instructions: a03 main (/root/noploop) noploop 21796 [001] 1410598.858212: instructions: 80b main (/root/noploop) noploop 21797 [002] 1410598.861446: instructions: a07 main (/root/noploop) noploop 21796 [001] 1410598.865397: instructions: 917 main (/root/noploop) noploop 21796 [001] 1410598.865456: cycles: 7ef main (/root/noploop) noploop 21797 [002] 1410598.865466: cycles: 92b main (/root/noploop) noploop 21797 [002] 1410598.868632: instructions: 6db main (/root/noploop) cksum 21807 [004] 1410598.870889: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) cksum 21807 [004] 1410598.871891: cycles: 1ac6 cksum (/usr/bin/cksum) noploop 21796 [001] 1410598.872583: instructions: 9f7 main (/root/noploop) noploop 21797 [002] 1410598.875817: instructions: 697 main (/root/noploop) noploop 21796 [001] 1410598.879768: instructions: 7d3 main (/root/noploop) noploop 21797 [002] 1410598.883000: instructions: 933 main (/root/noploop) noploop 21796 [001] 1410598.886951: instructions: 9cc main (/root/noploop) cksum 21807 [004] 1410598.888074: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21797 [002] 1410598.890185: instructions: 993 main (/root/noploop) noploop 21796 [001] 1410598.894096: cycles: 6eb main (/root/noploop) noploop 21797 [002] 1410598.894108: cycles: 6c3 main (/root/noploop) noploop 21796 [001] 1410598.894553: instructions: 9e0 main (/root/noploop) swapper 0 [005] 1410598.895787: cycles: af2bfe poll_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 956752 cpuidle_enter_state (/lib/modules/4.13.0-rc1/build/vmlinux) 956957 cpuidle_enter (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8623 call_cpuidle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c88c9 do_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8b13 cpu_startup_entry (/lib/modules/4.13.0-rc1/build/vmlinux) 252886 start_secondary (/lib/modules/4.13.0-rc1/build/vmlinux) 2000cf verify_cpu (/lib/modules/4.13.0-rc1/build/vmlinux) noploop 21797 [002] 1410598.897371: instructions: 7c3 main (/root/noploop) cksum 21807 [004] 1410598.900532: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.902180: instructions: 9a4 main (/root/noploop) noploop 21797 [002] 1410598.904556: instructions: 95f main (/root/noploop) cksum 21807 [004] 1410598.905217: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.909806: instructions: 9c0 main (/root/noploop) noploop 21797 [002] 1410598.911741: instructions: 95f main (/root/noploop) noploop 21796 [001] 1410598.917432: instructions: 8e4 main (/root/noploop) noploop 21797 [002] 1410598.918925: instructions: 8cb main (/root/noploop) cksum 21807 [004] 1410598.922385: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.922738: cycles: a18 main (/root/noploop) noploop 21797 [002] 1410598.922749: cycles: 7d3 main (/root/noploop) swapper 0 [005] 1410598.924427: cycles: af2bfe poll_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 956752 cpuidle_enter_state (/lib/modules/4.13.0-rc1/build/vmlinux) 956957 cpuidle_enter (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8623 call_cpuidle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c88c9 do_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8b13 cpu_startup_entry (/lib/modules/4.13.0-rc1/build/vmlinux) 252886 start_secondary (/lib/modules/4.13.0-rc1/build/vmlinux) 2000cf verify_cpu (/lib/modules/4.13.0-rc1/build/vmlinux) noploop 21796 [001] 1410598.925060: instructions: 9e3 main (/root/noploop) noploop 21797 [002] 1410598.926110: instructions: 953 main (/root/noploop) cksum 21807 [004] 1410598.929175: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.932685: instructions: 9c4 main (/root/noploop) noploop 21797 [002] 1410598.933295: instructions: 6cf main (/root/noploop) cksum 21807 [004] 1410598.939563: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21796 [001] 1410598.940311: instructions: 8cb main (/root/noploop) noploop 21797 [002] 1410598.940480: instructions: 867 main (/root/noploop) noploop 21797 [002] 1410598.947665: instructions: a03 main (/root/noploop) noploop 21796 [001] 1410598.947923: instructions: 893 main (/root/noploop) noploop 21796 [001] 1410598.951379: cycles: 687 main (/root/noploop) noploop 21797 [002] 1410598.951390: cycles: 78b main (/root/noploop) swapper 0 [005] 1410598.953066: cycles: af2bfe poll_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 956752 cpuidle_enter_state (/lib/modules/4.13.0-rc1/build/vmlinux) 956957 cpuidle_enter (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8623 call_cpuidle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c88c9 do_idle (/lib/modules/4.13.0-rc1/build/vmlinux) 2c8b13 cpu_startup_entry (/lib/modules/4.13.0-rc1/build/vmlinux) 252886 start_secondary (/lib/modules/4.13.0-rc1/build/vmlinux) 2000cf verify_cpu (/lib/modules/4.13.0-rc1/build/vmlinux) noploop 21797 [002] 1410598.954849: instructions: 6e3 main (/root/noploop) noploop 21796 [001] 1410598.955534: instructions: 68b main (/root/noploop) cksum 21807 [004] 1410598.956752: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) cksum 21807 [004] 1410598.957817: cycles: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21797 [002] 1410598.962034: instructions: 703 main (/root/noploop) noploop 21796 [001] 1410598.962952: instructions: 9b3 main (/root/noploop) noploop 21797 [002] 1410598.969219: instructions: 89f main (/root/noploop) noploop 21796 [001] 1410598.970137: instructions: 707 main (/root/noploop) cksum 21807 [004] 1410598.973926: instructions: 193b cksum (/usr/bin/cksum) 1f52 main (/usr/bin/cksum) noploop 21797 [002] 1410598.976404: instructions: 552f0000552f [unknown] ([unknown]) noploop 21796 [001] 1410598.977322: instructions: 774db3aa23 [unknown] ([unknown])
{ "pile_set_name": "Github" }
/// /// Copyright (c) 2016 Dropbox, Inc. All rights reserved. /// /// Auto-generated by Stone, do not modify. /// #import <Foundation/Foundation.h> #import "DBSerializableProtocol.h" @class DBTEAMLOGSfTeamInviteChangeRoleType; NS_ASSUME_NONNULL_BEGIN #pragma mark - API Object /// /// The `SfTeamInviteChangeRoleType` struct. /// /// This class implements the `DBSerializable` protocol (serialize and /// deserialize instance methods), which is required for all Obj-C SDK API route /// objects. /// @interface DBTEAMLOGSfTeamInviteChangeRoleType : NSObject <DBSerializable, NSCopying> #pragma mark - Instance fields /// (no description). @property (nonatomic, readonly, copy) NSString *description_; #pragma mark - Constructors /// /// Full constructor for the struct (exposes all instance variables). /// /// @param description_ (no description). /// /// @return An initialized instance. /// - (instancetype)initWithDescription_:(NSString *)description_; - (instancetype)init NS_UNAVAILABLE; @end #pragma mark - Serializer Object /// /// The serialization class for the `SfTeamInviteChangeRoleType` struct. /// @interface DBTEAMLOGSfTeamInviteChangeRoleTypeSerializer : NSObject /// /// Serializes `DBTEAMLOGSfTeamInviteChangeRoleType` instances. /// /// @param instance An instance of the `DBTEAMLOGSfTeamInviteChangeRoleType` API /// object. /// /// @return A json-compatible dictionary representation of the /// `DBTEAMLOGSfTeamInviteChangeRoleType` API object. /// + (nullable NSDictionary<NSString *, id> *)serialize:(DBTEAMLOGSfTeamInviteChangeRoleType *)instance; /// /// Deserializes `DBTEAMLOGSfTeamInviteChangeRoleType` instances. /// /// @param dict A json-compatible dictionary representation of the /// `DBTEAMLOGSfTeamInviteChangeRoleType` API object. /// /// @return An instantiation of the `DBTEAMLOGSfTeamInviteChangeRoleType` /// object. /// + (DBTEAMLOGSfTeamInviteChangeRoleType *)deserialize:(NSDictionary<NSString *, id> *)dict; @end NS_ASSUME_NONNULL_END
{ "pile_set_name": "Github" }
# Basic glTF viewer ## Requirements * glew * glfw3 * premake5(linux) * OpenGL 3.3+ GPU ## Build on Linux and macOS ``` $ premake5 gmake $ make ``` ## Build on Visual Studio Plese use solution file located at `basic` folder.
{ "pile_set_name": "Github" }
<fdp-object-status status="negative" glyph="status-negative" clickable="true" (click)="showObjectStatus()" >Negative</fdp-object-status > <fdp-object-status status="critical" glyph="status-critical" clickable="true" (click)="showObjectStatus()" >Critical</fdp-object-status > <fdp-object-status status="positive" glyph="status-positive" clickable="true" (click)="showObjectStatus()" >Positive</fdp-object-status > <fdp-object-status status="informative" glyph="hint" clickable="true" (click)="showObjectStatus()" >Informative</fdp-object-status > <fdp-object-status glyph="to-be-reviewed" clickable="true" (click)="showObjectStatus()">Default</fdp-object-status> <br /> <br /> <ng-container *ngFor="let item of [1, 2, 3, 4, 5, 6, 7, 8]"> <fdp-object-status indicationColor="{{ item }}" clickable="true" (click)="showAlert(item)" >Indication Color {{ item }}</fdp-object-status > </ng-container>
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 -fsyntax-only -verify %s struct X { int& f(int) const; // expected-note 2 {{candidate function}} float& f(int); // expected-note 2 {{candidate function}} void test_f(int x) const { int& i = f(x); } void test_f2(int x) { float& f2 = f(x); } int& g(int) const; // expected-note 2 {{candidate function}} float& g(int); // expected-note 2 {{candidate function}} static double& g(double); // expected-note 2 {{candidate function}} void h(int); void test_member() { float& f1 = f(0); float& f2 = g(0); double& d1 = g(0.0); } void test_member_const() const { int &i1 = f(0); int &i2 = g(0); double& d1 = g(0.0); } static void test_member_static() { double& d1 = g(0.0); g(0); // expected-error{{call to 'g' is ambiguous}} } }; void test(X x, const X xc, X* xp, const X* xcp, volatile X xv, volatile X* xvp) { int& i1 = xc.f(0); int& i2 = xcp->f(0); float& f1 = x.f(0); float& f2 = xp->f(0); xv.f(0); // expected-error{{no matching member function for call to 'f'}} xvp->f(0); // expected-error{{no matching member function for call to 'f'}} int& i3 = xc.g(0); int& i4 = xcp->g(0); float& f3 = x.g(0); float& f4 = xp->g(0); double& d1 = xp->g(0.0); double& d2 = X::g(0.0); X::g(0); // expected-error{{call to 'g' is ambiguous}} X::h(0); // expected-error{{call to non-static member function without an object argument}} } struct X1 { int& member(); float& member() const; }; struct X2 : X1 { }; void test_X2(X2 *x2p, const X2 *cx2p) { int &ir = x2p->member(); float &fr = cx2p->member(); } // Tests the exact text used to note the candidates namespace test1 { class A { template <class T> void foo(T t, unsigned N); // expected-note {{candidate function [with T = int] not viable: no known conversion from 'const char [6]' to 'unsigned int' for 2nd argument}} void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'const char [6]' to 'char' for 2nd argument}} void foo(int n, const char *s, int t); // expected-note {{candidate function not viable: requires 3 arguments, but 2 were provided}} void foo(int n, const char *s, int t, ...); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}} void foo(int n, const char *s, int t, int u = 0); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}} void bar(double d); //expected-note {{candidate function not viable: 'this' argument has type 'const test1::A', but method is not marked const}} void bar(int i); //expected-note {{candidate function not viable: 'this' argument has type 'const test1::A', but method is not marked const}} void baz(A &d); // expected-note {{candidate function not viable: 1st argument ('const test1::A') would lose const qualifier}} void baz(int i); // expected-note {{candidate function not viable: no known conversion from 'const test1::A' to 'int' for 1st argument}} // PR 11857 void foo(int n); // expected-note {{candidate function not viable: requires single argument 'n', but 2 arguments were provided}} void foo(unsigned n = 10); // expected-note {{candidate function not viable: allows at most single argument 'n', but 2 arguments were provided}} void rab(double n, int u = 0); // expected-note {{candidate function not viable: requires at least argument 'n', but no arguments were provided}} void rab(int n, int u = 0); // expected-note {{candidate function not viable: requires at least argument 'n', but no arguments were provided}} void zab(double n = 0.0, int u = 0); // expected-note {{candidate function not viable: requires at most 2 arguments, but 3 were provided}} void zab(int n = 0, int u = 0); // expected-note {{candidate function not viable: requires at most 2 arguments, but 3 were provided}} }; void test() { A a; a.foo(4, "hello"); //expected-error {{no matching member function for call to 'foo'}} const A b = A(); b.bar(0); //expected-error {{no matching member function for call to 'bar'}} a.baz(b); //expected-error {{no matching member function for call to 'baz'}} a.rab(); //expected-error {{no matching member function for call to 'rab'}} a.zab(3, 4, 5); //expected-error {{no matching member function for call to 'zab'}} } } namespace b7398190 { struct S { int f(); // expected-note {{'this' argument has type 'const b7398190::S', but method is not marked const}} void f(int); // expected-note {{requires 1 argument, but 0 were provided}} }; const S *p; int k = p->f(); // expected-error {{no matching member function for call to 'f'}} }
{ "pile_set_name": "Github" }
BEGIN:VCALENDAR VERSION:2.0 CALSCALE:GREGORIAN PRODID:-//calendarserver.org//Zonal//EN BEGIN:VTIMEZONE TZID:Etc/GMT-14 X-LIC-LOCATION:Etc/GMT-14 BEGIN:STANDARD DTSTART:18000101T140000 RDATE:18000101T140000 TZNAME:+14 TZOFFSETFROM:+1400 TZOFFSETTO:+1400 END:STANDARD END:VTIMEZONE END:VCALENDAR
{ "pile_set_name": "Github" }
package mage.cards.f; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; /** * * @author fireshoes */ public final class FloodedShoreline extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Islands"); static { filter.add(SubType.ISLAND.getPredicate()); } public FloodedShoreline(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{U}{U}"); // {U}{U}, Return two Islands you control to their owner's hand: Return target creature to its owner's hand. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{U}{U}")); ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2,2, filter, true))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } public FloodedShoreline(final FloodedShoreline card) { super(card); } @Override public FloodedShoreline copy() { return new FloodedShoreline(this); } }
{ "pile_set_name": "Github" }
-- boundary1.test -- -- db eval { -- SELECT a FROM t1 WHERE rowid > 16383 ORDER BY rowid DESC -- } SELECT a FROM t1 WHERE rowid > 16383 ORDER BY rowid DESC
{ "pile_set_name": "Github" }
#Wed Apr 10 15:27:10 PDT 2013 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
{ "pile_set_name": "Github" }
<?xml version='1.0' encoding='utf-8'?> <collection xmlns="https://code.dccouncil.us/schemas/dc-library" xmlns:codified="https://code.dccouncil.us/schemas/codified" xmlns:codify="https://code.dccouncil.us/schemas/codify" xmlns:xi="http://www.w3.org/2001/XInclude" name="46"> <heading>The 46th Congress</heading> <subheading>Public Laws</subheading> <xi:include href="./laws/public/46-3-ch27.xml"/> <xi:include href="./laws/public/46-2-ch235.xml"/> <xi:include href="./laws/public/46-2-ch121.xml"/> <xi:include href="./laws/public/46-1-ch16.xml"/> <subheading>Resolutions</subheading> <xi:include href="./resolutions/25.xml"/> </collection>
{ "pile_set_name": "Github" }
-- Copyright 2004-2020 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- -- Test for ALTER TABLE RENAME and ALTER VIEW RENAME CREATE TABLE TABLE1A(ID INT); > ok INSERT INTO TABLE1A VALUES (1); > update count: 1 -- ALTER TABLE RENAME ALTER TABLE TABLE1A RENAME TO TABLE1B; > ok SELECT * FROM TABLE1B; >> 1 ALTER TABLE IF EXISTS TABLE1B RENAME TO TABLE1C; > ok SELECT * FROM TABLE1C; >> 1 ALTER TABLE BAD RENAME TO SMTH; > exception TABLE_OR_VIEW_NOT_FOUND_1 ALTER TABLE IF EXISTS BAD RENAME TO SMTH; > ok -- ALTER VIEW RENAME CREATE VIEW VIEW1A AS SELECT * FROM TABLE1C; > ok ALTER VIEW VIEW1A RENAME TO VIEW1B; > ok SELECT * FROM VIEW1B; >> 1 ALTER TABLE IF EXISTS VIEW1B RENAME TO VIEW1C; > ok SELECT * FROM VIEW1C; >> 1 ALTER VIEW BAD RENAME TO SMTH; > exception VIEW_NOT_FOUND_1 ALTER VIEW IF EXISTS BAD RENAME TO SMTH; > ok SELECT * FROM VIEW1C; >> 1 DROP TABLE TABLE1C CASCADE; > ok
{ "pile_set_name": "Github" }
# Выпуск №98 11 декабря 2017: Декодинг картинок, анимация и авторизация в браузерах, Webpack или Parcel, устаревший GIF и всё, что вы хотели знать про Smashing Magazine. - Виталий Фридман - Вадим Макеев - Алексей Симоненко ## Содержание - 00:04:19 События - 00:23:16 Новинки браузеров - 00:53:28 Webpack или Parcel - 01:16:46 GIF устарел - 01:26:30 Smashing Magazine Слушайте: [Google Podcasts](https://podcasts.google.com/?feed=aHR0cHM6Ly93ZWItc3RhbmRhcmRzLnJ1L3BvZGNhc3QvZmVlZC8), [Apple Podcasts](https://podcasts.apple.com/podcast/id1080500016), [ВКонтакте](https://vk.com/podcasts-32017543), [Яндекс.Музыка](https://music.yandex.ru/album/6245956), [Spotify](https://open.spotify.com/show/3rzAcADjpBpXt73L0epTjV), [YouTube](https://www.youtube.com/playlist?list=PLMBnwIwFEFHcwuevhsNXkFTcadeX5R1Go), [SoundCloud](https://soundcloud.com/web-standards), [RSS](https://web-standards.ru/podcast/feed/). Читайте: [Твиттер](https://twitter.com/webstandards_ru), [ВКонтакте](https://vk.com/webstandards_ru), [Фейсбук](https://www.facebook.com/webstandardsru), [Телеграм](https://t.me/webstandards_ru). Поддержите: [Патреон](https://www.patreon.com/webstandards_ru), [Яндекс.Деньги](https://money.yandex.ru/to/41001119329753), [PayPal](https://www.paypal.me/pepelsbey). [Обсуждайте в Слаке](http://slack.web-standards.ru/). ## События - [HolyJS в Москве 10–11 декабря](https://holyjs-moscow.ru) - [Pitercss_meetup №17 в Питере 20 декабря](https://pitercss.timepad.ru/event/627086/) - [MinskJS Meetup 3 в Минске 25 января](http://minskjs.by/) - [WSD в Москве 3 февраля](https://wsd.events/2018/02/03/) - [Rolling Scopes в Минске 10–11 февраля](https://2018.conf.rollingscopes.com/) - [Smashing Conf](https://smashingconf.com/) ## Новинки браузеров - [Safari TP 45](https://webkit.org/blog/8039/release-notes-for-safari-technology-preview-45/) - [Chrome 63](https://developers.google.com/web/updates/2017/12/nic63) - [Intent to Ship: image decoding attribute](https://groups.google.com/a/chromium.org/d/msg/Blink-dev/MbXp16hQclY/bQjegyrbAgAJ) - [Chrome 65 adding Web Animations API implementation](https://twitter.com/dancwilson/status/938138635953692672) - [Intent to Ship: Web Authentication](https://groups.google.com/d/msg/mozilla.dev.platform/tsevyqfBHLE/lccldWNNBwAJ) ## Webpack или Parcel - [Webpack 4.0.0-alpha.0](https://github.com/webpack/webpack/issues/6064) - [Parcel](https://parceljs.org) ## GIF устарел - [Эволюция `<img>` Gif без формата GIF](https://habr.ru/p/343958/) - [Debugging Grid Layouts With Firefox Grid Inspector](https://www.smashingmagazine.com/2017/12/grid-inspector/) ## Smashing Magazine - [Илья Пухальский](https://twitter.com/pukhalski) - [Виталий Фридман](https://twitter.com/smashingmag)
{ "pile_set_name": "Github" }
#!/bin/sh ENABLED=yes PROCS=motion ARGS="" PREARGS="" DESC=$PROCS PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin . /opt/etc/init.d/rc.func
{ "pile_set_name": "Github" }
var SERVER = "http://127.0.0.1:8888/"; var messages = ''; var message_timer = undefined; var last_send = undefined; var blockingWebRequest = false; var block = []; var block_domains = []; var block_domains_except = []; var headers = {}; var overrideHosts = {}; var send_messages = function() { message_timer = undefined; last_send = performance.now(); message_headers = new Headers({ "Content-Type": "application/json", "Content-Length": messages.length.toString() }); fetch(SERVER + 'messages', {method: 'POST', headers: message_headers, body: messages}); messages = ''; }; var send_message = function(event, body = undefined) { message = {path: event} if (body !== undefined) message['body'] = body; messages += JSON.stringify(message) + "\n"; if (message_timer == undefined) { elapsed = 1000; if (last_send !== undefined) elapsed = performance.now() - last_send; if (elapsed > 500) { send_messages(); } else { delay = Math.max(1, Math.min(500 - elapsed, 500)); message_timer = setTimeout(send_messages, delay); } } }; browser.runtime.onMessage.addListener(data => { if (data.msg == 'longTask') { send_message('wptagent.longTask', {dur: data.dur, ts: performance.now()}); } }); var log = function(message) { message_headers = new Headers({ "Content-Type": "application/json", "Content-Length": message.length.toString() }); fetch(SERVER + 'log', {method: 'POST', headers: message_headers, body: message}); }; function get_domain(url) { var domain; if (url.indexOf("://") > -1) { domain = url.split('/')[2]; } else { domain = url.split('/')[0]; } domain = domain.split(':')[0]; domain = domain.split('?')[0]; return domain; } function blockRequest(details) { var ret = {cancel: false} if (!details.url.startsWith(SERVER)) { var domain = get_domain(details.url); for (var i = 0; i < block.length; i++) { if (details.url.indexOf(block[i]) !== -1) { ret.cancel = true; break; } } if (!ret.cancel && block_domains.length > 0) { for (var i = 0; i < block_domains.length; i++) { if (domain == block_domains[i]) { ret.cancel = true; break; } } } if (!ret.cancel && block_domains_except.length > 0) { if (!block_domains_except.includes(domain)) { ret.cancel = true; } } } return ret; } function addHeaders(details) { if (!details.url.startsWith(SERVER)) { for (name in headers) { for (var i = 0; i < details.requestHeaders.length; ++i) { if (details.requestHeaders[i].name === name) { details.requestHeaders.splice(i, 1); break; } } details.requestHeaders.push({'name': name, 'value': headers[name]}) } var url = new URL(details.url); for (host in overrideHosts) { if (host == url.hostname) { for (var i = 0; i < details.requestHeaders.length; ++i) { if (details.requestHeaders[i].name === 'Host') { details.requestHeaders.splice(i, 1); break; } } details.requestHeaders.push({'name': 'Host', 'value': overrideHosts[host]}) details.requestHeaders.push({'name': 'x-Host', 'value': host}) } } } return {requestHeaders: details.requestHeaders}; } var installBlockingHandler = function() { if (!blockingWebRequest) { blockingWebRequest = true; browser.webRequest.onBeforeRequest.addListener(blockRequest, {urls: ["<all_urls>"]}, ["blocking"]); browser.webRequest.onBeforeSendHeaders.addListener(addHeaders, {urls: ["<all_urls>"]}, ["blocking", "requestHeaders"]); } }; // Get the config from wptagent fetch(SERVER + 'config').then(function(response) { if (response.ok) { response.json().then(function(data) { if (data['block'] != undefined) { block = data['block']; } if (data['block_domains'] != undefined) { block_domains = data['block_domains']; } if (data['block_domains_except'] != undefined) { block_domains_except = data['block_domains_except']; } if (data['headers'] != undefined) { headers = data['headers']; } if (data['overrideHosts'] != undefined) { overrideHosts = data['overrideHosts']; } if (data['cookies'] != undefined) { for (var i = 0; i < data['cookies'].length; i++) { try { browser.cookies.set(data['cookies'][i]); } catch(e) { } } } if (block.length || block_domains.length || block_domains_except.length || Object.keys(headers).length || Object.keys(overrideHosts).length) { installBlockingHandler(); } // Let wptagent know we started send_message('wptagent.started', {ts: performance.now()}); }); } }); // Navigation handlers browser.webNavigation.onBeforeNavigate.addListener(details => { if (!details.url.startsWith(SERVER)) send_message('webNavigation.onBeforeNavigate', details); }, { url: [{schemes: ["http", "https"]}]} ); browser.webNavigation.onCommitted.addListener(details => { if (!details.url.startsWith(SERVER)) send_message('webNavigation.onCommitted', details); }, { url: [{schemes: ["http", "https"]}]} ); browser.webNavigation.onDOMContentLoaded.addListener(details => { if (!details.url.startsWith(SERVER)) send_message('webNavigation.onDOMContentLoaded', details); }, { url: [{schemes: ["http", "https"]}]} ); browser.webNavigation.onCompleted.addListener(details => { if (!details.url.startsWith(SERVER)) send_message('webNavigation.onCompleted', details); }, { url: [{schemes: ["http", "https"]}]} ); browser.webNavigation.onErrorOccurred.addListener(details => { if (!details.url.startsWith(SERVER)) send_message('webNavigation.onErrorOccurred', details); }, { url: [{schemes: ["http", "https"]}]} ); // Request handlers browser.webRequest.onBeforeRequest.addListener(details => { if (!details.url.startsWith(SERVER)) send_message('webRequest.onBeforeRequest', details); }, {urls: ["<all_urls>"]}); browser.webRequest.onSendHeaders.addListener(details => { if (!details.url.startsWith(SERVER)) send_message('webRequest.onSendHeaders', details); }, {urls: ["<all_urls>"]}, ["requestHeaders"]); browser.webRequest.onHeadersReceived.addListener(details => { if (!details.url.startsWith(SERVER)) send_message('webRequest.onHeadersReceived', details); }, {urls: ["<all_urls>"]}, ["responseHeaders"]); browser.webRequest.onResponseStarted.addListener(details => { if (!details.url.startsWith(SERVER)) send_message('webRequest.onResponseStarted', details); }, {urls: ["<all_urls>"]}, ["responseHeaders"]); browser.webRequest.onBeforeRedirect.addListener(details => { if (!details.url.startsWith(SERVER)) send_message('webRequest.onBeforeRedirect', details); }, {urls: ["<all_urls>"]}, ["responseHeaders"]); browser.webRequest.onCompleted.addListener(details => { if (!details.url.startsWith(SERVER)) send_message('webRequest.onCompleted', details); }, {urls: ["<all_urls>"]}, ["responseHeaders"]); browser.webRequest.onErrorOccurred.addListener(details => { if (!details.url.startsWith(SERVER)) send_message('webRequest.onErrorOccurred', details); }, {urls: ["<all_urls>"]});
{ "pile_set_name": "Github" }
DEFINED_PHASES=compile install DEPEND=|| ( >=app-text/stardict-2.4.2 app-text/sdcv app-text/goldendict ) gzip? ( app-arch/gzip app-text/dictd ) DESCRIPTION=Stardict Dictionary Simplified Chinese (GB) to English EAPI=6 HOMEPAGE=http://download.huzheng.org/zh_CN/ IUSE=gzip KEYWORDS=~amd64 ~arm ~ppc ~sparc ~x86 LICENSE=GPL-2 RESTRICT=strip SLOT=0 SRC_URI=mirror://sourceforge/stardict/stardict-cedict-gb-2.4.2.tar.bz2 _eclasses_=stardict 8d4771fbbd2a9aee09ef8040f10f28b3 _md5_=bbe34db76e352667489b6e289448bd24
{ "pile_set_name": "Github" }
{ "types": { "EIP712Domain": [ { "name": "name", "type": "string" }, { "name": "version", "type": "string" }, { "name": "chainId", "type": "uint256" }, { "name": "verifyingContract", "type": "address" } ], "Foo": [ { "name": "addys", "type": "address[]" }, { "name": "stringies", "type": "string[]" }, { "name": "inties", "type": "uint[]" } ] }, "primaryType": "Foo", "domain": { "name": "Lorem", "version": "1", "chainId": "1", "verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC" }, "message": { "addys": [ "0x0000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000003" ], "stringies": [ "lorem", "ipsum", "dolores" ], "inties": [ "0x0000000000000000000000000000000000000001", "3", 4.0 ] } }
{ "pile_set_name": "Github" }
#%RAML 1.0 # Objective: The following example shows how to set OAuth 2.0 properties. # Expected result: no error message # tags: security schemes, OAuth 2.0 title: Dropbox API version: 1 baseUri: https://api.dropbox.com/{version} securitySchemes: oauth_2_0: description: | Dropbox supports OAuth 2.0 for authenticating all API requests. type: OAuth 2.0 describedBy: headers: Authorization: description: | Used to send a valid OAuth 2 access token. Do not use with the "access_token" query string parameter. type: string queryParameters: access_token: description: | Used to send a valid OAuth 2 access token. Do not use with the "Authorization" header. type: string responses: 401: description: | Bad or expired token. This can happen if the user or Dropbox revoked or expired an access token. To fix, re-authenticate the user. 403: description: | Bad OAuth request (wrong consumer key, bad nonce, expired timestamp...). Unfortunately, re-authenticating the user won't help here. settings: authorizationUri: https://www.dropbox.com/1/oauth2/authorize accessTokenUri: https://api.dropbox.com/1/oauth2/token authorizationGrants: [ authorization_code, implicit, 'urn:ietf:params:oauth:grant-type:saml2-bearer' ]
{ "pile_set_name": "Github" }
package com.jeecms.cms.entity.main; import java.sql.Timestamp; import org.apache.commons.lang.StringUtils; import com.jeecms.cms.entity.main.base.BaseContentExt; public class ContentExt extends BaseContentExt { private static final long serialVersionUID = 1L; /** * 如果简短标题为空,则返回标题 * * @return */ public String getStitle() { if (!StringUtils.isBlank(getShortTitle())) { return getShortTitle(); } else { return getTitle(); } } public void init() { if (getReleaseDate() == null) { setReleaseDate(new Timestamp(System.currentTimeMillis())); } if (getBold() == null) { setBold(false); } if(getNeedRegenerate()==null){ setNeedRegenerate(true); } blankToNull(); } public void blankToNull() { if (StringUtils.isBlank(getShortTitle())) { setShortTitle(null); } if (StringUtils.isBlank(getAuthor())) { setAuthor(null); } if (StringUtils.isBlank(getOrigin())) { setOrigin(null); } if (StringUtils.isBlank(getOriginUrl())) { setOriginUrl(null); } if (StringUtils.isBlank(getDescription())) { setDescription(null); } if (StringUtils.isBlank(getTitleColor())) { setTitleColor(null); } if (StringUtils.isBlank(getTitleImg())) { setTitleImg(null); } if (StringUtils.isBlank(getContentImg())) { setContentImg(null); } if (StringUtils.isBlank(getTypeImg())) { setTypeImg(null); } if (StringUtils.isBlank(getLink())) { setLink(null); } if (StringUtils.isBlank(getTplContent())) { setTplContent(null); } if (StringUtils.isBlank(getMediaPath())) { setMediaPath(null); } if (StringUtils.isBlank(getMediaType())) { setMediaType(null); } } /* [CONSTRUCTOR MARKER BEGIN] */ public ContentExt () { super(); } /** * Constructor for primary key */ public ContentExt (java.lang.Integer id) { super(id); } /** * Constructor for required fields */ public ContentExt ( java.lang.Integer id, java.lang.String title, java.util.Date releaseDate, java.lang.Boolean bold, java.lang.Boolean needRegenerate) { super ( id, title, releaseDate, bold, needRegenerate); } /* [CONSTRUCTOR MARKER END] */ }
{ "pile_set_name": "Github" }
<?xml version="1.0" standalone="no" ?> <!DOCTYPE pov SYSTEM "/usr/share/cgc-docs/replay.dtd"> <pov> <cbid>service</cbid> <replay> <read><delim>\x0a</delim><match><data>2D Particle Simulator\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Enter the number of particles to simulate \x281-10\x29:\x0a</data></match></read> <write><data>9\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read> <write><data>156.56030,117.41608\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read> <write><data>0.87994,7.46642\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read> <write><data>7.71893\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read> <write><data>7.96228\x0a</data></write> <read><delim>\x0a</delim><match><data>Particle #1 added at (156.56030,117.41608) velocity(0.87994,7.46642) mass(7.71893) radius(7.96228).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read> <write><data>186.22030,113.94834\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read> <write><data>2.78437,7.26892\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read> <write><data>5.62715\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read> <write><data>6.08670\x0a</data></write> <read><delim>\x0a</delim><match><data>Particle #2 added at (186.22030,113.94834) velocity(2.78437,7.26892) mass(5.62715) radius(6.08670).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read> <write><data>193.51304,159.95880\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read> <write><data>5.50465,1.07406\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read> <write><data>2.03509\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read> <write><data>5.34471\x0a</data></write> <read><delim>\x0a</delim><match><data>Particle #3 added at (193.51304,159.95880) velocity(5.50465,1.07406) mass(2.03509) radius(5.34471).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read> <write><data>174.49197,109.89404\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read> <write><data>9.94075,6.86044\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read> <write><data>5.70468\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read> <write><data>2.07708\x0a</data></write> <read><delim>\x0a</delim><match><data>Particle #4 added at (174.49197,109.89404) velocity(9.94075,6.86044) mass(5.70468) radius(2.07708).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read> <write><data>173.35359,120.78006\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read> <write><data>8.28914,9.93472\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read> <write><data>9.93750\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read> <write><data>5.21090\x0a</data></write> <read><delim>\x0a</delim><match><data>Particle #5 added at (173.35359,120.78006) velocity(8.28914,9.93472) mass(9.93750) radius(5.21090).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read> <write><data>135.61800,157.65639\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read> <write><data>1.45387,6.50614\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read> <write><data>3.72796\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read> <write><data>9.98074\x0a</data></write> <read><delim>\x0a</delim><match><data>Particle #6 added at (135.61800,157.65639) velocity(1.45387,6.50614) mass(3.72796) radius(9.98074).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read> <write><data>185.47191,136.09655\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read> <write><data>7.41999,2.80527\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read> <write><data>2.16104\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read> <write><data>5.65310\x0a</data></write> <read><delim>\x0a</delim><match><data>Particle #7 added at (185.47191,136.09655) velocity(7.41999,2.80527) mass(2.16104) radius(5.65310).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read> <write><data>144.03408,140.28777\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read> <write><data>0.63228,5.42303\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read> <write><data>3.17363\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read> <write><data>5.31876\x0a</data></write> <read><delim>\x0a</delim><match><data>Particle #8 added at (144.03408,140.28777) velocity(0.63228,5.42303) mass(3.17363) radius(5.31876).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read> <write><data>184.85680,333.66219\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read> <write><data>31.25458,8.30947\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read> <write><data>83.59691\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read> <write><data>29.77169\x0a</data></write> <read><delim>\x0a</delim><match><data>Invalid simulation data. Try again.\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read> <write><data>357.78186,222.91595\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read> <write><data>18.14453,4.39926\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read> <write><data>44.58561\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read> <write><data>76.93714\x0a</data></write> <read><delim>\x0a</delim><match><data>Invalid simulation data. Try again.\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read> <write><data>122.91810,146.16639\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read> <write><data>8.74640,7.85671\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read> <write><data>9.59354\x0a</data></write> <read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read> <write><data>6.20361\x0a</data></write> <read><delim>\x0a</delim><match><data>Particle #9 added at (122.91810,146.16639) velocity(8.74640,7.85671) mass(9.59354) radius(6.20361).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Running simulation with...\x0a</data></match></read> <read><delim>\x0a</delim><match><data>9 total particles:\x0a</data></match></read> <read><delim>\x0a</delim><match><data>0: Position (156.56000,117.41000) Velocity (0.87000,7.46000) mass (7.71000) radius (7.96000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>1: Position (186.22000,113.94000) Velocity (2.78000,7.26000) mass (5.62000) radius (6.08000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>2: Position (193.51000,159.95000) Velocity (5.50000,1.07000) mass (2.03000) radius (5.34000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>3: Position (174.49000,109.89000) Velocity (9.94000,6.86000) mass (5.70000) radius (2.07000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>4: Position (173.35000,120.78000) Velocity (8.28000,9.93000) mass (9.93000) radius (5.21000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>5: Position (135.61000,157.65000) Velocity (1.45000,6.50000) mass (3.72000) radius (9.98000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>6: Position (185.47000,136.09000) Velocity (7.41000,2.80000) mass (2.16000) radius (5.65000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>7: Position (144.03000,140.28000) Velocity (0.63000,5.42000) mass (3.17000) radius (5.31000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>8: Position (122.91000,146.16000) Velocity (8.74000,7.85000) mass (9.59000) radius (6.20000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>--------------------\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000001000000000010\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00001000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000100000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000100\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000100000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000100000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000100\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000100000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>--------------------\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Simulation complete, 26 collisions simulated over 10 seconds in 80 frames.\x0a</data></match></read> <read><delim>\x0a</delim><match><data>9 total particles:\x0a</data></match></read> <read><delim>\x0a</delim><match><data>0: Position (162.59618,124.76035) Velocity (-5.23438,-3.19364) mass (7.71000) radius (7.96000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>1: Position (183.04450,164.46004) Velocity (-1.12057,2.83332) mass (5.62000) radius (6.08000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>2: Position (115.59444,123.99360) Velocity (-1.28757,4.13917) mass (2.03000) radius (5.34000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>3: Position (172.57056,119.49517) Velocity (1.49653,-3.52875) mass (5.70000) radius (2.07000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>4: Position (170.30794,166.19666) Velocity (-1.40597,0.35842) mass (9.93000) radius (5.21000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>5: Position (133.05209,168.73314) Velocity (13.04400,-5.13575) mass (3.72000) radius (9.98000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>6: Position (168.84725,180.03533) Velocity (-12.95917,5.99709) mass (2.16000) radius (5.65000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>7: Position (123.50156,136.28106) Velocity (6.10468,28.86559) mass (3.17000) radius (5.31000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>8: Position (107.71347,152.03382) Velocity (-5.95988,-5.51458) mass (9.59000) radius (6.20000).\x0a</data></match></read> <read><delim>\x0a</delim><match><data>--------------------\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000001000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000010000000100000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000001000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>01000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00001000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00010000000010000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000100000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read> <read><delim>\x0a</delim><match><data>--------------------\x0a</data></match></read> <read><delim>\x0a</delim><match><data>Goodbye\x0a</data></match></read> </replay> </pov>
{ "pile_set_name": "Github" }
<system> <name>KOI-5249</name> <rightascension>19 26 01</rightascension> <declination>+41 33 01</declination> <distance>1114.45</distance> <star> <name>KOI-5249</name> <temperature errorminus="282.00" errorplus="282.00">6372.00</temperature> <radius errorminus="0.6350" errorplus="0.6350">1.0150</radius> <metallicity errorminus="0.3400" errorplus="0.3400">-0.3200</metallicity> <planet> <name>KOI-5249 b</name> <name>KOI-5249 01</name> <radius errorminus="0.08976" errorplus="0.08976">0.12694</radius> <period errorminus="2.3320000e-04" errorplus="2.3320000e-04">19.453211300000</period> <transittime errorminus="0.0106000" errorplus="0.0106000">2454972.3448000</transittime> <semimajoraxis errorminus="1.16e-06" errorplus="1.16e-06">0.1446560</semimajoraxis> <temperature errorminus="235.0" errorplus="235.0">745.0</temperature> <list>Kepler Objects of Interest</list> <description>This is a Kepler Object of Interest from the Q1-Q12 dataset. It has been flagged as a possible transit event but has not been confirmed to be a planet yet.</description> <istransiting>1</istransiting> </planet> </star> </system>
{ "pile_set_name": "Github" }
1 122 161 232 392 692 810 1110
{ "pile_set_name": "Github" }
# # service: simple wrapper around start-stop-daemon # # Usage: service ACTION EXEC ARGS... # # Action: # -C check if EXEC is alive # -S start EXEC, passing it ARGS as its arguments # -K kill EXEC, sending it a TERM signal if not specified otherwise # # Environment variables exposed: # SERVICE_DAEMONIZE run EXEC in background # SERVICE_WRITE_PID create a pid-file and use it for matching # SERVICE_MATCH_EXEC use EXEC command-line for matching (default) # SERVICE_MATCH_NAME use EXEC process name for matching # SERVICE_USE_PID assume EXEC create its own pid-file and use it for matching # SERVICE_NAME process name to use (default to EXEC file part) # SERVICE_PID_FILE pid file to use (default to /var/run/$SERVICE_NAME.pid) # SERVICE_SIG signal to send when using -K # SERVICE_SIG_RELOAD default signal used when reloading # SERVICE_SIG_STOP default signal used when stopping # SERVICE_STOP_TIME time to wait for a process to stop gracefully before killing it # SERVICE_UID user EXEC should be run as # SERVICE_GID group EXEC should be run as # # SERVICE_DEBUG don't do anything, but show what would be done # SERVICE_QUIET don't print anything # SERVICE_QUIET=1 SERVICE_SIG_RELOAD="HUP" SERVICE_SIG_STOP="TERM" SERVICE_STOP_TIME=5 SERVICE_MATCH_EXEC=1 service() { local ssd local exec local name local start ssd="${SERVICE_DEBUG:+echo }start-stop-daemon${SERVICE_QUIET:+ -q}" case "$1" in -C) ssd="$ssd -K -t" ;; -S) ssd="$ssd -S${SERVICE_DAEMONIZE:+ -b}${SERVICE_WRITE_PID:+ -m}" start=1 ;; -K) ssd="$ssd -K${SERVICE_SIG:+ -s $SERVICE_SIG}" ;; *) echo "service: unknown ACTION '$1'" 1>&2 return 1 esac shift exec="$1" [ -n "$exec" ] || { echo "service: missing argument" 1>&2 return 1 } [ -x "$exec" ] || { echo "service: file '$exec' is not executable" 1>&2 return 1 } name="${SERVICE_NAME:-${exec##*/}}" [ -z "$SERVICE_USE_PID$SERVICE_WRITE_PID$SERVICE_PID_FILE" ] \ || ssd="$ssd -p ${SERVICE_PID_FILE:-/var/run/$name.pid}" [ -z "$SERVICE_MATCH_NAME" ] || ssd="$ssd -n $name" ssd="$ssd${SERVICE_UID:+ -c $SERVICE_UID${SERVICE_GID:+:$SERVICE_GID}}" [ -z "$SERVICE_MATCH_EXEC$start" ] || ssd="$ssd -x $exec" shift $ssd${1:+ -- "$@"} } service_check() { service -C "$@" } service_signal() { SERVICE_SIG="${SERVICE_SIG:-USR1}" service -K "$@" } service_start() { service -S "$@" } service_stop() { local try SERVICE_SIG="${SERVICE_SIG:-$SERVICE_SIG_STOP}" service -K "$@" || return 1 while [ $((try++)) -lt $SERVICE_STOP_TIME ]; do service -C "$@" || return 0 sleep 1 done SERVICE_SIG="KILL" service -K "$@" sleep 1 ! service -C "$@" } service_reload() { SERVICE_SIG="${SERVICE_SIG:-$SERVICE_SIG_RELOAD}" service -K "$@" }
{ "pile_set_name": "Github" }
var baseGet = require('./_baseGet'); /** * A specialized version of `baseProperty` which supports deep paths. * * @private * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function(object) { return baseGet(object, path); }; } module.exports = basePropertyDeep;
{ "pile_set_name": "Github" }
#ifndef _DELTA_INFER_CUSTOM_OPS_ALLOC_H_ #define _DELTA_INFER_CUSTOM_OPS_ALLOC_H_ #include <cstring> #include "delta_infer/custom_ops/ops_utils.h" namespace tensorflow { template <typename Device, typename T> class DeltaAlloc { public: T* malloc(size_t size) const { return nullptr; } void free(T* ptr) const {} }; #ifdef WITH_CUDA template <typename T> class DeltaAlloc<GPUDevice, T> { public: T* malloc(size_t size, OpKernelContext* context = nullptr) const { T* ptr = nullptr; // int curr_device = 0; // cuda(GetDevice(&curr_device)); // printf("gpu alloc size %d (%d)\n", size, sizeof(T)); cuda(Malloc(&ptr, size * sizeof(T))); return ptr; } void free(T* ptr) const { cuda(Free(ptr)); } }; #endif template <typename T> class DeltaAlloc<CPUDevice, T> { public: DeltaAlloc() {} T* malloc(size_t size, OpKernelContext* context = nullptr) const { Tensor buf; long long int buf_size = (long long int)size * sizeof(T); tensorflow::Status status = context->allocate_temp(DT_UINT8, TensorShape{buf_size}, &buf); if (status != tensorflow::Status::OK()) throw std::runtime_error("TF error: context->allocate_temp failed"); auto flat = buf.flat<T>(); T* ptr = (T*)flat.data(); return ptr; } void free(T* ptr) const { printf("[DeltaFree] call from DeltaAlloc<CPUDevice, T> free\n"); } }; template <typename Device, typename T> class TransformerParam; template <typename Device, typename T> class TransformerNLPParam; template <typename Device, typename T, typename D = void> struct CopyToHost { void operator()(T* dst, const T* src, size_t size) {} }; template <typename Device, typename T, typename D = void> struct CopyToDevice { void operator()(T* dst, const T* src, size_t size) {} }; #ifdef WITH_CUDA template <typename T, typename D> struct CopyToHost<GPUDevice, T, D> { void operator()(T* dst, const T* src, size_t size) { cuda(Memcpy(dst, src, size * sizeof(T), cudaMemcpyDeviceToHost)); } void async(T* dst, const T* src, size_t size, TransformerParam<GPUDevice, D>& param) { cuda(MemcpyAsync(dst, src, size * sizeof(T), cudaMemcpyDeviceToHost, param.stream)); } void async(T* dst, const T* src, size_t size, TransformerNLPParam<GPUDevice, D>& param) { cuda(MemcpyAsync(dst, src, size * sizeof(T), cudaMemcpyDeviceToHost, param.stream)); } void async(T* dst, const T* src, size_t size, TransformerNLPParam<CPUDevice, D>& param) {} }; template <typename T, typename D> struct CopyToDevice<GPUDevice, T, D> { void operator()(T* dst, const T* src, size_t size) { cuda(Memcpy(dst, src, size * sizeof(T), cudaMemcpyDeviceToDevice)); } void async(T* dst, const T* src, size_t size, TransformerNLPParam<GPUDevice, D>& param) { cuda(MemcpyAsync(dst, src, size * sizeof(T), cudaMemcpyDeviceToDevice, param.stream)); } }; #endif template <typename T, typename D> struct CopyToHost<CPUDevice, T, D> { void operator()(T* dst, const T* src, size_t size) { std::memcpy(dst, src, size * sizeof(T)); } void async(T* dst, const T* src, size_t size, TransformerParam<CPUDevice, D>& param) { std::memcpy(dst, src, size * sizeof(T)); } }; template <typename Device, typename T> double CheckSum(const T* data, size_t len = 1) { cuda(DeviceSynchronize()); double sum = 0.0f; T* sum_buf = new T[len]; CopyToHost<Device, T> cpy; cpy(sum_buf, data, len); for (int i = 0; i < len; i++) { sum += sum_buf[i]; } return sum; } template <typename Device, typename T> void CheckElts(const T* data, const char* preffix, size_t len = 12) { cuda(DeviceSynchronize()); T* sum_buf = new T[len]; CopyToHost<Device, T> cpy; cpy(sum_buf, data, len); fprintf(stdout, "Check (%d)Elt of %s :", len, preffix); for (int i = 0; i < len; i++) { fprintf(stdout, "%f ", sum_buf[i]); } fprintf(stdout, "\n"); fflush(stdout); } } /* namespace tensorflow */ #endif
{ "pile_set_name": "Github" }
# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=6 DESCRIPTION="A simple, object-oriented, PHP Redmine API client" HOMEPAGE="https://github.com/kbsali/php-redmine-api" SRC_URI="https://github.com/kbsali/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" LICENSE="MIT" SLOT="0" KEYWORDS="amd64 x86" IUSE="test" RESTRICT="!test? ( test )" RDEPEND="dev-lang/php:*[curl,json,simplexml]" DEPEND="test? ( ${RDEPEND} <dev-php/phpunit-6 )" src_install() { insinto "/usr/share/php/${PN}" doins -r lib dodoc example.php README.markdown } src_test() { phpunit || die "test suite failed" } pkg_postinst() { elog "${PN} has been installed in /usr/share/php/${PN}/." elog "To use it in a script, require('${PN}/lib/autoload.php'), and then" elog "use the Redmine\\Client class normally. Most of the examples in the" elog "documentation should work without modification." }
{ "pile_set_name": "Github" }
<div id="container"> <div id="middle"> <div id="content">I</div> </div> </div> #parent { display: table; } #middle { display: table-cell; vertical-align: bottom; } #child { font-size: 30px; height: 30px; text-align: center; }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <Module name="ProcessOptions_Target" id="285"> <Interfaces> <Interface provider="0x01011055" id='0x01010031'/> </Interfaces> <Dependencies> <Local>Mcl_NtElevation</Local> </Dependencies> <Lp>Yes</Lp> <Target>Yes</Target> <Architecture type="i386"> <Platform family="winnt"> <Version other="*" minor="*" major="*"> <File loadtype="file">i386-winnt-vc9s/release/ProcessOptions_Target.dll</File> <File loadtype="memory">i386-winnt-vc9s/release/ProcessOptions_Target.dll</File> </Version> </Platform> </Architecture> <Architecture type="x64"> <Platform family="winnt"> <Version other="*" minor="*" major="*"> <File loadtype="file">x64-winnt-vc9s/release/ProcessOptions_Target.dll</File> <File loadtype="memory">x64-winnt-vc9s/release/ProcessOptions_Target.dll</File> </Version> </Platform> </Architecture> </Module>
{ "pile_set_name": "Github" }
#include <core.p4> #define V1MODEL_VERSION 20180101 #include <v1model.p4> header Ethernet { bit<48> src; bit<48> dst; bit<16> type; } struct parsed_packet_t { Ethernet eth; } struct local_metadata_t { } parser parse(packet_in pk, out parsed_packet_t hdr, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { state start { pk.extract<Ethernet>(hdr.eth); transition accept; } } control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { @hidden action parser_errorbmv2l30() { hdr.eth.setValid(); hdr.eth.type = 16w0; hdr.eth.src = 48w0; hdr.eth.dst = 48w0; } @hidden action parser_errorbmv2l35() { standard_metadata.egress_spec = 9w0; } @hidden table tbl_parser_errorbmv2l30 { actions = { parser_errorbmv2l30(); } const default_action = parser_errorbmv2l30(); } @hidden table tbl_parser_errorbmv2l35 { actions = { parser_errorbmv2l35(); } const default_action = parser_errorbmv2l35(); } apply { if (standard_metadata.parser_error == error.PacketTooShort) { tbl_parser_errorbmv2l30.apply(); } tbl_parser_errorbmv2l35.apply(); } } control egress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { apply { } } control deparser(packet_out b, in parsed_packet_t hdr) { apply { b.emit<Ethernet>(hdr.eth); } } control verify_checks(inout parsed_packet_t hdr, inout local_metadata_t local_metadata) { apply { } } control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local_metadata) { apply { } } V1Switch<parsed_packet_t, local_metadata_t>(parse(), verify_checks(), ingress(), egress(), compute_checksum(), deparser()) main;
{ "pile_set_name": "Github" }
--TEST-- Test object compare when object handler different --FILE-- <?php //Set the default time zone date_default_timezone_set("Europe/London"); echo "Simple test comparing two objects with different compare callback handler\n"; class X { } $obj1 = new X(); $obj2 = new DateTime(("2009-02-12 12:47:41 GMT")); var_dump($obj1 == $obj2); ?> ===DONE=== --EXPECTF-- Simple test comparing two objects with different compare callback handler bool(false) ===DONE===
{ "pile_set_name": "Github" }
#!/usr/bin/env sh ############################################################################## ## ## Gradle start up script for UN*X ## ############################################################################## # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. 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 SAVED="`pwd`" cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS="" # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" warn ( ) { echo "$*" } die ( ) { echo echo "$*" echo exit 1 } # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false case "`uname`" in CYGWIN* ) cygwin=true ;; Darwin* ) darwin=true ;; MINGW* ) msys=true ;; NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi # Increase the maximum file descriptors if we can. if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then MAX_FD="$MAX_FD_LIMIT" fi ulimit -n $MAX_FD if [ $? -ne 0 ] ; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi else warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" fi fi # For Darwin, add options to specify how the application appears in the dock if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin, switch paths to Windows format before running java if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` SEP="" for dir in $ROOTDIRSRAW ; do ROOTDIRS="$ROOTDIRS$SEP$dir" SEP="|" done OURCYGPATTERN="(^($ROOTDIRS))" # Add a user-defined pattern to the cygpath arguments if [ "$GRADLE_CYGPATTERN" != "" ] ; then OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" fi # Now convert the arguments - kludge to limit ourselves to /bin/sh i=0 for arg in "$@" ; do CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` else eval `echo args$i`="\"$arg\"" fi i=$((i+1)) done case $i in (0) set -- ;; (1) set -- "$args0" ;; (2) set -- "$args0" "$args1" ;; (3) set -- "$args0" "$args1" "$args2" ;; (4) set -- "$args0" "$args1" "$args2" "$args3" ;; (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi # Escape application args save ( ) { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } APP_ARGS=$(save "$@") # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then cd "$(dirname "$0")" fi exec "$JAVACMD" "$@"
{ "pile_set_name": "Github" }
#!/usr/bin/env sh ############################################################################## ## ## Gradle start up script for UN*X ## ############################################################################## # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. 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 SAVED="`pwd`" cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS="" # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" warn ( ) { echo "$*" } die ( ) { echo echo "$*" echo exit 1 } # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false case "`uname`" in CYGWIN* ) cygwin=true ;; Darwin* ) darwin=true ;; MINGW* ) msys=true ;; NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi # Increase the maximum file descriptors if we can. if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then MAX_FD="$MAX_FD_LIMIT" fi ulimit -n $MAX_FD if [ $? -ne 0 ] ; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi else warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" fi fi # For Darwin, add options to specify how the application appears in the dock if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin, switch paths to Windows format before running java if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` SEP="" for dir in $ROOTDIRSRAW ; do ROOTDIRS="$ROOTDIRS$SEP$dir" SEP="|" done OURCYGPATTERN="(^($ROOTDIRS))" # Add a user-defined pattern to the cygpath arguments if [ "$GRADLE_CYGPATTERN" != "" ] ; then OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" fi # Now convert the arguments - kludge to limit ourselves to /bin/sh i=0 for arg in "$@" ; do CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` else eval `echo args$i`="\"$arg\"" fi i=$((i+1)) done case $i in (0) set -- ;; (1) set -- "$args0" ;; (2) set -- "$args0" "$args1" ;; (3) set -- "$args0" "$args1" "$args2" ;; (4) set -- "$args0" "$args1" "$args2" "$args3" ;; (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi # Escape application args save ( ) { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } APP_ARGS=$(save "$@") # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then cd "$(dirname "$0")" fi exec "$JAVACMD" "$@"
{ "pile_set_name": "Github" }
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using NuGet.Packaging.Core; using NuGet.Versioning; namespace NuGet.PackageManagement.VisualStudio { /// <summary> /// Common package queries implementes as extension methods /// </summary> public static class PackageCollectionExtensions { public static NuGetVersion[] GetPackageVersions(this IEnumerable<PackageIdentity> packages, string packageId) { return packages .Where(p => StringComparer.OrdinalIgnoreCase.Equals(p.Id, packageId)) .Select(p => p.Version) .ToArray(); } public static IEnumerable<IGrouping<string, NuGetVersion>> GroupById(this IEnumerable<PackageIdentity> packages) { return packages .GroupBy(p => p.Id, p => p.Version, StringComparer.OrdinalIgnoreCase); } public static PackageIdentity[] GetLatest(this IEnumerable<PackageIdentity> packages) { return packages .GroupById() .Select(g => new PackageIdentity(g.Key, g.MaxOrDefault())) .ToArray(); } public static PackageIdentity[] GetEarliest(this IEnumerable<PackageIdentity> packages) { return packages .GroupById() .Select(g => new PackageIdentity(g.Key, g.MinOrDefault())) .ToArray(); } /// <summary> /// True if any package reference is AutoReferenced=true. /// </summary> public static bool IsAutoReferenced(this IEnumerable<PackageCollectionItem> packages, string id) { return packages.Where(e => StringComparer.OrdinalIgnoreCase.Equals(id, e.Id)) .Any(e => e.IsAutoReferenced()); } } }
{ "pile_set_name": "Github" }
// // Generated by Bluespec Compiler, version 2019.05.beta2 (build a88bf40db, 2019-05-24) // // // // // Ports: // Name I/O size props // m_near_mem_io_addr_base O 64 const // m_near_mem_io_addr_size O 64 const // m_near_mem_io_addr_lim O 64 const // m_plic_addr_base O 64 const // m_plic_addr_size O 64 const // m_plic_addr_lim O 64 const // m_uart0_addr_base O 64 const // m_uart0_addr_size O 64 const // m_uart0_addr_lim O 64 const // m_boot_rom_addr_base O 64 const // m_boot_rom_addr_size O 64 const // m_boot_rom_addr_lim O 64 const // m_mem0_controller_addr_base O 64 const // m_mem0_controller_addr_size O 64 const // m_mem0_controller_addr_lim O 64 const // m_tcm_addr_base O 64 const // m_tcm_addr_size O 64 const // m_tcm_addr_lim O 64 const // m_is_mem_addr O 1 // m_is_IO_addr O 1 // m_is_near_mem_IO_addr O 1 // m_pc_reset_value O 64 const // m_mtvec_reset_value O 64 const // m_nmivec_reset_value O 64 const // CLK I 1 unused // RST_N I 1 unused // m_is_mem_addr_addr I 64 // m_is_IO_addr_addr I 64 // m_is_near_mem_IO_addr_addr I 64 // // Combinational paths from inputs to outputs: // m_is_mem_addr_addr -> m_is_mem_addr // m_is_IO_addr_addr -> m_is_IO_addr // m_is_near_mem_IO_addr_addr -> m_is_near_mem_IO_addr // // `ifdef BSV_ASSIGNMENT_DELAY `else `define BSV_ASSIGNMENT_DELAY `endif `ifdef BSV_POSITIVE_RESET `define BSV_RESET_VALUE 1'b1 `define BSV_RESET_EDGE posedge `else `define BSV_RESET_VALUE 1'b0 `define BSV_RESET_EDGE negedge `endif module mkSoC_Map(CLK, RST_N, m_near_mem_io_addr_base, m_near_mem_io_addr_size, m_near_mem_io_addr_lim, m_plic_addr_base, m_plic_addr_size, m_plic_addr_lim, m_uart0_addr_base, m_uart0_addr_size, m_uart0_addr_lim, m_boot_rom_addr_base, m_boot_rom_addr_size, m_boot_rom_addr_lim, m_mem0_controller_addr_base, m_mem0_controller_addr_size, m_mem0_controller_addr_lim, m_tcm_addr_base, m_tcm_addr_size, m_tcm_addr_lim, m_is_mem_addr_addr, m_is_mem_addr, m_is_IO_addr_addr, m_is_IO_addr, m_is_near_mem_IO_addr_addr, m_is_near_mem_IO_addr, m_pc_reset_value, m_mtvec_reset_value, m_nmivec_reset_value); input CLK; input RST_N; // value method m_near_mem_io_addr_base output [63 : 0] m_near_mem_io_addr_base; // value method m_near_mem_io_addr_size output [63 : 0] m_near_mem_io_addr_size; // value method m_near_mem_io_addr_lim output [63 : 0] m_near_mem_io_addr_lim; // value method m_plic_addr_base output [63 : 0] m_plic_addr_base; // value method m_plic_addr_size output [63 : 0] m_plic_addr_size; // value method m_plic_addr_lim output [63 : 0] m_plic_addr_lim; // value method m_uart0_addr_base output [63 : 0] m_uart0_addr_base; // value method m_uart0_addr_size output [63 : 0] m_uart0_addr_size; // value method m_uart0_addr_lim output [63 : 0] m_uart0_addr_lim; // value method m_boot_rom_addr_base output [63 : 0] m_boot_rom_addr_base; // value method m_boot_rom_addr_size output [63 : 0] m_boot_rom_addr_size; // value method m_boot_rom_addr_lim output [63 : 0] m_boot_rom_addr_lim; // value method m_mem0_controller_addr_base output [63 : 0] m_mem0_controller_addr_base; // value method m_mem0_controller_addr_size output [63 : 0] m_mem0_controller_addr_size; // value method m_mem0_controller_addr_lim output [63 : 0] m_mem0_controller_addr_lim; // value method m_tcm_addr_base output [63 : 0] m_tcm_addr_base; // value method m_tcm_addr_size output [63 : 0] m_tcm_addr_size; // value method m_tcm_addr_lim output [63 : 0] m_tcm_addr_lim; // value method m_is_mem_addr input [63 : 0] m_is_mem_addr_addr; output m_is_mem_addr; // value method m_is_IO_addr input [63 : 0] m_is_IO_addr_addr; output m_is_IO_addr; // value method m_is_near_mem_IO_addr input [63 : 0] m_is_near_mem_IO_addr_addr; output m_is_near_mem_IO_addr; // value method m_pc_reset_value output [63 : 0] m_pc_reset_value; // value method m_mtvec_reset_value output [63 : 0] m_mtvec_reset_value; // value method m_nmivec_reset_value output [63 : 0] m_nmivec_reset_value; // signals for module outputs wire [63 : 0] m_boot_rom_addr_base, m_boot_rom_addr_lim, m_boot_rom_addr_size, m_mem0_controller_addr_base, m_mem0_controller_addr_lim, m_mem0_controller_addr_size, m_mtvec_reset_value, m_near_mem_io_addr_base, m_near_mem_io_addr_lim, m_near_mem_io_addr_size, m_nmivec_reset_value, m_pc_reset_value, m_plic_addr_base, m_plic_addr_lim, m_plic_addr_size, m_tcm_addr_base, m_tcm_addr_lim, m_tcm_addr_size, m_uart0_addr_base, m_uart0_addr_lim, m_uart0_addr_size; wire m_is_IO_addr, m_is_mem_addr, m_is_near_mem_IO_addr; // value method m_near_mem_io_addr_base assign m_near_mem_io_addr_base = 64'h0000000002000000 ; // value method m_near_mem_io_addr_size assign m_near_mem_io_addr_size = 64'h000000000000C000 ; // value method m_near_mem_io_addr_lim assign m_near_mem_io_addr_lim = 64'd33603584 ; // value method m_plic_addr_base assign m_plic_addr_base = 64'h000000000C000000 ; // value method m_plic_addr_size assign m_plic_addr_size = 64'h0000000000400000 ; // value method m_plic_addr_lim assign m_plic_addr_lim = 64'd205520896 ; // value method m_uart0_addr_base assign m_uart0_addr_base = 64'h00000000C0000000 ; // value method m_uart0_addr_size assign m_uart0_addr_size = 64'h0000000000000080 ; // value method m_uart0_addr_lim assign m_uart0_addr_lim = 64'h00000000C0000080 ; // value method m_boot_rom_addr_base assign m_boot_rom_addr_base = 64'h0000000000001000 ; // value method m_boot_rom_addr_size assign m_boot_rom_addr_size = 64'h0000000000001000 ; // value method m_boot_rom_addr_lim assign m_boot_rom_addr_lim = 64'd8192 ; // value method m_mem0_controller_addr_base assign m_mem0_controller_addr_base = 64'h0000000080000000 ; // value method m_mem0_controller_addr_size assign m_mem0_controller_addr_size = 64'h0000000010000000 ; // value method m_mem0_controller_addr_lim assign m_mem0_controller_addr_lim = 64'h0000000090000000 ; // value method m_tcm_addr_base assign m_tcm_addr_base = 64'h0 ; // value method m_tcm_addr_size assign m_tcm_addr_size = 64'd0 ; // value method m_tcm_addr_lim assign m_tcm_addr_lim = 64'd0 ; // value method m_is_mem_addr assign m_is_mem_addr = m_is_mem_addr_addr >= 64'h0000000000001000 && m_is_mem_addr_addr < 64'd8192 || m_is_mem_addr_addr >= 64'h0000000080000000 && m_is_mem_addr_addr < 64'h0000000090000000 ; // value method m_is_IO_addr assign m_is_IO_addr = m_is_IO_addr_addr >= 64'h0000000002000000 && m_is_IO_addr_addr < 64'd33603584 || m_is_IO_addr_addr >= 64'h000000000C000000 && m_is_IO_addr_addr < 64'd205520896 || m_is_IO_addr_addr >= 64'h00000000C0000000 && m_is_IO_addr_addr < 64'h00000000C0000080 ; // value method m_is_near_mem_IO_addr assign m_is_near_mem_IO_addr = m_is_near_mem_IO_addr_addr >= 64'h0000000002000000 && m_is_near_mem_IO_addr_addr < 64'd33603584 ; // value method m_pc_reset_value assign m_pc_reset_value = 64'h0000000000001000 ; // value method m_mtvec_reset_value assign m_mtvec_reset_value = 64'h0000000000001000 ; // value method m_nmivec_reset_value assign m_nmivec_reset_value = 64'hAAAAAAAAAAAAAAAA ; endmodule // mkSoC_Map
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright 2017 Bstek * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. ******************************************************************************/ package com.bstek.ureport.expression.model.expr; import java.util.ArrayList; import java.util.List; import com.bstek.ureport.build.Context; import com.bstek.ureport.expression.model.Condition; import com.bstek.ureport.expression.model.Expression; import com.bstek.ureport.expression.model.data.ExpressionData; import com.bstek.ureport.model.Cell; /** * @author Jacky.gao * @since 2016年11月18日 */ public abstract class BaseExpression implements Expression{ private static final long serialVersionUID = 3853234856946931008L; protected String expr; @Override public final ExpressionData<?> execute(Cell cell,Cell currentCell, Context context) { ExpressionData<?> data=compute(cell,currentCell,context); return data; } protected abstract ExpressionData<?> compute(Cell cell,Cell currentCell, Context context); protected List<Cell> filterCells(Cell cell,Context context,Condition condition,List<Cell> targetCells) { if(condition==null){ return targetCells; } List<Cell> list=new ArrayList<Cell>(); for(Cell targetCell:targetCells){ boolean conditionResult=true; List<Object> dataList=targetCell.getBindData(); if(dataList==null){ conditionResult=false; }else{ for(Object obj:dataList){ boolean result=condition.filter(cell,targetCell, obj, context); if(!result){ conditionResult=false; break; } } } if(!conditionResult){ continue; } list.add(targetCell); } return list; } public void setExpr(String expr) { this.expr = expr; } public String getExpr() { return expr; } }
{ "pile_set_name": "Github" }
/* Copyright 2017 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package stats import ( "expvar" "testing" ) func clear() { defaultVarGroup.vars = make(map[string]expvar.Var) defaultVarGroup.newVarHook = nil } func TestNoHook(t *testing.T) { clear() v := NewCounter("plainint", "help") v.Add(1) if v.String() != "1" { t.Errorf("want 1, got %s", v.String()) } } func TestFloat(t *testing.T) { var gotname string var gotv *Float clear() Register(func(name string, v expvar.Var) { gotname = name gotv = v.(*Float) }) v := NewFloat("Float") if gotname != "Float" { t.Errorf("want Float, got %s", gotname) } if gotv != v { t.Errorf("want %#v, got %#v", v, gotv) } v.Set(5.1) if v.Get() != 5.1 { t.Errorf("want 5.1, got %v", v.Get()) } v.Add(1.0) if v.Get() != 6.1 { t.Errorf("want 6.1, got %v", v.Get()) } if v.String() != "6.1" { t.Errorf("want 6.1, got %v", v.Get()) } f := FloatFunc(func() float64 { return 1.234 }) if f.String() != "1.234" { t.Errorf("want 1.234, got %v", f.String()) } } func TestString(t *testing.T) { var gotname string var gotv *String clear() Register(func(name string, v expvar.Var) { gotname = name gotv = v.(*String) }) v := NewString("String") if gotname != "String" { t.Errorf("want String, got %s", gotname) } if gotv != v { t.Errorf("want %#v, got %#v", v, gotv) } v.Set("a\"b") if v.Get() != "a\"b" { t.Errorf("want \"a\"b\", got %#v", gotv) } if v.String() != "\"a\\\"b\"" { t.Errorf("want \"\"a\\\"b\"\", got %#v", gotv) } f := StringFunc(func() string { return "a" }) if f.String() != "\"a\"" { t.Errorf("want \"a\", got %v", f.String()) } } type Mystr string func (m *Mystr) String() string { return string(*m) } func TestPublish(t *testing.T) { var gotname string var gotv expvar.Var clear() Register(func(name string, v expvar.Var) { gotname = name gotv = v.(*Mystr) }) v := Mystr("abcd") Publish("Mystr", &v) if gotname != "Mystr" { t.Errorf("want Mystr, got %s", gotname) } if gotv != &v { t.Errorf("want %#v, got %#v", &v, gotv) } } func f() string { return "abcd" } func TestPublishFunc(t *testing.T) { var gotname string var gotv JSONFunc clear() Register(func(name string, v expvar.Var) { gotname = name gotv = v.(JSONFunc) }) PublishJSONFunc("Myfunc", f) if gotname != "Myfunc" { t.Errorf("want Myfunc, got %s", gotname) } if gotv.String() != f() { t.Errorf("want %v, got %#v", f(), gotv()) } } func TestStringMap(t *testing.T) { clear() c := NewStringMap("stringmap1") c.Set("c1", "val1") c.Set("c2", "val2") c.Set("c2", "val3") want1 := `{"c1": "val1", "c2": "val3"}` want2 := `{"c2": "val3", "c1": "val1"}` if s := c.String(); s != want1 && s != want2 { t.Errorf("want %s or %s, got %s", want1, want2, s) } f := StringMapFunc(func() map[string]string { return map[string]string{ "c1": "val1", "c2": "val3", } }) if s := f.String(); s != want1 && s != want2 { t.Errorf("want %s or %s, got %s", want1, want2, s) } }
{ "pile_set_name": "Github" }
[ { "vendor": "Apache Software Foundation", "product": "Apache HTTP Server", "shodan_queries": [ { "query": "Apache", "query_confidence": "certain" } ], "censys_queries": [ { "query": "Apache", "query_confidence": "certain" } ], "scripts": { "py_script": "test.py", "nse_script": "test.nse" }, "vendor_confidence": "certain" }, { "vendor": "Nginx", "product": "Nginx", "shodan_queries": [ { "query": "Nginx", "query_confidence": "certain" } ], "censys_queries": [ { "query": "Nginx", "query_confidence": "certain" } ], "scripts": { "py_script": "test.py", "nse_script": "test.nse" }, "vendor_confidence": "certain" } ]
{ "pile_set_name": "Github" }
<?php namespace builder; /** * 软件接口 */ interface Software { public function produce(); }
{ "pile_set_name": "Github" }
+ - * / % -- ++ >> << ~ & | ^ += -= *= /= %= >>= <<= &= |= ^= ! && || -> :: ? : = == != < > <= >= <=> and and_eq bitand bitor not not_eq or or_eq xor xor_eq ---------------------------------------------------- [ ["operator", "+"], ["operator", "-"], ["operator", "*"], ["operator", "/"], ["operator", "%"], ["operator", "--"], ["operator", "++"], ["operator", ">>"], ["operator", "<<"], ["operator", "~"], ["operator", "&"], ["operator", "|"], ["operator", "^"], ["operator", "+="], ["operator", "-="], ["operator", "*="], ["operator", "/="], ["operator", "%="], ["operator", ">>="], ["operator", "<<="], ["operator", "&="], ["operator", "|="], ["operator", "^="], ["operator", "!"], ["operator", "&&"], ["operator", "||"], ["operator", "->"], ["operator", "::"], ["operator", "?"], ["operator", ":"], ["operator", "="], ["operator", "=="], ["operator", "!="], ["operator", "<"], ["operator", ">"], ["operator", "<="], ["operator", ">="], ["operator", "<=>"], ["operator", "and"], ["operator", "and_eq"], ["operator", "bitand"], ["operator", "bitor"], ["operator", "not"], ["operator", "not_eq"], ["operator", "or"], ["operator", "or_eq"], ["operator", "xor"], ["operator", "xor_eq"] ] ---------------------------------------------------- Checks for all operators.
{ "pile_set_name": "Github" }
import stainless.lang._ // import stainless.collection._ object AnonymousClasses1 { abstract class Foo { def bar: Int } def test(x: Int) = { require(x >= 0 && x < 100) def go(n: Int): Int = { require(n >= 0) if (n == 0) n else go(n - 1) } def makeFoo(m: Int) = { require(m == 0) new Foo { def bar = m + x } } makeFoo(go(x + 1)) } def theorem = { test(20).bar == 20 }.holds }
{ "pile_set_name": "Github" }
#------------------------------------------------------------------------------ # # Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR> # Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at # http://opensource.org/licenses/bsd-license.php # # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # #------------------------------------------------------------------------------ #include <AsmMacroIoLibV8.h> ASM_FUNC(GccSemihostCall) hlt #0xf000 ret
{ "pile_set_name": "Github" }
# Copyright (C) 2006-2013 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # menu "Global build settings" config ALL_KMODS bool "Select all kernel module packages by default" default ALL config ALL bool "Select all userspace packages by default" default n config SIGNED_PACKAGES bool "Cryptographically signed package lists" default y comment "General build options" config DISPLAY_SUPPORT bool "Show packages that require graphics support (local or remote)" default n config BUILD_PATENTED default y bool "Compile with support for patented functionality" help When this option is disabled, software which provides patented functionality will not be built. In case software provides optional support for patented functionality, this optional support will get disabled for this package. config BUILD_NLS default n bool "Compile with full language support" help When this option is enabled, packages are built with the full versions of iconv and GNU gettext instead of the default OpenWrt stubs. If uClibc is used, it is also built with locale support. config SHADOW_PASSWORDS bool prompt "Enable shadow password support" default y help Enable shadow password support. config CLEAN_IPKG bool prompt "Remove ipkg/opkg status data files in final images" default n help This removes all ipkg/opkg status data files from the target directory before building the root filesystem. config COLLECT_KERNEL_DEBUG bool prompt "Collect kernel debug information" select KERNEL_DEBUG_INFO default n help This collects debugging symbols from the kernel and all compiled modules. Useful for release builds, so that kernel issues can be debugged offline later. comment "Kernel build options" source "config/Config-kernel.in" comment "Package build options" config DEBUG bool prompt "Compile packages with debugging info" default n help Adds -g3 to the CFLAGS. config IPV6 bool prompt "Enable IPv6 support in packages" default y help Enables IPv6 support in kernel (builtin) and packages. config PKG_BUILD_PARALLEL bool prompt "Compile certain packages parallelized" default y help This adds a -jX option to certain packages that are known to behave well for parallel build. By default, the package make processes use the main jobserver, in which case this option only takes effect when you add -jX to the make command. If you are unsure, select N. config PKG_BUILD_USE_JOBSERVER bool prompt "Use top-level make jobserver for packages" depends on PKG_BUILD_PARALLEL default y help This passes the main make process jobserver fds to package builds, enabling full parallelization across different packages. Note that disabling this may overcommit CPU resources depending on the -j level of the main make process, the number of package submake jobs selected below and the number of actual CPUs present. Example: If the main make is passed a -j4 and the submake -j is also set to 4, we may end up with 16 parallel make processes in the worst case. config PKG_BUILD_JOBS int prompt "Number of package submake jobs (2-512)" range 2 512 default 2 depends on PKG_BUILD_PARALLEL && !PKG_BUILD_USE_JOBSERVER help The number of jobs (-jX) to pass to packages submake. config PKG_DEFAULT_PARALLEL bool prompt "Parallelize the default package build rule (May break build)" depends on PKG_BUILD_PARALLEL depends on BROKEN default n help Always set the default package build rules to parallel build. WARNING: This may break build or kill your cat, as it builds packages with multiple jobs that are probably not tested in a parallel build environment. Only say Y if you don't mind fixing broken packages. Before reporting build bugs, set this to N and re-run the build. comment "Stripping options" choice prompt "Binary stripping method" default USE_STRIP if EXTERNAL_TOOLCHAIN default USE_STRIP if USE_GLIBC default USE_SSTRIP help Select the binary stripping method you wish to use. config NO_STRIP bool "none" help This will install unstripped binaries (useful for native compiling/debugging). config USE_STRIP bool "strip" help This will install binaries stripped using strip from binutils. config USE_SSTRIP bool "sstrip" depends on !USE_GLIBC help This will install binaries stripped using sstrip. endchoice config STRIP_ARGS string prompt "Strip arguments" depends on USE_STRIP default "--strip-unneeded --remove-section=.comment --remove-section=.note" if DEBUG default "--strip-all" help Specifies arguments passed to the strip command when stripping binaries. config STRIP_KERNEL_EXPORTS bool "Strip unnecessary exports from the kernel image" help Reduces kernel size by stripping unused kernel exports from the kernel image. Note that this might make the kernel incompatible with any kernel modules that were not selected at the time the kernel image was created. config USE_MKLIBS bool "Strip unnecessary functions from libraries" help Reduces libraries to only those functions that are necessary for using all selected packages (including those selected as <M>). Note that this will make the system libraries incompatible with most of the packages that are not selected during the build process. choice prompt "Preferred standard C++ library" default USE_LIBSTDCXX if USE_GLIBC default USE_UCLIBCXX help Select the preferred standard C++ library for all packages that support this. config USE_UCLIBCXX bool "uClibc++" config USE_LIBSTDCXX bool "libstdc++" endchoice comment "Hardening build options" config PKG_CHECK_FORMAT_SECURITY bool prompt "Enable gcc format-security" default y help Add -Wformat -Werror=format-security to the CFLAGS. You can disable this per package by adding PKG_CHECK_FORMAT_SECURITY:=0 in the package Makefile. choice prompt "User space Stack-Smashing Protection" depends on USE_MUSL default PKG_CC_STACKPROTECTOR_REGULAR help Enable GCC Stack Smashing Protection (SSP) for userspace applications config PKG_CC_STACKPROTECTOR_NONE bool "None" config PKG_CC_STACKPROTECTOR_REGULAR bool "Regular" select SSP_SUPPORT if !USE_MUSL depends on KERNEL_CC_STACKPROTECTOR_REGULAR config PKG_CC_STACKPROTECTOR_STRONG bool "Strong" select SSP_SUPPORT if !USE_MUSL depends on GCC_VERSION_5 depends on KERNEL_CC_STACKPROTECTOR_STRONG endchoice choice prompt "Kernel space Stack-Smashing Protection" default KERNEL_CC_STACKPROTECTOR_REGULAR depends on USE_MUSL || !(x86_64 || i386) help Enable GCC Stack-Smashing Protection (SSP) for the kernel config KERNEL_CC_STACKPROTECTOR_NONE bool "None" config KERNEL_CC_STACKPROTECTOR_REGULAR bool "Regular" config KERNEL_CC_STACKPROTECTOR_STRONG depends on GCC_VERSION_5 bool "Strong" endchoice choice prompt "Enable buffer-overflows detection (FORTIFY_SOURCE)" default PKG_FORTIFY_SOURCE_1 help Enable the _FORTIFY_SOURCE macro which introduces additional checks to detect buffer-overflows in the following standard library functions: memcpy, mempcpy, memmove, memset, strcpy, stpcpy, strncpy, strcat, strncat, sprintf, vsprintf, snprintf, vsnprintf, gets. "Conservative" (_FORTIFY_SOURCE set to 1) only introduces checks that shouldn't change the behavior of conforming programs, while "aggressive" (_FORTIFY_SOURCES set to 2) some more checking is added, but some conforming programs might fail. config PKG_FORTIFY_SOURCE_NONE bool "None" config PKG_FORTIFY_SOURCE_1 bool "Conservative" config PKG_FORTIFY_SOURCE_2 bool "Aggressive" endchoice choice prompt "Enable RELRO protection" default PKG_RELRO_FULL help Enable a link-time protection known as RELRO (Relocation Read Only) which helps to protect from certain type of exploitation techniques altering the content of some ELF sections. "Partial" RELRO makes the .dynamic section not writeable after initialization, introducing almost no performance penalty, while "full" RELRO also marks the GOT as read-only at the cost of initializing all of it at startup. config PKG_RELRO_NONE bool "None" config PKG_RELRO_PARTIAL bool "Partial" config PKG_RELRO_FULL bool "Full" endchoice endmenu
{ "pile_set_name": "Github" }
from .debug_driver import DebugDriver, DebugState class DummyDebugDriver(DebugDriver): """ Stub implementation of the debug driver """ def __init__(self): super().__init__() self.status = DebugState.STOPPED def run(self): self.status = DebugState.RUNNING def restart(self): self.status = DebugState.RUNNING def step(self): pass def stop(self): self.status = DebugState.STOPPED def get_status(self): return self.status def get_registers(self, registers): return {r: 0 for r in registers} def get_pc(self): return 0 def get_fp(self): return 0 def set_breakpoint(self, address): pass def clear_breakpoint(self, address): pass def read_mem(self, address, size): return bytes(size) def write_mem(self, address, data): pass def update_status(self): pass
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg_tab" > <LinearLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center" android:gravity="center" android:orientation="horizontal" > <ImageView android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" /> <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="5dp" android:textColor="#fff" android:textStyle="bold" /> </LinearLayout> </FrameLayout>
{ "pile_set_name": "Github" }
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <Button android:id="@+id/btn_sgv" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:padding="16dp" android:layout_margin="16dp" android:text="Staggered Grid View" /> <Button android:id="@+id/btn_sgv_fragment" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:padding="16dp" android:layout_margin="16dp" android:text="Staggered Grid View in Fragment" /> <Button android:id="@+id/btn_sgv_empty_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:padding="16dp" android:layout_margin="16dp" android:text="Staggered Grid View with Empty View" /> <Button android:id="@+id/btn_listview" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:padding="16dp" android:layout_margin="16dp" android:text="List View" /> </LinearLayout>
{ "pile_set_name": "Github" }
# -------------------------------------------------------- # Multitask Network Cascade # Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- import time class Timer(object): """A simple timer.""" def __init__(self): self.total_time = 0. self.calls = 0 self.start_time = 0. self.diff = 0. self.average_time = 0. def tic(self): # using time.time instead of time.clock because time time.clock # does not normalize for multithreading self.start_time = time.time() def toc(self, average=True): self.diff = time.time() - self.start_time self.total_time += self.diff self.calls += 1 self.average_time = self.total_time / self.calls if average: return self.average_time else: return self.diff
{ "pile_set_name": "Github" }
package org.sword.wechat4j.csc; import java.io.File; import java.util.ArrayList; import java.util.List; import org.apache.commons.codec.digest.DigestUtils; import org.junit.Before; import org.junit.Test; import org.sword.lang.HttpUtils; import org.sword.wechat4j.csc.CustomerServices; import org.sword.wechat4j.csc.CustomerServicesManager; import org.sword.wechat4j.csc.CustomerServicesSession; import org.sword.wechat4j.csc.Record; import org.sword.wechat4j.exception.WeChatException; import org.sword.wechat4j.token.TokenProxy; import com.alibaba.fastjson.JSONObject; public class CustomerServicesTest { private CustomerServicesManager manager; @Before public void init(){ manager = new CustomerServicesManager(); } /** * 创建会话 */ @Test public void create(){ String openId = "otweTt4fjjPDZtGlQx_w5XfV42sc"; String kfAccount = "service01@wechat4j"; try { manager.kfSessionCreate(openId, kfAccount); System.out.println("会话创建成功"); } catch (WeChatException e) { System.out.println("会话创建失败"); e.printStackTrace(); } } /** * 关闭会话 */ @Test public void close(){ String openId = "otweTt4fjjPDZtGlQx_w5XfV42sc"; String kfAccount = "service01@wechat4j"; try { manager.kfSessionClose(openId, kfAccount); System.out.println("会关闭建成功"); } catch (WeChatException e) { System.out.println("会关闭建失败"); e.printStackTrace(); } } /** * 获取客户的会话状态 */ @Test public void getSession(){ String openId = "otweTt4fjjPDZtGlQx_w5XfV42sc"; System.out.println("客户["+openId+"]会话状态"); CustomerServicesSession customerServicesSession = manager.getSession(openId); System.out.println("会话创建时间:"+customerServicesSession.getCreateTime()); System.out.println("客服:"+customerServicesSession.getKfAccount()); } /** * 获取客服的会话列表 */ @Test public void getSessionList(){ String kfAccount = "service01@wechat4j"; System.out.println("客服["+kfAccount+"]会话列表"); List<CustomerServicesSession> customerServicesSessions = manager.getSessionList(kfAccount); for (CustomerServicesSession customerServicesSession : customerServicesSessions) { System.out.println("客户:"+customerServicesSession.getOpenId()); System.out.println("会话创建时间:"+customerServicesSession.getCreateTime()); } } /** * 获取未接入会话列表 */ @Test public void getWaitCaseList(){ List<CustomerServicesSession> customerServicesSessions = manager.getWaitCaseList(); System.out.println("未接入会话列表"); for (CustomerServicesSession customerServicesSession : customerServicesSessions) { System.out.println("客户:"+customerServicesSession.getOpenId()); System.out.println("会话创建时间:"+customerServicesSession.getCreateTime()); } } /** * 获取客服基本信息 */ @Test public void getKfList(){ List<CustomerServices> customerServices = manager.getKfList(); System.out.println("获取所有客服"); for (CustomerServices cs : customerServices) { System.out.println("完整客服账号:"+cs.getKfAccount()); System.out.println("客服头像:"+cs.getKfHeadimgurl()); System.out.println("客服工号:"+cs.getKfId()); System.out.println("客服昵称:"+cs.getKfNick()); } } /** * 获取在线客服接待信息 */ @Test public void getOnlieKfList(){ List<CustomerServices> customerServices = manager.getOnlieKfList(); System.out.println("获取在线客服接待信息"); for (CustomerServices cs : customerServices) { System.out.println("完整客服账号:"+cs.getKfAccount()); System.out.println("客服状态:"+cs.getStatus()); System.out.println("客服工号:"+cs.getKfId()); System.out.println("客服最大自动接入数:"+cs.getAutoAccept()); System.out.println("客服当前接待数:"+cs.getAcceptedCase()); } } /** * 添加客服账号 */ @Test public void kfAddAccount(){ String kfAccount="service03@wechat4j"; String nickName ="客服03"; String password ="service03"; try { manager.kfAddAccount(kfAccount, nickName, DigestUtils.md5Hex(password).toUpperCase()); System.out.println("添加客服成功"); } catch (WeChatException e) { System.out.println("添加客服失败"); e.printStackTrace(); } } /** * 设置客服信息 */ @Test public void kfUpdateAccount(){ String kfAccount="service03@wechat4j"; String nickName ="客服"; String password ="service"; try { manager.kfUpdateAccount(kfAccount, nickName, DigestUtils.md5Hex(password)); System.out.println("设置客服信息成功"); } catch (WeChatException e) { System.out.println("设置客服信息失败"); e.printStackTrace(); } } /** * 上传客服头像 */ @Test public void kfUploadHeadImg(){ String kfAccount="service01@wechat4j"; try { manager.kfUploadHeadImg(kfAccount, new File("D://wtb.jpg")); System.out.println("头像上传成功"); } catch (WeChatException e) { System.out.println("头像上传失败"); e.printStackTrace(); } } /** * 删除客服账号 */ @Test public void kfDelAccount(){ String kfAccount="service03@wechat4j"; try { manager.kfDelAccount(kfAccount); System.out.println("客服删除成功"); } catch (WeChatException e) { System.out.println("客服删除失败"); e.printStackTrace(); } } /** * 获取客服聊天记录 */ @Test public void getRecord(){ long starttime=System.currentTimeMillis()/1000L-20*60*60; long endtime=System.currentTimeMillis()/1000L; int pageindex=1; int pagesize=50; List<Record> records = manager.getRecord(starttime, endtime, pageindex, pagesize); for (Record record : records) { System.out.println("用户的标识:"+record.getOpenid()); System.out.println("操作ID:"+record.getOpercode()); System.out.println("会话状态:"+RecordOperCode.getSessionState(record.getOpercode())); System.out.println("聊天记录:"+record.getText()); System.out.println("操作时间,UNIX时间戳:"+record.getTime()); System.out.println("客服账号:"+record.getWorker()); } } }
{ "pile_set_name": "Github" }
-- Verify get_patchsets_for_change BEGIN; SELECT has_function_privilege( 'get_patchsets_for_change(uuid)', 'execute'); ROLLBACK;
{ "pile_set_name": "Github" }
((output (((f.ml (1 0) (1 10)) (paragraph (((f.ml (1 0) (1 10)) (superscript (((f.ml (1 6) (1 9)) (word foo)))))))))) (warnings ()))
{ "pile_set_name": "Github" }
/* * Copyright 2015 Toradex AG * * Stefan Agner <stefan@agner.ch> * * Freescale TCON device driver * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include <linux/clk.h> #include <linux/io.h> #include <linux/mm.h> #include <linux/of_address.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include "fsl_tcon.h" void fsl_tcon_bypass_disable(struct fsl_tcon *tcon) { regmap_update_bits(tcon->regs, FSL_TCON_CTRL1, FSL_TCON_CTRL1_TCON_BYPASS, 0); } void fsl_tcon_bypass_enable(struct fsl_tcon *tcon) { regmap_update_bits(tcon->regs, FSL_TCON_CTRL1, FSL_TCON_CTRL1_TCON_BYPASS, FSL_TCON_CTRL1_TCON_BYPASS); } static struct regmap_config fsl_tcon_regmap_config = { .reg_bits = 32, .reg_stride = 4, .val_bits = 32, .name = "tcon", }; static int fsl_tcon_init_regmap(struct device *dev, struct fsl_tcon *tcon, struct device_node *np) { struct resource res; void __iomem *regs; if (of_address_to_resource(np, 0, &res)) return -EINVAL; regs = devm_ioremap_resource(dev, &res); if (IS_ERR(regs)) return PTR_ERR(regs); tcon->regs = devm_regmap_init_mmio(dev, regs, &fsl_tcon_regmap_config); return PTR_ERR_OR_ZERO(tcon->regs); } struct fsl_tcon *fsl_tcon_init(struct device *dev) { struct fsl_tcon *tcon; struct device_node *np; int ret; /* TCON node is not mandatory, some devices do not provide TCON */ np = of_parse_phandle(dev->of_node, "fsl,tcon", 0); if (!np) return NULL; tcon = devm_kzalloc(dev, sizeof(*tcon), GFP_KERNEL); if (!tcon) goto err_node_put; ret = fsl_tcon_init_regmap(dev, tcon, np); if (ret) { dev_err(dev, "Couldn't create the TCON regmap\n"); goto err_node_put; } tcon->ipg_clk = of_clk_get_by_name(np, "ipg"); if (IS_ERR(tcon->ipg_clk)) { dev_err(dev, "Couldn't get the TCON bus clock\n"); goto err_node_put; } ret = clk_prepare_enable(tcon->ipg_clk); if (ret) { dev_err(dev, "Couldn't enable the TCON clock\n"); goto err_node_put; } of_node_put(np); dev_info(dev, "Using TCON in bypass mode\n"); return tcon; err_node_put: of_node_put(np); return NULL; } void fsl_tcon_free(struct fsl_tcon *tcon) { clk_disable_unprepare(tcon->ipg_clk); clk_put(tcon->ipg_clk); }
{ "pile_set_name": "Github" }
/* * wm8750.c -- WM8750 ALSA SoC audio driver * * Copyright 2005 Openedhand Ltd. * * Author: Richard Purdie <richard@openedhand.com> * * Based on WM8753.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/pm.h> #include <linux/i2c.h> #include <linux/regmap.h> #include <linux/spi/spi.h> #include <linux/slab.h> #include <linux/of_device.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> #include <sound/initval.h> #include "wm8750.h" /* * wm8750 register cache * We can't read the WM8750 register space when we * are using 2 wire for device control, so we cache them instead. */ static const struct reg_default wm8750_reg_defaults[] = { { 0, 0x0097 }, { 1, 0x0097 }, { 2, 0x0079 }, { 3, 0x0079 }, { 4, 0x0000 }, { 5, 0x0008 }, { 6, 0x0000 }, { 7, 0x000a }, { 8, 0x0000 }, { 9, 0x0000 }, { 10, 0x00ff }, { 11, 0x00ff }, { 12, 0x000f }, { 13, 0x000f }, { 14, 0x0000 }, { 15, 0x0000 }, { 16, 0x0000 }, { 17, 0x007b }, { 18, 0x0000 }, { 19, 0x0032 }, { 20, 0x0000 }, { 21, 0x00c3 }, { 22, 0x00c3 }, { 23, 0x00c0 }, { 24, 0x0000 }, { 25, 0x0000 }, { 26, 0x0000 }, { 27, 0x0000 }, { 28, 0x0000 }, { 29, 0x0000 }, { 30, 0x0000 }, { 31, 0x0000 }, { 32, 0x0000 }, { 33, 0x0000 }, { 34, 0x0050 }, { 35, 0x0050 }, { 36, 0x0050 }, { 37, 0x0050 }, { 38, 0x0050 }, { 39, 0x0050 }, { 40, 0x0079 }, { 41, 0x0079 }, { 42, 0x0079 }, }; /* codec private data */ struct wm8750_priv { unsigned int sysclk; }; #define wm8750_reset(c) snd_soc_write(c, WM8750_RESET, 0) /* * WM8750 Controls */ static const char *wm8750_bass[] = {"Linear Control", "Adaptive Boost"}; static const char *wm8750_bass_filter[] = { "130Hz @ 48kHz", "200Hz @ 48kHz" }; static const char *wm8750_treble[] = {"8kHz", "4kHz"}; static const char *wm8750_3d_lc[] = {"200Hz", "500Hz"}; static const char *wm8750_3d_uc[] = {"2.2kHz", "1.5kHz"}; static const char *wm8750_3d_func[] = {"Capture", "Playback"}; static const char *wm8750_alc_func[] = {"Off", "Right", "Left", "Stereo"}; static const char *wm8750_ng_type[] = {"Constant PGA Gain", "Mute ADC Output"}; static const char *wm8750_line_mux[] = {"Line 1", "Line 2", "Line 3", "PGA", "Differential"}; static const char *wm8750_pga_sel[] = {"Line 1", "Line 2", "Line 3", "Differential"}; static const char *wm8750_out3[] = {"VREF", "ROUT1 + Vol", "MonoOut", "ROUT1"}; static const char *wm8750_diff_sel[] = {"Line 1", "Line 2"}; static const char *wm8750_adcpol[] = {"Normal", "L Invert", "R Invert", "L + R Invert"}; static const char *wm8750_deemph[] = {"None", "32Khz", "44.1Khz", "48Khz"}; static const char *wm8750_mono_mux[] = {"Stereo", "Mono (Left)", "Mono (Right)", "Digital Mono"}; static const struct soc_enum wm8750_enum[] = { SOC_ENUM_SINGLE(WM8750_BASS, 7, 2, wm8750_bass), SOC_ENUM_SINGLE(WM8750_BASS, 6, 2, wm8750_bass_filter), SOC_ENUM_SINGLE(WM8750_TREBLE, 6, 2, wm8750_treble), SOC_ENUM_SINGLE(WM8750_3D, 5, 2, wm8750_3d_lc), SOC_ENUM_SINGLE(WM8750_3D, 6, 2, wm8750_3d_uc), SOC_ENUM_SINGLE(WM8750_3D, 7, 2, wm8750_3d_func), SOC_ENUM_SINGLE(WM8750_ALC1, 7, 4, wm8750_alc_func), SOC_ENUM_SINGLE(WM8750_NGATE, 1, 2, wm8750_ng_type), SOC_ENUM_SINGLE(WM8750_LOUTM1, 0, 5, wm8750_line_mux), SOC_ENUM_SINGLE(WM8750_ROUTM1, 0, 5, wm8750_line_mux), SOC_ENUM_SINGLE(WM8750_LADCIN, 6, 4, wm8750_pga_sel), /* 10 */ SOC_ENUM_SINGLE(WM8750_RADCIN, 6, 4, wm8750_pga_sel), SOC_ENUM_SINGLE(WM8750_ADCTL2, 7, 4, wm8750_out3), SOC_ENUM_SINGLE(WM8750_ADCIN, 8, 2, wm8750_diff_sel), SOC_ENUM_SINGLE(WM8750_ADCDAC, 5, 4, wm8750_adcpol), SOC_ENUM_SINGLE(WM8750_ADCDAC, 1, 4, wm8750_deemph), SOC_ENUM_SINGLE(WM8750_ADCIN, 6, 4, wm8750_mono_mux), /* 16 */ }; static const struct snd_kcontrol_new wm8750_snd_controls[] = { SOC_DOUBLE_R("Capture Volume", WM8750_LINVOL, WM8750_RINVOL, 0, 63, 0), SOC_DOUBLE_R("Capture ZC Switch", WM8750_LINVOL, WM8750_RINVOL, 6, 1, 0), SOC_DOUBLE_R("Capture Switch", WM8750_LINVOL, WM8750_RINVOL, 7, 1, 1), SOC_DOUBLE_R("Headphone Playback ZC Switch", WM8750_LOUT1V, WM8750_ROUT1V, 7, 1, 0), SOC_DOUBLE_R("Speaker Playback ZC Switch", WM8750_LOUT2V, WM8750_ROUT2V, 7, 1, 0), SOC_ENUM("Playback De-emphasis", wm8750_enum[15]), SOC_ENUM("Capture Polarity", wm8750_enum[14]), SOC_SINGLE("Playback 6dB Attenuate", WM8750_ADCDAC, 7, 1, 0), SOC_SINGLE("Capture 6dB Attenuate", WM8750_ADCDAC, 8, 1, 0), SOC_DOUBLE_R("PCM Volume", WM8750_LDAC, WM8750_RDAC, 0, 255, 0), SOC_ENUM("Bass Boost", wm8750_enum[0]), SOC_ENUM("Bass Filter", wm8750_enum[1]), SOC_SINGLE("Bass Volume", WM8750_BASS, 0, 15, 1), SOC_SINGLE("Treble Volume", WM8750_TREBLE, 0, 15, 1), SOC_ENUM("Treble Cut-off", wm8750_enum[2]), SOC_SINGLE("3D Switch", WM8750_3D, 0, 1, 0), SOC_SINGLE("3D Volume", WM8750_3D, 1, 15, 0), SOC_ENUM("3D Lower Cut-off", wm8750_enum[3]), SOC_ENUM("3D Upper Cut-off", wm8750_enum[4]), SOC_ENUM("3D Mode", wm8750_enum[5]), SOC_SINGLE("ALC Capture Target Volume", WM8750_ALC1, 0, 7, 0), SOC_SINGLE("ALC Capture Max Volume", WM8750_ALC1, 4, 7, 0), SOC_ENUM("ALC Capture Function", wm8750_enum[6]), SOC_SINGLE("ALC Capture ZC Switch", WM8750_ALC2, 7, 1, 0), SOC_SINGLE("ALC Capture Hold Time", WM8750_ALC2, 0, 15, 0), SOC_SINGLE("ALC Capture Decay Time", WM8750_ALC3, 4, 15, 0), SOC_SINGLE("ALC Capture Attack Time", WM8750_ALC3, 0, 15, 0), SOC_SINGLE("ALC Capture NG Threshold", WM8750_NGATE, 3, 31, 0), SOC_ENUM("ALC Capture NG Type", wm8750_enum[4]), SOC_SINGLE("ALC Capture NG Switch", WM8750_NGATE, 0, 1, 0), SOC_SINGLE("Left ADC Capture Volume", WM8750_LADC, 0, 255, 0), SOC_SINGLE("Right ADC Capture Volume", WM8750_RADC, 0, 255, 0), SOC_SINGLE("ZC Timeout Switch", WM8750_ADCTL1, 0, 1, 0), SOC_SINGLE("Playback Invert Switch", WM8750_ADCTL1, 1, 1, 0), SOC_SINGLE("Right Speaker Playback Invert Switch", WM8750_ADCTL2, 4, 1, 0), /* Unimplemented */ /* ADCDAC Bit 0 - ADCHPD */ /* ADCDAC Bit 4 - HPOR */ /* ADCTL1 Bit 2,3 - DATSEL */ /* ADCTL1 Bit 4,5 - DMONOMIX */ /* ADCTL1 Bit 6,7 - VSEL */ /* ADCTL2 Bit 2 - LRCM */ /* ADCTL2 Bit 3 - TRI */ /* ADCTL3 Bit 5 - HPFLREN */ /* ADCTL3 Bit 6 - VROI */ /* ADCTL3 Bit 7,8 - ADCLRM */ /* ADCIN Bit 4 - LDCM */ /* ADCIN Bit 5 - RDCM */ SOC_DOUBLE_R("Mic Boost", WM8750_LADCIN, WM8750_RADCIN, 4, 3, 0), SOC_DOUBLE_R("Bypass Left Playback Volume", WM8750_LOUTM1, WM8750_LOUTM2, 4, 7, 1), SOC_DOUBLE_R("Bypass Right Playback Volume", WM8750_ROUTM1, WM8750_ROUTM2, 4, 7, 1), SOC_DOUBLE_R("Bypass Mono Playback Volume", WM8750_MOUTM1, WM8750_MOUTM2, 4, 7, 1), SOC_SINGLE("Mono Playback ZC Switch", WM8750_MOUTV, 7, 1, 0), SOC_DOUBLE_R("Headphone Playback Volume", WM8750_LOUT1V, WM8750_ROUT1V, 0, 127, 0), SOC_DOUBLE_R("Speaker Playback Volume", WM8750_LOUT2V, WM8750_ROUT2V, 0, 127, 0), SOC_SINGLE("Mono Playback Volume", WM8750_MOUTV, 0, 127, 0), }; /* * DAPM Controls */ /* Left Mixer */ static const struct snd_kcontrol_new wm8750_left_mixer_controls[] = { SOC_DAPM_SINGLE("Playback Switch", WM8750_LOUTM1, 8, 1, 0), SOC_DAPM_SINGLE("Left Bypass Switch", WM8750_LOUTM1, 7, 1, 0), SOC_DAPM_SINGLE("Right Playback Switch", WM8750_LOUTM2, 8, 1, 0), SOC_DAPM_SINGLE("Right Bypass Switch", WM8750_LOUTM2, 7, 1, 0), }; /* Right Mixer */ static const struct snd_kcontrol_new wm8750_right_mixer_controls[] = { SOC_DAPM_SINGLE("Left Playback Switch", WM8750_ROUTM1, 8, 1, 0), SOC_DAPM_SINGLE("Left Bypass Switch", WM8750_ROUTM1, 7, 1, 0), SOC_DAPM_SINGLE("Playback Switch", WM8750_ROUTM2, 8, 1, 0), SOC_DAPM_SINGLE("Right Bypass Switch", WM8750_ROUTM2, 7, 1, 0), }; /* Mono Mixer */ static const struct snd_kcontrol_new wm8750_mono_mixer_controls[] = { SOC_DAPM_SINGLE("Left Playback Switch", WM8750_MOUTM1, 8, 1, 0), SOC_DAPM_SINGLE("Left Bypass Switch", WM8750_MOUTM1, 7, 1, 0), SOC_DAPM_SINGLE("Right Playback Switch", WM8750_MOUTM2, 8, 1, 0), SOC_DAPM_SINGLE("Right Bypass Switch", WM8750_MOUTM2, 7, 1, 0), }; /* Left Line Mux */ static const struct snd_kcontrol_new wm8750_left_line_controls = SOC_DAPM_ENUM("Route", wm8750_enum[8]); /* Right Line Mux */ static const struct snd_kcontrol_new wm8750_right_line_controls = SOC_DAPM_ENUM("Route", wm8750_enum[9]); /* Left PGA Mux */ static const struct snd_kcontrol_new wm8750_left_pga_controls = SOC_DAPM_ENUM("Route", wm8750_enum[10]); /* Right PGA Mux */ static const struct snd_kcontrol_new wm8750_right_pga_controls = SOC_DAPM_ENUM("Route", wm8750_enum[11]); /* Out 3 Mux */ static const struct snd_kcontrol_new wm8750_out3_controls = SOC_DAPM_ENUM("Route", wm8750_enum[12]); /* Differential Mux */ static const struct snd_kcontrol_new wm8750_diffmux_controls = SOC_DAPM_ENUM("Route", wm8750_enum[13]); /* Mono ADC Mux */ static const struct snd_kcontrol_new wm8750_monomux_controls = SOC_DAPM_ENUM("Route", wm8750_enum[16]); static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = { SND_SOC_DAPM_MIXER("Left Mixer", SND_SOC_NOPM, 0, 0, &wm8750_left_mixer_controls[0], ARRAY_SIZE(wm8750_left_mixer_controls)), SND_SOC_DAPM_MIXER("Right Mixer", SND_SOC_NOPM, 0, 0, &wm8750_right_mixer_controls[0], ARRAY_SIZE(wm8750_right_mixer_controls)), SND_SOC_DAPM_MIXER("Mono Mixer", WM8750_PWR2, 2, 0, &wm8750_mono_mixer_controls[0], ARRAY_SIZE(wm8750_mono_mixer_controls)), SND_SOC_DAPM_PGA("Right Out 2", WM8750_PWR2, 3, 0, NULL, 0), SND_SOC_DAPM_PGA("Left Out 2", WM8750_PWR2, 4, 0, NULL, 0), SND_SOC_DAPM_PGA("Right Out 1", WM8750_PWR2, 5, 0, NULL, 0), SND_SOC_DAPM_PGA("Left Out 1", WM8750_PWR2, 6, 0, NULL, 0), SND_SOC_DAPM_DAC("Right DAC", "Right Playback", WM8750_PWR2, 7, 0), SND_SOC_DAPM_DAC("Left DAC", "Left Playback", WM8750_PWR2, 8, 0), SND_SOC_DAPM_MICBIAS("Mic Bias", WM8750_PWR1, 1, 0), SND_SOC_DAPM_ADC("Right ADC", "Right Capture", WM8750_PWR1, 2, 0), SND_SOC_DAPM_ADC("Left ADC", "Left Capture", WM8750_PWR1, 3, 0), SND_SOC_DAPM_MUX("Left PGA Mux", WM8750_PWR1, 5, 0, &wm8750_left_pga_controls), SND_SOC_DAPM_MUX("Right PGA Mux", WM8750_PWR1, 4, 0, &wm8750_right_pga_controls), SND_SOC_DAPM_MUX("Left Line Mux", SND_SOC_NOPM, 0, 0, &wm8750_left_line_controls), SND_SOC_DAPM_MUX("Right Line Mux", SND_SOC_NOPM, 0, 0, &wm8750_right_line_controls), SND_SOC_DAPM_MUX("Out3 Mux", SND_SOC_NOPM, 0, 0, &wm8750_out3_controls), SND_SOC_DAPM_PGA("Out 3", WM8750_PWR2, 1, 0, NULL, 0), SND_SOC_DAPM_PGA("Mono Out 1", WM8750_PWR2, 2, 0, NULL, 0), SND_SOC_DAPM_MUX("Differential Mux", SND_SOC_NOPM, 0, 0, &wm8750_diffmux_controls), SND_SOC_DAPM_MUX("Left ADC Mux", SND_SOC_NOPM, 0, 0, &wm8750_monomux_controls), SND_SOC_DAPM_MUX("Right ADC Mux", SND_SOC_NOPM, 0, 0, &wm8750_monomux_controls), SND_SOC_DAPM_OUTPUT("LOUT1"), SND_SOC_DAPM_OUTPUT("ROUT1"), SND_SOC_DAPM_OUTPUT("LOUT2"), SND_SOC_DAPM_OUTPUT("ROUT2"), SND_SOC_DAPM_OUTPUT("MONO1"), SND_SOC_DAPM_OUTPUT("OUT3"), SND_SOC_DAPM_OUTPUT("VREF"), SND_SOC_DAPM_INPUT("LINPUT1"), SND_SOC_DAPM_INPUT("LINPUT2"), SND_SOC_DAPM_INPUT("LINPUT3"), SND_SOC_DAPM_INPUT("RINPUT1"), SND_SOC_DAPM_INPUT("RINPUT2"), SND_SOC_DAPM_INPUT("RINPUT3"), }; static const struct snd_soc_dapm_route wm8750_dapm_routes[] = { /* left mixer */ {"Left Mixer", "Playback Switch", "Left DAC"}, {"Left Mixer", "Left Bypass Switch", "Left Line Mux"}, {"Left Mixer", "Right Playback Switch", "Right DAC"}, {"Left Mixer", "Right Bypass Switch", "Right Line Mux"}, /* right mixer */ {"Right Mixer", "Left Playback Switch", "Left DAC"}, {"Right Mixer", "Left Bypass Switch", "Left Line Mux"}, {"Right Mixer", "Playback Switch", "Right DAC"}, {"Right Mixer", "Right Bypass Switch", "Right Line Mux"}, /* left out 1 */ {"Left Out 1", NULL, "Left Mixer"}, {"LOUT1", NULL, "Left Out 1"}, /* left out 2 */ {"Left Out 2", NULL, "Left Mixer"}, {"LOUT2", NULL, "Left Out 2"}, /* right out 1 */ {"Right Out 1", NULL, "Right Mixer"}, {"ROUT1", NULL, "Right Out 1"}, /* right out 2 */ {"Right Out 2", NULL, "Right Mixer"}, {"ROUT2", NULL, "Right Out 2"}, /* mono mixer */ {"Mono Mixer", "Left Playback Switch", "Left DAC"}, {"Mono Mixer", "Left Bypass Switch", "Left Line Mux"}, {"Mono Mixer", "Right Playback Switch", "Right DAC"}, {"Mono Mixer", "Right Bypass Switch", "Right Line Mux"}, /* mono out */ {"Mono Out 1", NULL, "Mono Mixer"}, {"MONO1", NULL, "Mono Out 1"}, /* out 3 */ {"Out3 Mux", "VREF", "VREF"}, {"Out3 Mux", "ROUT1 + Vol", "ROUT1"}, {"Out3 Mux", "ROUT1", "Right Mixer"}, {"Out3 Mux", "MonoOut", "MONO1"}, {"Out 3", NULL, "Out3 Mux"}, {"OUT3", NULL, "Out 3"}, /* Left Line Mux */ {"Left Line Mux", "Line 1", "LINPUT1"}, {"Left Line Mux", "Line 2", "LINPUT2"}, {"Left Line Mux", "Line 3", "LINPUT3"}, {"Left Line Mux", "PGA", "Left PGA Mux"}, {"Left Line Mux", "Differential", "Differential Mux"}, /* Right Line Mux */ {"Right Line Mux", "Line 1", "RINPUT1"}, {"Right Line Mux", "Line 2", "RINPUT2"}, {"Right Line Mux", "Line 3", "RINPUT3"}, {"Right Line Mux", "PGA", "Right PGA Mux"}, {"Right Line Mux", "Differential", "Differential Mux"}, /* Left PGA Mux */ {"Left PGA Mux", "Line 1", "LINPUT1"}, {"Left PGA Mux", "Line 2", "LINPUT2"}, {"Left PGA Mux", "Line 3", "LINPUT3"}, {"Left PGA Mux", "Differential", "Differential Mux"}, /* Right PGA Mux */ {"Right PGA Mux", "Line 1", "RINPUT1"}, {"Right PGA Mux", "Line 2", "RINPUT2"}, {"Right PGA Mux", "Line 3", "RINPUT3"}, {"Right PGA Mux", "Differential", "Differential Mux"}, /* Differential Mux */ {"Differential Mux", "Line 1", "LINPUT1"}, {"Differential Mux", "Line 1", "RINPUT1"}, {"Differential Mux", "Line 2", "LINPUT2"}, {"Differential Mux", "Line 2", "RINPUT2"}, /* Left ADC Mux */ {"Left ADC Mux", "Stereo", "Left PGA Mux"}, {"Left ADC Mux", "Mono (Left)", "Left PGA Mux"}, {"Left ADC Mux", "Digital Mono", "Left PGA Mux"}, /* Right ADC Mux */ {"Right ADC Mux", "Stereo", "Right PGA Mux"}, {"Right ADC Mux", "Mono (Right)", "Right PGA Mux"}, {"Right ADC Mux", "Digital Mono", "Right PGA Mux"}, /* ADC */ {"Left ADC", NULL, "Left ADC Mux"}, {"Right ADC", NULL, "Right ADC Mux"}, }; struct _coeff_div { u32 mclk; u32 rate; u16 fs; u8 sr:5; u8 usb:1; }; /* codec hifi mclk clock divider coefficients */ static const struct _coeff_div coeff_div[] = { /* 8k */ {12288000, 8000, 1536, 0x6, 0x0}, {11289600, 8000, 1408, 0x16, 0x0}, {18432000, 8000, 2304, 0x7, 0x0}, {16934400, 8000, 2112, 0x17, 0x0}, {12000000, 8000, 1500, 0x6, 0x1}, /* 11.025k */ {11289600, 11025, 1024, 0x18, 0x0}, {16934400, 11025, 1536, 0x19, 0x0}, {12000000, 11025, 1088, 0x19, 0x1}, /* 16k */ {12288000, 16000, 768, 0xa, 0x0}, {18432000, 16000, 1152, 0xb, 0x0}, {12000000, 16000, 750, 0xa, 0x1}, /* 22.05k */ {11289600, 22050, 512, 0x1a, 0x0}, {16934400, 22050, 768, 0x1b, 0x0}, {12000000, 22050, 544, 0x1b, 0x1}, /* 32k */ {12288000, 32000, 384, 0xc, 0x0}, {18432000, 32000, 576, 0xd, 0x0}, {12000000, 32000, 375, 0xa, 0x1}, /* 44.1k */ {11289600, 44100, 256, 0x10, 0x0}, {16934400, 44100, 384, 0x11, 0x0}, {12000000, 44100, 272, 0x11, 0x1}, /* 48k */ {12288000, 48000, 256, 0x0, 0x0}, {18432000, 48000, 384, 0x1, 0x0}, {12000000, 48000, 250, 0x0, 0x1}, /* 88.2k */ {11289600, 88200, 128, 0x1e, 0x0}, {16934400, 88200, 192, 0x1f, 0x0}, {12000000, 88200, 136, 0x1f, 0x1}, /* 96k */ {12288000, 96000, 128, 0xe, 0x0}, {18432000, 96000, 192, 0xf, 0x0}, {12000000, 96000, 125, 0xe, 0x1}, }; static inline int get_coeff(int mclk, int rate) { int i; for (i = 0; i < ARRAY_SIZE(coeff_div); i++) { if (coeff_div[i].rate == rate && coeff_div[i].mclk == mclk) return i; } printk(KERN_ERR "wm8750: could not get coeff for mclk %d @ rate %d\n", mclk, rate); return -EINVAL; } static int wm8750_set_dai_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { struct snd_soc_codec *codec = codec_dai->codec; struct wm8750_priv *wm8750 = snd_soc_codec_get_drvdata(codec); switch (freq) { case 11289600: case 12000000: case 12288000: case 16934400: case 18432000: wm8750->sysclk = freq; return 0; } return -EINVAL; } static int wm8750_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) { struct snd_soc_codec *codec = codec_dai->codec; u16 iface = 0; /* set master/slave audio interface */ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBM_CFM: iface = 0x0040; break; case SND_SOC_DAIFMT_CBS_CFS: break; default: return -EINVAL; } /* interface format */ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_I2S: iface |= 0x0002; break; case SND_SOC_DAIFMT_RIGHT_J: break; case SND_SOC_DAIFMT_LEFT_J: iface |= 0x0001; break; case SND_SOC_DAIFMT_DSP_A: iface |= 0x0003; break; case SND_SOC_DAIFMT_DSP_B: iface |= 0x0013; break; default: return -EINVAL; } /* clock inversion */ switch (fmt & SND_SOC_DAIFMT_INV_MASK) { case SND_SOC_DAIFMT_NB_NF: break; case SND_SOC_DAIFMT_IB_IF: iface |= 0x0090; break; case SND_SOC_DAIFMT_IB_NF: iface |= 0x0080; break; case SND_SOC_DAIFMT_NB_IF: iface |= 0x0010; break; default: return -EINVAL; } snd_soc_write(codec, WM8750_IFACE, iface); return 0; } static int wm8750_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { struct snd_soc_codec *codec = dai->codec; struct wm8750_priv *wm8750 = snd_soc_codec_get_drvdata(codec); u16 iface = snd_soc_read(codec, WM8750_IFACE) & 0x1f3; u16 srate = snd_soc_read(codec, WM8750_SRATE) & 0x1c0; int coeff = get_coeff(wm8750->sysclk, params_rate(params)); /* bit size */ switch (params_format(params)) { case SNDRV_PCM_FORMAT_S16_LE: break; case SNDRV_PCM_FORMAT_S20_3LE: iface |= 0x0004; break; case SNDRV_PCM_FORMAT_S24_LE: iface |= 0x0008; break; case SNDRV_PCM_FORMAT_S32_LE: iface |= 0x000c; break; } /* set iface & srate */ snd_soc_write(codec, WM8750_IFACE, iface); if (coeff >= 0) snd_soc_write(codec, WM8750_SRATE, srate | (coeff_div[coeff].sr << 1) | coeff_div[coeff].usb); return 0; } static int wm8750_mute(struct snd_soc_dai *dai, int mute) { struct snd_soc_codec *codec = dai->codec; u16 mute_reg = snd_soc_read(codec, WM8750_ADCDAC) & 0xfff7; if (mute) snd_soc_write(codec, WM8750_ADCDAC, mute_reg | 0x8); else snd_soc_write(codec, WM8750_ADCDAC, mute_reg); return 0; } static int wm8750_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) { u16 pwr_reg = snd_soc_read(codec, WM8750_PWR1) & 0xfe3e; switch (level) { case SND_SOC_BIAS_ON: /* set vmid to 50k and unmute dac */ snd_soc_write(codec, WM8750_PWR1, pwr_reg | 0x00c0); break; case SND_SOC_BIAS_PREPARE: break; case SND_SOC_BIAS_STANDBY: if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { snd_soc_cache_sync(codec); /* Set VMID to 5k */ snd_soc_write(codec, WM8750_PWR1, pwr_reg | 0x01c1); /* ...and ramp */ msleep(1000); } /* mute dac and set vmid to 500k, enable VREF */ snd_soc_write(codec, WM8750_PWR1, pwr_reg | 0x0141); break; case SND_SOC_BIAS_OFF: snd_soc_write(codec, WM8750_PWR1, 0x0001); break; } codec->dapm.bias_level = level; return 0; } #define WM8750_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) #define WM8750_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ SNDRV_PCM_FMTBIT_S24_LE) static const struct snd_soc_dai_ops wm8750_dai_ops = { .hw_params = wm8750_pcm_hw_params, .digital_mute = wm8750_mute, .set_fmt = wm8750_set_dai_fmt, .set_sysclk = wm8750_set_dai_sysclk, }; static struct snd_soc_dai_driver wm8750_dai = { .name = "wm8750-hifi", .playback = { .stream_name = "Playback", .channels_min = 1, .channels_max = 2, .rates = WM8750_RATES, .formats = WM8750_FORMATS,}, .capture = { .stream_name = "Capture", .channels_min = 1, .channels_max = 2, .rates = WM8750_RATES, .formats = WM8750_FORMATS,}, .ops = &wm8750_dai_ops, }; static int wm8750_suspend(struct snd_soc_codec *codec) { wm8750_set_bias_level(codec, SND_SOC_BIAS_OFF); return 0; } static int wm8750_resume(struct snd_soc_codec *codec) { wm8750_set_bias_level(codec, SND_SOC_BIAS_STANDBY); return 0; } static int wm8750_probe(struct snd_soc_codec *codec) { int ret; ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP); if (ret < 0) { printk(KERN_ERR "wm8750: failed to set cache I/O: %d\n", ret); return ret; } ret = wm8750_reset(codec); if (ret < 0) { printk(KERN_ERR "wm8750: failed to reset: %d\n", ret); return ret; } /* charge output caps */ wm8750_set_bias_level(codec, SND_SOC_BIAS_STANDBY); /* set the update bits */ snd_soc_update_bits(codec, WM8750_LDAC, 0x0100, 0x0100); snd_soc_update_bits(codec, WM8750_RDAC, 0x0100, 0x0100); snd_soc_update_bits(codec, WM8750_LOUT1V, 0x0100, 0x0100); snd_soc_update_bits(codec, WM8750_ROUT1V, 0x0100, 0x0100); snd_soc_update_bits(codec, WM8750_LOUT2V, 0x0100, 0x0100); snd_soc_update_bits(codec, WM8750_ROUT2V, 0x0100, 0x0100); snd_soc_update_bits(codec, WM8750_LINVOL, 0x0100, 0x0100); snd_soc_update_bits(codec, WM8750_RINVOL, 0x0100, 0x0100); return ret; } static int wm8750_remove(struct snd_soc_codec *codec) { wm8750_set_bias_level(codec, SND_SOC_BIAS_OFF); return 0; } static struct snd_soc_codec_driver soc_codec_dev_wm8750 = { .probe = wm8750_probe, .remove = wm8750_remove, .suspend = wm8750_suspend, .resume = wm8750_resume, .set_bias_level = wm8750_set_bias_level, .controls = wm8750_snd_controls, .num_controls = ARRAY_SIZE(wm8750_snd_controls), .dapm_widgets = wm8750_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wm8750_dapm_widgets), .dapm_routes = wm8750_dapm_routes, .num_dapm_routes = ARRAY_SIZE(wm8750_dapm_routes), }; static const struct of_device_id wm8750_of_match[] = { { .compatible = "wlf,wm8750", }, { .compatible = "wlf,wm8987", }, { } }; MODULE_DEVICE_TABLE(of, wm8750_of_match); static const struct regmap_config wm8750_regmap = { .reg_bits = 7, .val_bits = 9, .max_register = WM8750_MOUTV, .reg_defaults = wm8750_reg_defaults, .num_reg_defaults = ARRAY_SIZE(wm8750_reg_defaults), .cache_type = REGCACHE_RBTREE, }; #if defined(CONFIG_SPI_MASTER) static int wm8750_spi_probe(struct spi_device *spi) { struct wm8750_priv *wm8750; struct regmap *regmap; int ret; wm8750 = devm_kzalloc(&spi->dev, sizeof(struct wm8750_priv), GFP_KERNEL); if (wm8750 == NULL) return -ENOMEM; regmap = devm_regmap_init_spi(spi, &wm8750_regmap); if (IS_ERR(regmap)) return PTR_ERR(regmap); spi_set_drvdata(spi, wm8750); ret = snd_soc_register_codec(&spi->dev, &soc_codec_dev_wm8750, &wm8750_dai, 1); return ret; } static int wm8750_spi_remove(struct spi_device *spi) { snd_soc_unregister_codec(&spi->dev); return 0; } static const struct spi_device_id wm8750_spi_ids[] = { { "wm8750", 0 }, { "wm8987", 0 }, { }, }; MODULE_DEVICE_TABLE(spi, wm8750_spi_ids); static struct spi_driver wm8750_spi_driver = { .driver = { .name = "wm8750", .owner = THIS_MODULE, .of_match_table = wm8750_of_match, }, .id_table = wm8750_spi_ids, .probe = wm8750_spi_probe, .remove = wm8750_spi_remove, }; #endif /* CONFIG_SPI_MASTER */ #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) static int wm8750_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct wm8750_priv *wm8750; struct regmap *regmap; int ret; wm8750 = devm_kzalloc(&i2c->dev, sizeof(struct wm8750_priv), GFP_KERNEL); if (wm8750 == NULL) return -ENOMEM; i2c_set_clientdata(i2c, wm8750); regmap = devm_regmap_init_i2c(i2c, &wm8750_regmap); if (IS_ERR(regmap)) return PTR_ERR(regmap); ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm8750, &wm8750_dai, 1); return ret; } static int wm8750_i2c_remove(struct i2c_client *client) { snd_soc_unregister_codec(&client->dev); return 0; } static const struct i2c_device_id wm8750_i2c_id[] = { { "wm8750", 0 }, { "wm8987", 0 }, { } }; MODULE_DEVICE_TABLE(i2c, wm8750_i2c_id); static struct i2c_driver wm8750_i2c_driver = { .driver = { .name = "wm8750", .owner = THIS_MODULE, .of_match_table = wm8750_of_match, }, .probe = wm8750_i2c_probe, .remove = wm8750_i2c_remove, .id_table = wm8750_i2c_id, }; #endif static int __init wm8750_modinit(void) { int ret = 0; #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) ret = i2c_add_driver(&wm8750_i2c_driver); if (ret != 0) { printk(KERN_ERR "Failed to register wm8750 I2C driver: %d\n", ret); } #endif #if defined(CONFIG_SPI_MASTER) ret = spi_register_driver(&wm8750_spi_driver); if (ret != 0) { printk(KERN_ERR "Failed to register wm8750 SPI driver: %d\n", ret); } #endif return ret; } module_init(wm8750_modinit); static void __exit wm8750_exit(void) { #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) i2c_del_driver(&wm8750_i2c_driver); #endif #if defined(CONFIG_SPI_MASTER) spi_unregister_driver(&wm8750_spi_driver); #endif } module_exit(wm8750_exit); MODULE_DESCRIPTION("ASoC WM8750 driver"); MODULE_AUTHOR("Liam Girdwood"); MODULE_LICENSE("GPL");
{ "pile_set_name": "Github" }
/* Registered Users List Setting */ .registered-users-list { list-style-type: none; margin: 7.5px; padding: 0; & > li { width: 25%; font-size: 12px; float: left; padding: 7.5px; color: #333; & .username { font-size: 12px; color: #333; margin-bottom: 0; & small { display: block; font-size: 11px; color: #707478; margin-top: 3px; } } & img { max-width: 100%; .border-radius(3px); } & > a { display: block; margin-bottom: 10px; } } }
{ "pile_set_name": "Github" }
# Installation instructions ## Requirements - Buildship 3.x - Minimum Java version: 1.8 - Eclipse version: 4.3, or newer - Buildship 2.x - Minimum Java version: 1.7 - Eclipse version: 4.2, or newer - Buildship 1.x - Minimum Java version: 1.6 - Eclipse version: 4.2 - 4.6 Different Eclipse versions might be compatible but they aren't explicitly tested. Depending on the Gradle version that Buildship uses for a project import, certain features may not be available. ## Installing from eclipse.org update site We propose you install Buildship from the [Eclipse Marketplace](http://marketplace.eclipse.org/content/buildship-gradle-integration). Buildship is also available through one of the provided composite update sites listed on [eclipse.org](https://projects.eclipse.org/projects/tools.buildship/downloads). For manual installation use one of the update sites below. ### Update site with the latest release There's a separate update site that contains the latest Buildship release. https://download.eclipse.org/buildship/updates/latest/ This update site is built against the Eclipse version that was current at the time of the release. ### Update sites for Buildship 3.x Eclipse Version | Type | Update Site --------------- | ----------| ------------ 2020-03 | snapshot | `https://download.eclipse.org/buildship/updates/e415/snapshots/3.x` 2020-03 | milestone | `https://download.eclipse.org/buildship/updates/e415/milestones/3.x` 2020-03 | release | `https://download.eclipse.org/buildship/updates/e415/releases/3.x` 2019-12 | snapshot | `https://download.eclipse.org/buildship/updates/e414/snapshots/3.x` 2019-12 | milestone | `https://download.eclipse.org/buildship/updates/e414/milestones/3.x` 2019-12 | release | `https://download.eclipse.org/buildship/updates/e414/releases/3.x` 2019-09 | snapshot | `https://download.eclipse.org/buildship/updates/e413/snapshots/3.x` 2019-09 | milestone | `https://download.eclipse.org/buildship/updates/e413/milestones/3.x` 2019-09 | release | `https://download.eclipse.org/buildship/updates/e413/releases/3.x` 2019-06 | snapshot | `https://download.eclipse.org/buildship/updates/e412/snapshots/3.x` 2019-06 | milestone | `https://download.eclipse.org/buildship/updates/e412/milestones/3.x` 2019-06 | release | `https://download.eclipse.org/buildship/updates/e412/releases/3.x` 2019-03 | snapshot | `https://download.eclipse.org/buildship/updates/e411/snapshots/3.x` 2019-03 | milestone | `https://download.eclipse.org/buildship/updates/e411/milestones/3.x` 2019-03 | release | `https://download.eclipse.org/buildship/updates/e411/releases/3.x` 2018-12 | snapshot | `https://download.eclipse.org/buildship/updates/e410/snapshots/3.x` 2018-12 | milestone | `https://download.eclipse.org/buildship/updates/e410/milestones/3.x` 2018-12 | release | `https://download.eclipse.org/buildship/updates/e410/releases/3.x` 2018-09 | snapshot | `https://download.eclipse.org/buildship/updates/e49/snapshots/3.x` 2018-09 | milestone | `https://download.eclipse.org/buildship/updates/e49/milestones/3.x` 2018-09 | release | `https://download.eclipse.org/buildship/updates/e49/releases/3.x` Photon (4.8) | snapshot | `https://download.eclipse.org/buildship/updates/e48/snapshots/3.x` Photon (4.8) | milestone | `https://download.eclipse.org/buildship/updates/e48/milestones/3.x` Photon (4.8) | release | `https://download.eclipse.org/buildship/updates/e48/releases/3.x` Oxygen (4.7) | snapshot | `https://download.eclipse.org/buildship/updates/e47/snapshots/3.x` Oxygen (4.7) | milestone | `https://download.eclipse.org/buildship/updates/e47/milestones/3.x` Oxygen (4.7) | release | `https://download.eclipse.org/buildship/updates/e47/releases/3.x` Neon (4.6) | snapshot | `https://download.eclipse.org/buildship/updates/e46/snapshots/3.x` Neon (4.6) | milestone | `https://download.eclipse.org/buildship/updates/e46/milestones/3.x` Neon (4.6) | release | `https://download.eclipse.org/buildship/updates/e46/releases/3.x` Mars (4.5) | snapshot | `https://download.eclipse.org/buildship/updates/e45/snapshots/3.x` Mars (4.5) | milestone | `https://download.eclipse.org/buildship/updates/e45/milestones/3.x` Mars (4.5) | release | `https://download.eclipse.org/buildship/updates/e45/releases/3.x` Luna (4.4) | snapshot | `https://download.eclipse.org/buildship/updates/e44/snapshots/3.x` Luna (4.4) | milestone | `https://download.eclipse.org/buildship/updates/e44/milestones/3.x` Luna (4.4) | release | `https://download.eclipse.org/buildship/updates/e44/releases/3.x` Kepler (4.3) | snapshot | `https://download.eclipse.org/buildship/updates/e43/snapshots/3.x` Kepler (4.3) | milestone | `https://download.eclipse.org/buildship/updates/e43/milestones/3.x` Kepler (4.3) | release | `https://download.eclipse.org/buildship/updates/e43/releases/3.x` ### Update sites for Buildship 2.x Eclipse Version | Type | Update Site --------------- | ----------| ------------ Photon (4.8) | release | `https://download.eclipse.org/buildship/updates/e48/releases/2.x` Photon (4.8) | milestone | `https://download.eclipse.org/buildship/updates/e48/milestones/2.x` Photon (4.8) | snapshot | `https://download.eclipse.org/buildship/updates/e48/snapshots/2.x` Oxygen (4.7) | release | `https://download.eclipse.org/buildship/updates/e47/releases/2.x` Oxygen (4.7) | milestone | `https://download.eclipse.org/buildship/updates/e47/milestones/2.x` Oxygen (4.7) | snapshot | `https://download.eclipse.org/buildship/updates/e47/snapshots/2.x` Neon (4.6) | release | `https://download.eclipse.org/buildship/updates/e46/releases/2.x` Neon (4.6) | milestone | `https://download.eclipse.org/buildship/updates/e46/milestones/2.x` Neon (4.6) | snapshot | `https://download.eclipse.org/buildship/updates/e46/snapshots/2.x` Mars (4.5) | release | `https://download.eclipse.org/buildship/updates/e45/releases/2.x` Mars (4.5) | milestone | `https://download.eclipse.org/buildship/updates/e45/milestones/2.x` Mars (4.5) | snapshot | `https://download.eclipse.org/buildship/updates/e45/snapshots/2.x` Luna (4.4) | release | `https://download.eclipse.org/buildship/updates/e44/releases/2.x` Luna (4.4) | milestone | `https://download.eclipse.org/buildship/updates/e44/milestones/2.x` Luna (4.4) | snapshot | `https://download.eclipse.org/buildship/updates/e44/snapshots/2.x` Kepler (4.3) | release | `https://download.eclipse.org/buildship/updates/e43/releases/2.x` Kepler (4.3) | milestone | `https://download.eclipse.org/buildship/updates/e43/milestones/2.x` Kepler (4.3) | snapshot | `https://download.eclipse.org/buildship/updates/e43/snapshots/2.x` Juno (4.2) | release | `https://download.eclipse.org/buildship/updates/e42/releases/2.x` Juno (4.2) | milestone | `https://download.eclipse.org/buildship/updates/e42/milestones/2.x` Juno (4.2) | snapshot | `https://download.eclipse.org/buildship/updates/e42/snapshots/2.x` #### Update sites for Buildship 1.x Eclipse Version | Update Site -------------- |------------ Neon (4.6) | `https://download.eclipse.org/buildship/updates/e46/releases/1.0` Mars (4.5) | `https://download.eclipse.org/buildship/updates/e45/releases/1.0` Luna (4.4) | `https://download.eclipse.org/buildship/updates/e44/releases/1.0` Kepler (4.3) | `https://download.eclipse.org/buildship/updates/e43/releases/1.0` Juno (4.2) | `https://download.eclipse.org/buildship/updates/e42/releases/1.0` Indigo (3.7) | `https://download.eclipse.org/buildship/updates/e37/releases/1.0` Helios (3.6) | `https://download.eclipse.org/buildship/updates/e36/releases/1.0` The continuous integration server generates nightly snapshot releases each day 23:00 CET which instantly become available at the snapshot update sites above. In regular intervals, the Buildship team also creates new milestone releases and makes them available at the milestone update sites. Apply the following instructions to install the latest snapshot or milestone of Buildship into Eclipse. 1. In Eclipse, open the menu item _Help >> Install New Software_. 1. Paste the appropriate update site link into the _Work with_ text box. 1. Click the _Add_ button at the top of the screen, give the update site a name, and press _OK_. 1. Ensure that the option _Group Items by Category_ is enabled. 1. Select the top-level node _Buildship: Eclipse Plug-ins for Gradle_ once it appears. 1. Click _Next_. This may take a while. 1. Review the list of software that will be installed. Click _Next_ again. 1. Review and accept the licence agreement and click _Finish_. ## Updating from update site If you have already installed Buildship, you can update to the most recent version by opening the menu item _Help >> Check for Updates_. Note, that the update works only if Buildship was installed from the updates sites from download.eclipse.org or from builds.gradle.org, as listed above. If Buildship comes preinstalled in your Eclipse (for instance if you use the standard [Eclipse for Java developers](https://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/neon) package) then you have to do the update manually. To do that just follow the steps from the previous section.
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_111) on Fri Nov 25 14:34:39 CST 2016 --> <title>VideoFrameRef</title> <meta name="date" content="2016-11-25"> <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="VideoFrameRef"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../deprecated-list.html">Deprecated</a></li> <li><a href="../../index-all.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../org/openni/Version.html" title="class in org.openni"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../org/openni/VideoMode.html" title="class in org.openni"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../index.html?org/openni/VideoFrameRef.html" target="_top">Frames</a></li> <li><a href="VideoFrameRef.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.openni</div> <h2 title="Class VideoFrameRef" class="title">Class VideoFrameRef</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.openni.VideoFrameRef</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="typeNameLabel">VideoFrameRef</span> extends java.lang.Object</pre> <div class="block">The <a href="../../org/openni/VideoFrameRef.html" title="class in org.openni"><code>VideoFrameRef</code></a> class encapsulates a single video frame - the output of a <a href="../../org/openni/VideoStream.html" title="class in org.openni"><code>VideoStream</code></a> at a specific time. The data contained will be a single frame of color, IR, or depth video, along with associated meta data. An object of type <a href="../../org/openni/VideoFrameRef.html" title="class in org.openni"><code>VideoFrameRef</code></a> does not actually hold the data of the frame, but only a reference to it. OpenNI uses a ref-count to decide when the data buffer can be freed. Once the frame is no longer needed, it can be released by calling the <a href="../../org/openni/VideoFrameRef.html#release--"><code>release()</code></a> method. Although the finalization process of the garbage collector also releases the reference, it is preferable to manually release it by calling this method rather than to rely on a finalization process which may not run to completion for a long period of time. The usual way to obtain <a href="../../org/openni/VideoFrameRef.html" title="class in org.openni"><code>VideoFrameRef</code></a> objects is by a call to <a href="../../org/openni/VideoStream.html#readFrame--"><code>VideoStream.readFrame()</code></a>. Please note that the returned frame holds native memory. Although the finalization process of the garbage collector also disposes of the same system resources, it is preferable to manually free the associated resources by calling this method rather than to rely on a finalization process which may not run to completion for a long period of time. All data references by a <a href="../../org/openni/VideoFrameRef.html" title="class in org.openni"><code>VideoFrameRef</code></a> is stored as a primitive array of pixels. Each pixel will be of a type according to the configured pixel format (see <a href="../../org/openni/VideoMode.html" title="class in org.openni"><code>VideoMode</code></a>).</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#finalize--">finalize</a></span>()</code>&nbsp;</td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#getCropOriginX--">getCropOriginX</a></span>()</code> <div class="block">Indicates the X coordinate of the upper left corner of the crop window.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#getCropOriginY--">getCropOriginY</a></span>()</code> <div class="block">Indicates the Y coordinate of the upper left corner of the crop window.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#getCroppingEnabled--">getCroppingEnabled</a></span>()</code> <div class="block">Indicates whether cropping was enabled when the frame was produced.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>java.nio.ByteBuffer</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#getData--">getData</a></span>()</code> <div class="block">Getter function for the array of data pointed to by this object.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#getFrameIndex--">getFrameIndex</a></span>()</code> <div class="block">Frames are provided sequential frame ID numbers by the sensor that produced them.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>long</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#getHandle--">getHandle</a></span>()</code>&nbsp;</td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#getHeight--">getHeight</a></span>()</code> <div class="block">Gives the current height of this frame, measured in pixels.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code><a href="../../org/openni/SensorType.html" title="enum in org.openni">SensorType</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#getSensorType--">getSensorType</a></span>()</code> <div class="block">Getter function for the sensor type used to produce this frame.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#getStrideInBytes--">getStrideInBytes</a></span>()</code> <div class="block">Gives the length of one row of pixels, measured in bytes.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>long</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#getTimestamp--">getTimestamp</a></span>()</code> <div class="block">Provides a timestamp for the frame.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code><a href="../../org/openni/VideoMode.html" title="class in org.openni">VideoMode</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#getVideoMode--">getVideoMode</a></span>()</code> <div class="block">Returns a reference to the <a href="../../org/openni/VideoMode.html" title="class in org.openni"><code>VideoMode</code></a> object assigned to this frame.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#getWidth--">getWidth</a></span>()</code> <div class="block">Gives the current width of this frame, measured in pixels.</div> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../org/openni/VideoFrameRef.html#release--">release</a></span>()</code> <div class="block">Release the reference to the frame.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getData--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getData</h4> <pre>public final&nbsp;java.nio.ByteBuffer&nbsp;getData()</pre> <div class="block">Getter function for the array of data pointed to by this object.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>ByteBuffer object to the actual frame data array. Type of data can be determined according to the pixel format (can be obtained by calling <a href="../../org/openni/VideoFrameRef.html#getVideoMode--"><code>getVideoMode()</code></a>).</dd> </dl> </li> </ul> <a name="getSensorType--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getSensorType</h4> <pre>public&nbsp;<a href="../../org/openni/SensorType.html" title="enum in org.openni">SensorType</a>&nbsp;getSensorType()</pre> <div class="block">Getter function for the sensor type used to produce this frame. Used to determine whether this is an IR, Color or Depth frame. See the <a href="../../org/openni/SensorType.html" title="enum in org.openni"><code>SensorType</code></a> enumeration for all possible return values from this function.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The type of sensor used to produce this frame.</dd> </dl> </li> </ul> <a name="getVideoMode--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getVideoMode</h4> <pre>public final&nbsp;<a href="../../org/openni/VideoMode.html" title="class in org.openni">VideoMode</a>&nbsp;getVideoMode()</pre> <div class="block">Returns a reference to the <a href="../../org/openni/VideoMode.html" title="class in org.openni"><code>VideoMode</code></a> object assigned to this frame. This object describes the video mode the sensor was configured to when the frame was produced and can be used to determine the pixel format and resolution of the data. It will also provide the frame rate that the sensor was running at when it recorded this frame.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Reference to the <a href="../../org/openni/VideoMode.html" title="class in org.openni"><code>VideoMode</code></a> assigned to this frame.</dd> </dl> </li> </ul> <a name="getTimestamp--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getTimestamp</h4> <pre>public&nbsp;long&nbsp;getTimestamp()</pre> <div class="block">Provides a timestamp for the frame. The 'zero' point for this stamp is implementation specific, but all streams from the same device are guaranteed to use the same zero. This value can therefore be used to compute time deltas between frames from the same device, regardless of whether they are from the same stream.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Timestamp of frame, measured in microseconds from an arbitrary zero</dd> </dl> </li> </ul> <a name="getFrameIndex--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getFrameIndex</h4> <pre>public&nbsp;int&nbsp;getFrameIndex()</pre> <div class="block">Frames are provided sequential frame ID numbers by the sensor that produced them. If frame synchronization has been enabled for a device via <a href="../../org/openni/Device.html#setDepthColorSyncEnabled-boolean-"><code>Device.setDepthColorSyncEnabled(boolean)</code></a>, then frame numbers for corresponding frames of depth and color are guaranteed to match. If frame synchronization is not enabled, then there is no guarantee of matching frame indexes between <a href="../../org/openni/VideoStream.html" title="class in org.openni"><code>VideoStream</code></a> "VideoStreams". In the latter case, applications should use timestamps instead of frame indexes to align frames in time.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Index number for this frame.</dd> </dl> </li> </ul> <a name="getWidth--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getWidth</h4> <pre>public&nbsp;int&nbsp;getWidth()</pre> <div class="block">Gives the current width of this frame, measured in pixels. If cropping is enabled, this will be the width of the cropping window. If cropping is not enabled, then this will simply be equal to the X resolution of the <a href="../../org/openni/VideoMode.html" title="class in org.openni"><code>VideoMode</code></a> used to produce this frame.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Width of this frame in pixels.</dd> </dl> </li> </ul> <a name="getHeight--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHeight</h4> <pre>public&nbsp;int&nbsp;getHeight()</pre> <div class="block">Gives the current height of this frame, measured in pixels. If cropping is enabled, this will be the length of the cropping window. If cropping is not enabled, then this will simply be equal to the Y resolution of the <a href="../../org/openni/VideoMode.html" title="class in org.openni"><code>VideoMode</code></a> used to produce this frame.</div> </li> </ul> <a name="getCroppingEnabled--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getCroppingEnabled</h4> <pre>public&nbsp;boolean&nbsp;getCroppingEnabled()</pre> <div class="block">Indicates whether cropping was enabled when the frame was produced.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if cropping is enabled, false otherwise</dd> </dl> </li> </ul> <a name="getCropOriginX--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getCropOriginX</h4> <pre>public&nbsp;int&nbsp;getCropOriginX()</pre> <div class="block">Indicates the X coordinate of the upper left corner of the crop window.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Distance of crop origin from left side of image, in pixels.</dd> </dl> </li> </ul> <a name="getCropOriginY--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getCropOriginY</h4> <pre>public&nbsp;int&nbsp;getCropOriginY()</pre> <div class="block">Indicates the Y coordinate of the upper left corner of the crop window.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Distance of crop origin from top of image, in pixels.</dd> </dl> </li> </ul> <a name="getStrideInBytes--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getStrideInBytes</h4> <pre>public&nbsp;int&nbsp;getStrideInBytes()</pre> <div class="block">Gives the length of one row of pixels, measured in bytes. Primarily useful for indexing the array which contains the data.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Stride of the array which contains the image for this frame, in bytes</dd> </dl> </li> </ul> <a name="release--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>release</h4> <pre>public&nbsp;void&nbsp;release()</pre> <div class="block">Release the reference to the frame. Once this method is called, the object becomes invalid, and no method should be called other than the assignment operator, or passing this object to a <a href="../../org/openni/VideoStream.html" title="class in org.openni"><code>VideoStream</code></a>::readFrame() call. Although the finalization process of the garbage collector also releases the reference, it is preferable to manually release it by calling this method rather than to rely on a finalization process which may not run to completion for a long period of time.</div> </li> </ul> <a name="getHandle--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHandle</h4> <pre>public&nbsp;long&nbsp;getHandle()</pre> </li> </ul> <a name="finalize--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>finalize</h4> <pre>protected&nbsp;void&nbsp;finalize() throws java.lang.Throwable</pre> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code>finalize</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.Throwable</code></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../deprecated-list.html">Deprecated</a></li> <li><a href="../../index-all.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../org/openni/Version.html" title="class in org.openni"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../org/openni/VideoMode.html" title="class in org.openni"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../index.html?org/openni/VideoFrameRef.html" target="_top">Frames</a></li> <li><a href="VideoFrameRef.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "pile_set_name": "Github" }
(* Contribution to the Coq Library V6.3 (July 1999) *) (****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA ENS-CNRS *) (* Rocquencourt Lyon *) (* *) (* Coq V5.10 *) (* Nov 25th 1994 *) (* *) (****************************************************************************) (* conf_local_SL.v *) (****************************************************************************) (*****************************************************************************) (* Projet Coq - Calculus of Inductive Constructions V5.8 *) (*****************************************************************************) (* *) (* Meta-theory of the explicit substitution calculus lambda-env *) (* Amokrane Saibi *) (* *) (* September 1993 *) (* *) (*****************************************************************************) (* Confluence locale de sigma-lift *) Require Import TS. Require Import sur_les_relations. Require Import sigma_lift. Require Import determinePC_SL. Require Import resoudPC_SL. Definition e_local1 (b : wsort) (x y : TS b) := forall z : TS b, e_relSL _ x z -> exists u : TS b, e_relSLstar _ y u /\ e_relSLstar _ z u. Notation local1 := (e_local1 _) (only parsing). (* <Warning> : Syntax is discontinued *) (* app *) Goal forall x y : terms, reg_app x y -> e_local1 _ x y. simple induction 1; red in |- *; intros a b0 s z H0. pattern s, z in |- *; apply case_SL_reg_app with a b0; auto. exists (app (env a s) (env b0 s)); auto. Save local_app. Hint Resolve local_app. (* lambda *) Goal forall x y : terms, reg_lambda x y -> e_local1 _ x y. simple induction 1; red in |- *; intros a s z H0. pattern s, z in |- *; apply case_SL_reg_lambda with a; auto. exists (lambda (env a (lift s))); auto. Save local_lambda. Hint Resolve local_lambda. (* clos *) Goal forall x y : terms, reg_clos x y -> e_local1 _ x y. simple induction 1; red in |- *; intros a s t z H0. pattern t, z in |- *; apply case_SL_clos with a s; auto. exists (env a (comp s t)); auto. Save local_clos. Hint Resolve local_clos. (* varshift1 *) Goal forall x y : terms, reg_varshift1 x y -> e_local1 _ x y. simple induction 1; red in |- *; intros n z H0. pattern z in |- *; apply case_SL_varshift1 with n; auto. exists (var (S n)); auto. Save local_varshift1. Hint Resolve local_varshift1. (* varshift2 *) Goal forall x y : terms, reg_varshift2 x y -> e_local1 _ x y. simple induction 1; red in |- *; intros n s z H0. pattern z in |- *; apply case_SL_varshift2 with n s; auto. exists (env (var (S n)) s); auto. Save local_varshift2. Hint Resolve local_varshift2. (* fvarcons *) Goal forall x y : terms, reg_fvarcons x y -> e_local1 _ x y. simple induction 1; red in |- *; intros a s z H0. pattern z in |- *; apply case_SL_fvarcons with a s; intros. 3: assumption. exists a; auto. apply PC_fvarcons_ctxt_r with s; assumption. Save local_fvarcons. Hint Resolve local_fvarcons. (* fvarlift1 *) Goal forall x y : terms, reg_fvarlift1 x y -> e_local1 _ x y. simple induction 1; red in |- *; intros s z H0. pattern z in |- *; apply case_SL_fvarlift1 with s; intros. 3: assumption. exists (var 0); auto. apply PC_fvarlift1_ctxt_r' with s; assumption. Save local_fvarlift1. Hint Resolve local_fvarlift1. (* fvarlift2 *) Goal forall x y : terms, reg_fvarlift2 x y -> e_local1 _ x y. simple induction 1; red in |- *; intros s t z H0. pattern z in |- *; apply case_SL_fvarlift2 with s t; intros. 3: assumption. exists (env (var 0) t); auto. apply PC_fvarlift2_ctxt_r with s; assumption. Save local_fvarlift2. Hint Resolve local_fvarlift2. (* rvarcons *) Goal forall x y : terms, reg_rvarcons x y -> e_local1 _ x y. simple induction 1; red in |- *; intros n a s z H0. pattern z in |- *; apply case_SL_rvarcons with n a s; intros. 3: assumption. exists (env (var n) s); auto. apply PC_rvarcons_ctxt_r with a; assumption. Save local_rvarcons. Hint Resolve local_rvarcons. (* rvarlift1 *) Goal forall x y : terms, reg_rvarlift1 x y -> e_local1 _ x y. simple induction 1; red in |- *; intros n s z H0. pattern z in |- *; apply case_SL_rvarlift1 with n s; auto. exists (env (var n) (comp s shift)); auto. Save local_rvarlift1. Hint Resolve local_rvarlift1. (* rvarlift2 *) Goal forall x y : terms, reg_rvarlift2 x y -> e_local1 _ x y. simple induction 1; red in |- *; intros n s t z H0. pattern z in |- *; apply case_SL_rvarlift2 with n s t; auto. exists (env (var n) (comp s (comp shift t))); auto. Save local_rvarlift2. Hint Resolve local_rvarlift2. (* assenv *) Goal forall x y : sub_explicits, reg_assenv x y -> e_local1 _ x y. simple induction 1; red in |- *; intros s t u z H0. pattern u, z in |- *; apply case_SL_assenv with s t; auto. exists (comp s (comp t u)); auto. Save local_assenv. Hint Resolve local_assenv. (* mapenv *) Goal forall x y : sub_explicits, reg_mapenv x y -> e_local1 _ x y. simple induction 1; red in |- *; intros a s t z H0. pattern t, z in |- *; apply case_SL_mapenv with a s; auto. exists (cons (env a t) (comp s t)); auto. Save local_mapenv. Hint Resolve local_mapenv. (* shiftcons *) Goal forall x y : sub_explicits, reg_shiftcons x y -> e_local1 _ x y. simple induction 1; red in |- *; intros a s z H0. pattern z in |- *; apply case_SL_shiftcons with a s; intros. 3: assumption. exists s; auto. apply PC_shiftcons_ctxt_r with a; assumption. Save local_shiftcons. Hint Resolve local_shiftcons. (* shiftlift1 *) Goal forall x y : sub_explicits, reg_shiftlift1 x y -> e_local1 _ x y. simple induction 1; red in |- *; intros s z H0. pattern z in |- *; apply case_SL_shiflift1 with s; auto. exists (comp s shift); auto. Save local_shiftlift1. Hint Resolve local_shiftlift1. (* shiftlift2 *) Goal forall x y : sub_explicits, reg_shiftlift2 x y -> e_local1 _ x y. simple induction 1; red in |- *; intros s t z H0. pattern z in |- *; apply case_SL_shiflift2 with s t; auto. exists (comp s (comp shift t)); auto. Save local_shiftlift2. Hint Resolve local_shiftlift2. (* lift1 *) Goal forall x y : sub_explicits, reg_lift1 x y -> e_local1 _ x y. simple induction 1; red in |- *; intros s t z H0. pattern z in |- *; apply case_SL_lift1 with s t; auto. exists (lift (comp s t)); auto. Save local_lift1. Hint Resolve local_lift1. (* lift2 *) Goal forall x y : sub_explicits, reg_lift2 x y -> e_local1 _ x y. simple induction 1; red in |- *; intros s t u z H0. pattern z in |- *; apply case_SL_lift2 with s t u; auto. exists (comp (lift (comp s t)) u); auto. Save local_lift2. Hint Resolve local_lift2. (* liftenv *) Goal forall x y : sub_explicits, reg_liftenv x y -> e_local1 _ x y. simple induction 1; red in |- *; intros a s t z H0. pattern z in |- *; apply case_SL_liftenv with a s t; auto. exists (cons a (comp s t)); auto. Save local_liftenv. Hint Resolve local_liftenv. (* idl *) Goal forall x y : sub_explicits, reg_idl x y -> e_local1 _ x y. simple induction 1; red in |- *; intros s z H0. pattern s, z in |- *; apply case_SL_idl; auto. exists s; auto. Save local_idl. Hint Resolve local_idl. (* idr *) Goal forall x y : sub_explicits, reg_idr x y -> e_local1 _ x y. simple induction 1; red in |- *; intros s z H0. apply Ex_PQ; pattern s, z in |- *; apply case_SL_idr; auto. exists s; auto. Save local_idr. Hint Resolve local_idr. (* liftid *) Goal forall x y : sub_explicits, reg_liftid x y -> e_local1 _ x y. simple induction 1; red in |- *; intros z H0. pattern z in |- *; apply case_SL_liftid; auto. Save local_liftid. Hint Resolve local_liftid. (* id *) Goal forall x y : terms, reg_id x y -> e_local1 _ x y. simple induction 1; red in |- *; intros a z H0. apply Ex_PQ; pattern a, z in |- *; apply case_SL_reg_id; auto. exists a; auto 6. Save local_id. Hint Resolve local_id. (* systeme SL *) Goal forall (b : wsort) (x y : TS b), e_systemSL _ x y -> e_local1 _ x y. simple induction 1; auto. Save local_systemSL. Goal forall (b : wsort) (x y : TS b), e_relSL _ x y -> e_local1 _ x y. simple induction 1. (* systemSL *) intros; apply local_systemSL; assumption. (* contexte app gauche *) red in |- *; intros a a' b0 H0 H1 z H2. pattern z in |- *; apply case_SLapp with a b0. 3: assumption. intros a'' H3; elim (H1 a'' H3); intros a_ H4. elim H4; intros H5 H6. exists (app a_ b0); auto. intros b0' H3; exists (app a' b0'); auto. (* contexte app droit *) red in |- *; intros a b0 b0' H0 H1 z H2. pattern z in |- *; apply case_SLapp with a b0. 3: assumption. intros a' H3; exists (app a' b0'); auto. intros b0'' H3; elim (H1 b0'' H3); intros b0_ H4. elim H4; intros H5 H6. exists (app a b0_); auto. (* contexte lambda *) red in |- *; intros a a' H0 H1 z H2. pattern z in |- *; apply case_SLlambda with a. 2: assumption. intros a'' H3; elim (H1 a'' H3); intros a_ H4; elim H4; intros H5 H6. exists (lambda a_); auto. (* contexte env gauche *) red in |- *; intros a a' s H0 H1 z H2. apply Ex_PQ; generalize H0; pattern a, s, z in |- *; apply case_SLenv; auto. intros n H3; elim (case_SLvar n a' H3). intros n s1 H3; elim (case_SLvar n a' H3). intros a1 s1 H3; elim (case_SLvar 0 a' H3). intros s1 H3; elim (case_SLvar 0 a' H3). intros s1 s2 H3; elim (case_SLvar 0 a' H3). intros n a1 s1 H3; elim (case_SLvar (S n) a' H3). intros n s1 H3; elim (case_SLvar (S n) a' H3). intros n s1 s2 H3; elim (case_SLvar (S n) a' H3). intros a'' H3 H4; elim (H1 a'' H3); intros a_ H5; elim H5; intros H6 H7. exists (env a_ s); auto. intros s' H3 H4; exists (env a' s'); auto. (* contexte env droit *) red in |- *; intros a s s' H0 H1 z H2. apply Ex_PQ; generalize H0; pattern a, s, z in |- *; apply case_SLenv; auto. intros n H3; elim (case_SLshift s' H3). intros; apply PC_fvarcons_ctxt_r with s1; assumption. intros; apply PC_fvarlift1_ctxt_r' with s1; assumption. intros; apply PC_fvarlift2_ctxt_r with s1; assumption. intros; apply PC_rvarcons_ctxt_r with a1; assumption. intro H3; elim (case_SLid s' H3). intros a' H3 H4; exists (env a' s'); auto. intros s'' H3 H4; elim (H1 s'' H3); intros s_ H5; elim H5; intros H6 H7. exists (env a s_); auto. (* contexte cons gauche *) red in |- *; intros a a' s H0 H1 z H2. pattern z in |- *; apply case_SLcons with a s; auto. intros a'' H3; elim (H1 a'' H3); intros a_ H4; elim H4; intros H5 H6. exists (cons a_ s); auto. intros s' H3; exists (cons a' s'); auto. (* contexte cons droit *) red in |- *; intros a s s' H0 H1 z H2. pattern z in |- *; apply case_SLcons with a s; auto. intros a' H3; exists (cons a' s'); auto. intros s'' H3; elim (H1 s'' H3); intros s_ H4; elim H4; intros H5 H6. exists (cons a s_); auto. (* contexte comp gauche *) red in |- *; intros s s' t H0 H1 z H2. apply Ex_PQ; generalize H0; pattern s, t, z in |- *; apply case_SLcomp; auto. intros a t1 H3; elim (case_SLshift s' H3). intros t1 H3; elim (case_SLshift s' H3). intros t1 t2 H3; elim (case_SLshift s' H3). intro H3; elim (case_SLid s' H3). intros s'' H3; elim (H1 s'' H3); intros s_ H4; elim H4; intros H5 H6. exists (comp s_ t); auto. intros t' H3; exists (comp s' t'); auto. (* contexte comp droit *) red in |- *; intros s t t' H0 H1 z H2. apply Ex_PQ; generalize H0; pattern s, t, z in |- *; apply case_SLcomp; auto. intros; apply PC_shiftcons_ctxt_r with a; assumption. intro H3; elim (case_SLid t' H3). intros s' H3; exists (comp s' t'); auto. intros t'' H3; elim (H1 t'' H3); intros t_ H4; elim H4; intros H5 H6. exists (comp s t_); auto. (* contexte lift *) red in |- *; intros s s' H0 H1 z H2. generalize H0; pattern s, z in |- *; apply case_SLlift. 3: assumption. intro H3; elim (case_SLid s' H3). intros s'' H3; elim (H1 s'' H3); intros s_ H4; elim H4; intros H5 H6. exists (lift s_); auto. Save local_relSL. (*************************************************************) (* sigma-lift est localement confluente *) (*************************************************************) Theorem conf_local_SL : forall b : wsort, explicit_local_confluence _ (e_relSL b). red in |- *; red in |- *; intros b x y z H H0. generalize z H0. change (e_local1 _ x y) in |- *; apply local_relSL; assumption. Qed.
{ "pile_set_name": "Github" }
--- title: "Sinatra: README (Spanish)" layout: default --- <p><small>This page is also available in <a href="/intro.html">English</a>, <a href="/intro-zh.html">Chinese</a>, <a href="/intro-fr.html">French</a>, <a href="/intro-de.html">German</a>, <a href="/intro-hu.html">Hungarian</a>, <a href="/intro-ko.html">Korean</a>, <a href="/intro-pt-br.html">Portuguese (Brazilian)</a>, <a href="/intro-pt-pt.html">Portuguese (European)</a>, <a href="/intro-ru.html">Russian</a> and <a href="/intro-ja.html">Japanese</a>.</small></p> <h1>Introducción</h1> {% include README.es.html %}
{ "pile_set_name": "Github" }
# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # # Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. # # The contents of this file are subject to the terms of either the GNU # General Public License Version 2 only ("GPL") or the Common Development # and Distribution License("CDDL") (collectively, the "License"). You # may not use this file except in compliance with the License. You can # obtain a copy of the License at # https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html # or packager/legal/LICENSE.txt. See the License for the specific # language governing permissions and limitations under the License. # # When distributing the software, include this License Header Notice in each # file and include the License file at packager/legal/LICENSE.txt. # # GPL Classpath Exception: # Oracle designates this particular file as subject to the "Classpath" # exception as provided by Oracle in the GPL Version 2 section of the License # file that accompanied this code. # # Modifications: # If applicable, add the following below the License Header, with the fields # enclosed by brackets [] replaced by your own identifying information: # "Portions Copyright [year] [name of copyright owner]" # # Contributor(s): # If you wish your version of this file to be governed by only the CDDL or # only the GPL Version 2, indicate your decision by adding "[Contributor] # elects to include this software in this distribution under the [CDDL or GPL # Version 2] license." If you don't indicate a single choice of license, a # recipient has the option to distribute your version of this file under # either the CDDL, the GPL Version 2 or to extend the choice of license to # its licensees as provided above. However, if you add GPL Version 2 code # and therefore, elected the GPL Version 2 license, then the option applies # only if the new code is made subject to such option by the copyright # holder. # app.file=slsbnicmt testsuite.name=EJB_slsbnicmt testng.test.name=EJB_slsbnicmt #possible choices war|ear|jar contextroot=slsbnicmt archive.type=war ws.root=../.. #Definitely need to set this at local level deploy.platform=v3 result.output=${ws.root}/test-output
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta content="text/html; charset=iso-8859-1" http-equiv="content-type"> <title>Rename file</title> <link rel="stylesheet" type="text/css" href="Help.css"> </head> <body> <h1>Rename file</h1> <p>This tool will rename a user-specified input raster or vector data set, including all associated files.</p> <h2 class="SeeAlso">See Also:</h2> <ul> <li>None</li> </ul> <h2 class="SeeAlso">Scripting:</h2> <p>This is an example of a Python script using this tool:</p> <p style="background-color: rgb(240,240,240);"> <code> wd = pluginHost.getWorkingDirectory()&#10;<br> input_file = wd + "input.dep"&#10;<br> output_file = wd + "output.dep"&#10;<br> args = [input_file, output_file]&#10;<br> pluginHost.runPlugin("RenameFile", args, False)&#10;<br> </code> </p> <p>And the following is a Groovy script also using this tool:</p> <p style="background-color: rgb(240,240,240);"> <code> def wd = pluginHost.getWorkingDirectory()&#10;<br> def inputFile = wd + "input.dep"&#10;<br> def outputFile = wd + "output.dep"&#10;<br> String[] args = [inputFile, outputFile]&#10;<br> pluginHost.runPlugin("RenameFile", args, false)&#10;<br> </code> </p> <h2 class="SeeAlso">Credits:</h2> <ul> <li>John Lindsay (jlindsay@uoguelph.ca, 2013)</li> </ul> </body> </html>
{ "pile_set_name": "Github" }
#ifdef UCD_COMPATIBLE #include <net-snmp/agent/var_struct.h> #else #error "Please update your headers or configure using --enable-ucd-snmp-compatibility" #endif
{ "pile_set_name": "Github" }
#!/usr/bin/python # vim:sw=4:ts=4:et: # 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/. # This script uses addr2line (part of binutils) to post-process the entries # produced by NS_FormatCodeAddress(), which on Linux often lack a function # name, a file name and a line number. import subprocess import sys import re import os import pty import termios from StringIO import StringIO class unbufferedLineConverter: """ Wrap a child process that responds to each line of input with one line of output. Uses pty to trick the child into providing unbuffered output. """ def __init__(self, command, args = []): pid, fd = pty.fork() if pid == 0: # We're the child. Transfer control to command. os.execvp(command, [command] + args) else: # Disable echoing. attr = termios.tcgetattr(fd) attr[3] = attr[3] & ~termios.ECHO termios.tcsetattr(fd, termios.TCSANOW, attr) # Set up a file()-like interface to the child process self.r = os.fdopen(fd, "r", 1) self.w = os.fdopen(os.dup(fd), "w", 1) def convert(self, line): self.w.write(line + "\n") return (self.r.readline().rstrip("\r\n"), self.r.readline().rstrip("\r\n")) @staticmethod def test(): assert unbufferedLineConverter("rev").convert("123") == "321" assert unbufferedLineConverter("cut", ["-c3"]).convert("abcde") == "c" print "Pass" objdump_section_re = re.compile("^ [0-9a-f]* ([0-9a-f ]{8}) ([0-9a-f ]{8}) ([0-9a-f ]{8}) ([0-9a-f ]{8}).*") def elf_section(file, section): """ Return the requested ELF section of the file as a str, representing a sequence of bytes. """ # We can read the .gnu_debuglink section using either of: # objdump -s --section=.gnu_debuglink $file # readelf -x .gnu_debuglink $file # Since readelf prints things backwards on little-endian platforms # for some versions only (backwards on Fedora Core 6, forwards on # Fedora 7), use objdump. objdump = subprocess.Popen(['objdump', '-s', '--section=' + section, file], stdout=subprocess.PIPE, # redirect stderr so errors don't get printed stderr=subprocess.PIPE) (objdump_stdout, objdump_stderr) = objdump.communicate() if objdump.returncode != 0: return None result = "" # Turn hexadecimal dump into the bytes it represents for line in StringIO(objdump_stdout).readlines(): m = objdump_section_re.match(line) if m: for gnum in [0, 1, 2, 3]: word = m.groups()[gnum] if word != " ": for idx in [0, 2, 4, 6]: result += chr(int(word[idx:idx+2], 16)) return result # FIXME: Hard-coded to gdb defaults (works on Fedora and Ubuntu). global_debug_dir = '/usr/lib/debug'; endian_re = re.compile("\s*Data:\s+.*(little|big) endian.*$") # Table of 256 values, per documentation of .gnu_debuglink sections. gnu_debuglink_crc32_table = [ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d ] def gnu_debuglink_crc32(stream): # Note that python treats bitwise operators as though integers have # an infinite number of bits (and thus such that negative integers # 1-pad out to infinity). crc = 0xffffffff while True: # Choose to read in 4096 byte chunks. bytes = stream.read(4096) if len(bytes) == 0: break for byte in bytes: crc = gnu_debuglink_crc32_table[(crc ^ ord(byte)) & 0xff] ^ (crc >> 8) return ~crc & 0xffffffff def separate_debug_file_for(file): """ Finds a separated file with the debug sections for a binary. Such files are commonly installed by debug packages on linux distros. Rules for finding them are documented in: https://sourceware.org/gdb/current/onlinedocs/gdb/Separate-Debug-Files.html """ def have_debug_file(debugfile): return os.path.isfile(debugfile) endian = None readelf = subprocess.Popen(['readelf', '-h', file], stdout=subprocess.PIPE) for line in readelf.stdout.readlines(): m = endian_re.match(line) if m: endian = m.groups()[0] break readelf.terminate() if endian is None: sys.stderr.write("Could not determine endianness of " + file + "\n") return None def word32(s): if type(s) != str or len(s) != 4: raise StandardError("expected 4 byte string input") s = list(s) if endian == "big": s.reverse() return sum(map(lambda idx: ord(s[idx]) * (256 ** idx), range(0, 4))) buildid = elf_section(file, ".note.gnu.build-id"); if buildid is not None: # The build ID is an ELF note section, so it begins with a # name size (4), a description size (size of contents), a # type (3), and the name "GNU\0". note_header = buildid[0:16] buildid = buildid[16:] if word32(note_header[0:4]) != 4 or \ word32(note_header[4:8]) != len(buildid) or \ word32(note_header[8:12]) != 3 or \ note_header[12:16] != "GNU\0": sys.stderr.write("malformed .note.gnu.build_id in " + file + "\n") else: buildid = "".join(map(lambda ch: "%02X" % ord(ch), buildid)).lower() f = os.path.join(global_debug_dir, ".build-id", buildid[0:2], buildid[2:] + ".debug") if have_debug_file(f): return f debuglink = elf_section(file, ".gnu_debuglink"); if debuglink is not None: # The debuglink section contains a string, ending with a # null-terminator and then 0 to three bytes of padding to fill the # current 32-bit unit. (This padding is usually null bytes, but # I've seen null-null-H, on Ubuntu x86_64.) This is followed by # a 4-byte CRC. debuglink_name = debuglink[:-4] null_idx = debuglink_name.find("\0") if null_idx == -1 or null_idx + 4 < len(debuglink_name): sys.stderr.write("Malformed .gnu_debuglink in " + file + "\n") return None debuglink_name = debuglink_name[0:null_idx] debuglink_crc = word32(debuglink[-4:]) dirname = os.path.dirname(file) possible_files = [ os.path.join(dirname, debuglink_name), os.path.join(dirname, ".debug", debuglink_name), os.path.join(global_debug_dir, dirname.lstrip("/"), debuglink_name) ] for f in possible_files: if have_debug_file(f): fio = open(f, mode="r") file_crc = gnu_debuglink_crc32(fio) fio.close() if file_crc == debuglink_crc: return f return None elf_type_re = re.compile("^\s*Type:\s+(\S+)") elf_text_section_re = re.compile("^\s*\[\s*\d+\]\s+\.text\s+\w+\s+(\w+)\s+(\w+)\s+") def address_adjustment_for(file): """ Return the address adjustment to use for a file. addr2line wants offsets relative to the base address for shared libraries, but it wants addresses including the base address offset for executables. This returns the appropriate address adjustment to add to an offset within file. See bug 230336. """ readelf = subprocess.Popen(['readelf', '-h', file], stdout=subprocess.PIPE) elftype = None for line in readelf.stdout.readlines(): m = elf_type_re.match(line) if m: elftype = m.groups()[0] break readelf.terminate() if elftype != "EXEC": # If we're not dealing with an executable, return 0. return 0 adjustment = 0 readelf = subprocess.Popen(['readelf', '-S', file], stdout=subprocess.PIPE) for line in readelf.stdout.readlines(): m = elf_text_section_re.match(line) if m: # Subtract the .text section's offset within the # file from its base address. adjustment = int(m.groups()[0], 16) - int(m.groups()[1], 16); break readelf.terminate() return adjustment addr2lines = {} def addressToSymbol(file, address): converter = None address_adjustment = None cache = None if not file in addr2lines: debug_file = separate_debug_file_for(file) or file converter = unbufferedLineConverter('/usr/bin/addr2line', ['-C', '-f', '-e', debug_file]) address_adjustment = address_adjustment_for(file) cache = {} addr2lines[file] = (converter, address_adjustment, cache) else: (converter, address_adjustment, cache) = addr2lines[file] if address in cache: return cache[address] result = converter.convert(hex(int(address, 16) + address_adjustment)) cache[address] = result return result # Matches lines produced by NS_FormatCodeAddress(). line_re = re.compile("^(.*#\d+: )(.+)\[(.+) \+(0x[0-9A-Fa-f]+)\](.*)$") def fixSymbols(line): result = line_re.match(line) if result is not None: (before, fn, file, address, after) = result.groups() if os.path.exists(file) and os.path.isfile(file): (name, fileline) = addressToSymbol(file, address) # If addr2line gave us something useless, keep what we had before. if name == "??": name = fn if fileline == "??:0" or fileline == "??:?": fileline = file nl = '\n' if line[-1] == '\n' else '' return "%s%s (%s)%s%s" % (before, name, fileline, after, nl) else: sys.stderr.write("Warning: File \"" + file + "\" does not exist.\n") return line else: return line if __name__ == "__main__": for line in sys.stdin: sys.stdout.write(fixSymbols(line))
{ "pile_set_name": "Github" }
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ // ========================================================================== // Print styles. // Inlined to avoid the additional HTTP request: h5bp.com/r // ========================================================================== @media print { *, *:before, *:after { background: transparent !important; color: #000 !important; // Black prints faster: h5bp.com/s box-shadow: none !important; text-shadow: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } // Don't show links that are fragment identifiers, // or use the `javascript:` pseudo protocol a[href^="#"]:after, a[href^="javascript:"]:after { content: ""; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } thead { display: table-header-group; // h5bp.com/t } tr, img { page-break-inside: avoid; } img { max-width: 100% !important; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } // Bootstrap specific changes start // // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 // Once fixed, we can just straight up remove this. select { background: #fff !important; } // Bootstrap components .navbar { display: none; } .btn, .dropup > .btn { > .caret { border-top-color: #000 !important; } } .label { border: 1px solid #000; } .table { border-collapse: collapse !important; td, th { background-color: #fff !important; } } .table-bordered { th, td { border: 1px solid #ddd !important; } } // Bootstrap specific changes end }
{ "pile_set_name": "Github" }
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ // ========================================================================== // Print styles. // Inlined to avoid the additional HTTP request: h5bp.com/r // ========================================================================== @media print { *, *:before, *:after { background: transparent !important; color: #000 !important; // Black prints faster: h5bp.com/s box-shadow: none !important; text-shadow: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } // Don't show links that are fragment identifiers, // or use the `javascript:` pseudo protocol a[href^="#"]:after, a[href^="javascript:"]:after { content: ""; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } thead { display: table-header-group; // h5bp.com/t } tr, img { page-break-inside: avoid; } img { max-width: 100% !important; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } // Bootstrap specific changes start // // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 // Once fixed, we can just straight up remove this. select { background: #fff !important; } // Bootstrap components .navbar { display: none; } .btn, .dropup > .btn { > .caret { border-top-color: #000 !important; } } .label { border: 1px solid #000; } .table { border-collapse: collapse !important; td, th { background-color: #fff !important; } } .table-bordered { th, td { border: 1px solid #ddd !important; } } // Bootstrap specific changes end }
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>arm_fir_decimate_init_f32.c File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="proglogo"><img alt="CMSIS Logo" src="CMSIS_Logo_Final.png"></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-DSP &#160;<span id="projectnumber">Verison 1.1.0</span> </div> <div id="projectbrief">CMSIS DSP Software Library</div> </td> </tr> </tbody> </table> </div> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <li><a href="../../General/html/index.html"><span>CMSIS</span></a></li> <li><a href="../../Core/html/index.html"><span>CORE</span></a></li> <li class="current"><a href="../../DSP/html/index.html"><span>DSP</span></a></li> <li><a href="../../RTOS/html/index.html"><span>RTOS API</span></a></li> <li><a href="../../SVD/html/index.html"><span>SVD</span></a></li> </ul> </div> <!-- Generated by Doxygen 1.7.5.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('arm__fir__decimate__init__f32_8c.html',''); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">arm_fir_decimate_init_f32.c File Reference</div> </div> </div> <div class="contents"> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="func-members"></a> Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="arm__math_8h.html#a5e459c6409dfcd2927bb8a57491d7cf6">arm_status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___f_i_r__decimate.html#gaaa2524b08220fd6c3f753e692ffc7d3b">arm_fir_decimate_init_f32</a> (<a class="el" href="structarm__fir__decimate__instance__f32.html">arm_fir_decimate_instance_f32</a> *S, uint16_t numTaps, uint8_t M, <a class="el" href="arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715">float32_t</a> *pCoeffs, <a class="el" href="arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715">float32_t</a> *pState, uint32_t <a class="el" href="arm__variance__example__f32_8c.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a>)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialization function for the floating-point FIR decimator. <a href="group___f_i_r__decimate.html#gaaa2524b08220fd6c3f753e692ffc7d3b"></a><br/></td></tr> </table> </div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="arm__fir__decimate__init__f32_8c.html">arm_fir_decimate_init_f32.c</a> </li> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <li class="footer">Generated on Wed Mar 28 2012 15:38:07 for CMSIS-DSP by ARM Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li> --> </li> </ul> </div> </body> </html>
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="/benchmark/js/jquery.min.js"></script> <script type="text/javascript" src="/benchmark/js/js.cookie.js"></script> <title>BenchmarkTest02523</title> </head> <body> <form action="/benchmark/trustbound-01/BenchmarkTest02523" method="POST" id="FormBenchmarkTest02523"> <div><label>Please enter your details:</label></div> <br/> <div><label>Email:</label></div> <div><input type="text" id="email" name="email"></input></div> <div><label>Password:</label></div> <div><input type="text" id="password" name="password" value=""></input></div> <div>&nbsp</div> <div><label>Parameter: BenchmarkTest02523 <BR> Value:</label> <input type="text" id="BenchmarkTest02523" name="BenchmarkTest02523" value="color"></input></div> <br/> <div><input type="submit" value="Login" /></div> </form> </body> </html>
{ "pile_set_name": "Github" }
//----------------------------------------------------------------------------- // This code is licensed to you under the terms of the GNU GPL, version 2 or, // at your option, any later version. See the LICENSE.txt file for the text of // the license. //----------------------------------------------------------------------------- // CRC16 //----------------------------------------------------------------------------- #ifndef __CRC16_H #define __CRC16_H #include "common.h" #define CRC16_POLY_CCITT 0x1021 #define CRC16_POLY_KERMIT 0x8408 #define CRC16_POLY_LEGIC 0xc6c6 //0x6363 #define CRC16_POLY_DNP 0x3d65 #define X25_CRC_CHECK ((uint16_t)(~0xF0B8 & 0xFFFF)) // use this for checking of a correct crc typedef enum { CRC_NONE, CRC_11784, CRC_14443_A, CRC_14443_B, CRC_15693, CRC_ICLASS, CRC_FELICA, CRC_LEGIC, CRC_CCITT, CRC_KERMIT, CRC_XMODEM, CRC_CRYPTORF, } CrcType_t; uint16_t update_crc16_ex(uint16_t crc, uint8_t c, uint16_t polynomial); uint16_t update_crc16(uint16_t crc, uint8_t c); uint16_t Crc16(uint8_t const *d, size_t length, uint16_t remainder, uint16_t polynomial, bool refin, bool refout); uint16_t Crc16ex(CrcType_t ct, const uint8_t *d, size_t n); void compute_crc(CrcType_t ct, const uint8_t *d, size_t n, uint8_t *first, uint8_t *second); bool check_crc(CrcType_t ct, const uint8_t *d, size_t n); // Calculate CRC-16/CCITT-FALSE uint16_t crc16_ccitt(uint8_t const *d, size_t n); // Calculate CRC-16/KERMIT (FDX-B ISO11784/85) LF uint16_t crc16_fdx(uint8_t const *d, size_t n); // Calculate CRC-16/KERMIT uint16_t crc16_kermit(uint8_t const *d, size_t n); // Calculate CRC-16/XMODEM (FeliCa) uint16_t crc16_xmodem(uint8_t const *d, size_t n); // Calculate CRC-16/X25 (ISO15693, ISO14443 CRC-B,ISO/IEC 13239) uint16_t crc16_x25(uint8_t const *d, size_t n); // Calculate CRC-16/CRC-A (ISO14443 CRC-A) uint16_t crc16_a(uint8_t const *d, size_t n); // Calculate CRC-16/iCLASS uint16_t crc16_iclass(uint8_t const *d, size_t n); // Calculate CRC-16/Legic // the initial_value is based on the previous legic_Crc8 of the UID. // ie: uidcrc = 0x78 then initial_value == 0x7878 uint16_t crc16_legic(uint8_t const *d, size_t n, uint8_t uidcrc); // table implementation void init_table(CrcType_t crctype); void reset_table(void); void generate_table(uint16_t polynomial, bool refin); uint16_t crc16_fast(uint8_t const *d, size_t n, uint16_t initval, bool refin, bool refout); #endif
{ "pile_set_name": "Github" }
<?php namespace Opencart\Application\Controller\Catalog; class Download extends \Opencart\System\Engine\Controller { private $error = []; public function index() { $this->load->language('catalog/download'); $this->document->setTitle($this->language->get('heading_title')); $this->load->model('catalog/download'); $this->getList(); } public function add() { $this->load->language('catalog/download'); $this->document->setTitle($this->language->get('heading_title')); $this->load->model('catalog/download'); if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) { $this->model_catalog_download->addDownload($this->request->post); $this->session->data['success'] = $this->language->get('text_success'); $url = ''; if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $this->response->redirect($this->url->link('catalog/download', 'user_token=' . $this->session->data['user_token'] . $url)); } $this->getForm(); } public function edit() { $this->load->language('catalog/download'); $this->document->setTitle($this->language->get('heading_title')); $this->load->model('catalog/download'); if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) { $this->model_catalog_download->editDownload($this->request->get['download_id'], $this->request->post); $this->session->data['success'] = $this->language->get('text_success'); $url = ''; if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $this->response->redirect($this->url->link('catalog/download', 'user_token=' . $this->session->data['user_token'] . $url)); } $this->getForm(); } public function delete() { $this->load->language('catalog/download'); $this->document->setTitle($this->language->get('heading_title')); $this->load->model('catalog/download'); if (isset($this->request->post['selected']) && $this->validateDelete()) { foreach ($this->request->post['selected'] as $download_id) { $this->model_catalog_download->deleteDownload($download_id); } $this->session->data['success'] = $this->language->get('text_success'); $url = ''; if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $this->response->redirect($this->url->link('catalog/download', 'user_token=' . $this->session->data['user_token'] . $url)); } $this->getList(); } protected function getList() { if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'dd.name'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; } if (isset($this->request->get['page'])) { $page = (int)$this->request->get['page']; } else { $page = 1; } $url = ''; if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $data['breadcrumbs'] = []; $data['breadcrumbs'][] = [ 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token']) ]; $data['breadcrumbs'][] = [ 'text' => $this->language->get('heading_title'), 'href' => $this->url->link('catalog/download', 'user_token=' . $this->session->data['user_token'] . $url) ]; $data['add'] = $this->url->link('catalog/download|add', 'user_token=' . $this->session->data['user_token'] . $url); $data['delete'] = $this->url->link('catalog/download|delete', 'user_token=' . $this->session->data['user_token'] . $url); $data['downloads'] = []; $filter_data = [ 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $this->config->get('config_pagination'), 'limit' => $this->config->get('config_pagination') ]; $download_total = $this->model_catalog_download->getTotalDownloads(); $results = $this->model_catalog_download->getDownloads($filter_data); foreach ($results as $result) { $data['downloads'][] = [ 'download_id' => $result['download_id'], 'name' => $result['name'], 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), 'edit' => $this->url->link('catalog/download|edit', 'user_token=' . $this->session->data['user_token'] . '&download_id=' . $result['download_id'] . $url) ]; } if (isset($this->error['warning'])) { $data['error_warning'] = $this->error['warning']; } else { $data['error_warning'] = ''; } if (isset($this->session->data['success'])) { $data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $data['success'] = ''; } if (isset($this->request->post['selected'])) { $data['selected'] = (array)$this->request->post['selected']; } else { $data['selected'] = []; } $url = ''; if ($order == 'ASC') { $url .= '&order=DESC'; } else { $url .= '&order=ASC'; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $data['sort_name'] = $this->url->link('catalog/download', 'user_token=' . $this->session->data['user_token'] . '&sort=dd.name' . $url); $data['sort_date_added'] = $this->url->link('catalog/download', 'user_token=' . $this->session->data['user_token'] . '&sort=d.date_added' . $url); $url = ''; if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } $data['pagination'] = $this->load->controller('common/pagination', [ 'total' => $download_total, 'page' => $page, 'limit' => $this->config->get('config_pagination'), 'url' => $this->url->link('catalog/download', 'user_token=' . $this->session->data['user_token'] . $url . '&page={page}') ]); $data['results'] = sprintf($this->language->get('text_pagination'), ($download_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($download_total - $this->config->get('config_pagination'))) ? $download_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $download_total, ceil($download_total / $this->config->get('config_pagination'))); $data['sort'] = $sort; $data['order'] = $order; $data['header'] = $this->load->controller('common/header'); $data['column_left'] = $this->load->controller('common/column_left'); $data['footer'] = $this->load->controller('common/footer'); $this->response->setOutput($this->load->view('catalog/download_list', $data)); } protected function getForm() { $data['text_form'] = !isset($this->request->get['download_id']) ? $this->language->get('text_add') : $this->language->get('text_edit'); $data['user_token'] = $this->session->data['user_token']; if (isset($this->error['warning'])) { $data['error_warning'] = $this->error['warning']; } else { $data['error_warning'] = ''; } if (isset($this->error['name'])) { $data['error_name'] = $this->error['name']; } else { $data['error_name'] = []; } if (isset($this->error['filename'])) { $data['error_filename'] = $this->error['filename']; } else { $data['error_filename'] = ''; } if (isset($this->error['mask'])) { $data['error_mask'] = $this->error['mask']; } else { $data['error_mask'] = ''; } $url = ''; if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $data['breadcrumbs'] = []; $data['breadcrumbs'][] = [ 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token']) ]; $data['breadcrumbs'][] = [ 'text' => $this->language->get('heading_title'), 'href' => $this->url->link('catalog/download', 'user_token=' . $this->session->data['user_token'] . $url) ]; if (!isset($this->request->get['download_id'])) { $data['action'] = $this->url->link('catalog/download|add', 'user_token=' . $this->session->data['user_token'] . $url); } else { $data['action'] = $this->url->link('catalog/download|edit', 'user_token=' . $this->session->data['user_token'] . '&download_id=' . $this->request->get['download_id'] . $url); } $data['cancel'] = $this->url->link('catalog/download', 'user_token=' . $this->session->data['user_token'] . $url); $this->load->model('localisation/language'); $data['languages'] = $this->model_localisation_language->getLanguages(); if (isset($this->request->get['download_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) { $download_info = $this->model_catalog_download->getDownload($this->request->get['download_id']); } $data['user_token'] = $this->session->data['user_token']; if (isset($this->request->get['download_id'])) { $data['download_id'] = (int)$this->request->get['download_id']; } else { $data['download_id'] = 0; } if (isset($this->request->post['download_description'])) { $data['download_description'] = $this->request->post['download_description']; } elseif (!empty($download_info)) { $data['download_description'] = $this->model_catalog_download->getDescriptions($this->request->get['download_id']); } else { $data['download_description'] = []; } if (isset($this->request->post['filename'])) { $data['filename'] = $this->request->post['filename']; } elseif (!empty($download_info)) { $data['filename'] = $download_info['filename']; } else { $data['filename'] = ''; } if (isset($this->request->post['mask'])) { $data['mask'] = $this->request->post['mask']; } elseif (!empty($download_info)) { $data['mask'] = $download_info['mask']; } else { $data['mask'] = ''; } $data['header'] = $this->load->controller('common/header'); $data['column_left'] = $this->load->controller('common/column_left'); $data['footer'] = $this->load->controller('common/footer'); $this->response->setOutput($this->load->view('catalog/download_form', $data)); } protected function validateForm() { if (!$this->user->hasPermission('modify', 'catalog/download')) { $this->error['warning'] = $this->language->get('error_permission'); } foreach ($this->request->post['download_description'] as $language_id => $value) { if ((utf8_strlen(trim($value['name'])) < 3) || (utf8_strlen($value['name']) > 64)) { $this->error['name'][$language_id] = $this->language->get('error_name'); } } if ((utf8_strlen(trim($this->request->post['filename'])) < 3) || (utf8_strlen($this->request->post['filename']) > 128)) { $this->error['filename'] = $this->language->get('error_filename'); } if (!is_file(DIR_DOWNLOAD . $this->request->post['filename'])) { $this->error['filename'] = $this->language->get('error_exists'); } if ((utf8_strlen(trim($this->request->post['mask'])) < 3) || (utf8_strlen($this->request->post['mask']) > 128)) { $this->error['mask'] = $this->language->get('error_mask'); } if ($this->error && !isset($this->error['warning'])) { $this->error['warning'] = $this->language->get('error_warning'); } return !$this->error; } protected function validateDelete() { if (!$this->user->hasPermission('modify', 'catalog/download')) { $this->error['warning'] = $this->language->get('error_permission'); } $this->load->model('catalog/product'); foreach ($this->request->post['selected'] as $download_id) { $product_total = $this->model_catalog_product->getTotalProductsByDownloadId($download_id); if ($product_total) { $this->error['warning'] = sprintf($this->language->get('error_product'), $product_total); } } return !$this->error; } public function report() { $this->load->language('catalog/download'); if (isset($this->request->get['download_id'])) { $download_id = (int)$this->request->get['download_id']; } else { $download_id = 0; } if (isset($this->request->get['page'])) { $page = (int)$this->request->get['page']; } else { $page = 1; } $data['reports'] = []; $this->load->model('catalog/download'); $this->load->model('customer/customer'); $this->load->model('setting/store'); $results = $this->model_catalog_download->getReports($download_id, ($page - 1) * 10, 10); foreach ($results as $result) { $store_info = $this->model_setting_store->getStore($result['store_id']); if ($store_info) { $store = $store_info['name']; } elseif (!$result['store_id']) { $store = $this->config->get('config_name'); } else { $store = ''; } $data['reports'][] = [ 'ip' => $result['ip'], 'account' => $this->model_customer_customer->getTotalCustomersByIp($result['ip']), 'store' => $store, 'country' => $result['country'], 'date_added' => date($this->language->get('datetime_format'), strtotime($result['date_added'])), 'filter_ip' => $this->url->link('customer/customer', 'user_token=' . $this->session->data['user_token'] . '&filter_ip=' . $result['ip']) ]; } $report_total = $this->model_catalog_download->getTotalReports($download_id); $data['pagination'] = $this->load->controller('common/pagination', [ 'total' => $report_total, 'page' => $page, 'limit' => $this->config->get('config_pagination'), 'url' => $this->url->link('catalog/download|report', 'user_token=' . $this->session->data['user_token'] . '&download_id=' . $download_id . '&page={page}') ]); $data['results'] = sprintf($this->language->get('text_pagination'), ($report_total) ? (($page - 1) * 10) + 1 : 0, ((($page - 1) * 10) > ($report_total - 10)) ? $report_total : ((($page - 1) * 10) + 10), $report_total, ceil($report_total / 10)); $this->response->setOutput($this->load->view('catalog/download_report', $data)); } public function upload() { $this->load->language('catalog/download'); $json = []; // Check user has permission if (!$this->user->hasPermission('modify', 'catalog/download')) { $json['error'] = $this->language->get('error_permission'); } if (!$json) { if (!empty($this->request->files['file']['name']) && is_file($this->request->files['file']['tmp_name'])) { // Sanitize the filename $filename = basename(html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8')); // Validate the filename length if ((utf8_strlen($filename) < 3) || (utf8_strlen($filename) > 128)) { $json['error'] = $this->language->get('error_filename'); } // Allowed file extension types $allowed = []; $extension_allowed = preg_replace('~\r?\n~', "\n", $this->config->get('config_file_ext_allowed')); $filetypes = explode("\n", $extension_allowed); foreach ($filetypes as $filetype) { $allowed[] = trim($filetype); } if (!in_array(strtolower(substr(strrchr($filename, '.'), 1)), $allowed)) { $json['error'] = $this->language->get('error_filetype'); } // Allowed file mime types $allowed = []; $mime_allowed = preg_replace('~\r?\n~', "\n", $this->config->get('config_file_mime_allowed')); $filetypes = explode("\n", $mime_allowed); foreach ($filetypes as $filetype) { $allowed[] = trim($filetype); } if (!in_array($this->request->files['file']['type'], $allowed)) { $json['error'] = $this->language->get('error_filetype'); } // Check to see if any PHP files are trying to be uploaded $content = file_get_contents($this->request->files['file']['tmp_name']); if (preg_match('/\<\?php/i', $content)) { $json['error'] = $this->language->get('error_filetype'); } // Return any upload error if ($this->request->files['file']['error'] != UPLOAD_ERR_OK) { $json['error'] = $this->language->get('error_upload_' . $this->request->files['file']['error']); } } else { $json['error'] = $this->language->get('error_upload'); } } if (!$json) { $file = $filename . '.' . token(32); move_uploaded_file($this->request->files['file']['tmp_name'], DIR_DOWNLOAD . $file); $json['filename'] = $file; $json['mask'] = $filename; $json['success'] = $this->language->get('text_upload'); } $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function autocomplete() { $json = []; if (isset($this->request->get['filter_name'])) { $this->load->model('catalog/download'); $filter_data = [ 'filter_name' => $this->request->get['filter_name'], 'start' => 0, 'limit' => 5 ]; $results = $this->model_catalog_download->getDownloads($filter_data); foreach ($results as $result) { $json[] = [ 'download_id' => $result['download_id'], 'name' => strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')) ]; } } $sort_order = []; foreach ($json as $key => $value) { $sort_order[$key] = $value['name']; } array_multisort($sort_order, SORT_ASC, $json); $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } }
{ "pile_set_name": "Github" }
/** * Brazilian translation for bootstrap-datetimepicker * Cauan Cabral <cauan@radig.com.br> */ ;(function($){ $.fn.datetimepicker.dates['pt-BR'] = { days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado", "Domingo"], daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"], daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"], months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], today: "Hoje", suffix: [], meridiem: [] }; }(jQuery));
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <ows:ExceptionReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows/1.1" version="1.1.0" xml:lang="en-US" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd"> <ows:Exception exceptionCode="MissingParameterValue" locator="format"> <ows:ExceptionText>msWCSGetCoverage(): WCS server error. Missing required FORMAT parameter.</ows:ExceptionText> </ows:Exception> </ows:ExceptionReport>
{ "pile_set_name": "Github" }
<html> <body> <h1 align="center"><code>Schema.yaml</code> 詳解</h1> <h2></h2> <hr> <h2>開始之前</h2> <pre><code># Rime schema # encoding: utf-8 </code></pre> <h2>描述檔</h2> <ol><li><code>name:</code> 方案的顯示名偁〔即出現於方案選單中以示人的,通常爲中文〕</li> <li><code>schema_id:</code> 方案內部名,在代碼中引用此方案時以此名爲正,通常由英文、數字、下劃線組成</li> <li><code>author:</code> 發明人、撰寫者。如果您對方案做出了修改,請保留原作者名,並將自己的名字加在後面</li> <li><code>description:</code> 請簡要描述方案歷史、碼表來源、該方案規則等</li> <li><code>dependencies:</code> 如果本方案依賴於其它方案〔通常來說會依頼其它方案做爲反查,抑或是兩種或多種方案混用時〕</li> <li><code>version:</code> 版本號,在發佈新版前請確保已陞版本號</li> </ol> <ul><h4><strong>示例</strong></h4> <pre><code>schema: name: "蒼頡檢字法" schema_id: cangjie6 author: - "發明人 朱邦復先生、沈紅蓮女士" dependencies: - luna_pinyin - jyutping - zyenpheng description: | 第六代倉頡輸入法 碼表由雪齋、惜緣和crazy4u整理 version: 0.19 </code></pre></ul> <h2>開關</h2> <p>通常包含以下數個:</p> <ol><li><code>ascii_mode</code> 是中英文轉換開關。預設<code>0</code>爲中文,<code>1</code>爲英文</li> <li><code>full_shape</code> 是全角符號/半角符號開關。注意,開啓全角時英文字母亦爲全角。<code>0</code>爲半角,<code>1</code>爲全角</li> <li><code>extended_charset</code> 是字符集開關。<code>0</code>爲CJK基本字符集,<code>1</code>爲CJK全字符集</li> <ul><li>僅<code>table_translator</code>可用</li></ul> <li><code>ascii_punct</code> 是中西文標點轉換開關,<code>0</code>爲中文句讀,<code>1</code>爲西文標點。</li> <li><code>simplification</code> 是轉化字開關。一般情況下與上同,<code>0</code>爲不開啓轉化,<code>1</code>爲轉化。</li> <ul><li><code>simplification</code>選項名偁可自定義,亦可添加多套替換用字方案:</li></ul> <ul><pre><code>- name: zh_cn states: ["漢字", "汉字"] reset: 0 </code></pre> <p>或</p> <pre><code>- options: [ zh_trad, zh_cn, zh_mars ] states: - 字型 → 漢字 - 字型 → 汉字 - 字型 → 䕼茡 reset: 0 </code></pre> <ul> <li><code>name</code>/<code>options</code>名:須與<code>simplifier</code>中<code>option_name</code>相同</li> <li><code>states</code>:可不寫,如不寫則此開關存在但不可見,可由快捷鍵操作</li> <li><code>reset</code>:設定默認狀態〔<code>reset</code>可不寫,此時切換窗口時不會重置到默認狀態〕</li> </ul> </ul> <li>字符集過濾。此選項沒有默認名偁,須配合<code>charset_filter</code>使用。可單用,亦可添加多套字符集:</li> <pre><code>- name: gbk states: [ 增廣, 常用 ] reset: 0 </code></pre> 或 <pre><code>- options: [ utf-8, big5hkscs, big5, gbk, gb2312 ] states: - 字集 → 全 - 字集 → 港臺 - 字集 → 臺 - 字集 → 大陸 - 字集 → 简体 reset: 0 </code></pre> <ul> <li><code>name</code>/<code>options</code>名:須與<code>charset_filter</code><code>@</code>後的tag相同</li> <li>避免同時使用字符集過濾和<code>extended_charset</code></li> </ul> </ol> <ul> <h4><strong>示例</strong></h4> <pre><code>switches: - name: ascii_mode reset: 0 states: ["中文", "西文"] - name: full_shape states: ["半角", "全角"] - name: extended_charset states: ["通用", "增廣"] - name: simplification states: ["漢字", "汉字"] - name: ascii_punct states: ["句讀", "符號"] </code></pre></ul> <h2>引擎</h2> <ul><li>以下<b>加粗</b>項爲可細配者,<i>斜體</i>者爲不常用者</li> </ul> <p>引擎分四組:</p> <h3>一、<code>processors</code></h3> <ul><li>這批組件處理各類按鍵消息</li></ul> <ol><li><code>ascii_composer</code> 處理西文模式及中西文切</li> <li><b><code>recognizer</code></b> 與<code>matcher</code>搭配,處理符合特定規則的輸入碼,如網址、反查等<code>tags</code></li> <li><b><code>key_binder</code></b> 在特定條件下將按鍵綁定到其他按鍵,如重定義逗號、句號爲候選翻頁、開關快捷鍵等</li> <li><b><code>speller</code></b> 拼寫處理器,接受字符按鍵,編輯輸入</li> <li><b><code>punctuator</code></b> 句讀處理器,將單個字符按鍵直接映射爲標點符號或文字</li> <li><code>selector</code> 選字處理器,處理數字選字鍵〔可以換成別的哦〕、上、下候選定位、換頁</li> <li><code>navigator</code> 處理輸入欄內的光標移動</li> <li><code>express_editor</code> 編輯器,處理空格、回車上屏、回退鍵</li> <li><i><code>fluid_editor</code></i> 句式編輯器,用於以空格斷詞、回車上屏的【注音】、【語句流】等輸入方案,替換<code>express_editor</code></li> <li><i><code>chord_composer</code></i> 和絃作曲家或曰並擊處理器,用於【宮保拼音】等多鍵並擊的輸入方案</li> <li><code>lua_processor</code> 使用<code>lua</code>自定義按鍵,後接<code>@</code>+<code>lua</code>函數名</li> <ul><li><code>lua</code>函數名即用戶文件夾內<code>rime.lua</code>中函數名,參數爲<code>(key, env)</code></li></ul> </ol> <h3>二、<code>segmentors</code></h3> <ul><li>這批組件識別不同內容類型,將輸入碼分段並加上<code>tag</code></li></ul> <ol><li><code>ascii_segmentor</code> 標識西文段落〔譬如在西文模式下〕字母直接上屛</li> <li><code>matcher</code> 配合<code>recognizer</code>標識符合特定規則的段落,如網址、反查等,加上特定<code>tag</code></li> <li><b><code>abc_segmentor</code></b> 標識常規的文字段落,加上<code>abc</code>這個<code>tag</code></li> <li><code>punct_segmentor</code> 標識句讀段落〔鍵入標點符號用〕加上<code>punct</code>這個<code>tag</code></li> <li><code>fallback_segmentor</code> 標識其他未標識段落</li> <li><b><code>affix_segmentor</code></b> 用戶自定義<code>tag</code></li> <ul><li>此項可加載多個實例,後接<code>@</code>+<code>tag</code>名</li></ul> <li><i><code>lua_segmentor</code></i> 使用<code>lua</code>自定義切分,後接<code>@</code>+<code>lua</code>函數名</li> </ol> <h3>三、<code>translators</code></h3> <ul><li>這批組件翻譯特定類型的編碼段爲一組候選文字</li></ul> <ol><li><code>echo_translator</code> 沒有其他候選字時,回顯輸入碼〔輸入碼可以<code>Shift</code>+<code>Enter</code>上屛〕</li> <li><code>punct_translator</code> 配合<code>punct_segmentor</code>轉換標點符號</li> <li><b><code>table_translator</code></b> 碼表翻譯器,用於倉頡、五筆等基於碼表的輸入方案</li> - 此項可加載多個實例,後接<code>@</code>+翻譯器名〔如:<code>cangjie</code>、<code>wubi</code>等〕</li> <li><b><code>script_translator</code></b> 腳本翻譯器,用於拼音、粵拼等基於音節表的輸入方案</li> - 此項可加載多個實例,後接<code>@</code>+翻譯器名〔如:<code>pinyin</code>、<code>jyutping</code>等〕</li> <li><i><code>reverse_lookup_translator</code></i> 反查翻譯器,用另一種編碼方案查碼</li> <li><b><code>lua_translator</code></b> 使用<code>lua</code>自定義輸入,例如動態輸入當前日期、時間,後接<code>@</code>+<code>lua</code>函數名</li> <ul><li><code>lua</code>函數名即用戶文件夾內<code>rime.lua</code>中函數名,參數爲<code>(input, seg, env)</code></li> <li>可以<code>env.engine.context:get_option("option_name")</code>方式綁定到<code>switch</code>開關/<code>key_binder</code>快捷鍵</li></ul> </ol> <h3>四、<code>filters</code></h3> <ul><li>這批組件過濾翻譯的結果</li></ul> <ol> <li><code>uniquifier</code> 過濾重複的候選字,有可能來自<b><code>simplifier</code></b></li> <li><code>cjk_minifier</code> 字符集過濾〔僅用於<code>script_translator</code>,使之支援<code>extended_charset</code>開關〕</li> <li><b><code>single_char_filter</code></b> 單字過濾器,如加載此組件,則屛敝詞典中的詞組〔僅<code>table_translator</code>有效〕</li> <li><b><code>simplifier</code></b> 用字轉換</li> <li><b><code>reverse_lookup_filter</code></b> 反查濾鏡,以更靈活的方式反查,Rime1.0後替代<i><code>reverse_lookup_translator</code></i></li> <ul><li>此項可加載多個實例,後接<code>@</code>+濾鏡名〔如:<code>pinyin_lookup</code>、<code>jyutping_lookup</code>等〕</li></ul> <li><b><code>charset_filter</code></b> 字符集過濾</li> <ul><li>後接<code>@</code>+字符集名〔如:<code>utf-8</code>(無過濾)、<code>big5</code>、<code>big5hkscs</code>、<code>gbk</code>、<code>gb2312</code>〕</li></ul> <li><b><code>lua_filter</code></b> 使用<code>lua</code>自定義過濾,例如過濾字符集、調整排序,後接<code>@</code>+<code>lua</code>函數名</li> <ul><li><code>lua</code>函數名即用戶文件夾內<code>rime.lua</code>中函數名,參數爲<code>(input, env)</code></li> <li>可以<code>env.engine.context:get_option("option_name")</code>方式綁定到<code>switch</code>開關/<code>key_binder</code>快捷鍵</li></ul> </ol> <ul><h4><strong>示例</strong></h4> <p><small>cangjie6.schema.yaml</small></p> <pre><code>engine: processors: - ascii_composer - recognizer - key_binder - speller - punctuator - selector - navigator - express_editor segmentors: - ascii_segmentor - matcher - affix_segmentor@pinyin - affix_segmentor@jyutping - affix_segmentor@pinyin_lookup - affix_segmentor@jyutping_lookup - affix_segmentor@reverse_lookup - abc_segmentor - punct_segmentor - fallback_segmentor translators: - punct_translator - table_translator - script_translator@pinyin - script_translator@jyutping - script_translator@pinyin_lookup - script_translator@jyutping_lookup - lua_translator@get_date filters: - simplifier@zh_simp - uniquifier - cjk_minifier - charset_filter@gbk - reverse_lookup_filter@middle_chinese - reverse_lookup_filter@pinyin_reverse_lookup - reverse_lookup_filter@jyutping_reverse_lookup - lua_filter@single_char_first </code></pre></ul> <h2>細項配置</h2> <ul><li>凡<code>comment_format</code>、<code>preedit_format</code>、<code>speller/algebra</code>所用之正則表達式,請參閱<a href="http://www.boost.org/doc/libs/1_49_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html">「Perl正則表達式」</a></li> </ul> <p><strong>引擎中所舉之加粗者均可在下方詳細描述,格式爲:</strong></p> <pre><code>name: branches: configurations </code></pre> <p>或</p> <pre><code>name: branches: - configurations </code></pre> <h3>一、<code>speller</code></h3> <ol><li><code>alphabet:</code> 定義本方案輸入鍵</li> <li><code>initials:</code> 定義僅作始碼之鍵</li> <li><code>finals:</code> 定義僅作末碼之鍵</li> <li><code>delimiter:</code> 上屛時的音節間分音符</li> <li><code>algebra:</code> 拼寫運算規則,由之算出的拼寫匯入<code>prism</code>中</li> <li><code>max_code_length:</code> 形碼最大碼長,超過則頂字上屛〔<code>number</code>〕</li> <li><code>auto_select:</code> 自動上屛〔<code>true</code>或<code>false</code>〕</li> <li><code>auto_select_pattern:</code> 自動上屏規則,以正則表達式描述,當輸入串可以被匹配時自動頂字上屏。 <li><code>use_space:</code> 以空格作輸入碼〔<code>true</code>或<code>false</code>〕</li> </ol> <ul><ul><li><code>speller</code>的演算包含:</li> <pre><code>xform --改寫〔不保留原形〕 derive --衍生〔保留原形〕 abbrev --簡拼〔出字優先級較上兩組更低〕 fuzz --畧拼〔此種簡拼僅組詞,不出單字〕 xlit --變換〔適合大量一對一變換〕 erase --刪除 </code></pre></ul></ul> <ul><h4><strong>示例</strong></h4> <p><small>luna_pinyin.schema.yaml</small></p> <pre><code>speller: alphabet: zyxwvutsrqponmlkjihgfedcba delimiter: " '" algebra: - erase/^xx$/ - abbrev/^([a-z]).+$/$1/ - abbrev/^([zcs]h).+$/$1/ - derive/^([nl])ve$/$1ue/ - derive/^([jqxy])u/$1v/ - derive/un$/uen/ - derive/ui$/uei/ - derive/iu$/iou/ - derive/([aeiou])ng$/$1gn/ - derive/([dtngkhrzcs])o(u|ng)$/$1o/ - derive/ong$/on/ - derive/ao$/oa/ - derive/([iu])a(o|ng?)$/a$1$2/ </code></pre></ul> <h3>二、<code>segmentor</code></h3> <ul><li><code>segmentor</code>配合<code>recognizer</code>標記出<code>tag</code>。這裏會用到<code>affix_segmentor</code>和<code>abc_translator</code></li> <li><code>tag</code>用在<code>translator</code>、<code>reverse_lookup_filter</code>、<code>simplifier</code>中用以標定各自作用範圍</li> <li>如果不需要用到<code>extra_tags</code>則不需要單獨配置<code>segmentor</code></li> </ul> <ol><li><code>tag:</code> 設定其<code>tag</code></li> <li><code>prefix:</code> 設定其前綴標識,可不塡,不塡則無前綴</li> <li><code>suffix:</code> 設定其尾綴標識,可不塡,不塡則無尾綴</li> <li><code>tips:</code> 設定其輸入前提示符,可不塡,不塡則無提示符</li> <li><code>closing_tips:</code> 設定其結束輸入提示符,可不塡,不塡則無提示符</li> <li><code>extra_tags:</code> 爲此<code>segmentor</code>所標記的段落插上其它<code>tag</code></li> </ol> <ul><strong>當<code>affix_segmentor</code>和<code>translator</code>重名時,兩者可併在一處配置,此處1-5條對應下面19-23條。<code>abc_segmentor</code>僅可設<code>extra_tags</code></strong></ul> <ul><h4><strong>示例</strong></h4> <p><small>cangjie6.schema.yaml</small></p> <pre><code>reverse_lookup: tag: reverse_lookup prefix: "`" suffix: ";" tips: "【反查】" closing_tips: "【蒼頡】" extra_tags: - pinyin_lookup - jyutping_lookup </code></pre></ul> <h3>三、<code>translator</code></h3> <ul><li>每個方案有一個主<code>translator</code>,在引擎列表中不以<code>@</code>+翻譯器名定義,在細項配置時直接以<code>translator:</code>命名。以下加粗項爲可在主<code>translator</code>中定義之項,其它可在副〔以<code>@</code>+翻譯器名命名〕<code>translator</code>中定義</li> </ul> <ol><li><b><code>enable_charset_filter:</code></b> 是否開啓字符集過濾〔僅<code>table_translator</code>有效。啓用<code>cjk_minifier</code>後可適用於<code>script_translator</code>〕</li> <li><b><code>enable_encoder:</code></b> 是否開啓自動造詞〔僅<code>table_translator</code>有效〕</li> <li><b><code>encode_commit_history:</code></b> 是否對已上屛詞自動成詞〔僅<code>table_translator</code>有效〕</li> <li><b><code>max_phrase_length:</code></b> 最大自動成詞詞長〔僅<code>table_translator</code>有效〕</li> <li><b><code>enable_completion:</code></b> 提前顯示尚未輸入完整碼的字〔僅<code>table_translator</code>有效〕</li> <li><b><code>sentence_over_completion:</code></b> 在無全碼對應字而僅有逐鍵提示時也開啓智能組句〔僅<code>table_translator</code>有效〕</li> <li><b><code>strict_spelling:</code></b> 配合<code>speller</code>中的<code>fuzz</code>規則,僅以畧拼碼組詞〔僅<code>table_translator</code>有效〕</li> <li><b><code>disable_user_dict_for_patterns:</code></b> 禁止某些編碼錄入用戶詞典</li> <li><b><code>enable_sentence:</code></b> 是否開啓自動造句</li> <li><b><code>enable_user_dict:</code></b> 是否開啓用戶詞典〔用戶詞典記錄動態字詞頻、用戶詞〕</li> <ul><li>以上選塡<code>true</code>或<code>false</code></li></ul> <li><b><code>dictionary:</code></b> 翻譯器將調取此字典文件</li> <li><b><code>prism:</code></b> 設定由此主翻譯器的<code>speller</code>生成的棱鏡文件名,或此副編譯器調用的棱鏡名</li> <li><b><code>user_dict:</code></b> 設定用戶詞典名</li> <li><b><code>db_class:</code></b> 設定用戶詞典類型,可設<code>tabledb</code>〔文本〕或<code>userdb</code>〔二進制〕</li> <li><b><code>preedit_format:</code></b> 上屛碼自定義</li> <li><b><code>comment_format:</code></b> 提示碼自定義</li> <li><b><code>spelling_hints:</code></b> 設定多少字以內候選標註完整帶調拼音〔僅<code>script_translator</code>有效〕</li> <li><b><code>initial_quality:</code></b> 設定此翻譯器出字優先級</li> <li><code>tag:</code> 設定此翻譯器針對的<code>tag</code>。可不塡,不塡則僅針對<code>abc</code></li> <li><code>prefix:</code> 設定此翻譯器的前綴標識,可不塡,不塡則無前綴</li> <li><code>suffix:</code> 設定此翻譯器的尾綴標識,可不塡,不塡則無尾綴</li> <li><code>tips:</code> 設定此翻譯器的輸入前提示符,可不塡,不塡則無提示符</li> <li><code>closing_tips:</code> 設定此翻譯器的結束輸入提示符,可不塡,不塡則無提示符</li> <li><code>contextual_suggestions:</code> 是否使用語言模型優化輸出結果〔需配合<code>grammar</code>使用〕</li> <li><code>max_homophones:</code> 最大同音簇長度〔需配合<code>grammar</code>使用〕</li> <li><code>max_homographs:</code> 最大同形簇長度〔需配合<code>grammar</code>使用〕</li> </ol> <ul><h4><strong>示例</strong></h4> <p><small>cangjie6.schema.yaml 蒼頡主翻譯器</small></p> <pre><code>translator: dictionary: cangjie6 enable_charset_filter: true enable_sentence: true enable_encoder: true encode_commit_history: true max_phrase_length: 5 preedit_format: - xform/^([a-z ]<em>)$/$1|\U$1\E/ - xform/(?&lt;=[a-z])\s(?=[a-z])// - "xlit|ABCDEFGHIJKLMNOPQRSTUVWXYZ|日月金木水火土竹戈十大中一弓人心手口尸廿山女田止卜片|" comment_format: - "xlit|abcdefghijklmnopqrstuvwxyz~|日月金木水火土竹戈十大中一弓人心手口尸廿山女田止卜片・|" disable_user_dict_for_patterns: - "^z.</em>$" initial_quality: 0.75 </code></pre> <p><small>cangjie6.schema.yaml 拼音副翻譯器</small></p> <pre><code>pinyin: tag: pinyin dictionary: luna_pinyin enable_charset_filter: true prefix: 'P' #須配合recognizer suffix: ';' #須配合recognizer preedit_format: - "xform/([nl])v/$1ü/" - "xform/([nl])ue/$1üe/" - "xform/([jqxy])v/$1u/" tips: "【漢拼】" closing_tips: "【蒼頡】" </code></pre> <p><small>pinyin_simp.schema.yaml 拼音・簡化字主翻譯器</small></p> <pre><code>translator: dictionary: luna_pinyin prism: luna_pinyin_simp preedit_format: - xform/([nl])v/$1ü/ - xform/([nl])ue/$1üe/ - xform/([jqxy])v/$1u/ </code></pre> <p><small>luna_pinyin.schema.yaml 朙月拼音用戶短語</small></p> <pre><code>custom_phrase: #這是一個table_translator dictionary: "" user_dict: custom_phrase db_class: tabledb enable_sentence: false enable_completion: false initial_quality: 1 </code></pre></ul> <h3>四、<code>reverse_lookup_filter</code></h3> <ul><li>此濾鏡須掛在<code>translator</code>上,不影響該<code>translator</code>工作</li> </ul> <ol><li><code>tags:</code> 設定其作用範圍 <li><code>overwrite_comment:</code> 是否覆蓋其他提示 <li><code>dictionary:</code> 反查所得提示碼之碼表 <li><code>comment_format:</code> 自定義提示碼格式 </ol> <ul><h4><strong>示例</strong></h4> <p><small>cangjie6.schema.yaml</small></p> <pre><code>pinyin_reverse_lookup: #該反查濾鏡名 tags: [ pinyin_lookup ] #掛在這個tag所對應的翻譯器上 overwrite_comment: true dictionary: cangjie6 #反查所得爲蒼頡碼 comment_format: - "xform/$/〕/" - "xform/^/〔/" - "xlit|abcdefghijklmnopqrstuvwxyz |日月金木水火土竹戈十大中一弓人心手口尸廿山女田止卜片、|" </code></pre></ul> <h3>五、<code>simplifier</code></h3> <ol><li><code>option_name:</code> 對應<code>switches</code>中設定的切換項名</li> <li><code>opencc_config:</code> 用字轉換配置文件</li> <ul><li>位於:<code>rime_dir/opencc/</code>,自帶之配置文件含:</li> <ol><li>繁轉簡〔默認〕:<code>t2s.json</code></li> <li>繁轉臺灣:<code>t2tw.json</code></li> <li>繁轉香港:<code>t2hk.json</code></li> <li>簡轉繁:<code>s2t.json</code></li> </ol></ul> <li><code>tags:</code> 設定轉換範圍</li> <li><code>tips:</code> 設定是否提示轉換前的字,可塡<code>none</code>〔或不塡〕、<code>char</code>〔僅對單字有效〕、<code>all</code></li> <li><code>show_in_comment:</code> 設定是否僅將轉換結果顯示在備注中 <li><i><code>excluded_types:</code></i> 取消特定範圍〔一般爲<i><code>reverse_lookup_translator</code></i>〕轉化用字</li> </ol> <ul><h4><strong>示例</strong></h4> <p><small>修改自 luna_pinyin_kunki.schema</small></p> <pre><code>zh_tw: option_name: zh_tw opencc_config: t2tw.json tags: [ abc ] #abc對應abc_segmentor tips: none </code></pre></ul> <h3><i>六、<code>chord_composer</code></i></h3> <ul><li>並擊把鍵盤分兩半,相當於兩塊鍵盤。兩邊同時擊鍵,系統默認在其中一半上按的鍵先於另一半,由此得出上屛碼</li> </ul> <ol><li><code>alphabet:</code> 字母表,包含用於並擊的按鍵。擊鍵雖有先後,形成並擊時,一律以字母表順序排列 <li><code>algebra:</code> 拼寫運算規則,將一組並擊編碼轉換爲拼音音節 <li><code>output_format:</code> 並擊完成後套用的式樣,追加隔音符號 <li><code>prompt_format:</code> 並擊過程中套用的式樣,加方括弧 </ol> <ul><h4><strong>示例</strong></h4> <p><small>combo_pinyin.schema.yaml</small></p> <pre><code>chord_composer: # 字母表,包含用於並擊的按鍵 # 擊鍵雖有先後,形成並擊時,一律以字母表順序排列 alphabet: "swxdecfrvgtbnjum ki,lo." # 拼寫運算規則,將一組並擊編碼轉換爲拼音音節 algebra: # 先將物理按鍵字符對應到宮保拼音鍵位中的拼音字母 - 'xlit|swxdecfrvgtbnjum ki,lo.|sczhlfgdbktpRiuVaNIUeoE|' # 以下根據宮保拼音的鍵位分別變換聲母、韻母部分 # 組合聲母 - xform/^zf/zh/ - xform/^cl/ch/ - xform/^fb/m/ - xform/^ld/n/ - xform/^hg/r/ …… # 聲母獨用時補足隠含的韻母 - xform/^([bpf])$/$1u/ - xform/^([mdtnlgkh])$/$1e/ - xform/^([mdtnlgkh])$/$1e/ - xform/^([zcsr]h?)$/$1i/ # 並擊完成後套用的式樣,追加隔音符號 output_format: - "xform/^([a-z]+)$/$1'/" # 並擊過程中套用的式樣,加方括弧 prompt_format: - "xform/^(.*)$/[$1]/" </code></pre></ul> <h3>七、<code>lua</code></h3> <ul><li>請參攷<a href="https://github.com/hchunhui/librime-lua">hchunhui/librime-lua</a> 以尋求更多靈感。</li></ul> <ol> <li><code>lua_translator</code></li> <li><code>lua_filter</code></li> <li><code>lua_processor</code></li> <li><code>lua_segmentor</code></li> </ol> <ul><h4><strong>示例</strong></h4> <p><small>rime.lua</small></p> <pre><code>function get_date(input, seg, env) --- 以 show_date 爲開關名或 key_binder 中 toggle 的對象 on = env.engine.context:get_option("show_date") if (on and input == "date") then --- Candidate(type, start, end, text, comment) yield(Candidate("date", seg.start, seg._end, os.date("%Y年%m月%d日"), " 日期")) end end function single_char_first(input, env) --- 以 single_char 爲開關名或 key_binder 中 toggle 的對象 on = env.engine.context:get_option("single_char") local cache = {} for cand in input:iter() do if (not on or utf8.len(cand.text) == 1) then yield(cand) else table.insert(cache, cand) end end for i, cand in ipairs(cache) do yield(cand) end end </code></pre></ul> <h3>八、其它</h3> <ul><li>包括<code>recognizer</code>、<code>key_binder</code>、<code>punctuator</code>。<b>標點</b>、<b>快捷鍵</b>、<b>二三選重</b>、<b>特殊字符</b>等均於此設置</li> </ul> <ol><li><b><code>import_preset:</code></b> 由外部統一文件導入 <li><code>grammar:</code> 下設: <ul><li><code>language:</code> 取值<code>zh-han[ts]-t-essay-bg[wc]</code></li> <li><code>collocation_max_length:</code> 最大搭配長度(整句輸入可忽畧此項)</li> <li><code>collocation_min_length:</code> 最小搭配長度(整句輸入可忽畧此項)</li> </ul></li> <li><code>recognizer:</code> 下設<code>patterns:</code> 配合<code>segmentor</code>的<code>prefix</code>和<code>suffix</code>完成段落劃分、<code>tag</code>分配 <ul><li>前字段可以爲以<code>affix_segmentor@someTag</code>定義的<code>Tag</code>名,或者<code>punct</code>、<code>reverse_lookup</code>兩個內設的字段。其它字段不調用輸入法引擎,輸入即輸出〔如<code>url</code>等字段〕</li></ul></li> <li><code>key_binder:</code> 下設<code>bindings:</code> 設置功能性快捷鍵 <ul><li>每一條<code>binding</code>可能包含:<code>accept</code>實際所按之鍵、<code>send</code>輸出效果、<code>toggle</code>切換開關和<code>when</code>作用範圍〔<code>send</code>和<code>toggle</code>二選一〕</li> <ul> <li><code>toggle</code>可用字段包含各開關名</li> <li><code>when</code>可用字段包含:</li> <ul><pre><code>paging 翻䈎用 has_menu 操作候選項用 composing 操作輸入碼用 always 全域 </code></pre></ul> <li><code>accept</code>和<code>send</code>可用字段除A-Za-z0-9外,還包含以下鍵板上實際有的鍵:</li> <ul><pre><code>BackSpace 退格 Tab 水平定位符 Linefeed 换行 Clear 清除 Return 回車 Pause 暫停 Sys_Req 印屏 Escape 退出 Delete 刪除 Home 原位 Left 左箭頭 Up 上箭頭 Right 右箭頭 Down 下箭頭 Prior、Page_Up 上翻 Next、Page_Down 下翻 End 末位 Begin 始位 Shift_L 左Shift Shift_R 右Shift Control_L 左Ctrl Control_R 右Ctrl Meta_L 左Meta Meta_R 右Meta Alt_L 左Alt Alt_R 右Alt Super_L 左Super Super_R 右Super Hyper_L 左Hyper Hyper_R 右Hyper Caps_Lock 大寫鎖 Shift_Lock 上檔鎖 Scroll_Lock 滾動鎖 Num_Lock 小鍵板鎖 Select 選定 Print 列印 Execute 執行 Insert 插入 Undo 還原 Redo 重做 Menu 菜單 Find 蒐尋 Cancel 取消 Help 幫助 Break 中斷 space exclam ! quotedbl " numbersign # dollar $ percent % ampersand & apostrophe ' parenleft ( parenright ) asterisk * plus + comma , minus - period . slash / colon : semicolon ; less < equal = greater > question ? at @ bracketleft [ backslash \ bracketright ] asciicircum ^ underscore _ grave ` braceleft { bar | braceright } asciitilde ~ KP_Space 小鍵板空格 KP_Tab 小鍵板水平定位符 KP_Enter 小鍵板回車 KP_Delete 小鍵板刪除 KP_Home 小鍵板原位 KP_Left 小鍵板左箭頭 KP_Up 小鍵板上箭頭 KP_Right 小鍵板右箭頭 KP_Down 小鍵板下箭頭 KP_Prior、KP_Page_Up 小鍵板上翻 KP_Next、KP_Page_Down 小鍵板下翻 KP_End 小鍵板末位 KP_Begin 小鍵板始位 KP_Insert 小鍵板插入 KP_Equal 小鍵板等於 KP_Multiply 小鍵板乘號 KP_Add 小鍵板加號 KP_Subtract 小鍵板減號 KP_Divide 小鍵板除號 KP_Decimal 小鍵板小數點 KP_0 小鍵板0 KP_1 小鍵板1 KP_2 小鍵板2 KP_3 小鍵板3 KP_4 小鍵板4 KP_5 小鍵板5 KP_6 小鍵板6 KP_7 小鍵板7 KP_8 小鍵板8 KP_9 小鍵板9 </ul></pre></code> </ul></ul></ul> <li><code>editor</code>用以訂製操作鍵〔不支持<code>import_preset:</code>〕,鍵板鍵名同<code>key_binder/bindings</code>中的<code>accept</code>和<code>send</code>,效果定義如下:</li> <ul><pre><code>confirm 上屏候選項 commit_comment 上屏候選項備注 commit_raw_input 上屏原始輸入 commit_script_text 上屏變換後輸入 commit_composition 語句流單字上屏 revert 撤消上次輸入 back 按字符回退 back_syllable 按音節回退 delete_candidate 刪除候選項 delete 向後刪除 cancel 取消輸入 noop 空 </code></pre></ul> <li><code>punctuator:</code> 下設<code>full_shape:</code>和<code>half_shape:</code>分别控制全角模式下的符號和半角模式下的符號,另有<code>use_space:</code>空格頂字〔<code>true</code>或<code>false</code>〕 <ul><li>每條標點項可加<code>commit</code>直接上屏和<code>pair</code>交替上屏兩種模式,默認爲選單模式</li></ul> </ol> <ul><h4><strong>示例</strong></h4> <p><small>修改自 cangjie6.schema.yaml</small></p> <pre><code>key_binder: import_preset: default bindings: - {accept: semicolon, send: 2, when: has_menu} #分號選第二重碼 - {accept: apostrophe, send: 3, when: has_menu} #引號選第三重碼 - {accept: "Control+1", select: .next, when: always} - {accept: "Control+2", toggle: full_shape, when: always} - {accept: "Control+3", toggle: simplification, when: always} - {accept: "Control+4", toggle: extended_charset, when: always} editor: bindings: Return: commit_comment punctuator: import_preset: symbols half_shape: "'": {pair: ["「", "」"]} #第一次按是「,第二次是」 "(": ["〔", "["] #彈出選單 .: {commit: "。"} #無選單,直接上屛。優先級最高 recognizer: import_preset: default patterns: email: "^[a-z][-_.0-9a-z]*@.*$" url: "^(www[.]|https?:|ftp:|mailto:).*$" reverse_lookup: "`[a-z]*;?$" pinyin_lookup: "`P[a-z]*;?$" jyutping_lookup: "`J[a-z]*;?$" pinyin: "(?&lt!`)P[a-z']*;?$" jyutping: "(?&lt!`)J[a-z']*;?$" punct: "/[a-z]*$" #配合symbols.yaml中的特殊字符輸入 </code></pre></ul> <h2>其它</h2> <ul><li>Rime還爲每個方案提供選單和一定的外觀訂製能力</li> <li>通常情況下<code>menu</code>在<code>default.yaml</code>中定義〔或用戶修改檔<code>default.custom.yaml</code>〕,<code>style</code>在<code>squirrel.yaml</code>或<code>weasel.yaml</code>〔或用戶修改檔<code>squirrel.custom.yaml</code>或<code>weasel.custom.yaml</code>〕</li> <h4><strong>示例</strong></h4> <pre><code>menu: alternative_select_labels: [ ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨ ] # 修改候選標籤 alternative_select_keys: ASDFGHJKL #如編碼字符佔用數字鍵則須另設選字鍵 page_size: 5 #選單每䈎顯示個數 style: font_face: "HanaMinA, HanaMinB" #字體〔小狼毫得且僅得設一個字體;鼠鬚管得設多個字體,後面的字體自動補前面字體不含的字〕 font_point: 15 #字號 label_format: '%s' # 候選標籤格式 horizontal: false #橫/直排 line_spacing: 1 #行距 inline_preedit: true #輸入碼內嵌 </code></pre></ul> <br> <h1 align="center"><code>Dict.yaml</code> 詳解</h1> <h2></h2> <hr> <h2>開始之前</h2> <pre><code># Rime dict # encoding: utf-8 〔你還可以在這註釋字典來源、變動記錄等〕 </code></pre> <h2>描述檔</h2> <ol><li><code>name:</code> 內部字典名,也即<code>schema</code>所引用的字典名,確保與文件名相一致</li> <li><code>version:</code> 如果發佈,請確保每次改動陞版本號</li> </ol> <ul><h4><strong>示例</strong></h4> <pre><code>name: "cangjie6.extended" version: "0.1" </code></pre></ul> <h2>配置</h2> <ol><li><code>sort:</code> 字典<b>初始</b>排序,可選<code>original</code>或<code>by_weight</code></li> <li><code>use_preset_vocabulary:</code> 是否引入「八股文」〔含字詞頻、詞庫〕</li> <li><code>max_phrase_length:</code> 配合<code>use_preset_vocabulary:</code>,設定導入詞條最大詞長</li> <li><code>min_phrase_weight:</code> 配合<code>use_preset_vocabulary:</code>,設定導入詞條最小詞頻</li> <li><code>columns:</code> 定義碼表以<code>Tab</code>分隔出的各列,可設<code>text</code>【文本】、<code>code</code>【碼】、<code>weight</code>【權重】、<code>stem</code>【造詞碼】</li> <li><code>import_tables:</code> 加載其它外部碼表</li> <li><code>encoder:</code> 形碼造詞規則</li> <ol type="a"> <li><code>exclude_patterns:</code></li> <li><code>rules:</code> 可用<code>length_equal:</code>和<code>length_in_range:</code>定義。大寫字母表示字序,小寫字母表示其所跟隨的大寫字母所以表的字中的編碼序</li> <li><code>tail_anchor:</code> 造詞碼包含結構分割符〔僅用於倉頡〕</li> <li><code>exclude_patterns</code> 取消某編碼的造詞資格</li> </ol></ol> <ul><h4><strong>示例</strong></h4> <p><small>cangjie6.extended.dict.yaml</small></p> <pre><code>sort: by_weight use_preset_vocabulary: false import_tables: - cangjie6 #單字碼表由cangjie6.dict.yaml導入 columns: #此字典爲純詞典,無單字編碼,僅有字和詞頻 - text #字/詞 - weight #字/詞頻 encoder: exclude_patterns: - '^z.*$' rules: - length_equal: 2 #對於二字詞 formula: "AaAzBaBbBz" #取第一字首尾碼、第二字首次尾碼 - length_equal: 3 #對於三字詞 formula: "AaAzBaYzZz" #取第一字首尾碼、第二字首尾碼、第三字尾碼 - length_in_range: [4, 5] #對於四至五字詞 formula: "AaBzCaYzZz" #取第一字首碼,第二字尾碼、第三字首碼、倒數第二字尾碼、最後一字尾碼 tail_anchor: "'" </code></pre></ul> <h2>碼表</h2> <ul><li>以<code>Tab</code>分隔各列,各列依<code>columns:</code>定義排列。</li></ul> <ul><h4><strong>示例</strong></h4> <p><small>cangjie6.dict.yaml</small></p> <pre><code>columns: - text #第一列字/詞 - code #第二列碼 - weight #第三列字/詞頻 - stem #第四列造詞碼 </code></pre> <p><small>cangjie6.dict.yaml</small></p> <pre><code>個 owjr 246268 ow'jr 看 hqbu 245668 中 l 243881 呢 rsp 242970 來 doo 235101 嗎 rsqf 221092 爲 bhnf 211340 會 owfa 209844 她 vpd 204725 與 xyc 203975 給 vfor 193007 等 hgdi 183340 這 yymr 181787 用 bq 168934 b'q </code></pre> </ul> <hr> <p align="right">雪齋<br> 09-Nov-2013</p> </body> </html>
{ "pile_set_name": "Github" }
# coding=utf-8 """Tests for medusa/test_list_associated_files.py.""" from __future__ import unicode_literals import os from medusa import app from medusa.post_processor import PostProcessor import pytest def _rar_basename(filepath, files): for found_file in files: if os.path.splitext(os.path.basename(found_file))[1] == '.rar': return os.path.basename(os.path.splitext(os.path.basename(found_file))[0].lower()) @pytest.mark.parametrize('p', [ { # p0: No associated files. Wrong basename 'path': 'media/postprocess/', 'structure': ( 'bow.514.hdtv-lol[ettv].mkv', 'bow.514.hdtv-lol.srt', {'samples': ( 'sample.mkv', 'other.mkv', {'inception': ()} )} ), 'expected_associated_files': [], 'allowed_extensions': 'nfo,srt' }, { # p1: No associated files 'path': 'media/postprocess/', 'structure': ( 'bow.514.hdtv-lol[ettv].mkv', {'samples': ( 'sample.mkv', 'other.mkv', {'inception': ( 'cool.txt', 'bla.nfo' )} )} ), 'expected_associated_files': [], 'allowed_extensions': 'nfo,srt' }, { # p2: No media file, so can't list associated files 'path': 'media/postprocess/', 'structure': ( 'bow.514.hdtv-lol.srt', ), 'expected_associated_files': [], 'allowed_extensions': 'nfo,srt' }, { # p3: .srt and .nfo associated files. Check subfolders 'path': 'media/postprocess/', 'structure': ( 'Show.S01E01.720p.HDTV.X264-DIMENSION.mkv', 'Show.S01E01.720p.HDTV.X264-DIMENSION.pt-BR.srt', 'Show.S01E01.720p.HDTV.X264-DIMENSION.nfo', 'Show.S01E01.720p.HDTV.X264-DIMENSION.sfv', {'samples': ( 'sample.mkv', 'other.mkv', {'inception': ( 'cool.txt', 'bla.nfo' )} )} ), 'expected_associated_files': ['Show.S01E01.720p.HDTV.X264-DIMENSION.pt-BR.srt', 'Show.S01E01.720p.HDTV.X264-DIMENSION.nfo', ], 'allowed_extensions': 'nfo,srt', 'subfolders': True, 'refine': True }, { # p4: Only .nfo associated file allowed 'path': 'media/postprocess/', 'structure': ( 'Show.S01E01.720p.HDTV.X264-DIMENSION.mkv', 'Show.S01E01.720p.HDTV.X264-DIMENSION.pt-BR.srt', 'Show.S01E01.720p.HDTV.X264-DIMENSION.nfo', 'Show.S01E01.720p.HDTV.X264-DIMENSION.sfv' ), 'expected_associated_files': ['Show.S01E01.720p.HDTV.X264-DIMENSION.nfo', ], 'allowed_extensions': 'nfo', 'refine': True }, { # p5: No allowed extensions 'path': 'media/postprocess/', 'structure': ( 'Show.S01E01.720p.HDTV.X264-DIMENSION.mkv', 'Show.S01E01.720p.HDTV.X264-DIMENSION.pt-BR.srt', 'Show.S01E01.720p.HDTV.X264-DIMENSION.nfo', 'Show.S01E01.720p.HDTV.X264-DIMENSION.sfv' ), 'expected_associated_files': [], 'allowed_extensions': '', 'refine': True }, { # p6: Associated file based on RARed file 'path': 'media/postprocess/', 'structure': ( 'Show.S01E01.720p.HDTV.X264-DIMENSION.mkv', 'show.101.720p-dimension.rar', 'show.101.720p-dimension.nfo' ), 'expected_associated_files': ['show.101.720p-dimension.nfo'], 'allowed_extensions': 'nfo' }, { # p7: 'Subtitles only' param for associated files 'path': 'media/postprocess/', 'structure': ( 'Show.S01E01.720p.HDTV.X264-DIMENSION.mkv', 'Show.S01E01.720p.HDTV.X264-DIMENSION.pt-BR.srt', 'Show.S01E01.720p.HDTV.X264-DIMENSION.nfo', 'Show.S01E01.720p.HDTV.X264-DIMENSION.sfv' ), 'expected_associated_files': ['Show.S01E01.720p.HDTV.X264-DIMENSION.pt-BR.srt'], 'allowed_extensions': 'nfo,srt', 'subtitles_only': True }, { # p8: Subtitle in subfolder. Check subfolders enabled 'path': 'media/postprocess/', 'structure': ( 'Show.S01E01.720p.HDTV.X264-DIMENSION.mkv', {'subs': ( 'RARBG.txt', 'Show.S01E01.720p.HDTV.X264-DIMENSION.pt-BR.srt', )} ), 'expected_associated_files': ['Show.S01E01.720p.HDTV.X264-DIMENSION.pt-BR.srt', ], 'allowed_extensions': 'nfo,srt', 'subfolders': True }, ]) def test_list_associated_files(p, create_structure, monkeypatch): """Run the test.""" # Given test_path = create_structure(p['path'], structure=p['structure']) path = os.path.join(test_path, os.path.normcase(p['path'])) file_path = os.path.join(path, p['structure'][0]) expected_associated_files = p['expected_associated_files'] subtitles_only = p.get('subtitles_only', False) subfolders = p.get('subfolders', False) refine = p.get('refine', False) monkeypatch.setattr(app, 'ALLOWED_EXTENSIONS', p['allowed_extensions']) monkeypatch.setattr(app, 'MOVE_ASSOCIATED_FILES', 1) processor = PostProcessor(file_path) processor._rar_basename = _rar_basename # When found_associated_files = processor.list_associated_files(file_path, subfolders=subfolders, subtitles_only=subtitles_only, refine=refine) associated_files_basenames = [os.path.basename(i) for i in found_associated_files] # Then assert set(associated_files_basenames) == set(expected_associated_files)
{ "pile_set_name": "Github" }
;=============================================== ; Config file for res_generator.cpp utility. ;=============================================== ; Feel free to add new resources if needed, they are all will be attached while the build process ; ;How to format it: ; [any description, should be unique] ; name = "picture.png" ; relative path to the file ; path = "virtual/prefix/path/picture.png" ; a virtual prefix path to call the file from a code [fallback for missing images] name=_broken.png path=images/_broken.png [fallback for missing splash] name=cat_splash.png path=images/cat_splash.png [fallback for missing coin animation] name=coin.png path=images/coin.png [built-in cursor] name=cursor.png path=images/cursor.png [default scroll down arrow] name=scroll_down.png path=images/scroll_down.png [default scroll up arrow] name=scroll_up.png path=images/scroll_up.png [selector pointer] name=selector.png path=images/selector.png [loading animation] name=shell.png path=images/shell.png [16px app icon] name=cat_16.png path=icon/cat_16.png [32px app icon] name=cat_32.png path=icon/cat_32.png [256px app icon] name=cat_256.png path=icon/cat_256.png [credits main core script] name=script/maincore_credits.lua path=script/maincore_credits.lua [level main core script] name=script/maincore_level.lua path=script/maincore_level.lua [title screen main core script] name=script/maincore_title.lua path=script/maincore_title.lua [world map main core script] name=script/maincore_world.lua path=script/maincore_world.lua [NPC API main core script] name=script/npcs/maincore_npc.lua path=script/npcs/maincore_npc.lua [Player API main core script] name=script/player/maincore_player.lua path=script/player/maincore_player.lua [Default embedded TTF font] name=fonts/UKIJTuzB.ttf path=fonts/UKIJTuzB.ttf
{ "pile_set_name": "Github" }
#!/bin/sh # Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Generate make dependencies using C preprocessor. # Usage: # mkdep.sh cc cc_args_to_invoke_preprocessor... file.{[csh],cc} ... # Output is written to stdout. # Implemented with sh, expr, sed, and sort. c_cmd= cpp_cmd= for x in ${1+"$@"}; do case "$x" in *.[chsCHS]|*.cc|*.CC) ;; -c++=*) cpp_cmd="$cpp_cmd '`expr "$x" : '^.....\(.*\)$'`'";; *) c_cmd="$c_cmd '$x'" cpp_cmd="$cpp_cmd '$x'";; esac done # Write to stdout dependencies obtained by running each source file through the # C preprocessor using the command prefix from the command line. for file in ${1+"$@"}; do case "$file" in *.[chsCHS]|*.cc|*.CC) case "$file" in *.cc|*.CC) cmd="$cpp_cmd";; *) cmd="$c_cmd";; esac ext=`expr "$file" : '^.*[.]\([^.]*\)$'` basename=`expr "$file" : '^\(.*\)[.][^.]*$'` # remove extension case "$basename" in */*) basename=`expr "$basename" : '.*/\([^/]*\)$'`;; esac eval "$cmd" "'$file'" | sed ' s/^#line 1 "/# 1 "/ /^# 1 "[^<]/!d s/^# 1 \(".*"\).*$/\1/ / /!s/^"\(.*\)"$/\1/ p ' | sort -u | sed '1i\ '"$basename.o"': \\ s/^/ / $!s/$/ \\/ ' ;; esac done
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # This code is part of Amoco # Copyright (C) 2014 Axel Tillequin (bdcht3@gmail.com) # published under GPLv2 license # spec_xxx files are providers for instruction objects. from .utils import * # ------------------------------------------------------ # amoco IA32e instruction specs: # ------------------------------------------------------ ISPECS = [] # prefixes: # ------------------------------------------------------ def setpfx(obj, pfx, n): if obj.misc["REX"]: raise InstructionError(obj) obj.misc.update((pfx,)) if obj.misc["pfx"] is None: obj.misc["pfx"] = [None] * 4 if obj.misc["pfx"][n] != None: logger.verbose("pfx %s grp %s redefined" % (pfx[0], n)) obj.misc["pfx"][n] = pfx[0] @ispec_ia32("8>[ {f0} ]+", _pfx=("lock", True)) @ispec_ia32("8>[ {f2} ]+", _pfx=("repne", True)) @ispec_ia32("8>[ {f3} ]+", _pfx=("rep", True)) def prefix_grp1(obj, _pfx): setpfx(obj, _pfx, 0) @ispec_ia32("8>[ {26} ]+", _pfx=("segreg", env.es)) @ispec_ia32("8>[ {2e} ]+", _pfx=("segreg", env.cs)) @ispec_ia32("8>[ {36} ]+", _pfx=("segreg", env.ss)) @ispec_ia32("8>[ {3e} ]+", _pfx=("segreg", env.ds)) @ispec_ia32("8>[ {64} ]+", _pfx=("segreg", env.fs)) @ispec_ia32("8>[ {65} ]+", _pfx=("segreg", env.gs)) def prefix_grp2(obj, _pfx): setpfx(obj, _pfx, 1) @ispec_ia32("8>[ {66} ]+", _pfx=("opdsz", 16)) def prefix_grp3(obj, _pfx): if env.internals["mode"] == 16: _pfx = ("opdsz", 32) setpfx(obj, _pfx, 2) @ispec_ia32("8>[ {67} ]+", _pfx=("adrsz", 32)) def prefix_grp4(obj, _pfx): if env.internals["mode"] == 32: _pfx = ("adrsz", 16) if env.internals["mode"] == 16: _pfx = ("adrsz", 32) setpfx(obj, _pfx, 3) @ispec_ia32("8>[ B X R W 0010 ]+", _pfx=("REX", True)) def prefix_REX(obj, B, X, R, W, _pfx): if obj.misc["REX"] is not None: raise InstructionError(obj) obj.misc["REX"] = (W, R, X, B) def precond_rep(obj): return obj.misc["rep"] def precond_norep(obj): return not obj.misc["rep"] def precond_opdsz(obj): return obj.misc["opdsz"] def precond_noopdsz(obj): return not obj.misc["opdsz"] def precond_opdsz_16(obj): size = obj.misc["opdsz"] return size==16 def precond_repne(obj): return (obj.misc["repne"] and obj.misc["pfx"][0] == "repne") def precond_norepne(obj): return not (obj.misc["repne"] and obj.misc["pfx"][0] == "repne") def precond_REX(obj): return obj.misc["REX"] def precond_W1(obj): W=0 if obj.misc["REX"]: W, R, X, B = obj.misc["REX"] return W==1 def precond_32bits(obj): size = obj.misc["adrsz"] or 64 return size==32 # IA32e opcodes: # ------------------------------------------------------ # no operands: # ------------- @ispec_ia32(" 8>[ {90} ]", mnemonic="NOP", type=type_data_processing,__obj=precond_norep) @ispec_ia32(" 8>[ {90} ]", mnemonic="PAUSE", type=type_cpu_state,__obj=precond_rep) def ia32_nop(obj): pass @ispec_ia32(" 8>[ {9b} ]", mnemonic="WAIT", type=type_other) @ispec_ia32(" 8>[ {c9} ]", mnemonic="LEAVE", type=type_data_processing) @ispec_ia32(" 8>[ {c3} ]", mnemonic="RET", type=type_control_flow) @ispec_ia32(" 8>[ {cb} ]", mnemonic="RETF", type=type_control_flow) @ispec_ia32(" 8>[ {f4} ]", mnemonic="HLT", type=type_control_flow) @ispec_ia32(" 8>[ {cc} ]", mnemonic="INT3", type=type_cpu_state) @ispec_ia32(" 8>[ {f8} ]", mnemonic="CLC", type=type_data_processing) @ispec_ia32(" 8>[ {f9} ]", mnemonic="STC", type=type_data_processing) @ispec_ia32(" 8>[ {f5} ]", mnemonic="CMC", type=type_data_processing) @ispec_ia32(" 8>[ {fc} ]", mnemonic="CLD", type=type_data_processing) @ispec_ia32(" 8>[ {fd} ]", mnemonic="STD", type=type_data_processing) @ispec_ia32(" 8>[ {fa} ]", mnemonic="CLI", type=type_system) @ispec_ia32(" 8>[ {fb} ]", mnemonic="STI", type=type_system) @ispec_ia32(" 8>[ {9e} ]", mnemonic="SAHF", type=type_data_processing) @ispec_ia32(" 8>[ {9f} ]", mnemonic="LAHF", type=type_data_processing) @ispec_ia32(" 8>[ {d7} ]", mnemonic="XLATB", type=type_data_processing) @ispec_ia32(" 8>[ {9d} ]", mnemonic="POPFQ", type=type_other) @ispec_ia32(" 8>[ {9c} ]", mnemonic="PUSHFQ", type=type_other) @ispec_ia32("16>[ {0f}{06} ]", mnemonic="CLTS", type=type_other) @ispec_ia32("16>[ {0f}{a2} ]", mnemonic="CPUID", type=type_other) @ispec_ia32("16>[ {0f}{08} ]", mnemonic="INVD", type=type_other) @ispec_ia32("16>[ {0f}{09} ]", mnemonic="WBINVD", type=type_cpu_state) @ispec_ia32("16>[ {0f}{0b} ]", mnemonic="UD2", type=type_undefined) @ispec_ia32("16>[ {0f}{30} ]", mnemonic="WRMSR", type=type_system) @ispec_ia32("16>[ {0f}{31} ]", mnemonic="RDTSC", type=type_cpu_state) @ispec_ia32("16>[ {0f}{32} ]", mnemonic="RDMSR", type=type_system) @ispec_ia32("16>[ {0f}{33} ]", mnemonic="RDPMC", type=type_cpu_state) @ispec_ia32("16>[ {0f}{05} ]", mnemonic="SYSCALL", type=type_system) @ispec_ia32("16>[ {0f}{07} ]", mnemonic="SYSRET", type=type_system) @ispec_ia32("16>[ {0f}{34} ]", mnemonic="SYSENTER", type=type_system) @ispec_ia32("16>[ {0f}{35} ]", mnemonic="SYSEXIT", type=type_system) @ispec_ia32("24>[ {0f}{01}{c8} ]", mnemonic="MONITOR", type=type_cpu_state) @ispec_ia32("24>[ {0f}{01}{c9} ]", mnemonic="MWAIT", type=type_cpu_state) @ispec_ia32("24>[ {0f}{01}{d0} ]", mnemonic="XGETBV", type=type_system) @ispec_ia32("24>[ {0f}{01}{d1} ]", mnemonic="XSETBV", type=type_system) def ia32_nooperand(obj): pass @ispec_ia32(" 8>[ {cf} ]", mnemonic="IRETD", type=type_other) @ispec_ia32(" 8>[ {98} ]", mnemonic="CWDE", type=type_data_processing) @ispec_ia32(" 8>[ {99} ]", mnemonic="CDQ", type=type_data_processing) @ispec_ia32(" 8>[ {cf} ]", mnemonic="IRET", type=type_other,__obj=precond_opdsz) @ispec_ia32(" 8>[ {98} ]", mnemonic="CBW", type=type_data_processing,__obj=precond_opdsz) @ispec_ia32(" 8>[ {99} ]", mnemonic="CWD", type=type_data_processing,__obj=precond_opdsz) @ispec_ia32(" 8>[ {cf} ]", mnemonic="IRETQ", type=type_other,__obj=precond_W1) @ispec_ia32(" 8>[ {98} ]", mnemonic="CDQE", type=type_data_processing,__obj=precond_REX) @ispec_ia32(" 8>[ {99} ]", mnemonic="CQO", type=type_data_processing,__obj=precond_REX) def ia32_nooperand(obj): if obj.misc["opdsz"]: if obj.mnemonic == "CWDE": obj.mnemonic = "CBW" if obj.mnemonic == "CDQ": obj.mnemonic = "CWD" if obj.mnemonic == "IRETD": obj.mnemonic = "IRET" if obj.misc["REX"]: REX = obj.misc["REX"] W, R, X, B = REX if obj.mnemonic == "CWDE": obj.mnemonic = "CDQE" if obj.mnemonic == "CDQ": obj.mnemonic = "CQO" if obj.mnemonic == "IRETD" and W == 1: obj.mnemonic = "IRETQ" # instructions for which REP/REPNE is valid (see formats.py): @ispec_ia32(" 8>[ {6c} ]", mnemonic="INSB", type=type_system) @ispec_ia32(" 8>[ {6d} ]", mnemonic="INSD", type=type_system) @ispec_ia32(" 8>[ {a4} ]", mnemonic="MOVSB", type=type_data_processing) @ispec_ia32(" 8>[ {a5} ]", mnemonic="MOVSD", type=type_data_processing) @ispec_ia32(" 8>[ {a5} ]", mnemonic="MOVSQ", type=type_data_processing,__obj=precond_W1) @ispec_ia32(" 8>[ {a5} ]", mnemonic="MOVSW", type=type_data_processing,__obj=precond_opdsz_16) @ispec_ia32(" 8>[ {6e} ]", mnemonic="OUTSB", type=type_other) @ispec_ia32(" 8>[ {6f} ]", mnemonic="OUTSD", type=type_other) @ispec_ia32(" 8>[ {6f} ]", mnemonic="OUTSQ", type=type_other,__obj=precond_W1) @ispec_ia32(" 8>[ {6f} ]", mnemonic="OUTSW", type=type_other,__obj=precond_opdsz_16) @ispec_ia32(" 8>[ {ac} ]", mnemonic="LODSB", type=type_other) @ispec_ia32(" 8>[ {ad} ]", mnemonic="LODSD", type=type_other) @ispec_ia32(" 8>[ {ad} ]", mnemonic="LODSQ", type=type_other,__obj=precond_W1) @ispec_ia32(" 8>[ {ad} ]", mnemonic="LODSW", type=type_other,__obj=precond_opdsz_16) @ispec_ia32(" 8>[ {aa} ]", mnemonic="STOSB", type=type_data_processing) @ispec_ia32(" 8>[ {ab} ]", mnemonic="STOSD", type=type_data_processing) @ispec_ia32(" 8>[ {ab} ]", mnemonic="STOSQ", type=type_data_processing,__obj=precond_W1) @ispec_ia32(" 8>[ {ab} ]", mnemonic="STOSW", type=type_data_processing,__obj=precond_opdsz_16) @ispec_ia32(" 8>[ {a6} ]", mnemonic="CMPSB", type=type_data_processing) @ispec_ia32(" 8>[ {a7} ]", mnemonic="CMPSD", type=type_data_processing) @ispec_ia32(" 8>[ {a7} ]", mnemonic="CMPSQ", type=type_data_processing,__obj=precond_W1) @ispec_ia32(" 8>[ {a7} ]", mnemonic="CMPSW", type=type_data_processing,__obj=precond_opdsz_16) @ispec_ia32(" 8>[ {ae} ]", mnemonic="SCASB", type=type_data_processing) @ispec_ia32(" 8>[ {af} ]", mnemonic="SCASD", type=type_data_processing) @ispec_ia32(" 8>[ {af} ]", mnemonic="SCASQ", type=type_data_processing,__obj=precond_W1) @ispec_ia32(" 8>[ {af} ]", mnemonic="SCASW", type=type_data_processing,__obj=precond_opdsz_16) def ia32_strings(obj): if obj.misc["rep"]: obj.type = type_control_flow if obj.mnemonic[-1] == "D": W, R, X, B = getREX(obj) if W == 1: # REX superseeds 66 prefix obj.mnemonic = obj.mnemonic[:-1] + "Q" elif obj.misc["opdsz"] == 16: obj.mnemonic = obj.mnemonic[:-1] + "W" # 1 operand # ---------- # imm8: @ispec_ia32("16>[ {cd} ib(8) ]", mnemonic="INT", type=type_control_flow) def ia32_imm8(obj, ib): obj.operands = [env.cst(ib, 8)] @ispec_ia32("16>[ {6a} ib(8) ]", mnemonic="PUSH", type=type_data_processing) def ia32_imm8_signed(obj, ib): W, R, X, B = getREX(obj) obj.operands = [env.cst(ib, 8).signextend(8)] @ispec_ia32("16>[ {eb} ib(8) ]", mnemonic="JMP", type=type_control_flow) @ispec_ia32("16>[ {e2} ib(8) ]", mnemonic="LOOP", type=type_control_flow) @ispec_ia32("16>[ {e1} ib(8) ]", mnemonic="LOOPE", type=type_control_flow) @ispec_ia32("16>[ {e0} ib(8) ]", mnemonic="LOOPNE", type=type_control_flow) def ia32_imm_rel(obj, ib): size = obj.misc["adrsz"] or 64 obj.operands = [env.cst(ib, 8).signextend(size)] @ispec_ia32("16>[ {e3} cb(8) ]", mnemonic="JRCXZ", type=type_control_flow) @ispec_ia32("16>[ {e3} cb(8) ]", mnemonic="JECXZ", type=type_control_flow, __obj=precond_32bits) def ia32_cb8(obj, cb): size = obj.misc["adrsz"] or 64 if size == 32: obj.mnemonic = "JECXZ" obj.operands = [env.cst(cb, 8).signextend(size)] # imm16: @ispec_ia32("24>[ {c2} iw(16) ]", mnemonic="RETN", type=type_control_flow) def ia32_retn(obj, iw): obj.operands = [env.cst(iw, 16)] # imm16/32: @ispec_ia32("*>[ {68} ~data(*) ]", mnemonic="PUSH", type=type_data_processing) def ia32_imm32(obj, data): size = obj.misc["opdsz"] or 32 if data.size < size: raise InstructionError(obj) imm = data[0:size] W, R, X, B = getREX(obj) xsize = 64 if W == 1 else size obj.operands = [env.cst(imm.int(), size).signextend(xsize)] obj.bytes += pack(imm) @ispec_ia32("*>[ {e8} ~data(*) ]", mnemonic="CALL", type=type_control_flow) @ispec_ia32("*>[ {e9} ~data(*) ]", mnemonic="JMP", type=type_control_flow) def ia32_imm_rel(obj, data): size = immsz = obj.misc["opdsz"] or 64 if size == 64: immsz = 32 if data.size < immsz: raise InstructionError(obj) imm = data[0:immsz] op1 = env.cst(imm.int(-1), size) op1.sf = True obj.operands = [op1] obj.bytes += pack(imm) # explicit register: # r16/32 @ispec_ia32("*>[ reg(3) 0 1010 ]", mnemonic="PUSH") # 50 +rd @ispec_ia32("*>[ reg(3) 1 1010 ]", mnemonic="POP") # 58 +rd def ia32_rm32(obj, reg): size = obj.misc["opdsz"] or 64 W, R, X, B = getREX(obj) if W == 1: size = 64 op1 = getregB(obj, reg, size) obj.operands = [op1] obj.type = type_data_processing @ispec_ia32("16>[ {0f} reg(3) 1 0011 ]", mnemonic="BSWAP") # 0f c4 +rd def ia32_bswap(obj, reg): # Intel's manual suggests to use getregRW "Using a REX prefix in the form # of REX.R permits access to additional registers (R8-R15)", but in reality # it is encoded by REX.B, e.g. GNU as converts "bswap %r13d" to "41 0F CD". # This bug of Intel's manual was already detected in 2009. # Cf. https://blogs.oracle.com/sheldon/entry/intel_doc_bug obj.operands = [getregRB(obj, reg, 32)] obj.type = type_data_processing # implicit register: # r16 (segments) @ispec_ia32("16>[ {0f}{a0} ]", mnemonic="PUSH", _seg=env.fs, type=type_data_processing) @ispec_ia32("16>[ {0f}{a1} ]", mnemonic="POP", _seg=env.fs, type=type_data_processing) @ispec_ia32("16>[ {0f}{a8} ]", mnemonic="PUSH", _seg=env.gs, type=type_data_processing) @ispec_ia32("16>[ {0f}{a9} ]", mnemonic="POP", _seg=env.gs, type=type_data_processing) def ia32_push_pop(obj, _seg): W, R, X, B = getREX(obj) obj.operands = [_seg] # r/m operand: # r/m8 @ispec_ia32("*>[ {fe} /0 ]", mnemonic="INC", type=type_data_processing) @ispec_ia32("*>[ {fe} /1 ]", mnemonic="DEC", type=type_data_processing) @ispec_ia32("*>[ {f6} /6 ]", mnemonic="DIV", type=type_data_processing) @ispec_ia32("*>[ {f6} /7 ]", mnemonic="IDIV", type=type_data_processing) @ispec_ia32("*>[ {f6} /4 ]", mnemonic="MUL", type=type_data_processing) @ispec_ia32("*>[ {f6} /5 ]", mnemonic="IMUL", type=type_data_processing) @ispec_ia32("*>[ {f6} /3 ]", mnemonic="NEG", type=type_data_processing) @ispec_ia32("*>[ {f6} /2 ]", mnemonic="NOT", type=type_data_processing) @ispec_ia32("*>[ {0f}{18} /0 ]", mnemonic="PREFETCHNTA", type=type_other) @ispec_ia32("*>[ {0f}{18} /1 ]", mnemonic="PREFETCHT0", type=type_other) @ispec_ia32("*>[ {0f}{18} /2 ]", mnemonic="PREFETCHT1", type=type_other) @ispec_ia32("*>[ {0f}{18} /3 ]", mnemonic="PREFETCHT2", type=type_other) @ispec_ia32("*>[ {0f}{0d} /1 ]", mnemonic="PREFETCHW", type=type_other) def ia32_rm8(obj, Mod, RM, data): obj.misc["opdsz"] = 8 op1, data = getModRM(obj, Mod, RM, data) obj.operands = [op1] # r/m16/32 @ispec_ia32("*>[ {ff} /0 ]", mnemonic="INC") @ispec_ia32("*>[ {ff} /1 ]", mnemonic="DEC") @ispec_ia32("*>[ {f7} /2 ]", mnemonic="NOT") @ispec_ia32("*>[ {f7} /3 ]", mnemonic="NEG") @ispec_ia32("*>[ {f7} /4 ]", mnemonic="MUL") @ispec_ia32("*>[ {f7} /5 ]", mnemonic="IMUL") @ispec_ia32("*>[ {f7} /6 ]", mnemonic="DIV") @ispec_ia32("*>[ {f7} /7 ]", mnemonic="IDIV") def ia32_rm32(obj, Mod, RM, data): op1, data = getModRM(obj, Mod, RM, data) obj.operands = [op1] obj.type = type_data_processing @ispec_ia32("*>[ {ff} /6 ]", mnemonic="PUSH") @ispec_ia32("*>[ {8f} /0 ]", mnemonic="POP") def ia32_rm32(obj, Mod, RM, data): W, R, X, B = getREX(obj) op1, data = getModRM(obj, Mod, RM, data, REX=(1, R, X, B)) obj.operands = [op1] obj.type = type_data_processing # r64 no REX prefix needed @ispec_ia32("*>[ {ff} /2 ]", mnemonic="CALL") @ispec_ia32("*>[ {ff} /4 ]", mnemonic="JMP") def ia32_rm64(obj, Mod, RM, data): obj.misc["opdsz"] = 64 REX = obj.misc["REX"] or (1, 0, 0, 0) op1, data = getModRM(obj, Mod, RM, data, REX) obj.operands = [op1] obj.misc["absolute"] = True obj.type = type_control_flow # r/m32/48 @ispec_ia32("*>[ {ff} /3 ]", mnemonic="CALLF", type=type_control_flow) @ispec_ia32("*>[ {ff} /5 ]", mnemonic="JMPF", type=type_control_flow) @ispec_ia32("*>[ {0f}{01} /0 ]", mnemonic="SGDT", type=type_system) @ispec_ia32("*>[ {0f}{01} /1 ]", mnemonic="SIDT", type=type_system) @ispec_ia32("*>[ {0f}{01} /2 ]", mnemonic="LGDT", type=type_system) @ispec_ia32("*>[ {0f}{01} /3 ]", mnemonic="LIDT", type=type_system) @ispec_ia32("*>[ {0f}{01} /4 ]", mnemonic="SMSW", type=type_system) @ispec_ia32("*>[ {0f}{01} /7 ]", mnemonic="INVLPG", type=type_system) def ia32_op48(obj, Mod, RM, data): op1, data = getModRM(obj, Mod, RM, data) if op1._is_reg: raise InstructionError(obj) op1.size = 48 if obj.misc["opdsz"] == 16 else 80 obj.operands = [op1] # r/m16 @ispec_ia32("*>[ {0f}{00} /1 ]", mnemonic="STR", type=type_system) @ispec_ia32("*>[ {0f}{00} /2 ]", mnemonic="LLDT", type=type_system) @ispec_ia32("*>[ {0f}{00} /3 ]", mnemonic="LTR", type=type_system) @ispec_ia32("*>[ {0f}{00} /4 ]", mnemonic="VERR", type=type_system) @ispec_ia32("*>[ {0f}{00} /5 ]", mnemonic="VERW", type=type_system) @ispec_ia32("*>[ {0f}{01} /6 ]", mnemonic="LMSW", type=type_system) def ia32_lldt(obj, Mod, RM, data): obj.misc["opdsz"] = 16 op1, data = getModRM(obj, Mod, RM, data) obj.operands = [op1] # conditionals: @ispec_ia32("16>[ cc(4) 1110 cb(8) ]", mnemonic="Jcc") # 7x cb(8) def ia32_imm_rel(obj, cc, cb): obj.cond = CONDITION_CODES[cc] obj.operands = [env.cst(cb, 8).signextend(64)] obj.type = type_control_flow @ispec_ia32("*>[ {0f} cc(4) 0001 ~data(*) ]", mnemonic="Jcc") # 0f 8x cw/d def ia32_imm_rel(obj, cc, data): obj.cond = CONDITION_CODES[cc] size = obj.misc["opdsz"] or 32 if size == 16 or data.size < size: raise InstructionError(obj) imm = data[0:size] op1 = env.cst(imm.int(-1), size) op1.sf = True obj.operands = [op1.signextend(64)] obj.bytes += pack(imm) obj.type = type_control_flow # 2 operands # ---------- # implicit ax/eax, r16/32 @ispec_ia32("8>[ rd(3) 0 1001 ]", mnemonic="XCHG") # 9x def ia32_xchg(obj, rd): size = obj.misc["opdsz"] or 32 W, R, X, B = getREX(obj) if W == 1: size = 64 if R == 1: rd = (R << 3) + rd op1 = env.getreg(0, size) op2 = env.getreg(rd, size) obj.operands = [op1, op2] obj.type = type_data_processing # implicit al , imm8: @ispec_ia32("16>[ {04} ib(8) ]", mnemonic="ADD") @ispec_ia32("16>[ {14} ib(8) ]", mnemonic="ADC") @ispec_ia32("16>[ {1c} ib(8) ]", mnemonic="SBB") @ispec_ia32("16>[ {24} ib(8) ]", mnemonic="AND") @ispec_ia32("16>[ {2c} ib(8) ]", mnemonic="SUB") @ispec_ia32("16>[ {34} ib(8) ]", mnemonic="XOR") @ispec_ia32("16>[ {3c} ib(8) ]", mnemonic="CMP") @ispec_ia32("16>[ {0c} ib(8) ]", mnemonic="OR") @ispec_ia32("16>[ {a8} ib(8) ]", mnemonic="TEST") def ia32_al_imm8(obj, ib): obj.operands = [env.al, env.cst(ib, 8)] obj.type = type_data_processing # implicit al/ax/eax , adr16/32: @ispec_ia32("*>[ {a0} ~data(*) ]", mnemonic="MOV", _flg8=True, _inv=False) @ispec_ia32("*>[ {a1} ~data(*) ]", mnemonic="MOV", _flg8=False, _inv=False) @ispec_ia32("*>[ {a2} ~data(*) ]", mnemonic="MOV", _flg8=True, _inv=True) @ispec_ia32("*>[ {a3} ~data(*) ]", mnemonic="MOV", _flg8=False, _inv=True) def ia32_mov_adr(obj, data, _flg8, _inv): opdsz = obj.misc["opdsz"] or 64 if _flg8: opdsz = 8 op1 = env.getreg(0, opdsz) adrsz = obj.misc["adrsz"] or 64 seg = obj.misc["segreg"] if data.size < adrsz: raise InstructionError(obj) moffs8 = env.cst(data[0:adrsz].int(), adrsz) op2 = env.mem(moffs8, opdsz, seg) obj.operands = [op1, op2] if not _inv else [op2, op1] obj.bytes += pack(data[0:adrsz]) obj.type = type_data_processing # implicit ax/eax , imm16/32: @ispec_ia32("*>[ {05} ~data(*) ]", mnemonic="ADD") @ispec_ia32("*>[ {0d} ~data(*) ]", mnemonic="OR") @ispec_ia32("*>[ {15} ~data(*) ]", mnemonic="ADC") @ispec_ia32("*>[ {1d} ~data(*) ]", mnemonic="SBB") @ispec_ia32("*>[ {25} ~data(*) ]", mnemonic="AND") @ispec_ia32("*>[ {2d} ~data(*) ]", mnemonic="SUB") @ispec_ia32("*>[ {35} ~data(*) ]", mnemonic="XOR") @ispec_ia32("*>[ {3d} ~data(*) ]", mnemonic="CMP") @ispec_ia32("*>[ {a9} ~data(*) ]", mnemonic="TEST") def ia32_eax_imm(obj, data): size = immsz = obj.misc["opdsz"] or 32 W, R, X, B = getREX(obj) if W == 1: size = 64 if data.size < immsz: raise InstructionError(obj) imm = data[0:immsz] if size == 64: op1 = env.rax elif size == 32: op1 = env.eax else: op1 = env.ax obj.operands = [op1, env.cst(imm.int(), immsz).signextend(size)] obj.bytes += pack(imm) obj.type = type_data_processing # imm16 , imm8: @ispec_ia32("32>[ {c8} iw(16) ib(8) ]", mnemonic="ENTER") def ia32_enter(obj, iw, ib): obj.operands = [env.cst(iw, 16), env.cst(ib, 8)] obj.type = type_other # r/m8 , implicit @ispec_ia32("*>[ {d0} /0 ]", mnemonic="ROL", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d0} /1 ]", mnemonic="ROR", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d0} /2 ]", mnemonic="RCL", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d0} /3 ]", mnemonic="RCR", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d0} /4 ]", mnemonic="SAL", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d0} /5 ]", mnemonic="SHR", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d0} /6 ]", mnemonic="SHL", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d0} /7 ]", mnemonic="SAR", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d2} /0 ]", mnemonic="ROL", _op2=env.cl) @ispec_ia32("*>[ {d2} /1 ]", mnemonic="ROR", _op2=env.cl) @ispec_ia32("*>[ {d2} /2 ]", mnemonic="RCL", _op2=env.cl) @ispec_ia32("*>[ {d2} /3 ]", mnemonic="RCR", _op2=env.cl) @ispec_ia32("*>[ {d2} /4 ]", mnemonic="SAL", _op2=env.cl) @ispec_ia32("*>[ {d2} /5 ]", mnemonic="SHR", _op2=env.cl) @ispec_ia32("*>[ {d2} /6 ]", mnemonic="SHL", _op2=env.cl) @ispec_ia32("*>[ {d2} /7 ]", mnemonic="SAR", _op2=env.cl) def ia32_rm8_op2(obj, Mod, RM, data, _op2): obj.misc["opdsz"] = 8 op1, data = getModRM(obj, Mod, RM, data) obj.operands = [op1, _op2] obj.type = type_data_processing # r/m8 , imm8 @ispec_ia32("*>[ {80} /0 ]", mnemonic="ADD") @ispec_ia32("*>[ {80} /1 ]", mnemonic="OR") @ispec_ia32("*>[ {80} /2 ]", mnemonic="ADC") @ispec_ia32("*>[ {80} /3 ]", mnemonic="SBB") @ispec_ia32("*>[ {80} /4 ]", mnemonic="AND") @ispec_ia32("*>[ {80} /5 ]", mnemonic="SUB") @ispec_ia32("*>[ {80} /6 ]", mnemonic="XOR") @ispec_ia32("*>[ {80} /7 ]", mnemonic="CMP") @ispec_ia32("*>[ {c6} /0 ]", mnemonic="MOV") @ispec_ia32("*>[ {f6} /0 ]", mnemonic="TEST") def ia32_ptr_ib(obj, Mod, RM, data): obj.misc["opdsz"] = 8 op1, data = getModRM(obj, Mod, RM, data) if data.size < 8: raise InstructionError(obj) imm = data[0:8] obj.operands = [op1, env.cst(imm.int(), 8)] obj.bytes += pack(imm) obj.type = type_data_processing @ispec_ia32("*>[ {c0} /0 ]", mnemonic="ROL") @ispec_ia32("*>[ {c0} /1 ]", mnemonic="ROR") @ispec_ia32("*>[ {c0} /2 ]", mnemonic="RCL") @ispec_ia32("*>[ {c0} /3 ]", mnemonic="RCR") @ispec_ia32("*>[ {c0} /4 ]", mnemonic="SAL") @ispec_ia32("*>[ {c0} /5 ]", mnemonic="SHR") @ispec_ia32("*>[ {c0} /6 ]", mnemonic="SHL") @ispec_ia32("*>[ {c0} /7 ]", mnemonic="SAR") def ia32_ptr_ib(obj, Mod, RM, data): obj.misc["opdsz"] = 8 W, R, X, B = getREX(obj) op1, data = getModRM(obj, Mod, RM, data) if data.size < 8: raise InstructionError(obj) imm = data[0:8] mask = 0x3F if W == 1 else 0x1F obj.operands = [op1, env.cst(imm.int() & mask, 8)] obj.bytes += pack(imm) obj.type = type_data_processing @ispec_ia32("16>[ rb(3) 0 1101 ib(8) ]", mnemonic="MOV") # b0 + rb ib def ia32_mov_adr(obj, rb, ib): op1 = getregB(obj, rb, 8) op2 = env.cst(ib, 8) obj.operands = [op1, op2] obj.type = type_data_processing @ispec_ia32("*>[ rb(3) 1 1101 ~data(*) ]", mnemonic="MOV") # b8+rd id/io def ia32_mov_adr(obj, rb, data): size = obj.misc["opdsz"] or 32 W, R, X, B = getREX(obj) if W == 1: size = 64 if B == 1: rb = (B << 3) + rb op1 = env.getreg(rb, size) if data.size < size: raise InstructionError(obj) imm = data[0:size] op2 = env.cst(imm.int(), size).signextend(op1.size) obj.operands = [op1, op2] obj.bytes += pack(imm) obj.type = type_data_processing # r/m16/32, imm8 @ispec_ia32("*>[ {c1} /0 ]", mnemonic="ROL") @ispec_ia32("*>[ {c1} /1 ]", mnemonic="ROR") @ispec_ia32("*>[ {c1} /2 ]", mnemonic="RCL") @ispec_ia32("*>[ {c1} /3 ]", mnemonic="RCR") @ispec_ia32("*>[ {c1} /4 ]", mnemonic="SAL") @ispec_ia32("*>[ {c1} /5 ]", mnemonic="SHR") @ispec_ia32("*>[ {c1} /6 ]", mnemonic="SHL") @ispec_ia32("*>[ {c1} /7 ]", mnemonic="SAR") def ia32_rm32_imm8(obj, Mod, RM, data): W, R, X, B = getREX(obj) op1, data = getModRM(obj, Mod, RM, data) if data.size < 8: raise InstructionError(obj) imm = data[0:8] mask = 0x3F if W == 1 else 0x1F obj.operands = [op1, env.cst(imm.int() & mask, 8)] obj.bytes += pack(imm) obj.type = type_data_processing # r/m16/32 , implicit @ispec_ia32("*>[ {d1} /0 ]", mnemonic="ROL", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d1} /1 ]", mnemonic="ROR", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d1} /2 ]", mnemonic="RCL", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d1} /3 ]", mnemonic="RCR", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d1} /4 ]", mnemonic="SAL", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d1} /5 ]", mnemonic="SHR", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d1} /6 ]", mnemonic="SHL", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d1} /7 ]", mnemonic="SAR", _op2=env.cst(1, 8)) @ispec_ia32("*>[ {d3} /0 ]", mnemonic="ROL", _op2=env.cl) @ispec_ia32("*>[ {d3} /1 ]", mnemonic="ROR", _op2=env.cl) @ispec_ia32("*>[ {d3} /2 ]", mnemonic="RCL", _op2=env.cl) @ispec_ia32("*>[ {d3} /3 ]", mnemonic="RCR", _op2=env.cl) @ispec_ia32("*>[ {d3} /4 ]", mnemonic="SAL", _op2=env.cl) @ispec_ia32("*>[ {d3} /5 ]", mnemonic="SHR", _op2=env.cl) @ispec_ia32("*>[ {d3} /6 ]", mnemonic="SHL", _op2=env.cl) @ispec_ia32("*>[ {d3} /7 ]", mnemonic="SAR", _op2=env.cl) def ia32_rm32_op2(obj, Mod, RM, data, _op2): op1, data = getModRM(obj, Mod, RM, data) obj.operands = [op1, _op2] obj.type = type_data_processing # r/m16/32/64 , imm16/32 @ispec_ia32("*>[ {81} /0 ]", mnemonic="ADD") @ispec_ia32("*>[ {81} /1 ]", mnemonic="OR") @ispec_ia32("*>[ {81} /2 ]", mnemonic="ADC") @ispec_ia32("*>[ {81} /3 ]", mnemonic="SBB") @ispec_ia32("*>[ {81} /4 ]", mnemonic="AND") @ispec_ia32("*>[ {81} /5 ]", mnemonic="SUB") @ispec_ia32("*>[ {81} /6 ]", mnemonic="XOR") @ispec_ia32("*>[ {81} /7 ]", mnemonic="CMP") @ispec_ia32("*>[ {c7} /0 ]", mnemonic="MOV") @ispec_ia32("*>[ {f7} /0 ]", mnemonic="TEST") def ia32_ptr_iwd(obj, Mod, RM, data): op1, data = getModRM(obj, Mod, RM, data) W, R, X, B = getREX(obj) size = op1.size if W == 1: size = 32 if data.size < size: raise InstructionError(obj) imm = data[0:size] x = env.cst(imm.int(), size).signextend(op1.size) obj.operands = [op1, x] obj.bytes += pack(imm) obj.type = type_data_processing # r/m16/32 , sign extended imm8 @ispec_ia32("*>[ {83} /0 ]", mnemonic="ADD") @ispec_ia32("*>[ {83} /1 ]", mnemonic="OR") @ispec_ia32("*>[ {83} /2 ]", mnemonic="ADC") @ispec_ia32("*>[ {83} /3 ]", mnemonic="SBB") @ispec_ia32("*>[ {83} /4 ]", mnemonic="AND") @ispec_ia32("*>[ {83} /5 ]", mnemonic="SUB") @ispec_ia32("*>[ {83} /6 ]", mnemonic="XOR") @ispec_ia32("*>[ {83} /7 ]", mnemonic="CMP") def ia32_ptr_iwd(obj, Mod, RM, data): op1, data = getModRM(obj, Mod, RM, data) if data.size < 8: raise InstructionError(obj) imm = data[0:8] x = env.cst(imm.int(), 8).signextend(op1.size) if obj.mnemonic in ("OR", "AND", "XOR"): x.sf = False obj.operands = [op1, x] obj.bytes += pack(imm) obj.type = type_data_processing # r/m16/32 , imm8 @ispec_ia32("*>[ {0f}{ba} /4 ]", mnemonic="BT") @ispec_ia32("*>[ {0f}{ba} /7 ]", mnemonic="BTC") @ispec_ia32("*>[ {0f}{ba} /6 ]", mnemonic="BTR") @ispec_ia32("*>[ {0f}{ba} /5 ]", mnemonic="BTS") def ia32_BTx(obj, Mod, RM, data): op1, data = getModRM(obj, Mod, RM, data) if data.size < 8: raise InstructionError(obj) imm = data[0:8] x = env.cst(imm.int(), 8) obj.operands = [op1, x] obj.bytes += pack(imm) obj.type = type_data_processing # r/m8 , r8 @ispec_ia32("*>[ {00} /r ]", mnemonic="ADD") @ispec_ia32("*>[ {08} /r ]", mnemonic="OR") @ispec_ia32("*>[ {10} /r ]", mnemonic="ADC") @ispec_ia32("*>[ {18} /r ]", mnemonic="SBB") @ispec_ia32("*>[ {20} /r ]", mnemonic="AND") @ispec_ia32("*>[ {28} /r ]", mnemonic="SUB") @ispec_ia32("*>[ {30} /r ]", mnemonic="XOR") @ispec_ia32("*>[ {38} /r ]", mnemonic="CMP") @ispec_ia32("*>[ {0f}{b0} /r ]", mnemonic="CMPXCHG") @ispec_ia32("*>[ {0f}{c0} /r ]", mnemonic="XADD") @ispec_ia32("*>[ {88} /r ]", mnemonic="MOV") @ispec_ia32("*>[ {84} /r ]", mnemonic="TEST") def ia32_reg_8(obj, Mod, RM, REG, data): obj.misc["opdsz"] = 8 op1, data = getModRM(obj, Mod, RM, data) op2 = getregR(obj, REG, op1.size) obj.operands = [op1, op2] obj.type = type_data_processing # r8 , r/m8 @ispec_ia32("*>[ {02} /r ]", mnemonic="ADD") @ispec_ia32("*>[ {0a} /r ]", mnemonic="OR") @ispec_ia32("*>[ {12} /r ]", mnemonic="ADC") @ispec_ia32("*>[ {1a} /r ]", mnemonic="SBB") @ispec_ia32("*>[ {22} /r ]", mnemonic="AND") @ispec_ia32("*>[ {2a} /r ]", mnemonic="SUB") @ispec_ia32("*>[ {32} /r ]", mnemonic="XOR") @ispec_ia32("*>[ {3a} /r ]", mnemonic="CMP") @ispec_ia32("*>[ {86} /r ]", mnemonic="XCHG") @ispec_ia32("*>[ {8a} /r ]", mnemonic="MOV") def ia32_reg_8_inv(obj, Mod, RM, REG, data): obj.misc["opdsz"] = 8 op2, data = getModRM(obj, Mod, RM, data) op1 = getregR(obj, REG, op2.size) obj.operands = [op1, op2] obj.type = type_data_processing # r16 (segment selectors), r/m16 @ispec_ia32("*>[ {8c} /r ]", mnemonic="MOV", _inv=True) @ispec_ia32("*>[ {8e} /r ]", mnemonic="MOV", _inv=False) def ia32_arpl(obj, Mod, REG, RM, data, _inv): obj.misc["opdsz"] = 16 op2, data = getModRM(obj, Mod, RM, data) if REG == 6 or REG == 7: raise InstructionError(obj) op1 = [env.es, env.cs, env.ss, env.ds, env.fs, env.gs][REG] obj.operands = [op1, op2] if not _inv else [op2, op1] obj.type = type_data_processing @ispec_ia32("*>[ {63} /r ]", mnemonic="MOVSXD") def ia32_movsxd(obj, Mod, REG, RM, data): op1 = getregR(obj, REG, 64) # force REX.W=0 for op2 decoding: W, R, X, B = getREX(obj) op2, data = getModRM(obj, Mod, RM, data, REX=(0, R, X, B)) obj.operands = [op1, op2] obj.type = type_data_processing # r/m16/32 , r16/32 @ispec_ia32("*>[ {01} /r ]", mnemonic="ADD") @ispec_ia32("*>[ {09} /r ]", mnemonic="OR") @ispec_ia32("*>[ {11} /r ]", mnemonic="ADC") @ispec_ia32("*>[ {19} /r ]", mnemonic="SBB") @ispec_ia32("*>[ {21} /r ]", mnemonic="AND") @ispec_ia32("*>[ {29} /r ]", mnemonic="SUB") @ispec_ia32("*>[ {31} /r ]", mnemonic="XOR") @ispec_ia32("*>[ {39} /r ]", mnemonic="CMP") @ispec_ia32("*>[ {89} /r ]", mnemonic="MOV") @ispec_ia32("*>[ {85} /r ]", mnemonic="TEST") @ispec_ia32("*>[ {0f}{a3} /r ]", mnemonic="BT") @ispec_ia32("*>[ {0f}{bb} /r ]", mnemonic="BTC") @ispec_ia32("*>[ {0f}{b3} /r ]", mnemonic="BTR") @ispec_ia32("*>[ {0f}{ab} /r ]", mnemonic="BTS") @ispec_ia32("*>[ {0f}{b1} /r ]", mnemonic="CMPXCHG") @ispec_ia32("*>[ {0f}{c1} /r ]", mnemonic="XADD") def ia32_reg_32(obj, Mod, RM, REG, data): op1, data = getModRM(obj, Mod, RM, data) op2 = getregR(obj, REG, op1.size) obj.operands = [op1, op2] obj.type = type_data_processing # r16/32 , r/m16/32 @ispec_ia32("*>[ {03} /r ]", mnemonic="ADD") @ispec_ia32("*>[ {0b} /r ]", mnemonic="OR") @ispec_ia32("*>[ {13} /r ]", mnemonic="ADC") @ispec_ia32("*>[ {1b} /r ]", mnemonic="SBB") @ispec_ia32("*>[ {23} /r ]", mnemonic="AND") @ispec_ia32("*>[ {2b} /r ]", mnemonic="SUB") @ispec_ia32("*>[ {33} /r ]", mnemonic="XOR") @ispec_ia32("*>[ {3b} /r ]", mnemonic="CMP") @ispec_ia32("*>[ {87} /r ]", mnemonic="XCHG") @ispec_ia32("*>[ {8b} /r ]", mnemonic="MOV") @ispec_ia32("*>[ {8d} /r ]", mnemonic="LEA") @ispec_ia32("*>[ {0f}{bc} /r ]", mnemonic="BSF") @ispec_ia32("*>[ {0f}{bd} /r ]", mnemonic="BSR",__obj=precond_norep) @ispec_ia32("*>[ {0f}{bd} /r ]", mnemonic="LZCNT",__obj=precond_rep) @ispec_ia32("*>[ {0f}{af} /r ]", mnemonic="IMUL") @ispec_ia32("*>[ {0f}{03} /r ]", mnemonic="LSL") @ispec_ia32("*>[ {0f}{b8} /r ]", mnemonic="POPCNT",__obj=precond_norep) def ia32_reg_32_inv(obj, Mod, RM, REG, data): op2, data = getModRM(obj, Mod, RM, data) op1 = getregR(obj, REG, op2.size) if obj.mnemonic == "LEA": if not op2._is_mem: raise InstructionError(obj) obj.operands = [op1, op2] obj.type = type_data_processing # r16/32 , m16:16/32 @ispec_ia32("*>[ {0f}{b2} /r ]", mnemonic="LSS", _seg=env.ss) @ispec_ia32("*>[ {0f}{b4} /r ]", mnemonic="LFS", _seg=env.fs) @ispec_ia32("*>[ {0f}{b5} /r ]", mnemonic="LGS", _seg=env.gs) def ia32_r32_seg(obj, Mod, RM, REG, data, _seg): op2, data = getModRM(obj, Mod, RM, data) if not op2._is_mem: raise InstructionError(obj) op1 = getregR(obj, REG, op2.size) op2 = env.mem(op2.a, op1.size + 16, _seg) obj.operands = [op1, op2] obj.type = type_system @ispec_ia32("*>[ {0f}{ad} /r ]", mnemonic="SHRD") @ispec_ia32("*>[ {0f}{a5} /r ]", mnemonic="SHLD") def ia32_rm32_op3cl(obj, Mod, RM, REG, data): op1, data = getModRM(obj, Mod, RM, data) op2 = getregR(obj, REG, op1.size) obj.operands = [op1, op2, env.cl] obj.type = type_data_processing @ispec_ia32("*>[ {0f}{ac} /r ]", mnemonic="SHRD") @ispec_ia32("*>[ {0f}{a4} /r ]", mnemonic="SHLD") def ia32_rm32_op3cst(obj, Mod, RM, REG, data): op1, data = getModRM(obj, Mod, RM, data) op2 = getregR(obj, REG, op1.size) imm = data[0:8] obj.operands = [op1, op2, env.cst(imm.int(), 8)] obj.bytes += pack(imm) obj.type = type_data_processing # conditionals: @ispec_ia32("*>[ {0f} cc(4) 0010 /r ]", mnemonic="CMOVcc") # 0f 4x /r def ia32_CMOVcc(obj, cc, Mod, RM, REG, data): obj.cond = CONDITION_CODES[cc] op2, data = getModRM(obj, Mod, RM, data) op1 = getregR(obj, REG, op2.size) obj.operands = [op1, op2] obj.type = type_data_processing @ispec_ia32("*>[ {0f} cc(4) 1001 /r ]", mnemonic="SETcc") # 0f 9x /r def ia32_SETcc(obj, cc, Mod, RM, REG, data): obj.misc["opdsz"] = 8 obj.cond = CONDITION_CODES[cc] op1, data = getModRM(obj, Mod, RM, data) obj.operands = [op1] obj.type = type_data_processing # 3 operands: # ----------- # r16/32, r/m16/32, sign extended imm8 @ispec_ia32("*>[ {6b} /r ]", mnemonic="IMUL") def ia32_reg_rm_8(obj, Mod, RM, REG, data): op2, data = getModRM(obj, Mod, RM, data) op1 = getregR(obj, REG, op2.size) if data.size < 8: raise InstructionError(obj) imm = data[0:8] x = env.cst(imm.int(), 8).signextend(op1.size) obj.operands = [op1, op2, x] obj.bytes += pack(imm) obj.type = type_data_processing # r16/32/64, r/m16/32/64, imm16/32 @ispec_ia32("*>[ {69} /r ]", mnemonic="IMUL") def ia32_reg_rm_wd(obj, Mod, RM, REG, data): op2, data = getModRM(obj, Mod, RM, data) op1 = getregR(obj, REG, op2.size) sz = op2.size if sz == 64: sz = 32 if data.size < sz: raise InstructionError(obj) imm = data[0:sz] x = env.cst(imm.int(), sz).signextend(op2.size) obj.operands = [op1, op2, x] obj.bytes += pack(imm) obj.type = type_data_processing # special cases: # -------------- @ispec_ia32("*>[ {0f}{c7} /6 ]", mnemonic="RDRAND") def ia32_rdrand(obj, Mod, RM, data): op1, data = getModRM(obj, Mod, RM, data) if not op1._is_reg: raise InstructionError obj.operands = [op1] obj.type = type_other @ispec_ia32("*>[ {0f}{c3} /r ]", mnemonic="MOVNTI") def ia32_movnti(obj, Mod, RM, REG, data): op2, data = getModRM(obj, Mod, RM, data) if not op2._is_mem: raise InstructionError(obj) W, R, X, B = getREX(obj) if W == 1: op2.size = 64 op1 = env.getreg(REG, op2.size) obj.operands = [op2, op1] obj.type = type_data_processing @ispec_ia32("*>[ {0f}{c7} /1 ]", mnemonic="CMPXCHG8B") @ispec_ia32("*>[ {0f}{c7} /1 ]", mnemonic="CMPXCHG16B",__obj=precond_W1) def ia32_cmpxchg(obj, Mod, RM, data): op2, data = getModRM(obj, Mod, RM, data) if not op2._is_mem: raise InstructionError(obj) op2.size = 64 W, R, X, B = getREX(obj) if W == 1: obj.mnemonic = "CMPXCHG16B" op2.size = 128 obj.operands = [op2] obj.type = type_data_processing @ispec_ia32("*>[ {0f}{1f} /0 ]", mnemonic="NOP", type=type_cpu_state) def ia32_longnop(obj, Mod, RM, data): op1, data = getModRM(obj, Mod, RM, data) @ispec_ia32("*>[ {0f}{ae} /0 ]", mnemonic="FXSAVE", type=type_cpu_state) @ispec_ia32("*>[ {0f}{ae} /1 ]", mnemonic="FXRSTOR", type=type_cpu_state) @ispec_ia32("*>[ {0f}{ae} /2 ]", mnemonic="LDMXCSR", type=type_cpu_state) @ispec_ia32("*>[ {0f}{ae} /3 ]", mnemonic="STMXCSR", type=type_cpu_state) @ispec_ia32("*>[ {0f}{ae} /4 ]", mnemonic="XSAVE", type=type_cpu_state) @ispec("*>[ {0f}{ae} RM(3) 101 Mod(2) ~data(*) ]", mnemonic="XRSTOR", type=type_cpu_state) @ispec("*>[ {0f}{ae} RM(3) 011 Mod(2) ~data(*) ]", mnemonic="XSAVEOPT", type=type_cpu_state) @ispec("*>[ {0f}{ae} RM(3) 111 Mod(2) ~data(*) ]", mnemonic="CLFLUSH", type=type_cpu_state) @ispec("*>[ {0f}{ae} RM(3) 101 11=Mod(2) ~data(*) ]", mnemonic="LFENCE", type=type_cpu_state) @ispec("*>[ {0f}{ae} RM(3) 011 11=Mod(2) ~data(*) ]", mnemonic="MFENCE", type=type_cpu_state) @ispec("*>[ {0f}{ae} RM(3) 111 11=Mod(2) ~data(*) ]", mnemonic="SFENCE", type=type_cpu_state) def ia32_xfence(obj, Mod, RM, data): op1, data = getModRM(obj, Mod, RM, data) if Mod == 0b11 and obj.mnemonic in ("XRSTOR", "XSAVEOPT", "CLFLUSH"): raise InstructionError(obj) else: obj.operands = [op1] if obj.mnemonic == "CLFLUSH": obj.misc["opdsz"] = 8 @ispec_ia32("*>[ {0f}{20} /r ]", mnemonic="MOV", _inv=False) @ispec_ia32("*>[ {0f}{22} /r ]", mnemonic="MOV", _inv=True) def ia32_mov_cr(obj, Mod, REG, RM, data, _inv): if REG not in (0, 2, 3, 4): raise InstructionError(obj) op1 = env.cr(REG) op2 = getregR(obj, RM, 64) obj.operands = [op1, op2] if not _inv else [op2, op1] obj.type = type_system @ispec_ia32("*>[ {0f}{21} /r ]", mnemonic="MOV", _inv=False) @ispec_ia32("*>[ {0f}{23} /r ]", mnemonic="MOV", _inv=True) def ia32_mov_dr(obj, Mod, REG, RM, data, _inv): op1 = env.dr(REG) op2 = getregR(obj, RM, 64) obj.operands = [op1, op2] if not _inv else [op2, op1] obj.type = type_system @ispec_ia32("*>[ {0f}{02} /r ]", mnemonic="LAR") def ia32_mov_dr(obj, Mod, REG, RM, data): op1 = env.dr(REG) op2, data = getModRM(obj, Mod, RM, data) obj.operands = [op1, op2] obj.type = type_system # IN/OUT: # implicit al/ax/eax register: @ispec_ia32("8>[ {ec} ]", mnemonic="IN") @ispec_ia32("8>[ {ee} ]", mnemonic="OUT") def ia32_inout_8(obj): obj.operands = [env.al, env.dx] if obj.mnemonic == "IN" else [env.dx, env.al] obj.type = type_system @ispec_ia32("8>[ {ed} ]", mnemonic="IN") @ispec_ia32("8>[ {ef} ]", mnemonic="OUT") def ia32_inout_32(obj): op1 = env.ax if obj.misc["opdsz"] == 16 else env.eax obj.operands = [op1, env.dx] if obj.mnemonic == "IN" else [env.dx, op1] obj.type = type_system @ispec_ia32("16>[ {e4} ib(8) ]", mnemonic="IN") @ispec_ia32("16>[ {e6} ib(8) ]", mnemonic="OUT") def ia32_in_out(obj, ib): r, x = env.al, env.cst(ib, 8) obj.operands = [r, x] if obj.mnemonic == "IN" else [x, r] obj.type = type_system @ispec_ia32("16>[ {e5} ib(8) ]", mnemonic="IN") @ispec_ia32("16>[ {e7} ib(8) ]", mnemonic="OUT") def ia32_ADC_eax_imm(obj, ib): size = obj.misc["opdsz"] or 32 r = env.eax if size == 32 else env.ax x = env.cst(ib, 8) obj.operands = [r, x] if obj.mnemonic == "IN" else [x, r] obj.type = type_system @ispec_ia32("*>[ {0f}{b6} /r ]", mnemonic="MOVZX", _flg8=True) @ispec_ia32("*>[ {0f}{b7} /r ]", mnemonic="MOVZX", _flg8=False) @ispec_ia32("*>[ {0f}{be} /r ]", mnemonic="MOVSX", _flg8=True) @ispec_ia32("*>[ {0f}{bf} /r ]", mnemonic="MOVSX", _flg8=False) def ia32_movx(obj, Mod, RM, REG, data, _flg8): size = obj.misc["opdsz"] or 32 W, R, X, B = getREX(obj) if W == 1: size = 64 if R == 1: REG = (R << 3) + REG op1 = env.getreg(REG, size) obj.misc["opdsz"] = 8 if _flg8 else 16 op2, data = getModRM(obj, Mod, RM, data, REX=(0, R, X, B)) obj.operands = [op1, op2] obj.type = type_data_processing # MOVBE & CRC32: @ispec_ia32("*>[ {0f}{38} s 000 1111 /r ]", mnemonic="MOVBE",__obj=precond_norepne) def ia32_movbe_crc32(obj, s, Mod, RM, REG, data): op1, data = getModRM(obj, Mod, RM, data) if not op1._is_mem: raise InstructionError(obj) op2 = env.getreg(REG, op1.size) obj.operands = [op1, op2] if s else [op2, op1] obj.type = type_data_processing @ispec_ia32("*>[ {0f}{38} s 000 1111 /r ]", mnemonic="CRC32", __obj=precond_repne) # (f2) 0f 38 f0/f1 def ia32_movbe_crc32(obj, s, Mod, RM, REG, data): op1 = env.getreg(REG, 32) if s == 0: obj.misc["opdsz"] = 8 op2, data = getModRM(obj, Mod, RM, data) obj.operands = [op1, op2] obj.type = type_data_processing # FPU instructions: # ----------------- from amoco.arch.x64 import spec_fpu ISPECS += spec_fpu.ISPECS # ## SSE instructions: ## ----------------- # from amoco.arch.x64 import spec_sse ISPECS += spec_sse.ISPECS
{ "pile_set_name": "Github" }