text
stringlengths
2
1.04M
meta
dict
class Draft < ActiveRecord::Base attr_accessible :content end
{ "content_hash": "e3cb38be2da9c9e4389be3c32d110a97", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 32, "avg_line_length": 21.333333333333332, "alnum_prop": 0.78125, "repo_name": "jay16/solife", "id": "8302ece4ba95b4395c49d3453fb1e1b320a95295", "size": "64", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/models/draft.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "132011" }, { "name": "CoffeeScript", "bytes": "11943" }, { "name": "JavaScript", "bytes": "979812" }, { "name": "Ruby", "bytes": "176972" }, { "name": "Shell", "bytes": "1789" } ], "symlink_target": "" }
require 'spec_helper' include FixtureHelpers describe Puppet::Type.type(:eos_varp_interface).provider(:eos) do # Puppet RAL memoized methods let(:resource) do resource_hash = { ensure: :present, name: 'Vlan99', shared_ip: ['1.1.1.1', '2.2.2.2'], provider: described_class.name } Puppet::Type.type(:eos_varp_interface).new(resource_hash) end let(:provider) { resource.provider } let(:api) { double('varp') } let(:interfaces) { double('varp.interfaces') } def varp varp = Fixtures[:varp] return varp if varp fixture('varp', dir: File.dirname(__FILE__)) end before :each do allow(described_class.node).to receive(:api).with('varp') .and_return(api) allow(provider.node).to receive(:api).with('varp') .and_return(api) allow(api).to receive(:interfaces).and_return(interfaces) end context 'class methods' do before { allow(api).to receive(:get).and_return(varp) } describe '.instances' do subject { described_class.instances } it { is_expected.to be_an Array } it 'has one entry' do expect(subject.size).to eq(1) end it 'has an instance Vlan99' do instance = subject.find { |p| p.name == 'Vlan99' } expect(instance).to be_a described_class end context 'eos_varp_interface { Vlan99 }' do subject { described_class.instances.find { |p| p.name == 'Vlan99' } } include_examples 'provider resource methods', ensure: :present, name: 'Vlan99', shared_ip: ['1.1.1.1', '2.2.2.2'] end end describe '.prefetch' do let :resources do { 'Vlan99' => Puppet::Type.type(:eos_varp_interface) .new(name: 'Vlan99'), 'Vlan100' => Puppet::Type.type(:eos_varp_interface) .new(name: 'Vlan100') } end subject { described_class.prefetch(resources) } it 'resource providers are absent prior to calling .prefetch' do resources.values.each do |rsrc| expect(rsrc.provider.shared_ip).to eq(:absent) end end it 'sets the provider instance of the managed resource Vlan99' do subject expect(resources['Vlan99'].provider.name).to eq('Vlan99') expect(resources['Vlan99'].provider.shared_ip) .to eq(['1.1.1.1', '2.2.2.2']) end it 'does not set the provider instance of the unmanaged resource' do subject expect(resources['Vlan100'].provider.shared_ip).to eq(:absent) end end end context 'resource (instance) methods' do describe '#exists?' do subject { provider.exists? } context 'when the resource does not exist on the system' do it { is_expected.to be_falsey } end context 'when the resource exists on the system' do let(:provider) do allow(api).to receive(:get).and_return(varp) described_class.instances.first end it { is_expected.to be_truthy } end end describe '#create' do let(:name) { resource[:name] } it 'sets ensure to :present' do expect(interfaces).to receive(:set_addresses) .with(name, value: ['1.1.1.1', '2.2.2.2']) provider.create provider.shared_ip = ['1.1.1.1', '2.2.2.2'] provider.flush expect(provider.ensure).to eq(:present) end context 'when addresses are blank' do it 'sets ensure to :present' do resource[:ensure] = :present resource.delete(:shared_ip) expect { provider.create }.to raise_error end end end describe '#destroy' do let(:name) { resource[:name] } it 'sets ensure to :absent' do expect(interfaces).to receive(:set_addresses).with(name, enable: false) resource[:ensure] = :absent provider.destroy provider.flush expect(provider.ensure).to eq(:absent) end end describe '#shared_ip=(val)' do let(:name) { resource[:name] } it 'sets shared_ip to value ["1.1.1.1", "2.2.2.2"]' do expect(interfaces).to receive(:set_addresses) .with(name, value: ['1.1.1.1', '2.2.2.2']) provider.create provider.shared_ip = ['1.1.1.1', '2.2.2.2'] provider.flush expect(provider.shared_ip).to eq(['1.1.1.1', '2.2.2.2']) end end end end
{ "content_hash": "7a8a17d961581538a0b0c0505636bc1f", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 79, "avg_line_length": 28.61392405063291, "alnum_prop": 0.57509400575094, "repo_name": "arista-eosplus/puppet-eos", "id": "22162d14b1bb4319f7eda78e545ecb708de3c993", "size": "6056", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "spec/unit/puppet/provider/eos_varp_interface/default_spec.rb", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Makefile", "bytes": "6778" }, { "name": "Pascal", "bytes": "19" }, { "name": "Puppet", "bytes": "505" }, { "name": "Python", "bytes": "9081" }, { "name": "Ruby", "bytes": "740201" }, { "name": "Shell", "bytes": "2119" } ], "symlink_target": "" }
const dotenv = require('dotenv').config(); const five = require('johnny-five'); const mqtt = require('mqtt'); let temp_sensor; let board = new five.Board({repl: false,}); let client = mqtt.connect(process.env.MQTT_SERVER); const pub_topic = process.env.UNIQ_TOPIC + "/temperature/ic"; const meta_topic = process.env.UNIQ_TOPIC + "/temperature/m"; client.on('connect', () => { console.log("MQTT Server connected"); }); board.on("ready", () => { temp_sensor = new five.Thermometer({ controller: 'LM35', pin: process.env.TEMP_PIN || "A0", freq: process.env.TEMP_FREQUENCY * 1000 || 10000, }); temp_sensor.on("data", (data) => { const msg = { c: data.celsius, ts: Date.now(), }; // use the retain flag to ensure the last value stays behind. This // will ensure the bot can always get a value on start up client.publish(pub_topic, JSON.stringify(msg), {retain: true}); //console.log(msg); }); });
{ "content_hash": "e8370e0f1d8b691c6591bb696f6f5743", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 74, "avg_line_length": 27.513513513513512, "alnum_prop": 0.5962671905697446, "repo_name": "ajfisher/embodied-bots", "id": "83edd8b19da3755c21a53009012a30dae6688bc3", "size": "1018", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "examples/code/6-temp-server.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "64000" }, { "name": "HTML", "bytes": "40367" }, { "name": "JavaScript", "bytes": "188990" } ], "symlink_target": "" }
var TextGenerator = (function(){ /** @memberof Nehan @class TextGenerator @classdesc inline level generator, output inline level block. @constructor @extends {Nehan.LayoutGenerator} @param style {Nehan.StyleContext} @param stream {Nehan.TokenStream} @param child_generator {Nehan.LayoutGenerator} */ function TextGenerator(style, stream){ LayoutGenerator.call(this, style, stream); } Nehan.Class.extend(TextGenerator, LayoutGenerator); var __find_head_text = function(element){ return (element instanceof Box)? __find_head_text(element.elements[0]) : element; }; TextGenerator.prototype._yield = function(context){ if(!context.hasInlineSpaceFor(1)){ return null; } var next_head = Nehan.Config.hyphenate? this._peekParentNextToken() : null; var next_head_char = next_head? this._peekParentNextHeadChar(next_head) : null; var next_head_measure = next_head? this._estimateParentNextHeadMeasure(next_head) : this.style.getFontSize(); var is_next_head_ng = next_head_char? next_head_char.isHeadNg() : false; var is_head_output = this.style.contentMeasure === context.getInlineMaxMeasure(); //console.log("[t:%s]next head:%o, next_head_char:%s, next size:%d", this.style.markupName, next_head, (next_head_char? next_head_char.data : "null"), next_head_measure); while(this.hasNext()){ var element = this._getNext(context); if(element === null){ break; } var measure = this._getMeasure(element); //console.log("[t:%s]%o(%s), m = %d (%d/%d)", this.style.markupName, element, (element.data || ""), measure, context.inline.curMeasure, context.inline.maxMeasure); if(measure === 0){ break; } // skip head space for first word element if not 'white-space:pre' if(is_head_output && context.getInlineCurMeasure() === 0 && element instanceof Nehan.Char && element.isWhiteSpace() && !this.style.isPre()){ var next = this.stream.peek(); if(next && next instanceof Nehan.Word){ continue; // skip head space } } // if token is last one and maybe tail text, check tail/head NG between two inline generators. if(Nehan.Config.hyphenate && !this.stream.hasNext() && !context.hasInlineSpaceFor(measure + next_head_measure)){ // avoid tail/head NG between two generators if(element instanceof Nehan.Char && element.isTailNg() || is_next_head_ng){ context.setLineBreak(true); context.setHyphenated(true); //console.log("hyphenated at %o:type:%s", (element.data || ""), (is_next_head_ng? "head" : "tail")); //console.log("next head:%s", (next_head_char? next_head_char.data : "")); this.pushCache(element); break; } } if(!context.hasInlineSpaceFor(measure)){ //console.info("!> text overflow:%o(%s, m=%d)", element, element.data, measure); this.pushCache(element); context.setLineOver(true); break; } this._addElement(context, element, measure); //console.log("cur measure:%d", context.inline.curMeasure); if(!context.hasInlineSpaceFor(1)){ context.setLineOver(true); break; } } return this._createOutput(context); }; TextGenerator.prototype._createChildContext = function(context){ return new Nehan.LayoutContext( context.block, // inline generator inherits block context as it is. new Nehan.InlineContext(context.getInlineRestMeasure()) ); }; TextGenerator.prototype._createOutput = function(context){ if(context.isInlineEmpty()){ return null; } // hyphenate if this line is generated by overflow(not line-break). if(Nehan.Config.hyphenate && !context.isInlineEmpty() && !context.hasLineBreak()){ this._hyphenateLine(context); } var line = this.style.createTextBlock({ hasLineBreak:context.hasLineBreak(), // is line break included in? lineOver:context.isLineOver(), // is line full-filled? breakAfter:context.hasBreakAfter(), // is break after included in? hyphenated:context.isHyphenated(), // is line hyphenated? measure:context.getInlineCurMeasure(), // actual measure elements:context.getInlineElements(), // all inline-child, not only text, but recursive child box. charCount:context.getInlineCharCount(), maxExtent:context.getInlineMaxExtent(), maxFontSize:context.getInlineMaxFontSize(), isEmpty:context.isInlineEmpty() }); // set position in parent stream. if(this._parent && this._parent.stream){ line.pos = Math.max(0, this._parent.stream.getPos() - 1); } // call _onCreate callback for 'each' output this._onCreate(context, line); // call _onComplete callback for 'final' output if(!this.hasNext()){ this._onComplete(context, line); } //console.log(">> texts:[%s], context = %o, stream pos:%d, stream:%o", line.toString(), context, this.stream.getPos(), this.stream); return line; }; TextGenerator.prototype._peekParentNextToken = function(){ if(this.style.markupName === "rt"){ return null; } var root_line = this._parent; while(root_line && root_line.style === this.style){ root_line = root_line._parent || null; } root_line = root_line || this._parent; return (root_line && root_line.stream)? root_line.stream.peek() : null; }; TextGenerator.prototype._peekParentNextHeadChar = function(token){ if(token instanceof Nehan.Text){ var head_c1 = token.getContent().substring(0,1); return new Nehan.Char(head_c1); } else if(token instanceof Nehan.Tag){ if(token.name === "ruby"){ return null; // generally, ruby is not both tail-NG and head-NG. } var head_c1 = token.getContent().replace(/^[\s]*<[^>]+>/, "").substring(0,1); return new Nehan.Char(head_c1); } return null; }; // estimate 'maybe' size, not strict!! TextGenerator.prototype._estimateParentNextHeadMeasure = function(token){ var font_size = this.style.getFontSize(); if(token instanceof Nehan.Tag && token.name === "ruby"){ var ruby = new Nehan.RubyTokenStream(token.getContent()).get(); var char_count = ruby.getCharCount(); var rt_char_count = ruby.getRtString().length; return Math.max(Math.floor(rt_char_count * font_size / 2), char_count * font_size); } return font_size; }; TextGenerator.prototype._hyphenateLine = function(context){ // by stream.getToken(), stream pos has been moved to next pos already, so cur pos is the next head. var old_head = this.peekLastCache() || this.stream.peek(); if(old_head === null){ return; } // hyphenate by dangling. var head_next = this.stream.peek(); head_next = (head_next && old_head.pos === head_next.pos)? this.stream.peek(1) : head_next; if(Nehan.Config.danglingHyphenate && context.hyphenateDangling(old_head, head_next) === true){ this._addElement(context, old_head, 0); // push tail as zero element if(head_next){ this.stream.setPos(head_next.pos); } else { this.stream.get(); } context.setLineBreak(true); context.setHyphenated(true); this.clearCache(); return; } // hyphenate by sweep. var new_head = context.hyphenateSweep(old_head, head_next); // if fixed, new_head token is returned. if(new_head){ //console.log("old_head:%o, new_head:%o", old_head, new_head); var hyphenated_measure = (new_head.pos - old_head.pos) * this.style.getFontSize(); // [FIXME] this is not accurate size. context.addInlineMeasure(hyphenated_measure); //console.log("hyphenate and new head:%o", new_head); this.stream.setPos(new_head.pos); context.setLineBreak(true); context.setHyphenated(true); this.clearCache(); // stream position changed, so disable cache. } }; TextGenerator.prototype._getNext = function(context){ if(this.hasCache()){ var cache = this.popCache(context); return cache; } // read next token var token = this.stream.get(); if(token === null){ return null; } //console.log("text token:%o", token); // if white-space if(Nehan.Token.isWhiteSpace(token)){ return this._getWhiteSpace(context, token); } return this._getText(context, token); }; TextGenerator.prototype._breakInline = function(block_gen){ this.setTerminate(true); if(this._parent === null){ return; } if(this._parent instanceof TextGenerator){ this._parent._breakInline(block_gen); } else { this._parent.setChildLayout(block_gen); } }; TextGenerator.prototype._getWhiteSpace = function(context, token){ if(this.style.isPre()){ return this._getWhiteSpacePre(context, token); } // skip continuous white-spaces. this.stream.skipUntil(Nehan.Token.isWhiteSpace); // first new-line and tab are treated as single half space. if(token.isNewLine() || token.isTabSpace()){ Nehan.Char.call(token, " "); // update by half-space } // if white-space is not new-line, use first one. return this._getText(context, token); }; TextGenerator.prototype._getWhiteSpacePre = function(context, token){ if(Nehan.Token.isNewLine(token)){ context.setLineBreak(true); return null; } return this._getText(context, token); // read as normal text }; TextGenerator.prototype._getText = function(context, token){ if(!token.hasMetrics()){ this._setTextMetrics(context, token); } switch(token._type){ case "char": case "tcy": case "ruby": return token; case "word": return this._getWord(context, token); } console.error("Nehan::TextGenerator, undefined token:", token); throw "Nehan::TextGenerator, undefined token"; }; TextGenerator.prototype._setTextMetrics = function(context, token){ // if charactor token, set kerning before setting metrics. // because some additional space is added if kerning is enabled or not. if(Nehan.Config.kerning){ if(token instanceof Nehan.Char && token.isKerningChar()){ this._setTextSpacing(context, token); } else if(token instanceof Nehan.Word){ this._setTextSpacing(context, token); } } token.setMetrics(this.style.flow, this.style.getFont()); }; TextGenerator.prototype._setTextSpacing = function(context, token){ var next_token = this.stream.peek(); var prev_text = context.getInlineLastElement(); var next_text = next_token && Nehan.Token.isText(next_token)? next_token : null; Nehan.Spacing.add(token, prev_text, next_text); }; TextGenerator.prototype._getWord = function(context, token){ var rest_measure = context.getInlineRestMeasure(); var advance = token.getAdvance(this.style.flow, this.style.letterSpacing || 0); // if there is enough space for this word, just return. if(advance <= rest_measure){ token.setDivided(false); return token; } // at this point, this word is larger than rest space. // but if this word size is less than max_measure and 'word-berak' is not 'break-all', // just break line and show it at the head of next line. if(advance <= context.getInlineMaxMeasure() && !this.style.isWordBreakAll()){ return token; // overflow and cached } // at this point, situations are // 1. advance is larger than rest_measure and 'word-break' is set to 'break-all'. // 2. or word itself is larger than max_measure. // in these case, we must cut this word into some parts. var part = token.cutMeasure(this.style.flow, this.style.getFont(), rest_measure); // get sliced word if(!token.isDivided()){ return token; } if(token.data !== "" && token.bodySize > 0){ this.stream.prev(); // re-parse this token because rest part is still exists. } part.bodySize = Math.min(rest_measure, part.bodySize); // sometimes overflows. more accurate logic is required in the future. return part; }; TextGenerator.prototype._getMeasure = function(element){ return element.getAdvance(this.style.flow, this.style.letterSpacing || 0); }; TextGenerator.prototype._addElement = function(context, element, measure){ context.addInlineTextElement(element, measure); // call _onAddElement callback for each 'element' of output. this._onAddElement(context, element); }; return TextGenerator; })();
{ "content_hash": "e767fd5b113219b49af9e8c74fa4e348", "timestamp": "", "source": "github", "line_count": 330, "max_line_length": 174, "avg_line_length": 37.584848484848486, "alnum_prop": 0.6616141256147706, "repo_name": "david43/nehan.js", "id": "a0b79fdc26ec53bbe7fa2951343e04767b397b25", "size": "12403", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/text-generator.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2190" }, { "name": "HTML", "bytes": "10093" }, { "name": "JavaScript", "bytes": "1024715" }, { "name": "Makefile", "bytes": "85" } ], "symlink_target": "" }
* ~~Remove Job class - it's useless (just stick with `Task`)~~ * As a conciquence, rename `runnable` to `task` * New server/client json protocol * Make internal data structures that we pass between layers more json-friendly (e.g., look in ```__str__``` of ```class Service``` in ```runnable.py```) * SSL connection between client/server * Implement parallel start/stop of tasks * Expose service properties and commands as files: ``` For example: my_service |--/ task1 |--/ properties |--/ prop1 |--> about |--> value |--/ prop2 |--> about |--> value |--/ commands |--/ cmd1 |--> about |--> arg1 |--> arg2 |--> run |--/ cmd2 |--> about |--> run ``` Now we can examine ```prop1``` like this: ``` $ cat my_service/task1/properties/prop1/about Description of my_service.task1.prop1 ``` ``` $ cat my_service/task1/properties/prop1/value 1 ``` And run commands like this (without arguments): ``` $ echo 1 > my_service/task1/commands/cmd2 ``` With arguments: ``` $ echo "string arg1" > my_service/task1/commands/cmd1/arg1 $ echo 2 > my_service/task1/commands/cmd1/arg2 $ echo 1 > my_service/task1/commands/cmd1/run ```
{ "content_hash": "6f55989a6550c5854e22cc9d85ec5175", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 81, "avg_line_length": 27.607843137254903, "alnum_prop": 0.5284090909090909, "repo_name": "unix-beard/gloria", "id": "f5f8abbe47414a1e7c4f764c442721eb0fc39b14", "size": "1408", "binary": false, "copies": "1", "ref": "refs/heads/python3_port", "path": "TODO.md", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "92050" } ], "symlink_target": "" }
#include "config.h" #include "web/ValidationMessageClientImpl.h" #include "core/dom/Element.h" #include "core/frame/FrameView.h" #include "core/layout/LayoutObject.h" #include "platform/HostWindow.h" #include "public/platform/WebRect.h" #include "public/platform/WebString.h" #include "public/web/WebTextDirection.h" #include "public/web/WebViewClient.h" #include "web/WebViewImpl.h" #include "wtf/CurrentTime.h" namespace blink { ValidationMessageClientImpl::ValidationMessageClientImpl(WebViewImpl& webView) : m_webView(webView) , m_currentAnchor(nullptr) , m_lastPageScaleFactor(1) , m_finishTime(0) , m_timer(this, &ValidationMessageClientImpl::checkAnchorStatus) { } PassOwnPtrWillBeRawPtr<ValidationMessageClientImpl> ValidationMessageClientImpl::create(WebViewImpl& webView) { return adoptPtrWillBeNoop(new ValidationMessageClientImpl(webView)); } ValidationMessageClientImpl::~ValidationMessageClientImpl() { } FrameView* ValidationMessageClientImpl::currentView() { return m_currentAnchor->document().view(); } void ValidationMessageClientImpl::showValidationMessage(const Element& anchor, const String& message, TextDirection messageDir, const String& subMessage, TextDirection subMessageDir) { if (message.isEmpty()) { hideValidationMessage(anchor); return; } if (!anchor.layoutBox()) return; if (m_currentAnchor) hideValidationMessage(*m_currentAnchor); m_currentAnchor = &anchor; IntRect anchorInViewport = currentView()->contentsToViewport(anchor.pixelSnappedBoundingBox()); m_lastAnchorRectInScreen = currentView()->hostWindow()->viewportToScreen(anchorInViewport); m_lastPageScaleFactor = m_webView.pageScaleFactor(); m_message = message; const double minimumSecondToShowValidationMessage = 5.0; const double secondPerCharacter = 0.05; const double statusCheckInterval = 0.1; m_webView.client()->showValidationMessage(anchorInViewport, m_message, toWebTextDirection(messageDir), subMessage, toWebTextDirection(subMessageDir)); m_finishTime = monotonicallyIncreasingTime() + std::max(minimumSecondToShowValidationMessage, (message.length() + subMessage.length()) * secondPerCharacter); // FIXME: We should invoke checkAnchorStatus actively when layout, scroll, // or page scale change happen. m_timer.startRepeating(statusCheckInterval, BLINK_FROM_HERE); } void ValidationMessageClientImpl::hideValidationMessage(const Element& anchor) { if (!m_currentAnchor || !isValidationMessageVisible(anchor)) return; m_timer.stop(); m_currentAnchor = nullptr; m_message = String(); m_finishTime = 0; m_webView.client()->hideValidationMessage(); } bool ValidationMessageClientImpl::isValidationMessageVisible(const Element& anchor) { return m_currentAnchor == &anchor; } void ValidationMessageClientImpl::documentDetached(const Document& document) { if (m_currentAnchor && m_currentAnchor->document() == document) hideValidationMessage(*m_currentAnchor); } void ValidationMessageClientImpl::checkAnchorStatus(Timer<ValidationMessageClientImpl>*) { ASSERT(m_currentAnchor); if (monotonicallyIncreasingTime() >= m_finishTime || !currentView()) { hideValidationMessage(*m_currentAnchor); return; } // Check the visibility of the element. // FIXME: Can we check invisibility by scrollable non-frame elements? IntRect newAnchorRectInViewport = currentView()->contentsToViewport(m_currentAnchor->pixelSnappedBoundingBox()); // FIXME: This intersection eliminates the part of the rect outside the root view. // If this is meant as a visiblity test, intersecting it against the viewport rect // likely makes more sense. newAnchorRectInViewport = intersection(currentView()->convertToContainingWindow(currentView()->boundsRect()), newAnchorRectInViewport); if (newAnchorRectInViewport.isEmpty()) { hideValidationMessage(*m_currentAnchor); return; } IntRect newAnchorRectInViewportInScreen = currentView()->hostWindow()->viewportToScreen(newAnchorRectInViewport); if (newAnchorRectInViewportInScreen == m_lastAnchorRectInScreen && m_webView.pageScaleFactor() == m_lastPageScaleFactor) return; m_lastAnchorRectInScreen = newAnchorRectInViewportInScreen; m_lastPageScaleFactor = m_webView.pageScaleFactor(); m_webView.client()->moveValidationMessage(newAnchorRectInViewport); } void ValidationMessageClientImpl::willBeDestroyed() { if (m_currentAnchor) hideValidationMessage(*m_currentAnchor); } DEFINE_TRACE(ValidationMessageClientImpl) { visitor->trace(m_currentAnchor); ValidationMessageClient::trace(visitor); } } // namespace blink
{ "content_hash": "a5af997928966366de145e6eba2b7b7e", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 182, "avg_line_length": 35.80451127819549, "alnum_prop": 0.753884922301554, "repo_name": "Bysmyyr/chromium-crosswalk", "id": "ae87939ae4b0c1fc6aeff156bc9d4c3942292f04", "size": "6122", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "third_party/WebKit/Source/web/ValidationMessageClientImpl.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
package database import ( "time" "github.com/drone/drone/shared/model" "github.com/russross/meddler" ) type Userstore struct { meddler.DB } func NewUserstore(db meddler.DB) *Userstore { return &Userstore{db} } // GetUser retrieves a specific user from the // datastore for the given ID. func (db *Userstore) GetUser(id int64) (*model.User, error) { var usr = new(model.User) var err = meddler.Load(db, userTable, usr, id) return usr, err } // GetUserLogin retrieves a user from the datastore // for the specified remote and login name. func (db *Userstore) GetUserLogin(remote, login string) (*model.User, error) { var usr = new(model.User) var err = meddler.QueryRow(db, usr, rebind(userLoginQuery), remote, login) return usr, err } // GetUserToken retrieves a user from the datastore // with the specified token. func (db *Userstore) GetUserToken(token string) (*model.User, error) { var usr = new(model.User) var err = meddler.QueryRow(db, usr, rebind(userTokenQuery), token) return usr, err } // GetUserList retrieves a list of all users from // the datastore that are registered in the system. func (db *Userstore) GetUserList() ([]*model.User, error) { var users []*model.User var err = meddler.QueryAll(db, &users, rebind(userListQuery)) return users, err } // PostUser saves a User in the datastore. func (db *Userstore) PostUser(user *model.User) error { if user.Created == 0 { user.Created = time.Now().UTC().Unix() } user.Updated = time.Now().UTC().Unix() return meddler.Save(db, userTable, user) } // PutUser saves a user in the datastore. func (db *Userstore) PutUser(user *model.User) error { if user.Created == 0 { user.Created = time.Now().UTC().Unix() } user.Updated = time.Now().UTC().Unix() return meddler.Save(db, userTable, user) } // DelUser removes the user from the datastore. func (db *Userstore) DelUser(user *model.User) error { var _, err = db.Exec(rebind(userDeleteStmt), user.ID) return err } // User table name in database. const userTable = "users" // SQL query to retrieve a User by remote login. const userLoginQuery = ` SELECT * FROM users WHERE user_remote=? AND user_login=? LIMIT 1 ` // SQL query to retrieve a User by remote login. const userTokenQuery = ` SELECT * FROM users WHERE user_token=? LIMIT 1 ` // SQL query to retrieve a list of all users. const userListQuery = ` SELECT * FROM users ORDER BY user_name ASC ` // SQL statement to delete a User by ID. const userDeleteStmt = ` DELETE FROM users WHERE user_id=? `
{ "content_hash": "2ccf538747ed532d218ddf3054dd7a81", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 78, "avg_line_length": 23.914285714285715, "alnum_prop": 0.7128634010354441, "repo_name": "10fish/drone", "id": "25de08026020e36baee7b93413af8c6bd7bcfe60", "size": "2511", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "server/datastore/database/user.go", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
(function(require, module) { "use strict"; var AsyncExecutor = require('msl-core/util/AsyncExecutor.js'); var FilterStreamFactory = require('msl-core/msg/FilterStreamFactory.js'); var InputStream = require('msl-core/io/InputStream.js'); var MslConstants = require('msl-core/MslConstants.js'); var MslIoException = require('msl-core/MslIoException.js'); var OutputStream = require('msl-core/io/OutputStream.js'); var TextEncoding = require('msl-core/util/TextEncoding.js'); /** * <p>A filter input stream that appends read data to a text HTML DOM * element.</p> * * @author Wesley Miaw <wmiaw@netflix.com> */ var TextInputStream = InputStream.extend({ /** * Create a new text input stream backed by the provided input stream. * * @param {Element} target target text HTML DOM element. * @param {InputStream} in the backing input stream. */ init: function init(target, input) { // The properties. var props = { _target: { value: target, writable: false, enumerable: false, configurable: false }, _input: { value: input, writable: false, enumerable: false, configurable: false }, }; Object.defineProperties(this, props); }, /** @inheritDoc */ close: function close(timeout, callback) { this._input.close(timeout, callback); }, /** @inheritDoc */ mark: function mark(readlimit) { this._input.mark(readlimit); }, /** @inheritDoc */ reset: function reset() { this._input.reset(); }, /** @inheritDoc */ markSupported: function markSupported() { return this._input.markSupported(); }, /** @inheritDoc */ read: function read(len, timeout, callback) { var self = this; this._input.read(len, timeout, { result: function(data) { AsyncExecutor(callback, function() { try { if (data) self._target.innerHTML += TextEncoding.getString(data, MslConstants.DEFAULT_CHARSET); return data; } catch (e) { throw new MslIoException("Error encoding data into string.", e); } }, self); }, timeout: function(data) { AsyncExecutor(callback, function() { try { if (data) self._target.innerHTML += TextEncoding.getString(data, MslConstants.DEFAULT_CHARSET); return data; } catch (e) { throw new MslIoException("Error encoding data into string.", e); } }, self); }, error: callback.error, }); }, /** @inheritDoc */ skip: function skip(n, timeout, callback) { this._input.skip(n, timeout, callback); } }); /** * <p>A filter output stream that appends written data to a text HTML DOM * element.</p> * * @author Wesley Miaw <wmiaw@netflix.com> */ var TextOutputStream = OutputStream.extend({ /** * Create a new text output stream backed by the provided output stream. * * @param {Element} target target text HTML DOM element. * @param {OutputStream} output the backing output stream. */ init: function init(target, output) { // The properties. var props = { _target: { value: target, writable: false, enumerable: false, configurable: false }, _output: { value: output, writable: false, enumerable: false, configurable: false }, }; Object.defineProperties(this, props); }, /** @inheritDoc */ close: function close(timeout, callback) { this._output.close(timeout, callback); }, /** @inheritDoc */ write: function write(data, off, len, timeout, callback) { var self = this; AsyncExecutor(callback, function() { try { this._target.innerHTML += TextEncoding.getString(data.subarray(off, off + len), MslConstants.DEFAULT_CHARSET); } catch (e) { throw new MslIoException("Error encoding data into string.", e); } this._output.write(data, off, len, timeout, callback); }, self); }, /** @inheritDoc */ flush: function flush(timeout, callback) { this._output.flush(timeout, callback); }, }); /** * <p>This filter stream factory will append stream data to provided text * HTML DOM elements.</p> * * @author Wesley Miaw <wmiaw@netflix.com> */ var SimpleFilterStreamFactory = module.exports = FilterStreamFactory.extend({ /** * <p>Create a new filter stream factory that is tied to the provided * HTML text elements.</p> * * @param {Element} sentText sent text HTML DOM element. * @param {Element} receivedText received text HTML DOM element. */ init: function init(sentText, receivedText) { // Set properties. var props = { _sent: { value: sentText, writable: false, enumerable: false, configurable: false }, _received: { value: receivedText, writable: false, enumerable: false, configurable: false }, }; Object.defineProperties(this, props); }, /** @inheritDoc */ getInputStream: function getInputStream(input) { return new TextInputStream(this._received, input); }, /** @inheritDoc */ getOutputStream: function getOutputStream(output) { return new TextOutputStream(this._sent, output); }, }); })(require, (typeof module !== 'undefined') ? module : mkmodule('SimpleFilterStreamFactory'));
{ "content_hash": "2090f60a1827931a1a88f068d80f5b31", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 130, "avg_line_length": 36.93023255813954, "alnum_prop": 0.5264483627204031, "repo_name": "Netflix/msl", "id": "3a1ca563b67f0af79e1597410eb8853a66ef9eac", "size": "6979", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/simple/src/main/javascript/client/msg/SimpleFilterStreamFactory.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "48439" }, { "name": "C++", "bytes": "5793146" }, { "name": "CMake", "bytes": "8316" }, { "name": "CSS", "bytes": "6537" }, { "name": "HTML", "bytes": "30201" }, { "name": "Java", "bytes": "3470782" }, { "name": "JavaScript", "bytes": "4936589" }, { "name": "Objective-C", "bytes": "17744" }, { "name": "Rich Text Format", "bytes": "13258" }, { "name": "Shell", "bytes": "2125" } ], "symlink_target": "" }
package org.ice4j.socket; import java.io.*; import java.net.*; import java.nio.channels.*; import org.ice4j.stack.*; /** * Implements a <tt>DatagramSocket</tt> which delegates its calls to a specific * <tt>DatagramSocket</tt>. * * @author Lyubomir Marinov */ public class DelegatingDatagramSocket extends DatagramSocket { /** * Assigns a factory to generate custom DatagramSocket to replace classical * "java" DatagramSocket. This way external applications can define the * type of DatagramSocket to use. * If "null", then the classical "java" DatagramSocket is used. Otherwise * the factory generates custom DatagramSockets. */ private static DatagramSocketFactory delegateFactory = null; /** * The size to which to set the receive buffer size. This value must set by * using the DelegatingDatagramSocket.setDefaultReceiveBufferSize(int) * function before calling the DelegatingDatagramSocket constructor and must * be greater than 0 to be effective. */ private static int defaultReceiveBufferSize = -1; /** * If a factory is provided, then any new instances of * DelegatingDatagramSocket will automatically use a socket from the * factory instead of the super class. * * If this method is used, the factory class needs to ensure the socket * objects are properly constructed and initialized - in particular, any * default receive buffer size specified through * DelegatingDatagramSocket#setDefaultReceiveBufferSize() won't * automatically be applied to sockets obtain from the factory. * * @param factory The factory assigned to generates the new DatagramSocket * for each new DelegatingDatagramSocket which do not use a delegate socket. */ public static void setDefaultDelegateFactory(DatagramSocketFactory factory) { delegateFactory = factory; } /** * Specifies a default receive buffer size for the underlying sockets. * This function must be called before using the DelegatingDatagramSocket * constructor. The size must be greater than 0 to be effective. * * @see DatagramSocket#setReceiveBufferSize(int) for a discussion of the * effect of changing this setting. * * @param size the size to which to set the receive buffer size. This value * must be greater than 0. */ public static void setDefaultReceiveBufferSize(int size) { defaultReceiveBufferSize = size; } /** * Determines whether a packet should be logged, given the number of sent * or received packets. * * @param numOfPacket the number of packets sent or received. */ static boolean logNonStun(long numOfPacket) { return (numOfPacket == 1) || (numOfPacket == 300) || (numOfPacket == 500) || (numOfPacket == 1000) || ((numOfPacket % 5000) == 0); } /** * The <tt>DatagramSocket</tt> to which this * <tt>DelegatingDatagramSocket</tt> delegates its calls. */ protected final DatagramSocket delegate; /** * The number of non-STUN packets received on this socket. */ private long nbReceivedPackets = 0; /** * The number of non-STUN packets sent through this socket. */ private long nbSentPackets = 0; /** * Whether this socket has been closed. */ private boolean closed = false; /** * Initializes a new <tt>DelegatingDatagramSocket</tt> instance and binds it * to any available port on the local host machine. The socket will be * bound to the wildcard address, an IP address chosen by the kernel. * * @throws SocketException if the socket could not be opened, or the socket * could not bind to the specified local port * @see DatagramSocket#DatagramSocket() */ public DelegatingDatagramSocket() throws SocketException { this(null, new InetSocketAddress(0)); } /** * Initializes a new <tt>DelegatingDatagramSocket</tt> instance which to * implement the <tt>DatagramSocket</tt> functionality by delegating to a * specific <tt>DatagramSocket</tt>. * * @param delegate the <tt>DatagramSocket</tt> to which the new instance is * to delegate * @throws SocketException if anything goes wrong while initializing the new * <tt>DelegatingDatagramSocket</tt> instance */ public DelegatingDatagramSocket(DatagramSocket delegate) throws SocketException { this(delegate, null); } /** * Initializes a new <tt>DelegatingDatagramSocket</tt> instance and binds * it to the specified port on the local host machine. The socket will be * bound to the wildcard address, an IP address chosen by the kernel. * * @param port the port to bind the new socket to * @throws SocketException if the socket could not be opened, or the socket * could not bind to the specified local port * @see DatagramSocket#DatagramSocket(int) */ public DelegatingDatagramSocket(int port) throws SocketException { this(null, new InetSocketAddress(port)); } /** * Initializes a new <tt>DelegatingDatagramSocket</tt> instance bound to the * specified local address. The local port must be between 0 and 65535 * inclusive. If the IP address is 0.0.0.0, the socket will be bound to the * wildcard address, an IP address chosen by the kernel. * * @param port the local port to bind the new socket to * @param laddr the local address to bind the new socket to * @throws SocketException if the socket could not be opened, or the socket * could not bind to the specified local port * @see DatagramSocket#DatagramSocket(int, InetAddress) */ public DelegatingDatagramSocket(int port, InetAddress laddr) throws SocketException { this(null, new InetSocketAddress(laddr, port)); } /** * Creates a datagram socket, bound to the specified local socket address. * <p> * If, if the address is <tt>null</tt>, creates an unbound socket. * </p> * * @param bindaddr local socket address to bind, or <tt>null</tt> for an * unbound socket * @throws SocketException if the socket could not be opened, or the socket * could not bind to the specified local port */ public DelegatingDatagramSocket(SocketAddress bindaddr) throws SocketException { this(null, bindaddr); } /** * Initializes a new <tt>DelegatingDatagramSocket</tt> instance which * implements the <tt>DatagramSocket</tt> functionality. If delegate is not * null, then the DatagramSocket functionality is delegated to a specific * <tt>DatagramSocket</tt>. * * @param delegate the <tt>DatagramSocket</tt> to which the new instance is * to delegate. * @param address The local socket address to bind, or <tt>null</tt> for an * unbound socket. * * @throws SocketException if the socket could not be opened, or the socket * could not bind to the specified local port. */ public DelegatingDatagramSocket( DatagramSocket delegate, SocketAddress address) throws SocketException { super((SocketAddress) null); // Delegates the DatagramSocket functionality to the DatagramSocket // given in parameter. if (delegate != null) { this.delegate = delegate; } else { // Creates a custom DatagramSocket to replace classical "java" // DatagramSocket and set it as a delegate Socket if (delegateFactory != null) { this.delegate = delegateFactory.createUnboundDatagramSocket(); } // Creates a socket directly connected to the network stack. else { this.delegate = null; initReceiveBufferSize(); } // If not null, binds the delegate socket to the given address. // Otherwise bind the "super" socket to this address. bind(address); } } /** * Binds this <tt>DatagramSocket</tt> to a specific address and port. * <p> * If the address is <tt>null</tt>, then the system will pick up an * ephemeral port and a valid local address to bind the socket. *</p> * * @param addr the address and port to bind to * @throws SocketException if any error happens during the bind, or if the * socket is already bound * @throws SecurityException if a security manager exists and its * <tt>checkListen</tt> method doesn't allow the operation * @throws IllegalArgumentException if <tt>addr</tt> is a * <tt>SocketAddress</tt> subclass not supported by this socket * @see DatagramSocket#bind(SocketAddress) */ @Override public void bind(SocketAddress addr) throws SocketException { if (delegate == null) super.bind(addr); else delegate.bind(addr); } /** * Closes this datagram socket. * <p> * Any thread currently blocked in {@link #receive(DatagramPacket)} upon * this socket will throw a {@link SocketException}. * </p> * * @see DatagramSocket#close() */ @Override public void close() { // We want both #delegate and super to actually get closed (and release // the FDs which they hold). But super will not close unless isClosed() // returns false. So we update the #closed flag last. if (delegate != null) delegate.close(); super.close(); closed = true; } /** * Connects the socket to a remote address for this socket. When a socket is * connected to a remote address, packets may only be sent to or received * from that address. By default a datagram socket is not connected. * <p> * If the remote destination to which the socket is connected does not * exist, or is otherwise unreachable, and if an ICMP destination * unreachable packet has been received for that address, then a subsequent * call to {@link #send(DatagramPacket)} or {@link #receive(DatagramPacket)} * may throw a <tt>PortUnreachableException</tt>. Note, there is no * guarantee that the exception will be thrown. * </p> * * @param address the remote address for the socket * @param port the remote port for the socket * @throws IllegalArgumentException if the address is <tt>null</tt>, or the * port is out of range * @throws SecurityException if the caller is not allowed to send datagrams * to and receive datagrams from the address and port * @see DatagramSocket#connect(InetAddress, int) */ @Override public void connect(InetAddress address, int port) { if (delegate == null) super.connect(address, port); else delegate.connect(address, port); } /** * Connects this socket to a remote socket address. * * @param addr the remote address * @throws SocketException if the connect fails * @throws IllegalArgumentException if <tt>addr</tt> is <tt>null</tt> or a * <tt>SocketAddress</tt> subclass not supported by this socket * @see DatagramSocket#connect(SocketAddress) */ @Override public void connect(SocketAddress addr) throws SocketException { if (delegate == null) super.connect(addr); else delegate.connect(addr); } /** * Disconnects the socket. This does nothing if the socket is not connected. * * @see DatagramSocket#disconnect() */ @Override public void disconnect() { if (delegate == null) super.disconnect(); else delegate.disconnect(); } /** * Tests if <tt>SO_BROADCAST</tt> is enabled. * * @return a <tt>boolean</tt> indicating whether or not * <tt>SO_BROADCAST</tt> is enabled * @throws SocketException if there is an error in the underlying protocol, * such as an UDP error * @see DatagramSocket#getBroadcast() */ @Override public boolean getBroadcast() throws SocketException { return (delegate == null) ? super.getBroadcast() : delegate.getBroadcast(); } /** * Returns the unique {@link DatagramChannel} object associated with this * datagram socket, if any. * <p> * A datagram socket will have a channel if, and only if, the channel itself * was created via the {@link DatagramChannel#open()} method * </p> * * @return the datagram channel associated with this datagram socket, or * <tt>null</tt> if this socket was not created for a channel * @see DatagramSocket#getChannel() */ @Override public DatagramChannel getChannel() { return (delegate == null) ? super.getChannel() : delegate.getChannel(); } /** * Returns the address to which this socket is connected. Returns * <tt>null</tt> if the socket is not connected. * * @return the address to which this socket is connected * @see DatagramSocket#getInetAddress() */ @Override public InetAddress getInetAddress() { return (delegate == null) ? super.getInetAddress() : delegate.getInetAddress(); } /** * Gets the local address to which the socket is bound. * <p> * If there is a security manager, its <tt>checkConnect</tt> method is first * called with the host address and <tt>-1</tt> as its arguments to see if * the operation is allowed. * * @return the local address to which the socket is bound, or an * <tt>InetAddress</tt> representing any local address if either the socket * is not bound, or the security manager <tt>checkConnect</tt> method does * not allow the operation * @see DatagramSocket#getLocalAddress() */ @Override public InetAddress getLocalAddress() { return (delegate == null) ? super.getLocalAddress() : delegate.getLocalAddress(); } /** * Returns the port number on the local host to which this socket is bound. * * @return the port number on the local host to which this socket is bound * @see DatagramSocket#getLocalPort() */ @Override public int getLocalPort() { return (delegate == null) ? super.getLocalPort() : delegate.getLocalPort(); } /** * Returns the address of the endpoint this socket is bound to, or * <tt>null</tt> if it is not bound yet. * * @return a <tt>SocketAddress</tt> representing the local endpoint of this * socket, or <tt>null</tt> if it is not bound yet * @see DatagramSocket#getLocalSocketAddress() */ @Override public SocketAddress getLocalSocketAddress() { return (delegate == null) ? super.getLocalSocketAddress() : delegate.getLocalSocketAddress(); } /** * Returns the port for this socket. Returns <tt>-1</tt> if the socket is * not connected. * * @return the port to which this socket is connected * @see DatagramSocket#getPort() */ @Override public int getPort() { return (delegate == null) ? super.getPort() : delegate.getPort(); } /** * Gets the value of the <tt>SO_RCVBUF</tt> option for this * <tt>DatagramSocket</tt>, that is the buffer size used by the platform for * input on this <tt>DatagramSocket</tt>. * * @return the value of the <tt>SO_RCVBUF</tt> option for this * <tt>DatagramSocket</tt> * @throws SocketException if there is an error in the underlying protocol, * such as an UDP error * @see DatagramSocket#getReceiveBufferSize() */ @Override public int getReceiveBufferSize() throws SocketException { return (delegate == null) ? super.getReceiveBufferSize() : delegate.getReceiveBufferSize(); } /** * Returns the address of the endpoint this socket is connected to, or * <tt>null</tt> if it is unconnected. * * @return a <tt>SocketAddress</tt> representing the remote endpoint of this * socket, or <tt>null</tt> if it is not connected yet * @see DatagramSocket#getRemoteSocketAddress() */ @Override public SocketAddress getRemoteSocketAddress() { return (delegate == null) ? super.getRemoteSocketAddress() : delegate.getRemoteSocketAddress(); } /** * Tests if <tt>SO_REUSEADDR</tt> is enabled. * * @return a <tt>boolean</tt> indicating whether or not * <tt>SO_REUSEADDR</tt> is enabled * @throws SocketException if there is an error in the underlying protocol, * such as an UDP error * @see DatagramSocket#getReuseAddress() */ @Override public boolean getReuseAddress() throws SocketException { return (delegate == null) ? super.getReuseAddress() : delegate.getReuseAddress(); } /** * Gets the value of the <tt>SO_SNDBUF</tt> option for this * <tt>DatagramSocket</tt>, that is the buffer size used by the platform for * output on this <tt>DatagramSocket</tt>. * * @return the value of the <tt>SO_SNDBUF</tt> option for this * <tt>DatagramSocket</tt> * @throws SocketException if there is an error in the underlying protocol, * such as an UDP error * @see DatagramSocket#getSendBufferSize() */ @Override public int getSendBufferSize() throws SocketException { return (delegate == null) ? super.getSendBufferSize() : delegate.getSendBufferSize(); } /** * Retrieves setting for <tt>SO_TIMEOUT</tt>. Zero returned implies that * the option is disabled (i.e., timeout of infinity). * * @return the setting for <tt>SO_TIMEOUT</tt> * @throws SocketException if there is an error in the underlying protocol, * such as an UDP error * @see DatagramSocket#getSoTimeout() */ @Override public int getSoTimeout() throws SocketException { return (delegate == null) ? super.getSoTimeout() : delegate.getSoTimeout(); } /** * Gets the traffic class or type-of-service in the IP datagram header for * packets sent from this <tt>DatagramSocket</tt>. * <p> * As the underlying network implementation may ignore the traffic class or * type-of-service set using {@link #setTrafficClass(int)} this method may * return a different value than was previously set using the * {@link #setTrafficClass(int)} method on this <tt>DatagramSocket</tt>. * </p> * * @return the traffic class or type-of-service already set * @throws SocketException if there is an error obtaining the traffic class * or type-of-service value * @see DatagramSocket#getTrafficClass() */ @Override public int getTrafficClass() throws SocketException { return (delegate == null) ? super.getTrafficClass() : delegate.getTrafficClass(); } /** * Returns the binding state of the socket. * * @return <tt>true</tt> if the socket successfully bound to an address; * otherwise, <tt>false</tt> * @see DatagramSocket#isBound() */ @Override public boolean isBound() { return (delegate == null) ? super.isBound() : delegate.isBound(); } /** * Returns whether the socket is closed or not. * * @return <tt>true</tt> if the socket has been closed; otherwise, * <tt>false</tt> * @see DatagramSocket#isClosed() */ @Override public boolean isClosed() { return closed; } /** * Returns the connection state of the socket. * * @return <tt>true</tt> if the socket successfully connected to a server; * otherwise, <tt>false</tt> * @see DatagramSocket#isConnected() */ @Override public boolean isConnected() { return (delegate == null) ? super.isConnected() : delegate.isConnected(); } /** * Receives a datagram packet from this socket. When this method returns, * the <tt>DatagramPacket</tt>'s buffer is filled with the data received. * The datagram packet also contains the sender's IP address, and the port * number on the sender's machine. * <p> * This method blocks until a datagram is received. The <tt>length</tt> * field of the datagram packet object contains the length of the received * message. If the message is longer than the packet's length, the message * is truncated. * </p> * <p> * If there is a security manager, a packet cannot be received if the * security manager's <tt>checkAccept</tt> method does not allow it. * </p> * * @param p the <tt>DatagramPacket</tt> into which to place the incoming * data * @throws IOException if an I/O error occurs * @see DatagramSocket#receive(DatagramPacket) */ @Override public void receive(DatagramPacket p) throws IOException { if (delegate == null) { // If the packet length is too small, then the // DatagramSocket.receive function will truncate the received // datagram. This problem appears when reusing the same // DatagramPacket i.e. if the first time we use the DatagramPacket // to receive a small packet and the second time a bigger one, then // after the first packet is received, the length is set to the size // of the first packet and the second packet is truncated. // http://docs.oracle.com/javase/6/docs/api/java/net/DatagramSocket.html // // XXX(boris): I think the above is wrong. I don't interpret the // API description this way, and testing on a couple of different // environments shows that DatagramSocket.receive() grows the // packet's length to as much as much as the array (and offset) // would allow. I am leaving the code because it seems harmless. byte[] data = p.getData(); p.setLength((data == null) ? 0 : (data.length - p.getOffset())); super.receive(p); if (StunDatagramPacketFilter.isStunPacket(p) || logNonStun(++nbReceivedPackets)) { StunStack.logPacketToPcap( p, false, getLocalAddress(), getLocalPort()); } } else { delegate.receive(p); } } /** * Sends a datagram packet from this socket. The <tt>DatagramPacket</tt> * includes information indicating the data to be sent, its length, the IP * address of the remote host, and the port number on the remote host. * <p> * If there is a security manager, and the socket is not currently connected * to a remote address, this method first performs some security checks. * First, if <tt>p.getAddress().isMulticastAddress()</tt> is true, this * method calls the security manager's <tt>checkMulticast</tt> method with * <tt>p.getAddress()</tt> as its argument. If the evaluation of that * expression is <tt>false</tt>, this method instead calls the security * manager's <tt>checkConnect</tt> method with arguments * <tt>p.getAddress().getHostAddress()</tt> and <tt>p.getPort()</tt>. Each * call to a security manager method could result in a * <tt>SecurityException</tt> if the operation is not allowed. * </p> * * @param p the <tt>DatagramPacket</tt> to be sent * @throws IOException if an I/O error occurs * @see DatagramSocket#send(DatagramPacket) */ @Override public void send(DatagramPacket p) throws IOException { // Sends the packet to the final DatagramSocket if (delegate == null) { try { super.send(p); } // DIRTY, DIRTY, DIRTY!!! // Here we correct a java under MAC OSX bug when dealing with // ipv6 local interface: the destination address (as well as the // source address) under java / MAC OSX must have a scope ID, // i.e. "fe80::1%en1". This correction (the whole "catch") is to // be removed as soon as java under MAC OSX implements a real ipv6 // network stack. catch(Exception ex) { InetAddress tmpAddr = p.getAddress(); if (((ex instanceof NoRouteToHostException) || (ex.getMessage() != null && ex.getMessage().equals("No route to host"))) && (tmpAddr instanceof Inet6Address) && (tmpAddr.isLinkLocalAddress())) { Inet6Address newAddr = Inet6Address.getByAddress( "", tmpAddr.getAddress(), ((Inet6Address) super.getLocalAddress()) .getScopeId()); p.setAddress(newAddr); super.send(p); } else if (ex instanceof IOException) { throw((IOException)ex); } } if (logNonStun(++nbSentPackets)) { StunStack.logPacketToPcap( p, true, getLocalAddress(), getLocalPort()); } } // Else, the delegate socket will encapsulate the packet. else { delegate.send(p); } } /** * Enables/disables <tt>SO_BROADCAST</tt>. * * @param on whether or not to have broadcast turned on * @throws SocketException if there is an error in the underlying protocol, * such as an UDP error * @see DatagramSocket#setBroadcast(boolean) */ @Override public void setBroadcast(boolean on) throws SocketException { if (delegate == null) super.setBroadcast(on); else delegate.setBroadcast(on); } /** * Sets the <tt>SO_RCVBUF</tt> option to the specified value for this * <tt>DatagramSocket</tt>. The <tt>SO_RCVBUF</tt> option is used by the * network implementation as a hint to size the underlying network I/O * buffers. The <tt>SO_RCVBUF</tt> setting may also be used by the network * implementation to determine the maximum size of the packet that can be * received on this socket. * <p> * Because <tt>SO_RCVBUF</tt> is a hint, applications that want to verify * what size the buffers were set to should call * {@link #getReceiveBufferSize()}. * </p> * * @param size the size to which to set the receive buffer size. The value * must be greater than zero * @throws SocketException if there is an error in the underlying protocol, * such as an UDP error * @throws IllegalArgumentException if the value is zero or is negative * @see DatagramSocket#setReceiveBufferSize(int) */ @Override public void setReceiveBufferSize(int size) throws SocketException { if (delegate == null) super.setReceiveBufferSize(size); else delegate.setReceiveBufferSize(size); } /** * Enables/disables the <tt>SO_REUSEADDR</tt> socket option. * * @param on whether to enable or disable the <tt>SO_REUSEADDR</tt> socket * option * @throws SocketException if an error occurs enabling or disabling the * <tt>SO_RESUEADDR</tt> socket option, or the socket is closed * @see DatagramSocket#setReuseAddress(boolean) */ @Override public void setReuseAddress(boolean on) throws SocketException { if (delegate == null) super.setReuseAddress(on); else delegate.setReuseAddress(on); } /** * Sets the <tt>SO_SNDBUF</tt> option to the specified value for this * <tt>DatagramSocket</tt>. The <tt>SO_SNDBUF</tt> option is used by the * network implementation as a hint to size the underlying network I/O * buffers. The <tt>SO_SNDBUF</tt> setting may also be used by the network * implementation to determine the maximum size of the packet that can be * sent on this socket. * <p> * As <tt>SO_SNDBUF</tt> is a hint, applications that want to verify what * size the buffer is should call {@link #getSendBufferSize()}. * </p> * <p> * Increasing the buffer size may allow multiple outgoing packets to be * queued by the network implementation when the send rate is high. * </p> * * @param size the size to which to set the send buffer size. The value must * be greater than zero * @throws SocketException if there is an error in the underlying protocol, * such as an UDP error * @throws IllegalArgumentException if the value is zero or is negative * @see DatagramSocket#setSendBufferSize(int) */ @Override public void setSendBufferSize(int size) throws SocketException { if (delegate == null) super.setSendBufferSize(size); else delegate.setSendBufferSize(size); } /** * Enables/disables <tt>SO_TIMEOUT</tt> with the specified timeout, in * milliseconds. With this option set to a non-zero timeout, a call to * {@link #receive(DatagramPacket)} for this <tt>DatagramSocket</tt> will * block for only this amount of time. If the timeout expires, a * <tt>SocketTimeoutException</tt> is raised, though the * <tt>DatagramSocket</tt> is still valid. The option must be enabled prior * to entering the blocking operation to have effect. The timeout must be * greater than zero. A timeout of zero is interpreted as an infinite * timeout. * * @param timeout the specified timeout in milliseconds * @throws SocketException if there is an error in the underlying protocol, * such as an UDP error * @see DatagramSocket#setSoTimeout(int) */ @Override public void setSoTimeout(int timeout) throws SocketException { if (delegate == null) super.setSoTimeout(timeout); else delegate.setSoTimeout(timeout); } /** * Sets traffic class or type-of-service octet in the IP datagram header for * datagrams sent from this <tt>DatagramSocket</tt>. As the underlying * network implementation may ignore this value applications should consider * it a hint. * * @param tc an <tt>int</tt> value for the bitset * @throws SocketException if there is an error setting the traffic class or * type-of-service * @see DatagramSocket#setTrafficClass(int) */ @Override public void setTrafficClass(int tc) throws SocketException { if (delegate == null) super.setTrafficClass(tc); else delegate.setTrafficClass(tc); } /** * A utility method used by the constructors to ensure the receive buffer * size is set to the preferred default. * * This implementation only has an impact of there is no delegate, in other * words, if we really are using the superclass socket implementation as the * raw socket. * * @throws SocketException if there is an error in the underlying protocol, * such as an UDP error. */ private void initReceiveBufferSize() throws SocketException { // Only change the buffer size on the real underlying DatagramSocket. if (delegate == null && defaultReceiveBufferSize > 0) { super.setReceiveBufferSize(defaultReceiveBufferSize); } } }
{ "content_hash": "c7c03b7af37d327d66cad1fba2df7b37", "timestamp": "", "source": "github", "line_count": 933, "max_line_length": 84, "avg_line_length": 35.161843515541264, "alnum_prop": 0.6168688654514418, "repo_name": "jitsi/ice4j", "id": "9f5c70fc62e9c86f3a4096b84ccf50494dc3775a", "size": "33482", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/ice4j/socket/DelegatingDatagramSocket.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "2255500" }, { "name": "Kotlin", "bytes": "32582" } ], "symlink_target": "" }
.bigger{ font-size: 200%; } tr.deprecated { background-color: green; } .clear{clear:both;} .left{ float:left; } p.code { font-family: "Courier New" Courier monospace; background-color: gainsboro; width: 100%; padding: 1em; } .footer { background-color: #2C3E50; color: #bac1c8; font-size: 15px; padding: 0; } .center{ width : 100%; position: relative; } .center p{ margin: 0; position: absolute; top: 50%; left: 50%; margin-right: -50%; transform: translate(-50%, -50%) } .center img{ display: block; margin-left: auto; margin-right: auto } /*Draw svg lines for status updates */ line.status { stroke-width: 5; stroke-dasharray: 70px; stroke-dashoffset: 70px; animation-name: draw; animation-duration: 5s; animation-fill-mode: forwards; animation-iteration-count: 1; animation-timing-function: linear; } circle.status { stroke-width: 5; stroke-dasharray: 70px; stroke-dashoffset: 70px; animation-name: draw; animation-duration: 2s; animation-delay:1s; animation-fill-mode: forwards; animation-iteration-count: 1; animation-timing-function: linear; } line.success-true{ stroke: green; } line.success-false{ stroke:red; } circle.success-true{ stroke: green; fill-opacity:0; } circle.success-false{ stroke:red; fill-opacity:0; } @keyframes draw { to { stroke-dashoffset: 0; } } #statusUpdatesUl svg{ width:25px; height:61px; }
{ "content_hash": "522c772c174c6caf7027a72235411542", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 48, "avg_line_length": 15.66326530612245, "alnum_prop": 0.6306188925081433, "repo_name": "PhenoImageShare/PhenoImageShare", "id": "8c852f56b1de7792151efdf5da69fd6b41e9275d", "size": "1535", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "PhIS/WebContent/WEB-INF/resources/css/documentation.css", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1535" }, { "name": "HTML", "bytes": "11828" }, { "name": "Java", "bytes": "1682240" }, { "name": "JavaScript", "bytes": "1246143" }, { "name": "Python", "bytes": "31827" }, { "name": "Shell", "bytes": "295" } ], "symlink_target": "" }
import express from 'express'; import bodyParser from 'body-parser'; import { graphql } from 'graphql'; import schema from './schema'; const app = express(); let PORT = 3000; app.use(bodyParser.text({ type: 'application/graphql' })); app.post('/graphql', (req, res) => { console.log('graphql called', JSON.stringify(req.body)); graphql(schema, req.body) .then(result => res.send(result)); }); let server = app.listen(PORT, () => console.log('Server running... at localhost:%s', PORT) )
{ "content_hash": "692690ee870de19f127f805b8ac6bd6c", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 61, "avg_line_length": 24.85, "alnum_prop": 0.6740442655935613, "repo_name": "rgbycch/rgbycch-graphql", "id": "7fb2a73a7e7e2c84fbaaf7229e3d18d472274929", "size": "497", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "8905" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:gravity="center_vertical" android:padding="5dp"> <ImageView android:layout_width="50dp" android:layout_height="50dp" android:src="@drawable/assistant"/> <TextView android:id="@+id/tv_butler_left" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/chat_bg_cloud" android:gravity="center_vertical" android:text="ๅทฆ่พน" android:padding="20dp" android:textSize="18sp" android:textColor="@android:color/white"/> </LinearLayout>
{ "content_hash": "c72d2b27e241eefd9080924eef74ca41", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 62, "avg_line_length": 33.08, "alnum_prop": 0.6577992744860943, "repo_name": "chenyuh/SmartSetting", "id": "388e39c0c89aaee112b0c0485c78b7678104701f", "size": "831", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/butler_left_item.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "158644" } ], "symlink_target": "" }
use std; use ::math::aabbox::{ AABBox3, ExpandableToOther, }; use ::math::triangle::{ Triangle, }; use ::math::ray::Ray3; use ::math::vector::{ Vec3, Axis, }; use ::render::vertex::Vertex; pub struct KDNode { pub area: AABBox3, pub left: Option<Box<KDNode>>, pub right: Option<Box<KDNode>>, pub indices: Vec<usize>, } impl KDNode { pub fn new() -> KDNode { KDNode { area: AABBox3::new(), left: None, right: None, indices: Vec::new(), } } pub fn build(indices: &Vec<usize>, vertices: &Vec<Vertex>, triangles: &Vec<Triangle>) -> Option<Box<KDNode>> { let mut node = KDNode::new(); if indices.len() < 1 { return None; } if indices.len() < 2 { node.indices.push(indices[0]); node.area = triangles[indices[0]].get_aabb(vertices); return Some(Box::new(node)); } node.area = triangles[indices[0]].get_aabb(vertices); let mut midpt = Vec3::new(); let tris_recp = 1f64 / (indices.len() as f64); for index in indices { node.area.expand(&triangles[*index].get_aabb(vertices)); midpt += triangles[*index].get_midpoint(vertices) * tris_recp; } let mut left_indices = Vec::new(); let mut right_indices = Vec::new(); let axis = node.area.get_longest_axis(); // TODO for performance imporvement: put match block out of the for loop. for index in indices { match axis { Axis::X => if midpt.x >= triangles[*index].get_midpoint(vertices).x { right_indices.push(*index); } else { left_indices.push(*index); }, Axis::Y => if midpt.y >= triangles[*index].get_midpoint(vertices).y { right_indices.push(*index); } else { left_indices.push(*index); }, Axis::Z => if midpt.z >= triangles[*index].get_midpoint(vertices).z { right_indices.push(*index); } else { left_indices.push(*index); }, _ => panic!("Unexpected Axis value.") } } if left_indices.len() == 0 || right_indices.len() == 0 { node.indices = indices.clone(); // TODO for performance imporvement: I thinck these following three lines have redundant calculating, // I already calulated them, I ave doubt about it.. return Some(Box::new(node)); } node.left = KDNode::build(&left_indices, vertices, triangles); node.right = KDNode::build(&right_indices, vertices, triangles); Some(Box::new(node)) } pub fn hit(node: &KDNode, ray: &Ray3, tmin: f64, vertices: &Vec<Vertex>, triangles: &Vec<Triangle>) -> Option<(f64, f64, f64, usize)> { let (does_inter, dist) = node.area.intersection(ray); if !does_inter { return None; } if dist.gt(&tmin) { return None; } match node.left { Some(ref left_node_p) => { let l = KDNode::hit(&*left_node_p, ray, tmin, vertices, triangles); if l.is_some() { return l; } } None => {} } match node.right { Some(ref right_node_p) => { return KDNode::hit(&*right_node_p, ray, tmin, vertices, triangles); } None => {} } let mut hit_tri = false; let mut tri_ind: usize = 0; let mut t = tmin; let mut u = 0f64; let mut v = 0f64; for index in node.indices.iter() { match triangles[*index].intersect(ray, tmin, vertices) { Some((_t, _u, _v)) => { if t.lt(&_t) { hit_tri = true; tri_ind = *index; t = _t; u = _u; v = _v; } } None => {} } } if hit_tri { return Some((t, u, v, tri_ind)); } return None; } }
{ "content_hash": "97597ea34f0330baab21bb99b78d4779", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 152, "avg_line_length": 33.03174603174603, "alnum_prop": 0.4877462758289284, "repo_name": "Gearoenix/Dust", "id": "f3325018f62aba7224a8dc5aa65881b0897c5850", "size": "4162", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/math/kdtree.rs", "mode": "33188", "license": "mit", "language": [ { "name": "Rust", "bytes": "11862" } ], "symlink_target": "" }
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Settings</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <!-- build:css styles/app.css --> <link href="styles/bootstrap.min.css" rel="stylesheet"> <link href="styles/bootstrap-responsive.min.css" rel="stylesheet"> <link href="styles/font-awesome.min.css" rel="stylesheet"> <link href="styles/bootstrap-datetimepicker.min.css" rel="stylesheet"> <!-- endbuild --> <style> body { padding-top: 60px;} </style> <!-- build:css styles/settings.css --> <link rel="stylesheet" href="/styles/settings.css"> <!-- endbuild --> <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"> </script> <![endif]--> <link rel="shortcut icon" href="/favicon.ico"> </head> <body> <div class="navbar navbar-fixed-top navbar-inverse"> <div class="navbar-inner"> <div class="container-fluid"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <a class="brand" href="/">JEMS</a> <div class="nav-collapse collapse"> <ul class="nav"> <sec:authorize access="hasAnyRole('ROLE_ADMIN','ROLE_MANAGER')"> <li><a href="/dashboard"><i class="icon-bar-chart icon-white icon-large"></i> Dashboard</a></li> <li class="divider-vertical"></li> </sec:authorize> <li><a href="/calendar"><i class="icon-calendar icon-white icon-large"></i> Calendar</a></li> <li class="divider-vertical"></li> <sec:authorize access="hasAnyRole('ROLE_ADMIN','ROLE_MANAGER','ROLE_OPERATOR')"> <li><a href="/jemsevents?form"><i class="icon-file icon-white icon-large"></i> New Event</a></li> <li class="divider-vertical"></li> </sec:authorize> <li><a href="/jemsevents"><i class="icon-list icon-white icon-large"></i> List Events</a></li> <li class="divider-vertical"></li> <li><a href="/search"><i class="icon-search icon-white icon-large"></i> Search</a></li> <li class="divider-vertical"></li> <sec:authorize access="hasRole('ROLE_ADMIN')"> <li class="active"><a href="/settings"><i class="icon-cogs icon-white icon-large "></i> Settings</a></li> <li class="divider-vertical"></li> </sec:authorize> </ul> <div class="btn-group pull-right"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <i class="icon-user icon-large"></i> <sec:authentication property="principal.username" /> <span class="caret"></span> </a> <ul class="dropdown-menu"> <li><a href="/resources/j_spring_security_logout"><i class="icon-share icon-large"></i> Logout</a></li> </ul> </div> </div> </div> </div> </div> <div class="container"> <legend>Settings</legend> <div class="shortcuts"> <a href="/jemsusers" class="shortcut"> <i class="shortcut-icon icon-user"></i> <span class="shortcut-label">Users</span> </a> <a href="/jemscurrencys" class="shortcut"> <i class="shortcut-icon icon-money"></i> <span class="shortcut-label">Currencies</span> </a> <a href="/jemscountrys" class="shortcut"> <i class="shortcut-icon icon-globe"></i> <span class="shortcut-label">Countrys</span> </a> <a href="/jemsregions" class="shortcut"> <i class="shortcut-icon icon-map-marker"></i> <span class="shortcut-label">Regions</span> </a> <a href="/jemsorganizations" class="shortcut"> <i class="shortcut-icon icon-sitemap"></i> <span class="shortcut-label">Organizations</span> </a> <a href="/jemscostings" class="shortcut"> <i class="shortcut-icon icon-money"></i> <span class="shortcut-label">Costings</span> </a> <a href="/jemsorgtaxes" class="shortcut"> <i class="shortcut-icon icon-briefcase"></i> <span class="shortcut-label">Taxes</span> </a> <a href="/jemsstaffs" class="shortcut"> <i class="shortcut-icon icon-user"></i> <span class="shortcut-label">Staff</span> </a> <a href="/jemsclients" class="shortcut"> <i class="shortcut-icon icon-user"></i> <span class="shortcut-label">Clients</span> </a> <a href="/jemscsvdumps" class="shortcut"> <i class="shortcut-icon icon-table"></i> <span class="shortcut-label">CSV Dumps</span> </a> <!-- <a href="#" class="shortcut"> <i class="shortcut-icon icon-briefcase"></i> <span class="shortcut-label">Event Types</span> </a> <a href="#" class="shortcut"> <i class="shortcut-icon icon-briefcase"></i> <span class="shortcut-label">Event Statuses</span> </a> --> </div> </div> <!-- build:js scripts/app.js --> <script src="scripts/vendor/jquery.min.js"></script> <script src="scripts/vendor/bootstrap.min.js"></script> <script src="scripts/vendor/bootstrap-datetimepicker.min.js"></script> <script src="scripts/vendor/bootstrap-multiselect.js"></script> <!-- endbuild --> </body> </html>
{ "content_hash": "1c620cfc178f512306864efb0c7cbb45", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 131, "avg_line_length": 36.79761904761905, "alnum_prop": 0.5645422193464898, "repo_name": "josephgvariam/jems", "id": "49603b408aa41badbc6922a16dc25738d7892bdf", "size": "6182", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jems/src/main/webapp/WEB-INF/jems-views/app/settings.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "67001" }, { "name": "Java", "bytes": "510386" }, { "name": "JavaScript", "bytes": "39666" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/basicDemo/basicDemo.iml" filepath="$PROJECT_DIR$/basicDemo/basicDemo.iml" /> <module fileurl="file://$PROJECT_DIR$/beginningSpring/beginningSpring.iml" filepath="$PROJECT_DIR$/beginningSpring/beginningSpring.iml" /> <module fileurl="file://$PROJECT_DIR$/greeting/greeting.iml" filepath="$PROJECT_DIR$/greeting/greeting.iml" /> <module fileurl="file://$PROJECT_DIR$/helloSpring/helloSpring.iml" filepath="$PROJECT_DIR$/helloSpring/helloSpring.iml" /> </modules> </component> </project>
{ "content_hash": "32852193d8bf7659ab9739588557c4a5", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 144, "avg_line_length": 60.81818181818182, "alnum_prop": 0.7144992526158446, "repo_name": "liupeng3425/learnJavaEE", "id": "f1e790be4ea858f159b97d8b0d529177366f67dd", "size": "669", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": ".idea/modules.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "8775" }, { "name": "Java", "bytes": "16831" } ], "symlink_target": "" }
/** * Created by zhengHu on 16-10-8. * ๅ•ๆกไฟกๆฏๅฑ•็คบ็ป„ไปถ */ import React from 'react'; import SettlementZiTiForm from '../../components/settlement/SettlementZiTiForm'; import SettlementCardNoForm from '../../components/settlement/SettlementCardNoForm'; class ShadeForm extends React.Component { constructor(props) { super(props); this.state = {classNames: 'input-pops selected'}; } handleMove(evnet){ event.stopPropagation(); event.preventDefault(); return false; } render() { let datas=this.props.data,type=this.props.type,componentsArray=[]; console.log(type); switch (type){ case '1'://่‡ชไฝ“่”็ณปไบบ ๆ–ฐๅขžไฟฎๆ”น componentsArray.push( <SettlementZiTiForm data={datas} key="SettlementZiTiForm" saveAddressClick={this.props.saveAddressClick} close={this.props.closeOther}/> ) break; case '2'://่บซไปฝ่ฏ componentsArray.push( <SettlementCardNoForm data={datas} key="SettlementCardNoForm" saveAddressClick={this.props.saveAddressClick} close={this.props.closeOther}/> ); break; } return ( <div className={this.state.classNames} ref="input-pops" onTouchMove={this.handleMove}> {componentsArray} </div> ); } } ShadeForm.defaultProps = { }; export default ShadeForm;
{ "content_hash": "98dc89450d905e391bd3258f487cae20", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 154, "avg_line_length": 29.863636363636363, "alnum_prop": 0.6598173515981736, "repo_name": "HuZai/react_settlement", "id": "ce51a975791e1692d9bee82f8e06b7f841825d41", "size": "1354", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/components/settlement/ShadeForm.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "13615" }, { "name": "HTML", "bytes": "69614" }, { "name": "JavaScript", "bytes": "94410" } ], "symlink_target": "" }
package org.kuali.kra.award; import org.apache.commons.lang.StringUtils; import org.kuali.kra.award.document.AwardDocument; import org.kuali.kra.award.home.Award; import org.kuali.kra.award.home.ValidAwardBasisPayment; import org.kuali.kra.award.home.ValidBasisMethodPayment; import org.kuali.kra.infrastructure.Constants; import org.kuali.kra.infrastructure.KeyConstants; import org.kuali.kra.infrastructure.KraServiceLocator; import org.kuali.kra.service.AwardPaymentAndInvoicesService; import org.kuali.rice.kns.util.AuditCluster; import org.kuali.rice.kns.util.AuditError; import org.kuali.rice.kns.util.KNSGlobalVariables; import org.kuali.rice.krad.document.Document; import org.kuali.rice.krad.rules.rule.DocumentAuditRule; import java.util.ArrayList; import java.util.List; /** * This class... */ public class AwardPaymentAndInvoicesAuditRule implements DocumentAuditRule { private static final String DOT = "."; private static final String PAYMENTS_AND_INVOICES_AUDIT_ERRORS = "paymentAndInvoicesAuditErrors"; private static final String PAYMENT_METHOD = "Payment Method"; private static final String PAYMENT_BASIS = "Payment Basis"; private static final String BASIS_OF_PAYMENT_AUDIT_KEY = "awardBasisOfPaymentCode"; private static final String METHOD_OF_PAYMENT_AUDIT_KEY = "awardMethofOfPaymentCode"; private static final String PAYMENTS_INVOICES_URL=Constants.MAPPING_AWARD_PAYMENT_REPORTS_AND_TERMS_PAGE+"."+Constants.PAYMENT_AND_INVOICES_PANEL_ANCHOR; /** * @see org.kuali.rice.krad.rules.rule.DocumentAuditRule#processRunAuditBusinessRules(org.kuali.rice.krad.document.Document) */ public boolean processRunAuditBusinessRules(Document document) { boolean valid = true; AwardDocument awardDocument = (AwardDocument) document; List<AuditError> auditErrors = new ArrayList<AuditError>(); Award award = awardDocument.getAward(); if(award.getMethodOfPaymentCode() == null){ valid&=false; addErrorToAuditErrors(auditErrors, METHOD_OF_PAYMENT_AUDIT_KEY, PAYMENT_METHOD); } if(award.getBasisOfPaymentCode() == null) { valid&=false; addErrorToAuditErrors(auditErrors, BASIS_OF_PAYMENT_AUDIT_KEY, PAYMENT_BASIS); } valid &= checkAwardBasisOfPayment(awardDocument, auditErrors); valid &= checkAwardBasisAndMethodOfPayment( awardDocument, auditErrors ); reportAndCreateAuditCluster(auditErrors); return valid; } /** * This method creates and adds the Audit Error to the <code>{@link List<AuditError>}</code> auditError. * @param description */ protected void addErrorToAuditErrors(List<AuditError> auditErrors, String relAuditErrorKey, String description) { String[] params = new String[5]; params[0] = description; StringBuilder sb = new StringBuilder(); sb.append(Constants.MAPPING_AWARD_PAYMENT_REPORTS_AND_TERMS_PAGE); sb.append(DOT); sb.append(Constants.PAYMENT_AND_INVOICES_PANEL_ANCHOR); if( relAuditErrorKey != null ) { sb.append(DOT); sb.append( relAuditErrorKey ); } auditErrors.add(new AuditError(Constants.PAYMENT_AND_INVOICES_AUDIT_RULES_ERROR_KEY, KeyConstants.ERROR_REQUIRED, sb.toString(), params)); } /** * This method creates and adds the AuditCluster to the Global AuditErrorMap. */ @SuppressWarnings("unchecked") protected void reportAndCreateAuditCluster( List<AuditError> auditErrors ) { if (auditErrors.size() > 0) { KNSGlobalVariables.getAuditErrorMap().put(PAYMENTS_AND_INVOICES_AUDIT_ERRORS, new AuditCluster(Constants.PAYMENT_AND_INVOICES_PANEL_NAME, auditErrors, Constants.AUDIT_ERRORS)); } } protected boolean checkAwardBasisOfPayment( AwardDocument document, List<AuditError> errors ) { boolean valid = false; if( document.getAward().getAwardTypeCode() != null && document.getAward().getBasisOfPaymentCode()!=null) { List<ValidAwardBasisPayment> basisPayments = new ArrayList<ValidAwardBasisPayment>(getAwardPaymentAndInvoicesService().getValidAwardBasisPaymentsByAwardTypeCode(document.getAward().getAwardTypeCode())); for( ValidAwardBasisPayment basisPayment : basisPayments ) if( StringUtils.equals( basisPayment.getBasisOfPaymentCode(), document.getAward().getBasisOfPaymentCode() ) ) valid = true; document.getAward().refreshReferenceObject("awardType"); if( !valid ) //todo lookup basis of payment description to use instead of code. errors.add(new AuditError(Constants.PAYMENT_AND_INVOICES_AUDIT_RULES_ERROR_KEY, KeyConstants.ERROR_AWARD_INVALID_BASIS_OF_PAYMENT_FOR_AWARD_TYPE, PAYMENTS_INVOICES_URL, new String[] { document.getAward().getBasisOfPaymentCode(), document.getAward().getAwardType().getDescription()})); } else { valid = true; } return valid; } protected boolean checkAwardBasisAndMethodOfPayment( AwardDocument document, List<AuditError> errors ) { boolean valid = false; if( document.getAward().getAwardTypeCode() != null && document.getAward().getBasisOfPaymentCode()!=null) { List<ValidBasisMethodPayment> basisMethodPayments = new ArrayList<ValidBasisMethodPayment>(getAwardPaymentAndInvoicesService().getValidBasisMethodPaymentByBasisCode(document.getAward().getBasisOfPaymentCode())); for( ValidBasisMethodPayment basisMethodPayment : basisMethodPayments ) if( StringUtils.equals( basisMethodPayment.getMethodOfPaymentCode(), document.getAward().getMethodOfPaymentCode() ) ) valid = true; if( !valid ) //todo lookup basis of payment description to use instead of code. errors.add(new AuditError(Constants.PAYMENT_AND_INVOICES_AUDIT_RULES_ERROR_KEY, KeyConstants.ERROR_AWARD_INVALID_BASIS_AND_METHOD_OF_PAYMENT, PAYMENTS_INVOICES_URL, new String[] { })); } else { valid = true; } return valid; } protected AwardPaymentAndInvoicesService getAwardPaymentAndInvoicesService() { return KraServiceLocator.getService(AwardPaymentAndInvoicesService.class); } }
{ "content_hash": "5a5ba04280c70aeea68189fe9734c4c6", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 222, "avg_line_length": 47.25, "alnum_prop": 0.6675485008818343, "repo_name": "vivantech/kc_fixes", "id": "d83cf5b2333999a477639c5d40428f4e8a5598a4", "size": "7427", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/kuali/kra/award/AwardPaymentAndInvoicesAuditRule.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "595" }, { "name": "CSS", "bytes": "1277181" }, { "name": "HTML", "bytes": "21478104" }, { "name": "Java", "bytes": "25178010" }, { "name": "JavaScript", "bytes": "7250670" }, { "name": "PHP", "bytes": "15534" }, { "name": "PLSQL", "bytes": "374321" }, { "name": "Perl", "bytes": "1278" }, { "name": "Scheme", "bytes": "8283377" }, { "name": "Shell", "bytes": "1100" }, { "name": "XSLT", "bytes": "17866049" } ], "symlink_target": "" }
<resources> <string name="app_name">NetWorkTest</string> <string name="send_request">Send Request</string> </resources>
{ "content_hash": "9c692ad8140c3cfa741248ecc32d5445", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 53, "avg_line_length": 32, "alnum_prop": 0.703125, "repo_name": "songyang2088/A-week-to-develop-android-app-plan", "id": "57ae217049b1cfefe14d1ef6d51a5170a23a9024", "size": "128", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "001_FeatureGuide/networktest/src/main/res/values/strings.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "419178" } ], "symlink_target": "" }
from nose.tools import eq_ # package imports from openpyxl.shared.password_hasher import hash_password from openpyxl.worksheet import SheetProtection def test_hasher(): eq_('CBEB', hash_password('test')) def test_sheet_protection(): protection = SheetProtection() protection.password = 'test' eq_('CBEB', protection.password)
{ "content_hash": "d9045a70c7c02682707e6c2759aeaedd", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 57, "avg_line_length": 23.133333333333333, "alnum_prop": 0.7348703170028819, "repo_name": "chronossc/openpyxl", "id": "fd2fddf564085a8c2a98457fb2e20638cd06401a", "size": "1589", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "openpyxl/tests/test_password_hash.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "303430" }, { "name": "Shell", "bytes": "4269" } ], "symlink_target": "" }
#ifndef AVCODEC_AVCODEC_H #define AVCODEC_AVCODEC_H /** * @file * @ingroup libavc * Libavcodec external API header */ #include <errno.h> #include "libavutil/samplefmt.h" #include "libavutil/attributes.h" #include "libavutil/avutil.h" #include "libavutil/buffer.h" #include "libavutil/cpu.h" #include "libavutil/channel_layout.h" #include "libavutil/dict.h" #include "libavutil/frame.h" #include "libavutil/log.h" #include "libavutil/pixfmt.h" #include "libavutil/rational.h" #include "version.h" /** * @defgroup libavc Encoding/Decoding Library * @{ * * @defgroup lavc_decoding Decoding * @{ * @} * * @defgroup lavc_encoding Encoding * @{ * @} * * @defgroup lavc_codec Codecs * @{ * @defgroup lavc_codec_native Native Codecs * @{ * @} * @defgroup lavc_codec_wrappers External library wrappers * @{ * @} * @defgroup lavc_codec_hwaccel Hardware Accelerators bridge * @{ * @} * @} * @defgroup lavc_internal Internal * @{ * @} * @} * */ /** * @defgroup lavc_core Core functions/structures. * @ingroup libavc * * Basic definitions, functions for querying libavcodec capabilities, * allocating core structures, etc. * @{ */ /** * Identify the syntax and semantics of the bitstream. * The principle is roughly: * Two decoders with the same ID can decode the same streams. * Two encoders with the same ID can encode compatible streams. * There may be slight deviations from the principle due to implementation * details. * * If you add a codec ID to this list, add it so that * 1. no value of a existing codec ID changes (that would break ABI), * 2. it is as close as possible to similar codecs * * After adding new codec IDs, do not forget to add an entry to the codec * descriptor list and bump libavcodec minor version. */ enum AVCodecID { AV_CODEC_ID_NONE, /* video codecs */ AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding #if FF_API_XVMC AV_CODEC_ID_MPEG2VIDEO_XVMC, #endif /* FF_API_XVMC */ AV_CODEC_ID_H261, AV_CODEC_ID_H263, AV_CODEC_ID_RV10, AV_CODEC_ID_RV20, AV_CODEC_ID_MJPEG, AV_CODEC_ID_MJPEGB, AV_CODEC_ID_LJPEG, AV_CODEC_ID_SP5X, AV_CODEC_ID_JPEGLS, AV_CODEC_ID_MPEG4, AV_CODEC_ID_RAWVIDEO, AV_CODEC_ID_MSMPEG4V1, AV_CODEC_ID_MSMPEG4V2, AV_CODEC_ID_MSMPEG4V3, AV_CODEC_ID_WMV1, AV_CODEC_ID_WMV2, AV_CODEC_ID_H263P, AV_CODEC_ID_H263I, AV_CODEC_ID_FLV1, AV_CODEC_ID_SVQ1, AV_CODEC_ID_SVQ3, AV_CODEC_ID_DVVIDEO, AV_CODEC_ID_HUFFYUV, AV_CODEC_ID_CYUV, AV_CODEC_ID_H264, AV_CODEC_ID_INDEO3, AV_CODEC_ID_VP3, AV_CODEC_ID_THEORA, AV_CODEC_ID_ASV1, AV_CODEC_ID_ASV2, AV_CODEC_ID_FFV1, AV_CODEC_ID_4XM, AV_CODEC_ID_VCR1, AV_CODEC_ID_CLJR, AV_CODEC_ID_MDEC, AV_CODEC_ID_ROQ, AV_CODEC_ID_INTERPLAY_VIDEO, AV_CODEC_ID_XAN_WC3, AV_CODEC_ID_XAN_WC4, AV_CODEC_ID_RPZA, AV_CODEC_ID_CINEPAK, AV_CODEC_ID_WS_VQA, AV_CODEC_ID_MSRLE, AV_CODEC_ID_MSVIDEO1, AV_CODEC_ID_IDCIN, AV_CODEC_ID_8BPS, AV_CODEC_ID_SMC, AV_CODEC_ID_FLIC, AV_CODEC_ID_TRUEMOTION1, AV_CODEC_ID_VMDVIDEO, AV_CODEC_ID_MSZH, AV_CODEC_ID_ZLIB, AV_CODEC_ID_QTRLE, AV_CODEC_ID_TSCC, AV_CODEC_ID_ULTI, AV_CODEC_ID_QDRAW, AV_CODEC_ID_VIXL, AV_CODEC_ID_QPEG, AV_CODEC_ID_PNG, AV_CODEC_ID_PPM, AV_CODEC_ID_PBM, AV_CODEC_ID_PGM, AV_CODEC_ID_PGMYUV, AV_CODEC_ID_PAM, AV_CODEC_ID_FFVHUFF, AV_CODEC_ID_RV30, AV_CODEC_ID_RV40, AV_CODEC_ID_VC1, AV_CODEC_ID_WMV3, AV_CODEC_ID_LOCO, AV_CODEC_ID_WNV1, AV_CODEC_ID_AASC, AV_CODEC_ID_INDEO2, AV_CODEC_ID_FRAPS, AV_CODEC_ID_TRUEMOTION2, AV_CODEC_ID_BMP, AV_CODEC_ID_CSCD, AV_CODEC_ID_MMVIDEO, AV_CODEC_ID_ZMBV, AV_CODEC_ID_AVS, AV_CODEC_ID_SMACKVIDEO, AV_CODEC_ID_NUV, AV_CODEC_ID_KMVC, AV_CODEC_ID_FLASHSV, AV_CODEC_ID_CAVS, AV_CODEC_ID_JPEG2000, AV_CODEC_ID_VMNC, AV_CODEC_ID_VP5, AV_CODEC_ID_VP6, AV_CODEC_ID_VP6F, AV_CODEC_ID_TARGA, AV_CODEC_ID_DSICINVIDEO, AV_CODEC_ID_TIERTEXSEQVIDEO, AV_CODEC_ID_TIFF, AV_CODEC_ID_GIF, AV_CODEC_ID_DXA, AV_CODEC_ID_DNXHD, AV_CODEC_ID_THP, AV_CODEC_ID_SGI, AV_CODEC_ID_C93, AV_CODEC_ID_BETHSOFTVID, AV_CODEC_ID_PTX, AV_CODEC_ID_TXD, AV_CODEC_ID_VP6A, AV_CODEC_ID_AMV, AV_CODEC_ID_VB, AV_CODEC_ID_PCX, AV_CODEC_ID_SUNRAST, AV_CODEC_ID_INDEO4, AV_CODEC_ID_INDEO5, AV_CODEC_ID_MIMIC, AV_CODEC_ID_RL2, AV_CODEC_ID_ESCAPE124, AV_CODEC_ID_DIRAC, AV_CODEC_ID_BFI, AV_CODEC_ID_CMV, AV_CODEC_ID_MOTIONPIXELS, AV_CODEC_ID_TGV, AV_CODEC_ID_TGQ, AV_CODEC_ID_TQI, AV_CODEC_ID_AURA, AV_CODEC_ID_AURA2, AV_CODEC_ID_V210X, AV_CODEC_ID_TMV, AV_CODEC_ID_V210, AV_CODEC_ID_DPX, AV_CODEC_ID_MAD, AV_CODEC_ID_FRWU, AV_CODEC_ID_FLASHSV2, AV_CODEC_ID_CDGRAPHICS, AV_CODEC_ID_R210, AV_CODEC_ID_ANM, AV_CODEC_ID_BINKVIDEO, AV_CODEC_ID_IFF_ILBM, #define AV_CODEC_ID_IFF_BYTERUN1 AV_CODEC_ID_IFF_ILBM AV_CODEC_ID_KGV1, AV_CODEC_ID_YOP, AV_CODEC_ID_VP8, AV_CODEC_ID_PICTOR, AV_CODEC_ID_ANSI, AV_CODEC_ID_A64_MULTI, AV_CODEC_ID_A64_MULTI5, AV_CODEC_ID_R10K, AV_CODEC_ID_MXPEG, AV_CODEC_ID_LAGARITH, AV_CODEC_ID_PRORES, AV_CODEC_ID_JV, AV_CODEC_ID_DFA, AV_CODEC_ID_WMV3IMAGE, AV_CODEC_ID_VC1IMAGE, AV_CODEC_ID_UTVIDEO, AV_CODEC_ID_BMV_VIDEO, AV_CODEC_ID_VBLE, AV_CODEC_ID_DXTORY, AV_CODEC_ID_V410, AV_CODEC_ID_XWD, AV_CODEC_ID_CDXL, AV_CODEC_ID_XBM, AV_CODEC_ID_ZEROCODEC, AV_CODEC_ID_MSS1, AV_CODEC_ID_MSA1, AV_CODEC_ID_TSCC2, AV_CODEC_ID_MTS2, AV_CODEC_ID_CLLC, AV_CODEC_ID_MSS2, AV_CODEC_ID_VP9, AV_CODEC_ID_AIC, AV_CODEC_ID_ESCAPE130, AV_CODEC_ID_G2M, AV_CODEC_ID_WEBP, AV_CODEC_ID_HNM4_VIDEO, AV_CODEC_ID_HEVC, #define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC AV_CODEC_ID_FIC, AV_CODEC_ID_ALIAS_PIX, AV_CODEC_ID_BRENDER_PIX, AV_CODEC_ID_PAF_VIDEO, AV_CODEC_ID_EXR, AV_CODEC_ID_VP7, AV_CODEC_ID_SANM, AV_CODEC_ID_SGIRLE, AV_CODEC_ID_MVC1, AV_CODEC_ID_MVC2, AV_CODEC_ID_HQX, AV_CODEC_ID_TDSC, AV_CODEC_ID_HQ_HQA, AV_CODEC_ID_HAP, AV_CODEC_ID_DDS, AV_CODEC_ID_DXV, AV_CODEC_ID_SCREENPRESSO, AV_CODEC_ID_RSCC, AV_CODEC_ID_Y41P = 0x8000, AV_CODEC_ID_AVRP, AV_CODEC_ID_012V, AV_CODEC_ID_AVUI, AV_CODEC_ID_AYUV, AV_CODEC_ID_TARGA_Y216, AV_CODEC_ID_V308, AV_CODEC_ID_V408, AV_CODEC_ID_YUV4, AV_CODEC_ID_AVRN, AV_CODEC_ID_CPIA, AV_CODEC_ID_XFACE, AV_CODEC_ID_SNOW, AV_CODEC_ID_SMVJPEG, AV_CODEC_ID_APNG, AV_CODEC_ID_DAALA, AV_CODEC_ID_CFHD, /* various PCM "codecs" */ AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs AV_CODEC_ID_PCM_S16LE = 0x10000, AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_U16LE, AV_CODEC_ID_PCM_U16BE, AV_CODEC_ID_PCM_S8, AV_CODEC_ID_PCM_U8, AV_CODEC_ID_PCM_MULAW, AV_CODEC_ID_PCM_ALAW, AV_CODEC_ID_PCM_S32LE, AV_CODEC_ID_PCM_S32BE, AV_CODEC_ID_PCM_U32LE, AV_CODEC_ID_PCM_U32BE, AV_CODEC_ID_PCM_S24LE, AV_CODEC_ID_PCM_S24BE, AV_CODEC_ID_PCM_U24LE, AV_CODEC_ID_PCM_U24BE, AV_CODEC_ID_PCM_S24DAUD, AV_CODEC_ID_PCM_ZORK, AV_CODEC_ID_PCM_S16LE_PLANAR, AV_CODEC_ID_PCM_DVD, AV_CODEC_ID_PCM_F32BE, AV_CODEC_ID_PCM_F32LE, AV_CODEC_ID_PCM_F64BE, AV_CODEC_ID_PCM_F64LE, AV_CODEC_ID_PCM_BLURAY, AV_CODEC_ID_PCM_LXF, AV_CODEC_ID_S302M, AV_CODEC_ID_PCM_S8_PLANAR, AV_CODEC_ID_PCM_S24LE_PLANAR, AV_CODEC_ID_PCM_S32LE_PLANAR, AV_CODEC_ID_PCM_S16BE_PLANAR, /* new PCM "codecs" should be added right below this line starting with * an explicit value of for example 0x10800 */ /* various ADPCM codecs */ AV_CODEC_ID_ADPCM_IMA_QT = 0x11000, AV_CODEC_ID_ADPCM_IMA_WAV, AV_CODEC_ID_ADPCM_IMA_DK3, AV_CODEC_ID_ADPCM_IMA_DK4, AV_CODEC_ID_ADPCM_IMA_WS, AV_CODEC_ID_ADPCM_IMA_SMJPEG, AV_CODEC_ID_ADPCM_MS, AV_CODEC_ID_ADPCM_4XM, AV_CODEC_ID_ADPCM_XA, AV_CODEC_ID_ADPCM_ADX, AV_CODEC_ID_ADPCM_EA, AV_CODEC_ID_ADPCM_G726, AV_CODEC_ID_ADPCM_CT, AV_CODEC_ID_ADPCM_SWF, AV_CODEC_ID_ADPCM_YAMAHA, AV_CODEC_ID_ADPCM_SBPRO_4, AV_CODEC_ID_ADPCM_SBPRO_3, AV_CODEC_ID_ADPCM_SBPRO_2, AV_CODEC_ID_ADPCM_THP, AV_CODEC_ID_ADPCM_IMA_AMV, AV_CODEC_ID_ADPCM_EA_R1, AV_CODEC_ID_ADPCM_EA_R3, AV_CODEC_ID_ADPCM_EA_R2, AV_CODEC_ID_ADPCM_IMA_EA_SEAD, AV_CODEC_ID_ADPCM_IMA_EA_EACS, AV_CODEC_ID_ADPCM_EA_XAS, AV_CODEC_ID_ADPCM_EA_MAXIS_XA, AV_CODEC_ID_ADPCM_IMA_ISS, AV_CODEC_ID_ADPCM_G722, AV_CODEC_ID_ADPCM_IMA_APC, AV_CODEC_ID_ADPCM_VIMA, #if FF_API_VIMA_DECODER AV_CODEC_ID_VIMA = AV_CODEC_ID_ADPCM_VIMA, #endif AV_CODEC_ID_ADPCM_AFC = 0x11800, AV_CODEC_ID_ADPCM_IMA_OKI, AV_CODEC_ID_ADPCM_DTK, AV_CODEC_ID_ADPCM_IMA_RAD, AV_CODEC_ID_ADPCM_G726LE, AV_CODEC_ID_ADPCM_THP_LE, AV_CODEC_ID_ADPCM_PSX, AV_CODEC_ID_ADPCM_AICA, /* AMR */ AV_CODEC_ID_AMR_NB = 0x12000, AV_CODEC_ID_AMR_WB, /* RealAudio codecs*/ AV_CODEC_ID_RA_144 = 0x13000, AV_CODEC_ID_RA_288, /* various DPCM codecs */ AV_CODEC_ID_ROQ_DPCM = 0x14000, AV_CODEC_ID_INTERPLAY_DPCM, AV_CODEC_ID_XAN_DPCM, AV_CODEC_ID_SOL_DPCM, AV_CODEC_ID_SDX2_DPCM = 0x14800, /* audio codecs */ AV_CODEC_ID_MP2 = 0x15000, AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 AV_CODEC_ID_AAC, AV_CODEC_ID_AC3, AV_CODEC_ID_DTS, AV_CODEC_ID_VORBIS, AV_CODEC_ID_DVAUDIO, AV_CODEC_ID_WMAV1, AV_CODEC_ID_WMAV2, AV_CODEC_ID_MACE3, AV_CODEC_ID_MACE6, AV_CODEC_ID_VMDAUDIO, AV_CODEC_ID_FLAC, AV_CODEC_ID_MP3ADU, AV_CODEC_ID_MP3ON4, AV_CODEC_ID_SHORTEN, AV_CODEC_ID_ALAC, AV_CODEC_ID_WESTWOOD_SND1, AV_CODEC_ID_GSM, ///< as in Berlin toast format AV_CODEC_ID_QDM2, AV_CODEC_ID_COOK, AV_CODEC_ID_TRUESPEECH, AV_CODEC_ID_TTA, AV_CODEC_ID_SMACKAUDIO, AV_CODEC_ID_QCELP, AV_CODEC_ID_WAVPACK, AV_CODEC_ID_DSICINAUDIO, AV_CODEC_ID_IMC, AV_CODEC_ID_MUSEPACK7, AV_CODEC_ID_MLP, AV_CODEC_ID_GSM_MS, /* as found in WAV */ AV_CODEC_ID_ATRAC3, #if FF_API_VOXWARE AV_CODEC_ID_VOXWARE, #endif AV_CODEC_ID_APE, AV_CODEC_ID_NELLYMOSER, AV_CODEC_ID_MUSEPACK8, AV_CODEC_ID_SPEEX, AV_CODEC_ID_WMAVOICE, AV_CODEC_ID_WMAPRO, AV_CODEC_ID_WMALOSSLESS, AV_CODEC_ID_ATRAC3P, AV_CODEC_ID_EAC3, AV_CODEC_ID_SIPR, AV_CODEC_ID_MP1, AV_CODEC_ID_TWINVQ, AV_CODEC_ID_TRUEHD, AV_CODEC_ID_MP4ALS, AV_CODEC_ID_ATRAC1, AV_CODEC_ID_BINKAUDIO_RDFT, AV_CODEC_ID_BINKAUDIO_DCT, AV_CODEC_ID_AAC_LATM, AV_CODEC_ID_QDMC, AV_CODEC_ID_CELT, AV_CODEC_ID_G723_1, AV_CODEC_ID_G729, AV_CODEC_ID_8SVX_EXP, AV_CODEC_ID_8SVX_FIB, AV_CODEC_ID_BMV_AUDIO, AV_CODEC_ID_RALF, AV_CODEC_ID_IAC, AV_CODEC_ID_ILBC, AV_CODEC_ID_OPUS, AV_CODEC_ID_COMFORT_NOISE, AV_CODEC_ID_TAK, AV_CODEC_ID_METASOUND, AV_CODEC_ID_PAF_AUDIO, AV_CODEC_ID_ON2AVC, AV_CODEC_ID_DSS_SP, AV_CODEC_ID_FFWAVESYNTH = 0x15800, AV_CODEC_ID_SONIC, AV_CODEC_ID_SONIC_LS, AV_CODEC_ID_EVRC, AV_CODEC_ID_SMV, AV_CODEC_ID_DSD_LSBF, AV_CODEC_ID_DSD_MSBF, AV_CODEC_ID_DSD_LSBF_PLANAR, AV_CODEC_ID_DSD_MSBF_PLANAR, AV_CODEC_ID_4GV, AV_CODEC_ID_INTERPLAY_ACM, AV_CODEC_ID_XMA1, AV_CODEC_ID_XMA2, /* subtitle codecs */ AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. AV_CODEC_ID_DVD_SUBTITLE = 0x17000, AV_CODEC_ID_DVB_SUBTITLE, AV_CODEC_ID_TEXT, ///< raw UTF-8 text AV_CODEC_ID_XSUB, AV_CODEC_ID_SSA, AV_CODEC_ID_MOV_TEXT, AV_CODEC_ID_HDMV_PGS_SUBTITLE, AV_CODEC_ID_DVB_TELETEXT, AV_CODEC_ID_SRT, AV_CODEC_ID_MICRODVD = 0x17800, AV_CODEC_ID_EIA_608, AV_CODEC_ID_JACOSUB, AV_CODEC_ID_SAMI, AV_CODEC_ID_REALTEXT, AV_CODEC_ID_STL, AV_CODEC_ID_SUBVIEWER1, AV_CODEC_ID_SUBVIEWER, AV_CODEC_ID_SUBRIP, AV_CODEC_ID_WEBVTT, AV_CODEC_ID_MPL2, AV_CODEC_ID_VPLAYER, AV_CODEC_ID_PJS, AV_CODEC_ID_ASS, AV_CODEC_ID_HDMV_TEXT_SUBTITLE, /* other specific kind of codecs (generally used for attachments) */ AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. AV_CODEC_ID_TTF = 0x18000, AV_CODEC_ID_BINTEXT = 0x18800, AV_CODEC_ID_XBIN, AV_CODEC_ID_IDF, AV_CODEC_ID_OTF, AV_CODEC_ID_SMPTE_KLV, AV_CODEC_ID_DVD_NAV, AV_CODEC_ID_TIMED_ID3, AV_CODEC_ID_BIN_DATA, AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS * stream (only used by libavformat) */ AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems * stream (only used by libavformat) */ AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. AV_CODEC_ID_WRAPPED_AVFRAME = 0x21001, ///< Passthrough codec, AVFrames wrapped in AVPacket }; /** * This struct describes the properties of a single codec described by an * AVCodecID. * @see avcodec_descriptor_get() */ typedef struct AVCodecDescriptor { enum AVCodecID id; enum AVMediaType type; /** * Name of the codec described by this descriptor. It is non-empty and * unique for each codec descriptor. It should contain alphanumeric * characters and '_' only. */ const char *name; /** * A more descriptive name for this codec. May be NULL. */ const char *long_name; /** * Codec properties, a combination of AV_CODEC_PROP_* flags. */ int props; /** * MIME type(s) associated with the codec. * May be NULL; if not, a NULL-terminated array of MIME types. * The first item is always non-NULL and is the preferred MIME type. */ const char *const *mime_types; /** * If non-NULL, an array of profiles recognized for this codec. * Terminated with FF_PROFILE_UNKNOWN. */ const struct AVProfile *profiles; } AVCodecDescriptor; /** * Codec uses only intra compression. * Video codecs only. */ #define AV_CODEC_PROP_INTRA_ONLY (1 << 0) /** * Codec supports lossy compression. Audio and video codecs only. * @note a codec may support both lossy and lossless * compression modes */ #define AV_CODEC_PROP_LOSSY (1 << 1) /** * Codec supports lossless compression. Audio and video codecs only. */ #define AV_CODEC_PROP_LOSSLESS (1 << 2) /** * Codec supports frame reordering. That is, the coded order (the order in which * the encoded packets are output by the encoders / stored / input to the * decoders) may be different from the presentation order of the corresponding * frames. * * For codecs that do not have this property set, PTS and DTS should always be * equal. */ #define AV_CODEC_PROP_REORDER (1 << 3) /** * Subtitle codec is bitmap based * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. */ #define AV_CODEC_PROP_BITMAP_SUB (1 << 16) /** * Subtitle codec is text based. * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. */ #define AV_CODEC_PROP_TEXT_SUB (1 << 17) /** * @ingroup lavc_decoding * Required number of additionally allocated bytes at the end of the input bitstream for decoding. * This is mainly needed because some optimized bitstream readers read * 32 or 64 bit at once and could read over the end.<br> * Note: If the first 23 bits of the additional bytes are not 0, then damaged * MPEG bitstreams could cause overread and segfault. */ #define AV_INPUT_BUFFER_PADDING_SIZE 32 /** * @ingroup lavc_encoding * minimum encoding buffer size * Used to avoid some checks during header writing. */ #define AV_INPUT_BUFFER_MIN_SIZE 16384 #if FF_API_WITHOUT_PREFIX /** * @deprecated use AV_INPUT_BUFFER_PADDING_SIZE instead */ #define FF_INPUT_BUFFER_PADDING_SIZE 32 /** * @deprecated use AV_INPUT_BUFFER_MIN_SIZE instead */ #define FF_MIN_BUFFER_SIZE 16384 #endif /* FF_API_WITHOUT_PREFIX */ /** * @ingroup lavc_encoding * motion estimation type. * @deprecated use codec private option instead */ #if FF_API_MOTION_EST enum Motion_Est_ID { ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed ME_FULL, ME_LOG, ME_PHODS, ME_EPZS, ///< enhanced predictive zonal search ME_X1, ///< reserved for experiments ME_HEX, ///< hexagon based search ME_UMH, ///< uneven multi-hexagon search ME_TESA, ///< transformed exhaustive search algorithm ME_ITER=50, ///< iterative search }; #endif /** * @ingroup lavc_decoding */ enum AVDiscard{ /* We leave some space between them for extensions (drop some * keyframes for intra-only or drop just some bidir frames). */ AVDISCARD_NONE =-16, ///< discard nothing AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi AVDISCARD_NONREF = 8, ///< discard all non reference AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames AVDISCARD_NONINTRA= 24, ///< discard all non intra frames AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes AVDISCARD_ALL = 48, ///< discard all }; enum AVAudioServiceType { AV_AUDIO_SERVICE_TYPE_MAIN = 0, AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, AV_AUDIO_SERVICE_TYPE_NB , ///< Not part of ABI }; /** * @ingroup lavc_encoding */ typedef struct RcOverride{ int start_frame; int end_frame; int qscale; // If this is 0 then quality_factor will be used instead. float quality_factor; } RcOverride; #if FF_API_MAX_BFRAMES /** * @deprecated there is no libavcodec-wide limit on the number of B-frames */ #define FF_MAX_B_FRAMES 16 #endif /* encoding support These flags can be passed in AVCodecContext.flags before initialization. Note: Not everything is supported yet. */ /** * Allow decoders to produce frames with data planes that are not aligned * to CPU requirements (e.g. due to cropping). */ #define AV_CODEC_FLAG_UNALIGNED (1 << 0) /** * Use fixed qscale. */ #define AV_CODEC_FLAG_QSCALE (1 << 1) /** * 4 MV per MB allowed / advanced prediction for H.263. */ #define AV_CODEC_FLAG_4MV (1 << 2) /** * Output even those frames that might be corrupted. */ #define AV_CODEC_FLAG_OUTPUT_CORRUPT (1 << 3) /** * Use qpel MC. */ #define AV_CODEC_FLAG_QPEL (1 << 4) /** * Use internal 2pass ratecontrol in first pass mode. */ #define AV_CODEC_FLAG_PASS1 (1 << 9) /** * Use internal 2pass ratecontrol in second pass mode. */ #define AV_CODEC_FLAG_PASS2 (1 << 10) /** * loop filter. */ #define AV_CODEC_FLAG_LOOP_FILTER (1 << 11) /** * Only decode/encode grayscale. */ #define AV_CODEC_FLAG_GRAY (1 << 13) /** * error[?] variables will be set during encoding. */ #define AV_CODEC_FLAG_PSNR (1 << 15) /** * Input bitstream might be truncated at a random location * instead of only at frame boundaries. */ #define AV_CODEC_FLAG_TRUNCATED (1 << 16) /** * Use interlaced DCT. */ #define AV_CODEC_FLAG_INTERLACED_DCT (1 << 18) /** * Force low delay. */ #define AV_CODEC_FLAG_LOW_DELAY (1 << 19) /** * Place global headers in extradata instead of every keyframe. */ #define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22) /** * Use only bitexact stuff (except (I)DCT). */ #define AV_CODEC_FLAG_BITEXACT (1 << 23) /* Fx : Flag for h263+ extra options */ /** * H.263 advanced intra coding / MPEG-4 AC prediction */ #define AV_CODEC_FLAG_AC_PRED (1 << 24) /** * interlaced motion estimation */ #define AV_CODEC_FLAG_INTERLACED_ME (1 << 29) #define AV_CODEC_FLAG_CLOSED_GOP (1U << 31) /** * Allow non spec compliant speedup tricks. */ #define AV_CODEC_FLAG2_FAST (1 << 0) /** * Skip bitstream encoding. */ #define AV_CODEC_FLAG2_NO_OUTPUT (1 << 2) /** * Place global headers at every keyframe instead of in extradata. */ #define AV_CODEC_FLAG2_LOCAL_HEADER (1 << 3) /** * timecode is in drop frame format. DEPRECATED!!!! */ #define AV_CODEC_FLAG2_DROP_FRAME_TIMECODE (1 << 13) /** * Input bitstream might be truncated at a packet boundaries * instead of only at frame boundaries. */ #define AV_CODEC_FLAG2_CHUNKS (1 << 15) /** * Discard cropping information from SPS. */ #define AV_CODEC_FLAG2_IGNORE_CROP (1 << 16) /** * Show all frames before the first keyframe */ #define AV_CODEC_FLAG2_SHOW_ALL (1 << 22) /** * Export motion vectors through frame side data */ #define AV_CODEC_FLAG2_EXPORT_MVS (1 << 28) /** * Do not skip samples and export skip information as frame side data */ #define AV_CODEC_FLAG2_SKIP_MANUAL (1 << 29) /* Unsupported options : * Syntax Arithmetic coding (SAC) * Reference Picture Selection * Independent Segment Decoding */ /* /Fx */ /* codec capabilities */ /** * Decoder can use draw_horiz_band callback. */ #define AV_CODEC_CAP_DRAW_HORIZ_BAND (1 << 0) /** * Codec uses get_buffer() for allocating buffers and supports custom allocators. * If not set, it might not use get_buffer() at all or use operations that * assume the buffer was allocated by avcodec_default_get_buffer. */ #define AV_CODEC_CAP_DR1 (1 << 1) #define AV_CODEC_CAP_TRUNCATED (1 << 3) /** * Encoder or decoder requires flushing with NULL input at the end in order to * give the complete and correct output. * * NOTE: If this flag is not set, the codec is guaranteed to never be fed with * with NULL data. The user can still send NULL data to the public encode * or decode function, but libavcodec will not pass it along to the codec * unless this flag is set. * * Decoders: * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, * avpkt->size=0 at the end to get the delayed data until the decoder no longer * returns frames. * * Encoders: * The encoder needs to be fed with NULL data at the end of encoding until the * encoder no longer returns data. * * NOTE: For encoders implementing the AVCodec.encode2() function, setting this * flag also means that the encoder must set the pts and duration for * each output packet. If this flag is not set, the pts and duration will * be determined by libavcodec from the input frame. */ #define AV_CODEC_CAP_DELAY (1 << 5) /** * Codec can be fed a final frame with a smaller size. * This can be used to prevent truncation of the last audio samples. */ #define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6) #if FF_API_CAP_VDPAU /** * Codec can export data for HW decoding (VDPAU). */ #define AV_CODEC_CAP_HWACCEL_VDPAU (1 << 7) #endif /** * Codec can output multiple frames per AVPacket * Normally demuxers return one frame at a time, demuxers which do not do * are connected to a parser to split what they return into proper frames. * This flag is reserved to the very rare category of codecs which have a * bitstream that cannot be split into frames without timeconsuming * operations like full decoding. Demuxers carring such bitstreams thus * may return multiple frames in a packet. This has many disadvantages like * prohibiting stream copy in many cases thus it should only be considered * as a last resort. */ #define AV_CODEC_CAP_SUBFRAMES (1 << 8) /** * Codec is experimental and is thus avoided in favor of non experimental * encoders */ #define AV_CODEC_CAP_EXPERIMENTAL (1 << 9) /** * Codec should fill in channel configuration and samplerate instead of container */ #define AV_CODEC_CAP_CHANNEL_CONF (1 << 10) /** * Codec supports frame-level multithreading. */ #define AV_CODEC_CAP_FRAME_THREADS (1 << 12) /** * Codec supports slice-based (or partition-based) multithreading. */ #define AV_CODEC_CAP_SLICE_THREADS (1 << 13) /** * Codec supports changed parameters at any point. */ #define AV_CODEC_CAP_PARAM_CHANGE (1 << 14) /** * Codec supports avctx->thread_count == 0 (auto). */ #define AV_CODEC_CAP_AUTO_THREADS (1 << 15) /** * Audio encoder supports receiving a different number of samples in each call. */ #define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16) /** * Codec is intra only. */ #define AV_CODEC_CAP_INTRA_ONLY 0x40000000 /** * Codec is lossless. */ #define AV_CODEC_CAP_LOSSLESS 0x80000000 #if FF_API_WITHOUT_PREFIX /** * Allow decoders to produce frames with data planes that are not aligned * to CPU requirements (e.g. due to cropping). */ #define CODEC_FLAG_UNALIGNED AV_CODEC_FLAG_UNALIGNED #define CODEC_FLAG_QSCALE AV_CODEC_FLAG_QSCALE #define CODEC_FLAG_4MV AV_CODEC_FLAG_4MV #define CODEC_FLAG_OUTPUT_CORRUPT AV_CODEC_FLAG_OUTPUT_CORRUPT #define CODEC_FLAG_QPEL AV_CODEC_FLAG_QPEL #if FF_API_GMC /** * @deprecated use the "gmc" private option of the libxvid encoder */ #define CODEC_FLAG_GMC 0x0020 ///< Use GMC. #endif #if FF_API_MV0 /** * @deprecated use the flag "mv0" in the "mpv_flags" private option of the * mpegvideo encoders */ #define CODEC_FLAG_MV0 0x0040 #endif #if FF_API_INPUT_PRESERVED /** * @deprecated passing reference-counted frames to the encoders replaces this * flag */ #define CODEC_FLAG_INPUT_PRESERVED 0x0100 #endif #define CODEC_FLAG_PASS1 AV_CODEC_FLAG_PASS1 #define CODEC_FLAG_PASS2 AV_CODEC_FLAG_PASS2 #define CODEC_FLAG_GRAY AV_CODEC_FLAG_GRAY #if FF_API_EMU_EDGE /** * @deprecated edges are not used/required anymore. I.e. this flag is now always * set. */ #define CODEC_FLAG_EMU_EDGE 0x4000 #endif #define CODEC_FLAG_PSNR AV_CODEC_FLAG_PSNR #define CODEC_FLAG_TRUNCATED AV_CODEC_FLAG_TRUNCATED #if FF_API_NORMALIZE_AQP /** * @deprecated use the flag "naq" in the "mpv_flags" private option of the * mpegvideo encoders */ #define CODEC_FLAG_NORMALIZE_AQP 0x00020000 #endif #define CODEC_FLAG_INTERLACED_DCT AV_CODEC_FLAG_INTERLACED_DCT #define CODEC_FLAG_LOW_DELAY AV_CODEC_FLAG_LOW_DELAY #define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER #define CODEC_FLAG_BITEXACT AV_CODEC_FLAG_BITEXACT #define CODEC_FLAG_AC_PRED AV_CODEC_FLAG_AC_PRED #define CODEC_FLAG_LOOP_FILTER AV_CODEC_FLAG_LOOP_FILTER #define CODEC_FLAG_INTERLACED_ME AV_CODEC_FLAG_INTERLACED_ME #define CODEC_FLAG_CLOSED_GOP AV_CODEC_FLAG_CLOSED_GOP #define CODEC_FLAG2_FAST AV_CODEC_FLAG2_FAST #define CODEC_FLAG2_NO_OUTPUT AV_CODEC_FLAG2_NO_OUTPUT #define CODEC_FLAG2_LOCAL_HEADER AV_CODEC_FLAG2_LOCAL_HEADER #define CODEC_FLAG2_DROP_FRAME_TIMECODE AV_CODEC_FLAG2_DROP_FRAME_TIMECODE #define CODEC_FLAG2_IGNORE_CROP AV_CODEC_FLAG2_IGNORE_CROP #define CODEC_FLAG2_CHUNKS AV_CODEC_FLAG2_CHUNKS #define CODEC_FLAG2_SHOW_ALL AV_CODEC_FLAG2_SHOW_ALL #define CODEC_FLAG2_EXPORT_MVS AV_CODEC_FLAG2_EXPORT_MVS #define CODEC_FLAG2_SKIP_MANUAL AV_CODEC_FLAG2_SKIP_MANUAL /* Unsupported options : * Syntax Arithmetic coding (SAC) * Reference Picture Selection * Independent Segment Decoding */ /* /Fx */ /* codec capabilities */ #define CODEC_CAP_DRAW_HORIZ_BAND AV_CODEC_CAP_DRAW_HORIZ_BAND ///< Decoder can use draw_horiz_band callback. /** * Codec uses get_buffer() for allocating buffers and supports custom allocators. * If not set, it might not use get_buffer() at all or use operations that * assume the buffer was allocated by avcodec_default_get_buffer. */ #define CODEC_CAP_DR1 AV_CODEC_CAP_DR1 #define CODEC_CAP_TRUNCATED AV_CODEC_CAP_TRUNCATED #if FF_API_XVMC /* Codec can export data for HW decoding. This flag indicates that * the codec would call get_format() with list that might contain HW accelerated * pixel formats (XvMC, VDPAU, VAAPI, etc). The application can pick any of them * including raw image format. * The application can use the passed context to determine bitstream version, * chroma format, resolution etc. */ #define CODEC_CAP_HWACCEL 0x0010 #endif /* FF_API_XVMC */ /** * Encoder or decoder requires flushing with NULL input at the end in order to * give the complete and correct output. * * NOTE: If this flag is not set, the codec is guaranteed to never be fed with * with NULL data. The user can still send NULL data to the public encode * or decode function, but libavcodec will not pass it along to the codec * unless this flag is set. * * Decoders: * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, * avpkt->size=0 at the end to get the delayed data until the decoder no longer * returns frames. * * Encoders: * The encoder needs to be fed with NULL data at the end of encoding until the * encoder no longer returns data. * * NOTE: For encoders implementing the AVCodec.encode2() function, setting this * flag also means that the encoder must set the pts and duration for * each output packet. If this flag is not set, the pts and duration will * be determined by libavcodec from the input frame. */ #define CODEC_CAP_DELAY AV_CODEC_CAP_DELAY /** * Codec can be fed a final frame with a smaller size. * This can be used to prevent truncation of the last audio samples. */ #define CODEC_CAP_SMALL_LAST_FRAME AV_CODEC_CAP_SMALL_LAST_FRAME #if FF_API_CAP_VDPAU /** * Codec can export data for HW decoding (VDPAU). */ #define CODEC_CAP_HWACCEL_VDPAU AV_CODEC_CAP_HWACCEL_VDPAU #endif /** * Codec can output multiple frames per AVPacket * Normally demuxers return one frame at a time, demuxers which do not do * are connected to a parser to split what they return into proper frames. * This flag is reserved to the very rare category of codecs which have a * bitstream that cannot be split into frames without timeconsuming * operations like full decoding. Demuxers carring such bitstreams thus * may return multiple frames in a packet. This has many disadvantages like * prohibiting stream copy in many cases thus it should only be considered * as a last resort. */ #define CODEC_CAP_SUBFRAMES AV_CODEC_CAP_SUBFRAMES /** * Codec is experimental and is thus avoided in favor of non experimental * encoders */ #define CODEC_CAP_EXPERIMENTAL AV_CODEC_CAP_EXPERIMENTAL /** * Codec should fill in channel configuration and samplerate instead of container */ #define CODEC_CAP_CHANNEL_CONF AV_CODEC_CAP_CHANNEL_CONF #if FF_API_NEG_LINESIZES /** * @deprecated no codecs use this capability */ #define CODEC_CAP_NEG_LINESIZES 0x0800 #endif /** * Codec supports frame-level multithreading. */ #define CODEC_CAP_FRAME_THREADS AV_CODEC_CAP_FRAME_THREADS /** * Codec supports slice-based (or partition-based) multithreading. */ #define CODEC_CAP_SLICE_THREADS AV_CODEC_CAP_SLICE_THREADS /** * Codec supports changed parameters at any point. */ #define CODEC_CAP_PARAM_CHANGE AV_CODEC_CAP_PARAM_CHANGE /** * Codec supports avctx->thread_count == 0 (auto). */ #define CODEC_CAP_AUTO_THREADS AV_CODEC_CAP_AUTO_THREADS /** * Audio encoder supports receiving a different number of samples in each call. */ #define CODEC_CAP_VARIABLE_FRAME_SIZE AV_CODEC_CAP_VARIABLE_FRAME_SIZE /** * Codec is intra only. */ #define CODEC_CAP_INTRA_ONLY AV_CODEC_CAP_INTRA_ONLY /** * Codec is lossless. */ #define CODEC_CAP_LOSSLESS AV_CODEC_CAP_LOSSLESS /** * HWAccel is experimental and is thus avoided in favor of non experimental * codecs */ #define HWACCEL_CODEC_CAP_EXPERIMENTAL 0x0200 #endif /* FF_API_WITHOUT_PREFIX */ #if FF_API_MB_TYPE //The following defines may change, don't expect compatibility if you use them. #define MB_TYPE_INTRA4x4 0x0001 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific #define MB_TYPE_16x16 0x0008 #define MB_TYPE_16x8 0x0010 #define MB_TYPE_8x16 0x0020 #define MB_TYPE_8x8 0x0040 #define MB_TYPE_INTERLACED 0x0080 #define MB_TYPE_DIRECT2 0x0100 //FIXME #define MB_TYPE_ACPRED 0x0200 #define MB_TYPE_GMC 0x0400 #define MB_TYPE_SKIP 0x0800 #define MB_TYPE_P0L0 0x1000 #define MB_TYPE_P1L0 0x2000 #define MB_TYPE_P0L1 0x4000 #define MB_TYPE_P1L1 0x8000 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0) #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1) #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1) #define MB_TYPE_QUANT 0x00010000 #define MB_TYPE_CBP 0x00020000 //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) #endif /** * Pan Scan area. * This specifies the area which should be displayed. * Note there may be multiple such areas for one frame. */ typedef struct AVPanScan{ /** * id * - encoding: Set by user. * - decoding: Set by libavcodec. */ int id; /** * width and height in 1/16 pel * - encoding: Set by user. * - decoding: Set by libavcodec. */ int width; int height; /** * position of the top left corner in 1/16 pel for up to 3 fields/frames * - encoding: Set by user. * - decoding: Set by libavcodec. */ int16_t position[3][2]; }AVPanScan; /** * This structure describes the bitrate properties of an encoded bitstream. It * roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD * parameters for H.264/HEVC. */ typedef struct AVCPBProperties { /** * Maximum bitrate of the stream, in bits per second. * Zero if unknown or unspecified. */ int max_bitrate; /** * Minimum bitrate of the stream, in bits per second. * Zero if unknown or unspecified. */ int min_bitrate; /** * Average bitrate of the stream, in bits per second. * Zero if unknown or unspecified. */ int avg_bitrate; /** * The size of the buffer to which the ratecontrol is applied, in bits. * Zero if unknown or unspecified. */ int buffer_size; /** * The delay between the time the packet this structure is associated with * is received and the time when it should be decoded, in periods of a 27MHz * clock. * * UINT64_MAX when unknown or unspecified. */ uint64_t vbv_delay; } AVCPBProperties; #if FF_API_QSCALE_TYPE #define FF_QSCALE_TYPE_MPEG1 0 #define FF_QSCALE_TYPE_MPEG2 1 #define FF_QSCALE_TYPE_H264 2 #define FF_QSCALE_TYPE_VP56 3 #endif /** * The decoder will keep a reference to the frame and may reuse it later. */ #define AV_GET_BUFFER_FLAG_REF (1 << 0) /** * @defgroup lavc_packet AVPacket * * Types and functions for working with AVPacket. * @{ */ enum AVPacketSideDataType { AV_PKT_DATA_PALETTE, AV_PKT_DATA_NEW_EXTRADATA, /** * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: * @code * u32le param_flags * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) * s32le channel_count * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) * u64le channel_layout * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) * s32le sample_rate * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) * s32le width * s32le height * @endcode */ AV_PKT_DATA_PARAM_CHANGE, /** * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of * structures with info about macroblocks relevant to splitting the * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). * That is, it does not necessarily contain info about all macroblocks, * as long as the distance between macroblocks in the info is smaller * than the target payload size. * Each MB info structure is 12 bytes, and is laid out as follows: * @code * u32le bit offset from the start of the packet * u8 current quantizer at the start of the macroblock * u8 GOB number * u16le macroblock address within the GOB * u8 horizontal MV predictor * u8 vertical MV predictor * u8 horizontal MV predictor for block number 3 * u8 vertical MV predictor for block number 3 * @endcode */ AV_PKT_DATA_H263_MB_INFO, /** * This side data should be associated with an audio stream and contains * ReplayGain information in form of the AVReplayGain struct. */ AV_PKT_DATA_REPLAYGAIN, /** * This side data contains a 3x3 transformation matrix describing an affine * transformation that needs to be applied to the decoded video frames for * correct presentation. * * See libavutil/display.h for a detailed description of the data. */ AV_PKT_DATA_DISPLAYMATRIX, /** * This side data should be associated with a video stream and contains * Stereoscopic 3D information in form of the AVStereo3D struct. */ AV_PKT_DATA_STEREO3D, /** * This side data should be associated with an audio stream and corresponds * to enum AVAudioServiceType. */ AV_PKT_DATA_AUDIO_SERVICE_TYPE, /** * This side data contains quality related information from the encoder. * @code * u32le quality factor of the compressed frame. Allowed range is between 1 (good) and FF_LAMBDA_MAX (bad). * u8 picture type * u8 error count * u16 reserved * u64le[error count] sum of squared differences between encoder in and output * @endcode */ AV_PKT_DATA_QUALITY_STATS, /** * This side data contains an integer value representing the stream index * of a "fallback" track. A fallback track indicates an alternate * track to use when the current track can not be decoded for some reason. * e.g. no decoder available for codec. */ AV_PKT_DATA_FALLBACK_TRACK, /** * This side data corresponds to the AVCPBProperties struct. */ AV_PKT_DATA_CPB_PROPERTIES, /** * Recommmends skipping the specified number of samples * @code * u32le number of samples to skip from start of this packet * u32le number of samples to skip from end of this packet * u8 reason for start skip * u8 reason for end skip (0=padding silence, 1=convergence) * @endcode */ AV_PKT_DATA_SKIP_SAMPLES=70, /** * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that * the packet may contain "dual mono" audio specific to Japanese DTV * and if it is true, recommends only the selected channel to be used. * @code * u8 selected channels (0=mail/left, 1=sub/right, 2=both) * @endcode */ AV_PKT_DATA_JP_DUALMONO, /** * A list of zero terminated key/value strings. There is no end marker for * the list, so it is required to rely on the side data size to stop. */ AV_PKT_DATA_STRINGS_METADATA, /** * Subtitle event position * @code * u32le x1 * u32le y1 * u32le x2 * u32le y2 * @endcode */ AV_PKT_DATA_SUBTITLE_POSITION, /** * Data found in BlockAdditional element of matroska container. There is * no end marker for the data, so it is required to rely on the side data * size to recognize the end. 8 byte id (as found in BlockAddId) followed * by data. */ AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, /** * The optional first identifier line of a WebVTT cue. */ AV_PKT_DATA_WEBVTT_IDENTIFIER, /** * The optional settings (rendering instructions) that immediately * follow the timestamp specifier of a WebVTT cue. */ AV_PKT_DATA_WEBVTT_SETTINGS, /** * A list of zero terminated key/value strings. There is no end marker for * the list, so it is required to rely on the side data size to stop. This * side data includes updated metadata which appeared in the stream. */ AV_PKT_DATA_METADATA_UPDATE, }; #define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED typedef struct AVPacketSideData { uint8_t *data; int size; enum AVPacketSideDataType type; } AVPacketSideData; /** * This structure stores compressed data. It is typically exported by demuxers * and then passed as input to decoders, or received as output from encoders and * then passed to muxers. * * For video, it should typically contain one compressed frame. For audio it may * contain several compressed frames. Encoders are allowed to output empty * packets, with no compressed data, containing only side data * (e.g. to update some stream parameters at the end of encoding). * * AVPacket is one of the few structs in FFmpeg, whose size is a part of public * ABI. Thus it may be allocated on stack and no new fields can be added to it * without libavcodec and libavformat major bump. * * The semantics of data ownership depends on the buf field. * If it is set, the packet data is dynamically allocated and is * valid indefinitely until a call to av_packet_unref() reduces the * reference count to 0. * * If the buf field is not set av_packet_ref() would make a copy instead * of increasing the reference count. * * The side data is always allocated with av_malloc(), copied by * av_packet_ref() and freed by av_packet_unref(). * * @see av_packet_ref * @see av_packet_unref */ typedef struct AVPacket { /** * A reference to the reference-counted buffer where the packet data is * stored. * May be NULL, then the packet data is not reference-counted. */ AVBufferRef *buf; /** * Presentation timestamp in AVStream->time_base units; the time at which * the decompressed packet will be presented to the user. * Can be AV_NOPTS_VALUE if it is not stored in the file. * pts MUST be larger or equal to dts as presentation cannot happen before * decompression, unless one wants to view hex dumps. Some formats misuse * the terms dts and pts/cts to mean something different. Such timestamps * must be converted to true pts/dts before they are stored in AVPacket. */ int64_t pts; /** * Decompression timestamp in AVStream->time_base units; the time at which * the packet is decompressed. * Can be AV_NOPTS_VALUE if it is not stored in the file. */ int64_t dts; uint8_t *data; int size; int stream_index; /** * A combination of AV_PKT_FLAG values */ int flags; /** * Additional packet data that can be provided by the container. * Packet can contain several types of side information. */ AVPacketSideData *side_data; int side_data_elems; /** * Duration of this packet in AVStream->time_base units, 0 if unknown. * Equals next_pts - this_pts in presentation order. */ int64_t duration; int64_t pos; ///< byte position in stream, -1 if unknown #if FF_API_CONVERGENCE_DURATION /** * @deprecated Same as the duration field, but as int64_t. This was required * for Matroska subtitles, whose duration values could overflow when the * duration field was still an int. */ attribute_deprecated int64_t convergence_duration; #endif } AVPacket; #define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe #define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted #define AV_PKT_FLAG_NEW_SEG 0x8000 ///< The packet is the first packet from a source in concat enum AVSideDataParamChangeFlags { AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008, }; /** * @} */ struct AVCodecInternal; enum AVFieldOrder { AV_FIELD_UNKNOWN, AV_FIELD_PROGRESSIVE, AV_FIELD_TT, //< Top coded_first, top displayed first AV_FIELD_BB, //< Bottom coded first, bottom displayed first AV_FIELD_TB, //< Top coded first, bottom displayed first AV_FIELD_BT, //< Bottom coded first, top displayed first }; /** * main external API structure. * New fields can be added to the end with minor version bumps. * Removal, reordering and changes to existing fields require a major * version bump. * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user * applications. * sizeof(AVCodecContext) must not be used outside libav*. */ typedef struct AVCodecContext { /** * information on struct for av_log * - set by avcodec_alloc_context3 */ const AVClass *av_class; int log_level_offset; enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */ const struct AVCodec *codec; #if FF_API_CODEC_NAME /** * @deprecated this field is not used for anything in libavcodec */ attribute_deprecated char codec_name[32]; #endif enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */ /** * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). * This is used to work around some encoder bugs. * A demuxer should set this to what is stored in the field used to identify the codec. * If there are multiple such fields in a container then the demuxer should choose the one * which maximizes the information about the used codec. * If the codec tag field in a container is larger than 32 bits then the demuxer should * remap the longer ID to 32 bits with a table or other structure. Alternatively a new * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated * first. * - encoding: Set by user, if not then the default based on codec_id will be used. * - decoding: Set by user, will be converted to uppercase by libavcodec during init. */ unsigned int codec_tag; #if FF_API_STREAM_CODEC_TAG /** * @deprecated this field is unused */ attribute_deprecated unsigned int stream_codec_tag; #endif void *priv_data; /** * Private context used for internal data. * * Unlike priv_data, this is not codec-specific. It is used in general * libavcodec functions. */ struct AVCodecInternal *internal; /** * Private data of the user, can be used to carry app specific stuff. * - encoding: Set by user. * - decoding: Set by user. */ void *opaque; /** * the average bitrate * - encoding: Set by user; unused for constant quantizer encoding. * - decoding: Set by user, may be overwritten by libavcodec * if this info is available in the stream */ int64_t bit_rate; /** * number of bits the bitstream is allowed to diverge from the reference. * the reference can be CBR (for CBR pass1) or VBR (for pass2) * - encoding: Set by user; unused for constant quantizer encoding. * - decoding: unused */ int bit_rate_tolerance; /** * Global quality for codecs which cannot change it per frame. * This should be proportional to MPEG-1/2/4 qscale. * - encoding: Set by user. * - decoding: unused */ int global_quality; /** * - encoding: Set by user. * - decoding: unused */ int compression_level; #define FF_COMPRESSION_DEFAULT -1 /** * AV_CODEC_FLAG_*. * - encoding: Set by user. * - decoding: Set by user. */ int flags; /** * AV_CODEC_FLAG2_* * - encoding: Set by user. * - decoding: Set by user. */ int flags2; /** * some codecs need / can use extradata like Huffman tables. * mjpeg: Huffman tables * rv10: additional flags * mpeg4: global headers (they can be in the bitstream or here) * The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger * than extradata_size to avoid problems if it is read with the bitstream reader. * The bytewise contents of extradata must not depend on the architecture or CPU endianness. * - encoding: Set/allocated/freed by libavcodec. * - decoding: Set/allocated/freed by user. */ uint8_t *extradata; int extradata_size; /** * This is the fundamental unit of time (in seconds) in terms * of which frame timestamps are represented. For fixed-fps content, * timebase should be 1/framerate and timestamp increments should be * identically 1. * This often, but not always is the inverse of the frame rate or field rate * for video. * - encoding: MUST be set by user. * - decoding: the use of this field for decoding is deprecated. * Use framerate instead. */ AVRational time_base; /** * For some codecs, the time base is closer to the field rate than the frame rate. * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration * if no telecine is used ... * * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. */ int ticks_per_frame; /** * Codec delay. * * Encoding: Number of frames delay there will be from the encoder input to * the decoder output. (we assume the decoder matches the spec) * Decoding: Number of frames delay in addition to what a standard decoder * as specified in the spec would produce. * * Video: * Number of frames the decoded output will be delayed relative to the * encoded input. * * Audio: * For encoding, this field is unused (see initial_padding). * * For decoding, this is the number of samples the decoder needs to * output before the decoder's output is valid. When seeking, you should * start decoding this many samples prior to your desired seek point. * * - encoding: Set by libavcodec. * - decoding: Set by libavcodec. */ int delay; /* video only */ /** * picture width / height. * * @note Those fields may not match the values of the last * AVFrame outputted by avcodec_decode_video2 due frame * reordering. * * - encoding: MUST be set by user. * - decoding: May be set by the user before opening the decoder if known e.g. * from the container. Some decoders will require the dimensions * to be set by the caller. During decoding, the decoder may * overwrite those values as required while parsing the data. */ int width, height; /** * Bitstream width / height, may be different from width/height e.g. when * the decoded frame is cropped before being output or lowres is enabled. * * @note Those field may not match the value of the last * AVFrame outputted by avcodec_decode_video2 due frame * reordering. * * - encoding: unused * - decoding: May be set by the user before opening the decoder if known * e.g. from the container. During decoding, the decoder may * overwrite those values as required while parsing the data. */ int coded_width, coded_height; #if FF_API_ASPECT_EXTENDED #define FF_ASPECT_EXTENDED 15 #endif /** * the number of pictures in a group of pictures, or 0 for intra_only * - encoding: Set by user. * - decoding: unused */ int gop_size; /** * Pixel format, see AV_PIX_FMT_xxx. * May be set by the demuxer if known from headers. * May be overridden by the decoder if it knows better. * * @note This field may not match the value of the last * AVFrame outputted by avcodec_decode_video2 due frame * reordering. * * - encoding: Set by user. * - decoding: Set by user if known, overridden by libavcodec while * parsing the data. */ enum AVPixelFormat pix_fmt; #if FF_API_MOTION_EST /** * This option does nothing * @deprecated use codec private options instead */ attribute_deprecated int me_method; #endif /** * If non NULL, 'draw_horiz_band' is called by the libavcodec * decoder to draw a horizontal band. It improves cache usage. Not * all codecs can do that. You must check the codec capabilities * beforehand. * When multithreading is used, it may be called from multiple threads * at the same time; threads might draw different parts of the same AVFrame, * or multiple AVFrames, and there is no guarantee that slices will be drawn * in order. * The function is also used by hardware acceleration APIs. * It is called at least once during frame decoding to pass * the data needed for hardware render. * In that mode instead of pixel data, AVFrame points to * a structure specific to the acceleration API. The application * reads the structure and can change some fields to indicate progress * or mark state. * - encoding: unused * - decoding: Set by user. * @param height the height of the slice * @param y the y position of the slice * @param type 1->top field, 2->bottom field, 3->frame * @param offset offset into the AVFrame.data from which the slice should be read */ void (*draw_horiz_band)(struct AVCodecContext *s, const AVFrame *src, int offset[AV_NUM_DATA_POINTERS], int y, int type, int height); /** * callback to negotiate the pixelFormat * @param fmt is the list of formats which are supported by the codec, * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. * The first is always the native one. * @note The callback may be called again immediately if initialization for * the selected (hardware-accelerated) pixel format failed. * @warning Behavior is undefined if the callback returns a value not * in the fmt list of formats. * @return the chosen format * - encoding: unused * - decoding: Set by user, if not set the native format will be chosen. */ enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt); /** * maximum number of B-frames between non-B-frames * Note: The output will be delayed by max_b_frames+1 relative to the input. * - encoding: Set by user. * - decoding: unused */ int max_b_frames; /** * qscale factor between IP and B-frames * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). * - encoding: Set by user. * - decoding: unused */ float b_quant_factor; #if FF_API_RC_STRATEGY /** @deprecated use codec private option instead */ attribute_deprecated int rc_strategy; #define FF_RC_STRATEGY_XVID 1 #endif #if FF_API_PRIVATE_OPT /** @deprecated use encoder private options instead */ attribute_deprecated int b_frame_strategy; #endif /** * qscale offset between IP and B-frames * - encoding: Set by user. * - decoding: unused */ float b_quant_offset; /** * Size of the frame reordering buffer in the decoder. * For MPEG-2 it is 1 IPB or 0 low delay IP. * - encoding: Set by libavcodec. * - decoding: Set by libavcodec. */ int has_b_frames; #if FF_API_PRIVATE_OPT /** @deprecated use encoder private options instead */ attribute_deprecated int mpeg_quant; #endif /** * qscale factor between P and I-frames * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). * - encoding: Set by user. * - decoding: unused */ float i_quant_factor; /** * qscale offset between P and I-frames * - encoding: Set by user. * - decoding: unused */ float i_quant_offset; /** * luminance masking (0-> disabled) * - encoding: Set by user. * - decoding: unused */ float lumi_masking; /** * temporary complexity masking (0-> disabled) * - encoding: Set by user. * - decoding: unused */ float temporal_cplx_masking; /** * spatial complexity masking (0-> disabled) * - encoding: Set by user. * - decoding: unused */ float spatial_cplx_masking; /** * p block masking (0-> disabled) * - encoding: Set by user. * - decoding: unused */ float p_masking; /** * darkness masking (0-> disabled) * - encoding: Set by user. * - decoding: unused */ float dark_masking; /** * slice count * - encoding: Set by libavcodec. * - decoding: Set by user (or 0). */ int slice_count; #if FF_API_PRIVATE_OPT /** @deprecated use encoder private options instead */ attribute_deprecated int prediction_method; #define FF_PRED_LEFT 0 #define FF_PRED_PLANE 1 #define FF_PRED_MEDIAN 2 #endif /** * slice offsets in the frame in bytes * - encoding: Set/allocated by libavcodec. * - decoding: Set/allocated by user (or NULL). */ int *slice_offset; /** * sample aspect ratio (0 if unknown) * That is the width of a pixel divided by the height of the pixel. * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. * - encoding: Set by user. * - decoding: Set by libavcodec. */ AVRational sample_aspect_ratio; /** * motion estimation comparison function * - encoding: Set by user. * - decoding: unused */ int me_cmp; /** * subpixel motion estimation comparison function * - encoding: Set by user. * - decoding: unused */ int me_sub_cmp; /** * macroblock comparison function (not supported yet) * - encoding: Set by user. * - decoding: unused */ int mb_cmp; /** * interlaced DCT comparison function * - encoding: Set by user. * - decoding: unused */ int ildct_cmp; #define FF_CMP_SAD 0 #define FF_CMP_SSE 1 #define FF_CMP_SATD 2 #define FF_CMP_DCT 3 #define FF_CMP_PSNR 4 #define FF_CMP_BIT 5 #define FF_CMP_RD 6 #define FF_CMP_ZERO 7 #define FF_CMP_VSAD 8 #define FF_CMP_VSSE 9 #define FF_CMP_NSSE 10 #define FF_CMP_W53 11 #define FF_CMP_W97 12 #define FF_CMP_DCTMAX 13 #define FF_CMP_DCT264 14 #define FF_CMP_CHROMA 256 /** * ME diamond size & shape * - encoding: Set by user. * - decoding: unused */ int dia_size; /** * amount of previous MV predictors (2a+1 x 2a+1 square) * - encoding: Set by user. * - decoding: unused */ int last_predictor_count; #if FF_API_PRIVATE_OPT /** @deprecated use encoder private options instead */ attribute_deprecated int pre_me; #endif /** * motion estimation prepass comparison function * - encoding: Set by user. * - decoding: unused */ int me_pre_cmp; /** * ME prepass diamond size & shape * - encoding: Set by user. * - decoding: unused */ int pre_dia_size; /** * subpel ME quality * - encoding: Set by user. * - decoding: unused */ int me_subpel_quality; #if FF_API_AFD /** * DTG active format information (additional aspect ratio * information only used in DVB MPEG-2 transport streams) * 0 if not set. * * - encoding: unused * - decoding: Set by decoder. * @deprecated Deprecated in favor of AVSideData */ attribute_deprecated int dtg_active_format; #define FF_DTG_AFD_SAME 8 #define FF_DTG_AFD_4_3 9 #define FF_DTG_AFD_16_9 10 #define FF_DTG_AFD_14_9 11 #define FF_DTG_AFD_4_3_SP_14_9 13 #define FF_DTG_AFD_16_9_SP_14_9 14 #define FF_DTG_AFD_SP_4_3 15 #endif /* FF_API_AFD */ /** * maximum motion estimation search range in subpel units * If 0 then no limit. * * - encoding: Set by user. * - decoding: unused */ int me_range; #if FF_API_QUANT_BIAS /** * @deprecated use encoder private option instead */ attribute_deprecated int intra_quant_bias; #define FF_DEFAULT_QUANT_BIAS 999999 /** * @deprecated use encoder private option instead */ attribute_deprecated int inter_quant_bias; #endif /** * slice flags * - encoding: unused * - decoding: Set by user. */ int slice_flags; #define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display #define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics) #define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1) #if FF_API_XVMC /** * XVideo Motion Acceleration * - encoding: forbidden * - decoding: set by decoder * @deprecated XvMC doesn't need it anymore. */ attribute_deprecated int xvmc_acceleration; #endif /* FF_API_XVMC */ /** * macroblock decision mode * - encoding: Set by user. * - decoding: unused */ int mb_decision; #define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp #define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits #define FF_MB_DECISION_RD 2 ///< rate distortion /** * custom intra quantization matrix * - encoding: Set by user, can be NULL. * - decoding: Set by libavcodec. */ uint16_t *intra_matrix; /** * custom inter quantization matrix * - encoding: Set by user, can be NULL. * - decoding: Set by libavcodec. */ uint16_t *inter_matrix; #if FF_API_PRIVATE_OPT /** @deprecated use encoder private options instead */ attribute_deprecated int scenechange_threshold; /** @deprecated use encoder private options instead */ attribute_deprecated int noise_reduction; #endif #if FF_API_MPV_OPT /** * @deprecated this field is unused */ attribute_deprecated int me_threshold; /** * @deprecated this field is unused */ attribute_deprecated int mb_threshold; #endif /** * precision of the intra DC coefficient - 8 * - encoding: Set by user. * - decoding: Set by libavcodec */ int intra_dc_precision; /** * Number of macroblock rows at the top which are skipped. * - encoding: unused * - decoding: Set by user. */ int skip_top; /** * Number of macroblock rows at the bottom which are skipped. * - encoding: unused * - decoding: Set by user. */ int skip_bottom; #if FF_API_MPV_OPT /** * @deprecated use encoder private options instead */ attribute_deprecated float border_masking; #endif /** * minimum MB lagrange multipler * - encoding: Set by user. * - decoding: unused */ int mb_lmin; /** * maximum MB lagrange multipler * - encoding: Set by user. * - decoding: unused */ int mb_lmax; #if FF_API_PRIVATE_OPT /** * @deprecated use encoder private options instead */ attribute_deprecated int me_penalty_compensation; #endif /** * * - encoding: Set by user. * - decoding: unused */ int bidir_refine; #if FF_API_PRIVATE_OPT /** @deprecated use encoder private options instead */ attribute_deprecated int brd_scale; #endif /** * minimum GOP size * - encoding: Set by user. * - decoding: unused */ int keyint_min; /** * number of reference frames * - encoding: Set by user. * - decoding: Set by lavc. */ int refs; #if FF_API_PRIVATE_OPT /** @deprecated use encoder private options instead */ attribute_deprecated int chromaoffset; #endif #if FF_API_UNUSED_MEMBERS /** * Multiplied by qscale for each frame and added to scene_change_score. * - encoding: Set by user. * - decoding: unused */ attribute_deprecated int scenechange_factor; #endif /** * * Note: Value depends upon the compare function used for fullpel ME. * - encoding: Set by user. * - decoding: unused */ int mv0_threshold; #if FF_API_PRIVATE_OPT /** @deprecated use encoder private options instead */ attribute_deprecated int b_sensitivity; #endif /** * Chromaticity coordinates of the source primaries. * - encoding: Set by user * - decoding: Set by libavcodec */ enum AVColorPrimaries color_primaries; /** * Color Transfer Characteristic. * - encoding: Set by user * - decoding: Set by libavcodec */ enum AVColorTransferCharacteristic color_trc; /** * YUV colorspace type. * - encoding: Set by user * - decoding: Set by libavcodec */ enum AVColorSpace colorspace; /** * MPEG vs JPEG YUV range. * - encoding: Set by user * - decoding: Set by libavcodec */ enum AVColorRange color_range; /** * This defines the location of chroma samples. * - encoding: Set by user * - decoding: Set by libavcodec */ enum AVChromaLocation chroma_sample_location; /** * Number of slices. * Indicates number of picture subdivisions. Used for parallelized * decoding. * - encoding: Set by user * - decoding: unused */ int slices; /** Field order * - encoding: set by libavcodec * - decoding: Set by user. */ enum AVFieldOrder field_order; /* audio only */ int sample_rate; ///< samples per second int channels; ///< number of audio channels /** * audio sample format * - encoding: Set by user. * - decoding: Set by libavcodec. */ enum AVSampleFormat sample_fmt; ///< sample format /* The following data should not be initialized. */ /** * Number of samples per channel in an audio frame. * * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame * except the last must contain exactly frame_size samples per channel. * May be 0 when the codec has AV_CODEC_CAP_VARIABLE_FRAME_SIZE set, then the * frame size is not restricted. * - decoding: may be set by some decoders to indicate constant frame size */ int frame_size; /** * Frame counter, set by libavcodec. * * - decoding: total number of frames returned from the decoder so far. * - encoding: total number of frames passed to the encoder so far. * * @note the counter is not incremented if encoding/decoding resulted in * an error. */ int frame_number; /** * number of bytes per packet if constant and known or 0 * Used by some WAV based audio codecs. */ int block_align; /** * Audio cutoff bandwidth (0 means "automatic") * - encoding: Set by user. * - decoding: unused */ int cutoff; /** * Audio channel layout. * - encoding: set by user. * - decoding: set by user, may be overwritten by libavcodec. */ uint64_t channel_layout; /** * Request decoder to use this channel layout if it can (0 for default) * - encoding: unused * - decoding: Set by user. */ uint64_t request_channel_layout; /** * Type of service that the audio stream conveys. * - encoding: Set by user. * - decoding: Set by libavcodec. */ enum AVAudioServiceType audio_service_type; /** * desired sample format * - encoding: Not used. * - decoding: Set by user. * Decoder will decode to this format if it can. */ enum AVSampleFormat request_sample_fmt; /** * This callback is called at the beginning of each frame to get data * buffer(s) for it. There may be one contiguous buffer for all the data or * there may be a buffer per each data plane or anything in between. What * this means is, you may set however many entries in buf[] you feel necessary. * Each buffer must be reference-counted using the AVBuffer API (see description * of buf[] below). * * The following fields will be set in the frame before this callback is * called: * - format * - width, height (video only) * - sample_rate, channel_layout, nb_samples (audio only) * Their values may differ from the corresponding values in * AVCodecContext. This callback must use the frame values, not the codec * context values, to calculate the required buffer size. * * This callback must fill the following fields in the frame: * - data[] * - linesize[] * - extended_data: * * if the data is planar audio with more than 8 channels, then this * callback must allocate and fill extended_data to contain all pointers * to all data planes. data[] must hold as many pointers as it can. * extended_data must be allocated with av_malloc() and will be freed in * av_frame_unref(). * * otherwise exended_data must point to data * - buf[] must contain one or more pointers to AVBufferRef structures. Each of * the frame's data and extended_data pointers must be contained in these. That * is, one AVBufferRef for each allocated chunk of memory, not necessarily one * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), * and av_buffer_ref(). * - extended_buf and nb_extended_buf must be allocated with av_malloc() by * this callback and filled with the extra buffers if there are more * buffers than buf[] can hold. extended_buf will be freed in * av_frame_unref(). * * If AV_CODEC_CAP_DR1 is not set then get_buffer2() must call * avcodec_default_get_buffer2() instead of providing buffers allocated by * some other means. * * Each data plane must be aligned to the maximum required by the target * CPU. * * @see avcodec_default_get_buffer2() * * Video: * * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused * (read and/or written to if it is writable) later by libavcodec. * * avcodec_align_dimensions2() should be used to find the required width and * height, as they normally need to be rounded up to the next multiple of 16. * * Some decoders do not support linesizes changing between frames. * * If frame multithreading is used and thread_safe_callbacks is set, * this callback may be called from a different thread, but not from more * than one at once. Does not need to be reentrant. * * @see avcodec_align_dimensions2() * * Audio: * * Decoders request a buffer of a particular size by setting * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, * however, utilize only part of the buffer by setting AVFrame.nb_samples * to a smaller value in the output frame. * * As a convenience, av_samples_get_buffer_size() and * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() * functions to find the required data size and to fill data pointers and * linesize. In AVFrame.linesize, only linesize[0] may be set for audio * since all planes must be the same size. * * @see av_samples_get_buffer_size(), av_samples_fill_arrays() * * - encoding: unused * - decoding: Set by libavcodec, user can override. */ int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags); /** * If non-zero, the decoded audio and video frames returned from * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted * and are valid indefinitely. The caller must free them with * av_frame_unref() when they are not needed anymore. * Otherwise, the decoded frames must not be freed by the caller and are * only valid until the next decode call. * * - encoding: unused * - decoding: set by the caller before avcodec_open2(). */ int refcounted_frames; /* - encoding parameters */ float qcompress; ///< amount of qscale change between easy & hard scenes (0.0-1.0) float qblur; ///< amount of qscale smoothing over time (0.0-1.0) /** * minimum quantizer * - encoding: Set by user. * - decoding: unused */ int qmin; /** * maximum quantizer * - encoding: Set by user. * - decoding: unused */ int qmax; /** * maximum quantizer difference between frames * - encoding: Set by user. * - decoding: unused */ int max_qdiff; #if FF_API_MPV_OPT /** * @deprecated use encoder private options instead */ attribute_deprecated float rc_qsquish; attribute_deprecated float rc_qmod_amp; attribute_deprecated int rc_qmod_freq; #endif /** * decoder bitstream buffer size * - encoding: Set by user. * - decoding: unused */ int rc_buffer_size; /** * ratecontrol override, see RcOverride * - encoding: Allocated/set/freed by user. * - decoding: unused */ int rc_override_count; RcOverride *rc_override; #if FF_API_MPV_OPT /** * @deprecated use encoder private options instead */ attribute_deprecated const char *rc_eq; #endif /** * maximum bitrate * - encoding: Set by user. * - decoding: Set by user, may be overwritten by libavcodec. */ int64_t rc_max_rate; /** * minimum bitrate * - encoding: Set by user. * - decoding: unused */ int64_t rc_min_rate; #if FF_API_MPV_OPT /** * @deprecated use encoder private options instead */ attribute_deprecated float rc_buffer_aggressivity; attribute_deprecated float rc_initial_cplx; #endif /** * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow. * - encoding: Set by user. * - decoding: unused. */ float rc_max_available_vbv_use; /** * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow. * - encoding: Set by user. * - decoding: unused. */ float rc_min_vbv_overflow_use; /** * Number of bits which should be loaded into the rc buffer before decoding starts. * - encoding: Set by user. * - decoding: unused */ int rc_initial_buffer_occupancy; #if FF_API_CODER_TYPE #define FF_CODER_TYPE_VLC 0 #define FF_CODER_TYPE_AC 1 #define FF_CODER_TYPE_RAW 2 #define FF_CODER_TYPE_RLE 3 #if FF_API_UNUSED_MEMBERS #define FF_CODER_TYPE_DEFLATE 4 #endif /* FF_API_UNUSED_MEMBERS */ /** * @deprecated use encoder private options instead */ attribute_deprecated int coder_type; #endif /* FF_API_CODER_TYPE */ #if FF_API_PRIVATE_OPT /** @deprecated use encoder private options instead */ attribute_deprecated int context_model; #endif #if FF_API_MPV_OPT /** * @deprecated use encoder private options instead */ attribute_deprecated int lmin; /** * @deprecated use encoder private options instead */ attribute_deprecated int lmax; #endif #if FF_API_PRIVATE_OPT /** @deprecated use encoder private options instead */ attribute_deprecated int frame_skip_threshold; /** @deprecated use encoder private options instead */ attribute_deprecated int frame_skip_factor; /** @deprecated use encoder private options instead */ attribute_deprecated int frame_skip_exp; /** @deprecated use encoder private options instead */ attribute_deprecated int frame_skip_cmp; #endif /* FF_API_PRIVATE_OPT */ /** * trellis RD quantization * - encoding: Set by user. * - decoding: unused */ int trellis; #if FF_API_PRIVATE_OPT /** @deprecated use encoder private options instead */ attribute_deprecated int min_prediction_order; /** @deprecated use encoder private options instead */ attribute_deprecated int max_prediction_order; /** @deprecated use encoder private options instead */ attribute_deprecated int64_t timecode_frame_start; #endif #if FF_API_RTP_CALLBACK /** * @deprecated unused */ /* The RTP callback: This function is called */ /* every time the encoder has a packet to send. */ /* It depends on the encoder if the data starts */ /* with a Start Code (it should). H.263 does. */ /* mb_nb contains the number of macroblocks */ /* encoded in the RTP payload. */ attribute_deprecated void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb); #endif #if FF_API_PRIVATE_OPT /** @deprecated use encoder private options instead */ attribute_deprecated int rtp_payload_size; /* The size of the RTP payload: the coder will */ /* do its best to deliver a chunk with size */ /* below rtp_payload_size, the chunk will start */ /* with a start code on some codecs like H.263. */ /* This doesn't take account of any particular */ /* headers inside the transmitted RTP payload. */ #endif #if FF_API_STAT_BITS /* statistics, used for 2-pass encoding */ attribute_deprecated int mv_bits; attribute_deprecated int header_bits; attribute_deprecated int i_tex_bits; attribute_deprecated int p_tex_bits; attribute_deprecated int i_count; attribute_deprecated int p_count; attribute_deprecated int skip_count; attribute_deprecated int misc_bits; /** @deprecated this field is unused */ attribute_deprecated int frame_bits; #endif /** * pass1 encoding statistics output buffer * - encoding: Set by libavcodec. * - decoding: unused */ char *stats_out; /** * pass2 encoding statistics input buffer * Concatenated stuff from stats_out of pass1 should be placed here. * - encoding: Allocated/set/freed by user. * - decoding: unused */ char *stats_in; /** * Work around bugs in encoders which sometimes cannot be detected automatically. * - encoding: Set by user * - decoding: Set by user */ int workaround_bugs; #define FF_BUG_AUTODETECT 1 ///< autodetection #if FF_API_OLD_MSMPEG4 #define FF_BUG_OLD_MSMPEG4 2 #endif #define FF_BUG_XVID_ILACE 4 #define FF_BUG_UMP4 8 #define FF_BUG_NO_PADDING 16 #define FF_BUG_AMV 32 #if FF_API_AC_VLC #define FF_BUG_AC_VLC 0 ///< Will be removed, libavcodec can now handle these non-compliant files by default. #endif #define FF_BUG_QPEL_CHROMA 64 #define FF_BUG_STD_QPEL 128 #define FF_BUG_QPEL_CHROMA2 256 #define FF_BUG_DIRECT_BLOCKSIZE 512 #define FF_BUG_EDGE 1024 #define FF_BUG_HPEL_CHROMA 2048 #define FF_BUG_DC_CLIP 4096 #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders. #define FF_BUG_TRUNCATED 16384 /** * strictly follow the standard (MPEG4, ...). * - encoding: Set by user. * - decoding: Set by user. * Setting this to STRICT or higher means the encoder and decoder will * generally do stupid things, whereas setting it to unofficial or lower * will mean the encoder might produce output that is not supported by all * spec-compliant decoders. Decoders don't differentiate between normal, * unofficial and experimental (that is, they always try to decode things * when they can) unless they are explicitly asked to behave stupidly * (=strictly conform to the specs) */ int strict_std_compliance; #define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software. #define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences. #define FF_COMPLIANCE_NORMAL 0 #define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. /** * error concealment flags * - encoding: unused * - decoding: Set by user. */ int error_concealment; #define FF_EC_GUESS_MVS 1 #define FF_EC_DEBLOCK 2 #define FF_EC_FAVOR_INTER 256 /** * debug * - encoding: Set by user. * - decoding: Set by user. */ int debug; #define FF_DEBUG_PICT_INFO 1 #define FF_DEBUG_RC 2 #define FF_DEBUG_BITSTREAM 4 #define FF_DEBUG_MB_TYPE 8 #define FF_DEBUG_QP 16 #if FF_API_DEBUG_MV /** * @deprecated this option does nothing */ #define FF_DEBUG_MV 32 #endif #define FF_DEBUG_DCT_COEFF 0x00000040 #define FF_DEBUG_SKIP 0x00000080 #define FF_DEBUG_STARTCODE 0x00000100 #if FF_API_UNUSED_MEMBERS #define FF_DEBUG_PTS 0x00000200 #endif /* FF_API_UNUSED_MEMBERS */ #define FF_DEBUG_ER 0x00000400 #define FF_DEBUG_MMCO 0x00000800 #define FF_DEBUG_BUGS 0x00001000 #if FF_API_DEBUG_MV #define FF_DEBUG_VIS_QP 0x00002000 ///< only access through AVOptions from outside libavcodec #define FF_DEBUG_VIS_MB_TYPE 0x00004000 ///< only access through AVOptions from outside libavcodec #endif #define FF_DEBUG_BUFFERS 0x00008000 #define FF_DEBUG_THREADS 0x00010000 #define FF_DEBUG_GREEN_MD 0x00800000 #define FF_DEBUG_NOMC 0x01000000 #if FF_API_DEBUG_MV /** * debug * Code outside libavcodec should access this field using AVOptions * - encoding: Set by user. * - decoding: Set by user. */ int debug_mv; #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames #endif /** * Error recognition; may misdetect some more or less valid parts as errors. * - encoding: unused * - decoding: Set by user. */ int err_recognition; /** * Verify checksums embedded in the bitstream (could be of either encoded or * decoded data, depending on the codec) and print an error message on mismatch. * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the * decoder returning an error. */ #define AV_EF_CRCCHECK (1<<0) #define AV_EF_BITSTREAM (1<<1) ///< detect bitstream specification deviations #define AV_EF_BUFFER (1<<2) ///< detect improper bitstream length #define AV_EF_EXPLODE (1<<3) ///< abort decoding on minor error detection #define AV_EF_IGNORE_ERR (1<<15) ///< ignore errors and continue #define AV_EF_CAREFUL (1<<16) ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors #define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliances as errors #define AV_EF_AGGRESSIVE (1<<18) ///< consider things that a sane encoder should not do as an error /** * opaque 64bit number (generally a PTS) that will be reordered and * output in AVFrame.reordered_opaque * - encoding: unused * - decoding: Set by user. */ int64_t reordered_opaque; /** * Hardware accelerator in use * - encoding: unused. * - decoding: Set by libavcodec */ struct AVHWAccel *hwaccel; /** * Hardware accelerator context. * For some hardware accelerators, a global context needs to be * provided by the user. In that case, this holds display-dependent * data FFmpeg cannot instantiate itself. Please refer to the * FFmpeg HW accelerator documentation to know how to fill this * is. e.g. for VA API, this is a struct vaapi_context. * - encoding: unused * - decoding: Set by user */ void *hwaccel_context; /** * error * - encoding: Set by libavcodec if flags & AV_CODEC_FLAG_PSNR. * - decoding: unused */ uint64_t error[AV_NUM_DATA_POINTERS]; /** * DCT algorithm, see FF_DCT_* below * - encoding: Set by user. * - decoding: unused */ int dct_algo; #define FF_DCT_AUTO 0 #define FF_DCT_FASTINT 1 #define FF_DCT_INT 2 #define FF_DCT_MMX 3 #define FF_DCT_ALTIVEC 5 #define FF_DCT_FAAN 6 /** * IDCT algorithm, see FF_IDCT_* below. * - encoding: Set by user. * - decoding: Set by user. */ int idct_algo; #define FF_IDCT_AUTO 0 #define FF_IDCT_INT 1 #define FF_IDCT_SIMPLE 2 #define FF_IDCT_SIMPLEMMX 3 #define FF_IDCT_ARM 7 #define FF_IDCT_ALTIVEC 8 #if FF_API_ARCH_SH4 #define FF_IDCT_SH4 9 #endif #define FF_IDCT_SIMPLEARM 10 #if FF_API_UNUSED_MEMBERS #define FF_IDCT_IPP 13 #endif /* FF_API_UNUSED_MEMBERS */ #define FF_IDCT_XVID 14 #if FF_API_IDCT_XVIDMMX #define FF_IDCT_XVIDMMX 14 #endif /* FF_API_IDCT_XVIDMMX */ #define FF_IDCT_SIMPLEARMV5TE 16 #define FF_IDCT_SIMPLEARMV6 17 #if FF_API_ARCH_SPARC #define FF_IDCT_SIMPLEVIS 18 #endif #define FF_IDCT_FAAN 20 #define FF_IDCT_SIMPLENEON 22 #if FF_API_ARCH_ALPHA #define FF_IDCT_SIMPLEALPHA 23 #endif #define FF_IDCT_SIMPLEAUTO 128 /** * bits per sample/pixel from the demuxer (needed for huffyuv). * - encoding: Set by libavcodec. * - decoding: Set by user. */ int bits_per_coded_sample; /** * Bits per sample/pixel of internal libavcodec pixel/sample format. * - encoding: set by user. * - decoding: set by libavcodec. */ int bits_per_raw_sample; #if FF_API_LOWRES /** * low resolution decoding, 1-> 1/2 size, 2->1/4 size * - encoding: unused * - decoding: Set by user. * Code outside libavcodec should access this field using: * av_codec_{get,set}_lowres(avctx) */ int lowres; #endif #if FF_API_CODED_FRAME /** * the picture in the bitstream * - encoding: Set by libavcodec. * - decoding: unused * * @deprecated use the quality factor packet side data instead */ attribute_deprecated AVFrame *coded_frame; #endif /** * thread count * is used to decide how many independent tasks should be passed to execute() * - encoding: Set by user. * - decoding: Set by user. */ int thread_count; /** * Which multithreading methods to use. * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, * so clients which cannot provide future frames should not use it. * * - encoding: Set by user, otherwise the default is used. * - decoding: Set by user, otherwise the default is used. */ int thread_type; #define FF_THREAD_FRAME 1 ///< Decode more than one frame at once #define FF_THREAD_SLICE 2 ///< Decode more than one part of a single frame at once /** * Which multithreading methods are in use by the codec. * - encoding: Set by libavcodec. * - decoding: Set by libavcodec. */ int active_thread_type; /** * Set by the client if its custom get_buffer() callback can be called * synchronously from another thread, which allows faster multithreaded decoding. * draw_horiz_band() will be called from other threads regardless of this setting. * Ignored if the default get_buffer() is used. * - encoding: Set by user. * - decoding: Set by user. */ int thread_safe_callbacks; /** * The codec may call this to execute several independent things. * It will return only after finishing all tasks. * The user may replace this with some multithreaded implementation, * the default implementation will execute the parts serially. * @param count the number of things to execute * - encoding: Set by libavcodec, user can override. * - decoding: Set by libavcodec, user can override. */ int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size); /** * The codec may call this to execute several independent things. * It will return only after finishing all tasks. * The user may replace this with some multithreaded implementation, * the default implementation will execute the parts serially. * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. * @param c context passed also to func * @param count the number of things to execute * @param arg2 argument passed unchanged to func * @param ret return values of executed functions, must have space for "count" values. May be NULL. * @param func function that will be called count times, with jobnr from 0 to count-1. * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no * two instances of func executing at the same time will have the same threadnr. * @return always 0 currently, but code should handle a future improvement where when any call to func * returns < 0 no further calls to func may be done and < 0 is returned. * - encoding: Set by libavcodec, user can override. * - decoding: Set by libavcodec, user can override. */ int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count); /** * noise vs. sse weight for the nsse comparison function * - encoding: Set by user. * - decoding: unused */ int nsse_weight; /** * profile * - encoding: Set by user. * - decoding: Set by libavcodec. */ int profile; #define FF_PROFILE_UNKNOWN -99 #define FF_PROFILE_RESERVED -100 #define FF_PROFILE_AAC_MAIN 0 #define FF_PROFILE_AAC_LOW 1 #define FF_PROFILE_AAC_SSR 2 #define FF_PROFILE_AAC_LTP 3 #define FF_PROFILE_AAC_HE 4 #define FF_PROFILE_AAC_HE_V2 28 #define FF_PROFILE_AAC_LD 22 #define FF_PROFILE_AAC_ELD 38 #define FF_PROFILE_MPEG2_AAC_LOW 128 #define FF_PROFILE_MPEG2_AAC_HE 131 #define FF_PROFILE_DTS 20 #define FF_PROFILE_DTS_ES 30 #define FF_PROFILE_DTS_96_24 40 #define FF_PROFILE_DTS_HD_HRA 50 #define FF_PROFILE_DTS_HD_MA 60 #define FF_PROFILE_DTS_EXPRESS 70 #define FF_PROFILE_MPEG2_422 0 #define FF_PROFILE_MPEG2_HIGH 1 #define FF_PROFILE_MPEG2_SS 2 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3 #define FF_PROFILE_MPEG2_MAIN 4 #define FF_PROFILE_MPEG2_SIMPLE 5 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag #define FF_PROFILE_H264_BASELINE 66 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED) #define FF_PROFILE_H264_MAIN 77 #define FF_PROFILE_H264_EXTENDED 88 #define FF_PROFILE_H264_HIGH 100 #define FF_PROFILE_H264_HIGH_10 110 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA) #define FF_PROFILE_H264_HIGH_422 122 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA) #define FF_PROFILE_H264_HIGH_444 144 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA) #define FF_PROFILE_H264_CAVLC_444 44 #define FF_PROFILE_VC1_SIMPLE 0 #define FF_PROFILE_VC1_MAIN 1 #define FF_PROFILE_VC1_COMPLEX 2 #define FF_PROFILE_VC1_ADVANCED 3 #define FF_PROFILE_MPEG4_SIMPLE 0 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1 #define FF_PROFILE_MPEG4_CORE 2 #define FF_PROFILE_MPEG4_MAIN 3 #define FF_PROFILE_MPEG4_N_BIT 4 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7 #define FF_PROFILE_MPEG4_HYBRID 8 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 0 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 1 #define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 2 #define FF_PROFILE_JPEG2000_DCINEMA_2K 3 #define FF_PROFILE_JPEG2000_DCINEMA_4K 4 #define FF_PROFILE_VP9_0 0 #define FF_PROFILE_VP9_1 1 #define FF_PROFILE_VP9_2 2 #define FF_PROFILE_VP9_3 3 #define FF_PROFILE_HEVC_MAIN 1 #define FF_PROFILE_HEVC_MAIN_10 2 #define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3 #define FF_PROFILE_HEVC_REXT 4 /** * level * - encoding: Set by user. * - decoding: Set by libavcodec. */ int level; #define FF_LEVEL_UNKNOWN -99 /** * Skip loop filtering for selected frames. * - encoding: unused * - decoding: Set by user. */ enum AVDiscard skip_loop_filter; /** * Skip IDCT/dequantization for selected frames. * - encoding: unused * - decoding: Set by user. */ enum AVDiscard skip_idct; /** * Skip decoding for selected frames. * - encoding: unused * - decoding: Set by user. */ enum AVDiscard skip_frame; /** * Header containing style information for text subtitles. * For SUBTITLE_ASS subtitle type, it should contain the whole ASS * [Script Info] and [V4+ Styles] section, plus the [Events] line and * the Format line following. It shouldn't include any Dialogue line. * - encoding: Set/allocated/freed by user (before avcodec_open2()) * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) */ uint8_t *subtitle_header; int subtitle_header_size; #if FF_API_ERROR_RATE /** * @deprecated use the 'error_rate' private AVOption of the mpegvideo * encoders */ attribute_deprecated int error_rate; #endif #if FF_API_VBV_DELAY /** * VBV delay coded in the last frame (in periods of a 27 MHz clock). * Used for compliant TS muxing. * - encoding: Set by libavcodec. * - decoding: unused. * @deprecated this value is now exported as a part of * AV_PKT_DATA_CPB_PROPERTIES packet side data */ attribute_deprecated uint64_t vbv_delay; #endif #if FF_API_SIDEDATA_ONLY_PKT /** * Encoding only and set by default. Allow encoders to output packets * that do not contain any encoded data, only side data. * * Some encoders need to output such packets, e.g. to update some stream * parameters at the end of encoding. * * @deprecated this field disables the default behaviour and * it is kept only for compatibility. */ attribute_deprecated int side_data_only_packets; #endif /** * Audio only. The number of "priming" samples (padding) inserted by the * encoder at the beginning of the audio. I.e. this number of leading * decoded samples must be discarded by the caller to get the original audio * without leading padding. * * - decoding: unused * - encoding: Set by libavcodec. The timestamps on the output packets are * adjusted by the encoder so that they always refer to the * first sample of the data actually contained in the packet, * including any added padding. E.g. if the timebase is * 1/samplerate and the timestamp of the first input sample is * 0, the timestamp of the first output packet will be * -initial_padding. */ int initial_padding; /** * - decoding: For codecs that store a framerate value in the compressed * bitstream, the decoder may export it here. { 0, 1} when * unknown. * - encoding: unused */ AVRational framerate; /** * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. * - encoding: unused. * - decoding: Set by libavcodec before calling get_format() */ enum AVPixelFormat sw_pix_fmt; /** * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. * Code outside libavcodec should access this field using: * av_codec_{get,set}_pkt_timebase(avctx) * - encoding unused. * - decoding set by user. */ AVRational pkt_timebase; /** * AVCodecDescriptor * Code outside libavcodec should access this field using: * av_codec_{get,set}_codec_descriptor(avctx) * - encoding: unused. * - decoding: set by libavcodec. */ const AVCodecDescriptor *codec_descriptor; #if !FF_API_LOWRES /** * low resolution decoding, 1-> 1/2 size, 2->1/4 size * - encoding: unused * - decoding: Set by user. * Code outside libavcodec should access this field using: * av_codec_{get,set}_lowres(avctx) */ int lowres; #endif /** * Current statistics for PTS correction. * - decoding: maintained and used by libavcodec, not intended to be used by user apps * - encoding: unused */ int64_t pts_correction_num_faulty_pts; /// Number of incorrect PTS values so far int64_t pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far int64_t pts_correction_last_pts; /// PTS of the last frame int64_t pts_correction_last_dts; /// DTS of the last frame /** * Character encoding of the input subtitles file. * - decoding: set by user * - encoding: unused */ char *sub_charenc; /** * Subtitles character encoding mode. Formats or codecs might be adjusting * this setting (if they are doing the conversion themselves for instance). * - decoding: set by libavcodec * - encoding: unused */ int sub_charenc_mode; #define FF_SUB_CHARENC_MODE_DO_NOTHING -1 ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) #define FF_SUB_CHARENC_MODE_AUTOMATIC 0 ///< libavcodec will select the mode itself #define FF_SUB_CHARENC_MODE_PRE_DECODER 1 ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv /** * Skip processing alpha if supported by codec. * Note that if the format uses pre-multiplied alpha (common with VP6, * and recommended due to better video quality/compression) * the image will look as if alpha-blended onto a black background. * However for formats that do not use pre-multiplied alpha * there might be serious artefacts (though e.g. libswscale currently * assumes pre-multiplied alpha anyway). * Code outside libavcodec should access this field using AVOptions * * - decoding: set by user * - encoding: unused */ int skip_alpha; /** * Number of samples to skip after a discontinuity * - decoding: unused * - encoding: set by libavcodec */ int seek_preroll; #if !FF_API_DEBUG_MV /** * debug motion vectors * Code outside libavcodec should access this field using AVOptions * - encoding: Set by user. * - decoding: Set by user. */ int debug_mv; #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames #endif /** * custom intra quantization matrix * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix() * - encoding: Set by user, can be NULL. * - decoding: unused. */ uint16_t *chroma_intra_matrix; /** * dump format separator. * can be ", " or "\n " or anything else * Code outside libavcodec should access this field using AVOptions * (NO direct access). * - encoding: Set by user. * - decoding: Set by user. */ uint8_t *dump_separator; /** * ',' separated list of allowed decoders. * If NULL then all are allowed * - encoding: unused * - decoding: set by user through AVOPtions (NO direct access) */ char *codec_whitelist; /* * Properties of the stream that gets decoded * To be accessed through av_codec_get_properties() (NO direct access) * - encoding: unused * - decoding: set by libavcodec */ unsigned properties; #define FF_CODEC_PROPERTY_LOSSLESS 0x00000001 #define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x00000002 /** * Additional data associated with the entire coded stream. * * - decoding: unused * - encoding: may be set by libavcodec after avcodec_open2(). */ AVPacketSideData *coded_side_data; int nb_coded_side_data; } AVCodecContext; AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx); void av_codec_set_pkt_timebase (AVCodecContext *avctx, AVRational val); const AVCodecDescriptor *av_codec_get_codec_descriptor(const AVCodecContext *avctx); void av_codec_set_codec_descriptor(AVCodecContext *avctx, const AVCodecDescriptor *desc); unsigned av_codec_get_codec_properties(const AVCodecContext *avctx); int av_codec_get_lowres(const AVCodecContext *avctx); void av_codec_set_lowres(AVCodecContext *avctx, int val); int av_codec_get_seek_preroll(const AVCodecContext *avctx); void av_codec_set_seek_preroll(AVCodecContext *avctx, int val); uint16_t *av_codec_get_chroma_intra_matrix(const AVCodecContext *avctx); void av_codec_set_chroma_intra_matrix(AVCodecContext *avctx, uint16_t *val); /** * AVProfile. */ typedef struct AVProfile { int profile; const char *name; ///< short name for the profile } AVProfile; typedef struct AVCodecDefault AVCodecDefault; struct AVSubtitle; /** * AVCodec. */ typedef struct AVCodec { /** * Name of the codec implementation. * The name is globally unique among encoders and among decoders (but an * encoder and a decoder can share the same name). * This is the primary way to find a codec from the user perspective. */ const char *name; /** * Descriptive name for the codec, meant to be more human readable than name. * You should use the NULL_IF_CONFIG_SMALL() macro to define it. */ const char *long_name; enum AVMediaType type; enum AVCodecID id; /** * Codec capabilities. * see AV_CODEC_CAP_* */ int capabilities; const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 uint8_t max_lowres; ///< maximum value for lowres supported by the decoder, no direct access, use av_codec_get_max_lowres() const AVClass *priv_class; ///< AVClass for the private context const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} /***************************************************************** * No fields below this line are part of the public API. They * may not be used outside of libavcodec and can be changed and * removed at will. * New public fields should be added right above. ***************************************************************** */ int priv_data_size; struct AVCodec *next; /** * @name Frame-level threading support functions * @{ */ /** * If defined, called on thread contexts when they are created. * If the codec allocates writable tables in init(), re-allocate them here. * priv_data will be set to a copy of the original. */ int (*init_thread_copy)(AVCodecContext *); /** * Copy necessary context variables from a previous thread context to the current one. * If not defined, the next thread will start automatically; otherwise, the codec * must call ff_thread_finish_setup(). * * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. */ int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src); /** @} */ /** * Private codec-specific defaults. */ const AVCodecDefault *defaults; /** * Initialize codec static data, called from avcodec_register(). */ void (*init_static_data)(struct AVCodec *codec); int (*init)(AVCodecContext *); int (*encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size, const struct AVSubtitle *sub); /** * Encode data to an AVPacket. * * @param avctx codec context * @param avpkt output AVPacket (may contain a user-provided buffer) * @param[in] frame AVFrame containing the raw data to be encoded * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a * non-empty packet was returned in avpkt. * @return 0 on success, negative error code on failure */ int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr); int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt); int (*close)(AVCodecContext *); /** * Flush buffers. * Will be called when seeking */ void (*flush)(AVCodecContext *); /** * Internal codec capabilities. * See FF_CODEC_CAP_* in internal.h */ int caps_internal; } AVCodec; int av_codec_get_max_lowres(const AVCodec *codec); struct MpegEncContext; /** * @defgroup lavc_hwaccel AVHWAccel * @{ */ typedef struct AVHWAccel { /** * Name of the hardware accelerated codec. * The name is globally unique among encoders and among decoders (but an * encoder and a decoder can share the same name). */ const char *name; /** * Type of codec implemented by the hardware accelerator. * * See AVMEDIA_TYPE_xxx */ enum AVMediaType type; /** * Codec implemented by the hardware accelerator. * * See AV_CODEC_ID_xxx */ enum AVCodecID id; /** * Supported pixel format. * * Only hardware accelerated formats are supported here. */ enum AVPixelFormat pix_fmt; /** * Hardware accelerated codec capabilities. * see HWACCEL_CODEC_CAP_* */ int capabilities; /***************************************************************** * No fields below this line are part of the public API. They * may not be used outside of libavcodec and can be changed and * removed at will. * New public fields should be added right above. ***************************************************************** */ struct AVHWAccel *next; /** * Allocate a custom buffer */ int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame); /** * Called at the beginning of each frame or field picture. * * Meaningful frame information (codec specific) is guaranteed to * be parsed at this point. This function is mandatory. * * Note that buf can be NULL along with buf_size set to 0. * Otherwise, this means the whole frame is available at this point. * * @param avctx the codec context * @param buf the frame data buffer base * @param buf_size the size of the frame in bytes * @return zero if successful, a negative value otherwise */ int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); /** * Callback for each slice. * * Meaningful slice information (codec specific) is guaranteed to * be parsed at this point. This function is mandatory. * The only exception is XvMC, that works on MB level. * * @param avctx the codec context * @param buf the slice data buffer base * @param buf_size the size of the slice in bytes * @return zero if successful, a negative value otherwise */ int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); /** * Called at the end of each frame or field picture. * * The whole picture is parsed at this point and can now be sent * to the hardware accelerator. This function is mandatory. * * @param avctx the codec context * @return zero if successful, a negative value otherwise */ int (*end_frame)(AVCodecContext *avctx); /** * Size of per-frame hardware accelerator private data. * * Private data is allocated with av_mallocz() before * AVCodecContext.get_buffer() and deallocated after * AVCodecContext.release_buffer(). */ int frame_priv_data_size; /** * Called for every Macroblock in a slice. * * XvMC uses it to replace the ff_mpv_decode_mb(). * Instead of decoding to raw picture, MB parameters are * stored in an array provided by the video driver. * * @param s the mpeg context */ void (*decode_mb)(struct MpegEncContext *s); /** * Initialize the hwaccel private data. * * This will be called from ff_get_format(), after hwaccel and * hwaccel_context are set and the hwaccel private data in AVCodecInternal * is allocated. */ int (*init)(AVCodecContext *avctx); /** * Uninitialize the hwaccel private data. * * This will be called from get_format() or avcodec_close(), after hwaccel * and hwaccel_context are already uninitialized. */ int (*uninit)(AVCodecContext *avctx); /** * Size of the private data to allocate in * AVCodecInternal.hwaccel_priv_data. */ int priv_data_size; } AVHWAccel; /** * Hardware acceleration should be used for decoding even if the codec level * used is unknown or higher than the maximum supported level reported by the * hardware driver. * * It's generally a good idea to pass this flag unless you have a specific * reason not to, as hardware tends to under-report supported levels. */ #define AV_HWACCEL_FLAG_IGNORE_LEVEL (1 << 0) /** * Hardware acceleration can output YUV pixel formats with a different chroma * sampling than 4:2:0 and/or other than 8 bits per component. */ #define AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH (1 << 1) /** * @} */ #if FF_API_AVPICTURE /** * @defgroup lavc_picture AVPicture * * Functions for working with AVPicture * @{ */ /** * Picture data structure. * * Up to four components can be stored into it, the last component is * alpha. * @deprecated use AVFrame or imgutils functions instead */ typedef struct AVPicture { attribute_deprecated uint8_t *data[AV_NUM_DATA_POINTERS]; ///< pointers to the image data planes attribute_deprecated int linesize[AV_NUM_DATA_POINTERS]; ///< number of bytes per line } AVPicture; /** * @} */ #endif enum AVSubtitleType { SUBTITLE_NONE, SUBTITLE_BITMAP, ///< A bitmap, pict will be set /** * Plain text, the text field must be set by the decoder and is * authoritative. ass and pict fields may contain approximations. */ SUBTITLE_TEXT, /** * Formatted text, the ass field must be set by the decoder and is * authoritative. pict and text fields may contain approximations. */ SUBTITLE_ASS, }; #define AV_SUBTITLE_FLAG_FORCED 0x00000001 typedef struct AVSubtitleRect { int x; ///< top left corner of pict, undefined when pict is not set int y; ///< top left corner of pict, undefined when pict is not set int w; ///< width of pict, undefined when pict is not set int h; ///< height of pict, undefined when pict is not set int nb_colors; ///< number of colors in pict, undefined when pict is not set #if FF_API_AVPICTURE /** * @deprecated unused */ attribute_deprecated AVPicture pict; #endif /** * data+linesize for the bitmap of this subtitle. * Can be set for text/ass as well once they are rendered. */ uint8_t *data[4]; int linesize[4]; enum AVSubtitleType type; char *text; ///< 0 terminated plain UTF-8 text /** * 0 terminated ASS/SSA compatible event line. * The presentation of this is unaffected by the other values in this * struct. */ char *ass; int flags; } AVSubtitleRect; typedef struct AVSubtitle { uint16_t format; /* 0 = graphics */ uint32_t start_display_time; /* relative to packet pts, in ms */ uint32_t end_display_time; /* relative to packet pts, in ms */ unsigned num_rects; AVSubtitleRect **rects; int64_t pts; ///< Same as packet pts, in AV_TIME_BASE } AVSubtitle; /** * If c is NULL, returns the first registered codec, * if c is non-NULL, returns the next registered codec after c, * or NULL if c is the last one. */ AVCodec *av_codec_next(const AVCodec *c); /** * Return the LIBAVCODEC_VERSION_INT constant. */ unsigned avcodec_version(void); /** * Return the libavcodec build-time configuration. */ const char *avcodec_configuration(void); /** * Return the libavcodec license. */ const char *avcodec_license(void); /** * Register the codec codec and initialize libavcodec. * * @warning either this function or avcodec_register_all() must be called * before any other libavcodec functions. * * @see avcodec_register_all() */ void avcodec_register(AVCodec *codec); /** * Register all the codecs, parsers and bitstream filters which were enabled at * configuration time. If you do not call this function you can select exactly * which formats you want to support, by using the individual registration * functions. * * @see avcodec_register * @see av_register_codec_parser * @see av_register_bitstream_filter */ void avcodec_register_all(void); /** * Allocate an AVCodecContext and set its fields to default values. The * resulting struct should be freed with avcodec_free_context(). * * @param codec if non-NULL, allocate private data and initialize defaults * for the given codec. It is illegal to then call avcodec_open2() * with a different codec. * If NULL, then the codec-specific defaults won't be initialized, * which may result in suboptimal default settings (this is * important mainly for encoders, e.g. libx264). * * @return An AVCodecContext filled with default values or NULL on failure. * @see avcodec_get_context_defaults */ AVCodecContext *avcodec_alloc_context3(const AVCodec *codec); /** * Free the codec context and everything associated with it and write NULL to * the provided pointer. */ void avcodec_free_context(AVCodecContext **avctx); /** * Set the fields of the given AVCodecContext to default values corresponding * to the given codec (defaults may be codec-dependent). * * Do not call this function if a non-NULL codec has been passed * to avcodec_alloc_context3() that allocated this AVCodecContext. * If codec is non-NULL, it is illegal to call avcodec_open2() with a * different codec on this AVCodecContext. */ int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec); /** * Get the AVClass for AVCodecContext. It can be used in combination with * AV_OPT_SEARCH_FAKE_OBJ for examining options. * * @see av_opt_find(). */ const AVClass *avcodec_get_class(void); /** * Get the AVClass for AVFrame. It can be used in combination with * AV_OPT_SEARCH_FAKE_OBJ for examining options. * * @see av_opt_find(). */ const AVClass *avcodec_get_frame_class(void); /** * Get the AVClass for AVSubtitleRect. It can be used in combination with * AV_OPT_SEARCH_FAKE_OBJ for examining options. * * @see av_opt_find(). */ const AVClass *avcodec_get_subtitle_rect_class(void); /** * Copy the settings of the source AVCodecContext into the destination * AVCodecContext. The resulting destination codec context will be * unopened, i.e. you are required to call avcodec_open2() before you * can use this AVCodecContext to decode/encode video/audio data. * * @param dest target codec context, should be initialized with * avcodec_alloc_context3(NULL), but otherwise uninitialized * @param src source codec context * @return AVERROR() on error (e.g. memory allocation error), 0 on success */ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src); /** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this * function the context has to be allocated with avcodec_alloc_context3(). * * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for * retrieving a codec. * * @warning This function is not thread safe! * * @note Always call this function before using decoding routines (such as * @ref avcodec_decode_video2()). * * @code * avcodec_register_all(); * av_dict_set(&opts, "b", "2.5M", 0); * codec = avcodec_find_decoder(AV_CODEC_ID_H264); * if (!codec) * exit(1); * * context = avcodec_alloc_context3(codec); * * if (avcodec_open2(context, codec, opts) < 0) * exit(1); * @endcode * * @param avctx The context to initialize. * @param codec The codec to open this context for. If a non-NULL codec has been * previously passed to avcodec_alloc_context3() or * avcodec_get_context_defaults3() for this context, then this * parameter MUST be either NULL or equal to the previously passed * codec. * @param options A dictionary filled with AVCodecContext and codec-private options. * On return this object will be filled with options that were not found. * * @return zero on success, a negative value on error * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), * av_dict_set(), av_opt_find(). */ int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options); /** * Close a given AVCodecContext and free all the data associated with it * (but not the AVCodecContext itself). * * Calling this function on an AVCodecContext that hasn't been opened will free * the codec-specific data allocated in avcodec_alloc_context3() / * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will * do nothing. */ int avcodec_close(AVCodecContext *avctx); /** * Free all allocated data in the given subtitle struct. * * @param sub AVSubtitle to free. */ void avsubtitle_free(AVSubtitle *sub); /** * @} */ /** * @addtogroup lavc_packet * @{ */ /** * Allocate an AVPacket and set its fields to default values. The resulting * struct must be freed using av_packet_free(). * * @return An AVPacket filled with default values or NULL on failure. * * @note this only allocates the AVPacket itself, not the data buffers. Those * must be allocated through other means such as av_new_packet. * * @see av_new_packet */ AVPacket *av_packet_alloc(void); /** * Create a new packet that references the same data as src. * * This is a shortcut for av_packet_alloc()+av_packet_ref(). * * @return newly created AVPacket on success, NULL on error. * * @see av_packet_alloc * @see av_packet_ref */ AVPacket *av_packet_clone(AVPacket *src); /** * Free the packet, if the packet is reference counted, it will be * unreferenced first. * * @param packet packet to be freed. The pointer will be set to NULL. * @note passing NULL is a no-op. */ void av_packet_free(AVPacket **pkt); /** * Initialize optional fields of a packet with default values. * * Note, this does not touch the data and size members, which have to be * initialized separately. * * @param pkt packet */ void av_init_packet(AVPacket *pkt); /** * Allocate the payload of a packet and initialize its fields with * default values. * * @param pkt packet * @param size wanted payload size * @return 0 if OK, AVERROR_xxx otherwise */ int av_new_packet(AVPacket *pkt, int size); /** * Reduce packet size, correctly zeroing padding * * @param pkt packet * @param size new size */ void av_shrink_packet(AVPacket *pkt, int size); /** * Increase packet size, correctly zeroing padding * * @param pkt packet * @param grow_by number of bytes by which to increase the size of the packet */ int av_grow_packet(AVPacket *pkt, int grow_by); /** * Initialize a reference-counted packet from av_malloc()ed data. * * @param pkt packet to be initialized. This function will set the data, size, * buf and destruct fields, all others are left untouched. * @param data Data allocated by av_malloc() to be used as packet data. If this * function returns successfully, the data is owned by the underlying AVBuffer. * The caller may not access the data through other means. * @param size size of data in bytes, without the padding. I.e. the full buffer * size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. * * @return 0 on success, a negative AVERROR on error */ int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size); #if FF_API_AVPACKET_OLD_API /** * @warning This is a hack - the packet memory allocation stuff is broken. The * packet is allocated if it was not really allocated. * * @deprecated Use av_packet_ref */ attribute_deprecated int av_dup_packet(AVPacket *pkt); /** * Copy packet, including contents * * @return 0 on success, negative AVERROR on fail */ int av_copy_packet(AVPacket *dst, const AVPacket *src); /** * Copy packet side data * * @return 0 on success, negative AVERROR on fail */ int av_copy_packet_side_data(AVPacket *dst, const AVPacket *src); /** * Free a packet. * * @deprecated Use av_packet_unref * * @param pkt packet to free */ attribute_deprecated void av_free_packet(AVPacket *pkt); #endif /** * Allocate new information of a packet. * * @param pkt packet * @param type side information type * @param size side information size * @return pointer to fresh allocated data or NULL otherwise */ uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size); /** * Wrap an existing array as a packet side data. * * @param pkt packet * @param type side information type * @param data the side data array. It must be allocated with the av_malloc() * family of functions. The ownership of the data is transferred to * pkt. * @param size side information size * @return a non-negative number on success, a negative AVERROR code on * failure. On failure, the packet is unchanged and the data remains * owned by the caller. */ int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, uint8_t *data, size_t size); /** * Shrink the already allocated side data buffer * * @param pkt packet * @param type side information type * @param size new side information size * @return 0 on success, < 0 on failure */ int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size); /** * Get side information from packet. * * @param pkt packet * @param type desired side information type * @param size pointer for side information size to store (optional) * @return pointer to data if present or NULL otherwise */ uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size); int av_packet_merge_side_data(AVPacket *pkt); int av_packet_split_side_data(AVPacket *pkt); const char *av_packet_side_data_name(enum AVPacketSideDataType type); /** * Pack a dictionary for use in side_data. * * @param dict The dictionary to pack. * @param size pointer to store the size of the returned data * @return pointer to data if successful, NULL otherwise */ uint8_t *av_packet_pack_dictionary(AVDictionary *dict, int *size); /** * Unpack a dictionary from side_data. * * @param data data from side_data * @param size size of the data * @param dict the metadata storage dictionary * @return 0 on success, < 0 on failure */ int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict); /** * Convenience function to free all the side data stored. * All the other fields stay untouched. * * @param pkt packet */ void av_packet_free_side_data(AVPacket *pkt); /** * Setup a new reference to the data described by a given packet * * If src is reference-counted, setup dst as a new reference to the * buffer in src. Otherwise allocate a new buffer in dst and copy the * data from src into it. * * All the other fields are copied from src. * * @see av_packet_unref * * @param dst Destination packet * @param src Source packet * * @return 0 on success, a negative AVERROR on error. */ int av_packet_ref(AVPacket *dst, const AVPacket *src); /** * Wipe the packet. * * Unreference the buffer referenced by the packet and reset the * remaining packet fields to their default values. * * @param pkt The packet to be unreferenced. */ void av_packet_unref(AVPacket *pkt); /** * Move every field in src to dst and reset src. * * @see av_packet_unref * * @param src Source packet, will be reset * @param dst Destination packet */ void av_packet_move_ref(AVPacket *dst, AVPacket *src); /** * Copy only "properties" fields from src to dst. * * Properties for the purpose of this function are all the fields * beside those related to the packet data (buf, data, size) * * @param dst Destination packet * @param src Source packet * * @return 0 on success AVERROR on failure. * */ int av_packet_copy_props(AVPacket *dst, const AVPacket *src); /** * Convert valid timing fields (timestamps / durations) in a packet from one * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be * ignored. * * @param pkt packet on which the conversion will be performed * @param tb_src source timebase, in which the timing fields in pkt are * expressed * @param tb_dst destination timebase, to which the timing fields will be * converted */ void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst); /** * @} */ /** * @addtogroup lavc_decoding * @{ */ /** * Find a registered decoder with a matching codec ID. * * @param id AVCodecID of the requested decoder * @return A decoder if one was found, NULL otherwise. */ AVCodec *avcodec_find_decoder(enum AVCodecID id); /** * Find a registered decoder with the specified name. * * @param name name of the requested decoder * @return A decoder if one was found, NULL otherwise. */ AVCodec *avcodec_find_decoder_by_name(const char *name); /** * The default callback for AVCodecContext.get_buffer2(). It is made public so * it can be called by custom get_buffer2() implementations for decoders without * AV_CODEC_CAP_DR1 set. */ int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags); #if FF_API_EMU_EDGE /** * Return the amount of padding in pixels which the get_buffer callback must * provide around the edge of the image for codecs which do not have the * CODEC_FLAG_EMU_EDGE flag. * * @return Required padding in pixels. * * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer * needed */ attribute_deprecated unsigned avcodec_get_edge_width(void); #endif /** * Modify width and height values so that they will result in a memory * buffer that is acceptable for the codec if you do not use any horizontal * padding. * * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. */ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height); /** * Modify width and height values so that they will result in a memory * buffer that is acceptable for the codec if you also ensure that all * line sizes are a multiple of the respective linesize_align[i]. * * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. */ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS]); /** * Converts AVChromaLocation to swscale x/y chroma position. * * The positions represent the chroma (0,0) position in a coordinates system * with luma (0,0) representing the origin and luma(1,1) representing 256,256 * * @param xpos horizontal chroma sample position * @param ypos vertical chroma sample position */ int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos); /** * Converts swscale x/y chroma position to AVChromaLocation. * * The positions represent the chroma (0,0) position in a coordinates system * with luma (0,0) representing the origin and luma(1,1) representing 256,256 * * @param xpos horizontal chroma sample position * @param ypos vertical chroma sample position */ enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos); /** * Decode the audio frame of size avpkt->size from avpkt->data into frame. * * Some decoders may support multiple frames in a single AVPacket. Such * decoders would then just decode the first frame and the return value would be * less than the packet size. In this case, avcodec_decode_audio4 has to be * called again with an AVPacket containing the remaining data in order to * decode the second frame, etc... Even if no frames are returned, the packet * needs to be fed to the decoder with remaining data until it is completely * consumed or an error occurs. * * Some decoders (those marked with AV_CODEC_CAP_DELAY) have a delay between input * and output. This means that for some packets they will not immediately * produce decoded output and need to be flushed at the end of decoding to get * all the decoded data. Flushing is done by calling this function with packets * with avpkt->data set to NULL and avpkt->size set to 0 until it stops * returning samples. It is safe to flush even those decoders that are not * marked with AV_CODEC_CAP_DELAY, then no samples will be returned. * * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE * larger than the actual read bytes because some optimized bitstream * readers read 32 or 64 bits at once and could read over the end. * * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() * before packets may be fed to the decoder. * * @param avctx the codec context * @param[out] frame The AVFrame in which to store decoded audio samples. * The decoder will allocate a buffer for the decoded frame by * calling the AVCodecContext.get_buffer2() callback. * When AVCodecContext.refcounted_frames is set to 1, the frame is * reference counted and the returned reference belongs to the * caller. The caller must release the frame using av_frame_unref() * when the frame is no longer needed. The caller may safely write * to the frame if av_frame_is_writable() returns 1. * When AVCodecContext.refcounted_frames is set to 0, the returned * reference belongs to the decoder and is valid only until the * next call to this function or until closing or flushing the * decoder. The caller may not write to it. * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is * non-zero. Note that this field being set to zero * does not mean that an error has occurred. For * decoders with AV_CODEC_CAP_DELAY set, no given decode * call is guaranteed to produce a frame. * @param[in] avpkt The input AVPacket containing the input buffer. * At least avpkt->data and avpkt->size should be set. Some * decoders might also require additional fields to be set. * @return A negative error code is returned if an error occurred during * decoding, otherwise the number of bytes consumed from the input * AVPacket is returned. */ int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, const AVPacket *avpkt); /** * Decode the video frame of size avpkt->size from avpkt->data into picture. * Some decoders may support multiple frames in a single AVPacket, such * decoders would then just decode the first frame. * * @warning The input buffer must be AV_INPUT_BUFFER_PADDING_SIZE larger than * the actual read bytes because some optimized bitstream readers read 32 or 64 * bits at once and could read over the end. * * @warning The end of the input buffer buf should be set to 0 to ensure that * no overreading happens for damaged MPEG streams. * * @note Codecs which have the AV_CODEC_CAP_DELAY capability set have a delay * between input and output, these need to be fed with avpkt->data=NULL, * avpkt->size=0 at the end to return the remaining frames. * * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() * before packets may be fed to the decoder. * * @param avctx the codec context * @param[out] picture The AVFrame in which the decoded video frame will be stored. * Use av_frame_alloc() to get an AVFrame. The codec will * allocate memory for the actual bitmap by calling the * AVCodecContext.get_buffer2() callback. * When AVCodecContext.refcounted_frames is set to 1, the frame is * reference counted and the returned reference belongs to the * caller. The caller must release the frame using av_frame_unref() * when the frame is no longer needed. The caller may safely write * to the frame if av_frame_is_writable() returns 1. * When AVCodecContext.refcounted_frames is set to 0, the returned * reference belongs to the decoder and is valid only until the * next call to this function or until closing or flushing the * decoder. The caller may not write to it. * * @param[in] avpkt The input AVPacket containing the input buffer. * You can create such packet with av_init_packet() and by then setting * data and size, some decoders might in addition need other fields like * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least * fields possible. * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. * @return On error a negative value is returned, otherwise the number of bytes * used or zero if no frame could be decompressed. */ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const AVPacket *avpkt); /** * Decode a subtitle message. * Return a negative value on error, otherwise return the number of bytes used. * If no subtitle could be decompressed, got_sub_ptr is zero. * Otherwise, the subtitle is stored in *sub. * Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for * simplicity, because the performance difference is expect to be negligible * and reusing a get_buffer written for video codecs would probably perform badly * due to a potentially very different allocation pattern. * * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input * and output. This means that for some packets they will not immediately * produce decoded output and need to be flushed at the end of decoding to get * all the decoded data. Flushing is done by calling this function with packets * with avpkt->data set to NULL and avpkt->size set to 0 until it stops * returning subtitles. It is safe to flush even those decoders that are not * marked with CODEC_CAP_DELAY, then no subtitles will be returned. * * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() * before packets may be fed to the decoder. * * @param avctx the codec context * @param[out] sub The Preallocated AVSubtitle in which the decoded subtitle will be stored, * must be freed with avsubtitle_free if *got_sub_ptr is set. * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. * @param[in] avpkt The input AVPacket containing the input buffer. */ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt); /** * @defgroup lavc_parsing Frame parsing * @{ */ enum AVPictureStructure { AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field AV_PICTURE_STRUCTURE_FRAME, //< coded as frame }; typedef struct AVCodecParserContext { void *priv_data; struct AVCodecParser *parser; int64_t frame_offset; /* offset of the current frame */ int64_t cur_offset; /* current offset (incremented by each av_parser_parse()) */ int64_t next_frame_offset; /* offset of the next frame */ /* video info */ int pict_type; /* XXX: Put it back in AVCodecContext. */ /** * This field is used for proper frame duration computation in lavf. * It signals, how much longer the frame duration of the current frame * is compared to normal frame duration. * * frame_duration = (1 + repeat_pict) * time_base * * It is used by codecs like H.264 to display telecined material. */ int repeat_pict; /* XXX: Put it back in AVCodecContext. */ int64_t pts; /* pts of the current frame */ int64_t dts; /* dts of the current frame */ /* private data */ int64_t last_pts; int64_t last_dts; int fetch_timestamp; #define AV_PARSER_PTS_NB 4 int cur_frame_start_index; int64_t cur_frame_offset[AV_PARSER_PTS_NB]; int64_t cur_frame_pts[AV_PARSER_PTS_NB]; int64_t cur_frame_dts[AV_PARSER_PTS_NB]; int flags; #define PARSER_FLAG_COMPLETE_FRAMES 0x0001 #define PARSER_FLAG_ONCE 0x0002 /// Set if the parser has a valid file offset #define PARSER_FLAG_FETCHED_OFFSET 0x0004 #define PARSER_FLAG_USE_CODEC_TS 0x1000 int64_t offset; ///< byte offset from starting packet start int64_t cur_frame_end[AV_PARSER_PTS_NB]; /** * Set by parser to 1 for key frames and 0 for non-key frames. * It is initialized to -1, so if the parser doesn't set this flag, * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames * will be used. */ int key_frame; #if FF_API_CONVERGENCE_DURATION /** * @deprecated unused */ attribute_deprecated int64_t convergence_duration; #endif // Timestamp generation support: /** * Synchronization point for start of timestamp generation. * * Set to >0 for sync point, 0 for no sync point and <0 for undefined * (default). * * For example, this corresponds to presence of H.264 buffering period * SEI message. */ int dts_sync_point; /** * Offset of the current timestamp against last timestamp sync point in * units of AVCodecContext.time_base. * * Set to INT_MIN when dts_sync_point unused. Otherwise, it must * contain a valid timestamp offset. * * Note that the timestamp of sync point has usually a nonzero * dts_ref_dts_delta, which refers to the previous sync point. Offset of * the next frame after timestamp sync point will be usually 1. * * For example, this corresponds to H.264 cpb_removal_delay. */ int dts_ref_dts_delta; /** * Presentation delay of current frame in units of AVCodecContext.time_base. * * Set to INT_MIN when dts_sync_point unused. Otherwise, it must * contain valid non-negative timestamp delta (presentation time of a frame * must not lie in the past). * * This delay represents the difference between decoding and presentation * time of the frame. * * For example, this corresponds to H.264 dpb_output_delay. */ int pts_dts_delta; /** * Position of the packet in file. * * Analogous to cur_frame_pts/dts */ int64_t cur_frame_pos[AV_PARSER_PTS_NB]; /** * Byte position of currently parsed frame in stream. */ int64_t pos; /** * Previous frame byte position. */ int64_t last_pos; /** * Duration of the current frame. * For audio, this is in units of 1 / AVCodecContext.sample_rate. * For all other types, this is in units of AVCodecContext.time_base. */ int duration; enum AVFieldOrder field_order; /** * Indicate whether a picture is coded as a frame, top field or bottom field. * * For example, H.264 field_pic_flag equal to 0 corresponds to * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag * equal to 1 and bottom_field_flag equal to 0 corresponds to * AV_PICTURE_STRUCTURE_TOP_FIELD. */ enum AVPictureStructure picture_structure; /** * Picture number incremented in presentation or output order. * This field may be reinitialized at the first picture of a new sequence. * * For example, this corresponds to H.264 PicOrderCnt. */ int output_picture_number; /** * Dimensions of the decoded video intended for presentation. */ int width; int height; /** * Dimensions of the coded video. */ int coded_width; int coded_height; /** * The format of the coded data, corresponds to enum AVPixelFormat for video * and for enum AVSampleFormat for audio. * * Note that a decoder can have considerable freedom in how exactly it * decodes the data, so the format reported here might be different from the * one returned by a decoder. */ int format; } AVCodecParserContext; typedef struct AVCodecParser { int codec_ids[5]; /* several codec IDs are permitted */ int priv_data_size; int (*parser_init)(AVCodecParserContext *s); /* This callback never returns an error, a negative value means that * the frame start was in a previous packet. */ int (*parser_parse)(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size); void (*parser_close)(AVCodecParserContext *s); int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size); struct AVCodecParser *next; } AVCodecParser; AVCodecParser *av_parser_next(const AVCodecParser *c); void av_register_codec_parser(AVCodecParser *parser); AVCodecParserContext *av_parser_init(int codec_id); /** * Parse a packet. * * @param s parser context. * @param avctx codec context. * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. * @param buf input buffer. * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). * @param pts input presentation timestamp. * @param dts input decoding timestamp. * @param pos input byte position in stream. * @return the number of bytes of the input bitstream used. * * Example: * @code * while(in_len){ * len = av_parser_parse2(myparser, AVCodecContext, &data, &size, * in_data, in_len, * pts, dts, pos); * in_data += len; * in_len -= len; * * if(size) * decode_frame(data, size); * } * @endcode */ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int64_t pts, int64_t dts, int64_t pos); /** * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed * @deprecated use AVBitStreamFilter */ int av_parser_change(AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe); void av_parser_close(AVCodecParserContext *s); /** * @} * @} */ /** * @addtogroup lavc_encoding * @{ */ /** * Find a registered encoder with a matching codec ID. * * @param id AVCodecID of the requested encoder * @return An encoder if one was found, NULL otherwise. */ AVCodec *avcodec_find_encoder(enum AVCodecID id); /** * Find a registered encoder with the specified name. * * @param name name of the requested encoder * @return An encoder if one was found, NULL otherwise. */ AVCodec *avcodec_find_encoder_by_name(const char *name); /** * Encode a frame of audio. * * Takes input samples from frame and writes the next output packet, if * available, to avpkt. The output packet does not necessarily contain data for * the most recent frame, as encoders can delay, split, and combine input frames * internally as needed. * * @param avctx codec context * @param avpkt output AVPacket. * The user can supply an output buffer by setting * avpkt->data and avpkt->size prior to calling the * function, but if the size of the user-provided data is not * large enough, encoding will fail. If avpkt->data and * avpkt->size are set, avpkt->destruct must also be set. All * other AVPacket fields will be reset by the encoder using * av_init_packet(). If avpkt->data is NULL, the encoder will * allocate it. The encoder will set avpkt->size to the size * of the output packet. * * If this function fails or produces no output, avpkt will be * freed using av_packet_unref(). * @param[in] frame AVFrame containing the raw audio data to be encoded. * May be NULL when flushing an encoder that has the * AV_CODEC_CAP_DELAY capability set. * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame * can have any number of samples. * If it is not set, frame->nb_samples must be equal to * avctx->frame_size for all frames except the last. * The final frame may be smaller than avctx->frame_size. * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the * output packet is non-empty, and to 0 if it is * empty. If the function returns an error, the * packet can be assumed to be invalid, and the * value of got_packet_ptr is undefined and should * not be used. * @return 0 on success, negative error code on failure */ int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr); /** * Encode a frame of video. * * Takes input raw video data from frame and writes the next output packet, if * available, to avpkt. The output packet does not necessarily contain data for * the most recent frame, as encoders can delay and reorder input frames * internally as needed. * * @param avctx codec context * @param avpkt output AVPacket. * The user can supply an output buffer by setting * avpkt->data and avpkt->size prior to calling the * function, but if the size of the user-provided data is not * large enough, encoding will fail. All other AVPacket fields * will be reset by the encoder using av_init_packet(). If * avpkt->data is NULL, the encoder will allocate it. * The encoder will set avpkt->size to the size of the * output packet. The returned data (if any) belongs to the * caller, he is responsible for freeing it. * * If this function fails or produces no output, avpkt will be * freed using av_packet_unref(). * @param[in] frame AVFrame containing the raw video data to be encoded. * May be NULL when flushing an encoder that has the * AV_CODEC_CAP_DELAY capability set. * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the * output packet is non-empty, and to 0 if it is * empty. If the function returns an error, the * packet can be assumed to be invalid, and the * value of got_packet_ptr is undefined and should * not be used. * @return 0 on success, negative error code on failure */ int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr); int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVSubtitle *sub); /** * @} */ #if FF_API_AVCODEC_RESAMPLE /** * @defgroup lavc_resample Audio resampling * @ingroup libavc * @deprecated use libswresample instead * * @{ */ struct ReSampleContext; struct AVResampleContext; typedef struct ReSampleContext ReSampleContext; /** * Initialize audio resampling context. * * @param output_channels number of output channels * @param input_channels number of input channels * @param output_rate output sample rate * @param input_rate input sample rate * @param sample_fmt_out requested output sample format * @param sample_fmt_in input sample format * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency * @param log2_phase_count log2 of the number of entries in the polyphase filterbank * @param linear if 1 then the used FIR filter will be linearly interpolated between the 2 closest, if 0 the closest will be used * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate * @return allocated ReSampleContext, NULL if error occurred */ attribute_deprecated ReSampleContext *av_audio_resample_init(int output_channels, int input_channels, int output_rate, int input_rate, enum AVSampleFormat sample_fmt_out, enum AVSampleFormat sample_fmt_in, int filter_length, int log2_phase_count, int linear, double cutoff); attribute_deprecated int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples); /** * Free resample context. * * @param s a non-NULL pointer to a resample context previously * created with av_audio_resample_init() */ attribute_deprecated void audio_resample_close(ReSampleContext *s); /** * Initialize an audio resampler. * Note, if either rate is not an integer then simply scale both rates up so they are. * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq * @param log2_phase_count log2 of the number of entries in the polyphase filterbank * @param linear If 1 then the used FIR filter will be linearly interpolated between the 2 closest, if 0 the closest will be used * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate */ attribute_deprecated struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff); /** * Resample an array of samples using a previously configured context. * @param src an array of unconsumed samples * @param consumed the number of samples of src which have been consumed are returned here * @param src_size the number of unconsumed samples available * @param dst_size the amount of space in samples available in dst * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. * @return the number of samples written in dst or -1 if an error occurred */ attribute_deprecated int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx); /** * Compensate samplerate/timestamp drift. The compensation is done by changing * the resampler parameters, so no audible clicks or similar distortions occur * @param compensation_distance distance in output samples over which the compensation should be performed * @param sample_delta number of output samples which should be output less * * example: av_resample_compensate(c, 10, 500) * here instead of 510 samples only 500 samples would be output * * note, due to rounding the actual compensation might be slightly different, * especially if the compensation_distance is large and the in_rate used during init is small */ attribute_deprecated void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance); attribute_deprecated void av_resample_close(struct AVResampleContext *c); /** * @} */ #endif #if FF_API_AVPICTURE /** * @addtogroup lavc_picture * @{ */ /** * @deprecated unused */ attribute_deprecated int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height); /** * @deprecated unused */ attribute_deprecated void avpicture_free(AVPicture *picture); /** * @deprecated use av_image_fill_arrays() instead. */ attribute_deprecated int avpicture_fill(AVPicture *picture, const uint8_t *ptr, enum AVPixelFormat pix_fmt, int width, int height); /** * @deprecated use av_image_copy_to_buffer() instead. */ attribute_deprecated int avpicture_layout(const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height, unsigned char *dest, int dest_size); /** * @deprecated use av_image_get_buffer_size() instead. */ attribute_deprecated int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height); /** * @deprecated av_image_copy() instead. */ attribute_deprecated void av_picture_copy(AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height); /** * @deprecated unused */ attribute_deprecated int av_picture_crop(AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int top_band, int left_band); /** * @deprecated unused */ attribute_deprecated int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright, int *color); /** * @} */ #endif /** * @defgroup lavc_misc Utility functions * @ingroup libavc * * Miscellaneous utility functions related to both encoding and decoding * (or neither). * @{ */ /** * @defgroup lavc_misc_pixfmt Pixel formats * * Functions for working with pixel formats. * @{ */ /** * Utility function to access log2_chroma_w log2_chroma_h from * the pixel format AVPixFmtDescriptor. * * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample * for one that returns a failure code and continues in case of invalid * pix_fmts. * * @param[in] pix_fmt the pixel format * @param[out] h_shift store log2_chroma_w * @param[out] v_shift store log2_chroma_h * * @see av_pix_fmt_get_chroma_sub_sample */ void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift); /** * Return a value representing the fourCC code associated to the * pixel format pix_fmt, or 0 if no associated fourCC code can be * found. */ unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt); /** * @deprecated see av_get_pix_fmt_loss() */ int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt, int has_alpha); /** * Find the best pixel format to convert to given a certain source pixel * format. When converting from one pixel format to another, information loss * may occur. For example, when converting from RGB24 to GRAY, the color * information will be lost. Similarly, other losses occur when converting from * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of * the given pixel formats should be used to suffer the least amount of loss. * The pixel formats from which it chooses one, are determined by the * pix_fmt_list parameter. * * * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from * @param[in] src_pix_fmt source pixel format * @param[in] has_alpha Whether the source pixel format alpha channel is used. * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. * @return The best pixel format to convert to or -1 if none was found. */ enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(const enum AVPixelFormat *pix_fmt_list, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); /** * @deprecated see av_find_best_pix_fmt_of_2() */ enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); attribute_deprecated #if AV_HAVE_INCOMPATIBLE_LIBAV_ABI enum AVPixelFormat avcodec_find_best_pix_fmt2(const enum AVPixelFormat *pix_fmt_list, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); #else enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); #endif enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt); /** * @} */ #if FF_API_SET_DIMENSIONS /** * @deprecated this function is not supposed to be used from outside of lavc */ attribute_deprecated void avcodec_set_dimensions(AVCodecContext *s, int width, int height); #endif /** * Put a string representing the codec tag codec_tag in buf. * * @param buf buffer to place codec tag in * @param buf_size size in bytes of buf * @param codec_tag codec tag to assign * @return the length of the string that would have been generated if * enough space had been available, excluding the trailing null */ size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag); void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode); /** * Return a name for the specified profile, if available. * * @param codec the codec that is searched for the given profile * @param profile the profile value for which a name is requested * @return A name for the profile if found, NULL otherwise. */ const char *av_get_profile_name(const AVCodec *codec, int profile); /** * Return a name for the specified profile, if available. * * @param codec_id the ID of the codec to which the requested profile belongs * @param profile the profile value for which a name is requested * @return A name for the profile if found, NULL otherwise. * * @note unlike av_get_profile_name(), which searches a list of profiles * supported by a specific decoder or encoder implementation, this * function searches the list of profiles from the AVCodecDescriptor */ const char *avcodec_profile_name(enum AVCodecID codec_id, int profile); int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size); int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count); //FIXME func typedef /** * Fill AVFrame audio data and linesize pointers. * * The buffer buf must be a preallocated buffer with a size big enough * to contain the specified samples amount. The filled AVFrame data * pointers will point to this buffer. * * AVFrame extended_data channel pointers are allocated if necessary for * planar audio. * * @param frame the AVFrame * frame->nb_samples must be set prior to calling the * function. This function fills in frame->data, * frame->extended_data, frame->linesize[0]. * @param nb_channels channel count * @param sample_fmt sample format * @param buf buffer to use for frame data * @param buf_size size of buffer * @param align plane size sample alignment (0 = default) * @return >=0 on success, negative error code on failure * @todo return the size in bytes required to store the samples in * case of success, at the next libavutil bump */ int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, int buf_size, int align); /** * Reset the internal decoder state / flush internal buffers. Should be called * e.g. when seeking or when switching to a different stream. * * @note when refcounted frames are not used (i.e. avctx->refcounted_frames is 0), * this invalidates the frames previously returned from the decoder. When * refcounted frames are used, the decoder just releases any references it might * keep internally, but the caller's reference remains valid. */ void avcodec_flush_buffers(AVCodecContext *avctx); /** * Return codec bits per sample. * * @param[in] codec_id the codec * @return Number of bits per sample or zero if unknown for the given codec. */ int av_get_bits_per_sample(enum AVCodecID codec_id); /** * Return the PCM codec associated with a sample format. * @param be endianness, 0 for little, 1 for big, * -1 (or anything else) for native * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE */ enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be); /** * Return codec bits per sample. * Only return non-zero if the bits per sample is exactly correct, not an * approximation. * * @param[in] codec_id the codec * @return Number of bits per sample or zero if unknown for the given codec. */ int av_get_exact_bits_per_sample(enum AVCodecID codec_id); /** * Return audio frame duration. * * @param avctx codec context * @param frame_bytes size of the frame, or 0 if unknown * @return frame duration, in samples, if known. 0 if not able to * determine. */ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes); typedef struct AVBitStreamFilterContext { void *priv_data; struct AVBitStreamFilter *filter; AVCodecParserContext *parser; struct AVBitStreamFilterContext *next; /** * Internal default arguments, used if NULL is passed to av_bitstream_filter_filter(). * Not for access by library users. */ char *args; } AVBitStreamFilterContext; typedef struct AVBitStreamFilter { const char *name; int priv_data_size; int (*filter)(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe); void (*close)(AVBitStreamFilterContext *bsfc); struct AVBitStreamFilter *next; } AVBitStreamFilter; /** * Register a bitstream filter. * * The filter will be accessible to the application code through * av_bitstream_filter_next() or can be directly initialized with * av_bitstream_filter_init(). * * @see avcodec_register_all() */ void av_register_bitstream_filter(AVBitStreamFilter *bsf); /** * Create and initialize a bitstream filter context given a bitstream * filter name. * * The returned context must be freed with av_bitstream_filter_close(). * * @param name the name of the bitstream filter * @return a bitstream filter context if a matching filter was found * and successfully initialized, NULL otherwise */ AVBitStreamFilterContext *av_bitstream_filter_init(const char *name); /** * Filter bitstream. * * This function filters the buffer buf with size buf_size, and places the * filtered buffer in the buffer pointed to by poutbuf. * * The output buffer must be freed by the caller. * * @param bsfc bitstream filter context created by av_bitstream_filter_init() * @param avctx AVCodecContext accessed by the filter, may be NULL. * If specified, this must point to the encoder context of the * output stream the packet is sent to. * @param args arguments which specify the filter configuration, may be NULL * @param poutbuf pointer which is updated to point to the filtered buffer * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes * @param buf buffer containing the data to filter * @param buf_size size in bytes of buf * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data * @return >= 0 in case of success, or a negative error code in case of failure * * If the return value is positive, an output buffer is allocated and * is available in *poutbuf, and is distinct from the input buffer. * * If the return value is 0, the output buffer is not allocated and * should be considered identical to the input buffer, or in case * *poutbuf was set it points to the input buffer (not necessarily to * its starting address). */ int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe); /** * Release bitstream filter context. * * @param bsf the bitstream filter context created with * av_bitstream_filter_init(), can be NULL */ void av_bitstream_filter_close(AVBitStreamFilterContext *bsf); /** * If f is NULL, return the first registered bitstream filter, * if f is non-NULL, return the next registered bitstream filter * after f, or NULL if f is the last one. * * This function can be used to iterate over all registered bitstream * filters. */ AVBitStreamFilter *av_bitstream_filter_next(const AVBitStreamFilter *f); /* memory */ /** * Same behaviour av_fast_malloc but the buffer has additional * AV_INPUT_BUFFER_PADDING_SIZE at the end which will always be 0. * * In addition the whole buffer will initially and after resizes * be 0-initialized so that no uninitialized data will ever appear. */ void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size); /** * Same behaviour av_fast_padded_malloc except that buffer will always * be 0-initialized after call. */ void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size); /** * Encode extradata length to a buffer. Used by xiph codecs. * * @param s buffer to write to; must be at least (v/255+1) bytes long * @param v size of extradata in bytes * @return number of bytes written to the buffer. */ unsigned int av_xiphlacing(unsigned char *s, unsigned int v); #if FF_API_MISSING_SAMPLE /** * Log a generic warning message about a missing feature. This function is * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) * only, and would normally not be used by applications. * @param[in] avc a pointer to an arbitrary struct of which the first field is * a pointer to an AVClass struct * @param[in] feature string containing the name of the missing feature * @param[in] want_sample indicates if samples are wanted which exhibit this feature. * If want_sample is non-zero, additional verbage will be added to the log * message which tells the user how to report samples to the development * mailing list. * @deprecated Use avpriv_report_missing_feature() instead. */ attribute_deprecated void av_log_missing_feature(void *avc, const char *feature, int want_sample); /** * Log a generic warning message asking for a sample. This function is * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) * only, and would normally not be used by applications. * @param[in] avc a pointer to an arbitrary struct of which the first field is * a pointer to an AVClass struct * @param[in] msg string containing an optional message, or NULL if no message * @deprecated Use avpriv_request_sample() instead. */ attribute_deprecated void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3); #endif /* FF_API_MISSING_SAMPLE */ /** * Register the hardware accelerator hwaccel. */ void av_register_hwaccel(AVHWAccel *hwaccel); /** * If hwaccel is NULL, returns the first registered hardware accelerator, * if hwaccel is non-NULL, returns the next registered hardware accelerator * after hwaccel, or NULL if hwaccel is the last one. */ AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel); /** * Lock operation used by lockmgr */ enum AVLockOp { AV_LOCK_CREATE, ///< Create a mutex AV_LOCK_OBTAIN, ///< Lock the mutex AV_LOCK_RELEASE, ///< Unlock the mutex AV_LOCK_DESTROY, ///< Free mutex resources }; /** * Register a user provided lock manager supporting the operations * specified by AVLockOp. The "mutex" argument to the function points * to a (void *) where the lockmgr should store/get a pointer to a user * allocated mutex. It is NULL upon AV_LOCK_CREATE and equal to the * value left by the last call for all other ops. If the lock manager is * unable to perform the op then it should leave the mutex in the same * state as when it was called and return a non-zero value. However, * when called with AV_LOCK_DESTROY the mutex will always be assumed to * have been successfully destroyed. If av_lockmgr_register succeeds * it will return a non-negative value, if it fails it will return a * negative value and destroy all mutex and unregister all callbacks. * av_lockmgr_register is not thread-safe, it must be called from a * single thread before any calls which make use of locking are used. * * @param cb User defined callback. av_lockmgr_register invokes calls * to this callback and the previously registered callback. * The callback will be used to create more than one mutex * each of which must be backed by its own underlying locking * mechanism (i.e. do not use a single static object to * implement your lock manager). If cb is set to NULL the * lockmgr will be unregistered. */ int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)); /** * Get the type of the given codec. */ enum AVMediaType avcodec_get_type(enum AVCodecID codec_id); /** * Get the name of a codec. * @return a static string identifying the codec; never NULL */ const char *avcodec_get_name(enum AVCodecID id); /** * @return a positive value if s is open (i.e. avcodec_open2() was called on it * with no corresponding avcodec_close()), 0 otherwise. */ int avcodec_is_open(AVCodecContext *s); /** * @return a non-zero number if codec is an encoder, zero otherwise */ int av_codec_is_encoder(const AVCodec *codec); /** * @return a non-zero number if codec is a decoder, zero otherwise */ int av_codec_is_decoder(const AVCodec *codec); /** * @return descriptor for given codec ID or NULL if no descriptor exists. */ const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id); /** * Iterate over all codec descriptors known to libavcodec. * * @param prev previous descriptor. NULL to get the first descriptor. * * @return next descriptor or NULL after the last descriptor */ const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev); /** * @return codec descriptor with the given name or NULL if no such descriptor * exists. */ const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name); /** * Allocate a CPB properties structure and initialize its fields to default * values. * * @param size if non-NULL, the size of the allocated struct will be written * here. This is useful for embedding it in side data. * * @return the newly allocated struct or NULL on failure */ AVCPBProperties *av_cpb_properties_alloc(size_t *size); /** * @} */ #endif /* AVCODEC_AVCODEC_H */
{ "content_hash": "7cd0e33f1d64cb9d07635d848c45d51e", "timestamp": "", "source": "github", "line_count": 5385, "max_line_length": 155, "avg_line_length": 32.76285979572888, "alnum_prop": 0.6561203437096153, "repo_name": "hzdetu/panoplayer_ios_static", "id": "3c83c012f56bd332f0bce464f5ca0de52137a651", "size": "177231", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "lib/IJKMediaFramework.framework/Headers/libavcodec/avcodec.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1211890" }, { "name": "C++", "bytes": "50965" }, { "name": "DTrace", "bytes": "412" }, { "name": "GLSL", "bytes": "7884" }, { "name": "Objective-C", "bytes": "1294289" }, { "name": "Objective-C++", "bytes": "5559" }, { "name": "Ruby", "bytes": "1505" } ], "symlink_target": "" }
๏ปฟusing System; using System.Collections.Generic; using System.Text; using System.Threading; using System.Threading.Tasks; namespace BLTools { /// <summary> /// Wait for a condition to be met or timeout /// </summary> public class TConditionAwaiter : AConditionAwaiter { protected Func<bool> _Condition; /// <summary> /// Wait for a condition to be met or timeout /// </summary> /// <param name="condition">The condition to evaluate</param> /// <param name="timeoutInMsec">The timeout in msec</param> public TConditionAwaiter(Func<bool> condition, long timeoutInMsec) { _Condition = condition; TimeoutInMsec = timeoutInMsec; } /// <summary> /// Start the wait process /// </summary> /// <param name="pollingDelayInMsec">Delay in ms to wait between evalution of the condition</param> /// <returns>true if condition was met, false if timeout</returns> public bool Execute(int pollingDelayInMsec = 5) { DateTime StartTime = DateTime.Now; bool RetVal = _Condition(); double _AwaitedDuration = ( DateTime.Now - StartTime ).TotalMilliseconds; while (!RetVal && _AwaitedDuration < TimeoutInMsec) { Thread.Sleep(pollingDelayInMsec); RetVal = _Condition(); _AwaitedDuration = (DateTime.Now - StartTime).TotalMilliseconds; } return RetVal; } /// <summary> /// Start the wait process asynchronously /// </summary> /// <param name="pollingDelayInMsec">Delay in ms to wait between evalution of the condition</param> /// <returns>true if condition was met, false if timeout</returns> public async Task<bool> ExecuteAsync(int pollingDelayInMsec = 5) { DateTime StartTime = DateTime.Now; bool RetVal = _Condition(); double _AwaitedDuration = (DateTime.Now - StartTime).TotalMilliseconds; while (!RetVal && _AwaitedDuration < TimeoutInMsec) { await Task.Delay(pollingDelayInMsec).ConfigureAwait(false); RetVal = _Condition(); _AwaitedDuration = (DateTime.Now - StartTime).TotalMilliseconds; } return RetVal; } } /// <summary> /// Wait for a condition to be met or timeout /// </summary> public class TConditionAwaiter<T> : AConditionAwaiter { protected Predicate<T> _Predicate; /// <summary> /// Wait for a condition to be met or timeout /// </summary> /// <param name="predicate">The predicate to evaluate</param> /// <param name="timeoutInMsec">The timeout in msec</param> public TConditionAwaiter(Predicate<T> predicate, long timeoutInMsec) { _Predicate = predicate; TimeoutInMsec = timeoutInMsec; } /// <summary> /// Start the wait process /// </summary> /// <param name="source">The reference to an object used to the predicate evaluation</param> /// <param name="pollingDelayInMsec">Delay in ms to wait between evalution of the condition</param> /// <returns>true if condition was met, false if timeout</returns> public bool Execute(T source, int pollingDelayInMsec = 5) { DateTime StartTime = DateTime.Now; bool RetVal = _Predicate(source); double _AwaitedDuration = ( DateTime.Now - StartTime ).TotalMilliseconds; while ( !RetVal && _AwaitedDuration < TimeoutInMsec ) { Thread.Sleep(pollingDelayInMsec); RetVal = _Predicate(source); _AwaitedDuration = ( DateTime.Now - StartTime ).TotalMilliseconds; } return RetVal; } /// <summary> /// Start the wait process asynchronously /// </summary> /// <param name="source">The reference to an object used to the predicate evaluation</param> /// <param name="pollingDelayInMsec">Delay in ms to wait between evalution of the condition</param> /// <returns>true if condition was met, false if timeout</returns> public async Task<bool> ExecuteAsync(T source, int pollingDelayInMsec = 5) { DateTime StartTime = DateTime.Now; bool RetVal = _Predicate(source); double _AwaitedDuration = ( DateTime.Now - StartTime ).TotalMilliseconds; while ( !RetVal && _AwaitedDuration < TimeoutInMsec ) { await Task.Delay(pollingDelayInMsec).ConfigureAwait(false); RetVal = _Predicate(source); _AwaitedDuration = ( DateTime.Now - StartTime ).TotalMilliseconds; } return RetVal; } } }
{ "content_hash": "e3231d376dd15022fffa8028d44b4961", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 107, "avg_line_length": 36.52205882352941, "alnum_prop": 0.585262734044695, "repo_name": "bollylu/BLTools.dns.20", "id": "dbeba92a30b54beaeeb0d24b4858b2b62090cea1", "size": "4969", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "BLTools Dot Net Std 2.0/Actions and functions/Awaiters and monitors/TConditionAwaiter.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1151124" } ], "symlink_target": "" }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.network.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.network.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** NetworkSecurityGroup resource. */ @JsonFlatten @Fluent public class NetworkSecurityGroupInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupInner.class); /* * A unique read-only string that changes whenever the resource is updated. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /* * A collection of security rules of the network security group. */ @JsonProperty(value = "properties.securityRules") private List<SecurityRuleInner> securityRules; /* * The default security rules of network security group. */ @JsonProperty(value = "properties.defaultSecurityRules", access = JsonProperty.Access.WRITE_ONLY) private List<SecurityRuleInner> defaultSecurityRules; /* * A collection of references to network interfaces. */ @JsonProperty(value = "properties.networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) private List<NetworkInterfaceInner> networkInterfaces; /* * A collection of references to subnets. */ @JsonProperty(value = "properties.subnets", access = JsonProperty.Access.WRITE_ONLY) private List<SubnetInner> subnets; /* * A collection of references to flow log resources. */ @JsonProperty(value = "properties.flowLogs", access = JsonProperty.Access.WRITE_ONLY) private List<FlowLogInner> flowLogs; /* * The resource GUID property of the network security group resource. */ @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) private String resourceGuid; /* * The provisioning state of the network security group resource. */ @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * Resource ID. */ @JsonProperty(value = "id") private String id; /** * Get the etag property: A unique read-only string that changes whenever the resource is updated. * * @return the etag value. */ public String etag() { return this.etag; } /** * Get the securityRules property: A collection of security rules of the network security group. * * @return the securityRules value. */ public List<SecurityRuleInner> securityRules() { return this.securityRules; } /** * Set the securityRules property: A collection of security rules of the network security group. * * @param securityRules the securityRules value to set. * @return the NetworkSecurityGroupInner object itself. */ public NetworkSecurityGroupInner withSecurityRules(List<SecurityRuleInner> securityRules) { this.securityRules = securityRules; return this; } /** * Get the defaultSecurityRules property: The default security rules of network security group. * * @return the defaultSecurityRules value. */ public List<SecurityRuleInner> defaultSecurityRules() { return this.defaultSecurityRules; } /** * Get the networkInterfaces property: A collection of references to network interfaces. * * @return the networkInterfaces value. */ public List<NetworkInterfaceInner> networkInterfaces() { return this.networkInterfaces; } /** * Get the subnets property: A collection of references to subnets. * * @return the subnets value. */ public List<SubnetInner> subnets() { return this.subnets; } /** * Get the flowLogs property: A collection of references to flow log resources. * * @return the flowLogs value. */ public List<FlowLogInner> flowLogs() { return this.flowLogs; } /** * Get the resourceGuid property: The resource GUID property of the network security group resource. * * @return the resourceGuid value. */ public String resourceGuid() { return this.resourceGuid; } /** * Get the provisioningState property: The provisioning state of the network security group resource. * * @return the provisioningState value. */ public ProvisioningState provisioningState() { return this.provisioningState; } /** * Get the id property: Resource ID. * * @return the id value. */ public String id() { return this.id; } /** * Set the id property: Resource ID. * * @param id the id value to set. * @return the NetworkSecurityGroupInner object itself. */ public NetworkSecurityGroupInner withId(String id) { this.id = id; return this; } /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (securityRules() != null) { securityRules().forEach(e -> e.validate()); } if (defaultSecurityRules() != null) { defaultSecurityRules().forEach(e -> e.validate()); } if (networkInterfaces() != null) { networkInterfaces().forEach(e -> e.validate()); } if (subnets() != null) { subnets().forEach(e -> e.validate()); } if (flowLogs() != null) { flowLogs().forEach(e -> e.validate()); } } }
{ "content_hash": "f6a7ea9840d061dd6ce19f4a85761d4d", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 105, "avg_line_length": 30.28855721393035, "alnum_prop": 0.6596583442838371, "repo_name": "selvasingh/azure-sdk-for-java", "id": "fe4a88ac5675f50dc3cf7a282d6dab27c56c3272", "size": "6088", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/NetworkSecurityGroupInner.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "29891970" }, { "name": "JavaScript", "bytes": "6198" }, { "name": "PowerShell", "bytes": "160" }, { "name": "Shell", "bytes": "609" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <title>Filter</title> <script src="../build/react.js"></script> <script src="../build/react-dom.js"></script> <script src="../build/browser.min.js"></script> </head> <body> <div id="ex"></div> <script type="text/babel"> var SearchBar=React.createClass({ hanlderListener(event){ this.props.handUserInput(this.refs.filterTextInput.value, this.refs.filterIsStocked.checked); }, render(){ return (<form> <input type="text" placeholder="search..." onChange={this.hanlderListener} value={this.props.filterText} ref={'filterTextInput'}/> <br/> <input type="checkbox" value="Only show products" checked={this.props.isStocked} onChange={this.hanlderListener} ref={'filterIsStocked'}/>Only show products {this.props.filterText} <br/> </form>); } }); var ProductCategory=React.createClass({ render(){ var name=this.props.category return (<tr ><th colSpan='2'>{name}</th></tr>); } }); var ProductView=React.createClass({ render(){ var name=this.props.product.stocked?this.props.product.name: (<span style={{color:'red'}}>{this.props.product.name}</span>) return (<tr><th>{name}</th><th>{this.props.product.price}</th></tr>); } }); var ProductsTab=React.createClass({ render(){ var lis=[]; var lastClass; var filterText=this.props.filterText; var isStocked=this.props.isStocked; this.props.products.forEach(function(pro){ if (pro.name.indexOf(filterText)===-1 || (isStocked&&isStocked!=pro.stocked)){ return; } if (pro.category!=lastClass) { // lis.push(<ProductCategory category={pro.category} key={pro.category}/>); } lis.push(<ProductView product={pro} key={pro.name} />); lastClass=pro.category; }); return ( <table> <thead> <tr><th>NAME</th><th>PRICE</th></tr> </thead> <tbody>{lis}</tbody> </table> ); } }); var AllTab=React.createClass({ getInitialState() { return { filterText:'', isStocked:false }; }, handUserInput(filterText,isStocked){ this.setState({ filterText:filterText, isStocked:isStocked }) }, render(){ return (<div> <SearchBar filterText={this.state.filterText} isStocked={this.state.isStocked} handUserInput={this.handUserInput} /> <ProductsTab products={this.props.products} isStocked={this.state.isStocked} filterText={this.state.filterText} /> </div>); } }) var PRODUCTS = [ {category: 'Sporting Goods', price: '$493.99', stocked: true, name: 'Football'}, {category: 'Sporting Goods', price: '$9.99', stocked: true, name: 'Baseball'}, {category: 'Sporting Goods', price: '$29.99', stocked: false, name: 'Basketball'}, {category: 'Electronics', price: '$99.99', stocked: true, name: 'iPod Touch'}, {category: 'Electronics', price: '$399.99', stocked: false, name: 'iPhone 5'}, {category: 'Electronics', price: '$199.99', stocked: true, name: 'Nexus 7'} ]; ReactDOM.render(<AllTab products={PRODUCTS} />,document.getElementById('ex')); </script> </body> </html>
{ "content_hash": "f632fa47ef3a3b7f02d229174392e900", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 185, "avg_line_length": 30.235849056603772, "alnum_prop": 0.6177847113884556, "repo_name": "toyluck/ReactDemo", "id": "5eb76a163181a371bfdb1e751706de7de1c275bd", "size": "3205", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ReactDeep/TabFilter.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "26105" }, { "name": "JavaScript", "bytes": "1099529" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <faceted-project> <installed facet="java" version="1.7"/> <installed facet="jst.utility" version="1.0"/> <installed facet="jpt.jpa" version="2.0"/> </faceted-project>
{ "content_hash": "6501e6ff75118c99d12e235131c4d20f", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 48, "avg_line_length": 36.333333333333336, "alnum_prop": 0.6467889908256881, "repo_name": "Laesod/binary-storage", "id": "39a201fa1e6b7cd02cb41dfc036fc369f355c1e8", "size": "218", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": ".settings/org.eclipse.wst.common.project.facet.core.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "34716" } ], "symlink_target": "" }
package vtk.web.service; import java.util.Optional; import javax.servlet.http.HttpServletRequest; import vtk.repository.Resource; import vtk.security.Principal; /** * An Assertion states a fact about something. The only thing assertions share, * are the ability to check if there is a known conflict between this and * another assertion. Subinterfaces specifies the actual matching of the * assertions. * * <p>Assertions can also have an effect on URLs generated by the * framework (see {@link Service#constructLink}), such as the request * hostname, port, protocol, querystring and other parameters. For * example, an assertion stating that "The URL must contain request * parameter <code>foo=bar</code>" should ensure that this parameter * exists in the generated URL's query string when the * <code>processURL()</code> method is called. */ public interface WebAssertion { /** * Contributes to the construction of a URL. Assertions may * "decorate" a URL in many ways, for instance changing the port * number, query parameters, etc. * * @param url the URL that is in the process of being constructed. * @param resource the resorurce for which the URL is being * constructed * @param principal the authenticated principal for which the URL * is being constructed * @return an optional (possibly modified) * URL ({@code Optional#empty} if the URL cannot be constructed). */ public Optional<URL> processURL(URL url, Resource resource, Principal principal); /** * Static (without knowledge about current request) URL construction. * @param url the current URL * @return a (possibly modified) version of the URL parameter */ public URL processURL(URL url); /** * @return whether the request matches this assertion. */ public boolean matches(HttpServletRequest request, Resource resource, Principal principal); /** * Decides whether this assertion is in conflict with another * assertion. * * @param assertion the assertion for which to check conflict * @return <code>true</code> if the two assertions are * incompatible, <code>false</code> otherwise. */ public boolean conflicts(WebAssertion assertion); }
{ "content_hash": "f905e0adbcaacfbdb3beeb1f11b87827", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 95, "avg_line_length": 33.720588235294116, "alnum_prop": 0.7078063672045355, "repo_name": "vtkio/vtk", "id": "19b8efd51aa8c098be859d2511fd4826ed4b9a63", "size": "3901", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/vtk/web/service/WebAssertion.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "44483" }, { "name": "AngelScript", "bytes": "2500" }, { "name": "CSS", "bytes": "465045" }, { "name": "ColdFusion", "bytes": "122452" }, { "name": "FreeMarker", "bytes": "586252" }, { "name": "GAP", "bytes": "7879" }, { "name": "Groovy", "bytes": "46265" }, { "name": "HTML", "bytes": "990738" }, { "name": "Java", "bytes": "8373918" }, { "name": "JavaScript", "bytes": "1573427" }, { "name": "Lasso", "bytes": "20160" }, { "name": "PHP", "bytes": "40605" }, { "name": "PLSQL", "bytes": "14143" }, { "name": "Perl", "bytes": "14524" }, { "name": "Perl 6", "bytes": "23211" }, { "name": "Python", "bytes": "39475" }, { "name": "SQLPL", "bytes": "27514" }, { "name": "Shell", "bytes": "4599" } ], "symlink_target": "" }
#ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include <unistd.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <sys/param.h> #include <sys/un.h> #include <sys/select.h> #include <atalk/logger.h> #include "db_param.h" #define DB_PARAM_FN "db_param" #define MAXKEYLEN 64 static struct db_param params; static int parse_err; static size_t usock_maxlen(void) { struct sockaddr_un addr; return sizeof(addr.sun_path) - 1; } static int make_pathname(char *path, char *dir, char *fn, size_t maxlen) { size_t len; if (fn[0] != '/') { len = strlen(dir); if (len + 1 + strlen(fn) > maxlen) return -1; strcpy(path, dir); if (path[len - 1] != '/') strcat(path, "/"); strcat(path, fn); } else { if (strlen(fn) > maxlen) return -1; strcpy(path, fn); } return 0; } static void default_params(struct db_param *dbp, char *dir) { dbp->logfile_autoremove = DEFAULT_LOGFILE_AUTOREMOVE; dbp->cachesize = DEFAULT_CACHESIZE; dbp->maxlocks = DEFAULT_MAXLOCKS; dbp->maxlockobjs = DEFAULT_MAXLOCKOBJS; dbp->flush_frequency = DEFAULT_FLUSH_FREQUENCY; dbp->flush_interval = DEFAULT_FLUSH_INTERVAL; if (make_pathname(dbp->usock_file, dir, DEFAULT_USOCK_FILE, usock_maxlen()) < 0) { /* Not an error yet, it might be set in the config file */ dbp->usock_file[0] = '\0'; } dbp->fd_table_size = DEFAULT_FD_TABLE_SIZE; if ( dbp->fd_table_size > FD_SETSIZE -1) dbp->fd_table_size = FD_SETSIZE -1; dbp->idle_timeout = DEFAULT_IDLE_TIMEOUT; return; } static int parse_int(char *val) { char *tmp; int result = 0; result = strtol(val, &tmp, 10); if (tmp[0] != '\0') { LOG(log_error, logtype_cnid, "invalid characters in token %s", val); parse_err++; } return result; } /* TODO: This configuration file reading routine is neither very robust (%s buffer overflow) nor elegant, we need to add support for whitespace in filenames as well. */ struct db_param *db_param_read(char *dir) { FILE *fp; static char key[MAXKEYLEN + 1]; static char val[MAXPATHLEN + 1]; static char pfn[MAXPATHLEN + 1]; int items; default_params(&params, dir); params.dir = dir; if (make_pathname(pfn, dir, DB_PARAM_FN, MAXPATHLEN) < 0) { LOG(log_error, logtype_cnid, "Parameter filename too long"); return NULL; } if ((fp = fopen(pfn, "r")) == NULL) { if (errno == ENOENT) { if (strlen(params.usock_file) == 0) { LOG(log_error, logtype_cnid, "default usock filename too long"); return NULL; } else { return &params; } } else { LOG(log_error, logtype_cnid, "error opening %s: %s", pfn, strerror(errno)); return NULL; } } parse_err = 0; while ((items = fscanf(fp, " %s %s", key, val)) != EOF) { if (items != 2) { LOG(log_error, logtype_cnid, "error parsing config file"); parse_err++; break; } /* Config for both cnid_meta and dbd */ if (! strcmp(key, "usock_file")) { if (make_pathname(params.usock_file, dir, val, usock_maxlen()) < 0) { LOG(log_error, logtype_cnid, "usock filename %s too long", val); parse_err++; } else LOG(log_info, logtype_cnid, "db_param: setting UNIX domain socket filename to %s", params.usock_file); } if (! strcmp(key, "fd_table_size")) { params.fd_table_size = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting max number of concurrent afpd connections per volume (fd_table_size) to %d", params.fd_table_size); } else if (! strcmp(key, "logfile_autoremove")) { params.logfile_autoremove = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting logfile_autoremove to %d", params.logfile_autoremove); } else if (! strcmp(key, "cachesize")) { params.cachesize = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting cachesize to %d", params.cachesize); } else if (! strcmp(key, "maxlocks")) { params.maxlocks = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting maxlocks to %d", params.maxlocks); } else if (! strcmp(key, "maxlockobjs")) { params.maxlockobjs = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting maxlockobjs to %d", params.maxlockobjs); } else if (! strcmp(key, "flush_frequency")) { params.flush_frequency = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting flush_frequency to %d", params.flush_frequency); } else if (! strcmp(key, "flush_interval")) { params.flush_interval = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting flush_interval to %d", params.flush_interval); } else if (! strcmp(key, "idle_timeout")) { params.idle_timeout = parse_int(val); LOG(log_info, logtype_cnid, "db_param: setting idle timeout to %d", params.idle_timeout); } if (parse_err) break; } if (strlen(params.usock_file) == 0) { LOG(log_error, logtype_cnid, "default usock filename too long"); parse_err++; } fclose(fp); if (! parse_err) { /* sanity checks */ if (params.flush_frequency <= 0) params.flush_frequency = 86400; if (params.flush_interval <= 0) params.flush_interval = 1000000; if (params.fd_table_size <= 2) params.fd_table_size = 32; if (params.idle_timeout <= 0) params.idle_timeout = 86400; return &params; } else return NULL; }
{ "content_hash": "370426bf5c5ceb9b5f806b467e0d8e77", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 158, "avg_line_length": 31.55440414507772, "alnum_prop": 0.561247947454844, "repo_name": "Saresu/scripts", "id": "c89f8e5cec00890c2d9b4a3e8410241cc7b684a7", "size": "6267", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "devel/netatalk/netatalk-2.2.2/etc/cnid_dbd/db_param.c", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "3855792" }, { "name": "C++", "bytes": "4489" }, { "name": "Lua", "bytes": "3398" }, { "name": "Objective-C", "bytes": "233" }, { "name": "Perl", "bytes": "104149" }, { "name": "Shell", "bytes": "498892" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Mon Jun 24 22:25:09 UTC 2013 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class org.apache.hadoop.hbase.rest.protobuf.generated.VersionMessage (HBase 0.94.9 API) </TITLE> <META NAME="date" CONTENT="2013-06-24"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.hadoop.hbase.rest.protobuf.generated.VersionMessage (HBase 0.94.9 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../org/apache/hadoop/hbase/rest/protobuf/generated/VersionMessage.html" title="class in org.apache.hadoop.hbase.rest.protobuf.generated"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../../index.html?org/apache/hadoop/hbase/rest/protobuf/generated//class-useVersionMessage.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="VersionMessage.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.apache.hadoop.hbase.rest.protobuf.generated.VersionMessage</B></H2> </CENTER> No usage of org.apache.hadoop.hbase.rest.protobuf.generated.VersionMessage <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../org/apache/hadoop/hbase/rest/protobuf/generated/VersionMessage.html" title="class in org.apache.hadoop.hbase.rest.protobuf.generated"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../../index.html?org/apache/hadoop/hbase/rest/protobuf/generated//class-useVersionMessage.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="VersionMessage.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved. </BODY> </HTML>
{ "content_hash": "d1667358cc6393dd069f80eea12915a5", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 275, "avg_line_length": 44.92413793103448, "alnum_prop": 0.6129874117285846, "repo_name": "zqxjjj/NobidaBase", "id": "45ab6b3f14803928bf8546bf58becfb8612f9583", "size": "6514", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/apidocs/org/apache/hadoop/hbase/rest/protobuf/generated/class-use/VersionMessage.html", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "19836" }, { "name": "CSS", "bytes": "42877" }, { "name": "Erlang", "bytes": "324" }, { "name": "Java", "bytes": "29972006" }, { "name": "PHP", "bytes": "37634" }, { "name": "Perl", "bytes": "20962" }, { "name": "Python", "bytes": "29070" }, { "name": "Ruby", "bytes": "779544" }, { "name": "Shell", "bytes": "169607" }, { "name": "XSLT", "bytes": "8758" } ], "symlink_target": "" }
FROM balenalib/photon-tx2-nx-debian:bullseye-build ENV GO_VERSION 1.16.14 RUN mkdir -p /usr/local/go \ && curl -SLO "https://storage.googleapis.com/golang/go$GO_VERSION.linux-arm64.tar.gz" \ && echo "5e59056e36704acb25809bcdb27191f27593cb7aba4d716b523008135a1e764a go$GO_VERSION.linux-arm64.tar.gz" | sha256sum -c - \ && tar -xzf "go$GO_VERSION.linux-arm64.tar.gz" -C /usr/local/go --strip-components=1 \ && rm -f go$GO_VERSION.linux-arm64.tar.gz ENV GOROOT /usr/local/go ENV GOPATH /go ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" WORKDIR $GOPATH CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/613d8e9ca8540f29a43fddf658db56a8d826fffe/scripts/assets/tests/test-stack@golang.sh" \ && echo "Running test-stack@golang" \ && chmod +x test-stack@golang.sh \ && bash test-stack@golang.sh \ && rm -rf test-stack@golang.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Debian Bullseye \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nGo v1.16.14 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{ "content_hash": "e53f886b53c7f90bc9d879d0a154b917", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 677, "avg_line_length": 64.09677419354838, "alnum_prop": 0.7267237040764972, "repo_name": "resin-io-library/base-images", "id": "843c283e1c1a290fbffd6a66b30eb1c3f9334624", "size": "2008", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/golang/photon-tx2-nx/debian/bullseye/1.16.14/build/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "71234697" }, { "name": "JavaScript", "bytes": "13096" }, { "name": "Shell", "bytes": "12051936" }, { "name": "Smarty", "bytes": "59789" } ], "symlink_target": "" }
package org.sakaiproject.component.section; import java.io.Serializable; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.ToStringBuilder; import org.sakaiproject.section.api.coursemanagement.User; /** * A detachable User for persistent storage. * * @author <a href="mailto:jholtzman@berkeley.edu">Josh Holtzman</a> * */ public class UserImpl extends AbstractPersistentObject implements User, Serializable { private static final long serialVersionUID = 1L; protected String userUid; protected String sortName; protected String displayId; protected String displayName; /** * No-arg constructor needed for hibernate */ public UserImpl() { } public UserImpl(String displayName, String displayId, String sortName, String userUid) { this.displayName = displayName; this.displayId = displayId; this.sortName = sortName; this.userUid = userUid; } public String getDisplayName() { return displayName; } public String getDisplayId() { return displayId; } public String getSortName() { return sortName; } public String getUserUid() { return userUid; } public long getId() { return id; } public void setId(long id) { this.id = id; } public int getVersion() { return version; } public void setVersion(int version) { this.version = version; } public boolean equals(Object o) { if(o == this) { return true; } if(o instanceof UserImpl) { UserImpl other = (UserImpl)o; return new EqualsBuilder() .append(userUid, other.userUid) .isEquals(); } return false; } public int hashCode() { return new HashCodeBuilder(17, 37) .append(userUid) .toHashCode(); } public String toString() { return new ToStringBuilder(this).append(displayName) .append(userUid).append(id).toString(); } }
{ "content_hash": "6d287b00db7e7995ad654338232c52e4", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 89, "avg_line_length": 20.76923076923077, "alnum_prop": 0.7185185185185186, "repo_name": "eemirtekin/Sakai-10.6-TR", "id": "b8a2d012a0db3b684e954dddb859b722308ef4aa", "size": "3031", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "edu-services/sections-service/sections-impl/standalone/src/java/org/sakaiproject/component/section/UserImpl.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "59098" }, { "name": "Batchfile", "bytes": "6366" }, { "name": "C++", "bytes": "6402" }, { "name": "CSS", "bytes": "2616828" }, { "name": "ColdFusion", "bytes": "146057" }, { "name": "HTML", "bytes": "5982358" }, { "name": "Java", "bytes": "49585098" }, { "name": "JavaScript", "bytes": "6722774" }, { "name": "Lasso", "bytes": "26436" }, { "name": "PHP", "bytes": "223840" }, { "name": "PLSQL", "bytes": "2163243" }, { "name": "Perl", "bytes": "102776" }, { "name": "Python", "bytes": "87575" }, { "name": "Ruby", "bytes": "3606" }, { "name": "Shell", "bytes": "33041" }, { "name": "SourcePawn", "bytes": "2274" }, { "name": "XSLT", "bytes": "607759" } ], "symlink_target": "" }
@interface WFBigCollectionViewCell () @end @implementation WFBigCollectionViewCell - (void)awakeFromNib { // Initialization code } @end
{ "content_hash": "9919f491bc1ac9e9daf074dd7461439c", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 39, "avg_line_length": 13.090909090909092, "alnum_prop": 0.7569444444444444, "repo_name": "bksshetty/iosappium-test", "id": "1bfb9d109e8b2e5445d202950f7926ed9d6029e2", "size": "326", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "metaclone/metaclone/WFBigCollectionViewCell.m", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "2003" }, { "name": "Cucumber", "bytes": "270" }, { "name": "HTML", "bytes": "414121" }, { "name": "Objective-C", "bytes": "678714" }, { "name": "RobotFramework", "bytes": "4001" }, { "name": "Ruby", "bytes": "29397" }, { "name": "Shell", "bytes": "3548" }, { "name": "Swift", "bytes": "80847" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "52be174fce58e710d3b07a4e170ad39b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "19b38efc2a679bff429741346d2e26e58158a2c1", "size": "196", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Cyperaceae/Scleria/Scleria flagellum-nigrorum/ Syn. Schoenus moniliferus/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package SNMP::Info::Layer2::HPVC; use strict; use Exporter; use SNMP::Info::Layer2; use SNMP::Info::LLDP; @SNMP::Info::Layer2::HPVC::ISA = qw/SNMP::Info::Layer2 SNMP::Info::LLDP Exporter/; @SNMP::Info::Layer2::HPVC::EXPORT_OK = qw//; use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/; $VERSION = '3.34'; %MIBS = ( %SNMP::Info::Layer2::MIBS, %SNMP::Info::LLDP::MIBS, 'HPVC-MIB' => 'vcDomainName', 'CPQSINFO-MIB' => 'cpqSiSysSerialNum', 'HPVCMODULE-MIB' => 'vcModuleDomainName', ); %GLOBALS = ( %SNMP::Info::Layer2::GLOBALS, %SNMP::Info::LLDP::GLOBALS, 'serial1' => 'cpqSiSysSerialNum.0', 'os_ver' => 'cpqHoSWRunningVersion.1', 'os_bin' => 'cpqHoFwVerVersion.1', 'productname' => 'cpqSiProductName.0', ); %FUNCS = ( %SNMP::Info::Layer2::FUNCS, %SNMP::Info::LLDP::FUNCS, ); %MUNGE = ( # Inherit all the built in munging %SNMP::Info::Layer2::MUNGE, %SNMP::Info::LLDP::MUNGE, ); # Method Overrides sub os { return 'hpvc'; } sub vendor { return 'hp'; } sub model { my $hp = shift; return $hp->productname(); } 1; __END__ =head1 NAME SNMP::Info::Layer2::HPVC - SNMP Interface to HP Virtual Connect Switches =head1 AUTHOR Jeroen van Ingen =head1 SYNOPSIS # Let SNMP::Info determine the correct subclass for you. my $hp = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'myswitch', Community => 'public', Version => 2 ) or die "Can't connect to DestHost.\n"; my $class = $hp->class(); print "SNMP::Info determined this device to fall under subclass : $class\n"; =head1 DESCRIPTION Provides abstraction to the configuration information obtainable from a HP Virtual Connect Switch via SNMP. For speed or debugging purposes you can call the subclass directly, but not after determining a more specific class using the method above. my $hp = new SNMP::Info::Layer2::HPVC(...); =head2 Inherited Classes =over =item SNMP::Info::Layer2 =back =head2 Required MIBs =over =item F<HPVC-MIB> =item F<CPQSINFO-MIB> =item F<HPVCMODULE-MIB> =back All required MIBs can be found in the netdisco-mibs package. =head1 GLOBALS These are methods that return scalar value from SNMP =over =item $hp->os() Returns C<'hpvc'> =item $hp->os_bin() C<cpqHoFwVerVersion.1> =item $hp->os_ver() C<cpqHoSWRunningVersion.1> =item $hp->serial() C<cpqSiSysSerialNum.0> =item $hp->vendor() hp =item $hp->model() C<cpqSiProductName.0> =back =head2 Globals imported from SNMP::Info::Layer2 See documentation in L<SNMP::Info::Layer2/"GLOBALS"> for details. =head1 TABLE METHODS These are methods that return tables of information in the form of a reference to a hash. =head2 Overrides =over =back =head2 Table Methods imported from SNMP::Info::Layer2 See documentation in L<SNMP::Info::Layer2/"TABLE METHODS"> for details. =head1 MUNGES =over =back =head1 SET METHODS These are methods that provide SNMP set functionality for overridden methods or provide a simpler interface to complex set operations. See L<SNMP::Info/"SETTING DATA VIA SNMP"> for general information on set operations. =cut
{ "content_hash": "b795796109ef1d3da88c986d39be8df2", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 78, "avg_line_length": 18.092391304347824, "alnum_prop": 0.64313607689997, "repo_name": "42wim/snmp-info", "id": "eeea25730a8ead5808f6a41a099354e308d02dcc", "size": "5001", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Info/Layer2/HPVC.pm", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Perl", "bytes": "1522306" }, { "name": "Shell", "bytes": "130" } ], "symlink_target": "" }
package org.mifos.reports.business.service; import java.util.List; import org.mifos.framework.exceptions.ServiceException; import org.mifos.reports.cashconfirmationreport.BranchCashConfirmationCenterRecoveryBO; import org.mifos.reports.cashconfirmationreport.BranchCashConfirmationDisbursementBO; import org.mifos.reports.cashconfirmationreport.BranchCashConfirmationInfoBO; public interface IBranchCashConfirmationReportService { public List<BranchCashConfirmationCenterRecoveryBO> getCenterRecoveries(Integer branchId, String runDate) throws ServiceException; public List<BranchCashConfirmationInfoBO> getCenterIssues(Integer branchId, String runDate) throws ServiceException; public List<BranchCashConfirmationDisbursementBO> getDisbursements(Integer branchId, String runDate) throws ServiceException; }
{ "content_hash": "3615f991a2d6866e89a3e37dece215c9", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 120, "avg_line_length": 38.72727272727273, "alnum_prop": 0.8427230046948356, "repo_name": "vorburger/mifos-head", "id": "80d68501f8e6095de6eb2176e39bc07ed47483db", "size": "1613", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "application/src/main/java/org/mifos/reports/business/service/IBranchCashConfirmationReportService.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "16482762" }, { "name": "JavaScript", "bytes": "535771" }, { "name": "Python", "bytes": "27237" }, { "name": "Shell", "bytes": "42182" } ], "symlink_target": "" }
#ifndef CRYPTOPP_ZINFLATE_H #define CRYPTOPP_ZINFLATE_H #include "cryptlib.h" #include "secblock.h" #include "filters.h" #include "stdcpp.h" NAMESPACE_BEGIN(CryptoPP) //! \class LowFirstBitReader //! \since Crypto++ 1.0 class LowFirstBitReader { public: LowFirstBitReader(BufferedTransformation &store) : m_store(store), m_buffer(0), m_bitsBuffered(0) {} unsigned int BitsBuffered() const {return m_bitsBuffered;} unsigned long PeekBuffer() const {return m_buffer;} bool FillBuffer(unsigned int length); unsigned long PeekBits(unsigned int length); void SkipBits(unsigned int length); unsigned long GetBits(unsigned int length); private: BufferedTransformation &m_store; unsigned long m_buffer; unsigned int m_bitsBuffered; }; struct CodeLessThan; //! \class HuffmanDecoder //! \brief Huffman Decoder //! \since Crypto++ 1.0 class HuffmanDecoder { public: typedef unsigned int code_t; typedef unsigned int value_t; enum {MAX_CODE_BITS = sizeof(code_t)*8}; class Err : public Exception {public: Err(const std::string &what) : Exception(INVALID_DATA_FORMAT, "HuffmanDecoder: " + what) {}}; HuffmanDecoder() : m_maxCodeBits(0), m_cacheBits(0), m_cacheMask(0), m_normalizedCacheMask(0) {} HuffmanDecoder(const unsigned int *codeBitLengths, unsigned int nCodes) : m_maxCodeBits(0), m_cacheBits(0), m_cacheMask(0), m_normalizedCacheMask(0) {Initialize(codeBitLengths, nCodes);} void Initialize(const unsigned int *codeBitLengths, unsigned int nCodes); unsigned int Decode(code_t code, /* out */ value_t &value) const; bool Decode(LowFirstBitReader &reader, value_t &value) const; private: friend struct CodeLessThan; struct CodeInfo { CodeInfo(code_t code=0, unsigned int len=0, value_t value=0) : code(code), len(len), value(value) {} inline bool operator<(const CodeInfo &rhs) const {return code < rhs.code;} code_t code; unsigned int len; value_t value; }; struct LookupEntry { unsigned int type; union { value_t value; const CodeInfo *begin; }; union { unsigned int len; const CodeInfo *end; }; }; static code_t NormalizeCode(code_t code, unsigned int codeBits); void FillCacheEntry(LookupEntry &entry, code_t normalizedCode) const; unsigned int m_maxCodeBits, m_cacheBits, m_cacheMask, m_normalizedCacheMask; std::vector<CodeInfo, AllocatorWithCleanup<CodeInfo> > m_codeToValue; mutable std::vector<LookupEntry, AllocatorWithCleanup<LookupEntry> > m_cache; }; //! \class Inflator //! \brief DEFLATE decompressor (RFC 1951) //! \since Crypto++ 1.0 class Inflator : public AutoSignaling<Filter> { public: class Err : public Exception { public: Err(ErrorType e, const std::string &s) : Exception(e, s) {} }; //! \brief Exception thrown when a truncated stream is encountered class UnexpectedEndErr : public Err {public: UnexpectedEndErr() : Err(INVALID_DATA_FORMAT, "Inflator: unexpected end of compressed block") {}}; //! \brief Exception thrown when a bad block is encountered class BadBlockErr : public Err {public: BadBlockErr() : Err(INVALID_DATA_FORMAT, "Inflator: error in compressed block") {}}; //! \brief Exception thrown when an invalid distance is encountered class BadDistanceErr : public Err {public: BadDistanceErr() : Err(INVALID_DATA_FORMAT, "Inflator: error in bit distance") {}}; //! \brief RFC 1951 Decompressor //! \param attachment the filter's attached transformation //! \param repeat decompress multiple compressed streams in series //! \param autoSignalPropagation 0 to turn off MessageEnd signal Inflator(BufferedTransformation *attachment = NULLPTR, bool repeat = false, int autoSignalPropagation = -1); void IsolatedInitialize(const NameValuePairs &parameters); size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); bool IsolatedFlush(bool hardFlush, bool blocking); virtual unsigned int GetLog2WindowSize() const {return 15;} protected: ByteQueue m_inQueue; private: virtual unsigned int MaxPrestreamHeaderSize() const {return 0;} virtual void ProcessPrestreamHeader() {} virtual void ProcessDecompressedData(const byte *string, size_t length) {AttachedTransformation()->Put(string, length);} virtual unsigned int MaxPoststreamTailSize() const {return 0;} virtual void ProcessPoststreamTail() {} void ProcessInput(bool flush); void DecodeHeader(); bool DecodeBody(); void FlushOutput(); void OutputByte(byte b); void OutputString(const byte *string, size_t length); void OutputPast(unsigned int length, unsigned int distance); static const HuffmanDecoder *FixedLiteralDecoder(); static const HuffmanDecoder *FixedDistanceDecoder(); const HuffmanDecoder& GetLiteralDecoder() const; const HuffmanDecoder& GetDistanceDecoder() const; enum State {PRE_STREAM, WAIT_HEADER, DECODING_BODY, POST_STREAM, AFTER_END}; State m_state; bool m_repeat, m_eof, m_wrappedAround; byte m_blockType; word16 m_storedLen; enum NextDecode {LITERAL, LENGTH_BITS, DISTANCE, DISTANCE_BITS}; NextDecode m_nextDecode; unsigned int m_literal, m_distance; // for LENGTH_BITS or DISTANCE_BITS HuffmanDecoder m_dynamicLiteralDecoder, m_dynamicDistanceDecoder; LowFirstBitReader m_reader; SecByteBlock m_window; size_t m_current, m_lastFlush; }; NAMESPACE_END #endif
{ "content_hash": "f54e4d114e69f3291b216c108660e88e", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 144, "avg_line_length": 33.559006211180126, "alnum_prop": 0.7279289283731261, "repo_name": "OpenNetworking/gcoin-community", "id": "0767d4f95f65d418a602c5c7300914d837f3c7f2", "size": "5403", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/cryptopp/zinflate.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "107348" }, { "name": "Batchfile", "bytes": "4488" }, { "name": "C", "bytes": "416918" }, { "name": "C++", "bytes": "7508936" }, { "name": "CMake", "bytes": "19814" }, { "name": "CSS", "bytes": "1127" }, { "name": "HTML", "bytes": "50621" }, { "name": "Java", "bytes": "2100" }, { "name": "M4", "bytes": "130728" }, { "name": "Makefile", "bytes": "121564" }, { "name": "Objective-C", "bytes": "5451" }, { "name": "Perl", "bytes": "1717" }, { "name": "Protocol Buffer", "bytes": "847" }, { "name": "Python", "bytes": "428465" }, { "name": "QMake", "bytes": "756" }, { "name": "Roff", "bytes": "3762" }, { "name": "Shell", "bytes": "528962" } ], "symlink_target": "" }
I have to write the readme This code uses only the N64 side of the GameCube to N64 Controller adapter There's a lot of debug stuff in this code, but it's mostly functional, And a lot of uncommented code, but I think it's kinda easy to tell what's going on Check lines 175 through 178 That's where you set what the controller does
{ "content_hash": "740703b00d84f02cdf0c9f3dc1c47e2b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 74, "avg_line_length": 25.923076923076923, "alnum_prop": 0.7685459940652819, "repo_name": "WhatAboutGaming/Twitch-Plays-Stuff", "id": "0e872136850cb976284342968df4d3e1f640735d", "size": "337", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "n64_emulated_controller/README.rst", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "381" }, { "name": "C", "bytes": "46765" }, { "name": "C++", "bytes": "771804" }, { "name": "HTML", "bytes": "432" }, { "name": "JavaScript", "bytes": "5149208" }, { "name": "Makefile", "bytes": "3430" }, { "name": "Python", "bytes": "3667" } ], "symlink_target": "" }
๏ปฟ<?xml version="1.0" encoding="utf-8"?> <Weavers VerifyAssembly="true" VerifyIgnoreCodes="0x80131869,0x801318F3,0x80131040" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> <MethodTimer /> <Catel /> <LoadAssembliesOnStartup /> <ModuleInit /> </Weavers>
{ "content_hash": "ff63d22bd0064a6298f43e4004c07b8b", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 186, "avg_line_length": 44.857142857142854, "alnum_prop": 0.7484076433121019, "repo_name": "WildGums/LogViewer", "id": "4c6e8f83ef526d919d1f570fba31f1821f857029", "size": "316", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/LogViewer/FodyWeavers.xml", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "546090" }, { "name": "PowerShell", "bytes": "319" }, { "name": "Smalltalk", "bytes": "2654" } ], "symlink_target": "" }
git_org=${1} git_user=${2} git_email=${3} tf_modules_repo=${4} cluster_name=${5} cluster_project_id=${6} env=${7} index=${8} sleep_time=20 sleep_index=$((${index}+1)) sleep_total=$((${sleep_time}*${sleep_index})) sleep $sleep_total random=$(echo $RANDOM | md5sum | head -c 20; echo) git clone -b main https://${git_user}:${TF_VAR_github_token}@github.com/${git_org}/${tf_modules_repo} workload-identity-${random} cd workload-identity-${random} git checkout main cd landing-zone mkdir ${env} cp render/workload-identity.tpl ./${env}/${cluster_project_id}-${cluster_name}.tf cp render/variables.tpl ./${env}/variables.tf find ./${env} -type f -name ${cluster_project_id}-${cluster_name}.tf -exec sed -i "s/CLUSTER_NAME/${cluster_name}/g" {} + find ./${env} -type f -name ${cluster_project_id}-${cluster_name}.tf -exec sed -i "s:CLUSTER_PROJECT:${cluster_project_id}:g" {} + git add . git config --global user.name ${git_user} git config --global user.email ${git_email} git commit -m "Adding Cloud Deploy target ${cluster_name}." git push origin cd ../ rm -rf cloud-deploy-target-${tf_modules_repo}
{ "content_hash": "77b8bf6292acc61d4755c0c8e433958f", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 131, "avg_line_length": 32.470588235294116, "alnum_prop": 0.677536231884058, "repo_name": "GoogleCloudPlatform/software-delivery-blueprint", "id": "421380bcf1f9363ed506b9e10bd13d87f9cb6fad", "size": "1691", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "terraform-modules/landing-zone/render/create_wi.sh", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "2369" }, { "name": "Go", "bytes": "1231" }, { "name": "HCL", "bytes": "110796" }, { "name": "Java", "bytes": "4623" }, { "name": "Python", "bytes": "939" }, { "name": "Shell", "bytes": "87049" }, { "name": "Smarty", "bytes": "22115" } ], "symlink_target": "" }
import csv def read_csv_file(csv_file_name): f = open(csv_file_name, 'r') csv_file = csv.reader(f) csv_data = [] for row in csv_file: csv_data.append(row) f.close() return csv_data
{ "content_hash": "f7e8c0500fe2994c0ed4e1fa100bcc34", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 33, "avg_line_length": 18.09090909090909, "alnum_prop": 0.628140703517588, "repo_name": "InnovateUKGitHub/innovation-funding-service", "id": "3424139628aa364f9f6d5963032d2f078a5fcf44", "size": "199", "binary": false, "copies": "1", "ref": "refs/heads/development", "path": "robot-tests/IFS_acceptance_tests/libs/CsvLibrary.py", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "1972" }, { "name": "HTML", "bytes": "6342985" }, { "name": "Java", "bytes": "26591674" }, { "name": "JavaScript", "bytes": "269444" }, { "name": "Python", "bytes": "58983" }, { "name": "RobotFramework", "bytes": "3317394" }, { "name": "SCSS", "bytes": "100274" }, { "name": "Shell", "bytes": "60248" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="refresh" content="3;url=./"> <title>404</title> <style type="text/css"> body { background-image: url(../static/IMG/404.jpg); background-repeat: no-repeat; background-size: cover; } </style> </head> <body> </body> </html>
{ "content_hash": "8bdeec13d74409290673e0bc03c0acee", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 57, "avg_line_length": 21.352941176470587, "alnum_prop": 0.5371900826446281, "repo_name": "sysuzjz/IBM-BigData-course-mainpage", "id": "dfbdf6bcb187a06320520ae720ba20f1db3f9b5a", "size": "363", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "404.html", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "294" }, { "name": "CSS", "bytes": "111343" }, { "name": "HTML", "bytes": "88709" }, { "name": "JavaScript", "bytes": "1438717" }, { "name": "PHP", "bytes": "70076" } ], "symlink_target": "" }
package org.webrtc.kite.apprtc.tests; import org.webrtc.kite.apprtc.checks.BitrateCheck; import org.webrtc.kite.apprtc.checks.PeerConnectionCheck; import org.webrtc.kite.apprtc.checks.RemoteVideoDisplayCheck; import org.webrtc.kite.apprtc.steps.JoinRoomStep; import org.webrtc.kite.stats.GetStatsStep; import org.webrtc.kite.tests.TestRunner; import java.util.Random; public class AudioReceivingBitrateTest extends AppRTCTest { final Random rand = new Random(System.currentTimeMillis()); final String roomId = String.valueOf(Math.abs(rand.nextLong())); final String option = "ar"; // audio received @Override protected String debugOption() { return "?" + option + "br=" + this.bitrate; } @Override public void populateTestSteps(TestRunner runner) { JoinRoomStep joinRoomStep = new JoinRoomStep(runner); joinRoomStep.setRoomId(roomId); joinRoomStep.setDebugOption(this.debugOption() == null ? "" : this.debugOption()); BitrateCheck bitrateCheck = new BitrateCheck(runner); bitrateCheck.setOption(option); bitrateCheck.setExpectedBitrate(this.bitrate); runner.addStep(joinRoomStep); runner.addStep(new PeerConnectionCheck(runner)); runner.addStep(new RemoteVideoDisplayCheck(runner)); runner.addStep(bitrateCheck); if (this.getStats()) { runner.addStep(new GetStatsStep(runner, getStatsConfig)); } } }
{ "content_hash": "e0c13d3ebf10a4221bdb30f848b5fbd2", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 86, "avg_line_length": 32.372093023255815, "alnum_prop": 0.75, "repo_name": "webrtc/KITE", "id": "c05f0101d2acd0547b8eb3df859dd3789914ab0d", "size": "1987", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "KITE-AppRTC-Test/src/main/java/org/webrtc/kite/apprtc/tests/AudioReceivingBitrateTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "21333" }, { "name": "Java", "bytes": "422107" }, { "name": "JavaScript", "bytes": "15124" }, { "name": "Shell", "bytes": "40492" }, { "name": "VBScript", "bytes": "455" } ], "symlink_target": "" }
<!DOCTYPE html> <html class="writer-html5" lang="en" > <head> <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>numberlistp &mdash; Logtalk APIs v3.61.0-b01 documentation</title> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="_static/css/custom.css" type="text/css" /> <!--[if lt IE 9]> <script src="_static/js/html5shiv.min.js"></script> <![endif]--> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/_sphinx_javascript_frameworks_compat.js"></script> <script src="_static/doctools.js"></script> <script src="_static/sphinx_highlight.js"></script> <script src="_static/js/theme.js"></script> <!-- begin favicon --> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" /> <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" /> <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" /> <link rel="manifest" href="/site.webmanifest" /> <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" /> <meta name="msapplication-TileColor" content="#355b95" /> <meta name="theme-color" content="#ffffff" /> <!-- end favicon --> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="pairs" href="pairs_0.html" /> <link rel="prev" title="numberlist" href="numberlist_0.html" /> </head> <body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > <a href="index.html" class="icon icon-home"> Logtalk APIs <img src="_static/logtalk.gif" class="logo" alt="Logo"/> </a> <div class="version"> 3.61.0 </div> <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Contents</span></p> <ul class="current"> <li class="toctree-l1 current"><a class="reference internal" href="library_index.html">Libraries</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="library_index.html#arbitrary"><span class="xref std std-ref">arbitrary</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#assertions"><span class="xref std std-ref">assertions</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#assignvars"><span class="xref std std-ref">assignvars</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#base64"><span class="xref std std-ref">base64</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#cbor"><span class="xref std std-ref">cbor</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#code-metrics"><span class="xref std std-ref">code_metrics</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#core"><span class="xref std std-ref">core</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#coroutining"><span class="xref std std-ref">coroutining</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#csv"><span class="xref std std-ref">csv</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#dates"><span class="xref std std-ref">dates</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#dead-code-scanner"><span class="xref std std-ref">dead_code_scanner</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#debug-messages"><span class="xref std std-ref">debug_messages</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#debugger"><span class="xref std std-ref">debugger</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#dependents"><span class="xref std std-ref">dependents</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#diagrams"><span class="xref std std-ref">diagrams</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#dictionaries"><span class="xref std std-ref">dictionaries</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#dif"><span class="xref std std-ref">dif</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#doclet"><span class="xref std std-ref">doclet</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#edcg"><span class="xref std std-ref">edcg</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#events"><span class="xref std std-ref">events</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#expand-library-alias-paths"><span class="xref std std-ref">expand_library_alias_paths</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#expecteds"><span class="xref std std-ref">expecteds</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#fcube"><span class="xref std std-ref">fcube</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#flags"><span class="xref std std-ref">flags</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#format"><span class="xref std std-ref">format</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#genint"><span class="xref std std-ref">genint</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#gensym"><span class="xref std std-ref">gensym</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#git"><span class="xref std std-ref">git</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#grammars"><span class="xref std std-ref">grammars</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#heaps"><span class="xref std std-ref">heaps</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#help"><span class="xref std std-ref">help</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#hierarchies"><span class="xref std std-ref">hierarchies</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#hook-flows"><span class="xref std std-ref">hook_flows</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#hook-objects"><span class="xref std std-ref">hook_objects</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#html"><span class="xref std std-ref">html</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#ids"><span class="xref std std-ref">ids</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#intervals"><span class="xref std std-ref">intervals</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#iso8601"><span class="xref std std-ref">iso8601</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#issue-creator"><span class="xref std std-ref">issue_creator</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#java"><span class="xref std std-ref">java</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#json"><span class="xref std std-ref">json</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#lgtdoc"><span class="xref std std-ref">lgtdoc</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#lgtunit"><span class="xref std std-ref">lgtunit</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#library"><span class="xref std std-ref">library</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#logging"><span class="xref std std-ref">logging</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#loops"><span class="xref std std-ref">loops</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#meta"><span class="xref std std-ref">meta</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#meta-compiler"><span class="xref std std-ref">meta_compiler</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#metagol"><span class="xref std std-ref">metagol</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#nested-dictionaries"><span class="xref std std-ref">nested_dictionaries</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#optionals"><span class="xref std std-ref">optionals</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#options"><span class="xref std std-ref">options</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#os"><span class="xref std std-ref">os</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#packs"><span class="xref std std-ref">packs</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#pddl-parser"><span class="xref std std-ref">pddl_parser</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#ports-profiler"><span class="xref std std-ref">ports_profiler</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#queues"><span class="xref std std-ref">queues</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#random"><span class="xref std std-ref">random</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#reader"><span class="xref std std-ref">reader</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#redis"><span class="xref std std-ref">redis</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#sets"><span class="xref std std-ref">sets</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#statistics"><span class="xref std std-ref">statistics</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#term-io"><span class="xref std std-ref">term_io</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#timeout"><span class="xref std std-ref">timeout</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#toychr"><span class="xref std std-ref">toychr</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#tutor"><span class="xref std std-ref">tutor</span></a></li> <li class="toctree-l2 current"><a class="reference internal" href="library_index.html#types"><span class="xref std std-ref">types</span></a><ul class="current"> <li class="toctree-l3"><a class="reference internal" href="atom_0.html">atom</a></li> <li class="toctree-l3"><a class="reference internal" href="atomic_0.html">atomic</a></li> <li class="toctree-l3"><a class="reference internal" href="callable_0.html">callable</a></li> <li class="toctree-l3"><a class="reference internal" href="character_0.html">character</a></li> <li class="toctree-l3"><a class="reference internal" href="characterp_0.html">characterp</a></li> <li class="toctree-l3"><a class="reference internal" href="comparingp_0.html">comparingp</a></li> <li class="toctree-l3"><a class="reference internal" href="compound_0.html">compound</a></li> <li class="toctree-l3"><a class="reference internal" href="difflist_0.html">difflist</a></li> <li class="toctree-l3"><a class="reference internal" href="float_0.html">float</a></li> <li class="toctree-l3"><a class="reference internal" href="integer_0.html">integer</a></li> <li class="toctree-l3"><a class="reference internal" href="list_0.html">list</a></li> <li class="toctree-l3"><a class="reference internal" href="list_1.html">list(Type)</a></li> <li class="toctree-l3"><a class="reference internal" href="listp_0.html">listp</a></li> <li class="toctree-l3"><a class="reference internal" href="natural_0.html">natural</a></li> <li class="toctree-l3"><a class="reference internal" href="number_0.html">number</a></li> <li class="toctree-l3"><a class="reference internal" href="numberlist_0.html">numberlist</a></li> <li class="toctree-l3 current"><a class="current reference internal" href="#">numberlistp</a></li> <li class="toctree-l3"><a class="reference internal" href="pairs_0.html">pairs</a></li> <li class="toctree-l3"><a class="reference internal" href="term_0.html">term</a></li> <li class="toctree-l3"><a class="reference internal" href="termp_0.html">termp</a></li> <li class="toctree-l3"><a class="reference internal" href="type_0.html">type</a></li> <li class="toctree-l3"><a class="reference internal" href="varlist_0.html">varlist</a></li> <li class="toctree-l3"><a class="reference internal" href="varlistp_0.html">varlistp</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#union-find"><span class="xref std std-ref">union_find</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#uuid"><span class="xref std std-ref">uuid</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#verdi-neruda"><span class="xref std std-ref">verdi_neruda</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#wrapper"><span class="xref std std-ref">wrapper</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#xml-parser"><span class="xref std std-ref">xml_parser</span></a></li> <li class="toctree-l2"><a class="reference internal" href="library_index.html#zippers"><span class="xref std std-ref">zippers</span></a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="directory_index.html">Directories</a></li> <li class="toctree-l1"><a class="reference internal" href="entity_index.html">Entities</a></li> <li class="toctree-l1"><a class="reference internal" href="predicate_index.html">Predicates</a></li> </ul> <ul> <li class="toctree-l1"><a class="reference internal" href="core_inheritance_diagram.svg">Core diagram</a></li> <li class="toctree-l1"><a class="reference internal" href="library_inheritance_diagram.svg">Libraries diagram</a></li> <li class="toctree-l1"><a class="reference internal" href="tools_inheritance_diagram.svg">Tools diagram</a></li> <li class="toctree-l1"><a class="reference internal" href="ports_inheritance_diagram.svg">Ports diagram</a></li> <li class="toctree-l1"><a class="reference internal" href="contributions_inheritance_diagram.svg">Contributions diagram</a></li> <li class="toctree-l1"><a class="reference internal" href="genindex.html">Index</a></li> </ul> <p class="caption"><span class="caption-text">External Contents</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../manuals/index.html">Handbook</a></li> <li class="toctree-l1"><a class="reference internal" href="https://logtalk.org">Logtalk website</a></li> <li class="toctree-l1"><a class="reference internal" href="https://github.com/LogtalkDotOrg/logtalk3">GitHub repo</a></li> </ul> </div> </div> </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">Logtalk APIs</a> </nav> <div class="wy-nav-content"> <div class="rst-content"> <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> <li><a href="index.html" class="icon icon-home"></a> &raquo;</li> <li><a href="library_index.html">Libraries</a> &raquo;</li> <li><code class="docutils literal notranslate"><span class="pre">numberlistp</span></code></li> <li class="wy-breadcrumbs-aside"> <a href="_sources/numberlistp_0.rst.txt" rel="nofollow"> View page source</a> </li> </ul> <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> <p class="right" id="numberlistp-0"><span id="index-0"></span><strong>protocol</strong></p> <section id="numberlistp"> <h1><code class="docutils literal notranslate"><span class="pre">numberlistp</span></code><a class="headerlink" href="#numberlistp" title="Permalink to this heading">๏ƒ</a></h1> <p>List of numbers protocol.</p> <div class="line-block"> <div class="line"><strong>Author:</strong> Paulo Moura</div> <div class="line"><strong>Version:</strong> 1:8:0</div> <div class="line"><strong>Date:</strong> 2022-06-20</div> </div> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Dependencies:</strong></div> <div class="line-block"> <div class="line">(none)</div> </div> </div> <div class="line-block"> <div class="line"><strong>Remarks:</strong></div> <div class="line-block"> <div class="line">(none)</div> </div> </div> <div class="line-block"> <div class="line"><strong>Inherited public predicates:</strong></div> <div class="line-block"> <div class="line">(none)</div> </div> </div> <div class="contents local topic" id="contents"> <ul class="simple"> <li><p><a class="reference internal" href="#public-predicates" id="id1">Public predicates</a></p> <ul> <li><p><a class="reference internal" href="#min-2" id="id2"><code class="docutils literal notranslate"><span class="pre">min/2</span></code></a></p></li> <li><p><a class="reference internal" href="#max-2" id="id3"><code class="docutils literal notranslate"><span class="pre">max/2</span></code></a></p></li> <li><p><a class="reference internal" href="#min-max-3" id="id4"><code class="docutils literal notranslate"><span class="pre">min_max/3</span></code></a></p></li> <li><p><a class="reference internal" href="#product-2" id="id5"><code class="docutils literal notranslate"><span class="pre">product/2</span></code></a></p></li> <li><p><a class="reference internal" href="#sum-2" id="id6"><code class="docutils literal notranslate"><span class="pre">sum/2</span></code></a></p></li> <li><p><a class="reference internal" href="#average-2" id="id7"><code class="docutils literal notranslate"><span class="pre">average/2</span></code></a></p></li> <li><p><a class="reference internal" href="#median-2" id="id8"><code class="docutils literal notranslate"><span class="pre">median/2</span></code></a></p></li> <li><p><a class="reference internal" href="#modes-2" id="id9"><code class="docutils literal notranslate"><span class="pre">modes/2</span></code></a></p></li> <li><p><a class="reference internal" href="#euclidean-norm-2" id="id10"><code class="docutils literal notranslate"><span class="pre">euclidean_norm/2</span></code></a></p></li> <li><p><a class="reference internal" href="#chebyshev-norm-2" id="id11"><code class="docutils literal notranslate"><span class="pre">chebyshev_norm/2</span></code></a></p></li> <li><p><a class="reference internal" href="#manhattan-norm-2" id="id12"><code class="docutils literal notranslate"><span class="pre">manhattan_norm/2</span></code></a></p></li> <li><p><a class="reference internal" href="#euclidean-distance-3" id="id13"><code class="docutils literal notranslate"><span class="pre">euclidean_distance/3</span></code></a></p></li> <li><p><a class="reference internal" href="#chebyshev-distance-3" id="id14"><code class="docutils literal notranslate"><span class="pre">chebyshev_distance/3</span></code></a></p></li> <li><p><a class="reference internal" href="#manhattan-distance-3" id="id15"><code class="docutils literal notranslate"><span class="pre">manhattan_distance/3</span></code></a></p></li> <li><p><a class="reference internal" href="#scalar-product-3" id="id16"><code class="docutils literal notranslate"><span class="pre">scalar_product/3</span></code></a></p></li> <li><p><a class="reference internal" href="#normalize-range-2" id="id17"><code class="docutils literal notranslate"><span class="pre">normalize_range/2</span></code></a></p></li> <li><p><a class="reference internal" href="#normalize-range-4" id="id18"><code class="docutils literal notranslate"><span class="pre">normalize_range/4</span></code></a></p></li> <li><p><a class="reference internal" href="#normalize-unit-2" id="id19"><code class="docutils literal notranslate"><span class="pre">normalize_unit/2</span></code></a></p></li> <li><p><a class="reference internal" href="#normalize-scalar-2" id="id20"><code class="docutils literal notranslate"><span class="pre">normalize_scalar/2</span></code></a></p></li> <li><p><a class="reference internal" href="#rescale-3" id="id21"><code class="docutils literal notranslate"><span class="pre">rescale/3</span></code></a></p></li> </ul> </li> <li><p><a class="reference internal" href="#protected-predicates" id="id22">Protected predicates</a></p></li> <li><p><a class="reference internal" href="#private-predicates" id="id23">Private predicates</a></p></li> <li><p><a class="reference internal" href="#operators" id="id24">Operators</a></p></li> </ul> </div> <section id="public-predicates"> <h2><a class="toc-backref" href="#contents">Public predicates</a><a class="headerlink" href="#public-predicates" title="Permalink to this heading">๏ƒ</a></h2> <section id="min-2"> <span id="numberlistp-0-min-2"></span><span id="index-1"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">min/2</span></code></a><a class="headerlink" href="#min-2" title="Permalink to this heading">๏ƒ</a></h3> <p>Determines the minimum value in a list using arithmetic order. Fails if the list is empty.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">min(List,Minimum)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">min(+list(number),-number)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="max-2"> <span id="numberlistp-0-max-2"></span><span id="index-2"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">max/2</span></code></a><a class="headerlink" href="#max-2" title="Permalink to this heading">๏ƒ</a></h3> <p>Determines the list maximum value using arithmetic order. Fails if the list is empty.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">max(List,Maximum)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">max(+list(number),-number)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="min-max-3"> <span id="numberlistp-0-min-max-3"></span><span id="index-3"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">min_max/3</span></code></a><a class="headerlink" href="#min-max-3" title="Permalink to this heading">๏ƒ</a></h3> <p>Determines the minimum and maximum values in a list using arithmetic order. Fails if the list is empty.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">min_max(List,Minimum,Maximum)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">min_max(+list(number),-number,-number)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="product-2"> <span id="numberlistp-0-product-2"></span><span id="index-4"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">product/2</span></code></a><a class="headerlink" href="#product-2" title="Permalink to this heading">๏ƒ</a></h3> <p>Calculates the product of all list numbers. Fails if the list is empty.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">product(List,Product)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">product(+list(number),-number)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="sum-2"> <span id="numberlistp-0-sum-2"></span><span id="index-5"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">sum/2</span></code></a><a class="headerlink" href="#sum-2" title="Permalink to this heading">๏ƒ</a></h3> <p>Calculates the sum of all list numbers. Returns the integer zero if the list is empty.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">sum(List,Sum)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">sum(+list(number),-number)</span></code> - <code class="docutils literal notranslate"><span class="pre">one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="average-2"> <span id="numberlistp-0-average-2"></span><span id="index-6"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">average/2</span></code></a><a class="headerlink" href="#average-2" title="Permalink to this heading">๏ƒ</a></h3> <p>Calculates the average (i.e. arithmetic mean) of a list of numbers. Fails if the list is empty.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">average(List,Average)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">average(+list(number),-float)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="median-2"> <span id="numberlistp-0-median-2"></span><span id="index-7"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">median/2</span></code></a><a class="headerlink" href="#median-2" title="Permalink to this heading">๏ƒ</a></h3> <p>Calculates the median of a list of numbers. Fails if the list is empty.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">median(List,Median)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">median(+list(number),-float)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="modes-2"> <span id="numberlistp-0-modes-2"></span><span id="index-8"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">modes/2</span></code></a><a class="headerlink" href="#modes-2" title="Permalink to this heading">๏ƒ</a></h3> <p>Returns the list of modes of a list of numbers in ascending order. Fails if the list is empty.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">modes(List,Modes)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">modes(+list(number),-list(number))</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="euclidean-norm-2"> <span id="numberlistp-0-euclidean-norm-2"></span><span id="index-9"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">euclidean_norm/2</span></code></a><a class="headerlink" href="#euclidean-norm-2" title="Permalink to this heading">๏ƒ</a></h3> <p>Calculates the Euclidean norm of a list of numbers. Fails if the list is empty.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">euclidean_norm(List,Norm)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">euclidean_norm(+list(number),-float)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="chebyshev-norm-2"> <span id="numberlistp-0-chebyshev-norm-2"></span><span id="index-10"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">chebyshev_norm/2</span></code></a><a class="headerlink" href="#chebyshev-norm-2" title="Permalink to this heading">๏ƒ</a></h3> <p>Calculates the Chebyshev norm of a list of numbers. Fails if the list is empty.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">chebyshev_norm(List,Norm)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">chebyshev_norm(+list(integer),-integer)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> <div class="line"><code class="docutils literal notranslate"><span class="pre">chebyshev_norm(+list(float),-float)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="manhattan-norm-2"> <span id="numberlistp-0-manhattan-norm-2"></span><span id="index-11"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">manhattan_norm/2</span></code></a><a class="headerlink" href="#manhattan-norm-2" title="Permalink to this heading">๏ƒ</a></h3> <p>Calculates the Manhattan norm of a list of numbers. Fails if the list is empty.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">manhattan_norm(List,Norm)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">manhattan_norm(+list(integer),-integer)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> <div class="line"><code class="docutils literal notranslate"><span class="pre">manhattan_norm(+list(float),-float)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="euclidean-distance-3"> <span id="numberlistp-0-euclidean-distance-3"></span><span id="index-12"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">euclidean_distance/3</span></code></a><a class="headerlink" href="#euclidean-distance-3" title="Permalink to this heading">๏ƒ</a></h3> <p>Calculates the Euclidean distance between two lists of numbers. Fails if the two lists are empty or not of the same length.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">euclidean_distance(List1,List2,Distance)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">euclidean_distance(+list(number),+list(number),-float)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="chebyshev-distance-3"> <span id="numberlistp-0-chebyshev-distance-3"></span><span id="index-13"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">chebyshev_distance/3</span></code></a><a class="headerlink" href="#chebyshev-distance-3" title="Permalink to this heading">๏ƒ</a></h3> <p>Calculates the Chebyshev distance between two lists of numbers. Fails if the two lists are empty or not of the same length.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">chebyshev_distance(List1,List2,Distance)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">chebyshev_distance(+list(integer),+list(integer),-integer)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> <div class="line"><code class="docutils literal notranslate"><span class="pre">chebyshev_distance(+list(float),+list(float),-float)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="manhattan-distance-3"> <span id="numberlistp-0-manhattan-distance-3"></span><span id="index-14"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">manhattan_distance/3</span></code></a><a class="headerlink" href="#manhattan-distance-3" title="Permalink to this heading">๏ƒ</a></h3> <p>Calculates the Manhattan distance between two lists of numbers. Fails if the two lists are empty or not of the same length.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">manhattan_distance(List1,List2,Distance)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">manhattan_distance(+list(integer),+list(integer),-integer)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> <div class="line"><code class="docutils literal notranslate"><span class="pre">manhattan_distance(+list(float),+list(float),-float)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="scalar-product-3"> <span id="numberlistp-0-scalar-product-3"></span><span id="index-15"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">scalar_product/3</span></code></a><a class="headerlink" href="#scalar-product-3" title="Permalink to this heading">๏ƒ</a></h3> <p>Calculates the scalar product of two lists of numbers. Fails if the two lists are empty or not of the same length.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">scalar_product(List1,List2,Product)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">scalar_product(+list(integer),+list(integer),-integer)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> <div class="line"><code class="docutils literal notranslate"><span class="pre">scalar_product(+list(float),+list(float),-float)</span></code> - <code class="docutils literal notranslate"><span class="pre">zero_or_one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="normalize-range-2"> <span id="numberlistp-0-normalize-range-2"></span><span id="index-16"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">normalize_range/2</span></code></a><a class="headerlink" href="#normalize-range-2" title="Permalink to this heading">๏ƒ</a></h3> <p>Normalizes a list of numbers into the <code class="docutils literal notranslate"><span class="pre">[0.0,1.0]</span></code> range. Caller must handle arithmetic exceptions if the input list if not normalizable.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">normalize_range(List,NormalizedList)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">normalize_range(+list(number),-list(float))</span></code> - <code class="docutils literal notranslate"><span class="pre">one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="normalize-range-4"> <span id="numberlistp-0-normalize-range-4"></span><span id="index-17"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">normalize_range/4</span></code></a><a class="headerlink" href="#normalize-range-4" title="Permalink to this heading">๏ƒ</a></h3> <p>Normalizes a list of numbers into the given range. Caller must handle arithmetic exceptions if the input list if not normalizable.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">normalize_range(List,Minimum,Maximum,NormalizedList)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">normalize_range(+list(number),+number,+number,-list(float))</span></code> - <code class="docutils literal notranslate"><span class="pre">one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="normalize-unit-2"> <span id="numberlistp-0-normalize-unit-2"></span><span id="index-18"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">normalize_unit/2</span></code></a><a class="headerlink" href="#normalize-unit-2" title="Permalink to this heading">๏ƒ</a></h3> <p>Normalizes a list of numbers returning its unit vector (i.e. a list with Euclidean norm equal to one). Caller must handle arithmetic exceptions if the input list if not normalizable.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">normalize_unit(List,NormalizedList)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">normalize_unit(+list(number),-list(float))</span></code> - <code class="docutils literal notranslate"><span class="pre">one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="normalize-scalar-2"> <span id="numberlistp-0-normalize-scalar-2"></span><span id="index-19"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">normalize_scalar/2</span></code></a><a class="headerlink" href="#normalize-scalar-2" title="Permalink to this heading">๏ƒ</a></h3> <p>Normalizes a list of numbers such that the sum of all numbers is equal to one. Caller must handle arithmetic exceptions if the input list if not normalizable.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">normalize_scalar(List,NormalizedList)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">normalize_scalar(+list(number),-list(float))</span></code> - <code class="docutils literal notranslate"><span class="pre">one</span></code></div> </div> </div> <hr class="docutils" /> </section> <section id="rescale-3"> <span id="numberlistp-0-rescale-3"></span><span id="index-20"></span><h3><a class="toc-backref" href="#contents"><code class="docutils literal notranslate"><span class="pre">rescale/3</span></code></a><a class="headerlink" href="#rescale-3" title="Permalink to this heading">๏ƒ</a></h3> <p>Rescales all numbers in a list by the given factor.</p> <div class="line-block"> <div class="line"><strong>Compilation flags:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">static</span></code></div> </div> </div> <div class="line-block"> <div class="line"><strong>Template:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">rescale(List,Factor,RescaledList)</span></code></div> </div> <div class="line"><strong>Mode and number of proofs:</strong></div> <div class="line-block"> <div class="line"><code class="docutils literal notranslate"><span class="pre">rescale(+list(integer),+integer,-list(integer))</span></code> - <code class="docutils literal notranslate"><span class="pre">one</span></code></div> <div class="line"><code class="docutils literal notranslate"><span class="pre">rescale(+list(number),+float,-list(float))</span></code> - <code class="docutils literal notranslate"><span class="pre">one</span></code></div> </div> </div> </section> </section> <hr class="docutils" /> <section id="protected-predicates"> <h2><a class="toc-backref" href="#contents">Protected predicates</a><a class="headerlink" href="#protected-predicates" title="Permalink to this heading">๏ƒ</a></h2> <p>(none)</p> </section> <section id="private-predicates"> <h2><a class="toc-backref" href="#contents">Private predicates</a><a class="headerlink" href="#private-predicates" title="Permalink to this heading">๏ƒ</a></h2> <p>(none)</p> </section> <section id="operators"> <h2><a class="toc-backref" href="#contents">Operators</a><a class="headerlink" href="#operators" title="Permalink to this heading">๏ƒ</a></h2> <p>(none)</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="numberlist_0.html#numberlist-0"><span class="std std-ref">numberlist</span></a>, <a class="reference internal" href="listp_0.html#listp-0"><span class="std std-ref">listp</span></a>, <a class="reference internal" href="varlistp_0.html#varlistp-0"><span class="std std-ref">varlistp</span></a></p> </div> </section> </section> </div> </div> <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> <a href="numberlist_0.html" class="btn btn-neutral float-left" title="numberlist" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> <a href="pairs_0.html" class="btn btn-neutral float-right" title="pairs" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> <hr/> <div role="contentinfo"> <p>&#169; Copyright 1998-2022, Paulo Moura.</p> </div> Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. </footer> </div> </div> </section> </div> <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); </script> </body> </html>
{ "content_hash": "265dcb05648812995cfebd9254b2ec36", "timestamp": "", "source": "github", "line_count": 749, "max_line_length": 335, "avg_line_length": 70.03738317757009, "alnum_prop": 0.6959662968470014, "repo_name": "LogtalkDotOrg/logtalk3", "id": "2486f7eee9581485bf9701ed7bd1cecc96697cfa", "size": "52508", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/numberlistp_0.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1466" }, { "name": "CSS", "bytes": "20149" }, { "name": "CodeQL", "bytes": "1295" }, { "name": "Common Lisp", "bytes": "258800" }, { "name": "Dockerfile", "bytes": "1948" }, { "name": "Emacs Lisp", "bytes": "11861" }, { "name": "HTML", "bytes": "1958537" }, { "name": "Inno Setup", "bytes": "50865" }, { "name": "JavaScript", "bytes": "153065" }, { "name": "Logtalk", "bytes": "4960912" }, { "name": "Lua", "bytes": "23902" }, { "name": "Makefile", "bytes": "604" }, { "name": "PDDL", "bytes": "6555764" }, { "name": "PHP", "bytes": "26584" }, { "name": "PLSQL", "bytes": "362" }, { "name": "PowerShell", "bytes": "296191" }, { "name": "Prolog", "bytes": "10156468" }, { "name": "Python", "bytes": "16672" }, { "name": "Ruby", "bytes": "10762" }, { "name": "Shell", "bytes": "360508" }, { "name": "Starlark", "bytes": "913" }, { "name": "Tcl", "bytes": "5409" }, { "name": "TeX", "bytes": "12936" }, { "name": "Vim Script", "bytes": "19406" }, { "name": "Vim Snippet", "bytes": "1921" }, { "name": "XSLT", "bytes": "148349" }, { "name": "YASnippet", "bytes": "8069" } ], "symlink_target": "" }
package compute // Copyright (c) Microsoft and contributors. 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. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // limitations under the License. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) // VirtualMachineScaleSetsClient is the compute Client type VirtualMachineScaleSetsClient struct { BaseClient } // NewVirtualMachineScaleSetsClient creates an instance of the VirtualMachineScaleSetsClient client. func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient { return NewVirtualMachineScaleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewVirtualMachineScaleSetsClientWithBaseURI creates an instance of the VirtualMachineScaleSetsClient client. func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetsClient { return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create or update a VM scale set. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set to create or update. // parameters - the scale set object. func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (result VirtualMachineScaleSetsCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.CreateOrUpdate") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMinimum, Rule: 5, Chain: nil}, }}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMinimum, Rule: 5, Chain: nil}, }}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}, }}, }}}}}); err != nil { return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetsCreateOrUpdateFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // Deallocate deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the // compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. // VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsDeallocateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Deallocate") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", nil, "Failure preparing request") return } result, err = client.DeallocateSender(req) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", result.Response(), "Failure sending request") return } return } // DeallocatePreparer prepares the Deallocate request. func (client VirtualMachineScaleSetsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate", pathParameters), autorest.WithQueryParameters(queryParameters)) if VMInstanceIDs != nil { preparer = autorest.DecoratePreparer(preparer, autorest.WithJSON(VMInstanceIDs)) } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // DeallocateSender sends the Deallocate request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetsDeallocateFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // DeallocateResponder handles the response to the Deallocate request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp return } // Delete deletes a VM scale set. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. func (client VirtualMachineScaleSetsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetsDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Delete") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", result.Response(), "Failure sending request") return } return } // DeletePreparer prepares the Delete request. func (client VirtualMachineScaleSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetsDeleteFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } // DeleteInstances deletes virtual machines in a VM scale set. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. // VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) DeleteInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result VirtualMachineScaleSetsDeleteInstancesFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.DeleteInstances") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: VMInstanceIDs, Constraints: []validation.Constraint{{Target: "VMInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "DeleteInstances", err.Error()) } req, err := client.DeleteInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", nil, "Failure preparing request") return } result, err = client.DeleteInstancesSender(req) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", result.Response(), "Failure sending request") return } return } // DeleteInstancesPreparer prepares the DeleteInstances request. func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete", pathParameters), autorest.WithJSON(VMInstanceIDs), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // DeleteInstancesSender sends the DeleteInstances request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Request) (future VirtualMachineScaleSetsDeleteInstancesFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // DeleteInstancesResponder handles the response to the DeleteInstances request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp return } // ForceRecoveryServiceFabricPlatformUpdateDomainWalk manual platform update domain walk to update virtual machines in // a service fabric virtual machine scale set. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. // platformUpdateDomain - the platform update domain for which a manual recovery walk is requested func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32) (result RecoveryWalkResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx, resourceGroupName, VMScaleSetName, platformUpdateDomain) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", nil, "Failure preparing request") return } resp, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure sending request") return } result, err = client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure responding to request") } return } // ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer prepares the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "platformUpdateDomain": autorest.Encode("query", platformUpdateDomain), } preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender sends the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder handles the response to the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp *http.Response) (result RecoveryWalkResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // Get display information about a virtual machine scale set. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. func (client VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSet, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Get") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. func (client VirtualMachineScaleSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // GetInstanceView gets the status of a VM scale set instance. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. func (client VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetInstanceView, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetInstanceView") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", nil, "Failure preparing request") return } resp, err := client.GetInstanceViewSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure sending request") return } result, err = client.GetInstanceViewResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure responding to request") } return } // GetInstanceViewPreparer prepares the GetInstanceView request. func (client VirtualMachineScaleSetsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetInstanceViewSender sends the GetInstanceView request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // GetInstanceViewResponder handles the response to the GetInstanceView request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetInstanceView, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // GetOSUpgradeHistory gets list of OS upgrades on a VM scale set instance. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistory(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory") defer func() { sc := -1 if result.vmsslouh.Response.Response != nil { sc = result.vmsslouh.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.fn = client.getOSUpgradeHistoryNextResults req, err := client.GetOSUpgradeHistoryPreparer(ctx, resourceGroupName, VMScaleSetName) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", nil, "Failure preparing request") return } resp, err := client.GetOSUpgradeHistorySender(req) if err != nil { result.vmsslouh.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure sending request") return } result.vmsslouh, err = client.GetOSUpgradeHistoryResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure responding to request") } return } // GetOSUpgradeHistoryPreparer prepares the GetOSUpgradeHistory request. func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetOSUpgradeHistorySender sends the GetOSUpgradeHistory request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistorySender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // GetOSUpgradeHistoryResponder handles the response to the GetOSUpgradeHistory request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryResponder(resp *http.Response) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // getOSUpgradeHistoryNextResults retrieves the next set of results, if any. func (client VirtualMachineScaleSetsClient) getOSUpgradeHistoryNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListOSUpgradeHistory) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { req, err := lastResults.virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.GetOSUpgradeHistorySender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure sending next results request") } result, err = client.GetOSUpgradeHistoryResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure responding to next results request") } return } // GetOSUpgradeHistoryComplete enumerates all values, automatically crossing page boundaries as required. func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory") defer func() { sc := -1 if result.Response().Response.Response != nil { sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.page, err = client.GetOSUpgradeHistory(ctx, resourceGroupName, VMScaleSetName) return } // List gets a list of all VM scale sets under a resource group. // Parameters: // resourceGroupName - the name of the resource group. func (client VirtualMachineScaleSetsClient) List(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List") defer func() { sc := -1 if result.vmsslr.Response.Response != nil { sc = result.vmsslr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.fn = client.listNextResults req, err := client.ListPreparer(ctx, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.vmsslr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure sending request") return } result.vmsslr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to request") } return } // ListPreparer prepares the List request. func (client VirtualMachineScaleSetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) ListSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // listNextResults retrieves the next set of results, if any. func (client VirtualMachineScaleSetsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListResult) (result VirtualMachineScaleSetListResult, err error) { req, err := lastResults.virtualMachineScaleSetListResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure responding to next results request") } return } // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client VirtualMachineScaleSetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List") defer func() { sc := -1 if result.Response().Response.Response != nil { sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.page, err = client.List(ctx, resourceGroupName) return } // ListAll gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use // nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all // the VM Scale Sets. func (client VirtualMachineScaleSetsClient) ListAll(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll") defer func() { sc := -1 if result.vmsslwlr.Response.Response != nil { sc = result.vmsslwlr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.fn = client.listAllNextResults req, err := client.ListAllPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", nil, "Failure preparing request") return } resp, err := client.ListAllSender(req) if err != nil { result.vmsslwlr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure sending request") return } result.vmsslwlr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to request") } return } // ListAllPreparer prepares the ListAll request. func (client VirtualMachineScaleSetsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListAllSender sends the ListAll request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) ListAllSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListAllResponder handles the response to the ListAll request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) ListAllResponder(resp *http.Response) (result VirtualMachineScaleSetListWithLinkResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // listAllNextResults retrieves the next set of results, if any. func (client VirtualMachineScaleSetsClient) listAllNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListWithLinkResult) (result VirtualMachineScaleSetListWithLinkResult, err error) { req, err := lastResults.virtualMachineScaleSetListWithLinkResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListAllSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure sending next results request") } result, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure responding to next results request") } return } // ListAllComplete enumerates all values, automatically crossing page boundaries as required. func (client VirtualMachineScaleSetsClient) ListAllComplete(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll") defer func() { sc := -1 if result.Response().Response.Response != nil { sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.page, err = client.ListAll(ctx) return } // ListSkus gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed // for each SKU. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. func (client VirtualMachineScaleSetsClient) ListSkus(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus") defer func() { sc := -1 if result.vmsslsr.Response.Response != nil { sc = result.vmsslsr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.fn = client.listSkusNextResults req, err := client.ListSkusPreparer(ctx, resourceGroupName, VMScaleSetName) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", nil, "Failure preparing request") return } resp, err := client.ListSkusSender(req) if err != nil { result.vmsslsr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure sending request") return } result.vmsslsr, err = client.ListSkusResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to request") } return } // ListSkusPreparer prepares the ListSkus request. func (client VirtualMachineScaleSetsClient) ListSkusPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListSkusSender sends the ListSkus request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) ListSkusSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListSkusResponder handles the response to the ListSkus request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) ListSkusResponder(resp *http.Response) (result VirtualMachineScaleSetListSkusResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // listSkusNextResults retrieves the next set of results, if any. func (client VirtualMachineScaleSetsClient) listSkusNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListSkusResult) (result VirtualMachineScaleSetListSkusResult, err error) { req, err := lastResults.virtualMachineScaleSetListSkusResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListSkusSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure sending next results request") } result, err = client.ListSkusResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure responding to next results request") } return } // ListSkusComplete enumerates all values, automatically crossing page boundaries as required. func (client VirtualMachineScaleSetsClient) ListSkusComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus") defer func() { sc := -1 if result.Response().Response.Response != nil { sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.page, err = client.ListSkus(ctx, resourceGroupName, VMScaleSetName) return } // PerformMaintenance perform maintenance on one or more virtual machines in a VM scale set. Operation on instances // which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: // https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. // VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsPerformMaintenanceFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PerformMaintenance") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", nil, "Failure preparing request") return } result, err = client.PerformMaintenanceSender(req) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", result.Response(), "Failure sending request") return } return } // PerformMaintenancePreparer prepares the PerformMaintenance request. func (client VirtualMachineScaleSetsClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance", pathParameters), autorest.WithQueryParameters(queryParameters)) if VMInstanceIDs != nil { preparer = autorest.DecoratePreparer(preparer, autorest.WithJSON(VMInstanceIDs)) } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // PerformMaintenanceSender sends the PerformMaintenance request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetsPerformMaintenanceFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp return } // PowerOff power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and // you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. // VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsPowerOffFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PowerOff") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", nil, "Failure preparing request") return } result, err = client.PowerOffSender(req) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", result.Response(), "Failure sending request") return } return } // PowerOffPreparer prepares the PowerOff request. func (client VirtualMachineScaleSetsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff", pathParameters), autorest.WithQueryParameters(queryParameters)) if VMInstanceIDs != nil { preparer = autorest.DecoratePreparer(preparer, autorest.WithJSON(VMInstanceIDs)) } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // PowerOffSender sends the PowerOff request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetsPowerOffFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // PowerOffResponder handles the response to the PowerOff request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp return } // Redeploy redeploy one or more virtual machines in a VM scale set. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. // VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRedeployFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Redeploy") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", nil, "Failure preparing request") return } result, err = client.RedeploySender(req) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", result.Response(), "Failure sending request") return } return } // RedeployPreparer prepares the Redeploy request. func (client VirtualMachineScaleSetsClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy", pathParameters), autorest.WithQueryParameters(queryParameters)) if VMInstanceIDs != nil { preparer = autorest.DecoratePreparer(preparer, autorest.WithJSON(VMInstanceIDs)) } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // RedeploySender sends the Redeploy request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetsRedeployFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // RedeployResponder handles the response to the Redeploy request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp return } // Reimage reimages (upgrade the operating system) one or more virtual machines in a VM scale set. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. // VMScaleSetReimageInput - parameters for Reimaging VM ScaleSet. func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (result VirtualMachineScaleSetsReimageFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Reimage") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, VMScaleSetReimageInput) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", nil, "Failure preparing request") return } result, err = client.ReimageSender(req) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", result.Response(), "Failure sending request") return } return } // ReimagePreparer prepares the Reimage request. func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", pathParameters), autorest.WithQueryParameters(queryParameters)) if VMScaleSetReimageInput != nil { preparer = autorest.DecoratePreparer(preparer, autorest.WithJSON(VMScaleSetReimageInput)) } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ReimageSender sends the Reimage request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetsReimageFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // ReimageResponder handles the response to the Reimage request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp return } // ReimageAll reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation // is only supported for managed disks. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. // VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsReimageAllFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ReimageAll") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", nil, "Failure preparing request") return } result, err = client.ReimageAllSender(req) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", result.Response(), "Failure sending request") return } return } // ReimageAllPreparer prepares the ReimageAll request. func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall", pathParameters), autorest.WithQueryParameters(queryParameters)) if VMInstanceIDs != nil { preparer = autorest.DecoratePreparer(preparer, autorest.WithJSON(VMInstanceIDs)) } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ReimageAllSender sends the ReimageAll request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetsReimageAllFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // ReimageAllResponder handles the response to the ReimageAll request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp return } // Restart restarts one or more virtual machines in a VM scale set. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. // VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRestartFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Restart") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", nil, "Failure preparing request") return } result, err = client.RestartSender(req) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", result.Response(), "Failure sending request") return } return } // RestartPreparer prepares the Restart request. func (client VirtualMachineScaleSetsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart", pathParameters), autorest.WithQueryParameters(queryParameters)) if VMInstanceIDs != nil { preparer = autorest.DecoratePreparer(preparer, autorest.WithJSON(VMInstanceIDs)) } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // RestartSender sends the Restart request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetsRestartFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // RestartResponder handles the response to the Restart request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp return } // Start starts one or more virtual machines in a VM scale set. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. // VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsStartFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Start") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", nil, "Failure preparing request") return } result, err = client.StartSender(req) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", result.Response(), "Failure sending request") return } return } // StartPreparer prepares the Start request. func (client VirtualMachineScaleSetsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start", pathParameters), autorest.WithQueryParameters(queryParameters)) if VMInstanceIDs != nil { preparer = autorest.DecoratePreparer(preparer, autorest.WithJSON(VMInstanceIDs)) } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // StartSender sends the Start request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetsStartFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // StartResponder handles the response to the Start request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp return } // Update update a VM scale set. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set to create or update. // parameters - the scale set object. func (client VirtualMachineScaleSetsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (result VirtualMachineScaleSetsUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Update") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", nil, "Failure preparing request") return } result, err = client.UpdateSender(req) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", result.Response(), "Failure sending request") return } return } // UpdatePreparer prepares the Update request. func (client VirtualMachineScaleSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetsUpdateFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // UpdateInstances upgrades one or more virtual machines to the latest SKU set in the VM scale set model. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. // VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) UpdateInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result VirtualMachineScaleSetsUpdateInstancesFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.UpdateInstances") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: VMInstanceIDs, Constraints: []validation.Constraint{{Target: "VMInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "UpdateInstances", err.Error()) } req, err := client.UpdateInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", nil, "Failure preparing request") return } result, err = client.UpdateInstancesSender(req) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", result.Response(), "Failure sending request") return } return } // UpdateInstancesPreparer prepares the UpdateInstances request. func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade", pathParameters), autorest.WithJSON(VMInstanceIDs), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // UpdateInstancesSender sends the UpdateInstances request. The method will close the // http.Response Body if it receives an error. func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Request) (future VirtualMachineScaleSetsUpdateInstancesFuture, err error) { var resp *http.Response resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // UpdateInstancesResponder handles the response to the UpdateInstances request. The method always // closes the http.Response Body. func (client VirtualMachineScaleSetsClient) UpdateInstancesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp return }
{ "content_hash": "28d0c877e7a7bf4a14030b92dd591e3a", "timestamp": "", "source": "github", "line_count": 1822, "max_line_length": 255, "avg_line_length": 43.102085620197585, "alnum_prop": 0.778790811388988, "repo_name": "lomik/graphite-clickhouse", "id": "e6eb8334043e76269426ff4572c0aa582d0bb979", "size": "78532", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesets.go", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "408" }, { "name": "Go", "bytes": "192873" }, { "name": "Makefile", "bytes": "3035" }, { "name": "Shell", "bytes": "2916" } ], "symlink_target": "" }
static const char *phTextView = "placeHolderTextView"; @implementation UITextView (PlaceHolder) - (UITextView *)placeHolderTextView { return objc_getAssociatedObject(self, phTextView); } - (void)setPlaceHolderTextView:(UITextView *)placeHolderTextView { objc_setAssociatedObject(self, phTextView, placeHolderTextView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); } - (void)addPlaceHolder:(NSString *)placeHolder { if (![self placeHolderTextView]) { self.delegate = self; UITextView *textView = [[UITextView alloc] initWithFrame:self.bounds]; textView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; textView.font = [UIFont systemFontOfSize:14]; textView.backgroundColor = [UIColor clearColor]; textView.textColor = kRGBCOLOR(210, 210, 210); textView.userInteractionEnabled = NO; textView.text = placeHolder; [self addSubview:textView]; [self setPlaceHolderTextView:textView]; } } # pragma mark - # pragma mark - UITextViewDelegate - (void)textViewDidChange:(UITextView *)textView { if (textView.text.length) { self.placeHolderTextView.hidden = YES; } else { self.placeHolderTextView.hidden = NO; } } - (void)textViewDidEndEditing:(UITextView *)textView { if (textView.text && [textView.text isEqualToString:@""]) { self.placeHolderTextView.hidden = NO; } } @end
{ "content_hash": "adf1c734028739735a58f4a14a941d96", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 103, "avg_line_length": 36.84615384615385, "alnum_prop": 0.7077244258872651, "repo_name": "lihj/Gift", "id": "5880cee0bd20aad63060555fe7ce40e8fc846f88", "size": "1627", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "APP_iOS/APP_iOS/Category/UIKit/UITextView/UITextView+PlaceHolder.m", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "3234" }, { "name": "CSS", "bytes": "183077" }, { "name": "HTML", "bytes": "246645" }, { "name": "JavaScript", "bytes": "7949" }, { "name": "Objective-C", "bytes": "2509701" }, { "name": "Ruby", "bytes": "320" }, { "name": "Shell", "bytes": "8695" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="la" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About VictoriousCoin</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;VictoriousCoin&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Copyright ยฉ 2009-2014 The Bitcoin developers Copyright ยฉ 2012-2014 The NovaCoin developers Copyright ยฉ 2014 The VictoriousCoin developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation>Hoc est experimentale programma. Distributum sub MIT/X11 licentia programmatum, vide comitantem plicam COPYING vel http://www.opensource.org/licenses/mit-license.php. Hoc productum continet programmata composita ab OpenSSL Project pro utendo in OpenSSL Toolkit (http://www.openssl.org/) et programmata cifrarum scripta ab Eric Young (eay@cryptsoft.com) et UPnP programmata scripta ab Thomas Bernard.</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Dupliciter-clicca ut inscriptionem vel titulum mutes</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Crea novam inscriptionem</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copia inscriptionem iam selectam in latibulum systematis</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location line="-46"/> <source>These are your VictoriousCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation>&amp;Copia Inscriptionem</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a VictoriousCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Dele active selectam inscriptionem ex enumeratione</translation> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified VictoriousCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Dele</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>Copia &amp;Titulum</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>&amp;Muta</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma Separata Plica (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Titulus</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Inscriptio</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(nullus titulus)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Dialogus Tesserae</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Insere tesseram</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nova tessera</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Itera novam tesseram</translation> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>For staking only</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+35"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Insero novam tesseram cassidili.&lt;br/&gt;Sodes tessera &lt;b&gt;10 pluriumve fortuitarum litterarum&lt;/b&gt; utere aut &lt;b&gt;octo pluriumve verborum&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Cifra cassidile</translation> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Huic operationi necesse est tessera cassidili tuo ut cassidile reseret.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Resera cassidile</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Huic operationi necesse est tessera cassidili tuo ut cassidile decifret.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Decifra cassidile</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Muta tesseram</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Insero veterem novamque tesseram cassidili.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Confirma cifrationem cassidilis</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Certusne es te velle tuum cassidile cifrare?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>GRAVE: Oportet ulla prioria conservata quae fecisti de plica tui cassidilis reponi a nove generata cifrata plica cassidilis. Propter securitatem, prioria conservata de plica non cifrata cassidilis inutilia fiet simul atque incipis uti novo cifrato cassidili.</translation> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Monitio: Litterae ut capitales seratae sunt!</translation> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>Cassidile cifratum</translation> </message> <message> <location line="-58"/> <source>VictoriousCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Cassidile cifrare abortum est</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Cassidile cifrare abortum est propter internum errorem. Tuum cassidile cifratum non est.</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>Tesserae datae non eaedem sunt.</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>Cassidile reserare abortum est.</translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Tessera inserta pro cassidilis decifrando prava erat.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Cassidile decifrare abortum est.</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Tessera cassidilis successa est in mutando.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+280"/> <source>Sign &amp;message...</source> <translation>Signa &amp;nuntium...</translation> </message> <message> <location line="+242"/> <source>Synchronizing with network...</source> <translation>Synchronizans cum rete...</translation> </message> <message> <location line="-308"/> <source>&amp;Overview</source> <translation>&amp;Summarium</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Monstra generale summarium cassidilis</translation> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation>&amp;Transactiones</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Inspicio historiam transactionum</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>E&amp;xit</source> <translation>E&amp;xi</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Exi applicatione</translation> </message> <message> <location line="+4"/> <source>Show information about VictoriousCoin</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Informatio de &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Monstra informationem de Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Optiones</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Cifra Cassidile...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Conserva Cassidile...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Muta tesseram...</translation> </message> <message numerus="yes"> <location line="+250"/> <source>~%n block(s) remaining</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation type="unfinished"/> </message> <message> <location line="-247"/> <source>&amp;Export...</source> <translation type="unfinished"/> </message> <message> <location line="-62"/> <source>Send coins to a VictoriousCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Modify configuration options for VictoriousCoin</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Encrypt or decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup wallet to another location</source> <translation>Conserva cassidile in locum alium</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Muta tesseram utam pro cassidilis cifrando</translation> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation>Fenestra &amp;Debug</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Aperi terminalem debug et diagnosticalem</translation> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation>&amp;Verifica nuntium...</translation> </message> <message> <location line="-200"/> <source>VictoriousCoin</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet</source> <translation>Cassidile</translation> </message> <message> <location line="+178"/> <source>&amp;About VictoriousCoin</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Monstra/Occulta</translation> </message> <message> <location line="+9"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>&amp;File</source> <translation>&amp;Plica</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>&amp;Configuratio</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>&amp;Auxilium</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Tabella instrumentorum &quot;Tabs&quot;</translation> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+0"/> <location line="+60"/> <source>VictoriousCoin client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+70"/> <source>%n active connection(s) to VictoriousCoin network</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+40"/> <source>Downloaded %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+413"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-403"/> <source>%n second(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="-284"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+288"/> <source>%n minute(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Up to date</source> <translation>Recentissimo</translation> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation>Persequens...</translation> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>Transactio missa</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>Transactio incipiens</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Dies: %1 Quantitas: %2 Typus: %3 Inscriptio: %4 </translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid VictoriousCoin address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Cassidile &lt;b&gt;cifratum&lt;/b&gt; est et iam nunc &lt;b&gt;reseratum&lt;/b&gt;</translation> </message> <message> <location line="+10"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Cassidile &lt;b&gt;cifratum&lt;/b&gt; est et iam nunc &lt;b&gt;seratum&lt;/b&gt;</translation> </message> <message> <location line="+25"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+76"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s)</source> <translation><numerusform>%n hora</numerusform><numerusform>%n horae</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n dies</numerusform><numerusform>%n dies</numerusform></translation> </message> <message> <location line="+18"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. VictoriousCoin can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+90"/> <source>Network Alert</source> <translation>Monitio Retis</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>Quantitas:</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change:</source> <translation type="unfinished"/> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>List mode</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Amount</source> <translation>Quantitas</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation>Inscriptio</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>Dies</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>Confirmatum</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation>Copia inscriptionem</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copia titulum</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>Copia quantitatem</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation>Copia transactionis ID</translation> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+317"/> <source>highest</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium-high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>low-medium</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>low</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>lowest</source> <translation type="unfinished"/> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+66"/> <source>(no label)</source> <translation>(nullus titulus)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>(change)</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Muta Inscriptionem</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Titulus</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Inscriptio</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <source>New receiving address</source> <translation>Nova inscriptio accipiendi</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Nova inscriptio mittendi</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Muta inscriptionem accipiendi</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Muta inscriptionem mittendi</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Inserta inscriptio &quot;%1&quot; iam in libro inscriptionum est.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid VictoriousCoin address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Non potuisse cassidile reserare</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Generare novam clavem abortum est.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+420"/> <location line="+12"/> <source>VictoriousCoin-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Optiones</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Princeps</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Solve &amp;mercedem transactionis</translation> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start VictoriousCoin after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start VictoriousCoin on system login</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>&amp;Rete</translation> </message> <message> <location line="+6"/> <source>Automatically open the VictoriousCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Designa portam utendo &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the VictoriousCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP vicarii:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Porta:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Porta vicarii (e.g. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS &amp;Versio:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>SOCKS versio vicarii (e.g. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Fenestra</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Monstra tantum iconem in tabella systematis postquam fenestram minifactam est.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minifac in tabellam systematis potius quam applicationum</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Minifac potius quam exire applicatione quando fenestra clausa sit. Si haec optio activa est, applicatio clausa erit tantum postquam selegeris Exi in menu.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inifac ad claudendum</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;UI</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Lingua monstranda utenti:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting VictoriousCoin.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unita qua quantitates monstrare:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Selige praedefinitam unitam subdivisionis monstrare in interfacie et quando nummos mittere</translation> </message> <message> <location line="+9"/> <source>Whether to show VictoriousCoin addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Monstra inscriptiones in enumeratione transactionum</translation> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Cancella</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation>praedefinitum</translation> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting VictoriousCoin.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Inscriptio vicarii tradita non valida est.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Schema</translation> </message> <message> <location line="+33"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the VictoriousCoin network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-160"/> <source>Stake:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-107"/> <source>Wallet</source> <translation>Cassidile</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>Immature:</source> <translation>Immatura:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Fossum pendendum quod nondum maturum est</translation> </message> <message> <location line="+20"/> <source>Total:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Recentes transactiones&lt;/b&gt;</translation> </message> <message> <location line="-108"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+113"/> <location line="+1"/> <source>out of sync</source> <translation>non synchronizato</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nomen clientis</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation>N/A</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Versio clientis</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informatio</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Utens OpenSSL versione</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Tempus initiandi</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Rete</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Numerus conexionum</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Catena frustorum</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Numerus frustorum iam nunc</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Aestimatus totalis numerus frustorum</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Hora postremi frusti</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Aperi</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the VictoriousCoin-Qt help message to get a list with possible VictoriousCoin command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Terminale</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Dies aedificandi</translation> </message> <message> <location line="-104"/> <source>VictoriousCoin - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>VictoriousCoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Debug catalogi plica</translation> </message> <message> <location line="+7"/> <source>Open the VictoriousCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Vacuefac terminale</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the VictoriousCoin RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Utere sagittis sursum deorsumque ut per historiam naviges, et &lt;b&gt;Ctrl+L&lt;/b&gt; ut scrinium vacuefacias.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Scribe &lt;b&gt;help&lt;/b&gt; pro summario possibilium mandatorum.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+182"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Mitte Nummos</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>Quantitas:</translation> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 BC</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation>Mitte pluribus accipientibus simul</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Adde &amp;Accipientem</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Vacuefac &amp;Omnia</translation> </message> <message> <location line="+28"/> <source>Balance:</source> <translation>Pendendum:</translation> </message> <message> <location line="+16"/> <source>123.456 BC</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Confirma actionem mittendi</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Mitte</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a VictoriousCoin address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copia quantitatem</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Confirma mittendum nummorum</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation>Inscriptio accipientis non est valida, sodes reproba.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Oportet quantitatem ad pensandum maiorem quam 0 esse.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Quantitas est ultra quod habes.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Quantitas est ultra quod habes cum merces transactionis %1 includitur.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Geminata inscriptio inventa, tantum posse mittere ad quamque inscriptionem semel singulare operatione.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>WARNING: Invalid VictoriousCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(nullus titulus)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>&amp;Quantitas:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Pensa &amp;Ad:</translation> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation>Insero titulum huic inscriptioni ut eam in tuum librum inscriptionum addas.</translation> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation>&amp;Titulus:</translation> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Conglutina inscriptionem ex latibulo</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a VictoriousCoin address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Signationes - Signa / Verifica nuntium</translation> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>&amp;Signa Nuntium</translation> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Potes nuntios signare inscriptionibus tuis ut demonstres te eas possidere. Cautus es non amibiguum signare, quia impetus phiscatorum conentur te fallere ut signes identitatem tuam ad eos. Solas signa sententias cuncte descriptas quibus convenis.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation>Glutina inscriptionem ex latibulo</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Insere hic nuntium quod vis signare</translation> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation>Copia signationem in latibulum systematis</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this VictoriousCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation>Reconstitue omnes campos signandi nuntii</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Vacuefac &amp;Omnia</translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation>&amp;Verifica Nuntium</translation> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Insere inscriptionem signantem, nuntium (cura ut copias intermissiones linearum, spatia, tabs, et cetera exacte) et signationem infra ut nuntium verifices. Cautus esto ne magis legas in signationem quam in nuntio signato ipso est, ut vites falli ab impetu homo-in-medio.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified VictoriousCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation>Reconstitue omnes campos verificandi nuntii</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a VictoriousCoin address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Clicca &quot;Signa Nuntium&quot; ut signatio generetur</translation> </message> <message> <location line="+3"/> <source>Enter VictoriousCoin signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Inscriptio inserta non valida est.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Sodes inscriptionem proba et rursus conare.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>Inserta inscriptio clavem non refert.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Cassidilis reserare cancellatum est.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>Clavis privata absens est pro inserta inscriptione.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Nuntium signare abortum est.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Nuntius signatus.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>Signatio decodificari non potuit.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Sodes signationem proba et rursus conare.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>Signatio non convenit digesto nuntii</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Nuntium verificare abortum est.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Nuntius verificatus.</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation>Apertum donec %1</translation> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+8"/> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation>%1/non conecto</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/non confirmata</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 confirmationes</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Status</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, disseminatum per %n nodo</numerusform><numerusform>, disseminata per %n nodis</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Dies</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Fons</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Generatum</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Ab</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Ad</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>inscriptio propria</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>titulus</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Creditum</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>maturum erit in %n plure frusto</numerusform><numerusform>maturum erit in %n pluribus frustis</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>non acceptum</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Debitum</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Transactionis merces</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Cuncta quantitas</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Nuntius</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Annotatio</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID transactionis</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 20 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informatio de debug</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transactio</translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation>Lectenda</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Quantitas</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>verum</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>falsum</translation> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation>, nondum prospere disseminatum est</translation> </message> <message> <location line="+35"/> <source>unknown</source> <translation>ignotum</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Particularia transactionis</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Haec tabula monstrat descriptionem verbosam transactionis</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+226"/> <source>Date</source> <translation>Dies</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Typus</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Inscriptio</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Quantitas</translation> </message> <message> <location line="+60"/> <source>Open until %1</source> <translation>Apertum donec %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmatum (%1 confirmationes)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation><numerusform>Aperi pro %n plure frusto</numerusform><numerusform>Aperi pro %n pluribus frustis</numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Hoc frustum non acceptum est ab ulla alia nodis et probabiliter non acceptum erit!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Generatum sed non acceptum</translation> </message> <message> <location line="+42"/> <source>Received with</source> <translation>Acceptum cum</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Acceptum ab</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Missum ad</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Pensitatio ad te ipsum</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Fossa</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/a)</translation> </message> <message> <location line="+190"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Status transactionis. Supervola cum mure ut monstretur numerus confirmationum.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Dies et tempus quando transactio accepta est.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Typus transactionis.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Inscriptio destinationis transactionis.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Quantitas remota ex pendendo aut addita ei.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation>Omne</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Hodie</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Hac hebdomade</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Hoc mense</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Postremo mense</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Hoc anno</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Intervallum...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Acceptum cum</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Missum ad</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Ad te ipsum</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Fossa</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Alia</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Insere inscriptionem vel titulum ut quaeras</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Quantitas minima</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copia inscriptionem</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copia titulum</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copia quantitatem</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Copia transactionis ID</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Muta titulum</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Monstra particularia transactionis</translation> </message> <message> <location line="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma Separata Plica (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Confirmatum</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Dies</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Typus</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Titulus</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Inscriptio</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Quantitas</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Intervallum:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>ad</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+206"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>VictoriousCoin version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>Usus:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or victoriouscoind</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation>Enumera mandata</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>Accipe auxilium pro mandato</translation> </message> <message> <location line="+2"/> <source>Options:</source> <translation>Optiones:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: victoriouscoin.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: victoriouscoind.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Specifica indicem datorum</translation> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Constitue magnitudinem databasis cache in megabytes (praedefinitum: 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 7955 or testnet: 17955)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Manutene non plures quam &lt;n&gt; conexiones ad paria (praedefinitum: 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Conecta ad nodum acceptare inscriptiones parium, et disconecte</translation> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation>Specifica tuam propriam publicam inscriptionem</translation> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Limen pro disconectendo paria improba (praedefinitum: 100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Numerum secundorum prohibere ne paria improba reconectant (praedefinitum: 86400)</translation> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Error erat dum initians portam RPC %u pro auscultando in IPv4: %s</translation> </message> <message> <location line="+51"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 7956 or testnet: 17956)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Accept command line and JSON-RPC commands</source> <translation>Accipe terminalis et JSON-RPC mandata.</translation> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"/> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation>Operare infere sicut daemon et mandata accipe</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>Utere rete experimentale</translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Accipe conexiones externas (praedefinitum: 1 nisi -proxy neque -connect)</translation> </message> <message> <location line="-38"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Error erat dum initians portam RPC %u pro auscultando in IPv6, labens retrorsum ad IPv4: %s</translation> </message> <message> <location line="+117"/> <source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Monitio: -paytxfee constitutum valde magnum! Hoc est merces transactionis solves si mittis transactionem.</translation> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong VictoriousCoin will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Monitio: error legendo wallet.dat! Omnes claves recte lectae, sed data transactionum vel libri inscriptionum fortasse desint vel prava sint.</translation> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Monitio: wallet.data corrupta, data salvata! Originalis wallet.dat salvata ut wallet.{timestamp}.bak in %s; si pendendum tuum vel transactiones pravae sunt, oportet ab conservato restituere.</translation> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Conare recipere claves privatas de corrupto wallet.dat</translation> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation>Optiones creandi frustorum:</translation> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation>Conecte sole ad nodos specificatos (vel nodum specificatum)</translation> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Discooperi propriam inscriptionem IP (praedefinitum: 1 quando auscultans et nullum -externalip)</translation> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Non potuisse auscultare in ulla porta. Utere -listen=0 si hoc vis.</translation> </message> <message> <location line="-90"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"/> </message> <message> <location line="+83"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-82"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Maxima magnitudo memoriae pro datis accipendis singulis conexionibus, &lt;n&gt;*1000 octetis/bytes (praedefinitum: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Maxima magnitudo memoriae pro datis mittendis singulis conexionibus, &lt;n&gt;*1000 octetis/bytes (praedefinitum: 1000)</translation> </message> <message> <location line="-16"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Tantum conecte ad nodos in rete &lt;net&gt; (IPv4, IPv6 aut Tor)</translation> </message> <message> <location line="+28"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>Optiones SSL: (vide vici de Bitcoin pro instructionibus SSL configurationis)</translation> </message> <message> <location line="-74"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Mitte informationem vestigii/debug ad terminale potius quam plicam debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Constitue minimam magnitudinem frusti in octetis/bytes (praedefinitum: 0)</translation> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Diminue plicam debug.log ad initium clientis (praedefinitum: 1 nisi -debug)</translation> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Specifica tempumfati conexionis in millisecundis (praedefinitum: 5000)</translation> </message> <message> <location line="+109"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Utere UPnP designare portam auscultandi (praedefinitum: 0)</translation> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Utere UPnP designare portam auscultandi (praedefinitum: 1 quando auscultans)</translation> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Username for JSON-RPC connections</source> <translation>Nomen utentis pro conexionibus JSON-RPC</translation> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Monitio: Haec versio obsoleta est, progressio postulata!</translation> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrupta, salvare abortum est</translation> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation>Tessera pro conexionibus JSON-RPC</translation> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=victoriouscoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;VictoriousCoin Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Permitte conexionibus JSON-RPC ex inscriptione specificata</translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Mitte mandata nodo operanti in &lt;ip&gt; (praedefinitum: 127.0.0.1)</translation> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Pelle mandatum quando optissimum frustum mutat (%s in mandato substituitur ab hash frusti)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Facere mandatum quotiescumque cassidilis transactio mutet (%s in mandato sbstituitur ab TxID)</translation> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>Progredere cassidile ad formam recentissimam</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Constitue magnitudinem stagni clavium ad &lt;n&gt; (praedefinitum: 100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Iterum perlege catenam frustorum propter absentes cassidilis transactiones</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Utere OpenSSL (https) pro conexionibus JSON-RPC</translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>Plica certificationis daemonis moderantis (praedefinitum: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Clavis privata daemonis moderans (praedefinitum: server.pem)</translation> </message> <message> <location line="+1"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation type="unfinished"/> </message> <message> <location line="-158"/> <source>This help message</source> <translation>Hic nuntius auxilii</translation> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. VictoriousCoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>VictoriousCoin</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Non posse conglutinare ad %s in hoc computatro (conglutinare redidit errorem %d, %s)</translation> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Permitte quaerenda DNS pro -addnode, -seednode, et -connect</translation> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation>Legens inscriptiones...</translation> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Error legendi wallet.dat: Cassidile corruptum</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of VictoriousCoin</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart VictoriousCoin to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>Error legendi wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Inscriptio -proxy non valida: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Ignotum rete specificatum in -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Ignota -socks vicarii versio postulata: %i</translation> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Non posse resolvere -bind inscriptonem: &apos;%s&apos;</translation> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Non posse resolvere -externalip inscriptionem: &apos;%s&apos;</translation> </message> <message> <location line="-24"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantitas non valida pro -paytxfee=&lt;quantitas&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>Quantitas non valida</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>Inopia nummorum</translation> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation>Legens indicem frustorum...</translation> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Adice nodum cui conectere et conare sustinere conexionem apertam</translation> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. VictoriousCoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-97"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Loading wallet...</source> <translation>Legens cassidile...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>Non posse cassidile regredi</translation> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>Non posse scribere praedefinitam inscriptionem</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>Iterum perlegens...</translation> </message> <message> <location line="+5"/> <source>Done loading</source> <translation>Completo lengendi</translation> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation>Ut utaris optione %s</translation> </message> <message> <location line="+14"/> <source>Error</source> <translation>Error</translation> </message> <message> <location line="+6"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Necesse est te rpcpassword=&lt;tesseram&gt; constituere in plica configurationum: %s Si plica non existat, crea eam cum permissionibus ut solus eius dominus eam legere sinatur.</translation> </message> </context> </TS>
{ "content_hash": "e31ee38a0a5eae7fb9b9b7de5daeae05", "timestamp": "", "source": "github", "line_count": 3285, "max_line_length": 394, "avg_line_length": 35.8986301369863, "alnum_prop": 0.6110559922664021, "repo_name": "VictoriousCoin/Victorious-Coin", "id": "f1f5c25dc42a6b5aecb6c688436de9bfd0ae8156", "size": "117930", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_la.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "51312" }, { "name": "C", "bytes": "34409" }, { "name": "C++", "bytes": "2585300" }, { "name": "CSS", "bytes": "1127" }, { "name": "Groff", "bytes": "12684" }, { "name": "HTML", "bytes": "50620" }, { "name": "Makefile", "bytes": "121653" }, { "name": "NSIS", "bytes": "5914" }, { "name": "Objective-C", "bytes": "858" }, { "name": "Objective-C++", "bytes": "3537" }, { "name": "Python", "bytes": "41580" }, { "name": "QMake", "bytes": "13982" }, { "name": "Shell", "bytes": "9083" }, { "name": "TypeScript", "bytes": "1481146" } ], "symlink_target": "" }
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Plus Parser (+a)</title> <link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="../../../../index.html" title="Spirit 2.59"> <link rel="up" href="../operator.html" title="Parser Operators"> <link rel="prev" href="permutation.html" title="Permutation Parser (a ^ b)"> <link rel="next" href="sequence.html" title="Sequence Parser (a &gt;&gt; b)"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td> <td align="center"><a href="../../../../../../../../index.html">Home</a></td> <td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="permutation.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../operator.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="sequence.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h5 class="title"> <a name="spirit.qi.reference.operator.plus"></a><a class="link" href="plus.html" title="Plus Parser (+a)">Plus Parser (<code class="computeroutput"><span class="special">+</span><span class="identifier">a</span></code>)</a> </h5></div></div></div> <h6> <a name="spirit.qi.reference.operator.plus.h0"></a> <span class="phrase"><a name="spirit.qi.reference.operator.plus.description"></a></span><a class="link" href="plus.html#spirit.qi.reference.operator.plus.description">Description</a> </h6> <p> The plus operator, <code class="computeroutput"><span class="special">+</span><span class="identifier">a</span></code>, is a unary operator that matches its operand one or more times. </p> <h6> <a name="spirit.qi.reference.operator.plus.h1"></a> <span class="phrase"><a name="spirit.qi.reference.operator.plus.header"></a></span><a class="link" href="plus.html#spirit.qi.reference.operator.plus.header">Header</a> </h6> <pre class="programlisting"><span class="comment">// forwards to &lt;boost/spirit/home/qi/operator/plus.hpp&gt;</span> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">spirit</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">qi_plus</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> </pre> <p> Also, see <a class="link" href="../../../structure/include.html" title="Include">Include Structure</a>. </p> <h6> <a name="spirit.qi.reference.operator.plus.h2"></a> <span class="phrase"><a name="spirit.qi.reference.operator.plus.model_of"></a></span><a class="link" href="plus.html#spirit.qi.reference.operator.plus.model_of">Model of</a> </h6> <div class="blockquote"><blockquote class="blockquote"><p> <a class="link" href="../parser_concepts/unaryparser.html" title="UnaryParser"><code class="computeroutput"><span class="identifier">UnaryParser</span></code></a> </p></blockquote></div> <div class="variablelist"> <p class="title"><b>Notation</b></p> <dl class="variablelist"> <dt><span class="term"><code class="computeroutput"><span class="identifier">a</span></code></span></dt> <dd><p> A <a class="link" href="../parser_concepts/parser.html" title="Parser"><code class="computeroutput"><span class="identifier">Parser</span></code></a> </p></dd> </dl> </div> <h6> <a name="spirit.qi.reference.operator.plus.h3"></a> <span class="phrase"><a name="spirit.qi.reference.operator.plus.expression_semantics"></a></span><a class="link" href="plus.html#spirit.qi.reference.operator.plus.expression_semantics">Expression Semantics</a> </h6> <p> Semantics of an expression is defined only where it differs from, or is not defined in <a class="link" href="../parser_concepts/unaryparser.html" title="UnaryParser"><code class="computeroutput"><span class="identifier">UnaryParser</span></code></a>. </p> <div class="informaltable"><table class="table"> <colgroup> <col> <col> </colgroup> <thead><tr> <th> <p> Expression </p> </th> <th> <p> Semantics </p> </th> </tr></thead> <tbody><tr> <td> <p> <code class="computeroutput"><span class="special">+</span><span class="identifier">a</span></code> </p> </td> <td> <p> Match <code class="computeroutput"><span class="identifier">a</span></code> one or more times. </p> </td> </tr></tbody> </table></div> <h6> <a name="spirit.qi.reference.operator.plus.h4"></a> <span class="phrase"><a name="spirit.qi.reference.operator.plus.attributes"></a></span><a class="link" href="plus.html#spirit.qi.reference.operator.plus.attributes">Attributes</a> </h6> <p> See <a class="link" href="../../quick_reference/compound_attribute_rules.html#spirit.qi.quick_reference.compound_attribute_rules.notation">Compound Attribute Notation</a>. </p> <div class="informaltable"><table class="table"> <colgroup> <col> <col> </colgroup> <thead><tr> <th> <p> Expression </p> </th> <th> <p> Attribute </p> </th> </tr></thead> <tbody><tr> <td> <p> <code class="computeroutput"><span class="special">+</span><span class="identifier">a</span></code> </p> </td> <td> <p> </p> <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">a</span><span class="special">:</span> <span class="identifier">A</span> <span class="special">--&gt;</span> <span class="special">+</span><span class="identifier">a</span><span class="special">:</span> <span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">A</span><span class="special">&gt;</span> <span class="identifier">a</span><span class="special">:</span> <span class="identifier">Unused</span> <span class="special">--&gt;</span> <span class="special">+</span><span class="identifier">a</span><span class="special">:</span> <span class="identifier">Unused</span></pre> <p> </p> </td> </tr></tbody> </table></div> <h6> <a name="spirit.qi.reference.operator.plus.h5"></a> <span class="phrase"><a name="spirit.qi.reference.operator.plus.complexity"></a></span><a class="link" href="plus.html#spirit.qi.reference.operator.plus.complexity">Complexity</a> </h6> <div class="blockquote"><blockquote class="blockquote"><p> The overall complexity of the Plus is defined by the complexity of its subject, <code class="computeroutput"><span class="identifier">a</span></code>, multiplied by the number of repetitions. The complexity of the Plus itself is O(N), where N is the number successful repetitions. </p></blockquote></div> <h6> <a name="spirit.qi.reference.operator.plus.h6"></a> <span class="phrase"><a name="spirit.qi.reference.operator.plus.example"></a></span><a class="link" href="plus.html#spirit.qi.reference.operator.plus.example">Example</a> </h6> <div class="note"><table border="0" summary="Note"> <tr> <td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../images/note.png"></td> <th align="left">Note</th> </tr> <tr><td align="left" valign="top"><p> The test harness for the example(s) below is presented in the <a class="link" href="../basics.html#spirit.qi.reference.basics.examples">Basics Examples</a> section. </p></td></tr> </table></div> <p> Some using declarations: </p> <p> </p> <pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">ascii</span><span class="special">::</span><span class="identifier">alpha</span><span class="special">;</span> <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">qi</span><span class="special">::</span><span class="identifier">lexeme</span><span class="special">;</span> </pre> <p> </p> <p> Parse one or more strings containing one or more alphabetic characters and put them in a vector: </p> <p> </p> <pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&gt;</span> <span class="identifier">attr</span><span class="special">;</span> <span class="identifier">test_phrase_parser_attr</span><span class="special">(</span><span class="string">"yaba daba doo"</span><span class="special">,</span> <span class="special">+</span><span class="identifier">lexeme</span><span class="special">[+</span><span class="identifier">alpha</span><span class="special">],</span> <span class="identifier">attr</span><span class="special">);</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">attr</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">&lt;&lt;</span> <span class="char">','</span> <span class="special">&lt;&lt;</span> <span class="identifier">attr</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">&lt;&lt;</span> <span class="char">','</span> <span class="special">&lt;&lt;</span> <span class="identifier">attr</span><span class="special">[</span><span class="number">2</span><span class="special">]</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> </pre> <p> </p> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright ยฉ 2001-2011 Joel de Guzman, Hartmut Kaiser<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="permutation.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../operator.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="sequence.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
{ "content_hash": "af014ac158f16d4f549a8e04aee252b0", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 901, "avg_line_length": 62.04390243902439, "alnum_prop": 0.6056293733784103, "repo_name": "arangodb/arangodb", "id": "9967944f9a68c6963101213ca7d8005a18d2ca1b", "size": "12720", "binary": false, "copies": "3", "ref": "refs/heads/devel", "path": "3rdParty/boost/1.78.0/libs/spirit/doc/html/spirit/qi/reference/operator/plus.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "61827" }, { "name": "C", "bytes": "311036" }, { "name": "C++", "bytes": "35149373" }, { "name": "CMake", "bytes": "387268" }, { "name": "CSS", "bytes": "210549" }, { "name": "EJS", "bytes": "232160" }, { "name": "HTML", "bytes": "23114" }, { "name": "JavaScript", "bytes": "33841256" }, { "name": "LLVM", "bytes": "15003" }, { "name": "NASL", "bytes": "381737" }, { "name": "NSIS", "bytes": "47138" }, { "name": "Pascal", "bytes": "75391" }, { "name": "Perl", "bytes": "9811" }, { "name": "PowerShell", "bytes": "6806" }, { "name": "Python", "bytes": "190515" }, { "name": "SCSS", "bytes": "255542" }, { "name": "Shell", "bytes": "133576" }, { "name": "TypeScript", "bytes": "179074" }, { "name": "Yacc", "bytes": "79620" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <title>Oscilloscope</title> <style> body { margin: 0; background-color: #1a1a1a; color: #dddddd; text-align: center; } canvas { display: block; } button { margin-top: 100px; padding: 1em 2em; font-size: 1.5em; } </style> </head> <body> <button>Start Example</button> <script src="https://cdn.jsdelivr.net/npm/oscilloscope@1.x/dist/oscilloscope.min.js"></script> <!-- Examples --> <script src="microphone.js"></script> <!-- <script src="audio-element.js"></script> --> <!-- <script src="custom.js"></script> --> <script> document.querySelector('button').addEventListener('click', function() { document.querySelector('button').style.display = 'none'; startExample(); }) </script> </body> </html>
{ "content_hash": "749ea78e3e6397c81d75ecd6546c1b7d", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 96, "avg_line_length": 22.07894736842105, "alnum_prop": 0.5887961859356377, "repo_name": "mathiasvr/audio-oscilloscope", "id": "5c37d547b1bea811dcc6a94e3c86d172246a3eca", "size": "839", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1729" } ], "symlink_target": "" }
const webpack = require('webpack'); const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); module.exports = () => { return { entry: { 'create-hint': './src/index' }, mode: 'production', module: { rules: [ { test: /\.ts$/, use: [{ loader: 'ts-loader', options: { configFile: 'tsconfig-webpack.json' } }] } ] }, node: { __dirname: false, __filename: false, path: true, process: false }, output: { filename: 'src/[name].js' }, plugins: [ new ForkTsCheckerWebpackPlugin(), new webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true }), // We set process.env.webpack becase there are different code paths if we are bundling around loading resources new webpack.DefinePlugin({ 'process.env.webpack': JSON.stringify(true) }), new webpack.ProgressPlugin() ], resolve: { alias: { handlebars: 'handlebars/dist/handlebars.min.js' }, extensions: ['.ts', '.js', '.json'] }, target: 'node' }; };
{ "content_hash": "c5c17c4e44693a21987854aa14becc5f", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 123, "avg_line_length": 33.717948717948715, "alnum_prop": 0.47300380228136885, "repo_name": "sonarwhal/sonar", "id": "eed0eb9af28987df5e7ccee29a934cfc097f272a", "size": "1315", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/create-hint/webpack.config.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "507" }, { "name": "HTML", "bytes": "8263" }, { "name": "JavaScript", "bytes": "11468" }, { "name": "TypeScript", "bytes": "620538" } ], "symlink_target": "" }
import { FocusableOption, FocusKeyManager } from '@angular/cdk/a11y'; import { SelectionModel } from '@angular/cdk/collections'; import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList, Renderer2 } from '@angular/core'; import { CanDisable, CanDisableRipple, HasTabIndex, MatLine } from '@angular/material/core'; /** @docs-private */ export declare class MatSelectionListBase { } export declare const _MatSelectionListMixinBase: (new (...args: any[]) => HasTabIndex) & (new (...args: any[]) => CanDisableRipple) & (new (...args: any[]) => CanDisable) & typeof MatSelectionListBase; /** @docs-private */ export declare class MatListOptionBase { } export declare const _MatListOptionMixinBase: (new (...args: any[]) => CanDisableRipple) & typeof MatListOptionBase; /** Event emitted by a selection-list whenever the state of an option is changed. */ export interface MatSelectionListOptionEvent { option: MatListOption; } /** * Component for list-options of selection-list. Each list-option can automatically * generate a checkbox and can put current item into the selectionModel of selection-list * if the current item is checked. */ export declare class MatListOption extends _MatListOptionMixinBase implements AfterContentInit, OnInit, OnDestroy, FocusableOption, CanDisableRipple { private _renderer; private _element; private _changeDetector; selectionList: MatSelectionList; private _lineSetter; private _selected; private _disabled; /** Whether the option has focus. */ _hasFocus: boolean; _lines: QueryList<MatLine>; /** Whether the label should appear before or after the checkbox. Defaults to 'after' */ checkboxPosition: 'before' | 'after'; /** Value of the option */ value: any; /** Whether the option is disabled. */ disabled: any; /** Whether the option is selected. */ selected: boolean; /** Emitted when the option is selected. */ selectChange: EventEmitter<MatSelectionListOptionEvent>; /** Emitted when the option is deselected. */ deselected: EventEmitter<MatSelectionListOptionEvent>; constructor(_renderer: Renderer2, _element: ElementRef, _changeDetector: ChangeDetectorRef, selectionList: MatSelectionList); ngOnInit(): void; ngAfterContentInit(): void; ngOnDestroy(): void; /** Toggles the selection state of the option. */ toggle(): void; /** Allows for programmatic focusing of the option. */ focus(): void; /** Whether this list item should show a ripple effect when clicked. */ _isRippleDisabled(): any; _handleClick(): void; _handleFocus(): void; /** Retrieves the DOM element of the component host. */ _getHostElement(): HTMLElement; } /** * Material Design list component where each item is a selectable option. Behaves as a listbox. */ export declare class MatSelectionList extends _MatSelectionListMixinBase implements FocusableOption, CanDisable, CanDisableRipple, HasTabIndex, AfterContentInit { private _element; /** The FocusKeyManager which handles focus. */ _keyManager: FocusKeyManager<MatListOption>; /** The option components contained within this selection-list. */ options: QueryList<MatListOption>; /** The currently selected options. */ selectedOptions: SelectionModel<MatListOption>; constructor(_element: ElementRef, tabIndex: string); ngAfterContentInit(): void; /** Focus the selection-list. */ focus(): void; /** Selects all of the options. */ selectAll(): void; /** Deselects all of the options. */ deselectAll(): void; /** Sets the focused option of the selection-list. */ _setFocusedOption(option: MatListOption): void; /** Removes an option from the selection list and updates the active item. */ _removeOptionFromList(option: MatListOption): void; /** Passes relevant key presses to our key manager. */ _keydown(event: KeyboardEvent): void; /** Toggles the selected state of the currently focused option. */ private _toggleSelectOnFocusedOption(); /** * Utility to ensure all indexes are valid. * * @param index The index to be checked. * @returns True if the index is valid for our list of options. */ private _isValidIndex(index); /** Returns the index of the specified list option. */ private _getOptionIndex(option); }
{ "content_hash": "9b308a9dc65a5cab58d59d93c1423eaa", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 201, "avg_line_length": 45.47422680412371, "alnum_prop": 0.7104964860575833, "repo_name": "farazaftab/sjhschool", "id": "37e549a30d8a455bf192653c7db6a0026f2980d8", "size": "4613", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "node_modules/@angular/material/list/typings/selection-list.d.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "13511" }, { "name": "HTML", "bytes": "43011" }, { "name": "JavaScript", "bytes": "2341" }, { "name": "TypeScript", "bytes": "82177" } ], "symlink_target": "" }
package org.scalafmt class ScalafmtConfigTest extends org.scalatest.FunSuite { test("project.matcher") { val config = Scalafmt .parseHoconConfig( """ |project.excludeFilters = [ | "scalafmt-benchmarks/src/resources" | "/sbt-test/" | "bin/issue" |] """.stripMargin ) .get assert(config.project.matcher.matches("qux/Kazbar.scala")) assert(!config.project.matcher.matches("foo/sbt-test/src/main")) } }
{ "content_hash": "d7de4379428b0c9ab1c418990c87c8ff", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 68, "avg_line_length": 23.952380952380953, "alnum_prop": 0.588469184890656, "repo_name": "olafurpg/scalafmt", "id": "5c9e5ff66f0056844c1ad3d164543399612297cf", "size": "503", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "scalafmt-core/shared/src/test/scala/org/scalafmt/ScalafmtConfigTest.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "6516" }, { "name": "HTML", "bytes": "54" }, { "name": "Java", "bytes": "8600" }, { "name": "JavaScript", "bytes": "12337" }, { "name": "PowerShell", "bytes": "32" }, { "name": "Scala", "bytes": "1093161" }, { "name": "Shell", "bytes": "24508" }, { "name": "Standard ML", "bytes": "1765" } ], "symlink_target": "" }
package nl.knaw.dans.common.ldap.management; import java.io.IOException; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import javax.naming.Context; import javax.naming.NameNotFoundException; import javax.naming.NamingException; import javax.naming.directory.Attribute; import javax.naming.directory.Attributes; import javax.naming.directory.BasicAttribute; import javax.naming.directory.BasicAttributes; import javax.naming.directory.DirContext; import javax.naming.directory.InitialDirContext; import nl.knaw.dans.common.ldap.ds.Constants; public abstract class LdapServerBuilder { public static final String EASY_CONTEXT = "ou=easy," + Constants.DANS_CONTEXT; public static final String EASY_GROUPS_CONTEXT = "ou=groups," + EASY_CONTEXT; public static final String EASY_USERS_CONTEXT = "ou=users," + EASY_CONTEXT; public static final String EASY_MIGRATION_CONTEXT = "ou=migration," + EASY_CONTEXT; public static final String EASY_FEDERATION_CONTEXT = "ou=federation," + EASY_CONTEXT; public static final String DCCD_CONTEXT = "ou=dccd," + Constants.DANS_CONTEXT; public static final String DCCD_ORGANISATIONS_CONTEXT = "ou=organisations," + DCCD_CONTEXT; public static final String DCCD_USERS_CONTEXT = "ou=users," + DCCD_CONTEXT; private DirContext ctx; private DirContext rootContext; private String securityCredentials; public LdapServerBuilder() throws NamingException { } public abstract String getProviderUrl(); public abstract String getSecurityPrincipal(); public String getSecurityCredentials() { if (securityCredentials == null) { securityCredentials = Constants.DEFAULT_SECURITY_CREDENTIALS; } return securityCredentials; } public void setSecurityCredentials(String securityCredentials) { this.securityCredentials = securityCredentials; } protected Hashtable<String, String> getEnvironment() { Hashtable<String, String> env = new Hashtable<String, String>(); env.put(Context.INITIAL_CONTEXT_FACTORY, Constants.CONTEXT_FACTORY); env.put(Context.SECURITY_AUTHENTICATION, Constants.SIMPLE_AUTHENTICATION); env.put(Context.PROVIDER_URL, getProviderUrl()); env.put(Context.SECURITY_PRINCIPAL, getSecurityPrincipal()); env.put(Context.SECURITY_CREDENTIALS, getSecurityCredentials()); return env; } public DirContext getDirContext() throws NamingException { if (ctx == null) { ctx = new InitialDirContext(getEnvironment()); } return ctx; } public DirContext getRootContext() throws NamingException { if (rootContext == null) { rootContext = getDirContext().getSchema(""); } return rootContext; } public List<AbstractSchema> getSchemas() { List<AbstractSchema> schemas = new ArrayList<AbstractSchema>(); schemas.add(new DANSSchema()); schemas.add(new EasySchema()); schemas.add(new DCCDSchema()); return schemas; } public void buildServer() throws NamingException, IOException { buildContexts(); buildSchemas(); } public void buildSchemas() throws NamingException, IOException { List<AbstractSchema> schemas = getSchemas(); System.out.println("Count schemas = " + schemas.size()); // create attributeTypes for (AbstractSchema schema : schemas) { buildAttributeTypes(schema); } // destroy objectClasses int count = schemas.size() - 1; for (int i = count; i >= 0; i--) { destroyObjectClasses(schemas.get(i)); } // create objectClasses for (AbstractSchema schema : schemas) { buildObjectClasses(schema); } } protected void buildAttributeTypes(AbstractSchema schema) throws NamingException { System.out.println("BUILDING attributeTypes " + schema.getSchemaName() + " SCHEMA"); for (Attributes attrs : schema.getAttributeTypes()) { String name = "AttributeDefinition/" + attrs.get("NAME").get(); if (!isSchemaBound(name)) { createSchema(name, attrs); } } } protected void destroyObjectClasses(AbstractSchema schema) throws NamingException { System.out.println("DESTROYING objectClasses " + schema.getSchemaName() + " SCHEMA"); for (Attributes attrs : schema.getObjectClasses()) { String name = "ClassDefinition/" + attrs.get("NAME").get(); if (isSchemaBound(name)) { getRootContext().destroySubcontext(name); System.out.println("objectClass destroyed: " + name); } } } protected void buildObjectClasses(AbstractSchema schema) throws NamingException { System.out.println("BUILDING objectClasses " + schema.getSchemaName() + " SCHEMA"); for (Attributes attrs : schema.getObjectClasses()) { String name = "ClassDefinition/" + attrs.get("NAME").get(); if (!isSchemaBound(name)) { createSchema(name, attrs); } } } public void buildContexts() throws NamingException { buildDansContexts(); buildEasyContexts(); buildDccdContexts(); } protected void buildDansContexts() throws NamingException { System.out.println("BUILDING DANS CONTEXTS"); String dn = Constants.DANS_CONTEXT; if (!isContextBound(dn)) { Attributes attrs = new BasicAttributes(); Attribute oc = new BasicAttribute("objectclass"); oc.add("extensibleObject"); oc.add("domain"); oc.add("top"); attrs.put(oc); attrs.put("dc", Constants.dcDANS); attrs.put("dc", Constants.dcKNAW); attrs.put("dc", Constants.dcNL); buildContext(dn, attrs); } dn = Constants.TEST_CONTEXT; if (!isContextBound(dn)) { Attributes attrs = new BasicAttributes(); Attribute oc = new BasicAttribute("objectclass"); oc.add("extensibleObject"); oc.add("organizationalUnit"); oc.add("top"); attrs.put(oc); attrs.put("ou", Constants.ouTEST); buildContext(dn, attrs); } dn = Constants.TEST_USERS_CONTEXT; if (!isContextBound(dn)) { Attributes attrs = new BasicAttributes(); Attribute oc = new BasicAttribute("objectclass"); oc.add("extensibleObject"); oc.add("organizationalUnit"); oc.add("top"); attrs.put(oc); attrs.put("ou", Constants.ouUSERS); buildContext(dn, attrs); } dn = Constants.TEST_MIGRATION_CONTEXT; if (!isContextBound(dn)) { Attributes attrs = new BasicAttributes(); Attribute oc = new BasicAttribute("objectclass"); oc.add("extensibleObject"); oc.add("organizationalUnit"); oc.add("top"); attrs.put(oc); attrs.put("ou", Constants.ouMIGRATION); buildContext(dn, attrs); } dn = Constants.TEST_FEDERATION_CONTEXT; if (!isContextBound(dn)) { Attributes attrs = new BasicAttributes(); Attribute oc = new BasicAttribute("objectclass"); oc.add("extensibleObject"); oc.add("organizationalUnit"); oc.add("top"); attrs.put(oc); attrs.put("ou", Constants.ouFEDERATION); buildContext(dn, attrs); } System.out.println("END BUILDING DANS CONTEXTS"); } protected void buildEasyContexts() throws NamingException { System.out.println("BUILDING EASY CONTEXT"); String dn = EASY_CONTEXT; if (!isContextBound(dn)) { Attributes attrs = new BasicAttributes(); Attribute oc = new BasicAttribute("objectclass"); oc.add("extensibleObject"); oc.add("organizationalUnit"); oc.add("top"); attrs.put(oc); attrs.put("ou", "easy"); buildContext(dn, attrs); } dn = EASY_GROUPS_CONTEXT; if (!isContextBound(dn)) { Attributes attrs = new BasicAttributes(); Attribute oc = new BasicAttribute("objectclass"); oc.add("extensibleObject"); oc.add("organizationalUnit"); oc.add("top"); attrs.put(oc); attrs.put("ou", "groups"); buildContext(dn, attrs); } dn = EASY_USERS_CONTEXT; if (!isContextBound(dn)) { Attributes attrs = new BasicAttributes(); Attribute oc = new BasicAttribute("objectclass"); oc.add("extensibleObject"); oc.add("organizationalUnit"); oc.add("top"); attrs.put(oc); attrs.put("ou", "users"); buildContext(dn, attrs); } dn = EASY_MIGRATION_CONTEXT; if (!isContextBound(dn)) { Attributes attrs = new BasicAttributes(); Attribute oc = new BasicAttribute("objectclass"); oc.add("extensibleObject"); oc.add("organizationalUnit"); oc.add("top"); attrs.put(oc); attrs.put("ou", "migration"); buildContext(dn, attrs); } dn = EASY_FEDERATION_CONTEXT; if (!isContextBound(dn)) { Attributes attrs = new BasicAttributes(); Attribute oc = new BasicAttribute("objectclass"); oc.add("extensibleObject"); oc.add("organizationalUnit"); oc.add("top"); attrs.put(oc); attrs.put("ou", "federation"); buildContext(dn, attrs); } System.out.println("END BUILDING EASY CONTEXTS"); } protected void buildDccdContexts() throws NamingException { System.out.println("BUILDING DCCD CONTEXTS"); String dn = DCCD_CONTEXT; if (!isContextBound(dn)) { Attributes attrs = new BasicAttributes(); Attribute oc = new BasicAttribute("objectclass"); oc.add("extensibleObject"); oc.add("organizationalUnit"); oc.add("top"); attrs.put(oc); attrs.put("ou", "dccd"); buildContext(dn, attrs); } dn = DCCD_ORGANISATIONS_CONTEXT; if (!isContextBound(dn)) { Attributes attrs = new BasicAttributes(); Attribute oc = new BasicAttribute("objectclass"); oc.add("extensibleObject"); oc.add("organizationalUnit"); oc.add("top"); attrs.put(oc); attrs.put("ou", "organisations"); // was cn instaed of ou buildContext(dn, attrs); } dn = DCCD_USERS_CONTEXT; if (!isContextBound(dn)) { Attributes attrs = new BasicAttributes(); Attribute oc = new BasicAttribute("objectclass"); oc.add("extensibleObject"); oc.add("organizationalUnit"); oc.add("top"); attrs.put(oc); attrs.put("ou", "users"); buildContext(dn, attrs); } System.out.println("END BUILDING DCCD CONTEXTS"); } protected boolean isContextBound(String context) throws NamingException { boolean hasContext = false; try { getDirContext().listBindings(context); hasContext = true; System.out.println("Context found: " + context); } catch (NameNotFoundException e) { System.out.println("Context does not exist: " + context); } return hasContext; } protected void buildContext(String name, Attributes attrs) throws NamingException { getDirContext().createSubcontext(name, attrs); System.out.println("Added subContext: " + name); } protected void createSchema(String name, Attributes attrs) throws NamingException { getRootContext().createSubcontext(name, attrs); System.out.println("Added schema: " + name); } protected boolean isSchemaBound(String name) throws NamingException { boolean hasName = false; try { getRootContext().list(name); hasName = true; System.out.println("Schema found: " + name); } catch (NameNotFoundException e) { System.out.println("Schema does not exists: " + name); } return hasName; } }
{ "content_hash": "ae06ac322c35135c8c52dff745ef4fc8", "timestamp": "", "source": "github", "line_count": 441, "max_line_length": 95, "avg_line_length": 29.616780045351472, "alnum_prop": 0.5792052675905367, "repo_name": "DANS-KNAW/dccd-legacy-libs", "id": "d1ec45b6c6fa42f192e6242c8fa05b4d36eebe80", "size": "13844", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "dans-ldap/src/main/java/nl/knaw/dans/common/ldap/management/LdapServerBuilder.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "10948" }, { "name": "HTML", "bytes": "20779" }, { "name": "Java", "bytes": "2232276" }, { "name": "JavaScript", "bytes": "47338" }, { "name": "Shell", "bytes": "4282" } ], "symlink_target": "" }
// // TPPublishCommentItem.m // TP // // Created by moxin on 2015-06-11 19:56:48 +0800. // Copyright (c) 2015ๅนด VizLab. All rights reserved. // #import "TPPublishCommentItem.h" @interface TPPublishCommentItem() @end @implementation TPPublishCommentItem - (void)autoKVCBinding:(NSDictionary *)dictionary { [super autoKVCBinding:dictionary]; //todo... } @end
{ "content_hash": "3a6a21dcc6a53f9f1a094923175f37f3", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 52, "avg_line_length": 13.75, "alnum_prop": 0.6857142857142857, "repo_name": "CuiTrip/CuiTrip-IOS", "id": "378db2e102c12f3eec394a424845ff5264725bca", "size": "387", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "TP/ไธšๅŠก/่ฏ„่ฎบ/ๅ‘ๅธƒ/item/TPPublishCommentItem.m", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "7921" }, { "name": "C++", "bytes": "285" }, { "name": "Objective-C", "bytes": "1237376" }, { "name": "Ruby", "bytes": "65245" } ], "symlink_target": "" }
module Enumerable def parallel_map queue = Queue.new self.map do |item| Thread.new do # NOTE: You can not do anything that is not thread safe in this block... queue << yield(item) end end.each(&:join) [].tap do |results| results << queue.pop until queue.empty? end end def parallel_map_with_index queue = Queue.new self.map.with_index do |item, index| Thread.new do # NOTE: You can not do anything that is not thread safe in this block... queue << yield(item, index) end end.each(&:join) [].tap do |results| results << queue.pop until queue.empty? end end def ordered_parallel_map queue = Queue.new self.map.with_index do |item, index| Thread.new do # NOTE: You can not do anything that is not thread safe in this block... queue << [index, yield(item)] end end.each(&:join) [].tap do |results| results << queue.pop until queue.empty? end.sort.map {|index, item| item } end end
{ "content_hash": "683a33c2270bff2a29801c568192f24b", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 80, "avg_line_length": 23.02173913043478, "alnum_prop": 0.5977337110481586, "repo_name": "Tapjoy/slugforge", "id": "2a83865adf793fac51da99b923246ec5f3c36e84", "size": "1059", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/slugforge/helper/enumerable.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "130397" }, { "name": "Shell", "bytes": "16570" } ], "symlink_target": "" }
package rv.ui.screens; import java.awt.Color; import java.awt.geom.Rectangle2D; import rv.comm.rcssserver.GameState; import rv.world.WorldModel; /** * A 2D overlay that displays text on the screen * * @author justin */ public class TextOverlay implements GameState.GameStateChangeListener { private static final int FADE_DURATION = 750; private final String text; private final WorldModel world; private int duration; private int x, y; private float alpha = 1; private int elapsedReal = 0; private long lastTimeReal = 0; private float startTimeServer = 0; private float curTimeServer = 0; private boolean expired = false; private final float[] color; public void setDuration(int duration) { this.duration = duration; } public boolean isExpired() { return expired; } public TextOverlay(String text, WorldModel world, int duration) { this(text, world, duration, new float[] {1, 1, 1, 1}); } public TextOverlay(String text, WorldModel world, int duration, float[] color) { this.world = world; this.duration = duration; this.startTimeServer = world.getGameState().getTime(); curTimeServer = startTimeServer; this.text = text; this.color = color; world.getGameState().addListener(this); } private void update() { long curTimeReal = System.currentTimeMillis(); if (lastTimeReal != 0) elapsedReal += (curTimeReal - lastTimeReal); lastTimeReal = curTimeReal; int elapsedServer = Math.abs((int) ((curTimeServer - startTimeServer) * 1000)); int elapsed = Math.max(elapsedServer, elapsedReal); if (elapsed > duration) alpha = color[3] * Math.max(1 - (float) (elapsed - duration) / FADE_DURATION, 0); if (alpha == 0) { expired = true; world.getGameState().removeListener(this); } } private void calcXY(BorderTextRenderer tr, int w, int h) { Rectangle2D bounds = tr.getBounds(text); x = (int) (w - bounds.getWidth()) / 2; y = (int) (h - bounds.getHeight()) / 2; } public void render(BorderTextRenderer tr, int w, int h) { if (duration > 0) update(); calcXY(tr, w, h); Color textColor = new Color(color[0], color[1], color[2], alpha); Color shadowColor = new Color(0, 0, 0, alpha); tr.drawWithShadow(text, x, y, textColor, shadowColor); } @Override public void gsMeasuresAndRulesChanged(GameState gs) { } @Override public void gsPlayStateChanged(GameState gs) { } @Override public void gsTimeChanged(GameState gs) { curTimeServer = gs.getTime(); } }
{ "content_hash": "78a6d378c1aeceed2022b12eaaa23495", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 84, "avg_line_length": 22.88888888888889, "alnum_prop": 0.7010517799352751, "repo_name": "magmaOffenburg/RoboViz", "id": "5059313431d63a4e269b543e2c8a682324ff0851", "size": "3072", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/rv/ui/screens/TextOverlay.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "396" }, { "name": "GLSL", "bytes": "14184" }, { "name": "HTML", "bytes": "8010" }, { "name": "Java", "bytes": "649137" }, { "name": "Kotlin", "bytes": "101766" }, { "name": "Shell", "bytes": "973" } ], "symlink_target": "" }
Keycutter ========= Multiple rubygems accounts? Manage your keys with ease. Keycutter adds account management to rubygems, so you can manage gems for multiple accounts or organizations. Installation ------------ gem install keycutter Usage ----- Use the `gem keys` command to manage multiple API keys. Upon installation, keycutter will only know about your existing rubygems key: $ gem keys --list *** CURRENT KEYS *** * rubygems If you manage gems for your company or an open-source organization, you can add additional keys: $ gem keys --add work Email: Password: You'll be prompted for your Rubygems.org email and password. If you're using RubyGems 1.4.1 or higher, you can pass the `--host` option to use a rubygems-compatible host when adding a key: $ gem keys --add internal --host http://gems.mycompany.com By default, your existing rubygems.org key is used whenever communicating with rubygems. To switch the default key used to manage remote gems: $ gem keys --default work Your default key is always marked with a *: $ gem keys --list *** CURRENT KEYS *** internal rubygems * work You can also remove keys: $ gem keys --remove project Help is available from the command line: $ gem keys --help
{ "content_hash": "2ed00ad2626393dd9bf5f7cd79981705", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 79, "avg_line_length": 21.442622950819672, "alnum_prop": 0.6934250764525994, "repo_name": "joshfrench/keycutter", "id": "580d23ebeaaba4c12004f050900aa419f7ef1828", "size": "1308", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Gherkin", "bytes": "4180" }, { "name": "Ruby", "bytes": "9324" } ], "symlink_target": "" }
#ifndef QUICKSTEP_UTILITY_LIP_FILTER_LIP_FILTER_ADAPTIVE_PROBER_HPP_ #define QUICKSTEP_UTILITY_LIP_FILTER_LIP_FILTER_ADAPTIVE_PROBER_HPP_ #include <algorithm> #include <cstddef> #include <cstdint> #include <memory> #include <vector> #include "catalog/CatalogTypedefs.hpp" #include "storage/StorageBlockInfo.hpp" #include "storage/TupleIdSequence.hpp" #include "storage/ValueAccessor.hpp" #include "types/Type.hpp" #include "utility/Macros.hpp" #include "utility/lip_filter/LIPFilter.hpp" #include "glog/logging.h" namespace quickstep { /** \addtogroup Utility * @{ */ /** * @brief Helper class for adaptively applying a group of LIPFilters to a * ValueAccessor. Here "adaptive" means that the application ordering * of the filters will be adjusted on the fly based on the filters' miss * rates. */ class LIPFilterAdaptiveProber { public: /** * @brief Constructor. * * @param lip_filters The LIPFilters that will be probed. * @param The target attribute ids for the LIPFilters. * @param The target attribute types for the LIPFilters. */ LIPFilterAdaptiveProber(const std::vector<LIPFilter *> &lip_filters, const std::vector<attribute_id> &attr_ids, const std::vector<const Type *> &attr_types) { DCHECK_EQ(lip_filters.size(), attr_ids.size()); DCHECK_EQ(lip_filters.size(), attr_types.size()); probe_entries_.reserve(lip_filters.size()); for (std::size_t i = 0; i < lip_filters.size(); ++i) { DCHECK(lip_filters[i] != nullptr); probe_entries_.emplace_back( new ProbeEntry(lip_filters[i], attr_ids[i], attr_types[i])); } } /** * @brief Destructor. */ ~LIPFilterAdaptiveProber() { for (ProbeEntry *entry : probe_entries_) { delete entry; } } /** * @brief Apply this group of LIPFilters to the given ValueAccessor. * * @param accessor A ValueAccessor to be filtered. * @return A TupleIdSequence for the hit tuples in the ValueAccessor. */ TupleIdSequence* filterValueAccessor(ValueAccessor *accessor) { const TupleIdSequence *existence_map = accessor->getTupleIdSequenceVirtual(); if (existence_map == nullptr) { return filterValueAccessorNoExistenceMap(accessor); } else { return filterValueAccessorWithExistenceMap(accessor, existence_map); } } private: /** * @brief Internal data structure for representing each LIPFilter probing entry. */ struct ProbeEntry { ProbeEntry(const LIPFilter *lip_filter_in, const attribute_id attr_id_in, const Type *attr_type_in) : lip_filter(lip_filter_in), attr_id(attr_id_in), attr_type(attr_type_in), miss(0), cnt(0) { } /** * @brief Whether a LIPFilter is more selective than the other. */ static bool isBetterThan(const ProbeEntry *a, const ProbeEntry *b) { return a->miss_rate > b->miss_rate; } const LIPFilter *lip_filter; const attribute_id attr_id; const Type *attr_type; std::uint32_t miss; std::uint32_t cnt; float miss_rate; }; /** * @brief Sepecialized filterValueAccessor implementation where the given * ValueAccessor has no existence map. */ inline TupleIdSequence* filterValueAccessorNoExistenceMap(ValueAccessor *accessor) { const std::uint32_t num_tuples = accessor->getNumTuplesVirtual(); std::unique_ptr<TupleIdSequence> matches(new TupleIdSequence(num_tuples)); std::uint32_t next_batch_size = 64u; std::vector<tuple_id> batch(num_tuples); // Apply the filters in a batched manner. std::uint32_t batch_start = 0; do { const std::uint32_t batch_size = std::min(next_batch_size, num_tuples - batch_start); for (std::uint32_t i = 0; i < batch_size; ++i) { batch[i] = batch_start + i; } const std::uint32_t num_hits = filterBatch(accessor, &batch, batch_size); for (std::uint32_t i = 0; i < num_hits; ++i) { matches->set(batch[i], true); } batch_start += batch_size; next_batch_size *= 2; } while (batch_start < num_tuples); return matches.release(); } /** * @brief Sepecialized filterValueAccessor implementation where the given * ValueAccessor has an existence map. */ inline TupleIdSequence* filterValueAccessorWithExistenceMap(ValueAccessor *accessor, const TupleIdSequence *existence_map) { std::unique_ptr<TupleIdSequence> matches( new TupleIdSequence(existence_map->length())); std::uint32_t next_batch_size = 64u; std::uint32_t num_tuples_left = existence_map->numTuples(); std::vector<tuple_id> batch(num_tuples_left); // Apply the filters in a batched manner. TupleIdSequence::const_iterator tuple_it = existence_map->before_begin(); do { const std::uint32_t batch_size = next_batch_size < num_tuples_left ? next_batch_size : num_tuples_left; for (std::uint32_t i = 0; i < batch_size; ++i) { ++tuple_it; batch[i] = *tuple_it; } const std::uint32_t num_hits = filterBatch(accessor, &batch, batch_size); for (std::uint32_t i = 0; i < num_hits; ++i) { matches->set(batch[i], true); } num_tuples_left -= batch_size; next_batch_size *= 2; } while (num_tuples_left > 0); return matches.release(); } /** * @brief Filter the given batch of tuples from the ValueAccessor. Remove any * tuple in the batch that misses any filter. */ inline std::size_t filterBatch(ValueAccessor *accessor, std::vector<tuple_id> *batch, std::uint32_t batch_size) { // Apply the LIPFilters one by one to the batch and update corresponding // cnt/miss statistics. for (auto *entry : probe_entries_) { const std::uint32_t out_size = entry->lip_filter->filterBatch(accessor, entry->attr_id, entry->attr_type->isNullable(), batch, batch_size); entry->cnt += batch_size; entry->miss += batch_size - out_size; batch_size = out_size; } // Adaptively adjust the application ordering after each batch. adaptEntryOrder(); return batch_size; } /** * @brief Adjust LIPFilter application ordering with regard to their miss * rates (i.e. selectivites). */ inline void adaptEntryOrder() { for (auto &entry : probe_entries_) { entry->miss_rate = static_cast<float>(entry->miss) / entry->cnt; } std::sort(probe_entries_.begin(), probe_entries_.end(), ProbeEntry::isBetterThan); } std::vector<ProbeEntry *> probe_entries_; DISALLOW_COPY_AND_ASSIGN(LIPFilterAdaptiveProber); }; /** @} */ } // namespace quickstep #endif // QUICKSTEP_UTILITY_LIP_FILTER_LIP_FILTER_ADAPTIVE_PROBER_HPP_
{ "content_hash": "f19f8f1894758d553c6c53467d6d3d55", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 101, "avg_line_length": 31.67699115044248, "alnum_prop": 0.6162871909484565, "repo_name": "tarunbansal/incubator-quickstep", "id": "e1a75d63a7b8dc6e14008143fa2c4dd708a284ab", "size": "7968", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "utility/lip_filter/LIPFilterAdaptiveProber.hpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "8446499" }, { "name": "CMake", "bytes": "583645" }, { "name": "Protocol Buffer", "bytes": "48907" }, { "name": "Python", "bytes": "33134" }, { "name": "Ruby", "bytes": "5352" }, { "name": "Shell", "bytes": "3408" } ], "symlink_target": "" }
/* $Id: conf.c,v 1.1 2014/03/05 21:15:11 weerd Exp $ */ /* * Copyright (c) 2004 Daniel Hartmeier * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ static const char rcsid[] = "$Id: conf.c,v 1.1 2014/03/05 21:15:11 weerd Exp $"; #include <sys/file.h> #include <sys/param.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "conf.h" int load_conf(const char *fn, struct conf *c) { FILE *f; char s[8192], *t, k[128], *v; int i; if ((f = fopen(fn, "r")) == NULL) return (1); while ((t = fgets(s, sizeof(s), f))) { while (*t == ' ' || *t == '\t') t++; for (i = 0; i < sizeof(k) - 1 && *t && *t != ' ' && *t != '\t'; ++i) k[i] = *t++; k[i] = 0; if (!k[0] || k[0] == '\n' || k[0] == '#') continue; for (i = 0; c[i].n != NULL && strcmp(c[i].n, k); ++i) ; if (c[i].n == NULL) continue; v = c[i].v; while (*t == ' ' || *t == '\t') t++; for (i = 0; i < MAXPATHLEN - 1 && *t && *t != '\n'; ++i) v[i] = *t++; } fclose(f); return (0); }
{ "content_hash": "1357251bb403e14a62b13dfa48d69ac8", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 80, "avg_line_length": 31.554054054054053, "alnum_prop": 0.6338329764453962, "repo_name": "anavarro/undeadly", "id": "0e0cf27b2393018b9e07617cb8c04b6c60cbec3c", "size": "2335", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "conf.c", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "174894" }, { "name": "HTML", "bytes": "51139" }, { "name": "Makefile", "bytes": "1751" }, { "name": "Shell", "bytes": "1015" } ], "symlink_target": "" }
package application import ( "github.com/actionpay/postmanq/analyser" "github.com/actionpay/postmanq/common" "github.com/actionpay/postmanq/consumer" ) // ะฟั€ะธะปะพะถะตะฝะธะต, ะฐะฝะฐะปะธะทะธั€ัƒัŽั‰ะตะต ะฝะตะพั‚ะฟั€ะฐะฒะปะตะฝะฝั‹ะต ัะพะพะฑั‰ะตะฝะธั type Report struct { Abstract } // ัะพะทะดะฐะตั‚ ะฝะพะฒะพะต ะฟั€ะธะปะพะถะตะฝะธะต func NewReport() common.Application { return new(Report) } // ะทะฐะฟัƒัะบะฐะตั‚ ะฟั€ะธะปะพะถะตะฝะธะต func (r *Report) Run() { common.App = r common.Services = []interface{}{ analyser.Inst(), } r.services = []interface{}{ consumer.Inst(), analyser.Inst(), } r.run(r, common.NewApplicationEvent(common.InitApplicationEventKind)) } // ะทะฐะฟัƒัะบะฐะตั‚ ัะตั€ะฒะธัั‹ ะฟั€ะธะปะพะถะตะฝะธั func (r *Report) FireRun(event *common.ApplicationEvent, abstractService interface{}) { service := abstractService.(common.ReportService) go service.OnShowReport() }
{ "content_hash": "ca5a26539cf0a54b2eb7a756749df483", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 87, "avg_line_length": 22.194444444444443, "alnum_prop": 0.7484355444305382, "repo_name": "actionpay/postmanq", "id": "9d315dba23aae54e647fcf34df26f0fe08573041", "size": "912", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/report.go", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Go", "bytes": "170504" }, { "name": "PHP", "bytes": "3452" }, { "name": "Shell", "bytes": "752" } ], "symlink_target": "" }
package promql import ( "encoding/json" "fmt" "strconv" "strings" "github.com/pkg/errors" "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" ) func (Matrix) Type() parser.ValueType { return parser.ValueTypeMatrix } func (Vector) Type() parser.ValueType { return parser.ValueTypeVector } func (Scalar) Type() parser.ValueType { return parser.ValueTypeScalar } func (String) Type() parser.ValueType { return parser.ValueTypeString } // String represents a string value. type String struct { T int64 V string } func (s String) String() string { return s.V } func (s String) MarshalJSON() ([]byte, error) { return json.Marshal([...]interface{}{float64(s.T) / 1000, s.V}) } // Scalar is a data point that's explicitly not associated with a metric. type Scalar struct { T int64 V float64 } func (s Scalar) String() string { v := strconv.FormatFloat(s.V, 'f', -1, 64) return fmt.Sprintf("scalar: %v @[%v]", v, s.T) } func (s Scalar) MarshalJSON() ([]byte, error) { v := strconv.FormatFloat(s.V, 'f', -1, 64) return json.Marshal([...]interface{}{float64(s.T) / 1000, v}) } // Series is a stream of data points belonging to a metric. type Series struct { Metric labels.Labels `json:"metric"` Points []Point `json:"values"` } func (s Series) String() string { vals := make([]string, len(s.Points)) for i, v := range s.Points { vals[i] = v.String() } return fmt.Sprintf("%s =>\n%s", s.Metric, strings.Join(vals, "\n")) } // Point represents a single data point for a given timestamp. type Point struct { T int64 V float64 } func (p Point) String() string { v := strconv.FormatFloat(p.V, 'f', -1, 64) return fmt.Sprintf("%v @[%v]", v, p.T) } // MarshalJSON implements json.Marshaler. func (p Point) MarshalJSON() ([]byte, error) { v := strconv.FormatFloat(p.V, 'f', -1, 64) return json.Marshal([...]interface{}{float64(p.T) / 1000, v}) } // Sample is a single sample belonging to a metric. type Sample struct { Point Metric labels.Labels } func (s Sample) String() string { return fmt.Sprintf("%s => %s", s.Metric, s.Point) } func (s Sample) MarshalJSON() ([]byte, error) { v := struct { M labels.Labels `json:"metric"` V Point `json:"value"` }{ M: s.Metric, V: s.Point, } return json.Marshal(v) } // Vector is basically only an alias for model.Samples, but the // contract is that in a Vector, all Samples have the same timestamp. type Vector []Sample func (vec Vector) String() string { entries := make([]string, len(vec)) for i, s := range vec { entries[i] = s.String() } return strings.Join(entries, "\n") } // ContainsSameLabelset checks if a vector has samples with the same labelset // Such a behavior is semantically undefined // https://github.com/prometheus/prometheus/issues/4562 func (vec Vector) ContainsSameLabelset() bool { l := make(map[uint64]struct{}, len(vec)) for _, s := range vec { hash := s.Metric.Hash() if _, ok := l[hash]; ok { return true } l[hash] = struct{}{} } return false } // Matrix is a slice of Series that implements sort.Interface and // has a String method. type Matrix []Series func (m Matrix) String() string { // TODO(fabxc): sort, or can we rely on order from the querier? strs := make([]string, len(m)) for i, ss := range m { strs[i] = ss.String() } return strings.Join(strs, "\n") } // TotalSamples returns the total number of samples in the series within a matrix. func (m Matrix) TotalSamples() int { numSamples := 0 for _, series := range m { numSamples += len(series.Points) } return numSamples } func (m Matrix) Len() int { return len(m) } func (m Matrix) Less(i, j int) bool { return labels.Compare(m[i].Metric, m[j].Metric) < 0 } func (m Matrix) Swap(i, j int) { m[i], m[j] = m[j], m[i] } // ContainsSameLabelset checks if a matrix has samples with the same labelset. // Such a behavior is semantically undefined. // https://github.com/prometheus/prometheus/issues/4562 func (m Matrix) ContainsSameLabelset() bool { l := make(map[uint64]struct{}, len(m)) for _, ss := range m { hash := ss.Metric.Hash() if _, ok := l[hash]; ok { return true } l[hash] = struct{}{} } return false } // Result holds the resulting value of an execution or an error // if any occurred. type Result struct { Err error Value parser.Value Warnings storage.Warnings } // Vector returns a Vector if the result value is one. An error is returned if // the result was an error or the result value is not a Vector. func (r *Result) Vector() (Vector, error) { if r.Err != nil { return nil, r.Err } v, ok := r.Value.(Vector) if !ok { return nil, errors.New("query result is not a Vector") } return v, nil } // Matrix returns a Matrix. An error is returned if // the result was an error or the result value is not a Matrix. func (r *Result) Matrix() (Matrix, error) { if r.Err != nil { return nil, r.Err } v, ok := r.Value.(Matrix) if !ok { return nil, errors.New("query result is not a range Vector") } return v, nil } // Scalar returns a Scalar value. An error is returned if // the result was an error or the result value is not a Scalar. func (r *Result) Scalar() (Scalar, error) { if r.Err != nil { return Scalar{}, r.Err } v, ok := r.Value.(Scalar) if !ok { return Scalar{}, errors.New("query result is not a Scalar") } return v, nil } func (r *Result) String() string { if r.Err != nil { return r.Err.Error() } if r.Value == nil { return "" } return r.Value.String() } // StorageSeries simulates promql.Series as storage.Series. type StorageSeries struct { series Series } // NewStorageSeries returns a StorageSeries from a Series. func NewStorageSeries(series Series) *StorageSeries { return &StorageSeries{ series: series, } } func (ss *StorageSeries) Labels() labels.Labels { return ss.series.Metric } // Iterator returns a new iterator of the data of the series. func (ss *StorageSeries) Iterator() chunkenc.Iterator { return newStorageSeriesIterator(ss.series) } type storageSeriesIterator struct { points []Point curr int } func newStorageSeriesIterator(series Series) *storageSeriesIterator { return &storageSeriesIterator{ points: series.Points, curr: -1, } } func (ssi *storageSeriesIterator) Seek(t int64) bool { i := ssi.curr if i < 0 { i = 0 } for ; i < len(ssi.points); i++ { if ssi.points[i].T >= t { ssi.curr = i return true } } ssi.curr = len(ssi.points) - 1 return false } func (ssi *storageSeriesIterator) At() (t int64, v float64) { p := ssi.points[ssi.curr] return p.T, p.V } func (ssi *storageSeriesIterator) Next() bool { ssi.curr++ return ssi.curr < len(ssi.points) } func (ssi *storageSeriesIterator) Err() error { return nil }
{ "content_hash": "1abc373602ec9822a5d964e9b8e4768c", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 91, "avg_line_length": 23.517123287671232, "alnum_prop": 0.6707441386340469, "repo_name": "alileza/prometheus", "id": "81af1ad9da81784b4e75518084c6635658013030", "size": "7460", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "promql/value.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "9247" }, { "name": "Dockerfile", "bytes": "1270" }, { "name": "Go", "bytes": "3859257" }, { "name": "HTML", "bytes": "55048" }, { "name": "JavaScript", "bytes": "66687" }, { "name": "Lex", "bytes": "5940" }, { "name": "Makefile", "bytes": "3458" }, { "name": "SCSS", "bytes": "12493" }, { "name": "Shell", "bytes": "14947" }, { "name": "TypeScript", "bytes": "443400" }, { "name": "Yacc", "bytes": "26012" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in Gard. Chron. ser. 2, 6:323. 1876 #### Original name null ### Remarks null
{ "content_hash": "83240e6cf512808553c93c847b61a9d1", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 12.461538461538462, "alnum_prop": 0.6790123456790124, "repo_name": "mdoering/backbone", "id": "faa3f08ca9c915a5084f707184ec9113cf83e3a4", "size": "206", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Iridaceae/Iris/Iris hartwegii/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
/* * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package java.io; /** * Thrown when a serious I/O error has occurred. * * @author Xueming Shen * @since 1.6 */ public class IOError extends Error { /** * Constructs a new instance of IOError with the specified cause. The * IOError is created with the detail message of * <tt>(cause==null ? null : cause.toString())</tt> (which typically * contains the class and detail message of cause). * * @param cause * The cause of this error, or <tt>null</tt> if the cause * is not known */ public IOError(Throwable cause) { super(cause); } private static final long serialVersionUID = 67100927991680413L; }
{ "content_hash": "786e4820f061764dad7526c54ef4ffad", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 79, "avg_line_length": 17.84313725490196, "alnum_prop": 0.5989010989010989, "repo_name": "flyzsd/java-code-snippets", "id": "72900ae44558609d9a96efe90cc908c03b1021a4", "size": "1384", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ibm.jdk8/src/java/io/IOError.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "51741503" } ], "symlink_target": "" }
/* * File: EEPROM.h * Author: Phil * * Created on 25 April 2015, 20:30 */ #ifndef EEPROM_H #define EEPROM_H #define EEPROM_ADDR 0xAE unsigned char EEPROMReadRegister(unsigned char address); void EEPROMWriteRegister(unsigned char address, unsigned char data); #endif /* EEPROM_H */
{ "content_hash": "8f1833ba09753baaa102ae224b2cf3fd", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 68, "avg_line_length": 16.38888888888889, "alnum_prop": 0.711864406779661, "repo_name": "ep1cman/FM", "id": "90ebdd9503fbdae8227888c902d27b3bca434a2a", "size": "295", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "FM.X/EEPROM.h", "mode": "33188", "license": "mit", "language": [ { "name": "Arduino", "bytes": "7828" }, { "name": "C", "bytes": "30658" }, { "name": "C++", "bytes": "295" }, { "name": "CSS", "bytes": "3140" }, { "name": "Eagle", "bytes": "1133508" }, { "name": "HTML", "bytes": "41307" }, { "name": "Makefile", "bytes": "18072" }, { "name": "Shell", "bytes": "1401" } ], "symlink_target": "" }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createSelfSignedCert = undefined; var _bluebirdLst; function _load_bluebirdLst() { return _bluebirdLst = require("bluebird-lst"); } /** @internal */ let createSelfSignedCert = exports.createSelfSignedCert = (() => { var _ref = (0, (_bluebirdLst || _load_bluebirdLst()).coroutine)(function* (publisher) { const tmpDir = new (_builderUtil || _load_builderUtil()).TmpDir(); const targetDir = process.cwd(); const tempPrefix = _path.join((yield tmpDir.getTempDir()), (0, (_sanitizeFilename || _load_sanitizeFilename()).default)(publisher)); const cer = `${tempPrefix}.cer`; const pvk = `${tempPrefix}.pvk`; (0, (_builderUtil || _load_builderUtil()).log)((0, (_chalk || _load_chalk()).bold)('When asked to enter a password ("Create Private Key Password"), please select "None".')); try { yield (0, (_fsExtraP || _load_fsExtraP()).ensureDir)(_path.dirname(tempPrefix)); const vendorPath = _path.join((yield (0, (_windowsCodeSign || _load_windowsCodeSign()).getSignVendorPath)()), "windows-10", process.arch); yield (0, (_builderUtil || _load_builderUtil()).exec)(_path.join(vendorPath, "makecert.exe"), ["-r", "-h", "0", "-n", `CN=${(0, (_appx || _load_appx()).quoteString)(publisher)}`, "-eku", "1.3.6.1.5.5.7.3.3", "-pe", "-sv", pvk, cer]); const pfx = _path.join(targetDir, `${(0, (_sanitizeFilename || _load_sanitizeFilename()).default)(publisher)}.pfx`); yield (0, (_fs || _load_fs()).unlinkIfExists)(pfx); yield (0, (_builderUtil || _load_builderUtil()).exec)(_path.join(vendorPath, "pvk2pfx.exe"), ["-pvk", pvk, "-spc", cer, "-pfx", pfx]); (0, (_builderUtil || _load_builderUtil()).log)(`${pfx} created. Please see https://electron.build/code-signing how to use it to sign.`); const certLocation = "Cert:\\LocalMachine\\TrustedPeople"; (0, (_builderUtil || _load_builderUtil()).log)(`${pfx} will be imported into ${certLocation} Operation will be succeed only if runned from root. Otherwise import file manually.`); yield (0, (_builderUtil || _load_builderUtil()).spawn)("powershell.exe", ["Import-PfxCertificate", "-FilePath", `"${pfx}"`, "-CertStoreLocation", ""]); } finally { yield tmpDir.cleanup(); } }); return function createSelfSignedCert(_x) { return _ref.apply(this, arguments); }; })(); //# sourceMappingURL=create-self-signed-cert.js.map var _builderUtil; function _load_builderUtil() { return _builderUtil = require("builder-util"); } var _fs; function _load_fs() { return _fs = require("builder-util/out/fs"); } var _chalk; function _load_chalk() { return _chalk = require("chalk"); } var _fsExtraP; function _load_fsExtraP() { return _fsExtraP = require("fs-extra-p"); } var _path = _interopRequireWildcard(require("path")); var _sanitizeFilename; function _load_sanitizeFilename() { return _sanitizeFilename = _interopRequireDefault(require("sanitize-filename")); } var _appx; function _load_appx() { return _appx = require("../targets/appx"); } var _windowsCodeSign; function _load_windowsCodeSign() { return _windowsCodeSign = require("../windowsCodeSign"); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
{ "content_hash": "e770bf8c87c4c333282078786e9d92fc", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 269, "avg_line_length": 40.391304347826086, "alnum_prop": 0.6305166846071044, "repo_name": "erdanieee/imagePicker", "id": "1cd60a84cd239cd15163b86287ed609e43cdf096", "size": "3716", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "node_modules/electron-builder/out/cli/create-self-signed-cert.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "243" }, { "name": "JavaScript", "bytes": "873" } ], "symlink_target": "" }
package mqtt import ( "bytes" "fmt" "strings" "sync" "text/template" "time" paho "github.com/eclipse/paho.mqtt.golang" "github.com/gofrs/uuid" "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" "github.com/pkg/errors" log "github.com/sirupsen/logrus" "github.com/brocaar/chirpstack-api/go/v3/gw" "github.com/brocaar/chirpstack-gateway-bridge/internal/config" "github.com/brocaar/chirpstack-gateway-bridge/internal/integration/mqtt/auth" "github.com/brocaar/lorawan" ) // Backend implements a MQTT backend. type Backend struct { auth auth.Authentication conn paho.Client connMux sync.RWMutex connClosed bool clientOpts *paho.ClientOptions downlinkFrameFunc func(gw.DownlinkFrame) gatewayConfigurationFunc func(gw.GatewayConfiguration) gatewayCommandExecRequestFunc func(gw.GatewayCommandExecRequest) rawPacketForwarderCommandFunc func(gw.RawPacketForwarderCommand) gatewaysMux sync.RWMutex gateways map[lorawan.EUI64]struct{} gatewaysSubscribedMux sync.Mutex gatewaysSubscribed map[lorawan.EUI64]struct{} terminateOnConnectError bool qos uint8 eventTopicTemplate *template.Template commandTopicTemplate *template.Template marshal func(msg proto.Message) ([]byte, error) unmarshal func(b []byte, msg proto.Message) error } // NewBackend creates a new Backend. func NewBackend(conf config.Config) (*Backend, error) { var err error b := Backend{ qos: conf.Integration.MQTT.Auth.Generic.QOS, terminateOnConnectError: conf.Integration.MQTT.TerminateOnConnectError, clientOpts: paho.NewClientOptions(), gateways: make(map[lorawan.EUI64]struct{}), gatewaysSubscribed: make(map[lorawan.EUI64]struct{}), } switch conf.Integration.MQTT.Auth.Type { case "generic": b.auth, err = auth.NewGenericAuthentication(conf) if err != nil { return nil, errors.Wrap(err, "integation/mqtt: new generic authentication error") } case "gcp_cloud_iot_core": b.auth, err = auth.NewGCPCloudIoTCoreAuthentication(conf) if err != nil { return nil, errors.Wrap(err, "integration/mqtt: new GCP Cloud IoT Core authentication error") } conf.Integration.MQTT.EventTopicTemplate = "/devices/gw-{{ .GatewayID }}/events/{{ .EventType }}" conf.Integration.MQTT.CommandTopicTemplate = "/devices/gw-{{ .GatewayID }}/commands/#" case "azure_iot_hub": b.auth, err = auth.NewAzureIoTHubAuthentication(conf) if err != nil { return nil, errors.Wrap(err, "integration/mqtt: new azure iot hub authentication error") } conf.Integration.MQTT.EventTopicTemplate = "devices/{{ .GatewayID }}/messages/events/{{ .EventType }}" conf.Integration.MQTT.CommandTopicTemplate = "devices/{{ .GatewayID }}/messages/devicebound/#" default: return nil, fmt.Errorf("integration/mqtt: unknown auth type: %s", conf.Integration.MQTT.Auth.Type) } switch conf.Integration.Marshaler { case "json": b.marshal = func(msg proto.Message) ([]byte, error) { marshaler := &jsonpb.Marshaler{ EnumsAsInts: false, EmitDefaults: true, } str, err := marshaler.MarshalToString(msg) return []byte(str), err } b.unmarshal = func(b []byte, msg proto.Message) error { unmarshaler := &jsonpb.Unmarshaler{ AllowUnknownFields: true, // we don't want to fail on unknown fields } return unmarshaler.Unmarshal(bytes.NewReader(b), msg) } case "protobuf": b.marshal = func(msg proto.Message) ([]byte, error) { return proto.Marshal(msg) } b.unmarshal = func(b []byte, msg proto.Message) error { return proto.Unmarshal(b, msg) } default: return nil, fmt.Errorf("integration/mqtt: unknown marshaler: %s", conf.Integration.Marshaler) } b.eventTopicTemplate, err = template.New("event").Parse(conf.Integration.MQTT.EventTopicTemplate) if err != nil { return nil, errors.Wrap(err, "integration/mqtt: parse event-topic template error") } b.commandTopicTemplate, err = template.New("event").Parse(conf.Integration.MQTT.CommandTopicTemplate) if err != nil { return nil, errors.Wrap(err, "integration/mqtt: parse event-topic template error") } b.clientOpts.SetProtocolVersion(4) b.clientOpts.SetAutoReconnect(true) // this is required for buffering messages in case offline! b.clientOpts.SetOnConnectHandler(b.onConnected) b.clientOpts.SetConnectionLostHandler(b.onConnectionLost) b.clientOpts.SetKeepAlive(conf.Integration.MQTT.KeepAlive) b.clientOpts.SetMaxReconnectInterval(conf.Integration.MQTT.MaxReconnectInterval) if err = b.auth.Init(b.clientOpts); err != nil { return nil, errors.Wrap(err, "mqtt: init authentication error") } return &b, nil } // Start starts the integration. func (b *Backend) Start() error { b.connectLoop() go b.reconnectLoop() go b.subscribeLoop() return nil } // Stop stops the integration. func (b *Backend) Stop() error { b.connMux.Lock() defer b.connMux.Unlock() b.conn.Disconnect(250) b.connClosed = true return nil } // SetDownlinkFrameFunc sets the DownlinkFrame handler func. func (b *Backend) SetDownlinkFrameFunc(f func(gw.DownlinkFrame)) { b.downlinkFrameFunc = f } // SetGatewayConfigurationFunc sets the GatewayConfiguration handler func. func (b *Backend) SetGatewayConfigurationFunc(f func(gw.GatewayConfiguration)) { b.gatewayConfigurationFunc = f } // SetGatewayCommandExecRequestFunc sets the GatewayCommandExecRequest handler func. func (b *Backend) SetGatewayCommandExecRequestFunc(f func(gw.GatewayCommandExecRequest)) { b.gatewayCommandExecRequestFunc = f } // SetRawPacketForwarderCommandFunc sets the RawPacketForwarderCommand handler func. func (b *Backend) SetRawPacketForwarderCommandFunc(f func(gw.RawPacketForwarderCommand)) { b.rawPacketForwarderCommandFunc = f } // SetGatewaySubscription sets or unsets the gateway. // Note: the actual MQTT (un)subscribe happens in a separate function to avoid // race conditions in case of connection issues. This way, the gateways map // always reflect the desired state. func (b *Backend) SetGatewaySubscription(subscribe bool, gatewayID lorawan.EUI64) error { log.WithFields(log.Fields{ "gateway_id": gatewayID, "subscribe": subscribe, }).Debug("integration/mqtt: set gateway subscription") b.gatewaysMux.Lock() defer b.gatewaysMux.Unlock() if subscribe { b.gateways[gatewayID] = struct{}{} } else { delete(b.gateways, gatewayID) } return nil } func (b *Backend) subscribeGateway(gatewayID lorawan.EUI64) error { topic := bytes.NewBuffer(nil) if err := b.commandTopicTemplate.Execute(topic, struct{ GatewayID lorawan.EUI64 }{gatewayID}); err != nil { return errors.Wrap(err, "execute command topic template error") } log.WithFields(log.Fields{ "topic": topic.String(), "qos": b.qos, }).Info("integration/mqtt: subscribing to topic") if token := b.conn.Subscribe(topic.String(), b.qos, b.handleCommand); token.Wait() && token.Error() != nil { return errors.Wrap(token.Error(), "subscribe topic error") } return nil } func (b *Backend) unsubscribeGateway(gatewayID lorawan.EUI64) error { topic := bytes.NewBuffer(nil) if err := b.commandTopicTemplate.Execute(topic, struct{ GatewayID lorawan.EUI64 }{gatewayID}); err != nil { return errors.Wrap(err, "execute command topic template error") } log.WithFields(log.Fields{ "topic": topic.String(), }).Info("integration/mqtt: unsubscribing from topic") if token := b.conn.Unsubscribe(topic.String()); token.Wait() && token.Error() != nil { return errors.Wrap(token.Error(), "unsubscribe topic error") } return nil } // PublishEvent publishes the given event. func (b *Backend) PublishEvent(gatewayID lorawan.EUI64, event string, id uuid.UUID, v proto.Message) error { mqttEventCounter(event).Inc() idPrefix := map[string]string{ "up": "uplink_", "ack": "downlink_", "stats": "stats_", "exec": "exec_", "raw": "raw_", } return b.publish(gatewayID, event, log.Fields{ idPrefix[event] + "id": id, }, v) } func (b *Backend) connect() error { b.connMux.Lock() defer b.connMux.Unlock() if err := b.auth.Update(b.clientOpts); err != nil { return errors.Wrap(err, "integration/mqtt: update authentication error") } b.conn = paho.NewClient(b.clientOpts) if token := b.conn.Connect(); token.Wait() && token.Error() != nil { return token.Error() } return nil } // connectLoop blocks until the client is connected func (b *Backend) connectLoop() { for { if err := b.connect(); err != nil { if b.terminateOnConnectError { log.Fatal(err) } log.WithError(err).Error("integration/mqtt: connection error") time.Sleep(time.Second * 2) } else { break } } } func (b *Backend) disconnect() error { mqttDisconnectCounter().Inc() b.connMux.Lock() defer b.connMux.Unlock() b.conn.Disconnect(250) return nil } func (b *Backend) reconnectLoop() { if b.auth.ReconnectAfter() > 0 { for { b.connMux.RLock() closed := b.connClosed b.connMux.RUnlock() if closed { break } time.Sleep(b.auth.ReconnectAfter()) log.Info("mqtt: re-connect triggered") mqttReconnectCounter().Inc() b.disconnect() b.connectLoop() } } } func (b *Backend) onConnected(c paho.Client) { mqttConnectCounter().Inc() log.Info("integration/mqtt: connected to mqtt broker") b.gatewaysSubscribedMux.Lock() defer b.gatewaysSubscribedMux.Unlock() // reset the subscriptions as we have a new connection // note: this is done in the onConnected function because the subscribeLoop // locks the gatewaysSubscribedMux and will only release it after all // (un)subscribe operations have been completed. If it would be done in the // onConnectionLost function, the function could block until the connection // is restored because the (un)subscribe operations will block until then. b.gatewaysSubscribed = make(map[lorawan.EUI64]struct{}) } func (b *Backend) subscribeLoop() { for { b.connMux.RLock() closed := b.connClosed b.connMux.RUnlock() if closed { break } var subscribe []lorawan.EUI64 var unsubscribe []lorawan.EUI64 b.gatewaysMux.RLock() b.gatewaysSubscribedMux.Lock() // subscribe for gatewayID := range b.gateways { if _, ok := b.gatewaysSubscribed[gatewayID]; !ok { subscribe = append(subscribe, gatewayID) } } // unsubscribe for gatewayID := range b.gatewaysSubscribed { if _, ok := b.gateways[gatewayID]; !ok { unsubscribe = append(unsubscribe, gatewayID) } } // unlock gatewaysMux so that SetGatewaySubscription can write again // to the map, in which case changes are picked up in the next run b.gatewaysMux.RUnlock() for _, gatewayID := range subscribe { if err := b.subscribeGateway(gatewayID); err != nil { log.WithError(err).WithField("gateway_id", gatewayID).Error("integration/mqtt: subscribe gateway error") } else { b.gatewaysSubscribed[gatewayID] = struct{}{} } } for _, gatewayID := range unsubscribe { if err := b.unsubscribeGateway(gatewayID); err != nil { log.WithError(err).WithField("gateway_id", gatewayID).Error("integration/mqtt: unsubscribe gateway error") } else { delete(b.gatewaysSubscribed, gatewayID) } } b.gatewaysSubscribedMux.Unlock() time.Sleep(time.Millisecond * 100) } } func (b *Backend) onConnectionLost(c paho.Client, err error) { mqttDisconnectCounter().Inc() log.WithError(err).Error("mqtt: connection error") } func (b *Backend) handleDownlinkFrame(c paho.Client, msg paho.Message) { var downlinkFrame gw.DownlinkFrame if err := b.unmarshal(msg.Payload(), &downlinkFrame); err != nil { log.WithFields(log.Fields{ "topic": msg.Topic(), }).WithError(err).Error("integration/mqtt: unmarshal downlink frame error") return } var downID uuid.UUID copy(downID[:], downlinkFrame.GetDownlinkId()) // For backwards compatibility. if len(downlinkFrame.Items) == 0 && (downlinkFrame.TxInfo != nil && len(downlinkFrame.PhyPayload) != 0) { downlinkFrame.Items = append(downlinkFrame.Items, &gw.DownlinkFrameItem{ PhyPayload: downlinkFrame.PhyPayload, TxInfo: downlinkFrame.TxInfo, }) downlinkFrame.GatewayId = downlinkFrame.Items[0].GetTxInfo().GetGatewayId() } if len(downlinkFrame.Items) == 0 { log.WithFields(log.Fields{ "downlink_id": downID, }).Error("integration/mqtt: downlink must have at least one item") return } var gatewayID lorawan.EUI64 copy(gatewayID[:], downlinkFrame.GatewayId) log.WithFields(log.Fields{ "gateway_id": gatewayID, "downlink_id": downID, }).Info("integration/mqtt: downlink frame received") if b.downlinkFrameFunc != nil { b.downlinkFrameFunc(downlinkFrame) } } func (b *Backend) handleGatewayConfiguration(c paho.Client, msg paho.Message) { log.WithFields(log.Fields{ "topic": msg.Topic(), }).Info("integration/mqtt: gateway configuration received") var gatewayConfig gw.GatewayConfiguration if err := b.unmarshal(msg.Payload(), &gatewayConfig); err != nil { log.WithError(err).Error("integration/mqtt: unmarshal gateway configuration error") return } if b.gatewayConfigurationFunc != nil { b.gatewayConfigurationFunc(gatewayConfig) } } func (b *Backend) handleGatewayCommandExecRequest(c paho.Client, msg paho.Message) { var gatewayCommandExecRequest gw.GatewayCommandExecRequest if err := b.unmarshal(msg.Payload(), &gatewayCommandExecRequest); err != nil { log.WithFields(log.Fields{ "topic": msg.Topic(), }).WithError(err).Error("integration/mqtt: unmarshal gateway command execution request error") return } var gatewayID lorawan.EUI64 var execID uuid.UUID copy(gatewayID[:], gatewayCommandExecRequest.GetGatewayId()) copy(execID[:], gatewayCommandExecRequest.GetExecId()) log.WithFields(log.Fields{ "gateway_id": gatewayID, "exec_id": execID, }).Info("integration/mqtt: gateway command execution request received") if b.gatewayCommandExecRequestFunc != nil { b.gatewayCommandExecRequestFunc(gatewayCommandExecRequest) } } func (b *Backend) handleRawPacketForwarderCommand(c paho.Client, msg paho.Message) { var rawPacketForwarderCommand gw.RawPacketForwarderCommand if err := b.unmarshal(msg.Payload(), &rawPacketForwarderCommand); err != nil { log.WithFields(log.Fields{ "topic": msg.Topic(), }).WithError(err).Error("integration/mqtt: unmarshal raw packet-forwarder command error") return } var gatewayID lorawan.EUI64 var rawID uuid.UUID copy(gatewayID[:], rawPacketForwarderCommand.GetGatewayId()) copy(rawID[:], rawPacketForwarderCommand.GetRawId()) log.WithFields(log.Fields{ "gateway_id": gatewayID, "raw_id": rawID, }).Info("integration/mqtt: raw packet-forwarder command received") if b.rawPacketForwarderCommandFunc != nil { b.rawPacketForwarderCommandFunc(rawPacketForwarderCommand) } } func (b *Backend) handleCommand(c paho.Client, msg paho.Message) { if strings.HasSuffix(msg.Topic(), "down") || strings.Contains(msg.Topic(), "command=down") { mqttCommandCounter("down").Inc() b.handleDownlinkFrame(c, msg) } else if strings.HasSuffix(msg.Topic(), "config") || strings.Contains(msg.Topic(), "command=config") { mqttCommandCounter("config").Inc() b.handleGatewayConfiguration(c, msg) } else if strings.HasSuffix(msg.Topic(), "exec") || strings.Contains(msg.Topic(), "command=exec") { b.handleGatewayCommandExecRequest(c, msg) } else if strings.HasSuffix(msg.Topic(), "raw") || strings.Contains(msg.Topic(), "command=raw") { b.handleRawPacketForwarderCommand(c, msg) } else { log.WithFields(log.Fields{ "topic": msg.Topic(), }).Warning("integration/mqtt: unexpected command received") } } func (b *Backend) publish(gatewayID lorawan.EUI64, event string, fields log.Fields, msg proto.Message) error { topic := bytes.NewBuffer(nil) if err := b.eventTopicTemplate.Execute(topic, struct { GatewayID lorawan.EUI64 EventType string }{gatewayID, event}); err != nil { return errors.Wrap(err, "execute event template error") } bytes, err := b.marshal(msg) if err != nil { return errors.Wrap(err, "marshal message error") } fields["topic"] = topic.String() fields["qos"] = b.qos fields["event"] = event log.WithFields(fields).Info("integration/mqtt: publishing event") if token := b.conn.Publish(topic.String(), b.qos, false, bytes); token.Wait() && token.Error() != nil { return token.Error() } return nil }
{ "content_hash": "c4d64a7f753e00e1b28dd23944bf0d99", "timestamp": "", "source": "github", "line_count": 536, "max_line_length": 110, "avg_line_length": 30.486940298507463, "alnum_prop": 0.7215592680986476, "repo_name": "brocaar/lora-gateway-bridge", "id": "e1915d329532a20e28133cad761254929652aa7b", "size": "16341", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "internal/integration/mqtt/backend.go", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "539" }, { "name": "Go", "bytes": "305318" }, { "name": "Makefile", "bytes": "1071" }, { "name": "Shell", "bytes": "4521" } ], "symlink_target": "" }
/** * DOC: atomic modeset support * * The functions here implement the state management and hardware programming * dispatch required by the atomic modeset infrastructure. * See intel_atomic_plane.c for the plane-specific atomic functionality. */ #include <drm/drmP.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_plane_helper.h> #include "intel_drv.h" /** * intel_connector_atomic_get_property - fetch connector property value * @connector: connector to fetch property for * @state: state containing the property value * @property: property to look up * @val: pointer to write property value into * * The DRM core does not store shadow copies of properties for * atomic-capable drivers. This entrypoint is used to fetch * the current value of a driver-specific connector property. */ int intel_connector_atomic_get_property(struct drm_connector *connector, const struct drm_connector_state *state, struct drm_property *property, uint64_t *val) { int i; /* * TODO: We only have atomic modeset for planes at the moment, so the * crtc/connector code isn't quite ready yet. Until it's ready, * continue to look up all property values in the DRM's shadow copy * in obj->properties->values[]. * * When the crtc/connector state work matures, this function should * be updated to read the values out of the state structure instead. */ for (i = 0; i < connector->base.properties->count; i++) { if (connector->base.properties->properties[i] == property) { *val = connector->base.properties->values[i]; return 0; } } return -EINVAL; } /* * intel_crtc_duplicate_state - duplicate crtc state * @crtc: drm crtc * * Allocates and returns a copy of the crtc state (both common and * Intel-specific) for the specified crtc. * * Returns: The newly allocated crtc state, or NULL on failure. */ struct drm_crtc_state * intel_crtc_duplicate_state(struct drm_crtc *crtc) { struct intel_crtc_state *crtc_state; crtc_state = kmemdup(crtc->state, sizeof(*crtc_state), GFP_KERNEL); if (!crtc_state) return NULL; __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->base); crtc_state->update_pipe = false; crtc_state->disable_lp_wm = false; crtc_state->disable_cxsr = false; crtc_state->wm_changed = false; return &crtc_state->base; } /** * intel_crtc_destroy_state - destroy crtc state * @crtc: drm crtc * * Destroys the crtc state (both common and Intel-specific) for the * specified crtc. */ void intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state) { drm_atomic_helper_crtc_destroy_state(crtc, state); } /** * intel_atomic_setup_scalers() - setup scalers for crtc per staged requests * @dev: DRM device * @crtc: intel crtc * @crtc_state: incoming crtc_state to validate and setup scalers * * This function sets up scalers based on staged scaling requests for * a @crtc and its planes. It is called from crtc level check path. If request * is a supportable request, it attaches scalers to requested planes and crtc. * * This function takes into account the current scaler(s) in use by any planes * not being part of this atomic state * * Returns: * 0 - scalers were setup succesfully * error code - otherwise */ int intel_atomic_setup_scalers(struct drm_device *dev, struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state) { struct drm_plane *plane = NULL; struct intel_plane *intel_plane; struct intel_plane_state *plane_state = NULL; struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state; struct drm_atomic_state *drm_state = crtc_state->base.state; int num_scalers_need; int i, j; num_scalers_need = hweight32(scaler_state->scaler_users); /* * High level flow: * - staged scaler requests are already in scaler_state->scaler_users * - check whether staged scaling requests can be supported * - add planes using scalers that aren't in current transaction * - assign scalers to requested users * - as part of plane commit, scalers will be committed * (i.e., either attached or detached) to respective planes in hw * - as part of crtc_commit, scaler will be either attached or detached * to crtc in hw */ /* fail if required scalers > available scalers */ if (num_scalers_need > intel_crtc->num_scalers){ DRM_DEBUG_KMS("Too many scaling requests %d > %d\n", num_scalers_need, intel_crtc->num_scalers); return -EINVAL; } /* walkthrough scaler_users bits and start assigning scalers */ for (i = 0; i < sizeof(scaler_state->scaler_users) * 8; i++) { int *scaler_id; const char *name; int idx; /* skip if scaler not required */ if (!(scaler_state->scaler_users & (1 << i))) continue; if (i == SKL_CRTC_INDEX) { name = "CRTC"; idx = intel_crtc->base.base.id; /* panel fitter case: assign as a crtc scaler */ scaler_id = &scaler_state->scaler_id; } else { name = "PLANE"; /* plane scaler case: assign as a plane scaler */ /* find the plane that set the bit as scaler_user */ plane = drm_state->planes[i]; /* * to enable/disable hq mode, add planes that are using scaler * into this transaction */ if (!plane) { struct drm_plane_state *state; plane = drm_plane_from_index(dev, i); state = drm_atomic_get_plane_state(drm_state, plane); if (IS_ERR(state)) { DRM_DEBUG_KMS("Failed to add [PLANE:%d] to drm_state\n", plane->base.id); return PTR_ERR(state); } /* * the plane is added after plane checks are run, * but since this plane is unchanged just do the * minimum required validation. */ crtc_state->base.planes_changed = true; } intel_plane = to_intel_plane(plane); idx = plane->base.id; /* plane on different crtc cannot be a scaler user of this crtc */ if (WARN_ON(intel_plane->pipe != intel_crtc->pipe)) { continue; } plane_state = to_intel_plane_state(drm_state->plane_states[i]); scaler_id = &plane_state->scaler_id; } if (*scaler_id < 0) { /* find a free scaler */ for (j = 0; j < intel_crtc->num_scalers; j++) { if (!scaler_state->scalers[j].in_use) { scaler_state->scalers[j].in_use = 1; *scaler_id = j; DRM_DEBUG_KMS("Attached scaler id %u.%u to %s:%d\n", intel_crtc->pipe, *scaler_id, name, idx); break; } } } if (WARN_ON(*scaler_id < 0)) { DRM_DEBUG_KMS("Cannot find scaler for %s:%d\n", name, idx); continue; } /* set scaler mode */ if (num_scalers_need == 1 && intel_crtc->pipe != PIPE_C) { /* * when only 1 scaler is in use on either pipe A or B, * scaler 0 operates in high quality (HQ) mode. * In this case use scaler 0 to take advantage of HQ mode */ *scaler_id = 0; scaler_state->scalers[0].in_use = 1; scaler_state->scalers[0].mode = PS_SCALER_MODE_HQ; scaler_state->scalers[1].in_use = 0; } else { scaler_state->scalers[*scaler_id].mode = PS_SCALER_MODE_DYN; } } return 0; } static void intel_atomic_duplicate_dpll_state(struct drm_i915_private *dev_priv, struct intel_shared_dpll_config *shared_dpll) { enum intel_dpll_id i; /* Copy shared dpll state */ for (i = 0; i < dev_priv->num_shared_dpll; i++) { struct intel_shared_dpll *pll = &dev_priv->shared_dplls[i]; shared_dpll[i] = pll->config; } } struct intel_shared_dpll_config * intel_atomic_get_shared_dpll_state(struct drm_atomic_state *s) { struct intel_atomic_state *state = to_intel_atomic_state(s); WARN_ON(!drm_modeset_is_locked(&s->dev->mode_config.connection_mutex)); if (!state->dpll_set) { state->dpll_set = true; intel_atomic_duplicate_dpll_state(to_i915(s->dev), state->shared_dpll); } return state->shared_dpll; } struct drm_atomic_state * intel_atomic_state_alloc(struct drm_device *dev) { struct intel_atomic_state *state = kzalloc(sizeof(*state), GFP_KERNEL); if (!state || drm_atomic_state_init(dev, &state->base) < 0) { kfree(state); return NULL; } return &state->base; } void intel_atomic_state_clear(struct drm_atomic_state *s) { struct intel_atomic_state *state = to_intel_atomic_state(s); drm_atomic_state_default_clear(&state->base); state->dpll_set = false; }
{ "content_hash": "7ffc05f717c1f82059f11b49e2eda11a", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 78, "avg_line_length": 28.3573883161512, "alnum_prop": 0.6737760542898691, "repo_name": "mikedlowis-prototypes/albase", "id": "d0b1c9afa35ef6a909e9146eeb61dd343f87e9e4", "size": "9407", "binary": false, "copies": "49", "ref": "refs/heads/master", "path": "source/kernel/drivers/gpu/drm/i915/intel_atomic.c", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Assembly", "bytes": "10263145" }, { "name": "Awk", "bytes": "55187" }, { "name": "Batchfile", "bytes": "31438" }, { "name": "C", "bytes": "551654518" }, { "name": "C++", "bytes": "11818066" }, { "name": "CMake", "bytes": "122998" }, { "name": "Clojure", "bytes": "945" }, { "name": "DIGITAL Command Language", "bytes": "232099" }, { "name": "GDB", "bytes": "18113" }, { "name": "Gherkin", "bytes": "5110" }, { "name": "HTML", "bytes": "18291" }, { "name": "Lex", "bytes": "58937" }, { "name": "M4", "bytes": "561745" }, { "name": "Makefile", "bytes": "7082768" }, { "name": "Objective-C", "bytes": "634652" }, { "name": "POV-Ray SDL", "bytes": "546" }, { "name": "Perl", "bytes": "1229221" }, { "name": "Perl6", "bytes": "11648" }, { "name": "Python", "bytes": "316536" }, { "name": "Roff", "bytes": "4201130" }, { "name": "Shell", "bytes": "2436879" }, { "name": "SourcePawn", "bytes": "2711" }, { "name": "TeX", "bytes": "182745" }, { "name": "UnrealScript", "bytes": "12824" }, { "name": "Visual Basic", "bytes": "11568" }, { "name": "XS", "bytes": "1239" }, { "name": "Yacc", "bytes": "146537" } ], "symlink_target": "" }
> {%= description %} {%= include("install-npm", {save: true}) %} Jump to **[CLI instructions](#CLI)** ## Usage ```js var toQuotedString = require('{%= name %}'); ``` Say you want to turn this template into a javascript module: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>{{title}}</title> </head> <body> {%% body %} </body> </html> ``` Pass the string ```js var fs = require('fs'); var str = fs.readFileSync('foo.html', 'utf8'); toQuotedString(str); ``` Returns: ```js module.exports = [ '<!DOCTYPE html>', '<html lang="en">', ' <head>', ' <meta charset="UTF-8">', ' <title>{{title}}</title>', ' </head>', ' <body>', ' {%% body %}', ' </body>', '</html>' ]; ``` This doesn't add template variables, but it gets you part of the way there. ## CLI From the command line, specify a source file with contents to be wrapped: ```bash to-quoted-string foo.js ``` Pass a destination as the second arg, or with `-d`|`--dest` ```bash to-quoted-string foo.js bar.js ``` _(**NOTE**: if no dest is specifed, `_` is prepended to the source filename and the file extension is changed to `.js`)_ ## Run tests Install dev dependencies: ```bash npm i -d && npm test ``` ## Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %}) ## Author {%= include("author") %} ## License {%= copyright() %} {%= license() %} *** {%= include("footer") %}
{ "content_hash": "a0132e7e70273a9640525dbe46c18ac1", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 120, "avg_line_length": 16.571428571428573, "alnum_prop": 0.5928381962864722, "repo_name": "jonschlinkert/to-quoted-string", "id": "f2ea950bbb4fe9a9f89927be73f3d104b6973585", "size": "1544", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": ".verb.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "150" }, { "name": "JavaScript", "bytes": "3142" } ], "symlink_target": "" }
<div class="row"> <div class="col-lg-12"> <h1 class="page-header">Submeter Minicurso</h1> <?php if($success!=null): ?> <div class='alert alert-success text-center'> <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button> <strong><?php echo $success; ?></strong> </div> <?php endif; ?> <?php if($error!=null): ?> <div class='alert alert-danger text-center'> <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button> <strong><?php echo $error; ?></strong> </div> <?php endif; ?> <h4 class="page-header">Minicursos Submetidos</h4> <table class="table table-hover"> <!-- Falta centralizar verticalmente o texto --> <?php foreach($minicourses as $mc): ?> <tr class="active text-center"> <td style="width:40%;"><b><?php echo $mc->title; ?></b></td> <td>Enviado em: <?php echo date("d/m/Y", strtotime($mc->createdAt)); ?> </td> <?php if($mc->consolidated=='no'): ?> <td class="text-warning">Esperando Avaliaรงรฃo</td> <?php $limit = R::findOne('configuration','name="max_date_minicourse_submission"'); ?> <?php if(dateleq(mdate('%Y-%m-%d'),$limit->value)): ?> <td><a style="cursor:pointer;" class="minicourse-cancel-submission" data-data="<?php echo $mc->id; ?>">Cancelar Submissรฃo</a></td> <?php echo form_open(base_url('dashboard/minicourse/cancelsubmission'), array('id' => 'formMinicourseCancelSubmission-'.$mc->id,'novalidate' => '','class' => 'waiting','style' => 'display:inline-block;')); ?> <input style="display:none;" name="id" value="<?php echo $mc->id; ?>" /> </form> <?php endif; ?> <?php elseif($mc->consolidated=='yes'): ?> <td class="text-success">Minicurso Consolidado/Aceito</td> <td></td> <?php endif; ?> </tr> <?php endforeach; ?> <?php if(!count($minicourses)): ?> <tr class="text-center active"> <td><span class="text-danger">Vocรช ainda nรฃo submeteu nenhum minicurso.</span></td> </tr> <?php endif; ?> </table> <h4 class="page-header">Submeter Minicurso</h4> <?php if($date_limit['open']): ?> <p class="text-danger">Data limite de submissรฃo: <?php echo date("d/M/Y", strtotime($date_limit['config']->value)); ?></p> <?php echo form_open(base_url('dashboard/minicourse/create'), array('id' => 'formCreateMinicourse','novalidate' => '','class' => 'waiting')); ?> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label for="file">Tรญtulo *</label> <input type="text" class="form-control" placeholder="Tรญtulo" name="title" value="<?php echo $popform['title']; ?>" /> <p class="text-danger"><?php if($validation!=null): ?> <?php echo $validation['title']; ?> <?php endif; ?></p> </div> <div class="form-group"> <label for="file">Turno *</label> <select class="form-control" name="shift"> <option <?php if($popform['shift']=='matutino'): ?> selected="true" <?php endif; ?> value="matutino">Matutino</option> <option <?php if($popform['shift']=='vespertino'): ?> selected="true" <?php endif; ?> value="vespertino">Vespertino</option> <option <?php if($popform['shift']=='noturno'): ?> selected="true" <?php endif; ?> value="noturno">Noturno</option> </select> <p class="text-danger"><?php if($validation!=null): ?> <?php echo $validation['shift']; ?> <?php endif; ?></p> </div> <div class="form-group"> <label for="file">Ementa *</label> <textarea rows="5" class="form-control" placeholder="Ementa" name="syllabus" ><?php echo $popform['syllabus']; ?></textarea> <p class="text-danger"><?php if($validation!=null): ?> <?php echo $validation['syllabus']; ?> <?php endif; ?></p> </div> <div class="form-group"> <label for="file">Objetivos *</label> <textarea rows="6" class="form-control" placeholder="Objetivos" name="objectives" ><?php echo $popform['objectives']; ?></textarea> <p class="text-danger"><?php if($validation!=null): ?> <?php echo $validation['objectives']; ?> <?php endif; ?></p> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="file">Recursos *</label> <textarea rows="5" class="form-control" placeholder="Recursos" name="resources" ><?php echo $popform['resources']; ?></textarea> <p class="text-danger"><?php if($validation!=null): ?> <?php echo $validation['resources']; ?> <?php endif; ?></p> </div> <div class="form-group"> <label for="file">Quantidade de Vagas *</label> <input type="number" class="form-control" placeholder="Quantidade de Vagas" name="vacancies" value="<?php echo $popform['vacancies']; ?>" /> <p class="text-danger"><?php if($validation!=null): ?> <?php echo $validation['vacancies']; ?> <?php endif; ?></p> </div> <div class="form-group"> <label for="file">Programa *</label> <input id="programuploader" type="file" name="userfile" data-url="<?php echo base_url(); ?>dashboard/minicourse/uploadprogram" /> <figure class="loading" style="display:none;font-size:12;margin-top:0px;"><img src="<?php echo asset_url(); ?>img/loading.gif" /> Carregando, aguarde... </figure> <!-- There was a problem, so i used an ugly hack to solve the problem --> <input style="width:0px;height:0px;border:none;position:absolute;top:-200px;" type="text" name="program" value="" /> <p class="file-desc text-success"></p> <p class="text-danger"><?php if($validation!=null): ?> <?php echo $validation['program']; ?> <?php endif; ?></p> </div> <div class="form-group"> <label>Expositor(es) *</label> <br/> <button class="btn btn-default" data-toggle="modal" data-target=".modal-minicourse-add-author" type="button" style="margin-bottom:10px;">Adicionar Expositor</button> <textarea readOnly rows="4" class="form-control" placeholder="Nenhum autor adicionado" name="authors" ><?php echo $popform['authors']; ?></textarea> <a class="reset-authors" href="javascript:void(0);">Resetar</a> <p class="text-danger"><?php if($validation!=null): ?> <?php echo $validation['authors']; ?> <?php endif; ?></p> </div> </div> <div class="clearfix"></div> <div class="col-lg-12 text-center success-container"> <div class="success"></div> <button type="submit" class="btn btn-lg btn-success">Submeter Minicurso</button> </div> </div> </form> <?php else: ?> <p class="text-danger">A data limite de submissรฃo (<?php echo date("d/M/Y", strtotime($date_limit['config']->value)); ?>) foi atingida, nรฃo hรก possibilidades de envio de trabalho.</p> <?php endif; ?> </div> <!-- /.col-lg-12 --> </div> <div class="modal fade modal-minicourse-add-author" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <div class="modal-body"> <div class="form-group"> <label for="file">Nome Completo*</label> <input type="text" class="form-control" placeholder="Nome *" name="name" /> </div> <div class="form-group"> <label for="file">Instituiรงรฃo *</label> <input type="text" class="form-control" placeholder="Instituiรงรฃo *" name="institution"/> </div> <button class="btn btn-default" >Adicionar Autor</button> </div> </div> </div> </div>
{ "content_hash": "b76ee5e95eefeac37215d4c8cfbf69b9", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 236, "avg_line_length": 64.94117647058823, "alnum_prop": 0.4131340579710145, "repo_name": "ccsa-ufrn/seminario-ccsa-old", "id": "edc2932a8d5c7041fa9b174e2c54e7fb46d56643", "size": "11055", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/dashboard/minicourse/submit.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "157" }, { "name": "CSS", "bytes": "49916" }, { "name": "HTML", "bytes": "4428" }, { "name": "JavaScript", "bytes": "831778" }, { "name": "PHP", "bytes": "5948532" }, { "name": "Python", "bytes": "1140" } ], "symlink_target": "" }
struct wl_resource; namespace wl { extern const struct wp_viewport_interface kTestViewportImpl; class TestViewport : public ServerObject { public: explicit TestViewport(wl_resource* resource, wl_resource* surface); ~TestViewport() override; TestViewport(const TestViewport& rhs) = delete; TestViewport& operator=(const TestViewport& rhs) = delete; private: // Surface resource that is the ground for this Viewport. wl_resource* surface_ = nullptr; }; } // namespace wl #endif // UI_OZONE_PLATFORM_WAYLAND_TEST_TEST_VIEWPORT_H_
{ "content_hash": "76bcf80dc68ba3038424f0f2c9711a23", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 69, "avg_line_length": 26.142857142857142, "alnum_prop": 0.7486338797814208, "repo_name": "ric2b/Vivaldi-browser", "id": "0cea33c68e57c0013aa5d9ca7d5d5e55dc010007", "size": "928", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chromium/ui/ozone/platform/wayland/test/test_viewport.h", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
class AddBackendToProjects < ActiveRecord::Migration def change add_column :projects, :scm_type, :string end end
{ "content_hash": "eeee18f0ec5f8f87929116d8f0dd523c", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 52, "avg_line_length": 24.2, "alnum_prop": 0.7520661157024794, "repo_name": "PatientKeeper/rixeye", "id": "885069f20977c22d7d659e9bfa4749c8eb33c69b", "size": "121", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db/migrate/20130828120600_add_backend_to_projects.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "170821" }, { "name": "CoffeeScript", "bytes": "687" }, { "name": "JavaScript", "bytes": "66066" }, { "name": "Ruby", "bytes": "52794" } ], "symlink_target": "" }
๏ปฟ// -------------------------------------------------------------------------------------------------------------------- // <copyright file="DirectoryController.cs" company="70-53x"> // 70-53x // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace WebApplication.Controllers { using System; using System.Collections.Generic; using System.Configuration; using System.Data.Entity; using System.Globalization; using System.Linq; using System.Security.Claims; using System.Text; using System.Threading.Tasks; using System.Web.Mvc; using Microsoft.Azure.ActiveDirectory.GraphClient; using Microsoft.Azure.ActiveDirectory.GraphClient.Extensions; using Microsoft.Data.OData; using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Queue; using Newtonsoft.Json; using WebApplication.Data; using WebApplication.Helpers; using WebApplication.Models; using WebApplication.Tracing; /// <summary> /// The directory controller. /// </summary> [Authorize(Roles = "Company Administrator, User Account Administrator")] public class DirectoryController : Controller { #region Static Fields /// <summary> /// The client id. /// </summary> private static readonly string ClientId = ConfigurationManager.AppSettings["ClientId"]; /// <summary> /// The client secret. /// </summary> private static readonly string ClientSecret = ConfigurationManager.AppSettings["ClientSecret"]; /// <summary> /// The storage connection string. /// </summary> private static readonly string StorageConnectionString = ConfigurationManager.ConnectionStrings["Storage"].ConnectionString; /// <summary> /// The tenant id. /// </summary> private static readonly string TenantId = ConfigurationManager.AppSettings["TenantId"]; #endregion #region Fields /// <summary> /// The client. /// </summary> private readonly ActiveDirectoryClient client = new ActiveDirectoryHelper().ActiveDirectoryClient; #endregion #region Public Methods and Operators /// <summary> /// The index. /// </summary> /// <returns> /// The <see cref="System.Threading.Tasks.Task" />. /// </returns> public async Task<ActionResult> Index() { IPagedCollection<IUser> userQuery = await this.client.Users.ExecuteAsync(); var users = new List<IUser>(userQuery.CurrentPage); while (userQuery.MorePagesAvailable) { await userQuery.GetNextPageAsync(); users.AddRange(userQuery.CurrentPage); } return this.View(users); } /// <summary> /// The sync action. /// </summary> /// <returns> /// The <see cref="System.Threading.Tasks.Task" />. /// </returns> [HttpPost] [ValidateAntiForgeryToken] public async Task<ActionResult> Sync() { string upn = ((ClaimsIdentity)this.User.Identity).FindFirst(ClaimTypes.Upn).Value; CloudStorageAccount storageAccount = CloudStorageAccount.Parse(StorageConnectionString); CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient(); CloudQueue syncQueue = queueClient.GetQueueReference("sync"); await syncQueue.CreateIfNotExistsAsync(); ApplicationEventSource.EventSource.SyncDirectory(upn); using (var context = new AdventureWorksContext()) { HumanResourcesEmployee ceo = await context.HumanResourcesEmployee.SingleAsync(x => x.OrganizationLevel == 0); string managerId = null; foreach (HumanResourcesEmployee employee in context.HumanResourcesEmployee.OrderBy(x => x.OrganizationLevel).ToList()) { if (employee.OrganizationLevel > 0) { HumanResourcesEmployee manager = context.HumanResourcesEmployee.SingleOrDefault( e => e.OrganizationNode == employee.OrganizationNode.GetAncestor(1)) ?? ceo; managerId = new Guid(manager.BusinessEntityId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0).ToString(); } await this.SyncEmployee(employee, managerId); // await QueueMessage(employee, manager, syncQueue); } } return this.RedirectToAction("Index"); } /// <summary> /// The users action. /// </summary> /// <param name="upn"> /// The user principal name. /// </param> /// <returns> /// The <see cref="System.Threading.Tasks.Task"/>. /// </returns> [ActionName("User")] public async Task<ActionResult> Users(string upn) { IUser user = await this.client.Users.Where(x => x.UserPrincipalName == upn).ExecuteSingleAsync(); if (user == null) { return this.HttpNotFound(); } return this.View(user); } #endregion #region Methods /// <summary> /// The convert employee to user. /// </summary> /// <param name="employee"> /// The employee. /// </param> /// <returns> /// The <see cref="User"/>. /// </returns> private static User ConvertEmployeeToUser(HumanResourcesEmployee employee) { PersonAddress address = employee.PersonPerson.PersonBusinessEntity.PersonBusinessEntityAddress.Single().PersonAddress; string login = employee.LoginId.Substring(employee.LoginId.IndexOf('\\') + 1); string name = GetDisplayName(employee.PersonPerson); return new User { ObjectId = new Guid(employee.BusinessEntityId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0).ToString(), AccountEnabled = true, DisplayName = name, GivenName = employee.PersonPerson.FirstName, UserPrincipalName = string.Concat(login, "@7053x.onmicrosoft.com"), MailNickname = login, Surname = employee.PersonPerson.LastName, JobTitle = employee.JobTitle, Department = employee.HumanResourcesEmployeeDepartmentHistory.Single( edh => edh.EndDate.HasValue == false).HumanResourcesDepartment.Name, TelephoneNumber = employee.PersonPerson.PersonPersonPhone.Single().PhoneNumber, StreetAddress = string.Join(" ", address.AddressLine1, address.AddressLine2), City = address.City, State = address.PersonStateProvince.Name, PostalCode = address.PostalCode, Country = address.PersonStateProvince.PersonCountryRegion.Name, PasswordProfile = new PasswordProfile { Password = "7053xAW2014", ForceChangePasswordNextLogin = false }, PasswordPolicies = "DisablePasswordExpiration,DisableStrongPassword" }; } /// <summary> /// The get display name. /// </summary> /// <param name="person"> /// The person. /// </param> /// <returns> /// The <see cref="string"/>. /// </returns> private static string GetDisplayName(PersonPerson person) { const string Format = "{0} "; var sb = new StringBuilder(); if (!string.IsNullOrEmpty(person.Title)) { sb.AppendFormat(Format, person.Title); } sb.AppendFormat(Format, person.FirstName); sb.AppendFormat(Format, person.MiddleName); sb.AppendFormat(Format, person.LastName); if (!string.IsNullOrEmpty(person.Suffix)) { sb.AppendFormat(Format, person.Suffix); } return sb.ToString().TrimEnd(' '); } /// <summary> /// The queue message. /// </summary> /// <param name="employee"> /// The employee. /// </param> /// <param name="manager"> /// The manager. /// </param> /// <param name="syncQueue"> /// The sync queue. /// </param> /// <returns> /// The <see cref="Task"/>. /// </returns> private static async Task QueueMessage( HumanResourcesEmployee employee, HumanResourcesEmployee manager, CloudQueue syncQueue) { User user = ConvertEmployeeToUser(employee); var message = new SyncMessage(user, manager == null ? null : new Guid(manager.BusinessEntityId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0).ToString()) { TenantId = TenantId, ClientId = ClientId, ClientSecret = ClientSecret }; string payload = JsonConvert.SerializeObject(message); await syncQueue.AddMessageAsync(new CloudQueueMessage(payload)); } /// <summary> /// The sync user. /// </summary> /// <param name="employee"> /// The employee. /// </param> /// <param name="manager"> /// The employee's manager. /// </param> /// <returns> /// The <see cref="Task"/>. /// </returns> private async Task SyncEmployee(HumanResourcesEmployee employee, string manager) { User user = ConvertEmployeeToUser(employee); HumanResourcesDepartment department = employee.HumanResourcesEmployeeDepartmentHistory.Single(edh => edh.EndDate.HasValue == false) .HumanResourcesDepartment; var departmentId = new Guid(0, department.DepartmentId, department.DepartmentId, 0, 0, 0, 0, 0, 0, 0, 0).ToString(); ApplicationEventSource.EventSource.SyncUser(user.DisplayName, user.UserPrincipalName); try { await this.client.Users.GetByObjectId(user.ObjectId).ExecuteAsync(); } catch (ODataErrorException) { this.CreateUserAsync(manager, departmentId, department, user).Wait(); } ApplicationEventSource.EventSource.SyncUserDone(user.DisplayName, user.UserPrincipalName); } private async Task CreateUserAsync(string manager, string departmentId, HumanResourcesDepartment department, User user) { try { IGroup directoryGroup = await this.client.Groups.GetByObjectId(departmentId).ExecuteAsync(); var directoryGroupObject = (Group)directoryGroup; if (!user.MemberOf.Contains(directoryGroupObject)) { user.MemberOf.Add(directoryGroupObject); } if (!string.IsNullOrEmpty(manager)) { user.Manager = await this.client.Users.GetByObjectId(manager).ExecuteAsync() as User; } await this.client.Users.AddUserAsync(user); } catch (ODataErrorException) { this.CreateGroupAsync(departmentId, department).Wait(); } } private async Task CreateGroupAsync(string departmentId, HumanResourcesDepartment department) { await this.client.Groups.AddGroupAsync( new Group { ObjectId = departmentId, DisplayName = department.Name, Description = department.GroupName, MailNickname = department.Name.ToLowerInvariant().Replace(' ', '_'), MailEnabled = false, SecurityEnabled = true }); } #endregion } }
{ "content_hash": "6303832cc5b2725bc7859da85bf5b202", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 149, "avg_line_length": 38.523809523809526, "alnum_prop": 0.5251854140914709, "repo_name": "mdmsua/70-53x", "id": "f64586d1207f3f8fb17fbffefa7ccb2394ce9379", "size": "12946", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "70-53x/WebApplication/Controllers/DirectoryController.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "315658" }, { "name": "CSS", "bytes": "513" }, { "name": "JavaScript", "bytes": "19979" }, { "name": "PowerShell", "bytes": "37659" } ], "symlink_target": "" }
ACCEPTED #### According to IRMNG Homonym List #### Published in null #### Original name null ### Remarks null
{ "content_hash": "3dbce0528480b2a377a5f9795ebd68bd", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 18, "avg_line_length": 8.692307692307692, "alnum_prop": 0.6814159292035398, "repo_name": "mdoering/backbone", "id": "0bb9c029de9fb313b41e3de09fe6ea30b6213387", "size": "173", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Asterothrix/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
var angular = require('angular'); var module = angular.module('ui.winwin'); var paneId = 0; module.directive('pane', [ function() { return { restrict: 'E', require: '^window', replace: true, transclude: true, scope: { caption: '@', active: '=?', onSelect: '&select', onDeselect: '&deselect' }, template: '<div id="{{id}}" \ ng-class="{active: active}" \ class="tab" \ ui-draggable \ ui-drag-format="application/x-lx-window-pane" \ ui-drag-data=\'{\"id\":\"{{id}}\"}\' \ ng-click="select()"> \ <span pane-caption-transclude>{{caption}}</span> \ </div>', controller: function() {}, compile: function(element, attrs, transclude) { return function postLink(scope, element, attr, windowCtrl) { scope.id = 'wnd-pane' + paneId++; scope.active = false; windowCtrl.addPane(scope); scope.$watch('active', function(active) { if (active) { windowCtrl.select(scope); } }); scope.select = function() { scope.active = true; // windowCtrl.select(scope); } scope.remove = function() { windowCtrl.removePane(scope); } element.on('$destroy', function() { console.log('Pane Destroy'); scope.remove(); scope.$destroy(); }); scope.$transcludeFn = transclude; } } }; }]); module.directive('paneCaptionTransclude', [ function() { return { restrict: 'A', require: '^pane', link: function(scope, elm, attrs, tabCtrl) { scope.$watch('captionElement', function updateHeadingElement(caption) { if (caption) { elm.html(''); elm.append(caption); } }); } }; }]); module.directive('paneContentTransclude', [ function() { var isPaneCaption = function(node) { return node.tagName && ( node.hasAttribute('pane-caption') || node.hasAttribute('data-pane-caption') || node.tagName.toLowerCase() === 'pane-caption' || node.tagName.toLowerCase() === 'data-pane-caption' ); } return { restrict: 'A', require: '^window', link: function(scope, elm, attrs) { var pane = scope.$eval(attrs.paneContentTransclude); scope.id = pane.id; // Now our tab is ready to be transcluded: both the tab heading area // and the tab content area are loaded. Transclude 'em both. pane.$transcludeFn(pane.$parent, function(contents) { angular.forEach(contents, function(node) { if (isPaneCaption(node)) { // Let tabHeadingTransclude know. pane.captionElement = node; } else { elm.append(node); } }); }); } }; }]);
{ "content_hash": "140404aa8ebcfd5cc115abbea65b8c51", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 77, "avg_line_length": 27.663366336633665, "alnum_prop": 0.5508231925554761, "repo_name": "surikaterna/winwin", "id": "240d4a29607bc032882abc7705c4b80a85ebd6d8", "size": "2794", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/pane.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "5576" }, { "name": "HTML", "bytes": "1870" }, { "name": "JavaScript", "bytes": "13520" } ], "symlink_target": "" }
namespace { const char kArcAppPrefix[] = "arc://"; } namespace app_list { ArcAppResult::ArcAppResult(Profile* profile, const std::string& app_id, AppListControllerDelegate* controller, bool is_recommendation) : AppResult(profile, app_id, controller, is_recommendation) { std::string id = kArcAppPrefix; id += app_id; set_id(id); icon_loader_.reset(new ArcAppIconLoader(profile, GetPreferredIconDimension(), this)); icon_loader_->FetchImage(app_id); } ArcAppResult::~ArcAppResult() { } void ArcAppResult::OnAppImageUpdated(const std::string& app_id, const gfx::ImageSkia& image) { SetIcon(image); } void ArcAppResult::ExecuteLaunchCommand(int event_flags) { Open(event_flags); } void ArcAppResult::Open(int event_flags) { RecordHistogram(APP_SEARCH_RESULT); if (!arc::LaunchApp(profile(), app_id())) return; // Manually close app_list view because focus is not changed on ARC app start, // and current view remains active. controller()->DismissView(); } std::unique_ptr<SearchResult> ArcAppResult::Duplicate() const { std::unique_ptr<SearchResult> copy( new ArcAppResult(profile(), app_id(), controller(), display_type() == DISPLAY_RECOMMENDATION)); copy->set_title(title()); copy->set_title_tags(title_tags()); copy->set_relevance(relevance()); return copy; } ui::MenuModel* ArcAppResult::GetContextMenuModel() { if (!context_menu_) { context_menu_.reset(new ArcAppContextMenu( this, profile(), app_id(), controller())); } return context_menu_->GetMenuModel(); } } // namespace app_list
{ "content_hash": "81e22997c623efca080a67ae79b007ea", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 80, "avg_line_length": 28, "alnum_prop": 0.6166294642857143, "repo_name": "was4444/chromium.src", "id": "951689b32ac2ac95dfd10407ab1200471a448daf", "size": "2431", "binary": false, "copies": "1", "ref": "refs/heads/nw15", "path": "chrome/browser/ui/app_list/search/arc_app_result.cc", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
// these test out the execution API /** * given a sheet id & name, get the data converted to objects * @param {object} options args * @param {string} id the sheet id * @param {string} sheetName the sheetName * @return {[*]} the data */ function execGetData (options) { // maybe there are no arguments options = options || {}; var exec = new SheetExec(); var data = exec.sheetOpen(options.id, options.sheetName).getData(); // need to convert any dates since its not transferrable return exec.convertDatesToIso(data); } /** * given a sheet id & name, set the given data * @param {object} options args * @param {string} id the sheet id * @param {string} sheetName the sheetName * @param {boolean} clearFirst whether to clear first */ function execSetData (options ) { // maybe there are defaults options = options || {}; var sheetExec = new SheetExec().sheetOpen(options.id, options.sheetName); // clear it ? if (options.clearFirst) sheetExec.clearContent(); // write the data sheetExec.setData ( options.data ); } /** * @param {[string]} flightNumbers to check * @return {object} the result */ function execMatch (flightNumbers) { // get the sheet data var lookup = new SheetExec() .open(Settings.LOOKUP.ID, Settings.LOOKUP.NAME) .getData(); // generate a regex for flightnumbers of each interesting airline var rx = new RegExp (getRegex(lookup) ,'gmi'); return flightNumbers.map(function(flightNumber) { // match against given flight code var found = rx.exec(flightNumber); // return the airline code, name and the flight number return found ? { status:"ok", flight:found[0], carrier:found[1], name:lookup.filter(function(d) { return d[Settings.HEADINGS.CODE].toLowerCase() === found[1].toLowerCase(); })[0][Settings.HEADINGS.NAME] } : { status:'not found', flight:flightNumber }; }); } /** * this one increments a log with all the found flights * @param {object} results the results from an execmatch * @return {[object]} the data from the log */ function execLog (results) { // get the sheet data var sheetExec = new SheetExec().sheetOpen(Settings.LOG.ID, Settings.LOG.NAME); var log = sheetExec.getData(); /// log the results results.forEach(function (d) { if (d.status === "ok") { // need to log var findLog = log.filter(function(f) { return f[Settings.LOG.HEADINGS.FLIGHT].toLowerCase() === d.flight.toLowerCase(); }); // add if its new if (!findLog.length) { var item = {}; item[Settings.LOG.HEADINGS.FLIGHT] = d.flight; item[Settings.LOG.HEADINGS.COUNT] = 0; log.push(item); } else { var item = findLog[0]; } // increment item[Settings.LOG.HEADINGS.COUNT]++; } }); /// write the data (no need to clear) sheetExec.setData (log); } /** * make the regex for flight matching * @param {object} lookup the lookup data * @return {Regexp} the matching regex */ function getRegex (lookup) { // in case the sender canr do json objects var ob = typeof lookup === typeof 's' ? JSON.parse(lookup) : lookup; return '\\b(' + ob.map(function(d) { return d[Settings.HEADINGS.CODE].toLowerCase(); }).join("|") + ')([a-z]?)(\\d{1,4}[a-z]?)\\b'; } /** * get any code -- doesnt handle {}() in comments or strings properly yet * @param {[object]} sourceToGet the source to get [{module:x, functions:[y]}] * @return {[object]} the result [{source:the source, module:x, functions:[y]}] */ function execGetSource (sourceToGet) { return sourceToGet.map(function(d) { var module = ScriptApp.getResource(d.module).getDataAsString(); if (d.functions) { var source = d.functions.reduce(function(p,c) { var match = new RegExp('\\b\\(?\\s*function\\s*' + c + '|var\\s+'+c+'\\s*=\\s*\\(?\\s*function','gm').exec(module); if (!match) { throw 'function ' + c + ' not found in module ' + d.module } // now find matching close { var depth, s = '', bracketStart = '{', bracketEnd = '}' ; module.slice (match.index).split('').some(function(r) { if (bracketStart == r) { depth = (typeof depth === typeof undefined ? 1 : depth +1); } if (bracketEnd == r) { depth = (typeof depth === typeof undefined ? undefined : depth -1); } s+=r; return depth ===0; }); p += (s + '\n'); return p; } ,''); return {module:d.module, functions:d.functions , source: source}; } else { return {module:d.module, functions:d.functions , source: module}; } }); }
{ "content_hash": "c0bdb56ca9a9a6dbf7c6536f40aef039", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 125, "avg_line_length": 27.005555555555556, "alnum_prop": 0.5932935609956799, "repo_name": "brucemcpherson/GoingGas", "id": "c7d90665317d2ff7ef74cd910edf9778a1489ad8", "size": "4861", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "executionapi/gas/source/exec/Executes.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "4233" }, { "name": "HTML", "bytes": "2619" }, { "name": "JavaScript", "bytes": "148678" }, { "name": "Visual Basic", "bytes": "159937" } ], "symlink_target": "" }
ArJdbc::ConnectionMethods.module_eval do # Default connection method for MS-SQL adapter (`adapter: mssql`), # uses the (open-source) jTDS driver. # If you'd like to use the "official" MS's SQL-JDBC driver, it's preferable # to use the {#sqlserver_connection} method (set `adapter: sqlserver`). def mssql_connection(config) # NOTE: this detection ain't perfect and is only meant as a temporary hack # users will get a deprecation eventually to use `adapter: sqlserver` ... if config[:driver] =~ /SQLServerDriver$/ || config[:url] =~ /^jdbc:sqlserver:/ return sqlserver_connection(config) end config[:adapter_spec] ||= ::ArJdbc::MSSQL config[:adapter_class] = ActiveRecord::ConnectionAdapters::MSSQLAdapter unless config.key?(:adapter_class) return jndi_connection(config) if jndi_config?(config) begin require 'jdbc/jtds' # NOTE: the adapter has only support for working with the # open-source jTDS driver (won't work with MS's driver) ! ::Jdbc::JTDS.load_driver(:require) if defined?(::Jdbc::JTDS.load_driver) rescue LoadError => e # assuming driver.jar is on the class-path raise e unless e.message.to_s.index('no such file to load') end config[:host] ||= 'localhost' config[:port] ||= 1433 config[:driver] ||= defined?(::Jdbc::JTDS.driver_name) ? ::Jdbc::JTDS.driver_name : 'net.sourceforge.jtds.jdbc.Driver' config[:connection_alive_sql] ||= 'SELECT 1' config[:url] ||= begin url = "jdbc:jtds:sqlserver://#{config[:host]}:#{config[:port]}/#{config[:database]}" # Instance is often a preferrable alternative to port when dynamic ports are used. # If instance is specified then port is essentially ignored. url << ";instance=#{config[:instance]}" if config[:instance] # This will enable windows domain-based authentication and will require the JTDS native libraries be available. url << ";domain=#{config[:domain]}" if config[:domain] # AppName is shown in sql server as additional information against the connection. url << ";appname=#{config[:appname]}" if config[:appname] url end unless config[:domain] config[:username] ||= 'sa' config[:password] ||= '' end jdbc_connection(config) end alias_method :jdbcmssql_connection, :mssql_connection # @note Assumes SQLServer SQL-JDBC driver on the class-path. def sqlserver_connection(config) config[:adapter_spec] ||= ::ArJdbc::MSSQL config[:adapter_class] = ActiveRecord::ConnectionAdapters::MSSQLAdapter unless config.key?(:adapter_class) return jndi_connection(config) if jndi_config?(config) config[:host] ||= 'localhost' config[:driver] ||= 'com.microsoft.sqlserver.jdbc.SQLServerDriver' config[:connection_alive_sql] ||= 'SELECT 1' config[:url] ||= begin url = "jdbc:sqlserver://#{config[:host]}" url << ( config[:port] ? ":#{config[:port]};" : ';' ) url << "databaseName=#{config[:database]};" if config[:database] url << "instanceName=#{config[:instance]};" if config[:instance] app = config[:appname] || config[:application] url << "applicationName=#{app};" if app isc = config[:integrated_security] # Win only - needs sqljdbc_auth.dll url << "integratedSecurity=#{isc};" unless isc.nil? url end jdbc_connection(config) end alias_method :jdbcsqlserver_connection, :sqlserver_connection end
{ "content_hash": "7bd196c32414d1204b3a044250532ac6", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 122, "avg_line_length": 43.65822784810127, "alnum_prop": 0.6688895331980285, "repo_name": "kares/activerecord-jdbc-adapter", "id": "2946f71d6e116dbc8bd750a6ad05cea9029a805e", "size": "3449", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/arjdbc/mssql/connection_methods.rb", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Java", "bytes": "442216" }, { "name": "Ruby", "bytes": "925943" }, { "name": "Shell", "bytes": "259" } ], "symlink_target": "" }
/** * Created by yangm11 on 7/6/2017. */ 'use strict'; const fs = require('fs'); const path = require('path'); function listDir(dir) { let s = fs.statSync(dir); if (s.isFile()) { throw 'A directory expected'; } if (s.isDirectory()) { let arr = fs.readdirSync(dir); let res = { files: [], directories: [] }; for (let i = 0; i < arr.length; i++) { if (fs.statSync(path.join(dir, arr[i])).isFile()) { res.files.push(arr[i]); } else { res.directories.push(arr[i]); } } return res; } throw 'Failed to read the directory provided'; } if (typeof module !== 'undefined' && module.parent) { module.exports = listDir; } else { // test codes go here console.log(listDir('../')); }
{ "content_hash": "2df05b375dd13ba1995cf648d81061ef", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 57, "avg_line_length": 19.82051282051282, "alnum_prop": 0.5498059508408797, "repo_name": "mingzhangyang/commonUse", "id": "f892f3e0a997123677e82f6c8e98afcc2beb7d59", "size": "773", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "files/listDir.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "8061" }, { "name": "JavaScript", "bytes": "330769" }, { "name": "TypeScript", "bytes": "7199" } ], "symlink_target": "" }
package com.quillbytes.asserteasy.spec; import java.io.File; import java.net.URI; public interface RequestSpec<RequestType> { ResponseSpec get(String uri); ResponseSpec get(URI uri); ResponseSpec post(String uri); ResponseSpec post(URI uri); ResponseSpec put(String uri); ResponseSpec put(URI uri); ResponseSpec patch(String uri); ResponseSpec patch(URI uri); ResponseSpec delete(String uri); ResponseSpec delete(URI uri); ResponseSpec head(String uri); ResponseSpec head(URI uri); ResponseSpec options(String uri); ResponseSpec options(URI uri); ResponseSpec uploadFile(String uri, File file); ResponseSpec uploadFile(URI uri, File file); RequestType getRequest(); URI getURI(); }
{ "content_hash": "e274c1e5d3f634fbc64f3e0f7fd5cf1c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 51, "avg_line_length": 29.115384615384617, "alnum_prop": 0.7199471598414795, "repo_name": "jaspercastillo/asserteasy", "id": "7ed7f64159addaf5ff6c05fba02324444dc905c7", "size": "757", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/quillbytes/asserteasy/spec/RequestSpec.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "20126" } ], "symlink_target": "" }
require 'spec_helper' class PauseJob @queue = :test def self.perform(*args) end end describe ResquePauseHelper do context "when check queue status" do it "should return return false if don't have register on redis" do Resque.redis.del "pause:queue:queue1" expect(subject.paused?("queue1")).to be_falsey end it "should return return true if have register on redis" do Resque.redis.set "pause:queue:queue1", "AnyValue" expect(subject.paused?("queue1")).to be_truthy end end context "when pause a queue" do it "should register a unregistred queue" do Resque.redis.del "pause:queue:queue1" subject.pause("queue1") expect(subject.paused?("queue1")).to be_truthy end it "should register again a registred queue" do Resque.redis.set "pause:queue:queue1", "AnyValue" expect { subject.pause("queue1") }.to_not raise_error expect(Resque.redis.get("pause:queue:queue1")).not_to be_nil expect(Resque.redis.get("pause:queue:queue1")).to be_truthy end end context "when unpause a queue" do it "should unregister a unregistred queue" do Resque.redis.del "pause:queue:queue1" subject.unpause("queue1") expect(subject.paused?("queue1")).to be_falsey end it "should unregister a registred queue" do Resque.redis.set "pause:queue:queue1", "AnyValue" expect { subject.unpause("queue1") }.to_not raise_error expect(Resque.redis.get("pause:queue:queue1")).to be_nil end end context "when enqueue a job" do it "should enqueue on a empty queue" do Resque.redis.del "queue:queue1" subject.enqueue_job(:queue => "queue1", :class => PauseJob, :args => nil) expect(Resque.redis.llen("queue:queue1").to_i).to eq(1) end it "should enqueue on beginning of a queue" do Resque.redis.lpush "queue:queue1", {:class => PauseJob, :args => [1, 2]}.to_json subject.enqueue_job(:queue => "queue1", :class => PauseJob, :args => [1]) jobs = Resque.redis.lrange('queue:queue1', 0, 10) expect(jobs.count).to eq(2) expect(jobs[0]).to eq({:class => PauseJob, :args => [1]}.to_json) expect(jobs[1]).to eq({:class => PauseJob, :args => [1, 2]}.to_json) end end context "when checking if queue is paused" do it "should check if queue is paused" do expect(subject).to receive(:paused?).with("queue1") subject.check_paused(:queue => "queue1") end it "should not raise error when queue is not paused" do expect(subject).to receive(:paused?).with("queue1").and_return(false) expect { subject.check_paused(:queue => "queue1") }.to_not raise_error end it "should raise error when queue is paused" do allow(subject).to receive(:enqueue_job) allow(subject).to receive(:paused?).with("queue1").and_return(true) expect { subject.check_paused(:queue => "queue1") }.to raise_error(Resque::Job::DontPerform) end it "should enqueue the job again when queue is paused" do allow(subject).to receive(:paused?).with("queue1").and_return(true) args = {:queue => "queue1", :class => PauseJob, :args => [1, 2]} expect(subject).to receive(:enqueue_job).with(args) subject.check_paused(args) rescue nil end end end
{ "content_hash": "a97aa1bb6d43701162ffe9f85302a5b1", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 98, "avg_line_length": 29.9009009009009, "alnum_prop": 0.6514010244049413, "repo_name": "wandenberg/resque-pause", "id": "8ddd141253661bb293ff5abaa96ddae7fb8481cc", "size": "3319", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/resque_pause_helper_spec.rb", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "991" }, { "name": "JavaScript", "bytes": "493" }, { "name": "Ruby", "bytes": "19860" } ], "symlink_target": "" }
<!-- partial HTML of patch panel app --> <div id="ov-sample-custom" ng-controller="OvSampleCustomCtrl"> <div class="button-panel"> <div class="my-button" ng-click="getData()"> Load Devices </div> </div> <div class="data-panel"> <div> <label>Devices: <select ng-model="myDev" ng-options="dev.name for dev in devices"></select> </label> </div> </div> <div class="button-panel"> <div class="my-button" ng-click="loadPorts()"> Load Ports </div> </div> <div class="data-panel2"> <label>First Port: <select ng-model="myPort1" ng-options="port.name for port in ports"></select> </label> <label>Second Port: <select ng-model="myPort2" ng-options="port.name for port in ports"></select> </label> </div> <div class="button-panel"> <div class="my-button" ng-click="done()"> Patch! </div> </div> <div class="data-panel3"> <p> <span class="quote">{{data.message}} </span> </p> <pre> </pre> </div> <div class="button-panel"> <div class="my-button" ng-click="used()"> ConnectPoints in use </div> </div> <div class="data-panel4"> <p> <span class="quote">{{data.cpoints}} </span> </p> </div> </div>
{ "content_hash": "a1c33d0a615ef548ab9826888cf05960", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 91, "avg_line_length": 26.77777777777778, "alnum_prop": 0.4972337482710927, "repo_name": "wuwenbin2/onos_bgp_evpn", "id": "34204b4de3f2e852583e1fe73660d07897c2cf37", "size": "1446", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "apps/patchpanel/src/main/resources/app/view/sampleCustom/sampleCustom.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "211779" }, { "name": "Groff", "bytes": "1090" }, { "name": "HTML", "bytes": "177259" }, { "name": "Java", "bytes": "25432628" }, { "name": "JavaScript", "bytes": "2970699" }, { "name": "Protocol Buffer", "bytes": "8451" }, { "name": "Python", "bytes": "126671" }, { "name": "Shell", "bytes": "913" }, { "name": "Thrift", "bytes": "16641" } ], "symlink_target": "" }
package com.snowplowanalytics.snowplow.rdbloader package utils import scala.reflect.runtime.universe._ import scala.reflect.runtime.{universe => ru} import scala.util.control.NonFatal import cats.data._ import cats.implicits._ import org.json4s.JValue import org.json4s.jackson.{parseJson => parseJson4s} import io.circe._ // This project import LoaderError._ import config.Step /** * Various common utility functions */ object Common { /** * Remove all occurrences of access key id and secret access key from message * Helps to avoid publishing credentials on insecure channels * * @param message original message that may contain credentials * @param stopWords list of secret words (such as passwords) that should be sanitized * @return string with hidden keys */ def sanitize(message: String, stopWords: List[String]): String = stopWords.foldLeft(message) { (result, secret) => result.replaceAll(secret, "x" * secret.length) } /** * Generate result for end-of-the-world log message using loading result * * @param result loading process state * @return log entry, which can be interpreted accordingly */ def interpret(result: (List[Step], Either[LoaderError, Unit])): Log = { result match { case (steps, Right(_)) => Log.LoadingSucceeded(steps.reverse) case (steps, Left(error)) => Log.LoadingFailed(error.show, steps.reverse) } } /** * Transforms CamelCase string into snake_case * Also replaces all hyphens with underscores * * @see https://github.com/snowplow/iglu/blob/master/0-common/schema-ddl/src/main/scala/com.snowplowanalytics/iglu.schemaddl/StringUtils.scala * @param str string to transform * @return the underscored string */ def toSnakeCase(str: String): String = str.replaceAll("([A-Z]+)([A-Z][a-z])", "$1_$2") .replaceAll("([a-z\\d])([A-Z])", "$1_$2") .replaceAll("-", "_") .replaceAll("""\.""", "_") .toLowerCase /** * Common trait for all ADTs that can be read from string * Must be extended by sealed hierarchy including only singletons * Used by `decodeStringEnum` to get runtime representation of whole ADT */ trait StringEnum { /** * **IN** string representation. * It should be used only to help read `StringEnum` from string * and never other way round, such as render value into SQL statement */ def asString: String } /** * Derive decoder for ADT with `StringEnum` * * @tparam A sealed hierarchy * @return circe decoder for ADT `A` */ def decodeStringEnum[A <: StringEnum: TypeTag]: Decoder[A] = Decoder.instance(parseEnum[A]) /** * Helper method to parse Json4s JSON AST without exceptions * Truncate invalid JSON in error to prevent exposing credentials * * @param json string presumably containing valid JSON * @return json4s JValue AST if success */ def safeParse(json: String): Either[ConfigError, JValue] = try { parseJson4s(json).asRight } catch { case NonFatal(_) => ParseError(s"Invalid JSON [${json.take(10)}...]").asLeft } /** * Parse element of `StringEnum` sealed hierarchy from circe AST * * @param hCursor parser's cursor * @tparam A sealed hierarchy * @return either successful circe AST or decoding failure */ private def parseEnum[A <: StringEnum: TypeTag](hCursor: HCursor): Decoder.Result[A] = { for { string <- hCursor.as[String] method = fromString[A](string) result <- method.asDecodeResult(hCursor) } yield result } /** * Parse element of `StringEnum` sealed hierarchy from String * * @param string line containing `asString` representation of `StringEnum` * @tparam A sealed hierarchy * @return either successful circe AST or decoding failure */ def fromString[A <: StringEnum: TypeTag](string: String): Either[String, A] = { val map = sealedDescendants[A].map { o => (o.asString, o) }.toMap map.get(string) match { case Some(a) => Right(a) case None => Left(s"Unknown ${typeOf[A].typeSymbol.name.toString} [$string]") } } /** * Get all objects extending some sealed hierarchy * @tparam Root some sealed trait with object descendants * @return whole set of objects */ def sealedDescendants[Root: TypeTag]: Set[Root] = { val symbol = typeOf[Root].typeSymbol val internal = symbol.asInstanceOf[scala.reflect.internal.Symbols#Symbol] val descendants = if (internal.isSealed) Some(internal.sealedDescendants.map(_.asInstanceOf[Symbol]) - symbol) else None descendants.getOrElse(Set.empty).map(x => getCaseObject(x).asInstanceOf[Root]) } private val m = ru.runtimeMirror(getClass.getClassLoader) /** * Reflection method to get runtime object by compiler's `Symbol` * @param desc compiler runtime `Symbol` * @return "real" scala case object */ private def getCaseObject(desc: Symbol): Any = { val mod = m.staticModule(desc.asClass.fullName) m.reflectModule(mod).instance } /** * Syntax extension to transform `Either` with string as failure * into circe-appropriate decoder result */ implicit class ParseErrorOps[A](val error: Either[String, A]) extends AnyVal { def asDecodeResult(hCursor: HCursor): Decoder.Result[A] = error match { case Right(success) => Right(success) case Left(message) => Left(DecodingFailure(message, hCursor.history)) } } /** * Syntax extension to parse JSON objects with known keys */ implicit class JsonHashOps(val obj: Map[String, Json]) extends AnyVal { def getKey(key: String, hCursor: HCursor): Decoder.Result[Json] = obj.get(key) match { case Some(success) => Right(success) case None => Left(DecodingFailure(s"Key [$key] is missing", hCursor.history)) } } /** * Syntax extension to transform left type in `ValidationNel` */ implicit class LeftMapNel[L, R](val validation: ValidatedNel[L, R]) extends AnyVal { def leftMapNel[LL](l: L => LL): ValidatedNel[LL, R] = validation.leftMap(_.map(l)) } /** * Extract integer from string if it contains only valid number */ object IntString { def unapply(s: String): Option[Int] = try { Some(s.toInt) } catch { case _: NumberFormatException => None } } }
{ "content_hash": "fdce75768dc2c7146d9b51c3df822be2", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 144, "avg_line_length": 32.18781725888325, "alnum_prop": 0.6748146979971613, "repo_name": "acgray/snowplow", "id": "7eabe219b96a7a34e5d8da9ff7e79af6084aadac", "size": "7045", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "4-storage/rdb-loader/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/utils/Common.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "119" }, { "name": "Clojure", "bytes": "18945" }, { "name": "HTML", "bytes": "3654" }, { "name": "Java", "bytes": "38516" }, { "name": "JavaScript", "bytes": "7677" }, { "name": "LookML", "bytes": "153378" }, { "name": "PLpgSQL", "bytes": "60098" }, { "name": "Python", "bytes": "10880" }, { "name": "Ruby", "bytes": "126533" }, { "name": "Scala", "bytes": "1951289" }, { "name": "Shell", "bytes": "9809" }, { "name": "Thrift", "bytes": "3707" } ], "symlink_target": "" }
<!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"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.13"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Neodroid: /home/heider/Projects/Neodroid/Unity/Examples/Assets/droid/Runtime/Utilities/Structs/Space2.cs File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="neodroidcropped124.png"/></td> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Neodroid &#160;<span id="projectnumber">0.2.0</span> </div> <div id="projectbrief">Machine Learning Environment Prototyping Tool</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('_space2_8cs.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> &#124; <a href="#namespaces">Namespaces</a> </div> <div class="headertitle"> <div class="title">Space2.cs File Reference</div> </div> </div><!--header--> <div class="contents"> <p><a href="_space2_8cs_source.html">Go to the source code of this file.</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Classes</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdroid_1_1_runtime_1_1_utilities_1_1_structs_1_1_space2.html">droid.Runtime.Utilities.Structs.Space2</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a> Namespaces</h2></td></tr> <tr class="memitem:namespacedroid_1_1_runtime_1_1_utilities_1_1_structs"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedroid_1_1_runtime_1_1_utilities_1_1_structs.html">droid.Runtime.Utilities.Structs</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="dir_4f6666a8f2ab10bc970eb7559668f031.html">Runtime</a></li><li class="navelem"><a class="el" href="dir_d8da6fe6dddc6eeb0ed1e78a961648bc.html">Utilities</a></li><li class="navelem"><a class="el" href="dir_f76b7d29d9147939685f8614f6348f82.html">Structs</a></li><li class="navelem"><a class="el" href="_space2_8cs.html">Space2.cs</a></li> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> </ul> </div> </body> </html>
{ "content_hash": "38a7c52e96ff1af96153c473a0e6e4d0", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 379, "avg_line_length": 45.46153846153846, "alnum_prop": 0.6837751457040797, "repo_name": "sintefneodroid/droid", "id": "ea54d01a6c4e4f7921018af443ef31eed3e00739", "size": "5319", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/cvs/_space2_8cs.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "1475508" }, { "name": "HLSL", "bytes": "3678" }, { "name": "ShaderLab", "bytes": "157664" }, { "name": "Shell", "bytes": "204" } ], "symlink_target": "" }
/** * Program Name: CookieSalesLN.java * Program Purpose: Track cookie sales for girl scouts. * Date Created: 1/9/2017 * Last Modified: 1/11/2017 * * @author Liam Nickell * @version 1.0.0 */ public class CookieSalesLN { public static void main(String[] args) { String[] names = {"Anika", "Beatriz", "Cosima", "Delphine", "Esmerelda", "Fia", "Gemma", "Irina", "Jamila", "Katya"}; int[] sales = new int[10]; for(int i=0; i<10; i++) { sales[i] = (int) (Math.random()*11); } System.out.println("\nWeek 1"); printCookies(names, sales); topThree(names, sales); System.out.println("Week 2"); logCookies("Beatriz", 12, names, sales); logCookies("Delphine", 4, names, sales); logCookies("Fia", 8, names, sales); logCookies("Jamila", 15, names, sales); topThree(names, sales); System.out.println("Week 3"); logCookies("Anika", 14, names, sales); logCookies("Cosima", 6, names, sales); logCookies("Esmerelda", 2, names, sales); logCookies("Katya", 11, names, sales); topThree(names, sales); System.out.println("Week 4"); logCookies("Gemma", 18, names, sales); logCookies("Irina", 9, names, sales); logCookies("Beatriz", 7, names, sales); logCookies("Jamila", 13, names, sales); topThree(names, sales); printCookies(names, sales); int sum = 0; for(int i=0; i<10; i++) { sum += sales[i]; } System.out.println("Total boxes sold: " + sum); if(sum >= 150*1.1) { System.out.println("Congratulations, you get a pizza party!"); } else { System.out.println("Sorry, you don't get a pizza party."); } } /** * Method Purpose: lists top three girl scouts (by cookie sales) * * @param names string array containing girl scout names * @param sales int array containing number of boxes for each girl scout (parallel array to names) */ public static void topThree(String[] names, int[] sales) { int firstPlaceIndex = 0; int secondPlaceIndex = 0; int thirdPlaceIndex = 0; int store1 = 0; int store2 = 0; for(int i=1; i<10; i++) { if(sales[i] > sales[firstPlaceIndex]) { store1 = firstPlaceIndex; store2 = secondPlaceIndex; firstPlaceIndex = i; secondPlaceIndex = store1; thirdPlaceIndex = store2; } else if(firstPlaceIndex == secondPlaceIndex || sales[i] > sales[secondPlaceIndex]) { store1 = secondPlaceIndex; secondPlaceIndex = i; thirdPlaceIndex = store1; } else if(firstPlaceIndex == thirdPlaceIndex || sales[i] > sales[thirdPlaceIndex]) { thirdPlaceIndex = i; } } System.out.println("Top Three"); System.out.println("\tFirst: " + names[firstPlaceIndex] + " -- " + sales[firstPlaceIndex] + " boxes"); System.out.println("\tSecond: " + names[secondPlaceIndex] + " -- " + sales[secondPlaceIndex] + " boxes"); System.out.println("\tThird: " + names[thirdPlaceIndex] + " -- " + sales[thirdPlaceIndex] + " boxes\n"); } /** * Method Purpose: add new sales to total sales for given girl scout * * @param name girl scout to add sales to * @param additionalSales number of new sales to add * @param names string array containing girl scout names * @param sales int array containing number of boxes for each girl scout (parallel array to names) * * @return new total sales for given girl scout */ public static int logCookies(String name, int additionalSales, String[] names, int[] sales) { for(int i=0; i<10; i++) { if(names[i].equals(name)) { sales[i] += additionalSales; return sales[i]; } } System.out.println("Name Not Found."); return 0; } /** * Method Purpose: print all girl scouts and their sales * * @param names string array containing girl scout names * @param sales int array containing number of boxes for each girl scout (parallel array to names) */ public static void printCookies(String[] names, int[] sales) { for(int i=0; i<10; i++) { if(names[i].length() <= 7) { System.out.println(names[i] + "\t\t" + sales[i]); } else { System.out.println(names[i] + "\t" + sales[i]); } } System.out.println(); } }
{ "content_hash": "d5150a940730ca924175d74c7abf7535", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 125, "avg_line_length": 34.54347826086956, "alnum_prop": 0.55359765051395, "repo_name": "liamnickell/ap-cs", "id": "2d24a4b0dc5e25b1217a6328cc2c5c5f680411db", "size": "4767", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CookieSales/CookieSalesLN.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "5680" }, { "name": "HTML", "bytes": "208828" }, { "name": "Java", "bytes": "127667" } ], "symlink_target": "" }
<?php class YdCrypt { /** * @var string */ static private $key = YII_DRESSING_HASH; /** * @param string $decrypted * @param bool $lowSecurity * @return string */ static public function encrypt($decrypted, $lowSecurity = false) { $key = self::getKey(); if ($lowSecurity) return self::safe_base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $decrypted, MCRYPT_MODE_CBC, md5(md5($key)))); $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); $plain_utf8 = utf8_encode($decrypted); $cipher = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plain_utf8, MCRYPT_MODE_CBC, $iv); return self::safe_base64_encode($iv . $cipher); } /** * @param string $encrypted * @param bool $lowSecurity * @return string */ static public function decrypt($encrypted, $lowSecurity = false) { $key = self::getKey(); if ($lowSecurity) return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), self::safe_base64_decode($encrypted), MCRYPT_MODE_CBC, md5(md5($key))), "\0"); $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); $cipher = self::safe_base64_decode($encrypted); $iv = substr($cipher, 0, $iv_size); $cipher = substr($cipher, $iv_size); return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $cipher, MCRYPT_MODE_CBC, $iv)); } /** * @return string */ static private function getKey() { return pack('H*', md5(date('Ymd') . self::$key)); } /** * @param $value * @return bool|mixed */ static private function safe_base64_encode($value) { if (!is_string($value)) { return false; } return str_replace(array('+', '/', '='), array('-', '_', '*'), base64_encode($value)); } /** * @param $value * @return bool|mixed */ static private function safe_base64_decode($value) { if (!is_string($value)) { return false; } return base64_decode(str_replace(array('-', '_', '*'), array('+', '/', '='), $value)); } }
{ "content_hash": "d397d903fd205fb9b42e15df4806cc20", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 150, "avg_line_length": 29.415584415584416, "alnum_prop": 0.5518763796909493, "repo_name": "cornernote/yii-dressing", "id": "3378fe7aca8dcd0f3059b7db1f57e01ed4f61a11", "size": "2597", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "yii-dressing/components/YdCrypt.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "88039" }, { "name": "CoffeeScript", "bytes": "1254" }, { "name": "HTML", "bytes": "70017" }, { "name": "JavaScript", "bytes": "486720" }, { "name": "PHP", "bytes": "583377" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>vst: Not compatible ๐Ÿ‘ผ</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.1+2 / vst - 2.7.1</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">ยซ Up</a> <h1> vst <small> 2.7.1 <span class="label label-info">Not compatible ๐Ÿ‘ผ</span> </small> </h1> <p>๐Ÿ“… <em><script>document.write(moment("2022-10-05 10:47:20 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-05 10:47:20 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.7.1+2 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.03.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.03.0 Official 4.03.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; synopsis: &quot;Verified Software Toolchain&quot; description: &quot;The software toolchain includes static analyzers to check assertions about your program; optimizing compilers to translate your program to machine language; operating systems and libraries to supply context for your program. The Verified Software Toolchain project assures with machine-checked proofs that the assertions claimed at the top of the toolchain really hold in the machine-language program, running in the operating-system context.&quot; authors: [ &quot;Andrew W. Appel&quot; &quot;Lennart Beringer&quot; &quot;Sandrine Blazy&quot; &quot;Qinxiang Cao&quot; &quot;Santiago Cuellar&quot; &quot;Robert Dockins&quot; &quot;Josiah Dodds&quot; &quot;Nick Giannarakis&quot; &quot;Samuel Gruetter&quot; &quot;Aquinas Hobor&quot; &quot;Jean-Marie Madiot&quot; &quot;William Mansky&quot; ] maintainer: &quot;VST team&quot; homepage: &quot;http://vst.cs.princeton.edu/&quot; dev-repo: &quot;git+https://github.com/PrincetonUniversity/VST.git&quot; bug-reports: &quot;https://github.com/PrincetonUniversity/VST/issues&quot; license: &quot;https://raw.githubusercontent.com/PrincetonUniversity/VST/master/LICENSE&quot; build: [ [make &quot;-j%{jobs}%&quot; &quot;BITSIZE=64&quot;] ] install: [ [make &quot;install&quot; &quot;BITSIZE=64&quot;] ] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.12&quot; &amp; &lt; &quot;8.14&quot;} &quot;coq-compcert&quot; {(= &quot;3.8&quot;) | (= &quot;3.8~open-source&quot;)} &quot;coq-flocq&quot; {&gt;= &quot;3.2.1&quot;} ] tags: [ &quot;category:Computer Science/Semantics and Compilation/Semantics&quot; &quot;keyword:C&quot; &quot;logpath:VST&quot; &quot;date:2020-12-20&quot; ] url { src: &quot;https://github.com/PrincetonUniversity/VST/archive/v2.7.1.tar.gz&quot; checksum: &quot;sha512=cf8ab6bee5322a938859feaeb292220a32c5fa966f5fe183154ca0b6f6cb04129b5cb2c669af0ff1d95f6e962119f9eb0670c1b5150a62205c003650c625e455&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install ๐Ÿœ๏ธ</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-vst.2.7.1 coq.8.7.1+2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+2). The following dependencies couldn&#39;t be met: - coq-vst -&gt; coq-compcert (= 3.8 &amp; = 3.8~open-source) -&gt; ocaml &gt;= 4.05.0 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-vst.2.7.1</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install ๐Ÿš€</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall ๐Ÿงน</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> ยฉ Guillaume Claret ๐Ÿฃ </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "898bfcee20b35281e0ed306380f2de70", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 467, "avg_line_length": 41.98918918918919, "alnum_prop": 0.565010298661174, "repo_name": "coq-bench/coq-bench.github.io", "id": "f4fdaffd5bc8896ff2079fe7ecf1a5be2ff44eed", "size": "7793", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.03.0-2.0.5/released/8.7.1+2/vst/2.7.1.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
$gitVersionExe = "C:\git_pub\ZendeskApi_v2\build\GitVersion\GitVersion.exe" cd C:\git_pub\ZendeskApi_v2\src #& $path /l console /output buildserver /updateAssemblyInfo $output = gitversion $joined = $output -join "`n" $versionInfo = $joined | ConvertFrom-Json $versionInfo | % { foreach ($property in $_.PSObject.Properties) { Set-AppveyorBuildVariable -Name "GitVersion_$($property.Name)" -Value "$($_.PSObject.properties[$property.Name].Value)" } } Update-AppveyorBuild -Version "$versionInfo.NuGetVersionV2" + ".build.$env:APPVEYOR_BUILD_ID" #Write-Host $versionInfo;
{ "content_hash": "e045488aa587d9dc52cb5276dd42287a", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 119, "avg_line_length": 33.88235294117647, "alnum_prop": 0.7395833333333334, "repo_name": "mwarger/ZendeskApi_v2", "id": "e8c71eaca54349d0d4c9cf1caadc16525b293f7d", "size": "576", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "testing.ps1", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "111" }, { "name": "C#", "bytes": "625929" }, { "name": "PowerShell", "bytes": "14395" } ], "symlink_target": "" }
๏ปฟ//===================== Copyright (c) Valve Corporation. All Rights Reserved. ====================== using UnityEngine; using System.Collections; [RequireComponent(typeof(VRInteractable))] public class VRInteractableExample : MonoBehaviour { private TextMesh textMesh; private Vector3 oldPosition; private Quaternion oldRotation; void Awake() { textMesh = GetComponentInChildren<TextMesh>(); textMesh.text = "No Hand Hovering"; } /// <summary> /// Called when a VRHand starts hovering over me. /// </summary> /// <param name="hand"></param> void OnHandHoverBegin( VRHand hand ) { textMesh.text = "Hovering hand: " + hand.name; } /// <summary> /// Called when a VRHand stops hovering over me. /// </summary> /// <param name="hand"></param> void OnHandHoverEnd( VRHand hand ) { textMesh.text = "No Hand Hovering"; } /// <summary> /// Called every Update() while a VRHand is hovering over me. /// </summary> /// <param name="hand"></param> void HandHoverUpdate( VRHand hand ) { if ( hand.GetStandardInteractionButtonDown() || ( ( hand.controller != null ) && hand.controller.GetPressDown( Valve.VR.EVRButtonId.k_EButton_Grip ) ) ) { if ( hand.currentAttachedObject != gameObject ) { // Save our position/rotation so that we can restore it when we detach oldPosition = transform.position; oldRotation = transform.rotation; // Call this to continue receiving HandHoverUpdate messages, // and prevent the hand from hovering over anything else hand.HoverLock( GetComponent<VRInteractable>() ); // Attach this object to the hand hand.AttachObject( gameObject, false ); } else { // Detach this object from the hand hand.DetachObject( gameObject ); // Call this to undo HoverLock hand.HoverUnlock( GetComponent<VRInteractable>() ); // Restore position/rotation transform.position = oldPosition; transform.rotation = oldRotation; } } } /// <summary> /// Called when our GameObject becomes attached to the hand /// </summary> /// <param name="hand"></param> void OnAttachedToHand( VRHand hand ) { textMesh.text = "Attached to hand: " + hand.name; } /// <summary> /// Called when our GameObject detaches from the hand /// </summary> /// <param name="hand"></param> void OnDetachedFromHand( VRHand hand ) { textMesh.text = "Detached from hand: " + hand.name; } /// <summary> /// Called every Update() while our GameObject is attached to the hand /// </summary> /// <param name="hand"></param> void HandAttachedUpdate( VRHand hand ) { } /// <summary> /// Called when our attached GameObject becomes the primary attached object /// </summary> /// <param name="hand"></param> void OnHandFocusAcquired( VRHand hand ) { } /// <summary> /// Called when another attached GameObject becomes the primary attached object /// </summary> /// <param name="hand"></param> void OnHandFocusLost( VRHand hand ) { } }
{ "content_hash": "2a5d79b8deaa2b19d429797314be7f19", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 154, "avg_line_length": 24.915966386554622, "alnum_prop": 0.666779089376054, "repo_name": "zhutaorun/ViveUGUIModule", "id": "f7d9a26c062040400ddaf08bfcf12eb1b33828de", "size": "2967", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Assets/Valve/vr_interaction_system/Scripts/VRInteractableExample.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "337789" }, { "name": "GLSL", "bytes": "4821" } ], "symlink_target": "" }
/*================================================================================ code generated by: java2cpp author: Zoran Angelov, mailto://baldzar@gmail.com class: java.sql.PreparedStatement ================================================================================*/ #ifndef J2CPP_INCLUDE_IMPLEMENTATION #ifndef J2CPP_JAVA_SQL_PREPAREDSTATEMENT_HPP_DECL #define J2CPP_JAVA_SQL_PREPAREDSTATEMENT_HPP_DECL namespace j2cpp { namespace java { namespace lang { class String; } } } namespace j2cpp { namespace java { namespace lang { class Object; } } } namespace j2cpp { namespace java { namespace math { class BigDecimal; } } } namespace j2cpp { namespace java { namespace net { class URL; } } } namespace j2cpp { namespace java { namespace util { class Calendar; } } } namespace j2cpp { namespace java { namespace io { class InputStream; } } } namespace j2cpp { namespace java { namespace io { class Reader; } } } namespace j2cpp { namespace java { namespace sql { class Array; } } } namespace j2cpp { namespace java { namespace sql { class Blob; } } } namespace j2cpp { namespace java { namespace sql { class Clob; } } } namespace j2cpp { namespace java { namespace sql { class Statement; } } } namespace j2cpp { namespace java { namespace sql { class Time; } } } namespace j2cpp { namespace java { namespace sql { class ResultSetMetaData; } } } namespace j2cpp { namespace java { namespace sql { class Ref; } } } namespace j2cpp { namespace java { namespace sql { class ParameterMetaData; } } } namespace j2cpp { namespace java { namespace sql { class ResultSet; } } } namespace j2cpp { namespace java { namespace sql { class Timestamp; } } } namespace j2cpp { namespace java { namespace sql { class Date; } } } #include <java/io/InputStream.hpp> #include <java/io/Reader.hpp> #include <java/lang/Object.hpp> #include <java/lang/String.hpp> #include <java/math/BigDecimal.hpp> #include <java/net/URL.hpp> #include <java/sql/Array.hpp> #include <java/sql/Blob.hpp> #include <java/sql/Clob.hpp> #include <java/sql/Date.hpp> #include <java/sql/ParameterMetaData.hpp> #include <java/sql/Ref.hpp> #include <java/sql/ResultSet.hpp> #include <java/sql/ResultSetMetaData.hpp> #include <java/sql/Statement.hpp> #include <java/sql/Time.hpp> #include <java/sql/Timestamp.hpp> #include <java/util/Calendar.hpp> namespace j2cpp { namespace java { namespace sql { class PreparedStatement; class PreparedStatement : public object<PreparedStatement> { public: J2CPP_DECLARE_CLASS J2CPP_DECLARE_METHOD(0) J2CPP_DECLARE_METHOD(1) J2CPP_DECLARE_METHOD(2) J2CPP_DECLARE_METHOD(3) J2CPP_DECLARE_METHOD(4) J2CPP_DECLARE_METHOD(5) J2CPP_DECLARE_METHOD(6) J2CPP_DECLARE_METHOD(7) J2CPP_DECLARE_METHOD(8) J2CPP_DECLARE_METHOD(9) J2CPP_DECLARE_METHOD(10) J2CPP_DECLARE_METHOD(11) J2CPP_DECLARE_METHOD(12) J2CPP_DECLARE_METHOD(13) J2CPP_DECLARE_METHOD(14) J2CPP_DECLARE_METHOD(15) J2CPP_DECLARE_METHOD(16) J2CPP_DECLARE_METHOD(17) J2CPP_DECLARE_METHOD(18) J2CPP_DECLARE_METHOD(19) J2CPP_DECLARE_METHOD(20) J2CPP_DECLARE_METHOD(21) J2CPP_DECLARE_METHOD(22) J2CPP_DECLARE_METHOD(23) J2CPP_DECLARE_METHOD(24) J2CPP_DECLARE_METHOD(25) J2CPP_DECLARE_METHOD(26) J2CPP_DECLARE_METHOD(27) J2CPP_DECLARE_METHOD(28) J2CPP_DECLARE_METHOD(29) J2CPP_DECLARE_METHOD(30) J2CPP_DECLARE_METHOD(31) J2CPP_DECLARE_METHOD(32) J2CPP_DECLARE_METHOD(33) J2CPP_DECLARE_METHOD(34) J2CPP_DECLARE_METHOD(35) J2CPP_DECLARE_METHOD(36) explicit PreparedStatement(jobject jobj) : object<PreparedStatement>(jobj) { } operator local_ref<java::lang::Object>() const; operator local_ref<java::sql::Statement>() const; void addBatch(); void clearParameters(); jboolean execute(); local_ref< java::sql::ResultSet > executeQuery(); jint executeUpdate(); local_ref< java::sql::ResultSetMetaData > getMetaData(); local_ref< java::sql::ParameterMetaData > getParameterMetaData(); void setArray(jint, local_ref< java::sql::Array > const&); void setAsciiStream(jint, local_ref< java::io::InputStream > const&, jint); void setBigDecimal(jint, local_ref< java::math::BigDecimal > const&); void setBinaryStream(jint, local_ref< java::io::InputStream > const&, jint); void setBlob(jint, local_ref< java::sql::Blob > const&); void setBoolean(jint, jboolean); void setByte(jint, jbyte); void setBytes(jint, local_ref< array<jbyte,1> > const&); void setCharacterStream(jint, local_ref< java::io::Reader > const&, jint); void setClob(jint, local_ref< java::sql::Clob > const&); void setDate(jint, local_ref< java::sql::Date > const&); void setDate(jint, local_ref< java::sql::Date > const&, local_ref< java::util::Calendar > const&); void setDouble(jint, jdouble); void setFloat(jint, jfloat); void setInt(jint, jint); void setLong(jint, jlong); void setNull(jint, jint); void setNull(jint, jint, local_ref< java::lang::String > const&); void setObject(jint, local_ref< java::lang::Object > const&); void setObject(jint, local_ref< java::lang::Object > const&, jint); void setObject(jint, local_ref< java::lang::Object > const&, jint, jint); void setRef(jint, local_ref< java::sql::Ref > const&); void setShort(jint, jshort); void setString(jint, local_ref< java::lang::String > const&); void setTime(jint, local_ref< java::sql::Time > const&); void setTime(jint, local_ref< java::sql::Time > const&, local_ref< java::util::Calendar > const&); void setTimestamp(jint, local_ref< java::sql::Timestamp > const&); void setTimestamp(jint, local_ref< java::sql::Timestamp > const&, local_ref< java::util::Calendar > const&); void setUnicodeStream(jint, local_ref< java::io::InputStream > const&, jint); void setURL(jint, local_ref< java::net::URL > const&); }; //class PreparedStatement } //namespace sql } //namespace java } //namespace j2cpp #endif //J2CPP_JAVA_SQL_PREPAREDSTATEMENT_HPP_DECL #else //J2CPP_INCLUDE_IMPLEMENTATION #ifndef J2CPP_JAVA_SQL_PREPAREDSTATEMENT_HPP_IMPL #define J2CPP_JAVA_SQL_PREPAREDSTATEMENT_HPP_IMPL namespace j2cpp { java::sql::PreparedStatement::operator local_ref<java::lang::Object>() const { return local_ref<java::lang::Object>(get_jobject()); } java::sql::PreparedStatement::operator local_ref<java::sql::Statement>() const { return local_ref<java::sql::Statement>(get_jobject()); } void java::sql::PreparedStatement::addBatch() { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(0), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(0), void >(get_jobject()); } void java::sql::PreparedStatement::clearParameters() { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(1), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(1), void >(get_jobject()); } jboolean java::sql::PreparedStatement::execute() { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(2), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(2), jboolean >(get_jobject()); } local_ref< java::sql::ResultSet > java::sql::PreparedStatement::executeQuery() { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(3), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(3), local_ref< java::sql::ResultSet > >(get_jobject()); } jint java::sql::PreparedStatement::executeUpdate() { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(4), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(4), jint >(get_jobject()); } local_ref< java::sql::ResultSetMetaData > java::sql::PreparedStatement::getMetaData() { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(5), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(5), local_ref< java::sql::ResultSetMetaData > >(get_jobject()); } local_ref< java::sql::ParameterMetaData > java::sql::PreparedStatement::getParameterMetaData() { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(6), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(6), local_ref< java::sql::ParameterMetaData > >(get_jobject()); } void java::sql::PreparedStatement::setArray(jint a0, local_ref< java::sql::Array > const &a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(7), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(7), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setAsciiStream(jint a0, local_ref< java::io::InputStream > const &a1, jint a2) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(8), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(8), void >(get_jobject(), a0, a1, a2); } void java::sql::PreparedStatement::setBigDecimal(jint a0, local_ref< java::math::BigDecimal > const &a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(9), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(9), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setBinaryStream(jint a0, local_ref< java::io::InputStream > const &a1, jint a2) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(10), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(10), void >(get_jobject(), a0, a1, a2); } void java::sql::PreparedStatement::setBlob(jint a0, local_ref< java::sql::Blob > const &a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(11), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(11), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setBoolean(jint a0, jboolean a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(12), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(12), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setByte(jint a0, jbyte a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(13), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(13), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setBytes(jint a0, local_ref< array<jbyte,1> > const &a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(14), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(14), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setCharacterStream(jint a0, local_ref< java::io::Reader > const &a1, jint a2) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(15), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(15), void >(get_jobject(), a0, a1, a2); } void java::sql::PreparedStatement::setClob(jint a0, local_ref< java::sql::Clob > const &a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(16), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(16), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setDate(jint a0, local_ref< java::sql::Date > const &a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(17), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(17), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setDate(jint a0, local_ref< java::sql::Date > const &a1, local_ref< java::util::Calendar > const &a2) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(18), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(18), void >(get_jobject(), a0, a1, a2); } void java::sql::PreparedStatement::setDouble(jint a0, jdouble a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(19), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(19), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setFloat(jint a0, jfloat a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(20), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(20), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setInt(jint a0, jint a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(21), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(21), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setLong(jint a0, jlong a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(22), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(22), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setNull(jint a0, jint a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(23), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(23), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setNull(jint a0, jint a1, local_ref< java::lang::String > const &a2) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(24), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(24), void >(get_jobject(), a0, a1, a2); } void java::sql::PreparedStatement::setObject(jint a0, local_ref< java::lang::Object > const &a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(25), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(25), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setObject(jint a0, local_ref< java::lang::Object > const &a1, jint a2) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(26), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(26), void >(get_jobject(), a0, a1, a2); } void java::sql::PreparedStatement::setObject(jint a0, local_ref< java::lang::Object > const &a1, jint a2, jint a3) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(27), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(27), void >(get_jobject(), a0, a1, a2, a3); } void java::sql::PreparedStatement::setRef(jint a0, local_ref< java::sql::Ref > const &a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(28), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(28), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setShort(jint a0, jshort a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(29), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(29), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setString(jint a0, local_ref< java::lang::String > const &a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(30), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(30), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setTime(jint a0, local_ref< java::sql::Time > const &a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(31), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(31), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setTime(jint a0, local_ref< java::sql::Time > const &a1, local_ref< java::util::Calendar > const &a2) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(32), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(32), void >(get_jobject(), a0, a1, a2); } void java::sql::PreparedStatement::setTimestamp(jint a0, local_ref< java::sql::Timestamp > const &a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(33), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(33), void >(get_jobject(), a0, a1); } void java::sql::PreparedStatement::setTimestamp(jint a0, local_ref< java::sql::Timestamp > const &a1, local_ref< java::util::Calendar > const &a2) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(34), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(34), void >(get_jobject(), a0, a1, a2); } void java::sql::PreparedStatement::setUnicodeStream(jint a0, local_ref< java::io::InputStream > const &a1, jint a2) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(35), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(35), void >(get_jobject(), a0, a1, a2); } void java::sql::PreparedStatement::setURL(jint a0, local_ref< java::net::URL > const &a1) { return call_method< java::sql::PreparedStatement::J2CPP_CLASS_NAME, java::sql::PreparedStatement::J2CPP_METHOD_NAME(36), java::sql::PreparedStatement::J2CPP_METHOD_SIGNATURE(36), void >(get_jobject(), a0, a1); } J2CPP_DEFINE_CLASS(java::sql::PreparedStatement,"java/sql/PreparedStatement") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,0,"addBatch","()V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,1,"clearParameters","()V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,2,"execute","()Z") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,3,"executeQuery","()Ljava/sql/ResultSet;") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,4,"executeUpdate","()I") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,5,"getMetaData","()Ljava/sql/ResultSetMetaData;") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,6,"getParameterMetaData","()Ljava/sql/ParameterMetaData;") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,7,"setArray","(ILjava/sql/Array;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,8,"setAsciiStream","(ILjava/io/InputStream;I)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,9,"setBigDecimal","(ILjava/math/BigDecimal;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,10,"setBinaryStream","(ILjava/io/InputStream;I)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,11,"setBlob","(ILjava/sql/Blob;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,12,"setBoolean","(IZ)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,13,"setByte","(IB)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,14,"setBytes","(I[B)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,15,"setCharacterStream","(ILjava/io/Reader;I)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,16,"setClob","(ILjava/sql/Clob;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,17,"setDate","(ILjava/sql/Date;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,18,"setDate","(ILjava/sql/Date;Ljava/util/Calendar;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,19,"setDouble","(ID)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,20,"setFloat","(IF)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,21,"setInt","(II)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,22,"setLong","(IJ)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,23,"setNull","(II)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,24,"setNull","(IILjava/lang/String;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,25,"setObject","(ILjava/lang/Object;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,26,"setObject","(ILjava/lang/Object;I)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,27,"setObject","(ILjava/lang/Object;II)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,28,"setRef","(ILjava/sql/Ref;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,29,"setShort","(IS)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,30,"setString","(ILjava/lang/String;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,31,"setTime","(ILjava/sql/Time;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,32,"setTime","(ILjava/sql/Time;Ljava/util/Calendar;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,33,"setTimestamp","(ILjava/sql/Timestamp;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,34,"setTimestamp","(ILjava/sql/Timestamp;Ljava/util/Calendar;)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,35,"setUnicodeStream","(ILjava/io/InputStream;I)V") J2CPP_DEFINE_METHOD(java::sql::PreparedStatement,36,"setURL","(ILjava/net/URL;)V") } //namespace j2cpp #endif //J2CPP_JAVA_SQL_PREPAREDSTATEMENT_HPP_IMPL #endif //J2CPP_INCLUDE_IMPLEMENTATION
{ "content_hash": "ea4f9653d55e27050e4d1934e4b9487a", "timestamp": "", "source": "github", "line_count": 592, "max_line_length": 146, "avg_line_length": 37.32263513513514, "alnum_prop": 0.7001131477709889, "repo_name": "seem-sky/ph-open", "id": "f02f67f829f39d9946a7302f3cccd731d36aa9eb", "size": "22095", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "proj.android/jni/puzzleHero/platforms/android-8/java/sql/PreparedStatement.hpp", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "2586181" }, { "name": "C++", "bytes": "151891430" }, { "name": "CSS", "bytes": "45889" }, { "name": "Erlang", "bytes": "25427" }, { "name": "Java", "bytes": "320263" }, { "name": "JavaScript", "bytes": "791651" }, { "name": "Lua", "bytes": "10538" }, { "name": "Makefile", "bytes": "26374" }, { "name": "Objective-C", "bytes": "406244" }, { "name": "Objective-C++", "bytes": "359678" }, { "name": "Perl", "bytes": "6421" }, { "name": "Prolog", "bytes": "7299" }, { "name": "Python", "bytes": "5761" }, { "name": "Shell", "bytes": "11405" } ], "symlink_target": "" }
#include <stdlib.h> #ifndef __GST_MISTELIX_SOCKET_H__ #define __GST_MISTELIX_SOCKET_H__ int gst_mistelix_video_src_daemon_init (); int gst_mistelix_video_src_daemon_getfile (unsigned char** buffer, int* length, int* fixed); void gst_mistelix_video_src_daemon_shutdown (); #endif
{ "content_hash": "40c1da2f924a338a9315503c3493b196", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 88, "avg_line_length": 15.944444444444445, "alnum_prop": 0.7177700348432056, "repo_name": "GNOME/mistelix", "id": "61bdf09c4440dfc68b84e48878bad3e5b9285ede", "size": "1103", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gstreamer/mistelixsocket.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "72873" }, { "name": "C#", "bytes": "449432" }, { "name": "Shell", "bytes": "5426" } ], "symlink_target": "" }
class UnorderedList: def __init__(self): self.head = None
{ "content_hash": "57d3336857a21483fcf77cbf9abea28d", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 24, "avg_line_length": 23.333333333333332, "alnum_prop": 0.5857142857142857, "repo_name": "robin1885/algorithms-exercises-using-python", "id": "ea00d157abb4d8dc5c58983fd961293aac01677e", "size": "70", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "source-code-from-author-book/Listings-for-Second-Edition/listing_3_17.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "182896" } ], "symlink_target": "" }
angular.module('vk-api-angular').directive('vkPoll', function () { return { restrict: 'AEC', template: '<div class="vk-widget vk-widget--poll" data-ng-attr-id="{{::id}}"></div>', scope: {}, link: function (scope, element, attrs) { scope.id = attrs.elementId || 'vk-widget-' + scope.$id; VK.Widgets.Poll(scope.id, { width: attrs.width, pageUrl: attrs.pageUrl }, attrs.pollId); } }; });
{ "content_hash": "fe25fc9e46a4579a84c1df12e128e542", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 89, "avg_line_length": 31.642857142857142, "alnum_prop": 0.5711060948081265, "repo_name": "kefir500/vk-api-angular", "id": "bdb8e61be55058506119abb9f4548b286292c4ce", "size": "443", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/widgets/vk-widget-poll.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "36841" } ], "symlink_target": "" }
layout: post date: 2016-04-09 title: "Pronovias YAMEL 2015 Sleeveless Court Train Mermaid/Trumpet" category: Pronovias tags: [Pronovias,Mermaid/Trumpet,Jewel,Court Train,Sleeveless,2015] --- ### Pronovias YAMEL Just **$329.99** ### 2015 Sleeveless Court Train Mermaid/Trumpet <table><tr><td>BRANDS</td><td>Pronovias</td></tr><tr><td>Silhouette</td><td>Mermaid/Trumpet</td></tr><tr><td>Neckline</td><td>Jewel</td></tr><tr><td>Hemline/Train</td><td>Court Train</td></tr><tr><td>Sleeve</td><td>Sleeveless</td></tr><tr><td>Years</td><td>2015</td></tr></table> <a href="https://www.readybrides.com/en/pronovias/4267-pronovias-yamel.html"><img src="//img.readybrides.com/8578/pronovias-yamel.jpg" alt="Pronovias YAMEL" style="width:100%;" /></a> <!-- break --><a href="https://www.readybrides.com/en/pronovias/4267-pronovias-yamel.html"><img src="//img.readybrides.com/8579/pronovias-yamel.jpg" alt="Pronovias YAMEL" style="width:100%;" /></a> <a href="https://www.readybrides.com/en/pronovias/4267-pronovias-yamel.html"><img src="//img.readybrides.com/8577/pronovias-yamel.jpg" alt="Pronovias YAMEL" style="width:100%;" /></a> Buy it: [https://www.readybrides.com/en/pronovias/4267-pronovias-yamel.html](https://www.readybrides.com/en/pronovias/4267-pronovias-yamel.html)
{ "content_hash": "65a5708518a10d464ac4b3ce60231505", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 279, "avg_line_length": 84.66666666666667, "alnum_prop": 0.7236220472440945, "repo_name": "HOLEIN/HOLEIN.github.io", "id": "1e992e8a68c0a6a027c34f5d76da18c813579926", "size": "1274", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/2016-04-09-Pronovias-YAMEL-2015-Sleeveless-Court-Train-MermaidTrumpet.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "83876" }, { "name": "HTML", "bytes": "14547" }, { "name": "Ruby", "bytes": "897" } ], "symlink_target": "" }
'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), errorHandler = require('./errors.server.controller'), Document = mongoose.model('Document'), _ = require('lodash'); /** * Create a Document */ exports.create = function(req, res) { var document = new Document(req.body); document.user = req.user; document.save(function(err) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.jsonp(document); } }); }; /** * Show the current Document */ exports.read = function(req, res) { res.jsonp(req.document); }; /** * Update a Document */ exports.update = function(req, res) { var document = req.document ; document = _.extend(document , req.body); document.save(function(err) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.jsonp(document); } }); }; /** * Delete an Document */ exports.delete = function(req, res) { var document = req.document ; document.remove(function(err) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.jsonp(document); } }); }; /** * List of Documents */ exports.list = function(req, res) { Document.find().sort('-created').populate('user', 'displayName').exec(function(err, documents) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.jsonp(documents); } }); }; /** * Document middleware */ exports.documentByID = function(req, res, next, id) { Document.findById(id).populate('user', 'displayName').exec(function(err, document) { if (err) return next(err); if (! document) return next(new Error('Failed to load Document ' + id)); req.document = document ; next(); }); }; /** * Document authorization middleware */ exports.hasAuthorization = function(req, res, next) { if (req.document.user.id !== req.user.id) { return res.status(403).send('User is not authorized'); } next(); };
{ "content_hash": "1702b3b03944e44aeda3d525af72447a", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 97, "avg_line_length": 19.39252336448598, "alnum_prop": 0.6385542168674698, "repo_name": "rajasekaran247/office", "id": "2b74ec9422c0455299864bacfc2d28248498b9a8", "size": "2075", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/controllers/documents.server.controller.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "640071" }, { "name": "CoffeeScript", "bytes": "18527" }, { "name": "HTML", "bytes": "259076" }, { "name": "JavaScript", "bytes": "447432" }, { "name": "Shell", "bytes": "414" } ], "symlink_target": "" }
=================== KairosDB Statistics =================== KairosDB writes internal metrics to the data store so you can monitor the server's performance. Because the metrics are stored in the data store you can use the UI to view the statistics. These internal metrics are written once per minute by default. You can adjust how often they are reported by modifying the reporter period and report period unit properties in the kairosdb.properties file. :: kairosdb.reporter.period=1 kairosdb.reporter.period_unit=minute The possible values for kairosdb.reporter.period_unit are milliseconds, seconds, minutes, hours, and days. If you change these properties you must restart KairosDB for the changes to take effect. You can turn off metrics reporting by removing the kairosdb.service.reporter property from the property file. ---------------- Metrics Reported ---------------- * *kairosdb.datastore.key_write_size* - The number of rows written to the data store during the last write. * *kairosdb.datastore.write_size* - The number of data points written to the data store during the last write. * *kairosdb.datastore.write_buffer_size* - The size of the write buffer at the time of the last write. * *kairosdb.protocol.http_request_count* - The number of HTTP requests for each method. This includes a method tag that indicates the method that was called. For example, method=query if a query was done. * *kairosdb.protocol.telnet_request_count* - The number of telnet requests for each method. This includes a method tag that indicates the method that called. For example, method=put if the put method was called. * *kairosdb.jvm.free_memory* - The amount of free memory available in the JVM. * *kairosdb.jvm.total_memory* - The amount of total memory in the JVM. * *kairosdb.jvm.max_memory* - The maximum amount of memory the JVM will attempt to use. * *kairosdb.jvm.thread_count* - The total number of threads running in the JVM.
{ "content_hash": "159664804aa925a1ad0e250903b33c67", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 211, "avg_line_length": 60.90625, "alnum_prop": 0.7573114417650076, "repo_name": "KCFTech/kairosdb", "id": "d0d7c890966b11f436258da3c937034e2b19bbec", "size": "1949", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/docs/Statistics.rst", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "829" }, { "name": "CSS", "bytes": "5240" }, { "name": "Groovy", "bytes": "17765" }, { "name": "HTML", "bytes": "20889" }, { "name": "Java", "bytes": "966280" }, { "name": "JavaScript", "bytes": "57338" }, { "name": "Python", "bytes": "7893" }, { "name": "Shell", "bytes": "4946" } ], "symlink_target": "" }
package org.ambraproject.rhino.service.impl; import com.google.common.collect.ImmutableMap; import org.ambraproject.rhino.config.RuntimeConfiguration; import org.ambraproject.rhino.rest.response.ServiceResponse; import org.ambraproject.rhino.service.ConfigurationReadService; import org.ambraproject.rhino.util.GitInfo; import org.springframework.beans.factory.annotation.Autowired; import java.io.IOException; import java.io.InputStream; import java.net.UnknownHostException; import java.net.InetAddress; import java.util.LinkedHashMap; import java.util.Date; import java.util.Map; import java.util.Properties; import javax.annotation.PostConstruct; public class ConfigurationReadServiceImpl extends AmbraService implements ConfigurationReadService { @Autowired private RuntimeConfiguration runtimeConfiguration; @Autowired private GitInfo gitInfo; private String hostname = "unknown"; private final Date startTime = new Date(); @PostConstruct public void init() { try { hostname = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { } } @Override public ServiceResponse<Properties> readBuildConfig() throws IOException { return ServiceResponse.serveView(getBuildProperties()); } private static Map<String, Object> showEndpointAsMap(RuntimeConfiguration.ContentRepoEndpoint endpoint) { if (endpoint == null) return null; Map<String, Object> map = new LinkedHashMap<>(4); map.put("address", endpoint.getAddress()); map.put("bucket", endpoint.getDefaultBucket()); if (endpoint instanceof RuntimeConfiguration.MultiBucketContentRepoEndpoint) { map.put("secondaryBuckets", ((RuntimeConfiguration.MultiBucketContentRepoEndpoint) endpoint).getSecondaryBuckets()); } return map; } @Override public ServiceResponse<Map<String, Object>> readRepoConfig() throws IOException { return ServiceResponse.serveView(getRepoConfig()); } @Override public Map<String, Object> getRepoConfig() { Map<String, Object> cfgMap = new LinkedHashMap<>(4); cfgMap.put("editorial", showEndpointAsMap(runtimeConfiguration.getEditorialStorage())); cfgMap.put("corpus", showEndpointAsMap(runtimeConfiguration.getCorpusStorage())); return cfgMap; } @Override public ServiceResponse<Map<String, String>> readRunInfo() { Map<String, String> cfgMap = ImmutableMap.of("host", hostname, "started", startTime.toString()); return ServiceResponse.serveView(cfgMap); } /** * {@inheritDoc} */ @Override public Properties getBuildProperties() throws IOException { Properties properties = new Properties(); try (InputStream is = getClass().getResourceAsStream("/version.properties")) { properties.load(is); } properties.setProperty("gitCommitIdAbbrev", gitInfo.getCommitIdAbbrev()); return properties; } }
{ "content_hash": "38619a66ea89af5a81f8571fbe939772", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 122, "avg_line_length": 31.571428571428573, "alnum_prop": 0.757396449704142, "repo_name": "PLOS/rhino", "id": "4772db7ba17322a1825f18876ea13a1046403b4d", "size": "4002", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/main/java/org/ambraproject/rhino/service/impl/ConfigurationReadServiceImpl.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "45403" }, { "name": "HTML", "bytes": "11143" }, { "name": "Java", "bytes": "1057486" }, { "name": "JavaScript", "bytes": "315678" }, { "name": "Python", "bytes": "182185" }, { "name": "Shell", "bytes": "4465" }, { "name": "TSQL", "bytes": "1202" } ], "symlink_target": "" }
๏ปฟ// Copyright 2020 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. // [START pubsub_create_topic] using Google.Cloud.PubSub.V1; using Grpc.Core; using System; public class CreateTopicSample { public Topic CreateTopic(string projectId, string topicId) { PublisherServiceApiClient publisher = PublisherServiceApiClient.Create(); var topicName = TopicName.FromProjectTopic(projectId, topicId); Topic topic = null; try { topic = publisher.CreateTopic(topicName); Console.WriteLine($"Topic {topic.Name} created."); } catch (RpcException e) when (e.Status.StatusCode == StatusCode.AlreadyExists) { Console.WriteLine($"Topic {topicName} already exists."); } return topic; } } // [END pubsub_create_topic]
{ "content_hash": "7f9893468cd2691281c17585f1a978ce", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 85, "avg_line_length": 32.97560975609756, "alnum_prop": 0.6863905325443787, "repo_name": "GoogleCloudPlatform/dotnet-docs-samples", "id": "1c8be10ca2d2a77b3da28b144bfa994f346182a0", "size": "1354", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "pubsub/api/Pubsub.Samples/CreateTopic.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP.NET", "bytes": "44935" }, { "name": "Batchfile", "bytes": "2016" }, { "name": "C#", "bytes": "3481210" }, { "name": "CSS", "bytes": "17293" }, { "name": "Dockerfile", "bytes": "16003" }, { "name": "F#", "bytes": "7661" }, { "name": "HTML", "bytes": "148172" }, { "name": "JavaScript", "bytes": "202743" }, { "name": "PowerShell", "bytes": "259637" }, { "name": "Shell", "bytes": "7852" }, { "name": "Visual Basic .NET", "bytes": "2494" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- File: *RCSfile* Version: *Revision* Modified: *Date* (c) Copyright 2005-2014 by Mentor Graphics Corp. 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. 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. ======================================================================== --> <contexts> <!-- context entry to allow f1 topics in eclipse owned contexts--> <context id="new_project_wizard_context"> <topic label="BridgePoint xtUML Project Wizard" href="/org.xtuml.bp.doc/Reference/UserInterface/xtUMLModeling/Wizards/HTML/xtUMLProject.htm"/> </context> <context id="new_wizard_context"> <topic label="BridgePoint xtUML Project Wizard" href="/org.xtuml.bp.doc/Reference/UserInterface/xtUMLModeling/Wizards/HTML/xtUMLProject.htm"/> <topic label="BridgePoint xtUML Model Wizard" href="/org.xtuml.bp.doc/Reference/UserInterface/xtUMLModeling/Wizards/HTML/xtUMLModel.htm"/> </context> <context id="new_wizard_shortcut_context"> <topic label="BridgePoint xtUML Project Wizard" href="/org.xtuml.bp.doc/Reference/UserInterface/xtUMLModeling/Wizards/HTML/xtUMLProject.htm"/> <topic label="BridgePoint xtUML Model Wizard" href="/org.xtuml.bp.doc/Reference/UserInterface/xtUMLModeling/Wizards/HTML/xtUMLModel.htm"/> </context> <context id="new_wizard_selection_wizard_page_context"> <topic label="BridgePoint xtUML Project Wizard" href="/org.xtuml.bp.doc/Reference/UserInterface/xtUMLModeling/Wizards/HTML/xtUMLProject.htm"/> <topic label="BridgePoint xtUML Model Wizard" href="/org.xtuml.bp.doc/Reference/UserInterface/xtUMLModeling/Wizards/HTML/xtUMLModel.htm"/> </context> <context id="task_list_view_context"> <topic label="Problems View (BridgePoint)" href="/org.xtuml.bp.doc/Reference/UserInterface/xtUMLModeling/Views/HTML/Problems.htm"/> </context> <context id="property_sheet_page_help_context"> <topic label="Properties View (BridgePoint)" href="/org.xtuml.bp.doc/Reference/UserInterface/xtUMLModeling/Views/HTML/Properties.htm"/> </context> <!-- context entry for new xtUML project Wizard Page --> <context id="newProjectDialogId" > <description>This wizard helps you create a new xtUML Project.</description> <topic href="/org.xtuml.bp.doc/Reference/UserInterface/xtUMLModeling/Wizards/HTML/xtUMLProject.htm" label="BridgePoint xtUML Project Wizard"/> </context> <!-- context entry for new xtUML model Wizard Page --> <context id="newModelDialogId" > <description>This wizard helps you create a new xtUML Model.</description> <topic href="/org.xtuml.bp.doc/Reference/UserInterface/xtUMLModeling/Wizards/HTML/xtUMLModel.htm" label="BridgePoint xtUML Model Wizard"/> </context> <!-- context entry for BridgePoint preference item --> <context id="corePreferencesId" > <description>Allows you to set BridgePoint preferences.</description> <topic href="/org.xtuml.bp.doc/Reference/UserInterface/xtUMLModeling/Preferences/HTML/Preferences.htm" label="Preferences - BridgePoint"/> </context> </contexts>
{ "content_hash": "cade510aa58063f327b9e94279f97f5c", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 150, "avg_line_length": 55.15151515151515, "alnum_prop": 0.7142857142857143, "repo_name": "kirisma/bridgepoint", "id": "05b88d84feea91d5d3caf3b8edd97930b2a321d1", "size": "3640", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/org.xtuml.bp.core/contexts/contexts.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Arc", "bytes": "1004468" }, { "name": "Batchfile", "bytes": "10414" }, { "name": "C", "bytes": "637233" }, { "name": "C++", "bytes": "478883" }, { "name": "CSS", "bytes": "33213" }, { "name": "Clarion", "bytes": "1130" }, { "name": "GAP", "bytes": "252460" }, { "name": "HTML", "bytes": "2827485" }, { "name": "Java", "bytes": "22046494" }, { "name": "Makefile", "bytes": "1497" }, { "name": "PHP", "bytes": "341486" }, { "name": "Perl", "bytes": "107154" }, { "name": "SQLPL", "bytes": "204473" }, { "name": "Shell", "bytes": "59437" }, { "name": "Visual Basic", "bytes": "2428" }, { "name": "Xtend", "bytes": "720" } ], "symlink_target": "" }
package org.exem.flamingo.shared.util; import ch.qos.logback.ext.spring.web.WebLogbackConfigurer; import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import java.io.InputStream; import java.util.Enumeration; import java.util.Map; import java.util.Properties; import java.util.Set; /** * Application Version์„ ํ‘œ์‹œํ•˜๋Š” Configurer. * * @author Byoung Gon, Kim * @since 0.1 */ public class VersionConfigurer implements javax.servlet.ServletContextListener { /** * SLF4J Logging */ private Logger logger = LoggerFactory.getLogger(VersionConfigurer.class); private static final long MEGA_BYTES = 1024 * 1024; private static final String UNKNOWN = "Unknown"; @Override public void contextInitialized(ServletContextEvent servletContextEvent) { Properties properties = new Properties(); ServletContext context = servletContextEvent.getServletContext(); InputStream inputStream = null; try { inputStream = context.getResourceAsStream("/WEB-INF/app.properties"); properties.load(inputStream); } catch (Exception ex) { throw new IllegalArgumentException("Cannot load a '/WEB/INF/app.properties' file.", ex); } finally { IOUtils.closeQuietly(inputStream); } // See : http://patorjk.com/software/taag/#p=display&f=Slant&t=Flamingo%202 StringBuilder builder = new StringBuilder(); builder.append(" ________ _ ___ \n" + " / ____/ /___ _____ ___ (_)___ ____ _____ |__ \\\n" + " / /_ / / __ `/ __ `__ \\/ / __ \\/ __ `/ __ \\ __/ /\n" + " / __/ / / /_/ / / / / / / / / / / /_/ / /_/ / / __/ \n" + "/_/ /_/\\__,_/_/ /_/ /_/_/_/ /_/\\__, /\\____/ /____/ \n" + " /____/ \n" + " "); printHeader(builder, "Application Information"); Properties appProps = new Properties(); appProps.put("Instance", StringUtils.isEmpty(System.getProperty("instance")) ? "** UNKNOWN **" : System.getProperty("instance")); appProps.put("Version", properties.get("version")); appProps.put("Build Date", properties.get("build.timestamp")); appProps.put("Build Number", properties.get("build.number")); appProps.put("Revision Number", properties.get("revision.number")); appProps.put("Organization", properties.get("organization")); appProps.put("Homepage", properties.get("homepage")); if (context != null) { appProps.put("Application Server", context.getServerInfo() + " - Servlet API " + context.getMajorVersion() + "." + context.getMinorVersion()); } Properties systemProperties = System.getProperties(); appProps.put("Java Version", systemProperties.getProperty("java.version", UNKNOWN) + " - " + systemProperties.getProperty("java.vendor", UNKNOWN)); appProps.put("Current Working Directory", systemProperties.getProperty("user.dir", UNKNOWN)); print(builder, appProps); Properties memPros = new Properties(); final Runtime rt = Runtime.getRuntime(); final long maxMemory = rt.maxMemory() / MEGA_BYTES; final long totalMemory = rt.totalMemory() / MEGA_BYTES; final long freeMemory = rt.freeMemory() / MEGA_BYTES; final long usedMemory = totalMemory - freeMemory; memPros.put("Maximum Allowable Memory", maxMemory + "MB"); memPros.put("Total Memory", totalMemory + "MB"); memPros.put("Free Memory", freeMemory + "MB"); memPros.put("Used Memory", usedMemory + "MB"); print(builder, memPros); printHeader(builder, "Java System Properties"); Properties sysProps = new Properties(); for (final Map.Entry<Object, Object> entry : systemProperties.entrySet()) { sysProps.put(entry.getKey(), entry.getValue()); } print(builder, sysProps); printHeader(builder, "System Environments"); Map<String, String> getenv = System.getenv(); Properties envProps = new Properties(); Set<String> strings = getenv.keySet(); for (String key : strings) { String message = getenv.get(key); envProps.put(key, message); } print(builder, envProps); WebLogbackConfigurer.initLogging(servletContextEvent.getServletContext()); System.out.println(builder.toString()); } private void printHeader(StringBuilder builder, String message) { builder.append(org.slf4j.helpers.MessageFormatter.format("\n== {} =====================\n", message).getMessage()).append("\n"); } private void print(StringBuilder builder, Properties props) { int maxLength = getMaxLength(props); Enumeration<Object> keys = props.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); String value = props.getProperty(key); builder.append(" ").append(key).append(getCharacter(maxLength - key.getBytes().length, " ")).append(" : ").append(value).append("\n"); } } private int getMaxLength(Properties props) { Enumeration<Object> keys = props.keys(); int maxLength = -1; while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); if (maxLength < 0) { maxLength = key.getBytes().length; } else if (maxLength < key.getBytes().length) { maxLength = key.getBytes().length; } } return maxLength; } /** * ์ง€์ •ํ•œ ํฌ๊ธฐ ๋งŒํผ ๋ฌธ์ž์—ด์„ ๊ตฌ์„ฑํ•œ๋‹ค. * * @param size ๋ฌธ์ž์—ด์„ ๊ตฌ์„ฑํ•  ๋ฐ˜๋ณต์ˆ˜ * @param character ๋ฌธ์ž์—ด์„ ๊ตฌ์„ฑํ•˜๊ธฐ ์œ„ํ•œ ๋‹จ์œ„ ๋ฌธ์ž์—ด. ๋ฐ˜๋ณต์ˆ˜๋งŒํผ ์ƒ์„ฑ๋œ๋‹ค. * @return ๋ฌธ์ž์—ด */ private static String getCharacter(int size, String character) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < size; i++) { builder.append(character); } return builder.toString(); } @Override public void contextDestroyed(ServletContextEvent servletContextEvent) { WebLogbackConfigurer.shutdownLogging(servletContextEvent.getServletContext()); } }
{ "content_hash": "a3a5a3c4f66629d96317e2cfe673832b", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 155, "avg_line_length": 39.77914110429448, "alnum_prop": 0.5902220851326342, "repo_name": "EXEM-OSS/flamingo", "id": "53e422ffd2388d698d1b06f31568067fd7332454", "size": "6598", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "flamingo-shared/src/main/java/org/exem/flamingo/shared/util/VersionConfigurer.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ABAP", "bytes": "962" }, { "name": "ActionScript", "bytes": "1133" }, { "name": "Ada", "bytes": "99" }, { "name": "AutoHotkey", "bytes": "720" }, { "name": "Batchfile", "bytes": "260" }, { "name": "C#", "bytes": "83" }, { "name": "C++", "bytes": "761" }, { "name": "COBOL", "bytes": "4" }, { "name": "CSS", "bytes": "195997" }, { "name": "Cirru", "bytes": "520" }, { "name": "Clojure", "bytes": "794" }, { "name": "CoffeeScript", "bytes": "403" }, { "name": "ColdFusion", "bytes": "86" }, { "name": "Common Lisp", "bytes": "632" }, { "name": "D", "bytes": "324" }, { "name": "Dart", "bytes": "489" }, { "name": "Eiffel", "bytes": "375" }, { "name": "Elixir", "bytes": "692" }, { "name": "Elm", "bytes": "487" }, { "name": "Erlang", "bytes": "487" }, { "name": "Forth", "bytes": "979" }, { "name": "FreeMarker", "bytes": "28842" }, { "name": "GLSL", "bytes": "512" }, { "name": "Go", "bytes": "641" }, { "name": "Groovy", "bytes": "1080" }, { "name": "HTML", "bytes": "3457325" }, { "name": "Haskell", "bytes": "512" }, { "name": "Haxe", "bytes": "447" }, { "name": "Io", "bytes": "140" }, { "name": "JSONiq", "bytes": "4" }, { "name": "Java", "bytes": "902117" }, { "name": "JavaScript", "bytes": "38188038" }, { "name": "Julia", "bytes": "210" }, { "name": "LSL", "bytes": "2080" }, { "name": "Liquid", "bytes": "1883" }, { "name": "LiveScript", "bytes": "5747" }, { "name": "Lua", "bytes": "981" }, { "name": "Makefile", "bytes": "4566" }, { "name": "Matlab", "bytes": "203" }, { "name": "Nix", "bytes": "2212" }, { "name": "OCaml", "bytes": "539" }, { "name": "Objective-C", "bytes": "2672" }, { "name": "OpenSCAD", "bytes": "333" }, { "name": "PHP", "bytes": "351" }, { "name": "Pascal", "bytes": "1412" }, { "name": "Perl", "bytes": "678" }, { "name": "PowerShell", "bytes": "418" }, { "name": "Protocol Buffer", "bytes": "274" }, { "name": "Python", "bytes": "478" }, { "name": "R", "bytes": "2445" }, { "name": "Ruby", "bytes": "531" }, { "name": "Rust", "bytes": "495" }, { "name": "Scala", "bytes": "1541" }, { "name": "Scheme", "bytes": "559" }, { "name": "Shell", "bytes": "1154" }, { "name": "Tcl", "bytes": "899" }, { "name": "TeX", "bytes": "1345" }, { "name": "TypeScript", "bytes": "1607" }, { "name": "VHDL", "bytes": "830" }, { "name": "Vala", "bytes": "485" }, { "name": "Verilog", "bytes": "274" }, { "name": "Visual Basic", "bytes": "916" }, { "name": "XQuery", "bytes": "114" } ], "symlink_target": "" }
#ifndef PWENTRYV4_H_ #define PWENTRYV4_H_ #include "db/PwEntry.h" #include "db/v4/DefsV4.h" #include "db/v4/PwMetaV4.h" #include "crypto/CryptoManager.h" #include "util/ProgressObserver.h" #include <QMetaType> #include <QList> #include <bb/cascades/DataModel> #include <bb/cascades/QListDataModel> #include <QtXml/QXmlStreamReader> /** * Field of a V4 database entry */ class PwField: public QObject { Q_OBJECT Q_PROPERTY(QString name READ getName WRITE setName NOTIFY nameChanged) Q_PROPERTY(QString value READ getValue WRITE setValue NOTIFY valueChanged) Q_PROPERTY(bool protected READ isProtected WRITE setProtected NOTIFY protectedChanged) private: QString _name; QString _value; bool _isProtected; public: PwField(QObject* parent=0); PwField(QObject* parent, const QString& name, const QString& value, const bool isProtected); virtual ~PwField(); /** True if field's name corresponds to one of the fixed/standard V4 fields. */ bool isStandardField() const; Q_INVOKABLE static bool isStandardName(const QString& name); void clear(); PwField* clone() const; /** * Sets field's in memory protection flag to that specified in Meta's properties. * Only applies for standard fields, does nothing for the others. */ void updateProtectionFlag(const PwMetaV4& meta); ErrorCodesV4::ErrorCode readFromStream(QXmlStreamReader& xml, Salsa20& salsa20); void writeToStream(QXmlStreamWriter& xml, Salsa20& salsa20) const; /** Returns true if any string contains the query string. */ virtual bool matchesQuery(const QString& query) const; Q_INVOKABLE QString toString() const; // property accessors Q_INVOKABLE QString getName() const { return _name; } Q_INVOKABLE QString getValue() const { return _value; } Q_INVOKABLE bool isProtected() const { return _isProtected; } Q_INVOKABLE void setName(const QString& name); Q_INVOKABLE void setValue(const QString& value); Q_INVOKABLE void setProtected(const bool isProtected); signals: // nameChanged and valueChanged are never emitted void nameChanged(QString name); void valueChanged(QString value); void protectedChanged(bool prot); }; /** * Auto type settings of a V4 entry */ class PwAutoType { private: bool _enabled; quint32 _obfuscationType; QString _defaultSequence; QList<QStringPair> _associations; ErrorCodesV4::ErrorCode readAssociation(QXmlStreamReader& xml); public: PwAutoType(); PwAutoType(const PwAutoType& original); virtual ~PwAutoType(); void clear(); PwAutoType* clone() const; ErrorCodesV4::ErrorCode readFromStream(QXmlStreamReader& xml); void writeToStream(QXmlStreamWriter& xml) const; }; class PwDatabaseV4; /** * Database V4 entry */ class PwEntryV4: public PwEntry { Q_OBJECT Q_PROPERTY(PwUuid customIconUuid READ getCustomIconUuid WRITE setCustomIconUuid NOTIFY customIconUuidChanged) Q_PROPERTY(int extraSize READ getExtraSize NOTIFY extraSizeChanged) Q_PROPERTY(int historySize READ getHistorySize NOTIFY historySizeChanged) private: PwUuid _customIconUuid; PwAutoType _autoType; QList<PwField*> fields; bb::cascades::QListDataModel<PwField*> _extraFieldsDataModel; bb::cascades::QListDataModel<PwEntryV4*> _historyDataModel; quint32 _usageCount; QDateTime _locationChangedTime; QString _foregroundColor; QString _backgroundColor; QString _overrideUrl; QString _tags; // Loads timestamps of an entry ErrorCodesV4::ErrorCode readTimes(QXmlStreamReader& xml); // Loads the history tag of an entry and fills entry's history list ErrorCodesV4::ErrorCode readHistory(QXmlStreamReader& xml, const PwMetaV4& meta, Salsa20& salsa20); // Loads an entry's binary attachment ("Binary" field of an entry). ErrorCodesV4::ErrorCode readAttachment(QXmlStreamReader& xml, const PwMetaV4& meta, Salsa20& salsa20, PwAttachment& attachment); // Writes all entry's attachments to an XML stream. void writeAttachments(QXmlStreamWriter& xml); /** * Adds a named field value to the entry. */ void addField(PwField* field); /** * Updates a named field's value (adding if necessary). */ void setField(const QString& name, const QString& value); /** * Returns field instance by its name (or NULL if none found). */ PwField* getField(const QString& name) const; void addHistoryEntry(PwEntryV4* historyEntry); void clearHistory(); /** Removes old history items, if required by Meta settings */ void maintainHistorySize(); /** Removes historical item with oldest modification date. */ void removeOldestHistoryItem(); public: PwEntryV4(QObject* parent=0); virtual ~PwEntryV4(); virtual void clear(); /** Returns a new entry instance with the same field values */ virtual PwEntry* clone(); /** Search helper. Returns true if any of the fields contain the query string. */ virtual bool matchesQuery(const QString& query) const; /** * Makes a backup copy of the current values/state of the entry. * (For V4 adds the current state to entry's history) * Returns true if successful. */ virtual bool backupState(); /** * Moves the entry to the Recycle Bin group (or to DeletedObjects list if backup is disabled) * Returns true if successful. */ virtual bool moveToBackup(); /** Updates last access timestamp to current time and increases usage counter */ virtual void registerAccessEvent(); /** * Loads the given file and attaches it to the entry. * Makes a backup of the initial entry state. * Returns true if successful, false in case of any error. */ virtual bool attachFile(const QString& filePath); /** Loads entry fields from the stream. */ ErrorCodesV4::ErrorCode readFromStream(QXmlStreamReader& xml, const PwMetaV4& meta, Salsa20& salsa20, ProgressObserver* progressObserver); /** Writes the entry to the stream. */ void writeToStream(QXmlStreamWriter& xml, PwMetaV4& meta, Salsa20& salsa20, ProgressObserver* progressObserver); Q_INVOKABLE bb::cascades::DataModel* getExtraFieldsDataModel(); Q_INVOKABLE bb::cascades::DataModel* getHistoryDataModel(); /** Checks if the entry contains a field with the given name (comparison is case-sensitive). */ Q_INVOKABLE bool containsFieldName(const QString& fieldName) const; /** Deletes extra field with the given name (ignores errors) without making backup */ Q_INVOKABLE void deleteExtraField(const QString& fieldName); /** * Updates the given field with a new name, value and protection flag. * If 'field' is null, creates and adds one. */ Q_INVOKABLE void setExtraField(PwField* field, const QString& name, const QString& value, bool protect); // overriden property accessors virtual QString getTitle() const; virtual void setTitle(const QString& title); virtual QString getUserName() const; virtual void setUserName(const QString& userName); virtual QString getPassword() const; virtual void setPassword(const QString& password); virtual QString getUrl() const; virtual void setUrl(const QString& url); virtual QString getNotes() const; virtual void setNotes(const QString& notes); // own property accessors PwUuid getCustomIconUuid() const { return _customIconUuid; } void setCustomIconUuid(const PwUuid& uuid); int getHistorySize() { return _historyDataModel.size(); } int getExtraSize() { return _extraFieldsDataModel.size(); } quint32 getUsageCount() const { return _usageCount; } void setUsageCount(const quint32 usageCount); QDateTime getLocationChangedTime() const { return _locationChangedTime; } void setLocationChangedTime(const QDateTime& locationChangedTime); QString getForegroundColor() const { return _foregroundColor; } void setForegroundColor(const QString& fgColor); QString getBackgroundColor() const { return _backgroundColor; } void setBackgroundColor(const QString& bgColor); QString getOverrideUrl() const { return _overrideUrl; } void setOverrideUrl(const QString& url); QString getTags() const { return _tags; } void setTags(const QString& tags); signals: void customIconUuidChanged(PwUuid); void historySizeChanged(int); void extraSizeChanged(int); void usageCountChanged(quint32); void locationChangedTimeChanged(QDateTime); void foregroundColorChanged(QString); void backgroundColorChanged(QString); void overrideUrlChanged(QString); void tagsChanged(QString); }; Q_DECLARE_METATYPE(PwField*); Q_DECLARE_METATYPE(PwEntryV4*); #endif /* PWENTRYV4_H_ */
{ "content_hash": "304e453edbab9be8aad95b0e1d1efe06", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 142, "avg_line_length": 35.77642276422764, "alnum_prop": 0.7196909442108851, "repo_name": "anmipo/keepassb", "id": "8549d454347c3e01b3561fb42959df502d7d7a73", "size": "8905", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/db/v4/PwEntryV4.h", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "563941" }, { "name": "JavaScript", "bytes": "5613" }, { "name": "Makefile", "bytes": "441" }, { "name": "QML", "bytes": "189352" }, { "name": "QMake", "bytes": "25946" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_51) on Tue Aug 27 20:57:12 WEST 2013 --> <TITLE> Uses of Class net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager.MACRange </TITLE> <META NAME="date" CONTENT="2013-08-27"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager.MACRange"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../net/floodlightcontroller/linkdiscovery/internal/LinkDiscoveryManager.MACRange.html" title="class in net.floodlightcontroller.linkdiscovery.internal"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?net/floodlightcontroller/linkdiscovery/internal//class-useLinkDiscoveryManager.MACRange.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="LinkDiscoveryManager.MACRange.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager.MACRange</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../net/floodlightcontroller/linkdiscovery/internal/LinkDiscoveryManager.MACRange.html" title="class in net.floodlightcontroller.linkdiscovery.internal">LinkDiscoveryManager.MACRange</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#net.floodlightcontroller.linkdiscovery.internal"><B>net.floodlightcontroller.linkdiscovery.internal</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="net.floodlightcontroller.linkdiscovery.internal"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../net/floodlightcontroller/linkdiscovery/internal/LinkDiscoveryManager.MACRange.html" title="class in net.floodlightcontroller.linkdiscovery.internal">LinkDiscoveryManager.MACRange</A> in <A HREF="../../../../../net/floodlightcontroller/linkdiscovery/internal/package-summary.html">net.floodlightcontroller.linkdiscovery.internal</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Fields in <A HREF="../../../../../net/floodlightcontroller/linkdiscovery/internal/package-summary.html">net.floodlightcontroller.linkdiscovery.internal</A> with type parameters of type <A HREF="../../../../../net/floodlightcontroller/linkdiscovery/internal/LinkDiscoveryManager.MACRange.html" title="class in net.floodlightcontroller.linkdiscovery.internal">LinkDiscoveryManager.MACRange</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;java.util.Set&lt;<A HREF="../../../../../net/floodlightcontroller/linkdiscovery/internal/LinkDiscoveryManager.MACRange.html" title="class in net.floodlightcontroller.linkdiscovery.internal">LinkDiscoveryManager.MACRange</A>&gt;</CODE></FONT></TD> <TD><CODE><B>LinkDiscoveryManager.</B><B><A HREF="../../../../../net/floodlightcontroller/linkdiscovery/internal/LinkDiscoveryManager.html#ignoreMACSet">ignoreMACSet</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../net/floodlightcontroller/linkdiscovery/internal/LinkDiscoveryManager.MACRange.html" title="class in net.floodlightcontroller.linkdiscovery.internal"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?net/floodlightcontroller/linkdiscovery/internal//class-useLinkDiscoveryManager.MACRange.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="LinkDiscoveryManager.MACRange.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
{ "content_hash": "15c6a481fc3a0d9f1d0b28e5ebe79a11", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 432, "avg_line_length": 48.43888888888889, "alnum_prop": 0.6616584470696181, "repo_name": "fbotelho-university-code/poseidon", "id": "bdb00594d25082b6028accc9504bbe3225767ffc", "size": "8719", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/net/floodlightcontroller/linkdiscovery/internal/class-use/LinkDiscoveryManager.MACRange.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "187413" }, { "name": "Java", "bytes": "3322889" }, { "name": "JavaScript", "bytes": "96959" }, { "name": "Python", "bytes": "42427" }, { "name": "Shell", "bytes": "2816" } ], "symlink_target": "" }
from __future__ import absolute_import import exceptions import os import re import traceback import unittest from util import * _debug_mode = False class DebuggerTestCase(unittest.TestCase): def __init__(self,progname): self._progname = progname def setUp(self): self._debugger = Debugger() self._proc = self._debugger.launch_suspended(self._progname) @property def debugger(self): return self._debugger @property def process(self): return self._progname def test_is_selected(in_testnames, testname): # toks = test_name.split(".") for tn in in_testnames: if re.search(tn, testname): return True return False ########################################################################### class NdbVerboseTestResult(unittest.TestResult): def addError(self,test,err): traceback.print_tb(err[2]) unittest.TestResult.addError(self,test,err) print err[1] if _debug_mode: print "*** Halting test due to error. ***" os._exit(0) # do this so we truly exit... even if we have a lingering thread [eew] def addFailure(self,test,err): traceback.print_tb(err[2]) unittest.TestResult.addFailure(self,test,err) print err[1] if _debug_mode: print "*** Halting test due to error. ***" os._exit(0) # do this so we truly exit... even if we have a lingering thread [eew] def set_debug_mode(halt): if not isinstance(halt, bool): raise TypeError("Expected bool") global _debug_mode _debug_mode = halt ########################################################################### def do_run(testnames = None): """ Run a test given a list of test regexps to run, or all tests. """ immediate = _debug_mode MessageLoop.set_in_test_mode(True) dirs = ["tests", "tests/util", "tests/debugger", "tests/progdb"] try: import ui dirs.append("tests/ui") except: pass v = 2 r = unittest.TextTestRunner(verbosity=v) l = unittest.TestLoader() for dir in dirs: dirname = os.path.join(".", dir) files = os.listdir(dirname) pyfiles = [d for d in files if os.path.splitext(d)[1] == ".py"] if "__init__.py" in pyfiles: pyfiles.remove("__init__.py") suite = unittest.TestSuite() for pyfile in pyfiles: if pyfile.startswith("."): continue # dotfiles modbase = dir.replace("/",".") modname = os.path.splitext(pyfile)[0] pymodule = "%s.%s" % (modbase, modname) try: module = __import__(pymodule,fromlist=[True]) except: print "While importing [%s]\n" % pymodule traceback.print_exc() continue try: if hasattr(module,"load_tests"): s = module.load_tests() else: s = unittest.TestLoader().loadTestsFromModule(module) except Exception, ex: raise Exception("Error loading test cases from %s: %s"% (pymodule, str(ex))) for t in s: if isinstance(t, unittest.TestSuite): for i in t: if testnames != None: if test_is_selected(testnames,i.id()): suite.addTest(i) else: suite.addTest(i) elif isinstance(t, unittest.TestCase): if testnames != None: if test_is_selected(testnames,t.id()): suite.addTest(t) else: suite.addTest(t) else: raise Exception("Wtf, expected TestSuite or TestCase, got %s" % t) if suite.countTestCases(): if immediate == False: log0_raw("Test for %s", dir) log0_raw("----------------------------------------------------------------------") r.run(suite) log0_raw("\n") log0_raw("\n") else: for case in suite: tr = NdbVerboseTestResult() log0_raw("----------------------------------------------------------------------") log0_raw("%s", case.id()) case.run(result=tr) if tr.wasSuccessful(): log0("OK\n") elif len(tr.errors): log0("Error\n") else: log0("Fail\n") log2("TestSystem: done with module %s", dir) log2("TestSystem: done with all ymodules") def run(testnames = None): try: do_run(testnames) finally: MessageLoop.quit(True) MessageLoop.set_in_test_mode(False) # Stray code to load tests from a list of classes: def _load_tests_from_class(cls): in_suite = unittest.TestLoader().loadTestsFromTestCase(case) assert(isinstance(suite,unittest.TestSuite)) for test in in_suite: tests.addTest(test) def _append_suite_to_suite(dst_suite,src_suite): for test in src_suite: dst_suite.append(test)
{ "content_hash": "efb835548f630ab88735d14dad31732a", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 92, "avg_line_length": 29.19375, "alnum_prop": 0.5690430314707772, "repo_name": "natduca/ndbg", "id": "8dd586073d9243b9ed5796c88d4a5e5e66a9082e", "size": "5247", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/__init__.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "4728" }, { "name": "C++", "bytes": "5787" }, { "name": "Emacs Lisp", "bytes": "5014" }, { "name": "JavaScript", "bytes": "237" }, { "name": "Python", "bytes": "554374" }, { "name": "Shell", "bytes": "781" }, { "name": "VimL", "bytes": "1848" } ], "symlink_target": "" }
#region Using directives using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using Axiom.Animating; using Axiom.Core; using Axiom.Graphics; using Axiom.MathLib; using Axiom.Utility; using Axiom.Input; using Axiom.Configuration; #endregion namespace Multiverse.Base { public class MeshUtility { public static void GetSubmeshVertexData(out Vector3[] points, VertexData vertexData) { // if (subMesh.operationType != RenderMode.TriangleList) // continue; points = null; for (ushort bindIdx = 0; bindIdx < vertexData.vertexDeclaration.ElementCount; ++bindIdx) { VertexElement element = vertexData.vertexDeclaration.GetElement(bindIdx); HardwareVertexBuffer vBuffer = vertexData.vertexBufferBinding.GetBuffer(bindIdx); if (element.Semantic != VertexElementSemantic.Position) continue; points = new Vector3[vertexData.vertexCount]; ReadBuffer(vBuffer, vertexData.vertexCount, element.Size, ref points); return; } Debug.Assert(points != null, "Unable to retrieve position vertex data"); } public static void GetSubmeshIndexData(out int[,] indices, IndexData indexData) { HardwareIndexBuffer idxBuffer = indexData.indexBuffer; IndexType indexType = IndexType.Size16; if ((idxBuffer.Size / indexData.indexCount) != 2) { Debug.Assert(false, "Unexpected index buffer size"); indexType = IndexType.Size32; } Debug.Assert(indexData.indexCount % 3 == 0); indices = new int[indexData.indexCount / 3, 3]; ReadBuffer(idxBuffer, indexData.indexCount, indexType, ref indices); } private static void ReadBuffer(HardwareVertexBuffer vBuffer, int vertexCount, int vertexSize, ref Vector3[] data) { IntPtr bufData = vBuffer.Lock(BufferLocking.ReadOnly); unsafe { float* pFloats = (float*)bufData.ToPointer(); for (int i = 0; i < vertexCount; ++i) for (int j = 0; j < 3; ++j) { Debug.Assert(sizeof(float) * (i * 3 + j) < vertexCount * vertexSize, "Read off end of vertex buffer"); data[i][j] = pFloats[i * 3 + j]; } } // unlock the buffer vBuffer.Unlock(); } private static void ReadBuffer(HardwareIndexBuffer idxBuffer, int maxIndex, IndexType indexType, ref int[,] data) { IntPtr indices = idxBuffer.Lock(BufferLocking.ReadOnly); int faceCount = data.GetLength(0); if (indexType == IndexType.Size32) { // read the ints from the buffer data unsafe { int* pInts = (int*)indices.ToPointer(); for (int i = 0; i < faceCount; ++i) for (int j = 0; j < 3; ++j) { Debug.Assert(i * 3 + j < maxIndex, "Read off end of index buffer"); data[i, j] = pInts[i * 3 + j]; } } } else { // read the shorts from the buffer data unsafe { short* pShorts = (short*)indices.ToPointer(); for (int i = 0; i < faceCount; ++i) for (int j = 0; j < 3; ++j) { Debug.Assert(i * 3 + j < maxIndex, "Read off end of index buffer"); data[i, j] = pShorts[i * 3 + j]; } } } // unlock the buffer idxBuffer.Unlock(); } } }
{ "content_hash": "35965faf7eb5aa8e1f3520a72f9e3946", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 98, "avg_line_length": 29.759615384615383, "alnum_prop": 0.6646203554119547, "repo_name": "longde123/MultiversePlatform", "id": "8b2f3737c9dbf01e2fef9a8d75052b18aa672a99", "size": "4386", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/Base/MeshUtility.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Awk", "bytes": "1148" }, { "name": "Batchfile", "bytes": "56002" }, { "name": "C", "bytes": "2958956" }, { "name": "C#", "bytes": "11292123" }, { "name": "C++", "bytes": "428039" }, { "name": "CSS", "bytes": "107446" }, { "name": "Groff", "bytes": "3653" }, { "name": "HTML", "bytes": "767415" }, { "name": "Inno Setup", "bytes": "2093" }, { "name": "Java", "bytes": "4444010" }, { "name": "JavaScript", "bytes": "115349" }, { "name": "Makefile", "bytes": "35639" }, { "name": "Matlab", "bytes": "2076" }, { "name": "Objective-C", "bytes": "44581" }, { "name": "Perl", "bytes": "6299" }, { "name": "Python", "bytes": "4648545" }, { "name": "Scheme", "bytes": "48864" }, { "name": "Shell", "bytes": "880494" }, { "name": "XSLT", "bytes": "1834" } ], "symlink_target": "" }