text
stringlengths
2
100k
meta
dict
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2012 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // +build purego appengine js // This file contains an implementation of proto field accesses using package reflect. // It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can // be used on App Engine. package proto import ( "reflect" "sync" ) const unsafeAllowed = false // A field identifies a field in a struct, accessible from a pointer. // In this implementation, a field is identified by the sequence of field indices // passed to reflect's FieldByIndex. type field []int // toField returns a field equivalent to the given reflect field. func toField(f *reflect.StructField) field { return f.Index } // invalidField is an invalid field identifier. var invalidField = field(nil) // zeroField is a noop when calling pointer.offset. var zeroField = field([]int{}) // IsValid reports whether the field identifier is valid. func (f field) IsValid() bool { return f != nil } // The pointer type is for the table-driven decoder. // The implementation here uses a reflect.Value of pointer type to // create a generic pointer. In pointer_unsafe.go we use unsafe // instead of reflect to implement the same (but faster) interface. type pointer struct { v reflect.Value } // toPointer converts an interface of pointer type to a pointer // that points to the same target. func toPointer(i *Message) pointer { return pointer{v: reflect.ValueOf(*i)} } // toAddrPointer converts an interface to a pointer that points to // the interface data. func toAddrPointer(i *interface{}, isptr bool) pointer { v := reflect.ValueOf(*i) u := reflect.New(v.Type()) u.Elem().Set(v) return pointer{v: u} } // valToPointer converts v to a pointer. v must be of pointer type. func valToPointer(v reflect.Value) pointer { return pointer{v: v} } // offset converts from a pointer to a structure to a pointer to // one of its fields. func (p pointer) offset(f field) pointer { return pointer{v: p.v.Elem().FieldByIndex(f).Addr()} } func (p pointer) isNil() bool { return p.v.IsNil() } // grow updates the slice s in place to make it one element longer. // s must be addressable. // Returns the (addressable) new element. func grow(s reflect.Value) reflect.Value { n, m := s.Len(), s.Cap() if n < m { s.SetLen(n + 1) } else { s.Set(reflect.Append(s, reflect.Zero(s.Type().Elem()))) } return s.Index(n) } func (p pointer) toInt64() *int64 { return p.v.Interface().(*int64) } func (p pointer) toInt64Ptr() **int64 { return p.v.Interface().(**int64) } func (p pointer) toInt64Slice() *[]int64 { return p.v.Interface().(*[]int64) } var int32ptr = reflect.TypeOf((*int32)(nil)) func (p pointer) toInt32() *int32 { return p.v.Convert(int32ptr).Interface().(*int32) } // The toInt32Ptr/Slice methods don't work because of enums. // Instead, we must use set/get methods for the int32ptr/slice case. /* func (p pointer) toInt32Ptr() **int32 { return p.v.Interface().(**int32) } func (p pointer) toInt32Slice() *[]int32 { return p.v.Interface().(*[]int32) } */ func (p pointer) getInt32Ptr() *int32 { if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) { // raw int32 type return p.v.Elem().Interface().(*int32) } // an enum return p.v.Elem().Convert(int32PtrType).Interface().(*int32) } func (p pointer) setInt32Ptr(v int32) { // Allocate value in a *int32. Possibly convert that to a *enum. // Then assign it to a **int32 or **enum. // Note: we can convert *int32 to *enum, but we can't convert // **int32 to **enum! p.v.Elem().Set(reflect.ValueOf(&v).Convert(p.v.Type().Elem())) } // getInt32Slice copies []int32 from p as a new slice. // This behavior differs from the implementation in pointer_unsafe.go. func (p pointer) getInt32Slice() []int32 { if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) { // raw int32 type return p.v.Elem().Interface().([]int32) } // an enum // Allocate a []int32, then assign []enum's values into it. // Note: we can't convert []enum to []int32. slice := p.v.Elem() s := make([]int32, slice.Len()) for i := 0; i < slice.Len(); i++ { s[i] = int32(slice.Index(i).Int()) } return s } // setInt32Slice copies []int32 into p as a new slice. // This behavior differs from the implementation in pointer_unsafe.go. func (p pointer) setInt32Slice(v []int32) { if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) { // raw int32 type p.v.Elem().Set(reflect.ValueOf(v)) return } // an enum // Allocate a []enum, then assign []int32's values into it. // Note: we can't convert []enum to []int32. slice := reflect.MakeSlice(p.v.Type().Elem(), len(v), cap(v)) for i, x := range v { slice.Index(i).SetInt(int64(x)) } p.v.Elem().Set(slice) } func (p pointer) appendInt32Slice(v int32) { grow(p.v.Elem()).SetInt(int64(v)) } func (p pointer) toUint64() *uint64 { return p.v.Interface().(*uint64) } func (p pointer) toUint64Ptr() **uint64 { return p.v.Interface().(**uint64) } func (p pointer) toUint64Slice() *[]uint64 { return p.v.Interface().(*[]uint64) } func (p pointer) toUint32() *uint32 { return p.v.Interface().(*uint32) } func (p pointer) toUint32Ptr() **uint32 { return p.v.Interface().(**uint32) } func (p pointer) toUint32Slice() *[]uint32 { return p.v.Interface().(*[]uint32) } func (p pointer) toBool() *bool { return p.v.Interface().(*bool) } func (p pointer) toBoolPtr() **bool { return p.v.Interface().(**bool) } func (p pointer) toBoolSlice() *[]bool { return p.v.Interface().(*[]bool) } func (p pointer) toFloat64() *float64 { return p.v.Interface().(*float64) } func (p pointer) toFloat64Ptr() **float64 { return p.v.Interface().(**float64) } func (p pointer) toFloat64Slice() *[]float64 { return p.v.Interface().(*[]float64) } func (p pointer) toFloat32() *float32 { return p.v.Interface().(*float32) } func (p pointer) toFloat32Ptr() **float32 { return p.v.Interface().(**float32) } func (p pointer) toFloat32Slice() *[]float32 { return p.v.Interface().(*[]float32) } func (p pointer) toString() *string { return p.v.Interface().(*string) } func (p pointer) toStringPtr() **string { return p.v.Interface().(**string) } func (p pointer) toStringSlice() *[]string { return p.v.Interface().(*[]string) } func (p pointer) toBytes() *[]byte { return p.v.Interface().(*[]byte) } func (p pointer) toBytesSlice() *[][]byte { return p.v.Interface().(*[][]byte) } func (p pointer) toExtensions() *XXX_InternalExtensions { return p.v.Interface().(*XXX_InternalExtensions) } func (p pointer) toOldExtensions() *map[int32]Extension { return p.v.Interface().(*map[int32]Extension) } func (p pointer) getPointer() pointer { return pointer{v: p.v.Elem()} } func (p pointer) setPointer(q pointer) { p.v.Elem().Set(q.v) } func (p pointer) appendPointer(q pointer) { grow(p.v.Elem()).Set(q.v) } // getPointerSlice copies []*T from p as a new []pointer. // This behavior differs from the implementation in pointer_unsafe.go. func (p pointer) getPointerSlice() []pointer { if p.v.IsNil() { return nil } n := p.v.Elem().Len() s := make([]pointer, n) for i := 0; i < n; i++ { s[i] = pointer{v: p.v.Elem().Index(i)} } return s } // setPointerSlice copies []pointer into p as a new []*T. // This behavior differs from the implementation in pointer_unsafe.go. func (p pointer) setPointerSlice(v []pointer) { if v == nil { p.v.Elem().Set(reflect.New(p.v.Elem().Type()).Elem()) return } s := reflect.MakeSlice(p.v.Elem().Type(), 0, len(v)) for _, p := range v { s = reflect.Append(s, p.v) } p.v.Elem().Set(s) } // getInterfacePointer returns a pointer that points to the // interface data of the interface pointed by p. func (p pointer) getInterfacePointer() pointer { if p.v.Elem().IsNil() { return pointer{v: p.v.Elem()} } return pointer{v: p.v.Elem().Elem().Elem().Field(0).Addr()} // *interface -> interface -> *struct -> struct } func (p pointer) asPointerTo(t reflect.Type) reflect.Value { // TODO: check that p.v.Type().Elem() == t? return p.v } func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo { atomicLock.Lock() defer atomicLock.Unlock() return *p } func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) { atomicLock.Lock() defer atomicLock.Unlock() *p = v } func atomicLoadMarshalInfo(p **marshalInfo) *marshalInfo { atomicLock.Lock() defer atomicLock.Unlock() return *p } func atomicStoreMarshalInfo(p **marshalInfo, v *marshalInfo) { atomicLock.Lock() defer atomicLock.Unlock() *p = v } func atomicLoadMergeInfo(p **mergeInfo) *mergeInfo { atomicLock.Lock() defer atomicLock.Unlock() return *p } func atomicStoreMergeInfo(p **mergeInfo, v *mergeInfo) { atomicLock.Lock() defer atomicLock.Unlock() *p = v } func atomicLoadDiscardInfo(p **discardInfo) *discardInfo { atomicLock.Lock() defer atomicLock.Unlock() return *p } func atomicStoreDiscardInfo(p **discardInfo, v *discardInfo) { atomicLock.Lock() defer atomicLock.Unlock() *p = v } var atomicLock sync.Mutex
{ "pile_set_name": "Github" }
{ "name": "clone", "description": "deep cloning of objects and arrays", "tags": [ "clone", "object", "array", "function", "date" ], "version": "1.0.2", "repository": { "type": "git", "url": "git://github.com/pvorb/node-clone.git" }, "bugs": { "url": "https://github.com/pvorb/node-clone/issues" }, "main": "clone.js", "author": { "name": "Paul Vorbach", "email": "[email protected]", "url": "http://paul.vorba.ch/" }, "contributors": [ { "name": "Blake Miner", "email": "[email protected]", "url": "http://www.blakeminer.com/" }, { "name": "Tian You", "email": "[email protected]", "url": "http://blog.axqd.net/" }, { "name": "George Stagas", "email": "[email protected]", "url": "http://stagas.com/" }, { "name": "Tobiasz Cudnik", "email": "[email protected]", "url": "https://github.com/TobiaszCudnik" }, { "name": "Pavel Lang", "email": "[email protected]", "url": "https://github.com/langpavel" }, { "name": "Dan MacTough", "url": "http://yabfog.com/" }, { "name": "w1nk", "url": "https://github.com/w1nk" }, { "name": "Hugh Kennedy", "url": "http://twitter.com/hughskennedy" }, { "name": "Dustin Diaz", "url": "http://dustindiaz.com" }, { "name": "Ilya Shaisultanov", "url": "https://github.com/diversario" }, { "name": "Nathan MacInnes", "email": "[email protected]", "url": "http://macinn.es/" }, { "name": "Benjamin E. Coe", "email": "[email protected]", "url": "https://twitter.com/benjamincoe" }, { "name": "Nathan Zadoks", "url": "https://github.com/nathan7" }, { "name": "Róbert Oroszi", "email": "[email protected]", "url": "https://github.com/oroce" }, { "name": "Aurélio A. Heckert", "url": "http://softwarelivre.org/aurium" }, { "name": "Guy Ellis", "url": "http://www.guyellisrocks.com/" } ], "license": "MIT", "engines": { "node": ">=0.8" }, "dependencies": {}, "devDependencies": { "nodeunit": "~0.9.0" }, "optionalDependencies": {}, "scripts": { "test": "nodeunit test.js" }, "readme": "# clone\n\n[![build status](https://secure.travis-ci.org/pvorb/node-clone.png)](http://travis-ci.org/pvorb/node-clone)\n\n[![info badge](https://nodei.co/npm/clone.png?downloads=true&downloadRank=true&stars=true)](http://npm-stat.com/charts.html?package=clone)\n\noffers foolproof _deep cloning_ of objects, arrays, numbers, strings etc. in JavaScript.\n\n\n## Installation\n\n npm install clone\n\n(It also works with browserify, ender or standalone.)\n\n\n## Example\n\n~~~ javascript\nvar clone = require('clone');\n\nvar a, b;\n\na = { foo: { bar: 'baz' } }; // initial value of a\n\nb = clone(a); // clone a -> b\na.foo.bar = 'foo'; // change a\n\nconsole.log(a); // show a\nconsole.log(b); // show b\n~~~\n\nThis will print:\n\n~~~ javascript\n{ foo: { bar: 'foo' } }\n{ foo: { bar: 'baz' } }\n~~~\n\n**clone** masters cloning simple objects (even with custom prototype), arrays,\nDate objects, and RegExp objects. Everything is cloned recursively, so that you\ncan clone dates in arrays in objects, for example.\n\n\n## API\n\n`clone(val, circular, depth)`\n\n * `val` -- the value that you want to clone, any type allowed\n * `circular` -- boolean\n\n Call `clone` with `circular` set to `false` if you are certain that `obj`\n contains no circular references. This will give better performance if needed.\n There is no error if `undefined` or `null` is passed as `obj`.\n * `depth` -- depth to which the object is to be cloned (optional,\n defaults to infinity)\n\n`clone.clonePrototype(obj)`\n\n * `obj` -- the object that you want to clone\n\nDoes a prototype clone as\n[described by Oran Looney](http://oranlooney.com/functional-javascript/).\n\n\n## Circular References\n\n~~~ javascript\nvar a, b;\n\na = { hello: 'world' };\n\na.myself = a;\nb = clone(a);\n\nconsole.log(b);\n~~~\n\nThis will print:\n\n~~~ javascript\n{ hello: \"world\", myself: [Circular] }\n~~~\n\nSo, `b.myself` points to `b`, not `a`. Neat!\n\n\n## Test\n\n npm test\n\n\n## Caveat\n\nSome special objects like a socket or `process.stdout`/`stderr` are known to not\nbe cloneable. If you find other objects that cannot be cloned, please [open an\nissue](https://github.com/pvorb/node-clone/issues/new).\n\n\n## Bugs and Issues\n\nIf you encounter any bugs or issues, feel free to [open an issue at\ngithub](https://github.com/pvorb/node-clone/issues) or send me an email to\n<[email protected]>. I also always like to hear from you, if you’re using my code.\n\n## License\n\nCopyright © 2011-2015 [Paul Vorbach](http://paul.vorba.ch/) and\n[contributors](https://github.com/pvorb/node-clone/graphs/contributors).\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the “Software”), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", "readmeFilename": "README.md", "homepage": "https://github.com/pvorb/node-clone#readme", "_id": "[email protected]", "_shasum": "260b7a99ebb1edfe247538175f783243cb19d149", "_resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", "_from": "clone@>=1.0.0 <2.0.0" }
{ "pile_set_name": "Github" }
{ "acno": "D18808", "acquisitionYear": 1856, "additionalImages": [ { "copyright": null, "creativeCommons": null, "filenameBase": "D18808", "sizes": [ { "caption": "Enhanced image", "cleared": true, "file": "enhanced_images/D188/D18808_E.jpg", "height": 337, "resolution": 512, "size": "large", "width": 512 } ] } ], "all_artists": "Joseph Mallord William Turner", "catalogueGroup": { "accessionRanges": "D18706-D18840; D40974; D40984-D40985", "completeStatus": "COMPLETE", "finbergNumber": "CCXIII", "groupType": "Turner Sketchbook", "id": 65850, "shortTitle": "Mortlake and Pulborough Sketchbook" }, "classification": "on paper, unique", "contributorCount": 1, "contributors": [ { "birthYear": 1775, "date": "1775\u20131851", "displayOrder": 1, "fc": "Joseph Mallord William Turner", "gender": "Male", "id": 558, "mda": "Turner, Joseph Mallord William", "role": "artist", "startLetter": "T" } ], "creditLine": "Accepted by the nation as part of the Turner Bequest 1856", "dateRange": { "endYear": 1825, "startYear": 1825, "text": "c.1825" }, "dateText": "c.1825", "depth": "", "dimensions": "support: 113 x 187 mm", "finberg": "CCXIII 73 a", "foreignTitle": null, "groupTitle": "Mortlake and Pulborough Sketchbook", "height": "187", "id": 46161, "inscription": null, "medium": "Watercolour on paper", "movementCount": 0, "pageNumber": 148, "subjectCount": 3, "subjects": { "children": [ { "children": [ { "children": [ { "id": 2063, "name": "artist's notes" } ], "id": 166, "name": "inscriptions" } ], "id": 162, "name": "symbols & personifications" }, { "children": [ { "children": [ { "id": 678, "name": "boat - non-specific" } ], "id": 161, "name": "transport: water" } ], "id": 145, "name": "society" }, { "children": [ { "children": [ { "id": 451, "name": "figure" } ], "id": 95, "name": "adults" } ], "id": 91, "name": "people" } ], "id": 1, "name": "subject" }, "thumbnailCopyright": null, "thumbnailUrl": "http://www.tate.org.uk/art/images/work/D/D18/D18808_8.jpg", "title": "Sketches of ?Boats and ?Figures", "units": "mm", "url": "http://www.tate.org.uk/art/artworks/turner-sketches-of-boats-and-figures-d18808", "width": "113" }
{ "pile_set_name": "Github" }
/// <autosync enabled="true" /> /// <reference path="modernizr-2.8.3.js" /> /// <reference path="jquery-2.1.1.js" /> /// <reference path="bootstrap.js" /> /// <reference path="respond.js" />
{ "pile_set_name": "Github" }
config: path: github.com/uber/zanzibar/codegen schema: ./middlewares/transform-request/transform_request_schema.json dependencies: {} name: transform_request type: default
{ "pile_set_name": "Github" }
#pragma once #include "Scenes/Platformer/Inventory/Items/Crafting/Crafting.h" class LocalizedString; class Bone : public Crafting { public: static Bone* create(); Item* clone() override; std::string getItemName() override; LocalizedString* getString() override; std::string getIconResource() override; std::string getSerializationKey() override; static const std::string SaveKey; protected: Bone(); virtual ~Bone(); private: typedef Crafting super; };
{ "pile_set_name": "Github" }
--- title: "Command - devspace use context" sidebar_label: devspace use context --- Tells DevSpace which kube context to use ## Synopsis ``` devspace use context [flags] ``` ``` ####################################################### ############### devspace use context ################## ####################################################### Switch the current kube context Example: devspace use context my-context ####################################################### ``` ## Flags ``` -h, --help help for context ``` ## Global & Inherited Flags ``` --config string The devspace config file to use --debug Prints the stack trace if an error occurs --kube-context string The kubernetes context to use -n, --namespace string The kubernetes namespace to use --no-warn If true does not show any warning when deploying into a different namespace or kube-context than before -p, --profile string The devspace profile to use (if there is any) --silent Run in silent mode and prevents any devspace log output except panics & fatals -s, --switch-context Switches and uses the last kube context and namespace that was used to deploy the DevSpace project --var strings Variables to override during execution (e.g. --var=MYVAR=MYVALUE) ```
{ "pile_set_name": "Github" }
@echo off setlocal rem ------------------------------------------------------------------------------------------ rem setupVsoRemoteRepo [vsoRemote] [vsoUserName] [vsoPersonalAccessToken] [projName{optional}] rem create and populate VSO git repo for the ABS code instance rem rem vsoRmote: url of the VSO site (e.g. https://awesomebot.visualstudio.com ) rem vosUserName: user account name of the personal access token rem vsoPersonalAccessToken: the personal access token used to access VSO REST api rem projName the name of the project to create (default to WEBSITE_SITE_NAME) rem ------------------------------------------------------------------------------------------ set remoteUrl=%1 set remoteUser=%2 set remotePwd=%3 set projName=%4 if '%projName%'=='' set projName=%WEBSITE_SITE_NAME% set vstsRoot=%remoteUrl% set repoUrl=https://%remoteUser%:%remotePwd%@%remoteUrl:~8%/_git/%projName% set vstsCreateProject=https://%remoteUser%:%remotePwd%@%remoteUrl:~8%/defaultcollection/_apis/projects?api-version=3.0 rem use curl to create project pushd ..\wwwroot type PostDeployScripts\vsoProject.json.template | sed -e s/\{WEB_SITE_NAME\}/%projName%/g > %TEMP%\vsoProject.json call curl -H "Content-Type: application/json" -d "@%TEMP%\vsoProject.json" -X POST %vstsCreateProject% rm %TEMP%\vsoProject.json rem sleep for 15 seconds for the creation to complete, this is a wild guess call sleep 15 popd popd rem cd to project root pushd ..\wwwroot rem init git call git init call git config user.name "%remoteUser%" call git config user.password "%remotePwd%" call git config user.email "[email protected]" call git add . call git commit -m "prepare to setup source control" call git push %repoUrl% master popd rem cleanup git stuff pushd ..\wwwroot call rm -r -f .git popd endlocal
{ "pile_set_name": "Github" }
using System.Collections.Generic; using NzbDrone.Core.Datastore; using NzbDrone.Core.Messaging.Events; namespace NzbDrone.Core.Extras.Files { public interface IExtraFileRepository<TExtraFile> : IBasicRepository<TExtraFile> where TExtraFile : ExtraFile, new() { void DeleteForMovies(List<int> movieIds); void DeleteForMovieFile(int movieFileId); List<TExtraFile> GetFilesByMovie(int movieId); List<TExtraFile> GetFilesByMovieFile(int movieFileId); } public class ExtraFileRepository<TExtraFile> : BasicRepository<TExtraFile>, IExtraFileRepository<TExtraFile> where TExtraFile : ExtraFile, new() { public ExtraFileRepository(IMainDatabase database, IEventAggregator eventAggregator) : base(database, eventAggregator) { } public void DeleteForMovies(List<int> movieIds) { Delete(x => movieIds.Contains(x.MovieId)); } public void DeleteForMovieFile(int movieFileId) { Delete(x => x.MovieFileId == movieFileId); } public List<TExtraFile> GetFilesByMovie(int movieId) { return Query(x => x.MovieId == movieId); } public List<TExtraFile> GetFilesByMovieFile(int movieFileId) { return Query(x => x.MovieFileId == movieFileId); } } }
{ "pile_set_name": "Github" }
describe('forms.isAriaTextbox', function() { 'use strict'; var isAriaTextbox = axe.commons.forms.isAriaTextbox; var flatTreeSetup = axe.testUtils.flatTreeSetup; it('returns true for an element with role=textbox', function() { var node = document.createElement('div'); node.setAttribute('role', 'textbox'); flatTreeSetup(node); assert.isTrue(isAriaTextbox(node)); }); it('returns false for elements without role', function() { var node = document.createElement('div'); flatTreeSetup(node); assert.isFalse(isAriaTextbox(node)); }); it('returns false for elements with incorrect role', function() { var node = document.createElement('div'); node.setAttribute('role', 'main'); flatTreeSetup(node); assert.isFalse(isAriaTextbox(node)); }); it('returns false for native textbox inputs', function() { var node = document.createElement('input'); node.setAttribute('type', 'text'); flatTreeSetup(node); assert.isFalse(isAriaTextbox(node)); }); });
{ "pile_set_name": "Github" }
import THREE from 'three'; export function generateDataTexture(width, height, color) { const size = width * height; const data = new Uint8Array(3 * size); const r = Math.floor(color.r * 255); const g = Math.floor(color.g * 255); const b = Math.floor(color.b * 255); for (let i = 0; i < size; i++) { const stride = i * 3; data[stride] = r; data[stride + 1] = g; data[stride + 2] = b; } const texture = new THREE.DataTexture(data, width, height, THREE.RGBFormat); return texture; }
{ "pile_set_name": "Github" }
<h3>{$LANG.kbsuggestions}</h3> <p>{$LANG.kbsuggestionsexplanation}</p> <div class="kbarticles"> {foreach from=$kbarticles item=kbarticle} <p> <a href="knowledgebase.php?action=displayarticle&id={$kbarticle.id}" target="_blank"> <span class="glyphicon glyphicon-file"></span> {$kbarticle.title} </a> - {$kbarticle.article}... </p> {/foreach} </div>
{ "pile_set_name": "Github" }
<?php $lang["common_address_1"] = ""; $lang["common_address_2"] = ""; $lang["common_city"] = ""; $lang["common_close"] = ""; $lang["common_comments"] = ""; $lang["common_common"] = ""; $lang["common_confirm_search"] = ""; $lang["common_copryrights"] = ""; $lang["common_correct_errors"] = ""; $lang["common_country"] = ""; $lang["common_date"] = ""; $lang["common_delete"] = ""; $lang["common_det"] = ""; $lang["common_download_import_template"] = ""; $lang["common_edit"] = ""; $lang["common_email"] = ""; $lang["common_email_invalid_format"] = ""; $lang["common_export_csv"] = ""; $lang["common_export_csv_no"] = ""; $lang["common_export_csv_yes"] = ""; $lang["common_fields_required_message"] = ""; $lang["common_first_name"] = ""; $lang["common_first_name_required"] = ""; $lang["common_first_page"] = ""; $lang["common_gender"] = ""; $lang["common_gender_female"] = ""; $lang["common_gender_male"] = ""; $lang["common_id"] = ""; $lang["common_import"] = ""; $lang["common_import_change_file"] = ""; $lang["common_import_csv"] = ""; $lang["common_import_full_path"] = ""; $lang["common_import_remove_file"] = ""; $lang["common_import_select_file"] = ""; $lang["common_inv"] = ""; $lang["common_last_name"] = ""; $lang["common_last_name_required"] = ""; $lang["common_last_page"] = ""; $lang["common_learn_about_project"] = ""; $lang["common_list_of"] = ""; $lang["common_logout"] = ""; $lang["common_migration_needed"] = ""; $lang["common_new"] = ""; $lang["common_no_persons_to_display"] = ""; $lang["common_none_selected_text"] = ""; $lang["common_or"] = ""; $lang["common_phone_number"] = ""; $lang["common_phone_number_required"] = ""; $lang["common_please_visit_my"] = ""; $lang["common_powered_by"] = ""; $lang["common_price"] = ""; $lang["common_print"] = ""; $lang["common_remove"] = ""; $lang["common_required"] = ""; $lang["common_restore"] = ""; $lang["common_return_policy"] = ""; $lang["common_search"] = ""; $lang["common_search_options"] = ""; $lang["common_searched_for"] = ""; $lang["common_state"] = ""; $lang["common_submit"] = ""; $lang["common_total_spent"] = ""; $lang["common_unknown"] = ""; $lang["common_view_recent_sales"] = ""; $lang["common_website"] = ""; $lang["common_welcome"] = ""; $lang["common_welcome_message"] = ""; $lang["common_you_are_using_ospos"] = ""; $lang["common_zip"] = "";
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <emoticons-map name="default"> <emoticon file="smile.png"> <name text=":)"/> <name text=":-)"/> </emoticon> <emoticon file="smile-big.png"> <name text=":-D"/> <name text=":-d"/> <name text=":D"/> <name text=":d"/> </emoticon> <emoticon file="wink.png"> <name text=";-)"/> <name text=";)"/> </emoticon> <emoticon file="tongue.png"> <name text=":P"/> <name text=":-P"/> <name text=":-p"/> <name text=":p"/> </emoticon> <emoticon file="shock.png"> <name text="=-O"/> <name text="=-o"/> </emoticon> <emoticon file="kiss.png"> <name text=":-*"/> </emoticon> <emoticon file="glasses-cool.png"> <name text="8-)"/> </emoticon> <emoticon file="embarrassed.png"> <name text=":-["/> </emoticon> <emoticon file="crying.png"> <name text=":'("/> </emoticon> <emoticon file="thinking.png"> <name text=":-/"/> <name text=":-\\"/> </emoticon> <emoticon file="angel.png"> <name text="O:-)"/> <name text="o:-)"/> </emoticon> <emoticon file="shut-mouth.png"> <name text=":-X"/> </emoticon> <emoticon file="moneymouth.png"> <name text=":-$"/> </emoticon> <emoticon file="foot-in-mouth.png"> <name text=":-!"/> </emoticon> <emoticon file="shout.png"> <name text=">:o"/> <name text=">:O"/> </emoticon> <emoticon file="skywalker.png"> <name text="C:-)"/> <name text="c:-)"/> <name text="C:)"/> <name text="c:)"/> </emoticon> <emoticon file="monkey.png"> <name text=":-(|)"/> <name text=":(|)"/> <name text="8-|)"/> </emoticon> <emoticon file="sad.png"> <name text=":-("/> <name text=":("/> </emoticon> <emoticon file="cyclops.png"> <name text="O-)"/> <name text="o-)"/> </emoticon> </emoticons-map>
{ "pile_set_name": "Github" }
/************************************************************************* * File: numeric-limits.cpp * Brief: Shows the numeric limits for all possible numerical types. * Author: Caio Rodrigues *************************************************************************/ #include <iostream> #include <limits> // Numeric limits #include <iomanip> // setw, and other IO manipulators #include <string> // std::string #include <cstdint> // uint8_t, int8_t, ... #include <functional> struct RowPrinter{ int m_left; // Left alignment int m_right; // Right alignment RowPrinter(int left, int right): m_left(left), m_right(right){ // Print bool as 'true' or 'false' instead of 0 or 1. std::cout << std::boolalpha; } template<class A> auto printRow(const std::string& label, const A& value) const -> void { std::cout << std::setw(m_left) << label << std::setw(m_right) << value << "\n"; } }; #define SHOW_INTEGER_LIMITS(numtype) showNumericLimits<numtype>(#numtype) #define SHOW_FLOAT_LIMITS(numtype) showFloatPointLimits<numtype>(#numtype) template <class T> void showNumericLimits(const std::string& name){ RowPrinter rp{30, 25}; std::cout << "Numeric limits for type: " << name << "\n"; std::cout << std::string(60, '-') << "\n"; rp.printRow("Type:", name); rp.printRow("Is integer:", std::numeric_limits<T>::is_integer); rp.printRow("Is signed:", std::numeric_limits<T>::is_signed); rp.printRow("Number of digits 10:", std::numeric_limits<T>::digits10); rp.printRow("Max Number of digits 10:", std::numeric_limits<T>::max_digits10); // RTTI - Run-Time Type Information if(typeid(T) == typeid(uint8_t) || typeid(T) == typeid(int8_t) || typeid(T) == typeid(bool) || typeid(T) == typeid(char) || typeid(T) == typeid(unsigned char) ){ // Min Abs - samllest positive value for float point numbers rp.printRow("Min Abs:", static_cast<int>(std::numeric_limits<T>::min())); // Smallest value (can be negative) rp.printRow("Min:", static_cast<int>(std::numeric_limits<T>::lowest())); // Largest value rp.printRow("Max:", static_cast<int>(std::numeric_limits<T>::max())); } else { rp.printRow("Min Abs:", std::numeric_limits<T>::min()); rp.printRow("Min:", std::numeric_limits<T>::lowest()); rp.printRow("Max:", std::numeric_limits<T>::max()); } rp.printRow("Size in bytes:", sizeof(T)); rp.printRow("Size in bits:", 8 * sizeof(T)); std::cout << "\n"; } template<class T> void showFloatPointLimits(const std::string& name){ RowPrinter rp{30, 25}; showNumericLimits<T>(name); rp.printRow("Epsilon:", std::numeric_limits<T>::epsilon()); rp.printRow("Min exponent:", std::numeric_limits<T>::min_exponent10); rp.printRow("Max exponent:", std::numeric_limits<T>::max_exponent10); } int main(){ SHOW_INTEGER_LIMITS(bool); SHOW_INTEGER_LIMITS(char); SHOW_INTEGER_LIMITS(unsigned char); SHOW_INTEGER_LIMITS(wchar_t); // Standard integers in <cstdint> SHOW_INTEGER_LIMITS(int8_t); SHOW_INTEGER_LIMITS(uint8_t); SHOW_INTEGER_LIMITS(int16_t); SHOW_INTEGER_LIMITS(uint16_t); SHOW_INTEGER_LIMITS(int32_t); SHOW_INTEGER_LIMITS(uint32_t); SHOW_INTEGER_LIMITS(int64_t); SHOW_INTEGER_LIMITS(uint64_t); SHOW_INTEGER_LIMITS(short); SHOW_INTEGER_LIMITS(unsigned short); SHOW_INTEGER_LIMITS(int); SHOW_INTEGER_LIMITS(unsigned int); SHOW_INTEGER_LIMITS(long); SHOW_INTEGER_LIMITS(unsigned long); SHOW_INTEGER_LIMITS(long long); SHOW_INTEGER_LIMITS(unsigned long long); SHOW_FLOAT_LIMITS(float); SHOW_FLOAT_LIMITS(double); SHOW_FLOAT_LIMITS(long double); return 0; }
{ "pile_set_name": "Github" }
/************************************************************************** * * Copyright 2013-2014 RAD Game Tools and Valve Software * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * **************************************************************************/ // File: vogl_fs_preprocessor.cpp #include "vogl_fs_preprocessor.h" #include "vogl_file_utils.h" vogl_fs_preprocessor* vogl_fs_preprocessor::m_instance = 0; vogl_fs_preprocessor::vogl_fs_preprocessor() : m_pp_cmd(""), m_pp_opts(""), m_pp_prefix(""), m_count(0), m_length(0), m_in_length(0), m_shader_id(0), m_null_shader_id(0), m_in_shader(""), m_output_shader(""), m_null(false), m_tm(0), m_time_to_run_pp(0), m_enabled(false) { VOGL_FUNC_TRACER m_null_color[0] = 0.6275; m_null_color[1] = 0.1255; m_null_color[2] = 0.9412; m_null_color[3] = 1; m_tm.start(); atexit(&cleanup); } void vogl_fs_preprocessor::cleanup() { delete m_instance; m_instance = 0; } vogl_fs_preprocessor::~vogl_fs_preprocessor() { VOGL_FUNC_TRACER } void vogl_fs_preprocessor::reset() { m_pp_cmd = ""; m_pp_opts = ""; m_pp_prefix = ""; m_count = 0; m_length = 0; m_in_length = 0; m_in_shader = ""; m_shader_id = 0, m_null_shader_id = 0, m_output_shader = ""; m_null = false; m_null_color[0] = 0.6275; m_null_color[1] = 0.1255; m_null_color[2] = 0.9412; m_null_color[3] = 1; m_tm.stop(); m_tm.start(); m_time_to_run_pp = 0; m_enabled = false; } // Internal class function wrapped by public run() call so that we can easily time how long pp takes bool vogl_fs_preprocessor::_run() { // For NULL case, null FS output prior to PP run // Also verify any Shader ID if (m_null) { if ((0 != m_null_shader_id) && (m_shader_id != m_null_shader_id)) { m_output_shader = m_in_shader; m_count = 1; m_length = m_output_shader.get_len(); return true; } m_in_shader = _set_null_output_color(m_in_shader); } // Write input shader to a file to feed into pp //dynamic_string in_fs_filename("tmp_shader_in.frag"); dynamic_string in_fs_filename("tmp_shader_in.frag"); if (m_pp_prefix.size() > 0) in_fs_filename = dynamic_string(cVarArg, "%sshader_in_%i.frag", m_pp_prefix.get_ptr(), m_shader_id); dynamic_string_array shader_strings; shader_strings.push_back(m_in_shader); bool success = file_utils::write_text_file(in_fs_filename.get_ptr(), shader_strings, true); if (success) { dynamic_string out_shader_filename("tmp_shader_out.frag"); if (m_pp_prefix.size() > 0) out_shader_filename = dynamic_string(cVarArg, "%sshader_out_%i.frag", m_pp_prefix.get_ptr(), m_shader_id); //const dynamic_string out_shader_filename("tmp_shader_out.frag"); dynamic_string pp_cmd(cVarArg, "%s %s %s 1>%s", m_pp_cmd.get_ptr(), m_pp_opts.get_ptr(), in_fs_filename.get_ptr(), out_shader_filename.get_ptr()); // TODO : Is "system" best option here? Add improved error handling. system(pp_cmd.get_ptr()); dynamic_string_array updated_fs_lines; if (file_utils::read_text_file(out_shader_filename.get_ptr(), updated_fs_lines, file_utils::cRTFTrim | file_utils::cRTFIgnoreEmptyLines | file_utils::cRTFPrintErrorMessages)) { // TODO : Error handling here to parse for error cases in the pre-processor output // We successfully read updated shader so now use updated data m_count = updated_fs_lines.size(); // When trying to use multi-line shader string as read into updated_fs_lines there were // various compile errors so for now we just smash all shader lines into a single string m_output_shader.clear(); for (GLsizei i = 0; i < m_count; i++) { m_output_shader.append(updated_fs_lines[i].get_ptr()); m_output_shader.append("\n"); } m_count = 1; m_length = m_output_shader.get_len(); } else { vogl_error_printf("Could not read in new FS that was written out by FS pre-processor.\n"); return false; } } else { vogl_error_printf("Could not write out FS to a file to input into FS pre-processor.\n"); return false; } return true; } bool vogl_fs_preprocessor::run() { double pp_start = m_tm.get_elapsed_secs(); bool status = _run(); m_time_to_run_pp += m_tm.get_elapsed_secs() - pp_start; return status; } void vogl_fs_preprocessor::set_shader(GLuint id, vogl::vector<const GLcharARB *> in_shader_vec, vogl::vector<GLint> lengths) { m_shader_id = id; m_in_shader.clear(); for (unsigned int i = 0; i < in_shader_vec.size(); i++) { m_in_shader.append(dynamic_string(in_shader_vec[i], lengths[i])); m_in_shader.append("\n"); } } // This function performs null shader substitution by setting FS output color to constant color // The shader will then be cleaned up when run through LunarGOO as the preprocessor // TODO : This code is pretty fragile but works on TF2 and Dota2 tests for now // Ideally would like to offload the NULL (and any other capabilities) into the FSPP dynamic_string vogl_fs_preprocessor::_set_null_output_color(dynamic_string in_shader) { // For the input shader, find "gl_FragColor *;" section and replace with null color // Parse in_shader and find gl_FragColor vogl::vector<const char *> replace_strings(5); // in case we have to replace multiple color outputs replace_strings[0] = "gl_FragColor"; replace_strings[1] = "gl_FragData[0]"; replace_strings[2] = "gl_FragData[1]"; replace_strings[3] = "gl_FragData[2]"; replace_strings[4] = "gl_FragData[3]"; dynamic_string new_out_color = dynamic_string(cVarArg, "REPLACE_ME = vec4(%1.4f, %1.4f, %1.4f, %1.4f);", m_null_color[0], m_null_color[1], m_null_color[2], m_null_color[3]); dynamic_string replace_me = ""; // the string that we'll replace uint32_t num_found = 0; int32_t out_color_index = in_shader.find_right("gl_FragColor.a =", true); // Special case when glFragColor.a/.rgb are set independently for now if (out_color_index >= 0) { while (';' != in_shader[out_color_index]) replace_me.append_char(in_shader[out_color_index++]); replace_me.append_char(';'); // Verify that we can do rgb substitution before we replace alpha out_color_index = in_shader.find_right("gl_FragColor.rgb", true); if (out_color_index < 0) { vogl_error_printf("Unable to do NULL substitution for FS %i\n", m_shader_id); VOGL_ASSERT_ALWAYS; } // Just remove gl_FragColor.a line and merge NULL into gl_FragColor.rgb line in_shader.replace(replace_me.get_ptr(), "", true, &num_found, 1); new_out_color.replace("REPLACE_ME", replace_strings[0]); while (';' != in_shader[out_color_index]) replace_me.append_char(in_shader[out_color_index++]); replace_me.append_char(';'); in_shader.replace(replace_me.get_ptr(), new_out_color.get_ptr(), true, &num_found, 1); } else { for (uint32_t count = 0; count < replace_strings.size(); count++) { out_color_index = in_shader.find_right(replace_strings[count], true); if (out_color_index >= 0) { // need to make this replacement new_out_color.replace("REPLACE_ME", replace_strings[count]); // identify exact string we're replacing while (';' != in_shader[out_color_index]) replace_me.append_char(in_shader[out_color_index++]); replace_me.append_char(';'); in_shader.replace(replace_me.get_ptr(), new_out_color.get_ptr(), true, &num_found, 1); if (num_found != 1) { vogl_warning_printf("Failed to find shader output to replace null shader output\n"); } // reset replace strings for next pass replace_me.clear(); new_out_color.replace(replace_strings[count], "REPLACE_ME", true, &num_found, 1); } } } return in_shader; } // This is a bit of a work-around that allows us to pull certain options off // of the PP cmd line options and handle them prior to passing further options // onto the PP. Right now this handles NULL_FS processing. // Default NULL color is bright purple. // If "NULL" option found, will be of format NULL_FS[FS_ID]:<#>,<#>,<#>,<#> // Here are some examples of ways to use NULL options: // "NULL_FS" will cause all FSs to be nulled out // "NULL_FS[464]" will only null out only FS with trace handle "464" // "NULL_FS:1.0,0.0,0.0,1.0" will NULL all shaders out to red // "NULL_FS[789]:0.0,0.0,1.0,1.0" will NULL out shader with handle "789" to blue dynamic_string vogl_fs_preprocessor::_check_opts(const dynamic_string &in_opts) { dynamic_string working_str = in_opts; // parse the options and pull off any "internal" options that we deal with ourselves if (working_str.contains("NULL_FS", true)) { dynamic_string null_str = ""; dynamic_string color_str = ""; dynamic_string shader_id_str = ""; int ns_start_index = working_str.find_left("NULL_FS"); int ns_index = ns_start_index; unsigned int null_color_index = 0; bool store_color = false; bool store_id = false; // Pull NULL str out of opts while (working_str[ns_index] && working_str[ns_index] != ' ') { null_str.append_char(working_str[ns_index]); // if we're in a color section, store color at appropriate index if (store_color) { if (working_str[ns_index] == ',') { m_null_color[null_color_index++] = strtof(color_str.get_ptr(), NULL); color_str.clear(); } else color_str.append_char(working_str[ns_index]); } if (store_id) { if (working_str[ns_index] == ']') { m_null_shader_id = atoi(shader_id_str.get_ptr()); store_id = false; } else shader_id_str.append_char(working_str[ns_index]); } if (':' == working_str[ns_index]) store_color = true; if ('[' == working_str[ns_index]) store_id = true; ns_index++; } if (store_color) m_null_color[null_color_index] = strtof(color_str.get_ptr(), NULL); working_str.remove(ns_start_index, null_str.size()); // enable null FS m_null = true; } return working_str; }
{ "pile_set_name": "Github" }
config FUSE_FS tristate "FUSE (Filesystem in Userspace) support" help With FUSE it is possible to implement a fully functional filesystem in a userspace program. There's also a companion library: libfuse2. This library is available from the FUSE homepage: <http://fuse.sourceforge.net/> although chances are your distribution already has that library installed if you've installed the "fuse" package itself. See <file:Documentation/filesystems/fuse.txt> for more information. See <file:Documentation/Changes> for needed library/utility version. If you want to develop a userspace FS, or if you want to use a filesystem based on FUSE, answer Y or M. config CUSE tristate "Character device in Userspace support" depends on FUSE_FS help This FUSE extension allows character devices to be implemented in userspace. If you want to develop or use a userspace character device based on CUSE, answer Y or M.
{ "pile_set_name": "Github" }
BCSymbolMap Version: 2.0 -[UDByteBuf init] -[UDByteBuf capacity] -[UDByteBuf setCapacity:] -[UDByteBuf readableBytes] -[UDByteBuf writableBytes] -[UDByteBuf ensureWritable:] -[UDByteBuf trimWritable:] -[UDByteBuf discardReadBytes] -[UDByteBuf bytes:length:] -[UDByteBuf bytes:dest:length:] -[UDByteBuf readBytes:] -[UDByteBuf skipBytes:] -[UDByteBuf writeData:] -[UDByteBuf writeBytes:length:] -[UDByteBuf advanceWriterIndex:] -[UDByteBuf data] -[UDByteBuf readerIndex] -[UDByteBuf setReaderIndex:] -[UDByteBuf writerIndex] -[UDByteBuf setWriterIndex:] -[UDByteBuf .cxx_destruct] _OBJC_IVAR_$_UDByteBuf._data _OBJC_IVAR_$_UDByteBuf._writerIndex _OBJC_IVAR_$_UDByteBuf._readerIndex Apple LLVM version 8.0.0 (clang-800.0.38) /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDByteBuf.m /Users/virl/Projects/underdark/underdark-cocoa /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDByteBuf.h NSMakeRange /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRange.h -[UDBuffer length] -[UDBuffer readBytesWithOffset:length:] -[UDBuffer readBytesWithOffset:] /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDBuffer.m -[UDAggLink init] -[UDAggLink initWithTransport:adapter:channel:] -[UDAggLink dealloc] -[UDAggLink onChannelDisconnected] -[UDAggLink sendNextFrame] ___26-[UDAggLink sendNextFrame]_block_invoke ___copy_helper_block_ ___destroy_helper_block_ ___26-[UDAggLink sendNextFrame]_block_invoke.35 ___copy_helper_block_.36 ___destroy_helper_block_.37 ___26-[UDAggLink sendNextFrame]_block_invoke.47 ___26-[UDAggLink sendNextFrame]_block_invoke_2 ___copy_helper_block_.61 ___destroy_helper_block_.62 ___copy_helper_block_.64 ___destroy_helper_block_.65 -[UDAggLink priority] -[UDAggLink disconnect] ___23-[UDAggLink disconnect]_block_invoke ___copy_helper_block_.75 ___destroy_helper_block_.76 -[UDAggLink longTransferBegin] ___30-[UDAggLink longTransferBegin]_block_invoke ___copy_helper_block_.81 ___destroy_helper_block_.82 -[UDAggLink longTransferEnd] ___28-[UDAggLink longTransferEnd]_block_invoke ___copy_helper_block_.86 ___destroy_helper_block_.87 -[UDAggLink sendFrame:] -[UDAggLink sendFrameWithSource:] ___33-[UDAggLink sendFrameWithSource:]_block_invoke ___copy_helper_block_.99 ___destroy_helper_block_.100 -[UDAggLink transport] -[UDAggLink nodeId] -[UDAggLink slowLink] -[UDAggLink .cxx_destruct] _OBJC_IVAR_$_UDAggLink._transport _OBJC_IVAR_$_UDAggLink._adapter _OBJC_IVAR_$_UDAggLink._channel _OBJC_IVAR_$_UDAggLink._nodeId _OBJC_IVAR_$_UDAggLink._outputQueue _OBJC_IVAR_$_UDAggLink._preparedFrame _OBJC_IVAR_$_UDAggLink._disconnected ___block_descriptor_tmp ___block_descriptor_tmp.38 ___block_descriptor_tmp.63 ___block_descriptor_tmp.67 ___block_descriptor_tmp.78 ___block_descriptor_tmp.83 ___block_descriptor_tmp.88 ___block_descriptor_tmp.101 _OBJC_IVAR_$_UDAggLink._slowLink l_OBJC_PROTOCOL_$_NSObject l_OBJC_LABEL_PROTOCOL_$_NSObject l_OBJC_PROTOCOL_$_UDLink l_OBJC_LABEL_PROTOCOL_$_UDLink /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDAggLink.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDAggLink.h __destroy_helper_block_ __copy_helper_block_ __33-[UDAggLink sendFrameWithSource:]_block_invoke __28-[UDAggLink longTransferEnd]_block_invoke __30-[UDAggLink longTransferBegin]_block_invoke __23-[UDAggLink disconnect]_block_invoke __26-[UDAggLink sendNextFrame]_block_invoke_2 __26-[UDAggLink sendNextFrame]_block_invoke.47 __26-[UDAggLink sendNextFrame]_block_invoke.35 __26-[UDAggLink sendNextFrame]_block_invoke -[UDFutureListener initWithQueue:block:] -[UDFutureListener call:result:] ___32-[UDFutureListener call:result:]_block_invoke -[UDFutureListener .cxx_destruct] _OBJC_IVAR_$_UDFutureListener._queue _OBJC_IVAR_$_UDFutureListener._block /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDFutureListener.m __32-[UDFutureListener call:result:]_block_invoke -[UDCompositeBuffer init] -[UDCompositeBuffer append:] -[UDCompositeBuffer length] -[UDCompositeBuffer readBytesWithOffset:length:] -[UDCompositeBuffer buffers] -[UDCompositeBuffer .cxx_destruct] _OBJC_IVAR_$_UDCompositeBuffer._buffers /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDCompositeBuffer.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDCompositeBuffer.h +[UDUtil generateId] /Users/virl/Projects/underdark/underdark-cocoa/Underdark/Public/UDUtil.m -[UDFutureKnown init] -[UDFutureKnown initWithResult:] -[UDFutureKnown dealloc] -[UDFutureKnown listen:block:] ___30-[UDFutureKnown listen:block:]_block_invoke -[UDFutureKnown .cxx_destruct] _OBJC_IVAR_$_UDFutureKnown._result /Users/virl/Projects/underdark/underdark-cocoa/Underdark/Public/UDFutureKnown.m __30-[UDFutureKnown listen:block:]_block_invoke -[UDBtBeacon init] -[UDBtBeacon initWithAppId:] -[UDBtBeacon dealloc] -[UDBtBeacon requestPermissions] -[UDBtBeacon monitorIfNecessary] -[UDBtBeacon startMonitoring] -[UDBtBeacon stopMonitoring] -[UDBtBeacon advertiseIfNecessary] -[UDBtBeacon startAdvertising] -[UDBtBeacon stopAdvertising] -[UDBtBeacon notifyBluetoothRequired] ___37-[UDBtBeacon notifyBluetoothRequired]_block_invoke -[UDBtBeacon locationManager:didChangeAuthorizationStatus:] -[UDBtBeacon locationManager:didDetermineState:forRegion:] -[UDBtBeacon locationManager:didEnterRegion:] -[UDBtBeacon locationManager:didExitRegion:] -[UDBtBeacon locationManager:didFailWithError:] -[UDBtBeacon locationManager:monitoringDidFailForRegion:withError:] -[UDBtBeacon locationManager:didStartMonitoringForRegion:] -[UDBtBeacon peripheralManagerDidUpdateState:] -[UDBtBeacon peripheralManagerDidStartAdvertising:error:] -[UDBtBeacon beaconData] -[UDBtBeacon state] -[UDBtBeacon setState:] -[UDBtBeacon .cxx_destruct] _OBJC_IVAR_$_UDBtBeacon._beaconUuid _OBJC_IVAR_$_UDBtBeacon._region _OBJC_IVAR_$_UDBtBeacon._beaconData _OBJC_IVAR_$_UDBtBeacon._locationManager _OBJC_IVAR_$_UDBtBeacon._peripheralManager _OBJC_IVAR_$_UDBtBeacon._state l_OBJC_PROTOCOL_$_CLLocationManagerDelegate l_OBJC_LABEL_PROTOCOL_$_CLLocationManagerDelegate l_OBJC_PROTOCOL_$_CBPeripheralManagerDelegate l_OBJC_LABEL_PROTOCOL_$_CBPeripheralManagerDelegate /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDBtBeacon.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDBtBeacon.h __37-[UDBtBeacon notifyBluetoothRequired]_block_invoke -[UDDataBuffer initWithData:] -[UDDataBuffer length] -[UDDataBuffer readBytesWithOffset:length:] -[UDDataBuffer data] -[UDDataBuffer .cxx_destruct] _OBJC_IVAR_$_UDDataBuffer._data /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDDataBuffer.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDDataBuffer.h -[UDFrameCache initWithQueue:] -[UDFrameCache giveupDataId:] -[UDFrameCache cachedDataWithSource:] -[UDFrameCache dataForSource:] ___30-[UDFrameCache dataForSource:]_block_invoke -[UDFrameCache .cxx_destruct] _OBJC_IVAR_$_UDFrameCache._queue _OBJC_IVAR_$_UDFrameCache._cache _OBJC_IVAR_$_UDFrameCache._counts /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDFrameCache.m __30-[UDFrameCache dataForSource:]_block_invoke /Users/virl/Projects/underdark/underdark-cocoa/Underdark/Public/UDTransport.m -[UDNsdChannel init] -[UDNsdChannel initWithServer:input:output:] -[UDNsdChannel dealloc] -[UDNsdChannel randomChannelId] -[UDNsdChannel description] -[UDNsdChannel priority] -[UDNsdChannel sendHeartbeat] -[UDNsdChannel checkHeartbeat] -[UDNsdChannel checkHeartbeatImpl] -[UDNsdChannel sendLongTransferLock:] -[UDNsdChannel sendFrame:] -[UDNsdChannel sendFrameOld:] -[UDNsdChannel sendLinkFrame:] -[UDNsdChannel connect] -[UDNsdChannel disconnect] -[UDNsdChannel closeStreams] ___28-[UDNsdChannel closeStreams]_block_invoke -[UDNsdChannel onTerminated] ___28-[UDNsdChannel onTerminated]_block_invoke ___copy_helper_block_.101 ___destroy_helper_block_.102 -[UDNsdChannel stream:handleEvent:] -[UDNsdChannel outputStream:handleEvent:] -[UDNsdChannel writeFrame:] -[UDNsdChannel writeNextBytes] -[UDNsdChannel inputStream:handleEvent:] -[UDNsdChannel formFrames] ___26-[UDNsdChannel formFrames]_block_invoke ___copy_helper_block_.190 ___destroy_helper_block_.191 ___26-[UDNsdChannel formFrames]_block_invoke.199 ___copy_helper_block_.202 ___destroy_helper_block_.203 -[UDNsdChannel remoteNodeId] -[UDNsdChannel channelId] -[UDNsdChannel transferBytes] -[UDNsdChannel transferTime] -[UDNsdChannel transferSpeed] -[UDNsdChannel interfaceIndex] -[UDNsdChannel setInterfaceIndex:] -[UDNsdChannel server] -[UDNsdChannel inputStream] -[UDNsdChannel setInputStream:] -[UDNsdChannel outputStream] -[UDNsdChannel setOutputStream:] -[UDNsdChannel .cxx_destruct] _OBJC_IVAR_$_UDNsdChannel._channelId _OBJC_IVAR_$_UDNsdChannel._server _OBJC_IVAR_$_UDNsdChannel._state _OBJC_IVAR_$_UDNsdChannel._inputData _OBJC_IVAR_$_UDNsdChannel._outputQueue _OBJC_IVAR_$_UDNsdChannel._inputStream _OBJC_IVAR_$_UDNsdChannel._outputStream _OBJC_IVAR_$_UDNsdChannel._heartbeatTimer _OBJC_IVAR_$_UDNsdChannel._timeoutTimer _OBJC_IVAR_$_UDNsdChannel._remoteNodeId _OBJC_IVAR_$_UDNsdChannel._heartbeatReceived _OBJC_IVAR_$_UDNsdChannel._outputData _OBJC_IVAR_$_UDNsdChannel._outputDataOffset ___block_descriptor_tmp.103 _OBJC_IVAR_$_UDNsdChannel._transferStartTime _OBJC_IVAR_$_UDNsdChannel._transferBytes _OBJC_IVAR_$_UDNsdChannel._transferTime _OBJC_IVAR_$_UDNsdChannel._transferSpeed _OBJC_IVAR_$_UDNsdChannel._inputBuffer ___block_descriptor_tmp.192 ___block_descriptor_tmp.204 _OBJC_IVAR_$_UDNsdChannel._interfaceIndex l_OBJC_PROTOCOL_$_NSStreamDelegate l_OBJC_LABEL_PROTOCOL_$_NSStreamDelegate l_OBJC_PROTOCOL_$_UDChannel l_OBJC_LABEL_PROTOCOL_$_UDChannel /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDNsdChannel.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDNsdChannel.h __26-[UDNsdChannel formFrames]_block_invoke.199 __26-[UDNsdChannel formFrames]_block_invoke CFSwapInt32BigToHost /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h _OSSwapInt32 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/usr/include/libkern/arm/OSByteOrder.h __28-[UDNsdChannel onTerminated]_block_invoke __28-[UDNsdChannel closeStreams]_block_invoke CFSwapInt32HostToBig +[UDUnderdark logger] +[UDUnderdark setLogger:] +[UDUnderdark configureTransportWithAppId:nodeId:queue:kinds:] _underdarkLogger /Users/virl/Projects/underdark/underdark-cocoa/Underdark/Public/UDUnderdark.m -[UDFutureLazy init] -[UDFutureLazy initWithQueue:context:block:] -[UDFutureLazy initWithQueue:block:] -[UDFutureLazy dealloc] -[UDFutureLazy listen:block:] ___29-[UDFutureLazy listen:block:]_block_invoke ___29-[UDFutureLazy listen:block:]_block_invoke_2 ___copy_helper_block_.7 ___destroy_helper_block_.8 -[UDFutureLazy .cxx_destruct] _OBJC_IVAR_$_UDFutureLazy._queue _OBJC_IVAR_$_UDFutureLazy._retriever _OBJC_IVAR_$_UDFutureLazy._context ___block_descriptor_tmp.9 /Users/virl/Projects/underdark/underdark-cocoa/Underdark/Public/UDFutureLazy.m __29-[UDFutureLazy listen:block:]_block_invoke_2 __29-[UDFutureLazy listen:block:]_block_invoke /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDNsdUtil.m UDInterfaceIndexToName UDDnsErrorToString UDCallbackDescription UDCallbackInfoRelease UDCallbackInfoRetain -[UDBonjourChannel init] -[UDBonjourChannel initServerWithDelegate:nodeId:input:output:] -[UDBonjourChannel initClientWithDelegate:nodeId:remoteNodeId:input:output:] -[UDBonjourChannel dealloc] -[UDBonjourChannel randomChannelId] -[UDBonjourChannel description] -[UDBonjourChannel sendHeartbeat] -[UDBonjourChannel checkHeartbeat] -[UDBonjourChannel checkHeartbeatImpl] -[UDBonjourChannel connect] -[UDBonjourChannel disconnect] -[UDBonjourChannel closeStreams] ___32-[UDBonjourChannel closeStreams]_block_invoke -[UDBonjourChannel onTerminated] ___32-[UDBonjourChannel onTerminated]_block_invoke ___copy_helper_block_.98 ___destroy_helper_block_.99 -[UDBonjourChannel sendLongTransferLock:] ___41-[UDBonjourChannel sendLongTransferLock:]_block_invoke ___copy_helper_block_.108 ___destroy_helper_block_.109 -[UDBonjourChannel sendFrame:] -[UDBonjourChannel sendInternalFrame:] -[UDBonjourChannel enqueueFrame:] -[UDBonjourChannel enqueueItem:] -[UDBonjourChannel writeNextBytes] ___34-[UDBonjourChannel writeNextBytes]_block_invoke ___copy_helper_block_.143 ___destroy_helper_block_.144 -[UDBonjourChannel frameHeaderForFrameData:] -[UDBonjourChannel formFrames] -[UDBonjourChannel processInputFrame:] ___38-[UDBonjourChannel processInputFrame:]_block_invoke ___copy_helper_block_.191 ___destroy_helper_block_.192 ___38-[UDBonjourChannel processInputFrame:]_block_invoke.194 ___copy_helper_block_.195 ___destroy_helper_block_.196 ___38-[UDBonjourChannel processInputFrame:]_block_invoke.206 ___copy_helper_block_.209 ___destroy_helper_block_.210 ___38-[UDBonjourChannel processInputFrame:]_block_invoke.216 ___copy_helper_block_.219 ___destroy_helper_block_.220 -[UDBonjourChannel stream:handleEvent:] -[UDBonjourChannel outputStream:handleEvent:] -[UDBonjourChannel inputStream:handleEvent:] -[UDBonjourChannel nodeId] -[UDBonjourChannel remoteNodeId] -[UDBonjourChannel priority] -[UDBonjourChannel channelId] -[UDBonjourChannel setChannelId:] -[UDBonjourChannel longTransferCount] -[UDBonjourChannel setLongTransferCount:] -[UDBonjourChannel delegate] -[UDBonjourChannel setDelegate:] -[UDBonjourChannel queue] -[UDBonjourChannel ioThread] -[UDBonjourChannel inputStream] -[UDBonjourChannel setInputStream:] -[UDBonjourChannel outputStream] -[UDBonjourChannel setOutputStream:] -[UDBonjourChannel .cxx_destruct] _OBJC_IVAR_$_UDBonjourChannel._delegate _OBJC_IVAR_$_UDBonjourChannel._ioThread _OBJC_IVAR_$_UDBonjourChannel._queue _OBJC_IVAR_$_UDBonjourChannel._isClient _OBJC_IVAR_$_UDBonjourChannel._nodeId _OBJC_IVAR_$_UDBonjourChannel._state _OBJC_IVAR_$_UDBonjourChannel._inputByteBuf _OBJC_IVAR_$_UDBonjourChannel._outputQueue _OBJC_IVAR_$_UDBonjourChannel._outputCanWriteToStream _OBJC_IVAR_$_UDBonjourChannel._inputStream _OBJC_IVAR_$_UDBonjourChannel._outputStream _OBJC_IVAR_$_UDBonjourChannel._reportCanSendMore _OBJC_IVAR_$_UDBonjourChannel._remoteNodeId _OBJC_IVAR_$_UDBonjourChannel._channelId _OBJC_IVAR_$_UDBonjourChannel._heartbeatTimer _OBJC_IVAR_$_UDBonjourChannel._timeoutTimer _OBJC_IVAR_$_UDBonjourChannel._heartbeatReceived _OBJC_IVAR_$_UDBonjourChannel._priority _OBJC_IVAR_$_UDBonjourChannel._outputItem _OBJC_IVAR_$_UDBonjourChannel._outputDataOffset ___block_descriptor_tmp.100 ___block_descriptor_tmp.110 ___block_descriptor_tmp.145 ___block_descriptor_tmp.193 ___block_descriptor_tmp.197 ___block_descriptor_tmp.211 ___block_descriptor_tmp.221 _OBJC_IVAR_$_UDBonjourChannel._inputBuffer _OBJC_IVAR_$_UDBonjourChannel._longTransferCount /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDBonjourChannel.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDBonjourChannel.h __38-[UDBonjourChannel processInputFrame:]_block_invoke.216 __38-[UDBonjourChannel processInputFrame:]_block_invoke.206 __38-[UDBonjourChannel processInputFrame:]_block_invoke.194 __38-[UDBonjourChannel processInputFrame:]_block_invoke __34-[UDBonjourChannel writeNextBytes]_block_invoke __41-[UDBonjourChannel sendLongTransferLock:]_block_invoke __32-[UDBonjourChannel onTerminated]_block_invoke __32-[UDBonjourChannel closeStreams]_block_invoke -[UDRunLoopThread init] -[UDRunLoopThread initWithName:] -[UDRunLoopThread dealloc] -[UDRunLoopThread cancel] -[UDRunLoopThread noop] -[UDRunLoopThread runLoop] -[UDRunLoopThread cfRunLoop] -[UDRunLoopThread main] -[UDRunLoopThread mainCoreFoundation] -[UDRunLoopThread mainCocoa] -[UDRunLoopThread coreFoundation] -[UDRunLoopThread setCoreFoundation:] -[UDRunLoopThread .cxx_destruct] _OBJC_IVAR_$_UDRunLoopThread._waitGroup _OBJC_IVAR_$_UDRunLoopThread._cfRunLoop _OBJC_IVAR_$_UDRunLoopThread._coreFoundation _OBJC_IVAR_$_UDRunLoopThread._runLoop /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDRunLoopThread.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDRunLoopThread.h +[FramesRoot extensionRegistry] +[FramesRoot initialize] +[FramesRoot registerAllExtensions:] -[Frame hasKind] -[Frame setHasKind:] -[Frame hasHello] -[Frame setHasHello:] -[Frame hasHeartbeat] -[Frame setHasHeartbeat:] -[Frame hasPayload] -[Frame setHasPayload:] -[Frame hasPorts] -[Frame setHasPorts:] -[Frame hasConnected] -[Frame setHasConnected:] -[Frame hasDisconnected] -[Frame setHasDisconnected:] -[Frame hasLongTransfer] -[Frame setHasLongTransfer:] -[Frame init] +[Frame initialize] +[Frame defaultInstance] -[Frame defaultInstance] -[Frame isInitialized] -[Frame writeToCodedOutputStream:] -[Frame serializedSize] +[Frame parseFromData:] +[Frame parseFromData:extensionRegistry:] +[Frame parseFromInputStream:] +[Frame parseFromInputStream:extensionRegistry:] +[Frame parseFromCodedInputStream:] +[Frame parseFromCodedInputStream:extensionRegistry:] +[Frame builder] +[Frame builderWithPrototype:] -[Frame builder] -[Frame toBuilder] -[Frame writeDescriptionTo:withIndent:] -[Frame storeInDictionary:] -[Frame isEqual:] -[Frame hash] -[Frame kind] -[Frame setKind:] -[Frame hello] -[Frame setHello:] -[Frame heartbeat] -[Frame setHeartbeat:] -[Frame payload] -[Frame setPayload:] -[Frame ports] -[Frame setPorts:] -[Frame connected] -[Frame setConnected:] -[Frame disconnected] -[Frame setDisconnected:] -[Frame longTransfer] -[Frame setLongTransfer:] -[Frame .cxx_destruct] -[FrameBuilder init] -[FrameBuilder internalGetResult] -[FrameBuilder clear] -[FrameBuilder clone] -[FrameBuilder defaultInstance] -[FrameBuilder build] -[FrameBuilder buildPartial] -[FrameBuilder mergeFrom:] -[FrameBuilder mergeFromCodedInputStream:] -[FrameBuilder mergeFromCodedInputStream:extensionRegistry:] -[FrameBuilder hasKind] -[FrameBuilder kind] -[FrameBuilder setKind:] -[FrameBuilder clearKind] -[FrameBuilder hasHello] -[FrameBuilder hello] -[FrameBuilder setHello:] -[FrameBuilder setHelloBuilder:] -[FrameBuilder mergeHello:] -[FrameBuilder clearHello] -[FrameBuilder hasHeartbeat] -[FrameBuilder heartbeat] -[FrameBuilder setHeartbeat:] -[FrameBuilder setHeartbeatBuilder:] -[FrameBuilder mergeHeartbeat:] -[FrameBuilder clearHeartbeat] -[FrameBuilder hasPayload] -[FrameBuilder payload] -[FrameBuilder setPayload:] -[FrameBuilder setPayloadBuilder:] -[FrameBuilder mergePayload:] -[FrameBuilder clearPayload] -[FrameBuilder hasPorts] -[FrameBuilder ports] -[FrameBuilder setPorts:] -[FrameBuilder setPortsBuilder:] -[FrameBuilder mergePorts:] -[FrameBuilder clearPorts] -[FrameBuilder hasConnected] -[FrameBuilder connected] -[FrameBuilder setConnected:] -[FrameBuilder setConnectedBuilder:] -[FrameBuilder mergeConnected:] -[FrameBuilder clearConnected] -[FrameBuilder hasDisconnected] -[FrameBuilder disconnected] -[FrameBuilder setDisconnected:] -[FrameBuilder setDisconnectedBuilder:] -[FrameBuilder mergeDisconnected:] -[FrameBuilder clearDisconnected] -[FrameBuilder hasLongTransfer] -[FrameBuilder longTransfer] -[FrameBuilder setLongTransfer:] -[FrameBuilder setLongTransferBuilder:] -[FrameBuilder mergeLongTransfer:] -[FrameBuilder clearLongTransfer] -[FrameBuilder resultFrame] -[FrameBuilder setResultFrame:] -[FrameBuilder .cxx_destruct] -[Peer hasAddress] -[Peer setHasAddress:] -[Peer hasLegacy] -[Peer setHasLegacy:] -[Peer legacy] -[Peer setLegacy:] -[Peer init] +[Peer initialize] +[Peer defaultInstance] -[Peer defaultInstance] -[Peer ports] -[Peer portsAtIndex:] -[Peer isInitialized] -[Peer writeToCodedOutputStream:] -[Peer serializedSize] +[Peer parseFromData:] +[Peer parseFromData:extensionRegistry:] +[Peer parseFromInputStream:] +[Peer parseFromInputStream:extensionRegistry:] +[Peer parseFromCodedInputStream:] +[Peer parseFromCodedInputStream:extensionRegistry:] +[Peer builder] +[Peer builderWithPrototype:] -[Peer builder] -[Peer toBuilder] -[Peer writeDescriptionTo:withIndent:] ___38-[Peer writeDescriptionTo:withIndent:]_block_invoke -[Peer storeInDictionary:] -[Peer isEqual:] -[Peer hash] ___12-[Peer hash]_block_invoke ___copy_helper_block_.397 ___destroy_helper_block_.398 -[Peer address] -[Peer setAddress:] -[Peer portsArray] -[Peer setPortsArray:] -[Peer .cxx_destruct] -[PeerBuilder init] -[PeerBuilder internalGetResult] -[PeerBuilder clear] -[PeerBuilder clone] -[PeerBuilder defaultInstance] -[PeerBuilder build] -[PeerBuilder buildPartial] -[PeerBuilder mergeFrom:] -[PeerBuilder mergeFromCodedInputStream:] -[PeerBuilder mergeFromCodedInputStream:extensionRegistry:] -[PeerBuilder hasAddress] -[PeerBuilder address] -[PeerBuilder setAddress:] -[PeerBuilder clearAddress] -[PeerBuilder hasLegacy] -[PeerBuilder legacy] -[PeerBuilder setLegacy:] -[PeerBuilder clearLegacy] -[PeerBuilder ports] -[PeerBuilder portsAtIndex:] -[PeerBuilder addPorts:] -[PeerBuilder setPortsArray:] -[PeerBuilder setPortsValues:count:] -[PeerBuilder clearPorts] -[PeerBuilder resultPeer] -[PeerBuilder setResultPeer:] -[PeerBuilder .cxx_destruct] -[HelloFrame hasNodeId] -[HelloFrame setHasNodeId:] -[HelloFrame hasPeer] -[HelloFrame setHasPeer:] -[HelloFrame init] +[HelloFrame initialize] +[HelloFrame defaultInstance] -[HelloFrame defaultInstance] -[HelloFrame isInitialized] -[HelloFrame writeToCodedOutputStream:] -[HelloFrame serializedSize] +[HelloFrame parseFromData:] +[HelloFrame parseFromData:extensionRegistry:] +[HelloFrame parseFromInputStream:] +[HelloFrame parseFromInputStream:extensionRegistry:] +[HelloFrame parseFromCodedInputStream:] +[HelloFrame parseFromCodedInputStream:extensionRegistry:] +[HelloFrame builder] +[HelloFrame builderWithPrototype:] -[HelloFrame builder] -[HelloFrame toBuilder] -[HelloFrame writeDescriptionTo:withIndent:] -[HelloFrame storeInDictionary:] -[HelloFrame isEqual:] -[HelloFrame hash] -[HelloFrame nodeId] -[HelloFrame setNodeId:] -[HelloFrame peer] -[HelloFrame setPeer:] -[HelloFrame .cxx_destruct] -[HelloFrameBuilder init] -[HelloFrameBuilder internalGetResult] -[HelloFrameBuilder clear] -[HelloFrameBuilder clone] -[HelloFrameBuilder defaultInstance] -[HelloFrameBuilder build] -[HelloFrameBuilder buildPartial] -[HelloFrameBuilder mergeFrom:] -[HelloFrameBuilder mergeFromCodedInputStream:] -[HelloFrameBuilder mergeFromCodedInputStream:extensionRegistry:] -[HelloFrameBuilder hasNodeId] -[HelloFrameBuilder nodeId] -[HelloFrameBuilder setNodeId:] -[HelloFrameBuilder clearNodeId] -[HelloFrameBuilder hasPeer] -[HelloFrameBuilder peer] -[HelloFrameBuilder setPeer:] -[HelloFrameBuilder setPeerBuilder:] -[HelloFrameBuilder mergePeer:] -[HelloFrameBuilder clearPeer] -[HelloFrameBuilder resultHelloFrame] -[HelloFrameBuilder setResultHelloFrame:] -[HelloFrameBuilder .cxx_destruct] -[HeartbeatFrame init] +[HeartbeatFrame initialize] +[HeartbeatFrame defaultInstance] -[HeartbeatFrame defaultInstance] -[HeartbeatFrame isInitialized] -[HeartbeatFrame writeToCodedOutputStream:] -[HeartbeatFrame serializedSize] +[HeartbeatFrame parseFromData:] +[HeartbeatFrame parseFromData:extensionRegistry:] +[HeartbeatFrame parseFromInputStream:] +[HeartbeatFrame parseFromInputStream:extensionRegistry:] +[HeartbeatFrame parseFromCodedInputStream:] +[HeartbeatFrame parseFromCodedInputStream:extensionRegistry:] +[HeartbeatFrame builder] +[HeartbeatFrame builderWithPrototype:] -[HeartbeatFrame builder] -[HeartbeatFrame toBuilder] -[HeartbeatFrame writeDescriptionTo:withIndent:] -[HeartbeatFrame storeInDictionary:] -[HeartbeatFrame isEqual:] -[HeartbeatFrame hash] -[HeartbeatFrameBuilder init] -[HeartbeatFrameBuilder internalGetResult] -[HeartbeatFrameBuilder clear] -[HeartbeatFrameBuilder clone] -[HeartbeatFrameBuilder defaultInstance] -[HeartbeatFrameBuilder build] -[HeartbeatFrameBuilder buildPartial] -[HeartbeatFrameBuilder mergeFrom:] -[HeartbeatFrameBuilder mergeFromCodedInputStream:] -[HeartbeatFrameBuilder mergeFromCodedInputStream:extensionRegistry:] -[HeartbeatFrameBuilder resultHeartbeatFrame] -[HeartbeatFrameBuilder setResultHeartbeatFrame:] -[HeartbeatFrameBuilder .cxx_destruct] -[PayloadFrame hasPayload] -[PayloadFrame setHasPayload:] -[PayloadFrame init] +[PayloadFrame initialize] +[PayloadFrame defaultInstance] -[PayloadFrame defaultInstance] -[PayloadFrame isInitialized] -[PayloadFrame writeToCodedOutputStream:] -[PayloadFrame serializedSize] +[PayloadFrame parseFromData:] +[PayloadFrame parseFromData:extensionRegistry:] +[PayloadFrame parseFromInputStream:] +[PayloadFrame parseFromInputStream:extensionRegistry:] +[PayloadFrame parseFromCodedInputStream:] +[PayloadFrame parseFromCodedInputStream:extensionRegistry:] +[PayloadFrame builder] +[PayloadFrame builderWithPrototype:] -[PayloadFrame builder] -[PayloadFrame toBuilder] -[PayloadFrame writeDescriptionTo:withIndent:] -[PayloadFrame storeInDictionary:] -[PayloadFrame isEqual:] -[PayloadFrame hash] -[PayloadFrame payload] -[PayloadFrame setPayload:] -[PayloadFrame .cxx_destruct] -[PayloadFrameBuilder init] -[PayloadFrameBuilder internalGetResult] -[PayloadFrameBuilder clear] -[PayloadFrameBuilder clone] -[PayloadFrameBuilder defaultInstance] -[PayloadFrameBuilder build] -[PayloadFrameBuilder buildPartial] -[PayloadFrameBuilder mergeFrom:] -[PayloadFrameBuilder mergeFromCodedInputStream:] -[PayloadFrameBuilder mergeFromCodedInputStream:extensionRegistry:] -[PayloadFrameBuilder hasPayload] -[PayloadFrameBuilder payload] -[PayloadFrameBuilder setPayload:] -[PayloadFrameBuilder clearPayload] -[PayloadFrameBuilder resultPayloadFrame] -[PayloadFrameBuilder setResultPayloadFrame:] -[PayloadFrameBuilder .cxx_destruct] -[PortsFrame hasAddress] -[PortsFrame setHasAddress:] -[PortsFrame init] +[PortsFrame initialize] +[PortsFrame defaultInstance] -[PortsFrame defaultInstance] -[PortsFrame ports] -[PortsFrame portsAtIndex:] -[PortsFrame isInitialized] -[PortsFrame writeToCodedOutputStream:] -[PortsFrame serializedSize] +[PortsFrame parseFromData:] +[PortsFrame parseFromData:extensionRegistry:] +[PortsFrame parseFromInputStream:] +[PortsFrame parseFromInputStream:extensionRegistry:] +[PortsFrame parseFromCodedInputStream:] +[PortsFrame parseFromCodedInputStream:extensionRegistry:] +[PortsFrame builder] +[PortsFrame builderWithPrototype:] -[PortsFrame builder] -[PortsFrame toBuilder] -[PortsFrame writeDescriptionTo:withIndent:] ___44-[PortsFrame writeDescriptionTo:withIndent:]_block_invoke ___copy_helper_block_.538 ___destroy_helper_block_.539 -[PortsFrame storeInDictionary:] -[PortsFrame isEqual:] -[PortsFrame hash] ___18-[PortsFrame hash]_block_invoke ___copy_helper_block_.541 ___destroy_helper_block_.542 -[PortsFrame address] -[PortsFrame setAddress:] -[PortsFrame portsArray] -[PortsFrame setPortsArray:] -[PortsFrame .cxx_destruct] -[PortsFrameBuilder init] -[PortsFrameBuilder internalGetResult] -[PortsFrameBuilder clear] -[PortsFrameBuilder clone] -[PortsFrameBuilder defaultInstance] -[PortsFrameBuilder build] -[PortsFrameBuilder buildPartial] -[PortsFrameBuilder mergeFrom:] -[PortsFrameBuilder mergeFromCodedInputStream:] -[PortsFrameBuilder mergeFromCodedInputStream:extensionRegistry:] -[PortsFrameBuilder hasAddress] -[PortsFrameBuilder address] -[PortsFrameBuilder setAddress:] -[PortsFrameBuilder clearAddress] -[PortsFrameBuilder ports] -[PortsFrameBuilder portsAtIndex:] -[PortsFrameBuilder addPorts:] -[PortsFrameBuilder setPortsArray:] -[PortsFrameBuilder setPortsValues:count:] -[PortsFrameBuilder clearPorts] -[PortsFrameBuilder resultPortsFrame] -[PortsFrameBuilder setResultPortsFrame:] -[PortsFrameBuilder .cxx_destruct] -[ConnectedFrame hasPeer] -[ConnectedFrame setHasPeer:] -[ConnectedFrame init] +[ConnectedFrame initialize] +[ConnectedFrame defaultInstance] -[ConnectedFrame defaultInstance] -[ConnectedFrame isInitialized] -[ConnectedFrame writeToCodedOutputStream:] -[ConnectedFrame serializedSize] +[ConnectedFrame parseFromData:] +[ConnectedFrame parseFromData:extensionRegistry:] +[ConnectedFrame parseFromInputStream:] +[ConnectedFrame parseFromInputStream:extensionRegistry:] +[ConnectedFrame parseFromCodedInputStream:] +[ConnectedFrame parseFromCodedInputStream:extensionRegistry:] +[ConnectedFrame builder] +[ConnectedFrame builderWithPrototype:] -[ConnectedFrame builder] -[ConnectedFrame toBuilder] -[ConnectedFrame writeDescriptionTo:withIndent:] -[ConnectedFrame storeInDictionary:] -[ConnectedFrame isEqual:] -[ConnectedFrame hash] -[ConnectedFrame peer] -[ConnectedFrame setPeer:] -[ConnectedFrame .cxx_destruct] -[ConnectedFrameBuilder init] -[ConnectedFrameBuilder internalGetResult] -[ConnectedFrameBuilder clear] -[ConnectedFrameBuilder clone] -[ConnectedFrameBuilder defaultInstance] -[ConnectedFrameBuilder build] -[ConnectedFrameBuilder buildPartial] -[ConnectedFrameBuilder mergeFrom:] -[ConnectedFrameBuilder mergeFromCodedInputStream:] -[ConnectedFrameBuilder mergeFromCodedInputStream:extensionRegistry:] -[ConnectedFrameBuilder hasPeer] -[ConnectedFrameBuilder peer] -[ConnectedFrameBuilder setPeer:] -[ConnectedFrameBuilder setPeerBuilder:] -[ConnectedFrameBuilder mergePeer:] -[ConnectedFrameBuilder clearPeer] -[ConnectedFrameBuilder resultConnectedFrame] -[ConnectedFrameBuilder setResultConnectedFrame:] -[ConnectedFrameBuilder .cxx_destruct] -[DisconnectedFrame hasAddress] -[DisconnectedFrame setHasAddress:] -[DisconnectedFrame init] +[DisconnectedFrame initialize] +[DisconnectedFrame defaultInstance] -[DisconnectedFrame defaultInstance] -[DisconnectedFrame isInitialized] -[DisconnectedFrame writeToCodedOutputStream:] -[DisconnectedFrame serializedSize] +[DisconnectedFrame parseFromData:] +[DisconnectedFrame parseFromData:extensionRegistry:] +[DisconnectedFrame parseFromInputStream:] +[DisconnectedFrame parseFromInputStream:extensionRegistry:] +[DisconnectedFrame parseFromCodedInputStream:] +[DisconnectedFrame parseFromCodedInputStream:extensionRegistry:] +[DisconnectedFrame builder] +[DisconnectedFrame builderWithPrototype:] -[DisconnectedFrame builder] -[DisconnectedFrame toBuilder] -[DisconnectedFrame writeDescriptionTo:withIndent:] -[DisconnectedFrame storeInDictionary:] -[DisconnectedFrame isEqual:] -[DisconnectedFrame hash] -[DisconnectedFrame address] -[DisconnectedFrame setAddress:] -[DisconnectedFrame .cxx_destruct] -[DisconnectedFrameBuilder init] -[DisconnectedFrameBuilder internalGetResult] -[DisconnectedFrameBuilder clear] -[DisconnectedFrameBuilder clone] -[DisconnectedFrameBuilder defaultInstance] -[DisconnectedFrameBuilder build] -[DisconnectedFrameBuilder buildPartial] -[DisconnectedFrameBuilder mergeFrom:] -[DisconnectedFrameBuilder mergeFromCodedInputStream:] -[DisconnectedFrameBuilder mergeFromCodedInputStream:extensionRegistry:] -[DisconnectedFrameBuilder hasAddress] -[DisconnectedFrameBuilder address] -[DisconnectedFrameBuilder setAddress:] -[DisconnectedFrameBuilder clearAddress] -[DisconnectedFrameBuilder resultDisconnectedFrame] -[DisconnectedFrameBuilder setResultDisconnectedFrame:] -[DisconnectedFrameBuilder .cxx_destruct] -[LongTransferFrame hasLock] -[LongTransferFrame setHasLock:] -[LongTransferFrame lock] -[LongTransferFrame setLock:] -[LongTransferFrame init] +[LongTransferFrame initialize] +[LongTransferFrame defaultInstance] -[LongTransferFrame defaultInstance] -[LongTransferFrame isInitialized] -[LongTransferFrame writeToCodedOutputStream:] -[LongTransferFrame serializedSize] +[LongTransferFrame parseFromData:] +[LongTransferFrame parseFromData:extensionRegistry:] +[LongTransferFrame parseFromInputStream:] +[LongTransferFrame parseFromInputStream:extensionRegistry:] +[LongTransferFrame parseFromCodedInputStream:] +[LongTransferFrame parseFromCodedInputStream:extensionRegistry:] +[LongTransferFrame builder] +[LongTransferFrame builderWithPrototype:] -[LongTransferFrame builder] -[LongTransferFrame toBuilder] -[LongTransferFrame writeDescriptionTo:withIndent:] -[LongTransferFrame storeInDictionary:] -[LongTransferFrame isEqual:] -[LongTransferFrame hash] -[LongTransferFrameBuilder init] -[LongTransferFrameBuilder internalGetResult] -[LongTransferFrameBuilder clear] -[LongTransferFrameBuilder clone] -[LongTransferFrameBuilder defaultInstance] -[LongTransferFrameBuilder build] -[LongTransferFrameBuilder buildPartial] -[LongTransferFrameBuilder mergeFrom:] -[LongTransferFrameBuilder mergeFromCodedInputStream:] -[LongTransferFrameBuilder mergeFromCodedInputStream:extensionRegistry:] -[LongTransferFrameBuilder hasLock] -[LongTransferFrameBuilder lock] -[LongTransferFrameBuilder setLock:] -[LongTransferFrameBuilder clearLock] -[LongTransferFrameBuilder resultLongTransferFrame] -[LongTransferFrameBuilder setResultLongTransferFrame:] -[LongTransferFrameBuilder .cxx_destruct] _extensionRegistry _OBJC_IVAR_$_Frame.hasKind_ _OBJC_IVAR_$_Frame.hasHello_ _OBJC_IVAR_$_Frame.hasHeartbeat_ _OBJC_IVAR_$_Frame.hasPayload_ _OBJC_IVAR_$_Frame.hasPorts_ _OBJC_IVAR_$_Frame.hasConnected_ _OBJC_IVAR_$_Frame.hasDisconnected_ _OBJC_IVAR_$_Frame.hasLongTransfer_ _defaultFrameInstance _OBJC_IVAR_$_Frame.kind _OBJC_IVAR_$_Frame.hello _OBJC_IVAR_$_Frame.heartbeat _OBJC_IVAR_$_Frame.payload _OBJC_IVAR_$_Frame.ports _OBJC_IVAR_$_Frame.connected _OBJC_IVAR_$_Frame.disconnected _OBJC_IVAR_$_Frame.longTransfer l_OBJC_PROTOCOL_$_PBMessage l_OBJC_LABEL_PROTOCOL_$_PBMessage l_OBJC_PROTOCOL_$_GeneratedMessageProtocol l_OBJC_LABEL_PROTOCOL_$_GeneratedMessageProtocol _OBJC_IVAR_$_FrameBuilder.resultFrame _OBJC_IVAR_$_Peer.hasAddress_ _OBJC_IVAR_$_Peer.hasLegacy_ _OBJC_IVAR_$_Peer.legacy_ _defaultPeerInstance _OBJC_IVAR_$_Peer.portsArray ___block_descriptor_tmp.400 _OBJC_IVAR_$_Peer.address _OBJC_IVAR_$_PeerBuilder.resultPeer _OBJC_IVAR_$_HelloFrame.hasNodeId_ _OBJC_IVAR_$_HelloFrame.hasPeer_ _defaultHelloFrameInstance _OBJC_IVAR_$_HelloFrame.nodeId _OBJC_IVAR_$_HelloFrame.peer _OBJC_IVAR_$_HelloFrameBuilder.resultHelloFrame _defaultHeartbeatFrameInstance _OBJC_IVAR_$_HeartbeatFrameBuilder.resultHeartbeatFrame _OBJC_IVAR_$_PayloadFrame.hasPayload_ _defaultPayloadFrameInstance _OBJC_IVAR_$_PayloadFrame.payload _OBJC_IVAR_$_PayloadFrameBuilder.resultPayloadFrame _OBJC_IVAR_$_PortsFrame.hasAddress_ _defaultPortsFrameInstance _OBJC_IVAR_$_PortsFrame.portsArray ___block_descriptor_tmp.540 ___block_descriptor_tmp.543 _OBJC_IVAR_$_PortsFrame.address _OBJC_IVAR_$_PortsFrameBuilder.resultPortsFrame _OBJC_IVAR_$_ConnectedFrame.hasPeer_ _defaultConnectedFrameInstance _OBJC_IVAR_$_ConnectedFrame.peer _OBJC_IVAR_$_ConnectedFrameBuilder.resultConnectedFrame _OBJC_IVAR_$_DisconnectedFrame.hasAddress_ _defaultDisconnectedFrameInstance _OBJC_IVAR_$_DisconnectedFrame.address _OBJC_IVAR_$_DisconnectedFrameBuilder.resultDisconnectedFrame _OBJC_IVAR_$_LongTransferFrame.hasLock_ _OBJC_IVAR_$_LongTransferFrame.lock_ _defaultLongTransferFrameInstance _OBJC_IVAR_$_LongTransferFrameBuilder.resultLongTransferFrame /Users/virl/Projects/underdark/underdark-cocoa/Underdark/Frames.pb.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/Frames.pb.h __18-[PortsFrame hash]_block_invoke __44-[PortsFrame writeDescriptionTo:withIndent:]_block_invoke __12-[Peer hash]_block_invoke __38-[Peer writeDescriptionTo:withIndent:]_block_invoke FrameKindIsValidValue NSStringFromFrameKind -[UDFutureImpl init] -[UDFutureImpl dealloc] -[UDFutureImpl listen:block:] -[UDFutureImpl internal_succeed:] -[UDFutureImpl internal_fail:] -[UDFutureImpl .cxx_destruct] _OBJC_IVAR_$_UDFutureImpl._lock _OBJC_IVAR_$_UDFutureImpl._state _OBJC_IVAR_$_UDFutureImpl._listeners _OBJC_IVAR_$_UDFutureImpl._result _OBJC_IVAR_$_UDFutureImpl._error /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDFutureImpl.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDLogging.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDConfig.m -[UDNsdService initWithDelegate:thread:] -[UDNsdService cancelResolve] -[UDNsdService resolve] _UDServiceResolveReply _UDServiceFileDescriptorCallBack -[UDNsdService peerToPeer] -[UDNsdService setPeerToPeer:] -[UDNsdService flags] -[UDNsdService setFlags:] -[UDNsdService interfaceIndex] -[UDNsdService setInterfaceIndex:] -[UDNsdService name] -[UDNsdService setName:] -[UDNsdService regtype] -[UDNsdService setRegtype:] -[UDNsdService domain] -[UDNsdService setDomain:] -[UDNsdService host] -[UDNsdService address] -[UDNsdService port] -[UDNsdService delegate] -[UDNsdService thread] -[UDNsdService .cxx_destruct] _UDServiceGetAddrInfoReply _UDResolveRunLoopTimerCallBack _OBJC_IVAR_$_UDNsdService._delegate _OBJC_IVAR_$_UDNsdService._thread _OBJC_IVAR_$_UDNsdService._fd _OBJC_IVAR_$_UDNsdService._source _OBJC_IVAR_$_UDNsdService._resolveRef _OBJC_IVAR_$_UDNsdService._flags _OBJC_IVAR_$_UDNsdService._interfaceIndex _OBJC_IVAR_$_UDNsdService._name _OBJC_IVAR_$_UDNsdService._regtype _OBJC_IVAR_$_UDNsdService._domain _OBJC_IVAR_$_UDNsdService._peerToPeer _OBJC_IVAR_$_UDNsdService._host _OBJC_IVAR_$_UDNsdService._address _OBJC_IVAR_$_UDNsdService._port _OBJC_IVAR_$_UDNsdService._queryingName /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDNsdService.m UDResolveRunLoopTimerCallBack UDServiceGetAddrInfoReply /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDNsdService.h UDServiceFileDescriptorCallBack UDServiceResolveReply _OSSwapInt16 -[UDFutureSource init] -[UDFutureSource dealloc] -[UDFutureSource future] -[UDFutureSource succeed:] -[UDFutureSource fail:] -[UDFutureSource .cxx_destruct] _OBJC_IVAR_$_UDFutureSource._future /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDFutureSource.m -[UDAggTransport initWithAppId:nodeId:queue:] -[UDAggTransport addAdapter:] -[UDAggTransport start] ___23-[UDAggTransport start]_block_invoke -[UDAggTransport stop] ___22-[UDAggTransport stop]_block_invoke ___copy_helper_block_.31 ___destroy_helper_block_.32 -[UDAggTransport adapterAppWatcher:] -[UDAggTransport adapter:shouldConnectChannelId:] -[UDAggTransport adapter:channelConnected:] ___43-[UDAggTransport adapter:channelConnected:]_block_invoke ___copy_helper_block_.52 ___destroy_helper_block_.53 -[UDAggTransport adapter:channelDisconnected:] ___46-[UDAggTransport adapter:channelDisconnected:]_block_invoke ___copy_helper_block_.63 ___destroy_helper_block_.64 -[UDAggTransport adapter:channelCanSendMore:] -[UDAggTransport adapter:channel:didReceiveFrame:] ___50-[UDAggTransport adapter:channel:didReceiveFrame:]_block_invoke ___copy_helper_block_.70 ___destroy_helper_block_.71 -[UDAggTransport delegate] -[UDAggTransport setDelegate:] -[UDAggTransport queue] -[UDAggTransport ioqueue] -[UDAggTransport nodeId] -[UDAggTransport cache] -[UDAggTransport .cxx_destruct] _OBJC_IVAR_$_UDAggTransport._appId _OBJC_IVAR_$_UDAggTransport._nodeId _OBJC_IVAR_$_UDAggTransport._queue _OBJC_IVAR_$_UDAggTransport._ioqueue _OBJC_IVAR_$_UDAggTransport._adapters _OBJC_IVAR_$_UDAggTransport._links _OBJC_IVAR_$_UDAggTransport._cache _OBJC_IVAR_$_UDAggTransport._appWatcher _OBJC_IVAR_$_UDAggTransport._running ___block_descriptor_tmp.33 _OBJC_IVAR_$_UDAggTransport._delegate ___block_descriptor_tmp.54 ___block_descriptor_tmp.65 ___block_descriptor_tmp.72 l_OBJC_PROTOCOL_$_UDTransport l_OBJC_LABEL_PROTOCOL_$_UDTransport l_OBJC_PROTOCOL_$_UDAdapterDelegate l_OBJC_LABEL_PROTOCOL_$_UDAdapterDelegate /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDAggTransport.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDAggTransport.h __50-[UDAggTransport adapter:channel:didReceiveFrame:]_block_invoke __46-[UDAggTransport adapter:channelDisconnected:]_block_invoke __43-[UDAggTransport adapter:channelConnected:]_block_invoke __22-[UDAggTransport stop]_block_invoke __23-[UDAggTransport start]_block_invoke ___sldispatch_async_block_invoke /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDAsyncUtils.m __sldispatch_async_block_invoke sldispatch_async -[UDBonjourAdapter init] -[UDBonjourAdapter initWithAppId:nodeId:delegate:queue:peerToPeer:] -[UDBonjourAdapter dealloc] -[UDBonjourAdapter start] -[UDBonjourAdapter stop] -[UDBonjourAdapter longTransferLock] -[UDBonjourAdapter longTransferUnlock] -[UDBonjourAdapter applicationDidWakeUp] ___40-[UDBonjourAdapter applicationDidWakeUp]_block_invoke -[UDBonjourAdapter applicationWillSuspend] ___42-[UDBonjourAdapter applicationWillSuspend]_block_invoke -[UDBonjourAdapter wifiDidChangeState:] ___39-[UDBonjourAdapter wifiDidChangeState:]_block_invoke -[UDBonjourAdapter bluetoothDidChangeState:] ___44-[UDBonjourAdapter bluetoothDidChangeState:]_block_invoke ___copy_helper_block_.67 ___destroy_helper_block_.68 -[UDBonjourAdapter shouldConnectToAddress:] -[UDBonjourAdapter shouldAdvertise] -[UDBonjourAdapter browserDidFail:] -[UDBonjourAdapter browser:foundResult:] -[UDBonjourAdapter advertiserDidFail:] -[UDBonjourAdapter advertiser:didAcceptClient:] -[UDBonjourAdapter priorityForChannel:] -[UDBonjourAdapter channelConnecting:] -[UDBonjourAdapter channelConnected:] -[UDBonjourAdapter channelDisconnected:] -[UDBonjourAdapter channelTerminated:] -[UDBonjourAdapter channelCanSendMore:] -[UDBonjourAdapter channel:sentLongTransferFrame:] -[UDBonjourAdapter channel:receivedLongTransferFrame:] -[UDBonjourAdapter channel:receivedFrame:] -[UDBonjourAdapter appId] -[UDBonjourAdapter nodeId] -[UDBonjourAdapter priority] -[UDBonjourAdapter queue] -[UDBonjourAdapter ioThread] -[UDBonjourAdapter peerToPeer] -[UDBonjourAdapter .cxx_destruct] _OBJC_IVAR_$_UDBonjourAdapter._peerToPeer _OBJC_IVAR_$_UDBonjourAdapter._appId _OBJC_IVAR_$_UDBonjourAdapter._nodeId _OBJC_IVAR_$_UDBonjourAdapter._delegate _OBJC_IVAR_$_UDBonjourAdapter._queue _OBJC_IVAR_$_UDBonjourAdapter._channelsConnecting _OBJC_IVAR_$_UDBonjourAdapter._channels _OBJC_IVAR_$_UDBonjourAdapter._channelsTerminating _OBJC_IVAR_$_UDBonjourAdapter._ioThread _OBJC_IVAR_$_UDBonjourAdapter._priority _OBJC_IVAR_$_UDBonjourAdapter._browser _OBJC_IVAR_$_UDBonjourAdapter._advertiser _OBJC_IVAR_$_UDBonjourAdapter._running _OBJC_IVAR_$_UDBonjourAdapter._awake _OBJC_IVAR_$_UDBonjourAdapter._longTransferCount _OBJC_IVAR_$_UDBonjourAdapter._reachable ___block_descriptor_tmp.66 ___block_descriptor_tmp.69 l_OBJC_PROTOCOL_$_UDAppWatcherDelegate l_OBJC_LABEL_PROTOCOL_$_UDAppWatcherDelegate l_OBJC_PROTOCOL_$_UDBonjourBrowserDelegate l_OBJC_LABEL_PROTOCOL_$_UDBonjourBrowserDelegate l_OBJC_PROTOCOL_$_UDBonjourAdvertiserDelegate l_OBJC_LABEL_PROTOCOL_$_UDBonjourAdvertiserDelegate l_OBJC_PROTOCOL_$_UDBonjourChannelDelegate l_OBJC_LABEL_PROTOCOL_$_UDBonjourChannelDelegate l_OBJC_PROTOCOL_$_UDAdapter l_OBJC_LABEL_PROTOCOL_$_UDAdapter /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDBonjourAdapter.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDBonjourAdapter.h __44-[UDBonjourAdapter bluetoothDidChangeState:]_block_invoke __39-[UDBonjourAdapter wifiDidChangeState:]_block_invoke __42-[UDBonjourAdapter applicationWillSuspend]_block_invoke __40-[UDBonjourAdapter applicationDidWakeUp]_block_invoke -[UDNsdBrowser init] -[UDNsdBrowser initWithDelegate:service:queue:] -[UDNsdBrowser dealloc] -[UDNsdBrowser start] ___21-[UDNsdBrowser start]_block_invoke -[UDNsdBrowser stop] ___20-[UDNsdBrowser stop]_block_invoke ___copy_helper_block_.25 ___destroy_helper_block_.26 -[UDNsdBrowser startImpl] _UDServiceBrowseReply _UDFileDescriptorCallBack -[UDNsdBrowser stopImpl] -[UDNsdBrowser reconfirmRecord:interface:] -[UDNsdBrowser serviceDidResolve:] ___34-[UDNsdBrowser serviceDidResolve:]_block_invoke ___copy_helper_block_.110 ___destroy_helper_block_.111 -[UDNsdBrowser serviceDidNotResolve:] -[UDNsdBrowser peerToPeer] -[UDNsdBrowser setPeerToPeer:] -[UDNsdBrowser running] -[UDNsdBrowser delegate] -[UDNsdBrowser queue] -[UDNsdBrowser .cxx_destruct] _OBJC_IVAR_$_UDNsdBrowser._delegate _OBJC_IVAR_$_UDNsdBrowser._serviceType _OBJC_IVAR_$_UDNsdBrowser._queue _OBJC_IVAR_$_UDNsdBrowser._services _OBJC_IVAR_$_UDNsdBrowser._thread ___block_descriptor_tmp.27 _OBJC_IVAR_$_UDNsdBrowser._running _OBJC_IVAR_$_UDNsdBrowser._browseRef _OBJC_IVAR_$_UDNsdBrowser._peerToPeer _OBJC_IVAR_$_UDNsdBrowser._browseFd _OBJC_IVAR_$_UDNsdBrowser._browseSource ___block_descriptor_tmp.112 l_OBJC_PROTOCOL_$_UDNsdServiceDelegate l_OBJC_LABEL_PROTOCOL_$_UDNsdServiceDelegate /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDNsdBrowser.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDNsdBrowser.h __34-[UDNsdBrowser serviceDidResolve:]_block_invoke UDFileDescriptorCallBack UDServiceBrowseReply __20-[UDNsdBrowser stop]_block_invoke __21-[UDNsdBrowser start]_block_invoke -[UDNsdAdvertiser init] -[UDNsdAdvertiser initWithDelegate:service:name:queue:] -[UDNsdAdvertiser dealloc] -[UDNsdAdvertiser startWithPort:] _UDServiceRegisterReply -[UDNsdAdvertiser stop] -[UDNsdAdvertiser peerToPeer] -[UDNsdAdvertiser setPeerToPeer:] -[UDNsdAdvertiser delegate] -[UDNsdAdvertiser queue] -[UDNsdAdvertiser .cxx_destruct] _OBJC_IVAR_$_UDNsdAdvertiser._delegate _OBJC_IVAR_$_UDNsdAdvertiser._serviceType _OBJC_IVAR_$_UDNsdAdvertiser._serviceName _OBJC_IVAR_$_UDNsdAdvertiser._queue _OBJC_IVAR_$_UDNsdAdvertiser._running _OBJC_IVAR_$_UDNsdAdvertiser._sdref _OBJC_IVAR_$_UDNsdAdvertiser._peerToPeer /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDNsdAdvertiser.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDNsdAdvertiser.h UDServiceRegisterReply +[UDOutputItem ending] -[UDOutputItem init] -[UDOutputItem initWithData:] -[UDOutputItem dealloc] -[UDOutputItem isEnding] -[UDOutputItem markAsSent] -[UDOutputItem markAsDiscarded] -[UDOutputItem data] -[UDOutputItem internal] -[UDOutputItem setInternal:] -[UDOutputItem future] -[UDOutputItem setFuture:] -[UDOutputItem .cxx_destruct] _OBJC_IVAR_$_UDOutputItem._futureSource _OBJC_IVAR_$_UDOutputItem._future _OBJC_IVAR_$_UDOutputItem._data _OBJC_IVAR_$_UDOutputItem._internal /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDOutputItem.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDOutputItem.h -[UDNsdServer init] -[UDNsdServer initWithDelegate:nodeId:queue:] -[UDNsdServer dealloc] -[UDNsdServer startAccepting] _UDServerSocketCallBack -[UDNsdServer stopAccepting] -[UDNsdServer acceptCallback:address:handle:] -[UDNsdServer isLinkConnectedToNodeId:] -[UDNsdServer connectToHost:port:interface:] -[UDNsdServer linkConnecting:] -[UDNsdServer linkConnected:] -[UDNsdServer linkDisconnected:] ___32-[UDNsdServer linkDisconnected:]_block_invoke -[UDNsdServer linkTerminated:] -[UDNsdServer link:didReceiveFrame:] -[UDNsdServer nodeId] -[UDNsdServer port] -[UDNsdServer priority] -[UDNsdServer setPriority:] -[UDNsdServer queue] -[UDNsdServer ioThread] -[UDNsdServer delegate] -[UDNsdServer .cxx_destruct] ___UDServerSocketCallBack_block_invoke ___copy_helper_block_.141 ___destroy_helper_block_.142 _OBJC_IVAR_$_UDNsdServer._delegate _OBJC_IVAR_$_UDNsdServer._queue _OBJC_IVAR_$_UDNsdServer._nodeId _OBJC_IVAR_$_UDNsdServer._priority _OBJC_IVAR_$_UDNsdServer._links _OBJC_IVAR_$_UDNsdServer._linksConnecting _OBJC_IVAR_$_UDNsdServer._linksTerminating _OBJC_IVAR_$_UDNsdServer._acceptThread _OBJC_IVAR_$_UDNsdServer._ioThread _OBJC_IVAR_$_UDNsdServer._accepting _OBJC_IVAR_$_UDNsdServer._socket _OBJC_IVAR_$_UDNsdServer._port ___block_descriptor_tmp.143 /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDNsdServer.m __UDServerSocketCallBack_block_invoke /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDNsdServer.h __32-[UDNsdServer linkDisconnected:]_block_invoke UDServerSocketCallBack -[UDNsdAdapter init] -[UDNsdAdapter initWithDelegate:appId:nodeId:peerToPeer:queue:] -[UDNsdAdapter start] -[UDNsdAdapter stop] -[UDNsdAdapter longTransferLock] -[UDNsdAdapter longTransferUnlock] -[UDNsdAdapter applicationDidWakeUp] -[UDNsdAdapter applicationWillSuspend] -[UDNsdAdapter wifiDidChangeState:] -[UDNsdAdapter bluetoothDidChangeStae:] -[UDNsdAdapter serviceResolved:] -[UDNsdAdapter server:linkConnected:] -[UDNsdAdapter server:linkDisconnected:] -[UDNsdAdapter server:link:didReceiveFrame:] -[UDNsdAdapter queue] -[UDNsdAdapter delegate] -[UDNsdAdapter .cxx_destruct] _OBJC_IVAR_$_UDNsdAdapter._delegate _OBJC_IVAR_$_UDNsdAdapter._queue _OBJC_IVAR_$_UDNsdAdapter._nodeId _OBJC_IVAR_$_UDNsdAdapter._serviceType _OBJC_IVAR_$_UDNsdAdapter._server _OBJC_IVAR_$_UDNsdAdapter._advertiser _OBJC_IVAR_$_UDNsdAdapter._browser _OBJC_IVAR_$_UDNsdAdapter._running l_OBJC_PROTOCOL_$_UDNsdServerDelegate l_OBJC_LABEL_PROTOCOL_$_UDNsdServerDelegate l_OBJC_PROTOCOL_$_UDNsdBrowserDelegate l_OBJC_LABEL_PROTOCOL_$_UDNsdBrowserDelegate l_OBJC_PROTOCOL_$_UDNsdAdvertiserDelegate l_OBJC_LABEL_PROTOCOL_$_UDNsdAdvertiserDelegate /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDNsdAdapter.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDNsdAdapter.h -[UDDictKey init] -[UDDictKey initWithObject:] -[UDDictKey copyWithZone:] -[UDDictKey isEqual:] -[UDDictKey isEqualToKey:] -[UDDictKey hash] -[UDDictKey description] -[UDDictKey object] -[UDDictKey .cxx_destruct] _OBJC_IVAR_$_UDDictKey._object l_OBJC_PROTOCOL_$_NSCopying l_OBJC_LABEL_PROTOCOL_$_NSCopying /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDDictKey.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDDictKey.h -[UDWifiReach init] -[UDWifiReach initWithDelegate:queue:] -[UDWifiReach dealloc] -[UDWifiReach start] -[UDWifiReach stop] -[UDWifiReach applicationDidEnterBackground:] ___45-[UDWifiReach applicationDidEnterBackground:]_block_invoke -[UDWifiReach applicationDidBecomeActive:] ___42-[UDWifiReach applicationDidBecomeActive:]_block_invoke ___copy_helper_block_.17 ___destroy_helper_block_.18 ___42-[UDWifiReach applicationDidBecomeActive:]_block_invoke.20 ___copy_helper_block_.21 ___destroy_helper_block_.22 ___42-[UDWifiReach applicationDidBecomeActive:]_block_invoke.24 ___42-[UDWifiReach applicationDidBecomeActive:]_block_invoke.28 ___copy_helper_block_.29 ___destroy_helper_block_.30 ___42-[UDWifiReach applicationDidBecomeActive:]_block_invoke.32 ___copy_helper_block_.33 ___destroy_helper_block_.34 -[UDWifiReach isReachable] -[UDWifiReach refresh] -[UDWifiReach isWiFiEnabledOld] -[UDWifiReach isWiFiEnabled] -[UDWifiReach wifiDetails] -[UDWifiReach isWiFiConnected] -[UDWifiReach SSID] -[UDWifiReach BSSID] -[UDWifiReach .cxx_destruct] _OBJC_IVAR_$_UDWifiReach._delegate _OBJC_IVAR_$_UDWifiReach._queue _OBJC_IVAR_$_UDWifiReach._running _OBJC_IVAR_$_UDWifiReach._reachable _OBJC_IVAR_$_UDWifiReach._lastSSID ___block_descriptor_tmp.19 ___block_descriptor_tmp.23 ___block_descriptor_tmp.31 ___block_descriptor_tmp.35 l_OBJC_PROTOCOL_$_UDReach l_OBJC_LABEL_PROTOCOL_$_UDReach /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDWifiReach.m __42-[UDWifiReach applicationDidBecomeActive:]_block_invoke.32 __42-[UDWifiReach applicationDidBecomeActive:]_block_invoke.28 __42-[UDWifiReach applicationDidBecomeActive:]_block_invoke.24 __42-[UDWifiReach applicationDidBecomeActive:]_block_invoke.20 __42-[UDWifiReach applicationDidBecomeActive:]_block_invoke __45-[UDWifiReach applicationDidEnterBackground:]_block_invoke -[UDTimer initWithTimeInterval:target:selector:userInfo:repeats:dispatchQueue:] -[UDTimer init] +[UDTimer scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:dispatchQueue:] -[UDTimer dealloc] -[UDTimer description] -[UDTimer setTolerance:] -[UDTimer tolerance] -[UDTimer resetTimerProperties] -[UDTimer schedule] ___19-[UDTimer schedule]_block_invoke -[UDTimer fire] -[UDTimer invalidate] ___21-[UDTimer invalidate]_block_invoke ___copy_helper_block_.54 ___destroy_helper_block_.55 -[UDTimer timerFired] -[UDTimer timeInterval] -[UDTimer setTimeInterval:] -[UDTimer target] -[UDTimer setTarget:] -[UDTimer selector] -[UDTimer setSelector:] -[UDTimer userInfo] -[UDTimer setUserInfo:] -[UDTimer repeats] -[UDTimer setRepeats:] -[UDTimer privateSerialQueue] -[UDTimer setPrivateSerialQueue:] -[UDTimer timer] -[UDTimer setTimer:] -[UDTimer .cxx_destruct] _OBJC_IVAR_$_UDTimer._tolerance _OBJC_IVAR_$_UDTimer._timerFlags ___block_descriptor_tmp.56 _OBJC_IVAR_$_UDTimer._timeInterval _OBJC_IVAR_$_UDTimer._target _OBJC_IVAR_$_UDTimer._selector _OBJC_IVAR_$_UDTimer._userInfo _OBJC_IVAR_$_UDTimer._repeats _OBJC_IVAR_$_UDTimer._privateSerialQueue _OBJC_IVAR_$_UDTimer._timer /Users/virl/Projects/underdark/underdark-cocoa/Underdark/Public/UDTimer.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/Public/UDTimer.h __21-[UDTimer invalidate]_block_invoke __19-[UDTimer schedule]_block_invoke -[UDBtReach initWithDelegate:queue:] -[UDBtReach start] -[UDBtReach stop] -[UDBtReach isReachable] -[UDBtReach centralManagerDidUpdateState:] -[UDBtReach .cxx_destruct] _OBJC_IVAR_$_UDBtReach._delegate _OBJC_IVAR_$_UDBtReach._queue _OBJC_IVAR_$_UDBtReach._running _OBJC_IVAR_$_UDBtReach._manager _OBJC_IVAR_$_UDBtReach._reachable l_OBJC_PROTOCOL_$_CBCentralManagerDelegate l_OBJC_LABEL_PROTOCOL_$_CBCentralManagerDelegate /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDBtReach.m -[UDAppWatcher init] -[UDAppWatcher dealloc] -[UDAppWatcher addDelegate:] ___28-[UDAppWatcher addDelegate:]_block_invoke -[UDAppWatcher removeDelegate:] ___31-[UDAppWatcher removeDelegate:]_block_invoke ___copy_helper_block_.42 ___destroy_helper_block_.43 -[UDAppWatcher start] ___21-[UDAppWatcher start]_block_invoke ___copy_helper_block_.47 ___destroy_helper_block_.48 -[UDAppWatcher startImpl] -[UDAppWatcher stop] ___20-[UDAppWatcher stop]_block_invoke -[UDAppWatcher applicationWillSuspend:] -[UDAppWatcher applicationDidEnterBackground:] -[UDAppWatcher applicationWillEnterForeground:] -[UDAppWatcher applicationWillResignActive:] -[UDAppWatcher applicationDidBecomeActive:] -[UDAppWatcher reachUpdated:] -[UDAppWatcher applicationDidWakeUp] -[UDAppWatcher applicationWillSuspend] -[UDAppWatcher wifiDidChangeState:] -[UDAppWatcher bluetoothDidChangeState:] -[UDAppWatcher suspendLock] -[UDAppWatcher .cxx_destruct] _OBJC_IVAR_$_UDAppWatcher._delegates _OBJC_IVAR_$_UDAppWatcher._suspendLock _OBJC_IVAR_$_UDAppWatcher._reachBt _OBJC_IVAR_$_UDAppWatcher._reachWifi _OBJC_IVAR_$_UDAppWatcher._awake _OBJC_IVAR_$_UDAppWatcher._running ___block_descriptor_tmp.44 ___block_descriptor_tmp.49 l_OBJC_PROTOCOL_$_UDSuspendDelegate l_OBJC_LABEL_PROTOCOL_$_UDSuspendDelegate l_OBJC_PROTOCOL_$_UDReachDelegate l_OBJC_LABEL_PROTOCOL_$_UDReachDelegate /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDAppWatcher.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDAppWatcher.h __20-[UDAppWatcher stop]_block_invoke __21-[UDAppWatcher start]_block_invoke __31-[UDAppWatcher removeDelegate:]_block_invoke __28-[UDAppWatcher addDelegate:]_block_invoke +[UDBonjourUtil errorForCode:] +[UDBonjourUtil errorName:message:] +[UDBonjourUtil sockaddrFromData:] +[UDBonjourUtil addressFromData:port:] /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDBonjourUtil.m -[UDSuspendDelegateWrapper delegate] -[UDSuspendDelegateWrapper setDelegate:] -[UDSuspendDelegateWrapper .cxx_destruct] -[UDSuspendLock init] -[UDSuspendLock initWithName:] -[UDSuspendLock dealloc] -[UDSuspendLock addDelegate:] -[UDSuspendLock removeDelegate:] -[UDSuspendLock applicationDidEnterBackground:] -[UDSuspendLock lock] -[UDSuspendLock unlock] -[UDSuspendLock cancel] -[UDSuspendLock notifyDelegates] -[UDSuspendLock extend] ___23-[UDSuspendLock extend]_block_invoke -[UDSuspendLock name] -[UDSuspendLock .cxx_destruct] _OBJC_IVAR_$_UDSuspendDelegateWrapper._delegate _OBJC_IVAR_$_UDSuspendLock._backgroundTaskId _OBJC_IVAR_$_UDSuspendLock._name _OBJC_IVAR_$_UDSuspendLock._wrappers _OBJC_IVAR_$_UDSuspendLock._count /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDSuspendLock.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDSuspendLock.h __23-[UDSuspendLock extend]_block_invoke -[UDSockServer initWithDelegate:queue:] -[UDSockServer dealloc] -[UDSockServer start] _UDSockServerCallBack -[UDSockServer stop] -[UDSockServer acceptCallback:address:] -[UDSockServer delegate] -[UDSockServer port] -[UDSockServer queue] -[UDSockServer .cxx_destruct] ___UDSockServerCallBack_block_invoke _OBJC_IVAR_$_UDSockServer._delegate _OBJC_IVAR_$_UDSockServer._queue _OBJC_IVAR_$_UDSockServer._acceptThread _OBJC_IVAR_$_UDSockServer._running _OBJC_IVAR_$_UDSockServer._port _OBJC_IVAR_$_UDSockServer._socket4 _OBJC_IVAR_$_UDSockServer._socket6 _start.yes /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDSockServer.m __UDSockServerCallBack_block_invoke /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDSockServer.h UDSockServerCallBack -[UDSockServerClient init] -[UDSockServerClient initWithSocket:addressData:] -[UDSockServerClient dealloc] -[UDSockServerClient getInput:output:] -[UDSockServerClient addressData] -[UDSockServerClient address] -[UDSockServerClient .cxx_destruct] _OBJC_IVAR_$_UDSockServerClient._handle _OBJC_IVAR_$_UDSockServerClient._addressData _OBJC_IVAR_$_UDSockServerClient._address _OBJC_IVAR_$_UDSockServerClient._closeOnDealloc /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDSockServerClient.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDSockServerClient.h -[UDBonjourBrowser init] -[UDBonjourBrowser initWithDelegate:nodeId:serviceType:peerToPeer:] -[UDBonjourBrowser start] -[UDBonjourBrowser stop] -[UDBonjourBrowser restart] -[UDBonjourBrowser startImpl] -[UDBonjourBrowser stopImpl] -[UDBonjourBrowser checkDesiredState] -[UDBonjourBrowser netServiceBrowser:didFindService:moreComing:] -[UDBonjourBrowser netServiceBrowserWillSearch:] -[UDBonjourBrowser netServiceBrowserDidStopSearch:] -[UDBonjourBrowser netServiceBrowser:didNotSearch:] ___51-[UDBonjourBrowser netServiceBrowser:didNotSearch:]_block_invoke -[UDBonjourBrowser netServiceBrowser:didFindDomain:moreComing:] -[UDBonjourBrowser netServiceBrowser:didRemoveDomain:moreComing:] -[UDBonjourBrowser netServiceBrowser:didRemoveService:moreComing:] -[UDBonjourBrowser netServiceWillResolve:] -[UDBonjourBrowser netServiceDidResolveAddress:] ___48-[UDBonjourBrowser netServiceDidResolveAddress:]_block_invoke ___copy_helper_block_.105 ___destroy_helper_block_.106 -[UDBonjourBrowser netService:didNotResolve:] -[UDBonjourBrowser netServiceDidStop:] -[UDBonjourBrowser delegate] -[UDBonjourBrowser queue] -[UDBonjourBrowser ioThread] -[UDBonjourBrowser nodeId] -[UDBonjourBrowser serviceType] -[UDBonjourBrowser peerToPeer] -[UDBonjourBrowser .cxx_destruct] _OBJC_IVAR_$_UDBonjourBrowser._delegate _OBJC_IVAR_$_UDBonjourBrowser._queue _OBJC_IVAR_$_UDBonjourBrowser._ioThread _OBJC_IVAR_$_UDBonjourBrowser._nodeId _OBJC_IVAR_$_UDBonjourBrowser._serviceType _OBJC_IVAR_$_UDBonjourBrowser._peerToPeer _OBJC_IVAR_$_UDBonjourBrowser._state _OBJC_IVAR_$_UDBonjourBrowser._desiredState _OBJC_IVAR_$_UDBonjourBrowser._servicesResolving _OBJC_IVAR_$_UDBonjourBrowser._times _OBJC_IVAR_$_UDBonjourBrowser._browser ___block_descriptor_tmp.107 l_OBJC_PROTOCOL_$_NSNetServiceBrowserDelegate l_OBJC_LABEL_PROTOCOL_$_NSNetServiceBrowserDelegate l_OBJC_PROTOCOL_$_NSNetServiceDelegate l_OBJC_LABEL_PROTOCOL_$_NSNetServiceDelegate /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDBonjourBrowser.m __48-[UDBonjourBrowser netServiceDidResolveAddress:]_block_invoke __51-[UDBonjourBrowser netServiceBrowser:didNotSearch:]_block_invoke -[UDBrowseResult init] -[UDBrowseResult initWithNodeId:addressData:] -[UDBrowseResult getInput:output:] -[UDBrowseResult nodeId] -[UDBrowseResult addressData] -[UDBrowseResult address] -[UDBrowseResult port] -[UDBrowseResult .cxx_destruct] _OBJC_IVAR_$_UDBrowseResult._nodeId _OBJC_IVAR_$_UDBrowseResult._addressData _OBJC_IVAR_$_UDBrowseResult._port _OBJC_IVAR_$_UDBrowseResult._address /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDBrowseResult.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDBrowseResult.h -[UDBonjourAdvertiser init] -[UDBonjourAdvertiser initWithDelegate:nodeId:serviceType:peerToPeer:] -[UDBonjourAdvertiser start] -[UDBonjourAdvertiser stop] -[UDBonjourAdvertiser restart] -[UDBonjourAdvertiser sockServerDidAcceptClient:] -[UDBonjourAdvertiser startImpl] ___32-[UDBonjourAdvertiser startImpl]_block_invoke -[UDBonjourAdvertiser stopImpl] -[UDBonjourAdvertiser checkDesiredState] -[UDBonjourAdvertiser netServiceDidStop:] -[UDBonjourAdvertiser netService:didUpdateTXTRecordData:] -[UDBonjourAdvertiser netServiceWillPublish:] -[UDBonjourAdvertiser netServiceDidPublish:] -[UDBonjourAdvertiser netService:didNotPublish:] ___48-[UDBonjourAdvertiser netService:didNotPublish:]_block_invoke ___copy_helper_block_.82 ___destroy_helper_block_.83 -[UDBonjourAdvertiser netService:didAcceptConnectionWithInputStream:outputStream:] -[UDBonjourAdvertiser delegate] -[UDBonjourAdvertiser queue] -[UDBonjourAdvertiser ioThread] -[UDBonjourAdvertiser nodeId] -[UDBonjourAdvertiser serviceType] -[UDBonjourAdvertiser peerToPeer] -[UDBonjourAdvertiser .cxx_destruct] _OBJC_IVAR_$_UDBonjourAdvertiser._delegate _OBJC_IVAR_$_UDBonjourAdvertiser._queue _OBJC_IVAR_$_UDBonjourAdvertiser._ioThread _OBJC_IVAR_$_UDBonjourAdvertiser._nodeId _OBJC_IVAR_$_UDBonjourAdvertiser._serviceType _OBJC_IVAR_$_UDBonjourAdvertiser._peerToPeer _OBJC_IVAR_$_UDBonjourAdvertiser._state _OBJC_IVAR_$_UDBonjourAdvertiser._desiredState _OBJC_IVAR_$_UDBonjourAdvertiser._server _OBJC_IVAR_$_UDBonjourAdvertiser._service ___block_descriptor_tmp.84 l_OBJC_PROTOCOL_$_UDSockServerDelegate l_OBJC_LABEL_PROTOCOL_$_UDSockServerDelegate /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDBonjourAdvertiser.m __48-[UDBonjourAdvertiser netService:didNotPublish:]_block_invoke __32-[UDBonjourAdvertiser startImpl]_block_invoke +[UDAggItem ending] +[UDAggItem longTransferLock] +[UDAggItem longTransferUnlock] -[UDAggItem initWithSource:] -[UDAggItem dealloc] -[UDAggItem markAsSent] -[UDAggItem markAsDiscarded] -[UDAggItem source] -[UDAggItem future] -[UDAggItem isEnding] -[UDAggItem isLongTransferLock] -[UDAggItem isLongTransferUnlock] -[UDAggItem .cxx_destruct] _OBJC_IVAR_$_UDAggItem._isEnding _OBJC_IVAR_$_UDAggItem._isLongTransferLock _OBJC_IVAR_$_UDAggItem._isLongTransferUnlock _OBJC_IVAR_$_UDAggItem._futureSource _OBJC_IVAR_$_UDAggItem._future _OBJC_IVAR_$_UDAggItem._source /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDAggItem.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDAggItem.h -[UDFutureAsync init] -[UDFutureAsync initWithQueue:context:block:] -[UDFutureAsync initWithQueue:block:] -[UDFutureAsync listen:block:] ___30-[UDFutureAsync listen:block:]_block_invoke ___30-[UDFutureAsync listen:block:]_block_invoke_2 ___30-[UDFutureAsync listen:block:]_block_invoke_3 ___copy_helper_block_.5 ___destroy_helper_block_.6 ___copy_helper_block_.9 ___destroy_helper_block_.10 -[UDFutureAsync .cxx_destruct] _OBJC_IVAR_$_UDFutureAsync._queue _OBJC_IVAR_$_UDFutureAsync._retriever _OBJC_IVAR_$_UDFutureAsync._context ___block_descriptor_tmp.8 ___block_descriptor_tmp.11 l_OBJC_PROTOCOL_$_UDFutureStubDelegate l_OBJC_LABEL_PROTOCOL_$_UDFutureStubDelegate /Users/virl/Projects/underdark/underdark-cocoa/Underdark/Public/UDFutureAsync.m __30-[UDFutureAsync listen:block:]_block_invoke_3 __30-[UDFutureAsync listen:block:]_block_invoke_2 __30-[UDFutureAsync listen:block:]_block_invoke -[UDFutureStub init] -[UDFutureStub initWithDelegate:] -[UDFutureStub dealloc] -[UDFutureStub listen:block:] -[UDFutureStub delegate] -[UDFutureStub .cxx_destruct] _OBJC_IVAR_$_UDFutureStub._delegate /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDFutureStub.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/UDFutureStub.h -[UDSource init] -[UDSource initWithFuture:dataId:] -[UDSource initWithFuture:] -[UDSource future] -[UDSource dataId] -[UDSource .cxx_destruct] _OBJC_IVAR_$_UDSource._future _OBJC_IVAR_$_UDSource._dataId /Users/virl/Projects/underdark/underdark-cocoa/Underdark/Public/UDSource.m /Users/virl/Projects/underdark/underdark-cocoa/Underdark/Public/UDSource.h -[UDFuture listen:block:] /Users/virl/Projects/underdark/underdark-cocoa/Underdark/Public/UDFuture.m /Users/virl/Library/Developer/Xcode/DerivedData/Underdark-eouzvostwyqlsygrwtkfrlnohtpp/Build/Intermediates/Underdark.build/Release-iphoneos/Underdark.build/DerivedSources/Underdark_vers.c __ZL15__ARCLite__loadv __ZL58__arclite_NSMutableDictionary__setObject_forKeyedSubscriptP19NSMutableDictionaryP13objc_selectorP11objc_objectS4_ __ZL22add_image_hook_swiftV1PK11mach_headerl __ZL42__arclite_NSUndoManagerProxy_isKindOfClassP11objc_objectP13objc_selectorP10objc_class __ZL13replaceMethodP10objc_classP13objc_selectorPFP11objc_objectS4_S2_zEPS6_ __ZL30__arclite_NSManagedObject_initP11objc_objectP13objc_selector __ZL41__arclite_NSManagedObject_allocWithEntityP11objc_objectP13objc_selectorS0_ __ZL36__arclite_NSManagedObject_allocBatchP11objc_objectP13objc_selectorPS0_S0_j __ZL37__arclite_NSKKMS_fastIndexForKnownKeyP11objc_objectP13objc_selectorS0_ __ZL28__arclite_NSKKMS_indexForKeyP11objc_objectP13objc_selectorS0_ __ZL29__arclite_NSKKsD_objectForKeyP11objc_objectP13objc_selectorS0_ __ZL35__arclite_NSKKsD_removeObjectForKeyP11objc_objectP13objc_selectorS0_ __ZL33__arclite_NSKKsD_setObject_forKeyP11objc_objectP13objc_selectorS0_S0_ __ZL41__arclite_NSKKsD_addEntriesFromDictionaryP11objc_objectP13objc_selectorP12NSDictionary __ZL28__arclite_objc_readClassPairP10objc_classPK15objc_image_info __ZL32__arclite_objc_allocateClassPairP10objc_classPKcm __ZL32__arclite_object_getIndexedIvarsP11objc_object __ZL23__arclite_objc_getClassPKc __ZL27__arclite_objc_getMetaClassPKc __ZL31__arclite_objc_getRequiredClassPKc __ZL26__arclite_objc_lookUpClassPKc __ZL26__arclite_objc_getProtocolPKc __ZL23__arclite_class_getNameP10objc_class __ZL26__arclite_protocol_getNameP8Protocol __ZL37__arclite_objc_copyClassNamesForImagePKcPj __ZL17transcribeMethodsP10objc_classP15glue_class_ro_t __ZL19transcribeProtocolsP10objc_classP15glue_class_ro_t __ZL20transcribePropertiesP10objc_classP15glue_class_ro_t __ZL14initialize_impP11objc_objectP13objc_selector __ZL18allocateMaybeSwiftP18glue_swift_class_tm __ZL22copySwiftV1MangledNamePKcb __ZL13demangledNamePKcb __ZL16scanMangledFieldRPKcS0_S1_Ri __ZL30arclite_uninitialized_functionv __ZL12cxxConstructP11objc_object __ZL20fixStringForCoreDataP11objc_object _OBJC_METACLASS_$___ARCLite__ __ZL24OBJC_CLASS_$___ARCLite__ __ZL31OBJC_METACLASS_RO_$___ARCLite__ __non_lazy_classes __ZL27OBJC_CLASS_RO_$___ARCLite__ __ZL11_class_name __ZL32OBJC_$_CLASS_METHODS___ARCLite__ __ZL17_load_method_name __ZL17_load_method_type l_OBJC_PROTOCOL_$___ARCLiteKeyedSubscripting__ l_OBJC_LABEL_PROTOCOL_$___ARCLiteKeyedSubscripting__ l_OBJC_PROTOCOL_REFERENCE_$___ARCLiteKeyedSubscripting__ __ZL30NSUndoManagerProxy_targetClass __ZL29original_NSManagedObject_init __ZL40original_NSManagedObject_allocWithEntity __ZL35original_NSManagedObject_allocBatch __ZL25NSMutableDictionary_class __ZL22NSConstantString_class __ZL14NSString_class __ZL36original_NSKKMS_fastIndexForKnownKey __ZL27original_NSKKMS_indexForKey __ZL28original_NSKKsD_objectForKey __ZL34original_NSKKsD_removeObjectForKey __ZL32original_NSKKsD_setObject_forKey __ZL40original_NSKKsD_addEntriesFromDictionary __ZZL22add_image_hook_swiftV1PK11mach_headerlE7patches __ZGVZL22add_image_hook_swiftV1PK11mach_headerlE7patches __ZL31original_objc_allocateClassPair __ZL31original_object_getIndexedIvars __ZL22original_objc_getClass __ZL26original_objc_getMetaClass __ZL30original_objc_getRequiredClass __ZL25original_objc_lookUpClass __ZL25original_objc_getProtocol __ZL22original_class_getName __ZL25original_protocol_getName __ZL36original_objc_copyClassNamesForImage __ZL12demangleLock __ZL9Demangled /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++11 -Wno-trigraphs -fno-exceptions -fno-rtti -mpascal-strings -Os -Wno-missing-field-initializers -Wmissing-prototypes -Wno-implicit-atomic-properties -Wno-arc-repeated-use-of-weak -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -Wno-c++11-extensions -D NDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.Internal.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -miphoneos-version-min=4.3 -g -fno-threadsafe-statics -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -fembed-bitcode -iquote /Library/Caches/com.apple.xbs/Binaries/arclite_iOS/arclite_iOS-65~835/TempContent/Objects/arclite.build/arclite_iOS.build/arclite_iphoneos-generated-files.hmap -I /Library/Caches/com.apple.xbs/Binaries/arclite_iOS/arclite_iOS-65~835/TempContent/Objects/arclite.build/arclite_iOS.build/arclite_iphoneos-own-target-headers.hmap -I /Library/Caches/com.apple.xbs/Binaries/arclite_iOS/arclite_iOS-65~835/TempContent/Objects/arclite.build/arclite_iOS.build/arclite_iphoneos-all-target-headers.hmap -iquote /Library/Caches/com.apple.xbs/Binaries/arclite_iOS/arclite_iOS-65~835/TempContent/Objects/arclite.build/arclite_iOS.build/arclite_iphoneos-project-headers.hmap -I /Library/Caches/com.apple.xbs/Binaries/arclite_iOS/arclite_iOS-65~835/Symbols/BuiltProducts/include -I /Library/Caches/com.apple.xbs/Binaries/arclite_iOS/arclite_iOS-65~835/TempContent/Objects/arclite.build/arclite_iOS.build/DerivedSources/arm64 -I /Library/Caches/com.apple.xbs/Binaries/arclite_iOS/arclite_iOS-65~835/TempContent/Objects/arclite.build/arclite_iOS.build/DerivedSources -F/Library/Caches/com.apple.xbs/Binaries/arclite_iOS/arclite_iOS-65~835/Symbols/BuiltProducts -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.Internal.sdk/System/Library/PrivateFrameworks -Wall -Wextra -Wno-gcc-compat -fgnu-inline-asm -MMD -MT dependencies -MF /Library/Caches/com.apple.xbs/Binaries/arclite_iOS/arclite_iOS-65~835/TempContent/Objects/arclite.build/arclite_iOS.build/Objects-normal/arm64/arclite.d --serialize-diagnostics /Library/Caches/com.apple.xbs/Binaries/arclite_iOS/arclite_iOS-65~835/TempContent/Objects/arclite.build/arclite_iOS.build/Objects-normal/arm64/arclite.dia -c /Library/Caches/com.apple.xbs/Sources/arclite_iOS/arclite-65/source/arclite.mm -o /Library/Caches/com.apple.xbs/Binaries/arclite_iOS/arclite_iOS-65~835/TempContent/Objects/arclite.build/arclite_iOS.build/Objects-normal/arm64/arclite.o -mlinker-version=274.1 /Library/Caches/com.apple.xbs/Sources/arclite_iOS/arclite-65/source/arclite.mm /Library/Caches/com.apple.xbs/Sources/arclite_iOS/arclite-65 fixStringForCoreData cxxConstruct arclite_uninitialized_function scanMangledField isdigit /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.Internal.sdk/usr/include/ctype.h __isctype demangledName copySwiftV1DemangledName copySwiftV1MangledName allocateMaybeSwift word_align isSwift initialize_imp transcribeProperties property_list_nth transcribeProtocols transcribeMethods data method_list_nth __arclite_objc_copyClassNamesForImage __arclite_protocol_getName __arclite_class_getName __arclite_objc_getProtocol __arclite_objc_lookUpClass __arclite_objc_getRequiredClass __arclite_objc_getMetaClass __arclite_objc_getClass __arclite_object_getIndexedIvars __arclite_objc_allocateClassPair metaclass __arclite_objc_readClassPair transcribeIvars ivar_list_nth max alignment ro fastFlags __arclite_NSKKsD_addEntriesFromDictionary __arclite_NSKKsD_setObject_forKey __arclite_NSKKsD_removeObjectForKey __arclite_NSKKsD_objectForKey __arclite_NSKKMS_indexForKey __arclite_NSKKMS_fastIndexForKnownKey __arclite_NSManagedObject_allocBatch __arclite_NSManagedObject_allocWithEntity __arclite_NSManagedObject_init replaceMethod __arclite_NSUndoManagerProxy_isKindOfClass add_image_hook_swiftV1 patch_lazy_pointers patch_t<const char **(const char *, unsigned int *)> patch_t<const char *(Protocol *)> patch_t<const char *(Class)> patch_t<Protocol *(const char *)> patch_t<Class (const char *)> patch_t<void *(id)> patch_t<Class (Class, const char *, unsigned long)> patch_t<Class (Class, const objc_image_info *)> __arclite_NSMutableDictionary__setObject_forKeyedSubscript __ARCLite__load install_swiftV1 install_dict_nil_value addOrReplaceMethod keyedGetter
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="description" content="Specification for HTML Purifier's advanced API for defining custom filtering behavior." /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>Advanced API - HTML Purifier</title> </head><body> <h1>Advanced API</h1> <div id="filing">Filed under Development</div> <div id="index">Return to the <a href="index.html">index</a>.</div> <div id="home"><a href="http://htmlpurifier.org/">HTML Purifier</a> End-User Documentation</div> <p> Please see <a href="enduser-customize.html">Customize!</a> </p> </body></html> <!-- vim: et sw=4 sts=4 -->
{ "pile_set_name": "Github" }
// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 50; objects = { /* Begin PBXBuildFile section */ 329C76AE1AF28B5500BC1D8C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 329C76AD1AF28B5500BC1D8C /* AppDelegate.swift */; }; 329C76B01AF28B5500BC1D8C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 329C76AF1AF28B5500BC1D8C /* ViewController.swift */; }; 329C76B31AF28B5500BC1D8C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 329C76B11AF28B5500BC1D8C /* Main.storyboard */; }; 329C76B51AF28B5500BC1D8C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 329C76B41AF28B5500BC1D8C /* Assets.xcassets */; }; 329C76B81AF28B5500BC1D8C /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 329C76B61AF28B5500BC1D8C /* LaunchScreen.xib */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 329C76A81AF28B5500BC1D8C /* bk1ch03p104optionals2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = bk1ch03p104optionals2.app; sourceTree = BUILT_PRODUCTS_DIR; }; 329C76AC1AF28B5500BC1D8C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 329C76AD1AF28B5500BC1D8C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 329C76AF1AF28B5500BC1D8C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; }; 329C76B21AF28B5500BC1D8C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 329C76B41AF28B5500BC1D8C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 329C76B71AF28B5500BC1D8C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 329C76A51AF28B5500BC1D8C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 329C769F1AF28B5500BC1D8C = { isa = PBXGroup; children = ( 329C76AA1AF28B5500BC1D8C /* bk1ch03p104optionals2 */, 329C76A91AF28B5500BC1D8C /* Products */, ); sourceTree = "<group>"; }; 329C76A91AF28B5500BC1D8C /* Products */ = { isa = PBXGroup; children = ( 329C76A81AF28B5500BC1D8C /* bk1ch03p104optionals2.app */, ); name = Products; sourceTree = "<group>"; }; 329C76AA1AF28B5500BC1D8C /* bk1ch03p104optionals2 */ = { isa = PBXGroup; children = ( 329C76AD1AF28B5500BC1D8C /* AppDelegate.swift */, 329C76AF1AF28B5500BC1D8C /* ViewController.swift */, 329C76B11AF28B5500BC1D8C /* Main.storyboard */, 329C76B41AF28B5500BC1D8C /* Assets.xcassets */, 329C76B61AF28B5500BC1D8C /* LaunchScreen.xib */, 329C76AC1AF28B5500BC1D8C /* Info.plist */, ); path = bk1ch03p104optionals2; sourceTree = "<group>"; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 329C76A71AF28B5500BC1D8C /* bk1ch03p104optionals2 */ = { isa = PBXNativeTarget; buildConfigurationList = 329C76C71AF28B5500BC1D8C /* Build configuration list for PBXNativeTarget "bk1ch03p104optionals2" */; buildPhases = ( 329C76A41AF28B5500BC1D8C /* Sources */, 329C76A51AF28B5500BC1D8C /* Frameworks */, 329C76A61AF28B5500BC1D8C /* Resources */, ); buildRules = ( ); dependencies = ( ); name = bk1ch03p104optionals2; productName = bk1ch03p104optionals2; productReference = 329C76A81AF28B5500BC1D8C /* bk1ch03p104optionals2.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 329C76A01AF28B5500BC1D8C /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 1100; ORGANIZATIONNAME = "Matt Neuburg"; TargetAttributes = { 329C76A71AF28B5500BC1D8C = { CreatedOnToolsVersion = 6.3.1; LastSwiftMigration = 1000; }; }; }; buildConfigurationList = 329C76A31AF28B5500BC1D8C /* Build configuration list for PBXProject "bk1ch03p104optionals2" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( English, en, Base, ); mainGroup = 329C769F1AF28B5500BC1D8C; productRefGroup = 329C76A91AF28B5500BC1D8C /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 329C76A71AF28B5500BC1D8C /* bk1ch03p104optionals2 */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 329C76A61AF28B5500BC1D8C /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 329C76B31AF28B5500BC1D8C /* Main.storyboard in Resources */, 329C76B81AF28B5500BC1D8C /* LaunchScreen.xib in Resources */, 329C76B51AF28B5500BC1D8C /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 329C76A41AF28B5500BC1D8C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 329C76B01AF28B5500BC1D8C /* ViewController.swift in Sources */, 329C76AE1AF28B5500BC1D8C /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 329C76B11AF28B5500BC1D8C /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 329C76B21AF28B5500BC1D8C /* Base */, ); name = Main.storyboard; sourceTree = "<group>"; }; 329C76B61AF28B5500BC1D8C /* LaunchScreen.xib */ = { isa = PBXVariantGroup; children = ( 329C76B71AF28B5500BC1D8C /* Base */, ); name = LaunchScreen.xib; sourceTree = "<group>"; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 329C76C51AF28B5500BC1D8C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; 329C76C61AF28B5500BC1D8C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; VALIDATE_PRODUCT = YES; }; name = Release; }; 329C76C81AF28B5500BC1D8C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = bk1ch03p104optionals2/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = "com.neuburg.matt.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; }; name = Debug; }; 329C76C91AF28B5500BC1D8C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = bk1ch03p104optionals2/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = "com.neuburg.matt.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 329C76A31AF28B5500BC1D8C /* Build configuration list for PBXProject "bk1ch03p104optionals2" */ = { isa = XCConfigurationList; buildConfigurations = ( 329C76C51AF28B5500BC1D8C /* Debug */, 329C76C61AF28B5500BC1D8C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 329C76C71AF28B5500BC1D8C /* Build configuration list for PBXNativeTarget "bk1ch03p104optionals2" */ = { isa = XCConfigurationList; buildConfigurations = ( 329C76C81AF28B5500BC1D8C /* Debug */, 329C76C91AF28B5500BC1D8C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 329C76A01AF28B5500BC1D8C /* Project object */; }
{ "pile_set_name": "Github" }
import argparse import os from util import util import torch import GPUtil import numpy as np class Options(): def __init__(self): self.parser = argparse.ArgumentParser() self.initialized = False def initialize(self): self.parser.add_argument('--gpu_ids', type=str, default='1, 0', help='auto or gpu_ids seperated by comma.') self.parser.add_argument('--dataset', type=str, default='kitti', help='kitti') self.parser.add_argument('--dataroot', default='/ssd/jiaxin/USIP_datasets/kitti', help='path to images & laser point clouds') self.parser.add_argument('--name', type=str, default='train', help='name of the experiment. It decides where to store samples and models') self.parser.add_argument('--checkpoints_dir', type=str, default='./checkpoints', help='models are saved here') self.parser.add_argument('--batch_size', type=int, default=8, help='input batch size') self.parser.add_argument('--input_pc_num', type=int, default=16384, help='# of input points') self.parser.add_argument('--surface_normal_len', type=int, default=4, help='3 - surface normal, 4 - sn+curvature, 5 - sn+curvature+reflectance') self.parser.add_argument('--nThreads', default=10, type=int, help='# threads for loading data') self.parser.add_argument('--display_winsize', type=int, default=256, help='display window size') self.parser.add_argument('--display_id', type=int, default=1, help='window id of the web display') self.parser.add_argument('--activation', type=str, default='relu', help='activation function: relu, elu') self.parser.add_argument('--normalization', type=str, default='batch', help='normalization function: batch, instance') self.parser.add_argument('--lr', type=float, default=0.001, help='learning rate') self.parser.add_argument('--node_num', type=int, default=512, help='som node number') self.parser.add_argument('--k', type=int, default=1, help='k nearest neighbor') self.parser.add_argument('--node_knn_k_1', type=int, default=16, help='k nearest neighbor of SOM nodes searching on SOM nodes') self.parser.add_argument('--random_pc_dropout_lower_limit', type=float, default=1, help='keep ratio lower limit') self.parser.add_argument('--bn_momentum', type=float, default=0.1, help='normalization momentum, typically 0.1. Equal to (1-m) in TF') self.parser.add_argument('--bn_momentum_decay_step', type=int, default=None, help='BN momentum decay step. e.g, 0.5->0.01.') self.parser.add_argument('--bn_momentum_decay', type=float, default=0.6, help='BN momentum decay step. e.g, 0.5->0.01.') self.parser.add_argument('--rot_horizontal', type=bool, default=True, help='Rotation augmentation around vertical axis.') self.parser.add_argument('--rot_3d', type=bool, default=False, help='Rotation augmentation around xyz axis.') self.parser.add_argument('--rot_perturbation', type=bool, default=False, help='Small rotation augmentation around 3 axis.') self.parser.add_argument('--translation_perturbation', type=bool, default=False, help='Small translation augmentation around 3 axis.') self.parser.add_argument('--loss_sigma_lower_bound', type=float, default=0.001, help='Sigma lower bound') self.parser.add_argument('--keypoint_outlier_thre', type=float, default=3, help='Threshold of distance between cloesest keypoint pairs, large distance is considered to be mis-matched.') self.parser.add_argument('--keypoint_on_pc_alpha', type=float, default=0.01, help='weight of keypoint_on_pc loss, default 0.5.') self.parser.add_argument('--keypoint_on_pc_type', type=str, default='point_to_point', help='point_to_point (alpha=0.5) / point_to_plane (alpha=0.05)') # indoor / outdoor / object configuration self.parser.add_argument('--scene', type=str, default='outdoor', help='outdoor / indoor / object') # kitti configuration self.parser.add_argument('--radius_threshold', type=float, default=100, help='Threshold point cloud to be less than some radius.') self.initialized = True def process_opts(self): assert self.opt is not None # === processing options === begin === # determine which GPU to use # auto, throw exception when no GPU is available if self.opt.gpu_ids == 'auto': GPUtil.showUtilization() deviceIDs = GPUtil.getAvailable(order='first', limit=4, maxLoad=0.5, maxMemory=0.5, excludeID=[], excludeUUID=[]) deviceID_costs = [-1 * x for x in deviceIDs] # reorder the deviceID according to the computational capacity, i.e., total memory size # memory size is divided by 1000 without remainder, to avoid small fluctuation gpus = GPUtil.getGPUs() memory_size_costs = [-1 * (gpu.memoryTotal // 1000) for gpu in gpus if (gpu.load < 0.5 and gpu.memoryUtil < 0.5)] names = [gpu.name for gpu in gpus if (gpu.load < 0.5 and gpu.memoryUtil < 0.5)] sorted_idx = np.lexsort((deviceID_costs, memory_size_costs)) self.opt.gpu_ids = [deviceIDs[sorted_idx[0]]] print('### selected GPU PCI_ID: %d, Name: %s ###' % (self.opt.gpu_ids[0], names[sorted_idx[0]])) else: if type(self.opt.gpu_ids) == str: # split into integer list, manual or multi-gpu self.opt.gpu_ids = list(map(int, self.opt.gpu_ids.split(','))) self.opt.device = torch.device( "cuda:%d" % self.opt.gpu_ids[0] if (torch.cuda.is_available() and len(self.opt.gpu_ids) >= 1) else "cpu") # cuda.select_device(self.opt.gpu_ids[0]) # torch.cuda.set_device(self.opt.gpu_ids[0]) # set unique display_id self.opt.display_id = int(self.opt.display_id + 100 * self.opt.gpu_ids[0]) # assure that 2d & 3d rot are not conflicting assert ((self.opt.rot_3d & self.opt.rot_horizontal) == False) # === processing options === end === args = vars(self.opt) print('------------ Options -------------') for k, v in sorted(args.items()): print('%s: %s' % (str(k), str(v))) print('-------------- End ----------------') # save to the disk expr_dir = os.path.join(self.opt.checkpoints_dir, self.opt.name) util.mkdirs(expr_dir) file_name = os.path.join(expr_dir, 'opt.txt') with open(file_name, 'wt') as opt_file: opt_file.write('------------ Options -------------\n') for k, v in sorted(args.items()): opt_file.write('%s: %s\n' % (str(k), str(v))) opt_file.write('-------------- End ----------------\n') def parse_without_process(self): if not self.initialized: self.initialize() self.opt = self.parser.parse_args() return self.opt def parse(self): self.opt = self.parse_without_process() self.process_opts() return self.opt
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 25 2017 03:49:04). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <objc/NSObject.h> #import "MacBuddyManager-Protocol.h" @class CountryManager, NSArray, NSDictionary, NSIndexSet, NSMutableArray, NSString, SAKeyboard; @interface KeyboardManager : NSObject <MacBuddyManager> { CountryManager *countryManager; NSDictionary *inputDictionary; NSArray *keyboardsForCurrentLanguage; NSArray *allKnownKeyboards; NSMutableArray *keyboardsShownToTheUser; NSString *defaultKeyboardName; NSIndexSet *userSelectedTypingStyle; SAKeyboard *userSelectedKeyboard; BOOL userSelectedAltInputMethod; } + (id)prunedKeyboardsFromArray:(id)arg1; + (id)MBLocaleGetAppropriateKeyboardsForLocaleIdentifier:(id)arg1; + (id)_defaultInputSourceIdentifierForLocaleIdentifier:(id)arg1; + (id)_defaultInputSourceIdentifierForLocaleIdentifier:(id)arg1 intendedLang:(id *)arg2; + (id)_inputSourcesForLocalePart:(id)arg1; + (id)_inputSourcesForLocaleIdentifier:(id)arg1; + (id)_inputSourcesForLanguageIdentifier:(id)arg1; + (BOOL)_inputSourceIdentifierIsABCLayout:(id)arg1; + (id)_insertDefaultIDIdeallyInto:(id)arg1 inputIdentifier:(id)arg2 language:(id)arg3; + (id)_preferredKeyboardSourceIDsForLocaleIdentifier:(id)arg1 currentISOLanguageCode:(id)arg2; - (void).cxx_destruct; @property BOOL userSelectedAltInputMethod; // @synthesize userSelectedAltInputMethod; @property(retain) NSString *defaultKeyboardName; // @synthesize defaultKeyboardName; @property(retain) NSIndexSet *userSelectedTypingStyle; // @synthesize userSelectedTypingStyle; @property(retain) SAKeyboard *userSelectedKeyboard; // @synthesize userSelectedKeyboard; @property(retain) CountryManager *countryManager; // @synthesize countryManager; @property(retain) NSArray *allKnownKeyboards; // @synthesize allKnownKeyboards; @property(retain) NSArray *keyboardsForCurrentLanguage; // @synthesize keyboardsForCurrentLanguage; @property(retain) NSMutableArray *keyboardsShownToTheUser; // @synthesize keyboardsShownToTheUser; - (id)defaultTypingStyleForKeyboard:(id)arg1; - (BOOL)keyboardHasAltMethod:(id)arg1; - (id)typingStylesForKeyboard:(id)arg1; - (id)_inputDictionaryForKeyboard:(id)arg1; @property(readonly, copy) NSDictionary *_inputDictionary; - (BOOL)applySettings:(id *)arg1; - (id)initWithCountryManager:(id)arg1; - (id)init; - (void)showAllKeyboards:(BOOL)arg1; - (void)refreshKeyboardDatabase:(BOOL)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
{ "pile_set_name": "Github" }
// Copyright 2010-2012 RethinkDB, all rights reserved. #include <string> #include "unittest/gtest.hpp" #include "containers/archive/boost_types.hpp" #include "containers/archive/stl_types.hpp" namespace unittest { void dump_to_string(write_message_t *wm, std::string *out) { intrusive_list_t<write_buffer_t> *buffers = wm->unsafe_expose_buffers(); out->clear(); for (write_buffer_t *p = buffers->head(); p; p = buffers->next(p)) { out->append(p->data, p->data + p->size); } } TEST(WriteMessageTest, Variant) { boost::variant<int32_t, std::string, int8_t> v("Hello, world!"); write_message_t wm; serialize<cluster_version_t::LATEST_OVERALL>(&wm, v); std::string s; dump_to_string(&wm, &s); ASSERT_EQ(2, s[0]); ASSERT_EQ(13, s[1]); // The varint-encoded string length. ASSERT_EQ('H', s[2]); ASSERT_EQ('!', s[14]); ASSERT_EQ(15u, s.size()); } } // namespace unittest
{ "pile_set_name": "Github" }
/* * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ package org.antlr.v4.gui; import java.awt.*; import java.util.HashMap; import java.util.Locale; import java.util.Map; public class PostScriptDocument { public static final String DEFAULT_FONT = "CourierNew"; public static final Map<String, String> POSTSCRIPT_FONT_NAMES; static { POSTSCRIPT_FONT_NAMES = new HashMap<String, String>(); POSTSCRIPT_FONT_NAMES.put(Font.SANS_SERIF + ".plain", "ArialMT"); POSTSCRIPT_FONT_NAMES.put(Font.SANS_SERIF + ".bold", "Arial-BoldMT"); POSTSCRIPT_FONT_NAMES.put(Font.SANS_SERIF + ".italic", "Arial-ItalicMT"); POSTSCRIPT_FONT_NAMES.put(Font.SANS_SERIF + ".bolditalic", "Arial-BoldItalicMT"); POSTSCRIPT_FONT_NAMES.put(Font.SERIF + ".plain", "TimesNewRomanPSMT"); POSTSCRIPT_FONT_NAMES.put(Font.SERIF + ".bold", "TimesNewRomanPS-BoldMT"); POSTSCRIPT_FONT_NAMES.put(Font.SERIF + ".italic", "TimesNewRomanPS-ItalicMT"); POSTSCRIPT_FONT_NAMES.put(Font.SERIF + ".bolditalic", "TimesNewRomanPS-BoldItalicMT"); POSTSCRIPT_FONT_NAMES.put(Font.MONOSPACED + ".plain", "CourierNewPSMT"); POSTSCRIPT_FONT_NAMES.put(Font.MONOSPACED + ".bold", "CourierNewPS-BoldMT"); POSTSCRIPT_FONT_NAMES.put(Font.MONOSPACED + ".italic", "CourierNewPS-ItalicMT"); POSTSCRIPT_FONT_NAMES.put(Font.MONOSPACED + ".bolditalic", "CourierNewPS-BoldItalicMT"); } protected int boundingBoxWidth; protected int boundingBoxHeight; protected SystemFontMetrics fontMetrics; protected String fontName; protected int fontSize = 12; protected double lineWidth = 0.3; protected String boundingBox; protected StringBuilder ps = new StringBuilder(); protected boolean closed = false; public PostScriptDocument() { this(DEFAULT_FONT, 12); } public PostScriptDocument(String fontName, int fontSize) { header(); setFont(fontName, fontSize); } public String getPS() { close(); return header()+ps.toString(); } public void boundingBox(int w, int h) { boundingBoxWidth = w; boundingBoxHeight = h; boundingBox = String.format(Locale.US, "%%%%BoundingBox: %d %d %d %d\n", 0,0, boundingBoxWidth,boundingBoxHeight); } public void close() { if ( closed ) return; // ps.append("showpage\n"); ps.append("%%Trailer\n"); closed = true; } /** Compute the header separately because we need to wait for the bounding box */ protected StringBuilder header() { StringBuilder b = new StringBuilder(); b.append("%!PS-Adobe-3.0 EPSF-3.0\n"); b.append(boundingBox).append("\n"); b.append("0.3 setlinewidth\n"); b.append("%% x y w h highlight\n" + "/highlight {\n" + " 4 dict begin\n" + " /h exch def\n" + " /w exch def\n" + " /y exch def\n" + " /x exch def\n" + " gsave\n" + " newpath\n" + " x y moveto\n" + " 0 h rlineto % up to left corner\n" + " w 0 rlineto % to upper right corner\n" + " 0 h neg rlineto % to lower right corner\n" + " w neg 0 rlineto % back home to lower left corner\n" + " closepath\n" + " .95 .83 .82 setrgbcolor\n" + " fill\n" + " grestore\n" + " end\n" + "} def\n"); return b; } public void setFont(String fontName, int fontSize) { this.fontMetrics = new SystemFontMetrics(fontName); this.fontName = fontMetrics.getFont().getPSName(); this.fontSize = fontSize; String psname = POSTSCRIPT_FONT_NAMES.get(this.fontName); if (psname == null) { psname = this.fontName; } ps.append(String.format(Locale.US, "/%s findfont %d scalefont setfont\n", psname, fontSize)); } public void lineWidth(double w) { lineWidth = w; ps.append(w).append(" setlinewidth\n"); } public void move(double x, double y) { ps.append(String.format(Locale.US, "%1.3f %1.3f moveto\n", x, y)); } public void lineto(double x, double y) { ps.append(String.format(Locale.US, "%1.3f %1.3f lineto\n", x, y)); } public void line(double x1, double y1, double x2, double y2) { move(x1, y1); lineto(x2, y2); } public void rect(double x, double y, double width, double height) { line(x, y, x, y + height); line(x, y + height, x + width, y + height); line(x + width, y + height, x + width, y); line(x + width, y, x, y); } /** Make red box */ public void highlight(double x, double y, double width, double height) { ps.append(String.format(Locale.US, "%1.3f %1.3f %1.3f %1.3f highlight\n", x, y, width, height)); } public void stroke() { ps.append("stroke\n"); } // public void rarrow(double x, double y) { // ps.append(String.format(Locale.US, "%1.3f %1.3f rarrow\n", x,y)); // } // // public void darrow(double x, double y) { // ps.append(String.format(Locale.US, "%1.3f %1.3f darrow\n", x,y)); // } public void text(String s, double x, double y) { StringBuilder buf = new StringBuilder(); // escape \, (, ): \\, \(, \) for (char c : s.toCharArray()) { switch ( c ) { case '\\' : case '(' : case ')' : buf.append('\\'); buf.append(c); break; default : buf.append(c); break; } } s = buf.toString(); move(x,y); ps.append(String.format(Locale.US, "(%s) show\n", s)); stroke(); } // courier new: wid/hei 7.611979 10.0625 /** All chars are 600 thousands of an 'em' wide if courier */ public double getWidth(char c) { return fontMetrics.getWidth(c, fontSize); } public double getWidth(String s) { return fontMetrics.getWidth(s, fontSize); } public double getLineHeight() { return fontMetrics.getLineHeight(fontSize); } public int getFontSize() { return fontSize; } }
{ "pile_set_name": "Github" }
// Copyright 2017 The Gorilla WebSocket Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package websocket import ( "bytes" "net" "sync" "time" ) // PreparedMessage caches on the wire representations of a message payload. // Use PreparedMessage to efficiently send a message payload to multiple // connections. PreparedMessage is especially useful when compression is used // because the CPU and memory expensive compression operation can be executed // once for a given set of compression options. type PreparedMessage struct { messageType int data []byte mu sync.Mutex frames map[prepareKey]*preparedFrame } // prepareKey defines a unique set of options to cache prepared frames in PreparedMessage. type prepareKey struct { isServer bool compress bool compressionLevel int } // preparedFrame contains data in wire representation. type preparedFrame struct { once sync.Once data []byte } // NewPreparedMessage returns an initialized PreparedMessage. You can then send // it to connection using WritePreparedMessage method. Valid wire // representation will be calculated lazily only once for a set of current // connection options. func NewPreparedMessage(messageType int, data []byte) (*PreparedMessage, error) { pm := &PreparedMessage{ messageType: messageType, frames: make(map[prepareKey]*preparedFrame), data: data, } // Prepare a plain server frame. _, frameData, err := pm.frame(prepareKey{isServer: true, compress: false}) if err != nil { return nil, err } // To protect against caller modifying the data argument, remember the data // copied to the plain server frame. pm.data = frameData[len(frameData)-len(data):] return pm, nil } func (pm *PreparedMessage) frame(key prepareKey) (int, []byte, error) { pm.mu.Lock() frame, ok := pm.frames[key] if !ok { frame = &preparedFrame{} pm.frames[key] = frame } pm.mu.Unlock() var err error frame.once.Do(func() { // Prepare a frame using a 'fake' connection. // TODO: Refactor code in conn.go to allow more direct construction of // the frame. mu := make(chan bool, 1) mu <- true var nc prepareConn c := &Conn{ conn: &nc, mu: mu, isServer: key.isServer, compressionLevel: key.compressionLevel, enableWriteCompression: true, writeBuf: make([]byte, defaultWriteBufferSize+maxFrameHeaderSize), } if key.compress { c.newCompressionWriter = compressNoContextTakeover } err = c.WriteMessage(pm.messageType, pm.data) frame.data = nc.buf.Bytes() }) return pm.messageType, frame.data, err } type prepareConn struct { buf bytes.Buffer net.Conn } func (pc *prepareConn) Write(p []byte) (int, error) { return pc.buf.Write(p) } func (pc *prepareConn) SetWriteDeadline(t time.Time) error { return nil }
{ "pile_set_name": "Github" }
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ #pragma once namespace Data { namespace StateManager { /// <summary> /// CopyNamedOperationData encapsulates multiplexing information to indicate which /// component a given operation data belongs to : SM or SP2. /// </summary> /// <remarks> /// NamedOperationData is used in copy. /// </remarks> /// <dataformat> /// NATIVE: /// |UserOperationData||Context | /// OperationData: [HeaderVersion0][HeaderVersion1]...[HeaderVersionX][0].............[n] /// HeaderVersion0: [HeaderOperationDataCount|StateProviderID] /// [ULONG32 |LONG64 ] /// = 4 + 8 = 12 bytes /// Max number of context header segments: 4,294,967,295 /// Max number of user segments: 4,294,967,295 /// Version one header segment count: 1. /// Value add of this format is version-ability. /// </dataformat> /// <dataformat> /// MANAGED: /// |UserOperationData||Context| /// OperationData: [H0: Version][H1: StateProviderID][0].............[n] /// Header: [Version][StateProviderID] /// [LONG32 ][LONG64 ] /// = 4 + 8 = 12 bytes /// Possible Version Number Range: [1, 1] /// Max number of context header segments: 1 /// Max number of user segments: Not limited by protocol (2,147,483,647) /// </dataformat> /// <devnote> /// We use size of Header0 to determine whether the operation is formatted as managed or native. /// </devnote> class CopyNamedOperationData final : public Utilities::OperationData { K_FORCE_SHARED(CopyNamedOperationData) public: // static Creators. // Creates an CopyNamedOperationData::SPtr from inputs. // Used in the IN path. static NTSTATUS Create( __in FABRIC_STATE_PROVIDER_ID stateProviderId, __in SerializationMode::Enum serailizationMode, __in KAllocator & allocator, __in OperationData const & userOperationData, __out CSPtr & result) noexcept; // Creates an CopyNamedOperationData::SPtr by de-serializing the OperationData from LoggingReplicator. // Used in the OUT path. static NTSTATUS Create( __in KAllocator & allocator, __in Utilities::OperationData const & inputOperationData, __out CSPtr & result) noexcept; public: // Properties __declspec(property(get = get_StateProviderId)) FABRIC_STATE_PROVIDER_ID StateProviderId; FABRIC_STATE_PROVIDER_ID get_StateProviderId() const noexcept; __declspec(property(get = get_UserOperationData)) OperationData::CSPtr UserOperationDataCSPtr; OperationData::CSPtr get_UserOperationData() const noexcept; private: // Static header reader static NTSTATUS DeserializeContext( __in Utilities::OperationData const & operationData, __in KAllocator & allocator, __out ULONG32 & metadataOperationDataCount, __out FABRIC_STATE_PROVIDER_ID & stateProviderId, __out OperationData::CSPtr & userOperationData) noexcept; static NTSTATUS DeserializeNativeContext( __in Utilities::OperationData const & operationData, __in KAllocator & allocator, __out ULONG32 & metadataOperationDataCount, __out FABRIC_STATE_PROVIDER_ID & stateProviderId, __out OperationData::CSPtr & userOperationData) noexcept; static NTSTATUS DeserializeManagedContext( __in Utilities::OperationData const & operationData, __in KAllocator & allocator, __out ULONG32 & metadataOperationDataCount, __out FABRIC_STATE_PROVIDER_ID & stateProviderId, __out OperationData::CSPtr & userOperationData) noexcept; private: __checkReturn NTSTATUS Serialize( __in SerializationMode::Enum mode) noexcept; __checkReturn NTSTATUS CreateNativeContext() noexcept; // Managed Header for backwards compatibility. __checkReturn NTSTATUS CreateManagedContext() noexcept; private: // Constructor // Constructor for read path (deserialization) FAILABLE CopyNamedOperationData( __in ULONG32 metadataCount, __in FABRIC_STATE_PROVIDER_ID stateProviderId, __in Utilities::OperationData const & inputOperationData) noexcept; // Constructor for write path (serialization) FAILABLE CopyNamedOperationData( __in ULONG32 metadataCount, __in FABRIC_STATE_PROVIDER_ID stateProviderId, __in SerializationMode::Enum mode, __in Utilities::OperationData const & userOperationData) noexcept; private: // Statics static const ULONG32 NativeContextHeaderSize; static const ULONG32 CurrentWriteMetadataOperationDataCount; static const ULONG32 NativeHeaderCount; static const LONG32 ManagedVersion; static const LONG32 ManagedVersionBufferSize; static const LONG32 ManagedStateProviderBufferSize; static const ULONG32 ManagedHeaderCount; private: // Member variables // Number of operationData used as metadata. // Since this number can only increase, this number is also used as version number. ULONG32 const metadataCount_; // State Provider ID that the operation data belongs to. FABRIC_STATE_PROVIDER_ID const stateProviderId_; // Operation data of the SP2 or SM. Utilities::OperationData::CSPtr userOperationDataCSPtr_; }; } }
{ "pile_set_name": "Github" }
# Loading Firmware The purpose of this document is to detail how firmware on the Steam Controller can be loaded, backed up and restored. This is necessary for many of the Subprojects as they require changing the firmware on the Steam Controller. Note that most of the information in this document came from [UnBricking Steam Controller (Manual Firmware Update, Rollback)](https://steamcommunity.com/sharedfiles/filedetails/?id=572740074). This document exists as a backup of that information and so that it can be presented in the context of the Open Steam Controller Project. Note that at this point only the firmware on the LPC11U37F processor is being modified. There is at least one other chip that has firmware running on it that could potentially be changed (the nRF51822 Bluetooth Chip), however, at this point the firmware on that chip is not modified as any part of this project. ## Accessing the Firmware The firmware on the Steam Controller's LPC11U37F processor can be accessed via the following steps: * From a powered down state, hold the right trigger while connecting the controller via USB to a PC * This will activate the USB In-System Programming for the LPC11U37F * The LPC11U37F will act as a FAT12 file system labeled "CRP DISABLD" * The file system will have a single file called "firmware.bin" ## Backing Up the Firmware In order to return the controller to the last known working state, it is recommend to make a backup of the firmware currently installed via Steam. The following steps outline how to do this: * Connect the controller to a PC as outlined in Accessing the Firmware * Save the firmware to file on your PC * On macOS (Tested specifically on 10.12.6): * Copy firmware.bin from "CRP DISABLD" mount to backup file (i.e. backup.bin): * `cat /Volumes/CRP\ DISABLD/firmware.bin > backup.bin` * On Linux systems (Test on Ubuntu 18.04): * Locate mount point of CRP DISABLD * The following command may help: `mount | grep DISABLD` * Backup the firmware file * `dd if=<path to mount>/firmware.bin of=backup.bin` * On Windows (Tested on Windows 10 May 2019 Update): * A new removable drive will appear with the name CRP DISABLD (i.e. "CRP DISABLD (E:)") * Navigate to the drive using Windows File Explorer and copy firmware.bin to another directory ## Manually Loading Firmware These steps outline how to manually download new firmware onto the controller. It is recommend to back up the last officially loaded firmware via Steam as outlined above. * Connect the controller to a PC as outlined in Accessing the Firmware * Download the firmware .bin file: * On macOS (Tested specifically on 10.12.6): * Mount "CRP DISABLD" will appear * Load new firmware binary with command `cat new_firmware.bin > /Volumes/CRP\ DISABLD/firmware.bin` * Eject "CRP DISABLD" * On Linux systems (As reported by @rigidsh): * Locate mount point of CRP DISABLD * The following command may help: `mount | grep DISABLD` * Load new firmware binary with command: `dd conv=nocreat,notrunc oflag=direct bs=512 if=<path to your firmware> of=<path to sc flash>/firmware.bin` * "cat new_firmware.bin > /mount/CRP\ DISABLD/firmware.bin" will corrupt downloaded firmware. * Unmount CRP DISABLD * On Windows (Tested on Window 10 May 2019 Update): * A new removable drive will appear with the name CRP DISABLD (i.e. "CRP DISABLD (E:)") * Navigate to the drive using Windows File Explorer and delete firmware.bin * Make sure the firmware updated file is named firmware.bin * Copy the update file (firmware.bin) to the new drive (i.e. E: CRP DISABLD) * Eject the drive ## Restoring Firmware If the last official firmware loaded by Steam was not backed up properly, these steps outline how firmware can be obtained from Valve for manual download: * Download [firmware.vdf](http://media.steampowered.com/controller_config/firmware/firmware.vdf) file from Valve * Open firmware.vdf in a text editor * The "firmwaretimestamp" entry can give you an idea as to when a particular firmware was built * [Epoch Convert](https://www.epochconverter.com/hex) can be used to convert this to a human readable date * The "firmwarebinary" will give you a portion of the URL you need to download the firmware * Add the "firmwarebinary" string to the end of http://media.steampowered.com/controller_config/ to create a URL to download the firmware * For example http://media.steampowered.com/controller_config//firmware/vcf_wired_controller_d0g_57bf5c10.bin allows for downloading a copy of the firmware with the timestamp 57bf5c10 (Thursday, August 25, 2016 8:58:56 PM GMT). * Pasting the URL into a web browser will allow you to download the .bin file that can be loaded onto the controller following the steps in Manually Loading Firmware
{ "pile_set_name": "Github" }
// Copyright 2008, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Author: [email protected] (Zhanyong Wan) #include <iostream> #include "gmock/gmock.h" #include "gtest/gtest.h" // MS C++ compiler/linker has a bug on Windows (not on Windows CE), which // causes a link error when _tmain is defined in a static library and UNICODE // is enabled. For this reason instead of _tmain, main function is used on // Windows. See the following link to track the current status of this bug: // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=394464 // NOLINT #if GTEST_OS_WINDOWS_MOBILE # include <tchar.h> // NOLINT GTEST_API_ int _tmain(int argc, TCHAR** argv) { #else GTEST_API_ int main(int argc, char** argv) { #endif // GTEST_OS_WINDOWS_MOBILE std::cout << "Running main() from gmock_main.cc\n"; // Since Google Mock depends on Google Test, InitGoogleMock() is // also responsible for initializing Google Test. Therefore there's // no need for calling testing::InitGoogleTest() separately. testing::InitGoogleMock(&argc, argv); return RUN_ALL_TESTS(); }
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.spark.sql.catalyst.plans import org.apache.spark.SparkFunSuite class JoinTypesTest extends SparkFunSuite { test("construct an Inner type") { assert(JoinType("inner") === Inner) } test("construct a FullOuter type") { assert(JoinType("fullouter") === FullOuter) assert(JoinType("full_outer") === FullOuter) assert(JoinType("outer") === FullOuter) assert(JoinType("full") === FullOuter) } test("construct a LeftOuter type") { assert(JoinType("leftouter") === LeftOuter) assert(JoinType("left_outer") === LeftOuter) assert(JoinType("left") === LeftOuter) } test("construct a RightOuter type") { assert(JoinType("rightouter") === RightOuter) assert(JoinType("right_outer") === RightOuter) assert(JoinType("right") === RightOuter) } test("construct a LeftSemi type") { assert(JoinType("leftsemi") === LeftSemi) assert(JoinType("left_semi") === LeftSemi) assert(JoinType("semi") === LeftSemi) } test("construct a LeftAnti type") { assert(JoinType("leftanti") === LeftAnti) assert(JoinType("left_anti") === LeftAnti) assert(JoinType("anti") === LeftAnti) } test("construct a Cross type") { assert(JoinType("cross") === Cross) } }
{ "pile_set_name": "Github" }
/* * Copyright 2012 ZXing authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #import "ZXReader.h" /** * This class attempts to decode a barcode from an image, not by scanning the whole image, * but by scanning subsets of the image. This is important when there may be multiple barcodes in * an image, and detecting a barcode may find parts of multiple barcode and fail to decode * (e.g. QR Codes). Instead this scans the four quadrants of the image -- and also the center * 'quadrant' to cover the case where a barcode is found in the center. */ @interface ZXByQuadrantReader : NSObject <ZXReader> - (id)initWithDelegate:(id<ZXReader>)delegate; @end
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Text; namespace MxNet.GluonTS.Block { class ForkingMLPDecoder { } }
{ "pile_set_name": "Github" }
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. import 'package:test_reflective_loader/test_reflective_loader.dart'; import 'flutter_test.dart' as flutter_test; import 'profiling_test.dart' as profiling_test; import 'strings_test.dart' as strings_test; void main() { defineReflectiveSuite(() { flutter_test.main(); profiling_test.main(); strings_test.main(); }); }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" ?> <Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> <Property name="title" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <ResourceString bundle="de.thomas_oster/visicut/gui/resources/EditRasterProfileDialog.properties" key="TITLE" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/> </Property> <Property name="name" type="java.lang.String" value="Form" noResource="true"/> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> <SyntheticProperty name="generateCenter" type="boolean" value="false"/> </SyntheticProperties> <AuxValues> <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/> <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/> <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> </AuxValues> <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Component id="lbDescription" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="selectThumbnailButton1" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="lbGreyscaleShift" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="1" attributes="0"> <EmptySpace min="0" pref="0" max="32767" attributes="0"/> <Component id="jButton4" min="-2" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/> <Component id="jButton3" min="-2" max="-2" attributes="0"/> </Group> <Component id="jSlider1" alignment="0" pref="279" max="32767" attributes="1"/> <Component id="tfDescription" alignment="0" max="32767" attributes="1"/> <Component id="tfName" alignment="0" max="32767" attributes="1"/> <Component id="jComboBox1" alignment="0" max="32767" attributes="1"/> <Component id="jScrollPane1" alignment="0" pref="279" max="32767" attributes="1"/> <Component id="cbResolution" alignment="0" max="32767" attributes="1"/> <Component id="cbInvertColors" min="-2" max="-2" attributes="0"/> <Component id="lbName" alignment="0" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0"> <Group type="102" alignment="1" attributes="0"> <Component id="lbName" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="tfName" min="-2" max="-2" attributes="0"/> </Group> <Component id="selectThumbnailButton1" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="lbDescription" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="tfDescription" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="cbResolution" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Component id="jScrollPane1" pref="110" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="2" attributes="0"> <Component id="lbGreyscaleShift" alignment="2" min="-2" max="-2" attributes="0"/> <Component id="jSlider1" alignment="2" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="2" attributes="0"> <Component id="jLabel2" alignment="2" min="-2" max="-2" attributes="0"/> <Component id="cbInvertColors" alignment="2" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace type="unrelated" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="jButton4" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> </Layout> <SubComponents> <Component class="javax.swing.JButton" name="jButton4"> <Properties> <Property name="text" type="java.lang.String" resourceKey="Cancel"/> <Property name="name" type="java.lang.String" value="jButton4" noResource="true"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton4ActionPerformed"/> </Events> </Component> <Component class="javax.swing.JButton" name="jButton3"> <Properties> <Property name="text" type="java.lang.String" resourceKey="Save"/> <Property name="name" type="java.lang.String" value="jButton3" noResource="true"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> </Events> </Component> <Component class="javax.swing.JLabel" name="jLabel4"> <Properties> <Property name="text" type="java.lang.String" resourceKey="jLabel4.text"/> <Property name="name" type="java.lang.String" value="jLabel4" noResource="true"/> </Properties> </Component> <Component class="javax.swing.JTextField" name="tfDescription"> <Properties> <Property name="name" type="java.lang.String" value="tfDescription" noResource="true"/> </Properties> <BindingProperties> <BindingProperty name="text" source="Form" sourcePath="${currentRasterProfile.description}" target="tfDescription" targetPath="text" updateStrategy="0" immediately="false"> <BindingParameter name="javax.swing.binding.ParameterKeys.TEXT_CHANGE_STRATEGY" value="javax.swing.binding.TextChangeStrategy.ON_TYPE"/> <Property name="name" type="java.lang.String" value="desc"/> </BindingProperty> </BindingProperties> </Component> <Component class="javax.swing.JLabel" name="lbDescription"> <Properties> <Property name="text" type="java.lang.String" resourceKey="Description"/> <Property name="name" type="java.lang.String" value="lbDescription" noResource="true"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lbName"> <Properties> <Property name="text" type="java.lang.String" resourceKey="lbName.text"/> <Property name="name" type="java.lang.String" value="lbName" noResource="true"/> </Properties> </Component> <Component class="javax.swing.JTextField" name="tfName"> <Properties> <Property name="name" type="java.lang.String" value="tfName" noResource="true"/> </Properties> <BindingProperties> <BindingProperty name="text" source="Form" sourcePath="${currentRasterProfile.name}" target="tfName" targetPath="text" updateStrategy="0" immediately="false"> <BindingParameter name="javax.swing.binding.ParameterKeys.TEXT_CHANGE_STRATEGY" value="javax.swing.binding.TextChangeStrategy.ON_TYPE"/> <Property name="name" type="java.lang.String" value="Name"/> </BindingProperty> </BindingProperties> </Component> <Component class="javax.swing.JComboBox" name="jComboBox1"> <Properties> <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> <StringArray count="4"> <StringItem index="0" value="Item 1"/> <StringItem index="1" value="Item 2"/> <StringItem index="2" value="Item 3"/> <StringItem index="3" value="Item 4"/> </StringArray> </Property> <Property name="name" type="java.lang.String" value="jComboBox1" noResource="true"/> </Properties> <BindingProperties> <BindingProperty name="selectedItem" source="Form" sourcePath="${currentRasterProfile.ditherAlgorithm}" target="jComboBox1" targetPath="selectedItem" updateStrategy="0" immediately="false"/> </BindingProperties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jComboBox1ActionPerformed"/> </Events> </Component> <Component class="de.thomas_oster.uicomponents.SelectThumbnailButton" name="selectThumbnailButton1"> <Properties> <Property name="name" type="java.lang.String" value="selectThumbnailButton1" noResource="true"/> </Properties> <BindingProperties> <BindingProperty name="thumbnailPath" source="Form" sourcePath="${currentRasterProfile.thumbnailPath}" target="selectThumbnailButton1" targetPath="thumbnailPath" updateStrategy="0" immediately="false"> <Property name="name" type="java.lang.String" value="thumbnailbt"/> </BindingProperty> </BindingProperties> </Component> <Component class="javax.swing.JCheckBox" name="cbInvertColors"> <Properties> <Property name="text" type="java.lang.String" resourceKey="profile.invertColors"/> <Property name="name" type="java.lang.String" value="cbInvertColors" noResource="true"/> </Properties> <BindingProperties> <BindingProperty name="selected" source="Form" sourcePath="${currentRasterProfile.invertColors}" target="cbInvertColors" targetPath="selected" updateStrategy="0" immediately="false"> <Property name="name" type="java.lang.String" value="invcolors"/> </BindingProperty> </BindingProperties> </Component> <Component class="javax.swing.JSlider" name="jSlider1"> <Properties> <Property name="maximum" type="int" value="255"/> <Property name="minimum" type="int" value="-255"/> <Property name="toolTipText" type="java.lang.String" resourceKey="jSlider1.toolTipText"/> <Property name="name" type="java.lang.String" value="jSlider1" noResource="true"/> </Properties> <BindingProperties> <BindingProperty name="value" source="Form" sourcePath="${currentRasterProfile.colorShift}" target="jSlider1" targetPath="value" updateStrategy="0" immediately="false"> <BindingParameter name="IGNORE_ADJUSTING" value="N"/> <Property name="name" type="java.lang.String" value="colorshift"/> </BindingProperty> </BindingProperties> </Component> <Component class="javax.swing.JLabel" name="lbGreyscaleShift"> <Properties> <Property name="text" type="java.lang.String" resourceKey="profile.greyscaleShift"/> <Property name="name" type="java.lang.String" value="lbGreyscaleShift" noResource="true"/> </Properties> </Component> <Container class="javax.swing.JScrollPane" name="jScrollPane1"> <Properties> <Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/> </Properties> <AuxValues> <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> </AuxValues> <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <SubComponents> <Component class="javax.swing.JTable" name="jTable1"> <Properties> <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> <Table columnCount="4" rowCount="4"> <Column editable="true" title="Title 1" type="java.lang.Object"/> <Column editable="true" title="Title 2" type="java.lang.Object"/> <Column editable="true" title="Title 3" type="java.lang.Object"/> <Column editable="true" title="Title 4" type="java.lang.Object"/> </Table> </Property> <Property name="name" type="java.lang.String" value="jTable1" noResource="true"/> </Properties> <AuxValues> <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new BetterJTable()"/> </AuxValues> </Component> </SubComponents> </Container> <Component class="javax.swing.JLabel" name="jLabel1"> <Properties> <Property name="text" type="java.lang.String" resourceKey="Resolution"/> <Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/> </Properties> </Component> <Component class="javax.swing.JComboBox" name="cbResolution"> <Properties> <Property name="editable" type="boolean" value="true"/> <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> <StringArray count="4"> <StringItem index="0" value="Item 1"/> <StringItem index="1" value="Item 2"/> <StringItem index="2" value="Item 3"/> <StringItem index="3" value="Item 4"/> </StringArray> </Property> <Property name="name" type="java.lang.String" value="cbResolution" noResource="true"/> </Properties> <BindingProperties> <BindingProperty name="selectedItem" source="Form" sourcePath="${currentRasterProfile.DPI}" target="cbResolution" targetPath="selectedItem" updateStrategy="0" immediately="false"> <Property name="name" type="java.lang.String" value="cbBinding"/> </BindingProperty> </BindingProperties> </Component> <Component class="javax.swing.JLabel" name="jLabel2"> <Properties> <Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/> <Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/> </Properties> </Component> </SubComponents> </Form>
{ "pile_set_name": "Github" }
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads // <future> // enum class launch // { // async = 1, // deferred = 2, // any = async | deferred /* EXTENSION */ // }; #include <future> #include <cassert> #include "test_macros.h" int main(int, char**) { #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS LIBCPP_STATIC_ASSERT(static_cast<int>(std::launch::any) == (static_cast<int>(std::launch::async) | static_cast<int>(std::launch::deferred)), ""); #else LIBCPP_STATIC_ASSERT(std::launch::any == (std::launch::async | std::launch::deferred), ""); static_assert(std::launch(0) == (std::launch::async & std::launch::deferred), ""); LIBCPP_STATIC_ASSERT(std::launch::any == (std::launch::async ^ std::launch::deferred), ""); LIBCPP_STATIC_ASSERT(std::launch::deferred == ~std::launch::async, ""); std::launch x = std::launch::async; x &= std::launch::deferred; assert(x == std::launch(0)); x = std::launch::async; x |= std::launch::deferred; LIBCPP_ASSERT(x == std::launch::any); x ^= std::launch::deferred; assert(x == std::launch::async); #endif static_assert(static_cast<int>(std::launch::async) == 1, ""); static_assert(static_cast<int>(std::launch::deferred) == 2, ""); return 0; }
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 -ffreestanding -E %s #include <limits.h>
{ "pile_set_name": "Github" }
<?php /* * @package Include/help/en/ */ ?> <h1>Policy agent</h1> <p>In this view you can assign agents to a policy. This can be done in two ways:</p> <ul> <li type="circle">Massive actions</li> <li type="circle">Unity actions</li> </ul> <p>It is possible to select multiple agentes in order to add them to the policy. Also it is possible to delete them moving them to the left column.</p> <p>In the inferior part of this view it is showed the complete list of agents associated to the policy and agents pending to delete.</p>
{ "pile_set_name": "Github" }
Sophia License -------------- Copyright (C) Dmitry Simonenko ([email protected]) Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY AUTHORS ``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 AUTHORS 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.
{ "pile_set_name": "Github" }
/* * Copyright (C) 2008 Nir Tzachar <[email protected]? * Released under the terms of the GNU GPL v2.0. * * Derived from menuconfig. * */ #define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include "lkc.h" #include "nconf.h" #include <ctype.h> static const char nconf_global_help[] = N_( "Help windows\n" "------------\n" "o Global help: Unless in a data entry window, pressing <F1> will give \n" " you the global help window, which you are just reading.\n" "\n" "o A short version of the global help is available by pressing <F3>.\n" "\n" "o Local help: To get help related to the current menu entry, use any\n" " of <?> <h>, or if in a data entry window then press <F1>.\n" "\n" "\n" "Menu entries\n" "------------\n" "This interface lets you select features and parameters for the kernel\n" "build. Kernel features can either be built-in, modularized, or removed.\n" "Parameters must be entered as text or decimal or hexadecimal numbers.\n" "\n" "Menu entries beginning with following braces represent features that\n" " [ ] can be built in or removed\n" " < > can be built in, modularized or removed\n" " { } can be built in or modularized, are selected by another feature\n" " - - are selected by another feature\n" " XXX cannot be selected. Symbol Info <F2> tells you why.\n" "*, M or whitespace inside braces means to build in, build as a module\n" "or to exclude the feature respectively.\n" "\n" "To change any of these features, highlight it with the movement keys\n" "listed below and press <y> to build it in, <m> to make it a module or\n" "<n> to remove it. You may press the <Space> key to cycle through the\n" "available options.\n" "\n" "A trailing \"--->\" designates a submenu, a trailing \"----\" an\n" "empty submenu.\n" "\n" "Menu navigation keys\n" "----------------------------------------------------------------------\n" "Linewise up <Up>\n" "Linewise down <Down>\n" "Pagewise up <Page Up>\n" "Pagewise down <Page Down>\n" "First entry <Home>\n" "Last entry <End>\n" "Enter a submenu <Right> <Enter>\n" "Go back to parent menu <Left> <Esc> <F5>\n" "Close a help window <Enter> <Esc> <F5>\n" "Close entry window, apply <Enter>\n" "Close entry window, forget <Esc> <F5>\n" "Start incremental, case-insensitive search for STRING in menu entries,\n" " no regex support, STRING is displayed in upper left corner\n" " </>STRING\n" " Remove last character <Backspace>\n" " Jump to next hit <Down>\n" " Jump to previous hit <Up>\n" "Exit menu search mode </> <Esc>\n" "Search for configuration variables with or without leading CONFIG_\n" " <F8>RegExpr<Enter>\n" "Verbose search help <F8><F1>\n" "----------------------------------------------------------------------\n" "\n" "Unless in a data entry window, key <1> may be used instead of <F1>,\n" "<2> instead of <F2>, etc.\n" "\n" "\n" "Radiolist (Choice list)\n" "-----------------------\n" "Use the movement keys listed above to select the option you wish to set\n" "and press <Space>.\n" "\n" "\n" "Data entry\n" "----------\n" "Enter the requested information and press <Enter>. Hexadecimal values\n" "may be entered without the \"0x\" prefix.\n" "\n" "\n" "Text Box (Help Window)\n" "----------------------\n" "Use movement keys as listed in table above.\n" "\n" "Press any of <Enter> <Esc> <q> <F5> <F9> to exit.\n" "\n" "\n" "Alternate configuration files\n" "-----------------------------\n" "nconfig supports switching between different configurations.\n" "Press <F6> to save your current configuration. Press <F7> and enter\n" "a file name to load a previously saved configuration.\n" "\n" "\n" "Terminal configuration\n" "----------------------\n" "If you use nconfig in a xterm window, make sure your TERM environment\n" "variable specifies a terminal configuration which supports at least\n" "16 colors. Otherwise nconfig will look rather bad.\n" "\n" "If the \"stty size\" command reports the current terminalsize correctly,\n" "nconfig will adapt to sizes larger than the traditional 80x25 \"standard\"\n" "and display longer menus properly.\n" "\n" "\n" "Single menu mode\n" "----------------\n" "If you prefer to have all of the menu entries listed in a single menu,\n" "rather than the default multimenu hierarchy, run nconfig with\n" "NCONFIG_MODE environment variable set to single_menu. Example:\n" "\n" "make NCONFIG_MODE=single_menu nconfig\n" "\n" "<Enter> will then unfold the appropriate category, or fold it if it\n" "is already unfolded. Folded menu entries will be designated by a\n" "leading \"++>\" and unfolded entries by a leading \"-->\".\n" "\n" "Note that this mode can eventually be a little more CPU expensive than\n" "the default mode, especially with a larger number of unfolded submenus.\n" "\n"), menu_no_f_instructions[] = N_( "Legend: [*] built-in [ ] excluded <M> module < > module capable.\n" "Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n" "\n" "Use the following keys to navigate the menus:\n" "Move up or down with <Up> and <Down>.\n" "Enter a submenu with <Enter> or <Right>.\n" "Exit a submenu to its parent menu with <Esc> or <Left>.\n" "Pressing <y> includes, <n> excludes, <m> modularizes features.\n" "Pressing <Space> cycles through the available options.\n" "To search for menu entries press </>.\n" "<Esc> always leaves the current window.\n" "\n" "You do not have function keys support.\n" "Press <1> instead of <F1>, <2> instead of <F2>, etc.\n" "For verbose global help use key <1>.\n" "For help related to the current menu entry press <?> or <h>.\n"), menu_instructions[] = N_( "Legend: [*] built-in [ ] excluded <M> module < > module capable.\n" "Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n" "\n" "Use the following keys to navigate the menus:\n" "Move up or down with <Up> or <Down>.\n" "Enter a submenu with <Enter> or <Right>.\n" "Exit a submenu to its parent menu with <Esc> or <Left>.\n" "Pressing <y> includes, <n> excludes, <m> modularizes features.\n" "Pressing <Space> cycles through the available options.\n" "To search for menu entries press </>.\n" "<Esc> always leaves the current window.\n" "\n" "Pressing <1> may be used instead of <F1>, <2> instead of <F2>, etc.\n" "For verbose global help press <F1>.\n" "For help related to the current menu entry press <?> or <h>.\n"), radiolist_instructions[] = N_( "Press <Up>, <Down>, <Home> or <End> to navigate a radiolist, select\n" "with <Space>.\n" "For help related to the current entry press <?> or <h>.\n" "For global help press <F1>.\n"), inputbox_instructions_int[] = N_( "Please enter a decimal value.\n" "Fractions will not be accepted.\n" "Press <Enter> to apply, <Esc> to cancel."), inputbox_instructions_hex[] = N_( "Please enter a hexadecimal value.\n" "Press <Enter> to apply, <Esc> to cancel."), inputbox_instructions_string[] = N_( "Please enter a string value.\n" "Press <Enter> to apply, <Esc> to cancel."), setmod_text[] = N_( "This feature depends on another feature which has been configured as a\n" "module. As a result, the current feature will be built as a module too."), load_config_text[] = N_( "Enter the name of the configuration file you wish to load.\n" "Accept the name shown to restore the configuration you last\n" "retrieved. Leave empty to abort."), load_config_help[] = N_( "For various reasons, one may wish to keep several different\n" "configurations available on a single machine.\n" "\n" "If you have saved a previous configuration in a file other than the\n" "default one, entering its name here will allow you to load and modify\n" "that configuration.\n" "\n" "Leave empty to abort.\n"), save_config_text[] = N_( "Enter a filename to which this configuration should be saved\n" "as an alternate. Leave empty to abort."), save_config_help[] = N_( "For various reasons, one may wish to keep several different\n" "configurations available on a single machine.\n" "\n" "Entering a file name here will allow you to later retrieve, modify\n" "and use the current configuration as an alternate to whatever\n" "configuration options you have selected at that time.\n" "\n" "Leave empty to abort.\n"), search_help[] = N_( "Search for symbols (configuration variable names CONFIG_*) and display\n" "their relations. Regular expressions are supported.\n" "Example: Search for \"^FOO\".\n" "Result:\n" "-----------------------------------------------------------------\n" "Symbol: FOO [ = m]\n" "Prompt: Foo bus is used to drive the bar HW\n" "Defined at drivers/pci/Kconfig:47\n" "Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n" "Location:\n" " -> Bus options (PCI, PCMCIA, EISA, ISA)\n" " -> PCI support (PCI [ = y])\n" " -> PCI access mode (<choice> [ = y])\n" "Selects: LIBCRC32\n" "Selected by: BAR\n" "-----------------------------------------------------------------\n" "o The line 'Prompt:' shows the text displayed for this symbol in\n" " the menu hierarchy.\n" "o The 'Defined at' line tells at what file / line number the symbol is\n" " defined.\n" "o The 'Depends on:' line lists symbols that need to be defined for\n" " this symbol to be visible and selectable in the menu.\n" "o The 'Location:' lines tell, where in the menu structure this symbol\n" " is located. A location followed by a [ = y] indicates that this is\n" " a selectable menu item, and the current value is displayed inside\n" " brackets.\n" "o The 'Selects:' line tells, what symbol will be automatically selected\n" " if this symbol is selected (y or m).\n" "o The 'Selected by' line tells what symbol has selected this symbol.\n" "\n" "Only relevant lines are shown.\n" "\n\n" "Search examples:\n" "USB => find all symbols containing USB\n" "^USB => find all symbols starting with USB\n" "USB$ => find all symbols ending with USB\n" "\n"); struct mitem { char str[256]; char tag; void *usrptr; int is_visible; }; #define MAX_MENU_ITEMS 4096 static int show_all_items; static int indent; static struct menu *current_menu; static int child_count; static int single_menu_mode; /* the window in which all information appears */ static WINDOW *main_window; /* the largest size of the menu window */ static int mwin_max_lines; static int mwin_max_cols; /* the window in which we show option buttons */ static MENU *curses_menu; static ITEM *curses_menu_items[MAX_MENU_ITEMS]; static struct mitem k_menu_items[MAX_MENU_ITEMS]; static int items_num; static int global_exit; /* the currently selected button */ const char *current_instructions = menu_instructions; static char *dialog_input_result; static int dialog_input_result_len; static void conf(struct menu *menu); static void conf_choice(struct menu *menu); static void conf_string(struct menu *menu); static void conf_load(void); static void conf_save(void); static void show_help(struct menu *menu); static int do_exit(void); static void setup_windows(void); static void search_conf(void); typedef void (*function_key_handler_t)(int *key, struct menu *menu); static void handle_f1(int *key, struct menu *current_item); static void handle_f2(int *key, struct menu *current_item); static void handle_f3(int *key, struct menu *current_item); static void handle_f4(int *key, struct menu *current_item); static void handle_f5(int *key, struct menu *current_item); static void handle_f6(int *key, struct menu *current_item); static void handle_f7(int *key, struct menu *current_item); static void handle_f8(int *key, struct menu *current_item); static void handle_f9(int *key, struct menu *current_item); struct function_keys { const char *key_str; const char *func; function_key key; function_key_handler_t handler; }; static const int function_keys_num = 9; struct function_keys function_keys[] = { { .key_str = "F1", .func = "Help", .key = F_HELP, .handler = handle_f1, }, { .key_str = "F2", .func = "SymInfo", .key = F_SYMBOL, .handler = handle_f2, }, { .key_str = "F3", .func = "Help 2", .key = F_INSTS, .handler = handle_f3, }, { .key_str = "F4", .func = "ShowAll", .key = F_CONF, .handler = handle_f4, }, { .key_str = "F5", .func = "Back", .key = F_BACK, .handler = handle_f5, }, { .key_str = "F6", .func = "Save", .key = F_SAVE, .handler = handle_f6, }, { .key_str = "F7", .func = "Load", .key = F_LOAD, .handler = handle_f7, }, { .key_str = "F8", .func = "SymSearch", .key = F_SEARCH, .handler = handle_f8, }, { .key_str = "F9", .func = "Exit", .key = F_EXIT, .handler = handle_f9, }, }; static void print_function_line(void) { int i; int offset = 1; const int skip = 1; int lines = getmaxy(stdscr); for (i = 0; i < function_keys_num; i++) { (void) wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]); mvwprintw(main_window, lines-3, offset, "%s", function_keys[i].key_str); (void) wattrset(main_window, attributes[FUNCTION_TEXT]); offset += strlen(function_keys[i].key_str); mvwprintw(main_window, lines-3, offset, "%s", function_keys[i].func); offset += strlen(function_keys[i].func) + skip; } (void) wattrset(main_window, attributes[NORMAL]); } /* help */ static void handle_f1(int *key, struct menu *current_item) { show_scroll_win(main_window, _("Global help"), _(nconf_global_help)); return; } /* symbole help */ static void handle_f2(int *key, struct menu *current_item) { show_help(current_item); return; } /* instructions */ static void handle_f3(int *key, struct menu *current_item) { show_scroll_win(main_window, _("Short help"), _(current_instructions)); return; } /* config */ static void handle_f4(int *key, struct menu *current_item) { int res = btn_dialog(main_window, _("Show all symbols?"), 2, " <Show All> ", "<Don't show all>"); if (res == 0) show_all_items = 1; else if (res == 1) show_all_items = 0; return; } /* back */ static void handle_f5(int *key, struct menu *current_item) { *key = KEY_LEFT; return; } /* save */ static void handle_f6(int *key, struct menu *current_item) { conf_save(); return; } /* load */ static void handle_f7(int *key, struct menu *current_item) { conf_load(); return; } /* search */ static void handle_f8(int *key, struct menu *current_item) { search_conf(); return; } /* exit */ static void handle_f9(int *key, struct menu *current_item) { do_exit(); return; } /* return != 0 to indicate the key was handles */ static int process_special_keys(int *key, struct menu *menu) { int i; if (*key == KEY_RESIZE) { setup_windows(); return 1; } for (i = 0; i < function_keys_num; i++) { if (*key == KEY_F(function_keys[i].key) || *key == '0' + function_keys[i].key){ function_keys[i].handler(key, menu); return 1; } } return 0; } static void clean_items(void) { int i; for (i = 0; curses_menu_items[i]; i++) free_item(curses_menu_items[i]); bzero(curses_menu_items, sizeof(curses_menu_items)); bzero(k_menu_items, sizeof(k_menu_items)); items_num = 0; } typedef enum {MATCH_TINKER_PATTERN_UP, MATCH_TINKER_PATTERN_DOWN, FIND_NEXT_MATCH_DOWN, FIND_NEXT_MATCH_UP} match_f; /* return the index of the matched item, or -1 if no such item exists */ static int get_mext_match(const char *match_str, match_f flag) { int match_start = item_index(current_item(curses_menu)); int index; if (flag == FIND_NEXT_MATCH_DOWN) ++match_start; else if (flag == FIND_NEXT_MATCH_UP) --match_start; index = match_start; index = (index + items_num) % items_num; while (true) { char *str = k_menu_items[index].str; if (strcasestr(str, match_str) != 0) return index; if (flag == FIND_NEXT_MATCH_UP || flag == MATCH_TINKER_PATTERN_UP) --index; else ++index; index = (index + items_num) % items_num; if (index == match_start) return -1; } } /* Make a new item. */ static void item_make(struct menu *menu, char tag, const char *fmt, ...) { va_list ap; if (items_num > MAX_MENU_ITEMS-1) return; bzero(&k_menu_items[items_num], sizeof(k_menu_items[0])); k_menu_items[items_num].tag = tag; k_menu_items[items_num].usrptr = menu; if (menu != NULL) k_menu_items[items_num].is_visible = menu_is_visible(menu); else k_menu_items[items_num].is_visible = 1; va_start(ap, fmt); vsnprintf(k_menu_items[items_num].str, sizeof(k_menu_items[items_num].str), fmt, ap); va_end(ap); if (!k_menu_items[items_num].is_visible) memcpy(k_menu_items[items_num].str, "XXX", 3); curses_menu_items[items_num] = new_item( k_menu_items[items_num].str, k_menu_items[items_num].str); set_item_userptr(curses_menu_items[items_num], &k_menu_items[items_num]); /* if (!k_menu_items[items_num].is_visible) item_opts_off(curses_menu_items[items_num], O_SELECTABLE); */ items_num++; curses_menu_items[items_num] = NULL; } /* very hackish. adds a string to the last item added */ static void item_add_str(const char *fmt, ...) { va_list ap; int index = items_num-1; char new_str[256]; char tmp_str[256]; if (index < 0) return; va_start(ap, fmt); vsnprintf(new_str, sizeof(new_str), fmt, ap); va_end(ap); snprintf(tmp_str, sizeof(tmp_str), "%s%s", k_menu_items[index].str, new_str); strncpy(k_menu_items[index].str, tmp_str, sizeof(k_menu_items[index].str)); free_item(curses_menu_items[index]); curses_menu_items[index] = new_item( k_menu_items[index].str, k_menu_items[index].str); set_item_userptr(curses_menu_items[index], &k_menu_items[index]); } /* get the tag of the currently selected item */ static char item_tag(void) { ITEM *cur; struct mitem *mcur; cur = current_item(curses_menu); if (cur == NULL) return 0; mcur = (struct mitem *) item_userptr(cur); return mcur->tag; } static int curses_item_index(void) { return item_index(current_item(curses_menu)); } static void *item_data(void) { ITEM *cur; struct mitem *mcur; cur = current_item(curses_menu); if (!cur) return NULL; mcur = (struct mitem *) item_userptr(cur); return mcur->usrptr; } static int item_is_tag(char tag) { return item_tag() == tag; } static char filename[PATH_MAX+1]; static char menu_backtitle[PATH_MAX+128]; static const char *set_config_filename(const char *config_filename) { int size; size = snprintf(menu_backtitle, sizeof(menu_backtitle), "%s - %s", config_filename, rootmenu.prompt->text); if (size >= sizeof(menu_backtitle)) menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; size = snprintf(filename, sizeof(filename), "%s", config_filename); if (size >= sizeof(filename)) filename[sizeof(filename)-1] = '\0'; return menu_backtitle; } /* return = 0 means we are successful. * -1 means go on doing what you were doing */ static int do_exit(void) { int res; if (!conf_get_changed()) { global_exit = 1; return 0; } res = btn_dialog(main_window, _("Do you wish to save your new configuration?\n" "<ESC> to cancel and resume nconfig."), 2, " <save> ", "<don't save>"); if (res == KEY_EXIT) { global_exit = 0; return -1; } /* if we got here, the user really wants to exit */ switch (res) { case 0: res = conf_write(filename); if (res) btn_dialog( main_window, _("Error during writing of configuration.\n" "Your configuration changes were NOT saved."), 1, "<OK>"); break; default: btn_dialog( main_window, _("Your configuration changes were NOT saved."), 1, "<OK>"); break; } global_exit = 1; return 0; } static void search_conf(void) { struct symbol **sym_arr; struct gstr res; struct gstr title; char *dialog_input; int dres; title = str_new(); str_printf( &title, _("Enter (sub)string or regexp to search for " "(with or without \"%s\")"), CONFIG_); again: dres = dialog_inputbox(main_window, _("Search Configuration Parameter"), str_get(&title), "", &dialog_input_result, &dialog_input_result_len); switch (dres) { case 0: break; case 1: show_scroll_win(main_window, _("Search Configuration"), search_help); goto again; default: str_free(&title); return; } /* strip the prefix if necessary */ dialog_input = dialog_input_result; if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0) dialog_input += strlen(CONFIG_); sym_arr = sym_re_search(dialog_input); res = get_relations_str(sym_arr, NULL); free(sym_arr); show_scroll_win(main_window, _("Search Results"), str_get(&res)); str_free(&res); str_free(&title); } static void build_conf(struct menu *menu) { struct symbol *sym; struct property *prop; struct menu *child; int type, tmp, doint = 2; tristate val; char ch; if (!menu || (!show_all_items && !menu_is_visible(menu))) return; sym = menu->sym; prop = menu->prompt; if (!sym) { if (prop && menu != current_menu) { const char *prompt = menu_get_prompt(menu); enum prop_type ptype; ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; switch (ptype) { case P_MENU: child_count++; prompt = _(prompt); if (single_menu_mode) { item_make(menu, 'm', "%s%*c%s", menu->data ? "-->" : "++>", indent + 1, ' ', prompt); } else item_make(menu, 'm', " %*c%s %s", indent + 1, ' ', prompt, menu_is_empty(menu) ? "----" : "--->"); if (single_menu_mode && menu->data) goto conf_childs; return; case P_COMMENT: if (prompt) { child_count++; item_make(menu, ':', " %*c*** %s ***", indent + 1, ' ', _(prompt)); } break; default: if (prompt) { child_count++; item_make(menu, ':', "---%*c%s", indent + 1, ' ', _(prompt)); } } } else doint = 0; goto conf_childs; } type = sym_get_type(sym); if (sym_is_choice(sym)) { struct symbol *def_sym = sym_get_choice_value(sym); struct menu *def_menu = NULL; child_count++; for (child = menu->list; child; child = child->next) { if (menu_is_visible(child) && child->sym == def_sym) def_menu = child; } val = sym_get_tristate_value(sym); if (sym_is_changable(sym)) { switch (type) { case S_BOOLEAN: item_make(menu, 't', "[%c]", val == no ? ' ' : '*'); break; case S_TRISTATE: switch (val) { case yes: ch = '*'; break; case mod: ch = 'M'; break; default: ch = ' '; break; } item_make(menu, 't', "<%c>", ch); break; } } else { item_make(menu, def_menu ? 't' : ':', " "); } item_add_str("%*c%s", indent + 1, ' ', _(menu_get_prompt(menu))); if (val == yes) { if (def_menu) { item_add_str(" (%s)", _(menu_get_prompt(def_menu))); item_add_str(" --->"); if (def_menu->list) { indent += 2; build_conf(def_menu); indent -= 2; } } return; } } else { if (menu == current_menu) { item_make(menu, ':', "---%*c%s", indent + 1, ' ', _(menu_get_prompt(menu))); goto conf_childs; } child_count++; val = sym_get_tristate_value(sym); if (sym_is_choice_value(sym) && val == yes) { item_make(menu, ':', " "); } else { switch (type) { case S_BOOLEAN: if (sym_is_changable(sym)) item_make(menu, 't', "[%c]", val == no ? ' ' : '*'); else item_make(menu, 't', "-%c-", val == no ? ' ' : '*'); break; case S_TRISTATE: switch (val) { case yes: ch = '*'; break; case mod: ch = 'M'; break; default: ch = ' '; break; } if (sym_is_changable(sym)) { if (sym->rev_dep.tri == mod) item_make(menu, 't', "{%c}", ch); else item_make(menu, 't', "<%c>", ch); } else item_make(menu, 't', "-%c-", ch); break; default: tmp = 2 + strlen(sym_get_string_value(sym)); item_make(menu, 's', " (%s)", sym_get_string_value(sym)); tmp = indent - tmp + 4; if (tmp < 0) tmp = 0; item_add_str("%*c%s%s", tmp, ' ', _(menu_get_prompt(menu)), (sym_has_value(sym) || !sym_is_changable(sym)) ? "" : _(" (NEW)")); goto conf_childs; } } item_add_str("%*c%s%s", indent + 1, ' ', _(menu_get_prompt(menu)), (sym_has_value(sym) || !sym_is_changable(sym)) ? "" : _(" (NEW)")); if (menu->prompt && menu->prompt->type == P_MENU) { item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->"); return; } } conf_childs: indent += doint; for (child = menu->list; child; child = child->next) build_conf(child); indent -= doint; } static void reset_menu(void) { unpost_menu(curses_menu); clean_items(); } /* adjust the menu to show this item. * prefer not to scroll the menu if possible*/ static void center_item(int selected_index, int *last_top_row) { int toprow; set_top_row(curses_menu, *last_top_row); toprow = top_row(curses_menu); if (selected_index < toprow || selected_index >= toprow+mwin_max_lines) { toprow = max(selected_index-mwin_max_lines/2, 0); if (toprow >= item_count(curses_menu)-mwin_max_lines) toprow = item_count(curses_menu)-mwin_max_lines; set_top_row(curses_menu, toprow); } set_current_item(curses_menu, curses_menu_items[selected_index]); *last_top_row = toprow; post_menu(curses_menu); refresh_all_windows(main_window); } /* this function assumes reset_menu has been called before */ static void show_menu(const char *prompt, const char *instructions, int selected_index, int *last_top_row) { int maxx, maxy; WINDOW *menu_window; current_instructions = instructions; clear(); (void) wattrset(main_window, attributes[NORMAL]); print_in_middle(stdscr, 1, 0, getmaxx(stdscr), menu_backtitle, attributes[MAIN_HEADING]); (void) wattrset(main_window, attributes[MAIN_MENU_BOX]); box(main_window, 0, 0); (void) wattrset(main_window, attributes[MAIN_MENU_HEADING]); mvwprintw(main_window, 0, 3, " %s ", prompt); (void) wattrset(main_window, attributes[NORMAL]); set_menu_items(curses_menu, curses_menu_items); /* position the menu at the middle of the screen */ scale_menu(curses_menu, &maxy, &maxx); maxx = min(maxx, mwin_max_cols-2); maxy = mwin_max_lines; menu_window = derwin(main_window, maxy, maxx, 2, (mwin_max_cols-maxx)/2); keypad(menu_window, TRUE); set_menu_win(curses_menu, menu_window); set_menu_sub(curses_menu, menu_window); /* must reassert this after changing items, otherwise returns to a * default of 16 */ set_menu_format(curses_menu, maxy, 1); center_item(selected_index, last_top_row); set_menu_format(curses_menu, maxy, 1); print_function_line(); /* Post the menu */ post_menu(curses_menu); refresh_all_windows(main_window); } static void adj_match_dir(match_f *match_direction) { if (*match_direction == FIND_NEXT_MATCH_DOWN) *match_direction = MATCH_TINKER_PATTERN_DOWN; else if (*match_direction == FIND_NEXT_MATCH_UP) *match_direction = MATCH_TINKER_PATTERN_UP; /* else, do no change.. */ } struct match_state { int in_search; match_f match_direction; char pattern[256]; }; /* Return 0 means I have handled the key. In such a case, ans should hold the * item to center, or -1 otherwise. * Else return -1 . */ static int do_match(int key, struct match_state *state, int *ans) { char c = (char) key; int terminate_search = 0; *ans = -1; if (key == '/' || (state->in_search && key == 27)) { move(0, 0); refresh(); clrtoeol(); state->in_search = 1-state->in_search; bzero(state->pattern, sizeof(state->pattern)); state->match_direction = MATCH_TINKER_PATTERN_DOWN; return 0; } else if (!state->in_search) return 1; if (isalnum(c) || isgraph(c) || c == ' ') { state->pattern[strlen(state->pattern)] = c; state->pattern[strlen(state->pattern)] = '\0'; adj_match_dir(&state->match_direction); *ans = get_mext_match(state->pattern, state->match_direction); } else if (key == KEY_DOWN) { state->match_direction = FIND_NEXT_MATCH_DOWN; *ans = get_mext_match(state->pattern, state->match_direction); } else if (key == KEY_UP) { state->match_direction = FIND_NEXT_MATCH_UP; *ans = get_mext_match(state->pattern, state->match_direction); } else if (key == KEY_BACKSPACE || key == 127) { state->pattern[strlen(state->pattern)-1] = '\0'; adj_match_dir(&state->match_direction); } else terminate_search = 1; if (terminate_search) { state->in_search = 0; bzero(state->pattern, sizeof(state->pattern)); move(0, 0); refresh(); clrtoeol(); return -1; } return 0; } static void conf(struct menu *menu) { struct menu *submenu = 0; const char *prompt = menu_get_prompt(menu); struct symbol *sym; int res; int current_index = 0; int last_top_row = 0; struct match_state match_state = { .in_search = 0, .match_direction = MATCH_TINKER_PATTERN_DOWN, .pattern = "", }; while (!global_exit) { reset_menu(); current_menu = menu; build_conf(menu); if (!child_count) break; show_menu(prompt ? _(prompt) : _("Main Menu"), _(menu_instructions), current_index, &last_top_row); keypad((menu_win(curses_menu)), TRUE); while (!global_exit) { if (match_state.in_search) { mvprintw(0, 0, "searching: %s", match_state.pattern); clrtoeol(); } refresh_all_windows(main_window); res = wgetch(menu_win(curses_menu)); if (!res) break; if (do_match(res, &match_state, &current_index) == 0) { if (current_index != -1) center_item(current_index, &last_top_row); continue; } if (process_special_keys(&res, (struct menu *) item_data())) break; switch (res) { case KEY_DOWN: menu_driver(curses_menu, REQ_DOWN_ITEM); break; case KEY_UP: menu_driver(curses_menu, REQ_UP_ITEM); break; case KEY_NPAGE: menu_driver(curses_menu, REQ_SCR_DPAGE); break; case KEY_PPAGE: menu_driver(curses_menu, REQ_SCR_UPAGE); break; case KEY_HOME: menu_driver(curses_menu, REQ_FIRST_ITEM); break; case KEY_END: menu_driver(curses_menu, REQ_LAST_ITEM); break; case 'h': case '?': show_help((struct menu *) item_data()); break; } if (res == 10 || res == 27 || res == 32 || res == 'n' || res == 'y' || res == KEY_LEFT || res == KEY_RIGHT || res == 'm') break; refresh_all_windows(main_window); } refresh_all_windows(main_window); /* if ESC or left*/ if (res == 27 || (menu != &rootmenu && res == KEY_LEFT)) break; /* remember location in the menu */ last_top_row = top_row(curses_menu); current_index = curses_item_index(); if (!item_tag()) continue; submenu = (struct menu *) item_data(); if (!submenu || !menu_is_visible(submenu)) continue; sym = submenu->sym; switch (res) { case ' ': if (item_is_tag('t')) sym_toggle_tristate_value(sym); else if (item_is_tag('m')) conf(submenu); break; case KEY_RIGHT: case 10: /* ENTER WAS PRESSED */ switch (item_tag()) { case 'm': if (single_menu_mode) submenu->data = (void *) (long) !submenu->data; else conf(submenu); break; case 't': if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes) conf_choice(submenu); else if (submenu->prompt && submenu->prompt->type == P_MENU) conf(submenu); else if (res == 10) sym_toggle_tristate_value(sym); break; case 's': conf_string(submenu); break; } break; case 'y': if (item_is_tag('t')) { if (sym_set_tristate_value(sym, yes)) break; if (sym_set_tristate_value(sym, mod)) btn_dialog(main_window, setmod_text, 0); } break; case 'n': if (item_is_tag('t')) sym_set_tristate_value(sym, no); break; case 'm': if (item_is_tag('t')) sym_set_tristate_value(sym, mod); break; } } } static void conf_message_callback(const char *fmt, va_list ap) { char buf[1024]; vsnprintf(buf, sizeof(buf), fmt, ap); btn_dialog(main_window, buf, 1, "<OK>"); } static void show_help(struct menu *menu) { struct gstr help; if (!menu) return; help = str_new(); menu_get_ext_help(menu, &help); show_scroll_win(main_window, _(menu_get_prompt(menu)), str_get(&help)); str_free(&help); } static void conf_choice(struct menu *menu) { const char *prompt = _(menu_get_prompt(menu)); struct menu *child = 0; struct symbol *active; int selected_index = 0; int last_top_row = 0; int res, i = 0; struct match_state match_state = { .in_search = 0, .match_direction = MATCH_TINKER_PATTERN_DOWN, .pattern = "", }; active = sym_get_choice_value(menu->sym); /* this is mostly duplicated from the conf() function. */ while (!global_exit) { reset_menu(); for (i = 0, child = menu->list; child; child = child->next) { if (!show_all_items && !menu_is_visible(child)) continue; if (child->sym == sym_get_choice_value(menu->sym)) item_make(child, ':', "<X> %s", _(menu_get_prompt(child))); else if (child->sym) item_make(child, ':', " %s", _(menu_get_prompt(child))); else item_make(child, ':', "*** %s ***", _(menu_get_prompt(child))); if (child->sym == active){ last_top_row = top_row(curses_menu); selected_index = i; } i++; } show_menu(prompt ? _(prompt) : _("Choice Menu"), _(radiolist_instructions), selected_index, &last_top_row); while (!global_exit) { if (match_state.in_search) { mvprintw(0, 0, "searching: %s", match_state.pattern); clrtoeol(); } refresh_all_windows(main_window); res = wgetch(menu_win(curses_menu)); if (!res) break; if (do_match(res, &match_state, &selected_index) == 0) { if (selected_index != -1) center_item(selected_index, &last_top_row); continue; } if (process_special_keys( &res, (struct menu *) item_data())) break; switch (res) { case KEY_DOWN: menu_driver(curses_menu, REQ_DOWN_ITEM); break; case KEY_UP: menu_driver(curses_menu, REQ_UP_ITEM); break; case KEY_NPAGE: menu_driver(curses_menu, REQ_SCR_DPAGE); break; case KEY_PPAGE: menu_driver(curses_menu, REQ_SCR_UPAGE); break; case KEY_HOME: menu_driver(curses_menu, REQ_FIRST_ITEM); break; case KEY_END: menu_driver(curses_menu, REQ_LAST_ITEM); break; case 'h': case '?': show_help((struct menu *) item_data()); break; } if (res == 10 || res == 27 || res == ' ' || res == KEY_LEFT){ break; } refresh_all_windows(main_window); } /* if ESC or left */ if (res == 27 || res == KEY_LEFT) break; child = item_data(); if (!child || !menu_is_visible(child) || !child->sym) continue; switch (res) { case ' ': case 10: case KEY_RIGHT: sym_set_tristate_value(child->sym, yes); return; case 'h': case '?': show_help(child); active = child->sym; break; case KEY_EXIT: return; } } } static void conf_string(struct menu *menu) { const char *prompt = menu_get_prompt(menu); while (1) { int res; const char *heading; switch (sym_get_type(menu->sym)) { case S_INT: heading = _(inputbox_instructions_int); break; case S_HEX: heading = _(inputbox_instructions_hex); break; case S_STRING: heading = _(inputbox_instructions_string); break; default: heading = _("Internal nconf error!"); } res = dialog_inputbox(main_window, prompt ? _(prompt) : _("Main Menu"), heading, sym_get_string_value(menu->sym), &dialog_input_result, &dialog_input_result_len); switch (res) { case 0: if (sym_set_string_value(menu->sym, dialog_input_result)) return; btn_dialog(main_window, _("You have made an invalid entry."), 0); break; case 1: show_help(menu); break; case KEY_EXIT: return; } } } static void conf_load(void) { while (1) { int res; res = dialog_inputbox(main_window, NULL, load_config_text, filename, &dialog_input_result, &dialog_input_result_len); switch (res) { case 0: if (!dialog_input_result[0]) return; if (!conf_read(dialog_input_result)) { set_config_filename(dialog_input_result); sym_set_change_count(1); return; } btn_dialog(main_window, _("File does not exist!"), 0); break; case 1: show_scroll_win(main_window, _("Load Alternate Configuration"), load_config_help); break; case KEY_EXIT: return; } } } static void conf_save(void) { while (1) { int res; res = dialog_inputbox(main_window, NULL, save_config_text, filename, &dialog_input_result, &dialog_input_result_len); switch (res) { case 0: if (!dialog_input_result[0]) return; res = conf_write(dialog_input_result); if (!res) { set_config_filename(dialog_input_result); return; } btn_dialog(main_window, _("Can't create file! " "Probably a nonexistent directory."), 1, "<OK>"); break; case 1: show_scroll_win(main_window, _("Save Alternate Configuration"), save_config_help); break; case KEY_EXIT: return; } } } void setup_windows(void) { int lines, columns; getmaxyx(stdscr, lines, columns); if (main_window != NULL) delwin(main_window); /* set up the menu and menu window */ main_window = newwin(lines-2, columns-2, 2, 1); keypad(main_window, TRUE); mwin_max_lines = lines-7; mwin_max_cols = columns-6; /* panels order is from bottom to top */ new_panel(main_window); } int main(int ac, char **av) { int lines, columns; char *mode; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); if (ac > 1 && strcmp(av[1], "-s") == 0) { /* Silence conf_read() until the real callback is set up */ conf_set_message_callback(NULL); av++; } conf_parse(av[1]); conf_read(NULL); mode = getenv("NCONFIG_MODE"); if (mode) { if (!strcasecmp(mode, "single_menu")) single_menu_mode = 1; } /* Initialize curses */ initscr(); /* set color theme */ set_colors(); cbreak(); noecho(); keypad(stdscr, TRUE); curs_set(0); getmaxyx(stdscr, lines, columns); if (columns < 75 || lines < 20) { endwin(); printf("Your terminal should have at " "least 20 lines and 75 columns\n"); return 1; } notimeout(stdscr, FALSE); #if NCURSES_REENTRANT set_escdelay(1); #else ESCDELAY = 1; #endif /* set btns menu */ curses_menu = new_menu(curses_menu_items); menu_opts_off(curses_menu, O_SHOWDESC); menu_opts_on(curses_menu, O_SHOWMATCH); menu_opts_on(curses_menu, O_ONEVALUE); menu_opts_on(curses_menu, O_NONCYCLIC); menu_opts_on(curses_menu, O_IGNORECASE); set_menu_mark(curses_menu, " "); set_menu_fore(curses_menu, attributes[MAIN_MENU_FORE]); set_menu_back(curses_menu, attributes[MAIN_MENU_BACK]); set_menu_grey(curses_menu, attributes[MAIN_MENU_GREY]); set_config_filename(conf_get_configname()); setup_windows(); /* check for KEY_FUNC(1) */ if (has_key(KEY_F(1)) == FALSE) { show_scroll_win(main_window, _("Instructions"), _(menu_no_f_instructions)); } conf_set_message_callback(conf_message_callback); /* do the work */ while (!global_exit) { conf(&rootmenu); if (!global_exit && do_exit() == 0) break; } /* ok, we are done */ unpost_menu(curses_menu); free_menu(curses_menu); delwin(main_window); clear(); refresh(); endwin(); return 0; }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <Scheme LastUpgradeVersion = "0700" version = "1.3"> <BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> <BuildActionEntries> <BuildActionEntry buildForAnalyzing = "YES" buildForTesting = "YES" buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES"> <BuildableReference BuildableIdentifier = 'primary' BlueprintIdentifier = '9E033EDB5EC0819481B0546434FA577B' BlueprintName = 'AFNetworking' ReferencedContainer = 'container:Pods.xcodeproj' BuildableName = 'libAFNetworking.a'> </BuildableReference> </BuildActionEntry> </BuildActionEntries> </BuildAction> <TestAction selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES" buildConfiguration = "Debug"> <AdditionalOptions> </AdditionalOptions> </TestAction> <LaunchAction selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" buildConfiguration = "Debug" allowLocationSimulation = "YES"> <AdditionalOptions> </AdditionalOptions> </LaunchAction> <ProfileAction savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" buildConfiguration = "Release" shouldUseLaunchSchemeArgsEnv = "YES"> </ProfileAction> <AnalyzeAction buildConfiguration = "Debug"> </AnalyzeAction> <ArchiveAction buildConfiguration = "Release" revealArchiveInOrganizer = "YES"> </ArchiveAction> </Scheme>
{ "pile_set_name": "Github" }
/* * Copyright (C) 2006, 2007 Apple Inc. * Copyright (C) 2006 Samuel Weinig <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ module html { interface [ GenerateConstructor, InterfaceUUID=3f9c6e17-ee0c-43de-94b0-2a21b19b612c, ImplementationUUID=159bb8fe-ffee-4ff9-b507-76741118143f ] HTMLTableElement : HTMLElement { // could raise excepetions on setting. attribute HTMLTableCaptionElement caption setter raises(DOMException); attribute HTMLTableSectionElement tHead setter raises(DOMException); attribute HTMLTableSectionElement tFoot setter raises(DOMException); readonly attribute HTMLCollection rows; readonly attribute HTMLCollection tBodies; attribute [ConvertNullToNullString] DOMString align; attribute [ConvertNullToNullString] DOMString bgColor; attribute [ConvertNullToNullString] DOMString border; attribute [ConvertNullToNullString] DOMString cellPadding; attribute [ConvertNullToNullString] DOMString cellSpacing; // FIXME: the obj-c attribute is called frameBorders attribute [ConvertNullToNullString] DOMString frame; attribute [ConvertNullToNullString] DOMString rules; attribute [ConvertNullToNullString] DOMString summary; attribute [ConvertNullToNullString] DOMString width; HTMLElement createTHead(); void deleteTHead(); HTMLElement createTFoot(); void deleteTFoot(); HTMLElement createCaption(); void deleteCaption(); HTMLElement insertRow(in long index) raises(DOMException); void deleteRow(in long index) raises(DOMException); }; }
{ "pile_set_name": "Github" }
// // FirefoxUrlInfoInquirer.m // PageVisitedCaptureManager // // Created by Makara Khloth on 3/6/15. // // #import "FirefoxUrlInfoInquirer.h" #import "FirefoxProfileManager.h" #import "DebugStatus.h" #import "FMDatabase.h" #import "FMResultSet.h" @implementation FirefoxUrlInfoInquirer @synthesize mFirefoxPID, mFirefoxDatabasePath; - (instancetype) initWithFirefoxPID: (pid_t) aPID { NSString *placesPath = [[FirefoxProfileManager sharedManager] getPlacesPathOfPID:aPID]; if (placesPath) { self = [super init]; if (self) { self.mFirefoxPID = aPID; self.mFirefoxDatabasePath = placesPath; } return self; } else { return nil; } } - (NSDictionary *) lastUrlInfo { NSDictionary *urlInfo = nil; if (self.mFirefoxDatabasePath == nil) { self.mFirefoxDatabasePath = [self getActivePlacesPath]; } if ([self.mFirefoxDatabasePath length] > 0) { FMDatabase *db = [FMDatabase databaseWithPath:self.mFirefoxDatabasePath]; [db open]; NSString *sql = @"select * from moz_places where id in (select place_id from moz_historyvisits where visit_date = (select max(visit_date) from moz_historyvisits))"; FMResultSet *rs = [db executeQuery:sql]; if ([rs next]) { NSString *url = [rs stringForColumn:@"url"]; NSString *title = [rs stringForColumn:@"title"]; DLog(@"url = %@", url); DLog(@"title = %@", title); urlInfo = [NSDictionary dictionaryWithObjectsAndKeys:url, @"url", title, @"title", nil]; } [db close]; } return (urlInfo); } - (NSString *) urlWithTitle: (NSString *) aTitle { NSString *URL = nil; if (self.mFirefoxDatabasePath == nil) { self.mFirefoxDatabasePath = [self getActivePlacesPath]; } if ([self.mFirefoxDatabasePath length] > 0) { FMDatabase *db = [FMDatabase databaseWithPath:self.mFirefoxDatabasePath]; [db open]; NSString *sql = @"select * from moz_places where title = ? order by id desc limit 1"; FMResultSet *rs = [db executeQuery:sql, aTitle]; if ([rs next]) { NSString *url = [rs stringForColumn:@"url"]; NSString *title = [rs stringForColumn:@"title"]; DLog(@"url = %@", url); DLog(@"title = %@", title); URL = url; } [db close]; } return (URL); } - (NSString *) getActivePlacesPath { NSString *activePlacesPath = nil; NSFileManager *fileManager = [NSFileManager defaultManager]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); NSString *applicationSupportPath = [paths firstObject]; NSString *firefoxApplicationSupport = [applicationSupportPath stringByAppendingString:@"/Firefox/Profiles/"]; NSMutableArray *placesPaths = [NSMutableArray arrayWithCapacity:1]; NSArray *fileItems = [fileManager contentsOfDirectoryAtPath:firefoxApplicationSupport error:nil]; for (NSString *fileItem in fileItems) { NSString *fullPath = [firefoxApplicationSupport stringByAppendingString:fileItem]; NSDictionary *fileAttr = [fileManager attributesOfItemAtPath:fullPath error:nil]; if ([[fileAttr fileType] isEqualToString:NSFileTypeDirectory]) { fullPath = [fullPath stringByAppendingString:@"/places.sqlite"]; if ([fileManager fileExistsAtPath:fullPath]) { [placesPaths addObject:fullPath]; } } } activePlacesPath = [placesPaths firstObject]; NSDate *placesModificationDate = [[fileManager attributesOfItemAtPath:activePlacesPath error:nil] fileModificationDate]; for (int i = 1; i < placesPaths.count; i++) { NSString *anotherPlacesPath = [placesPaths objectAtIndex:i];; NSDate *anotherPlacesModificationDate = [[fileManager attributesOfItemAtPath:anotherPlacesPath error:nil] fileModificationDate]; if ([placesModificationDate compare:anotherPlacesModificationDate] == NSOrderedAscending) { // placesModificationDate < anotherPlacesModificationDate placesModificationDate = anotherPlacesModificationDate; activePlacesPath = anotherPlacesPath; } } DLog(@"activePlacesPath : %@", activePlacesPath); return activePlacesPath; } - (void) dealloc { [mFirefoxDatabasePath release]; [super dealloc]; } @end
{ "pile_set_name": "Github" }
var baseExtremum = require('./_baseExtremum'), baseGt = require('./_baseGt'), baseIteratee = require('./_baseIteratee'); /** * This method is like `_.max` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * the value is ranked. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {*} Returns the maximum value. * @example * * var objects = [{ 'n': 1 }, { 'n': 2 }]; * * _.maxBy(objects, function(o) { return o.n; }); * // => { 'n': 2 } * * // The `_.property` iteratee shorthand. * _.maxBy(objects, 'n'); * // => { 'n': 2 } */ function maxBy(array, iteratee) { return (array && array.length) ? baseExtremum(array, baseIteratee(iteratee, 2), baseGt) : undefined; } module.exports = maxBy;
{ "pile_set_name": "Github" }
/* Copyright (c) 2015-2018 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Language: Verilog 2001 `timescale 1ns / 1ps /* * Testbench for axis_frame_length_adjust_fifo */ module test_axis_frame_length_adjust_fifo; // Parameters parameter DATA_WIDTH = 8; parameter KEEP_ENABLE = (DATA_WIDTH>8); parameter KEEP_WIDTH = (DATA_WIDTH/8); parameter ID_ENABLE = 1; parameter ID_WIDTH = 8; parameter DEST_ENABLE = 1; parameter DEST_WIDTH = 8; parameter USER_ENABLE = 1; parameter USER_WIDTH = 1; parameter FRAME_FIFO_DEPTH = 4096; parameter HEADER_FIFO_DEPTH = 8; // Inputs reg clk = 0; reg rst = 0; reg [7:0] current_test = 0; reg [DATA_WIDTH-1:0] s_axis_tdata = 0; reg [KEEP_WIDTH-1:0] s_axis_tkeep = 0; reg s_axis_tvalid = 0; reg s_axis_tlast = 0; reg [ID_WIDTH-1:0] s_axis_tid = 0; reg [DEST_WIDTH-1:0] s_axis_tdest = 0; reg [USER_WIDTH-1:0] s_axis_tuser = 0; reg m_axis_hdr_ready = 0; reg m_axis_tready = 0; reg [15:0] length_min = 0; reg [15:0] length_max = 0; // Outputs wire s_axis_tready; wire [DATA_WIDTH-1:0] m_axis_tdata; wire [KEEP_WIDTH-1:0] m_axis_tkeep; wire m_axis_tvalid; wire m_axis_tlast; wire [ID_WIDTH-1:0] m_axis_tid; wire [DEST_WIDTH-1:0] m_axis_tdest; wire [USER_WIDTH-1:0] m_axis_tuser; wire m_axis_hdr_valid; wire m_axis_hdr_pad; wire m_axis_hdr_truncate; wire [15:0] m_axis_hdr_length; wire [15:0] m_axis_hdr_original_length; initial begin // myhdl integration $from_myhdl( clk, rst, current_test, s_axis_tdata, s_axis_tkeep, s_axis_tvalid, s_axis_tlast, s_axis_tid, s_axis_tdest, s_axis_tuser, m_axis_hdr_ready, m_axis_tready, length_min, length_max ); $to_myhdl( s_axis_tready, m_axis_hdr_valid, m_axis_hdr_pad, m_axis_hdr_truncate, m_axis_hdr_length, m_axis_hdr_original_length, m_axis_tdata, m_axis_tkeep, m_axis_tvalid, m_axis_tlast, m_axis_tid, m_axis_tdest, m_axis_tuser ); // dump file $dumpfile("test_axis_frame_length_adjust_fifo.lxt"); $dumpvars(0, test_axis_frame_length_adjust_fifo); end axis_frame_length_adjust_fifo #( .DATA_WIDTH(DATA_WIDTH), .KEEP_ENABLE(KEEP_ENABLE), .KEEP_WIDTH(KEEP_WIDTH), .ID_ENABLE(ID_ENABLE), .ID_WIDTH(ID_WIDTH), .DEST_ENABLE(DEST_ENABLE), .DEST_WIDTH(DEST_WIDTH), .USER_ENABLE(USER_ENABLE), .USER_WIDTH(USER_WIDTH), .FRAME_FIFO_DEPTH(FRAME_FIFO_DEPTH), .HEADER_FIFO_DEPTH(HEADER_FIFO_DEPTH) ) UUT ( .clk(clk), .rst(rst), // AXI input .s_axis_tdata(s_axis_tdata), .s_axis_tkeep(s_axis_tkeep), .s_axis_tvalid(s_axis_tvalid), .s_axis_tready(s_axis_tready), .s_axis_tlast(s_axis_tlast), .s_axis_tid(s_axis_tid), .s_axis_tdest(s_axis_tdest), .s_axis_tuser(s_axis_tuser), // AXI output .m_axis_hdr_valid(m_axis_hdr_valid), .m_axis_hdr_ready(m_axis_hdr_ready), .m_axis_hdr_pad(m_axis_hdr_pad), .m_axis_hdr_truncate(m_axis_hdr_truncate), .m_axis_hdr_length(m_axis_hdr_length), .m_axis_hdr_original_length(m_axis_hdr_original_length), .m_axis_tdata(m_axis_tdata), .m_axis_tkeep(m_axis_tkeep), .m_axis_tvalid(m_axis_tvalid), .m_axis_tready(m_axis_tready), .m_axis_tlast(m_axis_tlast), .m_axis_tid(m_axis_tid), .m_axis_tdest(m_axis_tdest), .m_axis_tuser(m_axis_tuser), // Configuration .length_min(length_min), .length_max(length_max) ); endmodule
{ "pile_set_name": "Github" }
/* ============================================================================== This file is part of the JUCE library. Copyright (c) 2020 - Raw Material Software Limited JUCE is an open source library subject to commercial or open-source licensing. By using JUCE, you agree to the terms of both the JUCE 6 End-User License Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). End User License Agreement: www.juce.com/juce-6-licence Privacy Policy: www.juce.com/juce-privacy-policy Or: You may also use this code under the terms of the GPL v3 (see www.gnu.org/licenses). JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE DISCLAIMED. ============================================================================== */ #pragma once //============================================================================== class ModuleDescription { public: ModuleDescription() = default; ModuleDescription (const File& folder) : moduleFolder (folder), moduleInfo (parseJUCEHeaderMetadata (getHeader())) { } bool isValid() const { return getID().isNotEmpty(); } String getID() const { return moduleInfo [Ids::ID_uppercase].toString(); } String getVendor() const { return moduleInfo [Ids::vendor].toString(); } String getVersion() const { return moduleInfo [Ids::version].toString(); } String getName() const { return moduleInfo [Ids::name].toString(); } String getDescription() const { return moduleInfo [Ids::description].toString(); } String getLicense() const { return moduleInfo [Ids::license].toString(); } String getMinimumCppStandard() const { return moduleInfo [Ids::minimumCppStandard].toString(); } String getPreprocessorDefs() const { return moduleInfo [Ids::defines].toString(); } String getExtraSearchPaths() const { return moduleInfo [Ids::searchpaths].toString(); } var getModuleInfo() const { return moduleInfo; } File getModuleFolder() const { return moduleFolder; } File getFolder() const { jassert (moduleFolder != File()); return moduleFolder; } File getHeader() const { if (moduleFolder != File()) { static const char* extensions[] = { ".h", ".hpp", ".hxx" }; for (auto e : extensions) { auto header = moduleFolder.getChildFile (moduleFolder.getFileName() + e); if (header.existsAsFile()) return header; } } return {}; } StringArray getDependencies() const { auto moduleDependencies = StringArray::fromTokens (moduleInfo ["dependencies"].toString(), " \t;,", "\"'"); moduleDependencies.trim(); moduleDependencies.removeEmptyStrings(); return moduleDependencies; } private: File moduleFolder; var moduleInfo; URL url; };
{ "pile_set_name": "Github" }
/* Simple DirectMedia Layer Copyright (C) 1997-2013 Sam Lantinga <[email protected]> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ /** * \file SDL_render.h * * Header file for SDL 2D rendering functions. * * This API supports the following features: * * single pixel points * * single pixel lines * * filled rectangles * * texture images * * The primitives may be drawn in opaque, blended, or additive modes. * * The texture images may be drawn in opaque, blended, or additive modes. * They can have an additional color tint or alpha modulation applied to * them, and may also be stretched with linear interpolation. * * This API is designed to accelerate simple 2D operations. You may * want more functionality such as polygons and particle effects and * in that case you should use SDL's OpenGL/Direct3D support or one * of the many good 3D engines. * * These functions must be called from the main thread. * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 */ #ifndef _SDL_render_h #define _SDL_render_h #include "SDL_stdinc.h" #include "SDL_rect.h" #include "SDL_video.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /** * \brief Flags used when creating a rendering context */ typedef enum { SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */ SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware acceleration */ SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized with the refresh rate */ SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports rendering to texture */ } SDL_RendererFlags; /** * \brief Information on the capabilities of a render driver or context. */ typedef struct SDL_RendererInfo { const char *name; /**< The name of the renderer */ Uint32 flags; /**< Supported ::SDL_RendererFlags */ Uint32 num_texture_formats; /**< The number of available texture formats */ Uint32 texture_formats[16]; /**< The available texture formats */ int max_texture_width; /**< The maximimum texture width */ int max_texture_height; /**< The maximimum texture height */ } SDL_RendererInfo; /** * \brief The access pattern allowed for a texture. */ typedef enum { SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */ SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */ } SDL_TextureAccess; /** * \brief The texture channel modulation used in SDL_RenderCopy(). */ typedef enum { SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ } SDL_TextureModulate; /** * \brief Flip constants for SDL_RenderCopyEx */ typedef enum { SDL_FLIP_NONE = 0x00000000, /**< Do not flip */ SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */ SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */ } SDL_RendererFlip; /** * \brief A structure representing rendering state */ struct SDL_Renderer; typedef struct SDL_Renderer SDL_Renderer; /** * \brief An efficient driver-specific representation of pixel data */ struct SDL_Texture; typedef struct SDL_Texture SDL_Texture; /* Function prototypes */ /** * \brief Get the number of 2D rendering drivers available for the current * display. * * A render driver is a set of code that handles rendering and texture * management on a particular display. Normally there is only one, but * some drivers may have several available with different capabilities. * * \sa SDL_GetRenderDriverInfo() * \sa SDL_CreateRenderer() */ extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); /** * \brief Get information about a specific 2D rendering driver for the current * display. * * \param index The index of the driver to query information about. * \param info A pointer to an SDL_RendererInfo struct to be filled with * information on the rendering driver. * * \return 0 on success, -1 if the index was out of range. * * \sa SDL_CreateRenderer() */ extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, SDL_RendererInfo * info); /** * \brief Create a window and default renderer * * \param width The width of the window * \param height The height of the window * \param window_flags The flags used to create the window * \param window A pointer filled with the window, or NULL on error * \param renderer A pointer filled with the renderer, or NULL on error * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer( int width, int height, Uint32 window_flags, SDL_Window **window, SDL_Renderer **renderer); /** * \brief Create a 2D rendering context for a window. * * \param window The window where rendering is displayed. * \param index The index of the rendering driver to initialize, or -1 to * initialize the first one supporting the requested flags. * \param flags ::SDL_RendererFlags. * * \return A valid rendering context or NULL if there was an error. * * \sa SDL_CreateSoftwareRenderer() * \sa SDL_GetRendererInfo() * \sa SDL_DestroyRenderer() */ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags); /** * \brief Create a 2D software rendering context for a surface. * * \param surface The surface where rendering is done. * * \return A valid rendering context or NULL if there was an error. * * \sa SDL_CreateRenderer() * \sa SDL_DestroyRenderer() */ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface); /** * \brief Get the renderer associated with a window. */ extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window); /** * \brief Get information about a rendering context. */ extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer, SDL_RendererInfo * info); /** * \brief Get the output size of a rendering context. */ extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer, int *w, int *h); /** * \brief Create a texture for a rendering context. * * \param renderer The renderer. * \param format The format of the texture. * \param access One of the enumerated values in ::SDL_TextureAccess. * \param w The width of the texture in pixels. * \param h The height of the texture in pixels. * * \return The created texture is returned, or 0 if no rendering context was * active, the format was unsupported, or the width or height were out * of range. * * \sa SDL_QueryTexture() * \sa SDL_UpdateTexture() * \sa SDL_DestroyTexture() */ extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int h); /** * \brief Create a texture from an existing surface. * * \param renderer The renderer. * \param surface The surface containing pixel data used to fill the texture. * * \return The created texture is returned, or 0 on error. * * \note The surface is not modified or freed by this function. * * \sa SDL_QueryTexture() * \sa SDL_DestroyTexture() */ extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface); /** * \brief Query the attributes of a texture * * \param texture A texture to be queried. * \param format A pointer filled in with the raw format of the texture. The * actual format may differ, but pixel transfers will use this * format. * \param access A pointer filled in with the actual access to the texture. * \param w A pointer filled in with the width of the texture in pixels. * \param h A pointer filled in with the height of the texture in pixels. * * \return 0 on success, or -1 if the texture is not valid. */ extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture, Uint32 * format, int *access, int *w, int *h); /** * \brief Set an additional color value used in render copy operations. * * \param texture The texture to update. * \param r The red color value multiplied into copy operations. * \param g The green color value multiplied into copy operations. * \param b The blue color value multiplied into copy operations. * * \return 0 on success, or -1 if the texture is not valid or color modulation * is not supported. * * \sa SDL_GetTextureColorMod() */ extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture, Uint8 r, Uint8 g, Uint8 b); /** * \brief Get the additional color value used in render copy operations. * * \param texture The texture to query. * \param r A pointer filled in with the current red color value. * \param g A pointer filled in with the current green color value. * \param b A pointer filled in with the current blue color value. * * \return 0 on success, or -1 if the texture is not valid. * * \sa SDL_SetTextureColorMod() */ extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture, Uint8 * r, Uint8 * g, Uint8 * b); /** * \brief Set an additional alpha value used in render copy operations. * * \param texture The texture to update. * \param alpha The alpha value multiplied into copy operations. * * \return 0 on success, or -1 if the texture is not valid or alpha modulation * is not supported. * * \sa SDL_GetTextureAlphaMod() */ extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture, Uint8 alpha); /** * \brief Get the additional alpha value used in render copy operations. * * \param texture The texture to query. * \param alpha A pointer filled in with the current alpha value. * * \return 0 on success, or -1 if the texture is not valid. * * \sa SDL_SetTextureAlphaMod() */ extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture, Uint8 * alpha); /** * \brief Set the blend mode used for texture copy operations. * * \param texture The texture to update. * \param blendMode ::SDL_BlendMode to use for texture blending. * * \return 0 on success, or -1 if the texture is not valid or the blend mode is * not supported. * * \note If the blend mode is not supported, the closest supported mode is * chosen. * * \sa SDL_GetTextureBlendMode() */ extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode blendMode); /** * \brief Get the blend mode used for texture copy operations. * * \param texture The texture to query. * \param blendMode A pointer filled in with the current blend mode. * * \return 0 on success, or -1 if the texture is not valid. * * \sa SDL_SetTextureBlendMode() */ extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode); /** * \brief Update the given texture rectangle with new pixel data. * * \param texture The texture to update * \param rect A pointer to the rectangle of pixels to update, or NULL to * update the entire texture. * \param pixels The raw pixel data. * \param pitch The number of bytes between rows of pixel data. * * \return 0 on success, or -1 if the texture is not valid. * * \note This is a fairly slow function. */ extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch); /** * \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data. * * \param texture The texture to update * \param rect A pointer to the rectangle of pixels to update, or NULL to * update the entire texture. * \param Yplane The raw pixel data for the Y plane. * \param Ypitch The number of bytes between rows of pixel data for the Y plane. * \param Uplane The raw pixel data for the U plane. * \param Upitch The number of bytes between rows of pixel data for the U plane. * \param Vplane The raw pixel data for the V plane. * \param Vpitch The number of bytes between rows of pixel data for the V plane. * * \return 0 on success, or -1 if the texture is not valid. * * \note You can use SDL_UpdateTexture() as long as your pixel data is * a contiguous block of Y and U/V planes in the proper order, but * this function is available if your pixel data is not contiguous. */ extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture, const SDL_Rect * rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch); /** * \brief Lock a portion of the texture for write-only pixel access. * * \param texture The texture to lock for access, which was created with * ::SDL_TEXTUREACCESS_STREAMING. * \param rect A pointer to the rectangle to lock for access. If the rect * is NULL, the entire texture will be locked. * \param pixels This is filled in with a pointer to the locked pixels, * appropriately offset by the locked area. * \param pitch This is filled in with the pitch of the locked pixels. * * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING. * * \sa SDL_UnlockTexture() */ extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture, const SDL_Rect * rect, void **pixels, int *pitch); /** * \brief Unlock a texture, uploading the changes to video memory, if needed. * * \sa SDL_LockTexture() */ extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture); /** * \brief Determines whether a window supports the use of render targets * * \param renderer The renderer that will be checked * * \return SDL_TRUE if supported, SDL_FALSE if not. */ extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer); /** * \brief Set a texture as the current rendering target. * * \param renderer The renderer. * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target * * \return 0 on success, or -1 on error * * \sa SDL_GetRenderTarget() */ extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); /** * \brief Get the current render target or NULL for the default render target. * * \return The current render target * * \sa SDL_SetRenderTarget() */ extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer); /** * \brief Set device independent resolution for rendering * * \param renderer The renderer for which resolution should be set. * \param w The width of the logical resolution * \param h The height of the logical resolution * * This function uses the viewport and scaling functionality to allow a fixed logical * resolution for rendering, regardless of the actual output resolution. If the actual * output resolution doesn't have the same aspect ratio the output rendering will be * centered within the output display. * * If the output display is a window, mouse events in the window will be filtered * and scaled so they seem to arrive within the logical resolution. * * \note If this function results in scaling or subpixel drawing by the * rendering backend, it will be handled using the appropriate * quality hints. * * \sa SDL_RenderGetLogicalSize() * \sa SDL_RenderSetScale() * \sa SDL_RenderSetViewport() */ extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h); /** * \brief Get device independent resolution for rendering * * \param renderer The renderer from which resolution should be queried. * \param w A pointer filled with the width of the logical resolution * \param h A pointer filled with the height of the logical resolution * * \sa SDL_RenderSetLogicalSize() */ extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h); /** * \brief Set the drawing area for rendering on the current target. * * \param renderer The renderer for which the drawing area should be set. * \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target. * * The x,y of the viewport rect represents the origin for rendering. * * \return 0 on success, or -1 on error * * \note If the window associated with the renderer is resized, the viewport is automatically reset. * * \sa SDL_RenderGetViewport() * \sa SDL_RenderSetLogicalSize() */ extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer, const SDL_Rect * rect); /** * \brief Get the drawing area for the current target. * * \sa SDL_RenderSetViewport() */ extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, SDL_Rect * rect); /** * \brief Set the clip rectangle for the current target. * * \param renderer The renderer for which clip rectangle should be set. * \param rect A pointer to the rectangle to set as the clip rectangle, or * NULL to disable clipping. * * \return 0 on success, or -1 on error * * \sa SDL_RenderGetClipRect() */ extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect); /** * \brief Get the clip rectangle for the current target. * * \param renderer The renderer from which clip rectangle should be queried. * \param rect A pointer filled in with the current clip rectangle, or * an empty rectangle if clipping is disabled. * * \sa SDL_RenderSetClipRect() */ extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer, SDL_Rect * rect); /** * \brief Set the drawing scale for rendering on the current target. * * \param renderer The renderer for which the drawing scale should be set. * \param scaleX The horizontal scaling factor * \param scaleY The vertical scaling factor * * The drawing coordinates are scaled by the x/y scaling factors * before they are used by the renderer. This allows resolution * independent drawing with a single coordinate system. * * \note If this results in scaling or subpixel drawing by the * rendering backend, it will be handled using the appropriate * quality hints. For best results use integer scaling factors. * * \sa SDL_RenderGetScale() * \sa SDL_RenderSetLogicalSize() */ extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer, float scaleX, float scaleY); /** * \brief Get the drawing scale for the current target. * * \param renderer The renderer from which drawing scale should be queried. * \param scaleX A pointer filled in with the horizontal scaling factor * \param scaleY A pointer filled in with the vertical scaling factor * * \sa SDL_RenderSetScale() */ extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer, float *scaleX, float *scaleY); /** * \brief Set the color used for drawing operations (Rect, Line and Clear). * * \param renderer The renderer for which drawing color should be set. * \param r The red value used to draw on the rendering target. * \param g The green value used to draw on the rendering target. * \param b The blue value used to draw on the rendering target. * \param a The alpha value used to draw on the rendering target, usually * ::SDL_ALPHA_OPAQUE (255). * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDL_SetRenderDrawColor(SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** * \brief Get the color used for drawing operations (Rect, Line and Clear). * * \param renderer The renderer from which drawing color should be queried. * \param r A pointer to the red value used to draw on the rendering target. * \param g A pointer to the green value used to draw on the rendering target. * \param b A pointer to the blue value used to draw on the rendering target. * \param a A pointer to the alpha value used to draw on the rendering target, * usually ::SDL_ALPHA_OPAQUE (255). * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDL_GetRenderDrawColor(SDL_Renderer * renderer, Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a); /** * \brief Set the blend mode used for drawing operations (Fill and Line). * * \param renderer The renderer for which blend mode should be set. * \param blendMode ::SDL_BlendMode to use for blending. * * \return 0 on success, or -1 on error * * \note If the blend mode is not supported, the closest supported mode is * chosen. * * \sa SDL_GetRenderDrawBlendMode() */ extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode); /** * \brief Get the blend mode used for drawing operations. * * \param renderer The renderer from which blend mode should be queried. * \param blendMode A pointer filled in with the current blend mode. * * \return 0 on success, or -1 on error * * \sa SDL_SetRenderDrawBlendMode() */ extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode *blendMode); /** * \brief Clear the current rendering target with the drawing color * * This function clears the entire rendering target, ignoring the viewport. * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer); /** * \brief Draw a point on the current rendering target. * * \param renderer The renderer which should draw a point. * \param x The x coordinate of the point. * \param y The y coordinate of the point. * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer, int x, int y); /** * \brief Draw multiple points on the current rendering target. * * \param renderer The renderer which should draw multiple points. * \param points The points to draw * \param count The number of points to draw * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, int count); /** * \brief Draw a line on the current rendering target. * * \param renderer The renderer which should draw a line. * \param x1 The x coordinate of the start point. * \param y1 The y coordinate of the start point. * \param x2 The x coordinate of the end point. * \param y2 The y coordinate of the end point. * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2); /** * \brief Draw a series of connected lines on the current rendering target. * * \param renderer The renderer which should draw multiple lines. * \param points The points along the lines * \param count The number of points, drawing count-1 lines * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, int count); /** * \brief Draw a rectangle on the current rendering target. * * \param renderer The renderer which should draw a rectangle. * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target. * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer, const SDL_Rect * rect); /** * \brief Draw some number of rectangles on the current rendering target. * * \param renderer The renderer which should draw multiple rectangles. * \param rects A pointer to an array of destination rectangles. * \param count The number of rectangles. * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect * rects, int count); /** * \brief Fill a rectangle on the current rendering target with the drawing color. * * \param renderer The renderer which should fill a rectangle. * \param rect A pointer to the destination rectangle, or NULL for the entire * rendering target. * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer, const SDL_Rect * rect); /** * \brief Fill some number of rectangles on the current rendering target with the drawing color. * * \param renderer The renderer which should fill multiple rectangles. * \param rects A pointer to an array of destination rectangles. * \param count The number of rectangles. * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect * rects, int count); /** * \brief Copy a portion of the texture to the current rendering target. * * \param renderer The renderer which should copy parts of a texture. * \param texture The source texture. * \param srcrect A pointer to the source rectangle, or NULL for the entire * texture. * \param dstrect A pointer to the destination rectangle, or NULL for the * entire rendering target. * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * srcrect, const SDL_Rect * dstrect); /** * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center * * \param renderer The renderer which should copy parts of a texture. * \param texture The source texture. * \param srcrect A pointer to the source rectangle, or NULL for the entire * texture. * \param dstrect A pointer to the destination rectangle, or NULL for the * entire rendering target. * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done aroud dstrect.w/2, dstrect.h/2) * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture * * \return 0 on success, or -1 on error */ extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * srcrect, const SDL_Rect * dstrect, const double angle, const SDL_Point *center, const SDL_RendererFlip flip); /** * \brief Read pixels from the current rendering target. * * \param renderer The renderer from which pixels should be read. * \param rect A pointer to the rectangle to read, or NULL for the entire * render target. * \param format The desired format of the pixel data, or 0 to use the format * of the rendering target * \param pixels A pointer to be filled in with the pixel data * \param pitch The pitch of the pixels parameter. * * \return 0 on success, or -1 if pixel reading is not supported. * * \warning This is a very slow operation, and should not be used frequently. */ extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, Uint32 format, void *pixels, int pitch); /** * \brief Update the screen with rendering performed. */ extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer); /** * \brief Destroy the specified texture. * * \sa SDL_CreateTexture() * \sa SDL_CreateTextureFromSurface() */ extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture); /** * \brief Destroy the rendering context for a window and free associated * textures. * * \sa SDL_CreateRenderer() */ extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer); /** * \brief Bind the texture to the current OpenGL/ES/ES2 context for use with * OpenGL instructions. * * \param texture The SDL texture to bind * \param texw A pointer to a float that will be filled with the texture width * \param texh A pointer to a float that will be filled with the texture height * * \return 0 on success, or -1 if the operation is not supported */ extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh); /** * \brief Unbind a texture from the current OpenGL/ES/ES2 context. * * \param texture The SDL texture to unbind * * \return 0 on success, or -1 if the operation is not supported */ extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* _SDL_render_h */ /* vi: set ts=4 sw=4 expandtab: */
{ "pile_set_name": "Github" }
#!/bin/sh if [ -z "$(uci -q get uhttpd.main.ubus_prefix)" ]; then uci set uhttpd.main.ubus_prefix=/ubus uci commit uhttpd fi exit 0
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Call name="setAttribute"> <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg> <Arg>^$</Arg> </Call> </Configure>
{ "pile_set_name": "Github" }
use crate::config::{ModuleConfig, RootModuleConfig}; use starship_module_config_derive::ModuleConfig; #[derive(Clone, ModuleConfig)] pub struct StatusConfig<'a> { pub format: &'a str, pub symbol: &'a str, pub style: &'a str, pub disabled: bool, } impl<'a> RootModuleConfig<'a> for StatusConfig<'a> { fn new() -> Self { StatusConfig { format: "[$symbol$status]($style) ", symbol: "✖", style: "bold red", disabled: true, } } }
{ "pile_set_name": "Github" }
/* Copyright 2020 Replicated 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. */ // Code generated by client-gen. DO NOT EDIT. // This package contains the scheme of the automatically generated clientset. package scheme
{ "pile_set_name": "Github" }
# Instructions Detailed instructions for running this example can be found at https://vitess.io. This document contains the summary of the commands to be run. ``` # Bring up initial cluster and commerce keyspace ./101_initial_cluster.sh # Setup aliases source alias.source # Insert and verify data mysql < ../common/insert_commerce_data.sql mysql --table < ../common/select_commerce_data.sql # Bring up customer keyspace ./201_customer_tablets.sh # Initiate move tables vtctlclient MoveTables -workflow=commerce2customer commerce customer '{"customer":{}, "corder":{}}' # Validate vtctlclient VDiff customer.commerce2customer # Cut-over vtctlclient SwitchReads -tablet_type=rdonly customer.commerce2customer vtctlclient SwitchReads -tablet_type=replica customer.commerce2customer vtctlclient SwitchWrites customer.commerce2customer # Clean-up vtctlclient DropSources customer.commerce2customer # Prepare for resharding ./301_customer_sharded.sh ./302_new_shards.sh # Reshard vtctlclient Reshard customer.cust2cust '0' '-80,80-' # Validate vtctlclient VDiff customer.cust2cust # Cut-over vtctlclient SwitchReads -tablet_type=rdonly customer.cust2cust vtctlclient SwitchReads -tablet_type=replica customer.cust2cust vtctlclient SwitchWrites customer.cust2cust # Down shard 0 ./306_down_shard_0.sh vtctlclient DeleteShard -recursive customer/0 # Down cluster ./401_teardown.sh ```
{ "pile_set_name": "Github" }
1 12:56:45.3980395268 IP (tos 0x2,ECT(0), ttl 248, id 0, offset 0, flags [none], proto RSVP (46), length 54312, bad cksum 3743 (->3051)!) 54.35.78.33 > 58.16.0.0: RSVPv1 Hello Message (20), Flags: [Refresh reduction capable], length: 65527, ttl: 15, checksum: 0x0902 Generalized UNI Object (229) Flags: [ignore and forward if unknown], Class-Type: 1 (1), length: 12 Subobject Type: Unknown (0), AF: HDLC (4), length: 2 (invalid)
{ "pile_set_name": "Github" }
// // TaskResourceReferenceCell.m // Coding_iOS // // Created by Ease on 16/2/23. // Copyright © 2016年 Coding. All rights reserved. // #import "TaskResourceReferenceCell.h" @interface TaskResourceReferenceCell () @property (strong, nonatomic) UIImageView *imgView; @property (strong, nonatomic) UILabel *codeL, *titleL; @end @implementation TaskResourceReferenceCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { // Initialization code self.accessoryType = UITableViewCellAccessoryDisclosureIndicator; if (!_imgView) { _imgView = [UIImageView new]; _imgView.contentMode = UIViewContentModeCenter; [self.contentView addSubview:_imgView]; } if (!_codeL) { _codeL = ({ UILabel *label = [UILabel new]; label.textColor = kColorBrandBlue; label.font = [UIFont systemFontOfSize:15]; label; }); [self.contentView addSubview:_codeL]; } if (!_titleL) { _titleL = ({ UILabel *label = [UILabel new]; label.textColor = kColor222; label.font = [UIFont systemFontOfSize:15]; label; }); [self.contentView addSubview:_titleL]; } [_imgView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView).offset(0); make.centerY.equalTo(self.contentView); make.size.mas_equalTo(CGSizeMake(44, 44)); }]; [_codeL mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView).offset(45); make.centerY.equalTo(self.contentView); }]; [_titleL mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.codeL.mas_right); make.centerY.equalTo(self.contentView); make.right.lessThanOrEqualTo(self.contentView); }]; } return self; } - (void)setItem:(ResourceReferenceItem *)item{ _item = item; if (!_item) { return; } [_imgView setImage:[UIImage imageNamed:[NSString stringWithFormat:@"task_resource_reference_%@", _item.target_type]] ?: [UIImage imageNamed:@"task_resource_reference_ProjectFile"]]; _codeL.text = [NSString stringWithFormat:@"# %@ ", _item.code.stringValue]; _titleL.text = _item.title; } @end
{ "pile_set_name": "Github" }
- case: result_is_successful disable_cache: false main: | from returns.pipeline import is_successful from returns.result import Result def returns_result() -> Result[int, str]: ... reveal_type(is_successful(returns_result())) # N: Revealed type is 'builtins.bool' - case: ioresult_is_successful disable_cache: false main: | from returns.pipeline import is_successful from returns.io import IOResult def returns_ioresult() -> IOResult[int, str]: ... reveal_type(is_successful(returns_ioresult())) # N: Revealed type is 'builtins.bool' - case: maybe_is_successful disable_cache: false main: | from returns.pipeline import is_successful from returns.maybe import Maybe reveal_type(is_successful(Maybe.from_value(1))) # N: Revealed type is 'builtins.bool' - case: custom_type_is_successful disable_cache: false main: | from returns.pipeline import is_successful from returns.primitives.hkt import Kind2 from returns.primitives.exceptions import UnwrapFailedError from returns.interfaces.unwrappable import Unwrappable from typing import TypeVar T = TypeVar('T') N = TypeVar('N') class MyOwn( Kind2['MyOwn', T, N], Unwrappable[T, N], ): def __init__(self, value: T, error: N) -> None: self.value = value self.error = error def unwrap(self) -> T: if self.error: raise UnwrapFailedError(self) return self.value def failure(self) -> N: if self.value: raise UnwrapFailedError(self) return self.error x: MyOwn[int, str] reveal_type(x.unwrap()) # N: Revealed type is 'builtins.int*' reveal_type(x.failure()) # N: Revealed type is 'builtins.str*' reveal_type(is_successful(x)) # N: Revealed type is 'builtins.bool'
{ "pile_set_name": "Github" }
require 'spec_helper' RSpec.describe 'KyberNetwork integration specs' do client = Cryptoexchange::Client.new let(:knc_eth_pair) { Cryptoexchange::Models::MarketPair.new(base: 'knc', target: 'eth', market: 'kyber_network') } it 'fetch pairs' do pairs = client.pairs('kyber_network') expect(pairs).not_to be_empty pair = pairs.first expect(pair.base).to_not be nil expect(pair.target).to_not be nil expect(pair.market).to eq 'kyber_network' end it 'give trade url' do trade_page_url = client.trade_page_url 'kyber_network', base: knc_eth_pair.base, target: knc_eth_pair.target expect(trade_page_url).to eq "https://kyberswap.com/swap/eth-knc" end it 'fetch ticker' do ticker = client.ticker(knc_eth_pair) expect(ticker.base).to eq 'KNC' expect(ticker.target).to eq 'ETH' expect(ticker.market).to eq 'kyber_network' expect(ticker.last).to be_a Numeric expect(ticker.bid).to be_a Numeric expect(ticker.ask).to be_a Numeric expect(ticker.high).to be_a Numeric expect(ticker.low).to be_a Numeric expect(ticker.volume).to be_a Numeric expect(ticker.timestamp).to be nil expect(ticker.payload).to_not be nil end end
{ "pile_set_name": "Github" }
{htn-main {:args [], :fields {plnt {:access :private, :initial {:args [], :pclass plant, :type :pclass-ctor}, :observable false}, sf {:access :private, :initial {:args [{:type :field-ref, :names [plnt]}], :pclass sequence-feasible, :type :pclass-ctor}, :observable false}}, :meta {:doc "Main class for HTN"}, :methods {main [{:args [], :betweens [], :body [{:type :method-fn, :method-ref {:type :field-ref, :names [sf main]}, :args []}], :controllable false, :cost 0, :display-args [], :display-name "Main", :post true, :pre true, :primitive false, :probability 1.0, :reward 0, :temporal-constraints [{:type :bounds, :value [0 :infinity]}]}]}, :type :pclass}, plant {:args [], :meta {:doc "The Plant API"}, :methods {do-a [{:args [], :betweens [], :body nil, :controllable false, :cost 0, :display-args [], :display-name "Do A", :post true, :pre true, :primitive true, :probability 1.0, :reward 0, :temporal-constraints [{:type :bounds, :value [2 4]}]}], do-b [{:args [], :betweens [], :body nil, :controllable false, :cost 0, :display-args [], :display-name "Do B", :post true, :pre true, :primitive true, :probability 1.0, :reward 0, :temporal-constraints [{:type :bounds, :value [3 6]}]}], do-c [{:args [], :betweens [], :body nil, :controllable false, :cost 0, :display-args [], :display-name "Do C", :post true, :pre true, :primitive true, :probability 1.0, :reward 0, :temporal-constraints [{:type :bounds, :value [4 8]}]}], do-d [{:args [], :betweens [], :body nil, :controllable false, :cost 0, :display-args [], :display-name "Do D", :post true, :pre true, :primitive true, :probability 1.0, :reward 0, :temporal-constraints [{:type :bounds, :value [1 2]}]}], do-e [{:args [], :betweens [], :body nil, :controllable false, :cost 0, :display-args [], :display-name "Do E", :post true, :pre true, :primitive true, :probability 1.0, :reward 0, :temporal-constraints [{:type :bounds, :value [5 10]}]}]}, :type :pclass}, sequence-feasible {:args [plnt], :meta {:doc "An example of infeasible sequence of activties"}, :methods {main [{:args [], :betweens [], :body [{:type :sequence, :body [{:type :method-fn, :method-ref {:type :pclass-arg-ref, :names [plnt do-a]}, :args []} {:type :method-fn, :method-ref {:type :pclass-arg-ref, :names [plnt do-b]}, :args []} {:type :method-fn, :method-ref {:type :pclass-arg-ref, :names [plnt do-c]}, :args []} {:type :method-fn, :method-ref {:type :pclass-arg-ref, :names [plnt do-d]}, :args []} {:type :method-fn, :method-ref {:type :pclass-arg-ref, :names [plnt do-e]}, :args []}], :temporal-constraints [{:type :bounds, :value [15 30]}]}], :controllable false, :cost 0, :display-args [], :display-name "Main", :doc "Simple TPN with constraints", :post true, :pre true, :primitive false, :probability 1.0, :reward 0, :temporal-constraints [{:type :bounds, :value [0 :infinity]}]}]}, :type :pclass}}
{ "pile_set_name": "Github" }
/* * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.runtime.module.extension.internal.runtime.config; import static java.util.Optional.ofNullable; import static java.util.concurrent.TimeUnit.MILLISECONDS; import static org.mule.runtime.api.i18n.I18nMessageFactory.createStaticMessage; import static org.mule.runtime.api.util.collection.Collectors.toImmutableList; import static org.mule.runtime.core.api.lifecycle.LifecycleUtils.assertNotStopping; import static org.mule.runtime.core.api.lifecycle.LifecycleUtils.disposeIfNeeded; import static org.mule.runtime.core.api.lifecycle.LifecycleUtils.initialiseIfNeeded; import static org.mule.runtime.core.api.lifecycle.LifecycleUtils.startIfNeeded; import static org.mule.runtime.core.api.lifecycle.LifecycleUtils.stopIfNeeded; import static org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader; import static org.mule.runtime.extension.api.values.ValueResolvingException.UNKNOWN; import static org.mule.runtime.module.extension.internal.value.ValueProviderUtils.valuesWithClassLoader; import static org.slf4j.LoggerFactory.getLogger; import org.mule.runtime.api.connection.ConnectionProvider; import org.mule.runtime.api.event.Event; import org.mule.runtime.api.exception.MuleException; import org.mule.runtime.api.exception.MuleRuntimeException; import org.mule.runtime.api.lifecycle.Initialisable; import org.mule.runtime.api.lifecycle.InitialisationException; import org.mule.runtime.api.lifecycle.Startable; import org.mule.runtime.api.meta.model.ExtensionModel; import org.mule.runtime.api.meta.model.config.ConfigurationModel; import org.mule.runtime.api.meta.model.connection.ConnectionProviderModel; import org.mule.runtime.api.util.Pair; import org.mule.runtime.api.value.Value; import org.mule.runtime.core.api.MuleContext; import org.mule.runtime.core.api.el.ExpressionManager; import org.mule.runtime.core.api.event.CoreEvent; import org.mule.runtime.extension.api.runtime.ExpirationPolicy; import org.mule.runtime.extension.api.runtime.config.ConfigurationInstance; import org.mule.runtime.extension.api.runtime.config.ConfigurationProvider; import org.mule.runtime.extension.api.runtime.config.ConfigurationStats; import org.mule.runtime.extension.api.runtime.config.ExpirableConfigurationProvider; import org.mule.runtime.extension.api.values.ConfigurationParameterValueProvider; import org.mule.runtime.extension.api.values.ValueResolvingException; import org.mule.runtime.module.extension.internal.runtime.resolver.ConnectionProviderValueResolver; import org.mule.runtime.module.extension.internal.runtime.resolver.ResolverSet; import org.mule.runtime.module.extension.internal.runtime.resolver.ResolverSetResult; import org.mule.runtime.module.extension.internal.runtime.resolver.ValueResolver; import org.mule.runtime.module.extension.internal.runtime.resolver.ValueResolvingContext; import org.mule.runtime.module.extension.internal.util.ReflectionCache; import org.mule.runtime.module.extension.internal.value.ValueProviderMediator; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; import org.slf4j.Logger; /** * A {@link ConfigurationProvider} which continuously evaluates the same {@link ResolverSet} and then uses the resulting * {@link ResolverSetResult} to build an instance of type {@code T} * <p> * Although each invocation to {@link #get(Event)} is guaranteed to end up in an invocation to * {@link #resolverSet#resolve(Object)}, the resulting {@link ResolverSetResult} might not end up generating a new instance. This * is so because {@link ResolverSetResult} instances are put in a cache to guarantee that equivalent evaluations of the * {@code resolverSet} return the same instance. * * @since 4.0.0 */ public final class DynamicConfigurationProvider extends LifecycleAwareConfigurationProvider implements ExpirableConfigurationProvider, ConfigurationParameterValueProvider { private static final Logger LOGGER = getLogger(DynamicConfigurationProvider.class); private final ConfigurationInstanceFactory configurationInstanceFactory; private final ResolverSet resolverSet; private final ConnectionProviderValueResolver connectionProviderResolver; private final ExpirationPolicy expirationPolicy; private final Map<Pair<ResolverSetResult, ResolverSetResult>, ConfigurationInstance> cache = new ConcurrentHashMap<>(); private final ReadWriteLock cacheLock = new ReentrantReadWriteLock(); private final Lock cacheReadLock = cacheLock.readLock(); private final Lock cacheWriteLock = cacheLock.writeLock(); private final ReflectionCache reflectionCache; private final ExpressionManager expressionManager; /** * Creates a new instance * * @param name this provider's name * @param extension the model that owns the {@code configurationModel} * @param config the model for the returned configurations * @param resolverSet the {@link ResolverSet} that provides the configuration's parameter values * @param connectionProviderResolver a {@link ValueResolver} used to obtain a {@link ConnectionProvider} * @param expirationPolicy the {@link ExpirationPolicy} for the unused instances * @param reflectionCache the {@link ReflectionCache} used to improve reflection lookups performance * @param expressionManager the {@link ExpressionManager} used to create a session used to evaluate the attributes. * @param muleContext the {@link MuleContext} that will own the configuration instances */ public DynamicConfigurationProvider(String name, ExtensionModel extension, ConfigurationModel config, ResolverSet resolverSet, ConnectionProviderValueResolver connectionProviderResolver, ExpirationPolicy expirationPolicy, ReflectionCache reflectionCache, ExpressionManager expressionManager, MuleContext muleContext) { super(name, extension, config, muleContext); this.configurationInstanceFactory = new ConfigurationInstanceFactory<>(extension, config, resolverSet, expressionManager, muleContext); this.reflectionCache = reflectionCache; this.expressionManager = expressionManager; this.resolverSet = resolverSet; this.connectionProviderResolver = connectionProviderResolver; this.expirationPolicy = expirationPolicy; } /** * Evaluates {@link #resolverSet} using the given {@code event} and returns an instance produced with the result. For equivalent * {@link ResolverSetResult}s it will return the same instance. * * @param event the current {@code event} * @return the resolved {@link ConfigurationInstance} */ @Override public ConfigurationInstance get(Event event) { return withContextClassLoader(getExtensionClassLoader(), () -> { try (ValueResolvingContext resolvingContext = ValueResolvingContext.builder(((CoreEvent) event)) .withExpressionManager(expressionManager).build()) { ResolverSetResult result = resolverSet.resolve(resolvingContext); ResolverSetResult providerResult = null; if (connectionProviderResolver.getResolverSet().isPresent()) { providerResult = ((ResolverSet) connectionProviderResolver.getResolverSet().get()).resolve(resolvingContext); } return getConfiguration(new Pair<>(result, providerResult), (CoreEvent) event); } }); } private ConfigurationInstance getConfiguration(Pair<ResolverSetResult, ResolverSetResult> resolverSetResult, CoreEvent event) throws Exception { ConfigurationInstance configuration; cacheReadLock.lock(); try { configuration = cache.get(resolverSetResult); if (configuration != null) { // important to account between the boundaries of the lock to prevent race condition updateUsageStatistic(configuration); return configuration; } } finally { cacheReadLock.unlock(); } cacheWriteLock.lock(); try { // re-check in case some other thread beat us to it... configuration = cache.get(resolverSetResult); if (configuration == null) { configuration = createConfiguration(resolverSetResult, event); cache.put(resolverSetResult, configuration); } // accounting here for the same reasons as above updateUsageStatistic(configuration); return configuration; } finally { cacheWriteLock.unlock(); } } private void updateUsageStatistic(ConfigurationInstance configuration) { MutableConfigurationStats stats = (MutableConfigurationStats) configuration.getStatistics(); stats.updateLastUsed(); } private ConfigurationInstance createConfiguration(Pair<ResolverSetResult, ResolverSetResult> values, CoreEvent event) throws MuleException { assertNotStopping(muleContext, "Mule is shutting down... Cannot create new dynamic configurations"); ConfigurationInstance configuration; ResolverSetResult connectionProviderValues = values.getSecond(); if (connectionProviderValues != null) { configuration = configurationInstanceFactory.createConfiguration(getName(), values.getFirst(), event, connectionProviderResolver, connectionProviderValues); } else { configuration = configurationInstanceFactory.createConfiguration(getName(), values.getFirst(), event, ofNullable(connectionProviderResolver)); } registerConfiguration(configuration); return configuration; } @Override protected void registerConfiguration(ConfigurationInstance configuration) { try { withContextClassLoader(getExtensionClassLoader(), () -> { if (lifecycleManager.isPhaseComplete(Initialisable.PHASE_NAME)) { try { initialiseIfNeeded(configuration, true, muleContext); } catch (Exception e) { disposeIfNeeded(configuration, LOGGER); throw e; } } if (lifecycleManager.isPhaseComplete(Startable.PHASE_NAME)) { try { startConfig(configuration); } catch (Exception e) { try { stopIfNeeded(configuration); } catch (Exception ex) { // Ignore and continue with the disposal LOGGER.warn("Exception while stopping " + configuration.toString(), e); } disposeIfNeeded(configuration, LOGGER); throw e; } } return null; }); } catch (Exception e) { throw new MuleRuntimeException(createStaticMessage("Could not register configuration of key " + getName()), e); } super.registerConfiguration(configuration); } @Override public List<ConfigurationInstance> getExpired() { cacheWriteLock.lock(); try { return cache.entrySet().stream().filter(entry -> isExpired(entry.getValue())).map(entry -> { cache.remove(entry.getKey()); unRegisterConfiguration(entry.getValue()); return entry.getValue(); }).collect(toImmutableList()); } finally { cacheWriteLock.unlock(); } } private boolean isExpired(ConfigurationInstance configuration) { ConfigurationStats stats = configuration.getStatistics(); return stats.getRunningSources() == 0 && stats.getInflightOperations() == 0 && expirationPolicy.isExpired(stats.getLastUsedMillis(), MILLISECONDS); } @Override protected void doInitialise() { try { initialiseIfNeeded(resolverSet, muleContext); initialiseIfNeeded(connectionProviderResolver, muleContext); } catch (InitialisationException e) { throw new MuleRuntimeException(e); } } @Override public void start() throws MuleException { super.start(); startIfNeeded(connectionProviderResolver); } /** * {@inheritDoc} * * @return {@code false} */ @Override public boolean isDynamic() { return true; } /** * {@inheritDoc} */ @Override public Set<Value> getConfigValues(String parameterName) throws ValueResolvingException { return valuesWithClassLoader(() -> new ValueProviderMediator<>(getConfigurationModel(), () -> muleContext, () -> reflectionCache) .getValues(parameterName, new ResolverSetBasedParameterResolver(resolverSet, getConfigurationModel(), reflectionCache, expressionManager)), getExtensionModel()); } /** * {@inheritDoc} */ @Override public Set<Value> getConnectionValues(String parameterName) throws ValueResolvingException { return valuesWithClassLoader(() -> { ConnectionProviderModel connectionProviderModel = getConnectionProviderModel() .orElseThrow(() -> new ValueResolvingException( "Internal Error. Unable to resolve values because the service is unable to get the connection model", UNKNOWN)); ResolverSet resolverSet = ((Optional<ResolverSet>) connectionProviderResolver.getResolverSet()) .orElseThrow(() -> new ValueResolvingException( "Internal Error. Unable to resolve values because of the service is unable to retrieve connection parameters", UNKNOWN)); return new ValueProviderMediator<>(connectionProviderModel, () -> muleContext, () -> reflectionCache) .getValues(parameterName, new ResolverSetBasedParameterResolver(resolverSet, connectionProviderModel, reflectionCache, expressionManager)); }, getExtensionModel()); } private Optional<ConnectionProviderModel> getConnectionProviderModel() { return this.connectionProviderResolver.getObjectBuilder() .filter(ob -> ob instanceof ConnectionProviderObjectBuilder) .map(ob -> ((ConnectionProviderObjectBuilder) ob).providerModel); } }
{ "pile_set_name": "Github" }
package com.ypx.imagepicker.bean.selectconfig; import android.graphics.Color; import android.os.Parcel; import android.os.Parcelable; import android.util.Size; import com.ypx.imagepicker.widget.cropimage.Info; /** * Time: 2019/10/27 18:53 * Author:ypx * Description: 单图剪裁配置类 */ public class CropConfigParcelable implements Parcelable { //充满式剪裁 public static final int STYLE_FILL = 1; //留白式剪裁 public static final int STYLE_GAP = 2; private int cropRatioX = 1; private int cropRatioY = 1; private boolean isCircle = false; private int cropRectMargin = 0; private int cropStyle = STYLE_FILL; private int cropGapBackgroundColor = Color.BLACK; private boolean saveInDCIM = false; // private Size outPutSize; private long maxOutPutByte; private boolean isLessOriginalByte; private Info cropRestoreInfo; private boolean isSingleCropCutNeedTop = false; public boolean isSingleCropCutNeedTop() { return isSingleCropCutNeedTop; } public void setSingleCropCutNeedTop(boolean singleCropCutNeedTop) { isSingleCropCutNeedTop = singleCropCutNeedTop; } protected CropConfigParcelable() { } protected CropConfigParcelable(Parcel in) { cropRatioX = in.readInt(); cropRatioY = in.readInt(); isCircle = in.readByte() != 0; cropRectMargin = in.readInt(); cropStyle = in.readInt(); cropGapBackgroundColor = in.readInt(); saveInDCIM = in.readByte() != 0; maxOutPutByte = in.readLong(); isLessOriginalByte = in.readByte() != 0; cropRestoreInfo = in.readParcelable(Info.class.getClassLoader()); isSingleCropCutNeedTop=in.readByte() != 0; } public static final Creator<CropConfigParcelable> CREATOR = new Creator<CropConfigParcelable>() { @Override public CropConfigParcelable createFromParcel(Parcel in) { return new CropConfigParcelable(in); } @Override public CropConfigParcelable[] newArray(int size) { return new CropConfigParcelable[size]; } }; public long getMaxOutPutByte() { return maxOutPutByte; } public void setMaxOutPutByte(long maxOutPutByte) { this.maxOutPutByte = maxOutPutByte; } public boolean isLessOriginalByte() { return isLessOriginalByte; } public void setLessOriginalByte(boolean lessOriginalByte) { isLessOriginalByte = lessOriginalByte; } public Info getCropRestoreInfo() { return cropRestoreInfo; } public void setCropRestoreInfo(Info cropRestoreInfo) { this.cropRestoreInfo = cropRestoreInfo; } public boolean isSaveInDCIM() { return saveInDCIM; } public void saveInDCIM(boolean saveInDCIM) { this.saveInDCIM = saveInDCIM; } public int getCropStyle() { return cropStyle; } public void setCropStyle(int cropStyle) { this.cropStyle = cropStyle; } public int getCropGapBackgroundColor() { return cropGapBackgroundColor; } public void setCropGapBackgroundColor(int cropGapBackgroundColor) { this.cropGapBackgroundColor = cropGapBackgroundColor; } public boolean isCircle() { return isCircle; } public void setCircle(boolean circle) { isCircle = circle; } public int getCropRectMargin() { return cropRectMargin; } public void setCropRectMargin(int cropRectMargin) { this.cropRectMargin = cropRectMargin; } public int getCropRatioX() { if (isCircle) { return 1; } return cropRatioX; } public void setCropRatio(int x, int y) { this.cropRatioX = x; this.cropRatioY = y; } public int getCropRatioY() { if (isCircle) { return 1; } return cropRatioY; } public boolean isGap() { return cropStyle == STYLE_GAP; } public boolean isNeedPng() { return isCircle || getCropGapBackgroundColor() == Color.TRANSPARENT; } /** * Describe the kinds of special objects contained in this Parcelable * instance's marshaled representation. For example, if the object will * include a file descriptor in the output of {@link #writeToParcel(Parcel, int)}, * the return value of this method must include the * {@link #CONTENTS_FILE_DESCRIPTOR} bit. * * @return a bitmask indicating the set of special object types marshaled * by this Parcelable object instance. */ @Override public int describeContents() { return 0; } /** * Flatten this object in to a Parcel. * * @param dest The Parcel in which the object should be written. * @param flags Additional flags about how the object should be written. * May be 0 or {@link #PARCELABLE_WRITE_RETURN_VALUE}. */ @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(cropRatioX); dest.writeInt(cropRatioY); dest.writeByte((byte) (isCircle ? 1 : 0)); dest.writeInt(cropRectMargin); dest.writeInt(cropStyle); dest.writeInt(cropGapBackgroundColor); dest.writeByte((byte) (saveInDCIM ? 1 : 0)); dest.writeLong(maxOutPutByte); dest.writeByte((byte) (isLessOriginalByte ? 1 : 0)); dest.writeParcelable(cropRestoreInfo, flags); dest.writeByte((byte) (isSingleCropCutNeedTop ? 1 : 0)); } }
{ "pile_set_name": "Github" }
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") android_sdk_repository( name = "androidsdk", api_level = 28, build_tools_version = "28.0.2", ) android_ndk_repository( name = "androidndk", ) local_repository( name = "rules_jvm_external", path = "../../", ) load("@rules_jvm_external//:defs.bzl", "maven_install") maven_install( artifacts = [ "junit:junit:4.12", "com.google.inject:guice:4.0", "org.hamcrest:java-hamcrest:2.0.0.0", "androidx.test.espresso:espresso-core:3.1.1", "androidx.test:runner:1.1.1", "androidx.test:rules:1.1.1", "androidx.test.ext:junit:1.1.0", ], repositories = [ "https://maven.google.com", "https://repo1.maven.org/maven2", ], ) # Everything below this line is used for the Android testing tools and their dependencies # --------------------------------------------------------------------------------------- # Android Test Support # # This repository contains the supporting tools to run Android instrumentation tests, # like the emulator definitions (android_device) and the device broker/test runner. ATS_TAG = "1edfdab3134a7f01b37afabd3eebfd2c5bb05151" ATS_SHA256 = "dcd1ff76aef1a26329d77863972780c8fe1fc8ff625747342239f0489c2837ec" http_archive( name = "android_test_support", sha256 = ATS_SHA256, strip_prefix = "android-test-%s" % ATS_TAG, urls = ["https://github.com/android/android-test/archive/%s.tar.gz" % ATS_TAG], ) load("@android_test_support//:repo.bzl", "android_test_repositories") android_test_repositories() http_archive( name = "bazel_toolchains", sha256 = "4d348abfaddbcee0c077fc51bb1177065c3663191588ab3d958f027cbfe1818b", strip_prefix = "bazel-toolchains-2.1.0", urls = [ "https://github.com/bazelbuild/bazel-toolchains/releases/download/2.1.0/bazel-toolchains-2.1.0.tar.gz", "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/2.1.0.tar.gz", ], ) load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig") # Creates a default toolchain config for RBE. # Use this as is if you are using the rbe_ubuntu16_04 container, # otherwise refer to RBE docs. rbe_autoconfig(name = "buildkite_config") rbe_autoconfig(name = "rbe_default")
{ "pile_set_name": "Github" }
version https://git-lfs.github.com/spec/v1 oid sha256:cbc6dd1e3de42c731be8ce8bd01430031fbf3bd0cd8f47770e483449c55a5a1b size 20676
{ "pile_set_name": "Github" }
// Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE // included by json_value.cpp namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueIteratorBase // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueIteratorBase::ValueIteratorBase() #ifndef JSON_VALUE_USE_INTERNAL_MAP : current_() , isNull_( true ) { } #else : isArray_( true ) , isNull_( true ) { iterator_.array_ = ValueInternalArray::IteratorState(); } #endif #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueIteratorBase::ValueIteratorBase( const Value::ObjectValues::iterator &current ) : current_( current ) , isNull_( false ) { } #else ValueIteratorBase::ValueIteratorBase( const ValueInternalArray::IteratorState &state ) : isArray_( true ) { iterator_.array_ = state; } ValueIteratorBase::ValueIteratorBase( const ValueInternalMap::IteratorState &state ) : isArray_( false ) { iterator_.map_ = state; } #endif Value & ValueIteratorBase::deref() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP return current_->second; #else if ( isArray_ ) return ValueInternalArray::dereference( iterator_.array_ ); return ValueInternalMap::value( iterator_.map_ ); #endif } void ValueIteratorBase::increment() { #ifndef JSON_VALUE_USE_INTERNAL_MAP ++current_; #else if ( isArray_ ) ValueInternalArray::increment( iterator_.array_ ); ValueInternalMap::increment( iterator_.map_ ); #endif } void ValueIteratorBase::decrement() { #ifndef JSON_VALUE_USE_INTERNAL_MAP --current_; #else if ( isArray_ ) ValueInternalArray::decrement( iterator_.array_ ); ValueInternalMap::decrement( iterator_.map_ ); #endif } ValueIteratorBase::difference_type ValueIteratorBase::computeDistance( const SelfType &other ) const { #ifndef JSON_VALUE_USE_INTERNAL_MAP # ifdef JSON_USE_CPPTL_SMALLMAP return current_ - other.current_; # else // Iterator for null value are initialized using the default // constructor, which initialize current_ to the default // std::map::iterator. As begin() and end() are two instance // of the default std::map::iterator, they can not be compared. // To allow this, we handle this comparison specifically. if ( isNull_ && other.isNull_ ) { return 0; } // Usage of std::distance is not portable (does not compile with Sun Studio 12 RogueWave STL, // which is the one used by default). // Using a portable hand-made version for non random iterator instead: // return difference_type( std::distance( current_, other.current_ ) ); difference_type myDistance = 0; for ( Value::ObjectValues::iterator it = current_; it != other.current_; ++it ) { ++myDistance; } return myDistance; # endif #else if ( isArray_ ) return ValueInternalArray::distance( iterator_.array_, other.iterator_.array_ ); return ValueInternalMap::distance( iterator_.map_, other.iterator_.map_ ); #endif } bool ValueIteratorBase::isEqual( const SelfType &other ) const { #ifndef JSON_VALUE_USE_INTERNAL_MAP if ( isNull_ ) { return other.isNull_; } return current_ == other.current_; #else if ( isArray_ ) return ValueInternalArray::equals( iterator_.array_, other.iterator_.array_ ); return ValueInternalMap::equals( iterator_.map_, other.iterator_.map_ ); #endif } void ValueIteratorBase::copy( const SelfType &other ) { #ifndef JSON_VALUE_USE_INTERNAL_MAP current_ = other.current_; #else if ( isArray_ ) iterator_.array_ = other.iterator_.array_; iterator_.map_ = other.iterator_.map_; #endif } Value ValueIteratorBase::key() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const Value::CZString czstring = (*current_).first; if ( czstring.c_str() ) { if ( czstring.isStaticString() ) return Value( StaticString( czstring.c_str() ) ); return Value( czstring.c_str() ); } return Value( czstring.index() ); #else if ( isArray_ ) return Value( ValueInternalArray::indexOf( iterator_.array_ ) ); bool isStatic; const char *memberName = ValueInternalMap::key( iterator_.map_, isStatic ); if ( isStatic ) return Value( StaticString( memberName ) ); return Value( memberName ); #endif } UInt ValueIteratorBase::index() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const Value::CZString czstring = (*current_).first; if ( !czstring.c_str() ) return czstring.index(); return Value::UInt( -1 ); #else if ( isArray_ ) return Value::UInt( ValueInternalArray::indexOf( iterator_.array_ ) ); return Value::UInt( -1 ); #endif } const char * ValueIteratorBase::memberName() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const char *name = (*current_).first.c_str(); return name ? name : ""; #else if ( !isArray_ ) return ValueInternalMap::key( iterator_.map_ ); return ""; #endif } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueConstIterator // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueConstIterator::ValueConstIterator() { } #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueConstIterator::ValueConstIterator( const Value::ObjectValues::iterator &current ) : ValueIteratorBase( current ) { } #else ValueConstIterator::ValueConstIterator( const ValueInternalArray::IteratorState &state ) : ValueIteratorBase( state ) { } ValueConstIterator::ValueConstIterator( const ValueInternalMap::IteratorState &state ) : ValueIteratorBase( state ) { } #endif ValueConstIterator & ValueConstIterator::operator =( const ValueIteratorBase &other ) { copy( other ); return *this; } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueIterator // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueIterator::ValueIterator() { } #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueIterator::ValueIterator( const Value::ObjectValues::iterator &current ) : ValueIteratorBase( current ) { } #else ValueIterator::ValueIterator( const ValueInternalArray::IteratorState &state ) : ValueIteratorBase( state ) { } ValueIterator::ValueIterator( const ValueInternalMap::IteratorState &state ) : ValueIteratorBase( state ) { } #endif ValueIterator::ValueIterator( const ValueConstIterator &other ) : ValueIteratorBase( other ) { } ValueIterator::ValueIterator( const ValueIterator &other ) : ValueIteratorBase( other ) { } ValueIterator & ValueIterator::operator =( const SelfType &other ) { copy( other ); return *this; } } // namespace Json
{ "pile_set_name": "Github" }
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.redsolver.noteless"> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- io.flutter.app.FlutterApplication is an android.app.Application that calls FlutterMain.startInitialization(this); in its onCreate method. In most cases you can leave this as-is, but you if you want to provide additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> <application android:name="io.flutter.app.FlutterApplication" android:label="Noteless" android:requestLegacyExternalStorage="true" android:icon="@mipmap/ic_launcher"> <activity android:name=".MainActivity" android:launchMode="singleTask" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> <!-- This keeps the window background of the activity showing until Flutter renders its first frame. It can be removed if there is no splash screen (such as the default splash screen defined in @style/LaunchTheme). --> <meta-data android:name="io.flutter.app.android.SplashScreenUntilFirstFrame" android:value="true" /> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/*" /> </intent-filter> </activity> </application> </manifest>
{ "pile_set_name": "Github" }
/* EMPTY CELLS */ .empty-show { empty-cells: show; } .empty-hide { empty-cells: hide; } .empty-inherit { empty-cells: inherit; } @include break(not-small) { .empty-show-ns { empty-cells: show; } .empty-hide-ns { empty-cells: hide; } .empty-inherit-ns { empty-cells: inherit; } } @include break(medium) { .empty-show-m { empty-cells: show; } .empty-hide-m { empty-cells: hide; } .empty-inherit-m { empty-cells: inherit; } } @include break(large) { .empty-show-l { empty-cells: show; } .empty-hide-l { empty-cells: hide; } .empty-inherit-l { empty-cells: inherit; } } @include break(extra-large) { .empty-show-xl { empty-cells: show; } .empty-hide-xl { empty-cells: hide; } .empty-inherit-xl { empty-cells: inherit; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>IBDocumentLocation</key> <string>84 130 356 240 0 0 1024 746 </string> <key>IBEditorPositions</key> <dict> <key>29</key> <string>84 375 281 44 0 0 1024 746 </string> </dict> <key>IBFramework Version</key> <string>489.0</string> <key>IBLastKnownRelativeProjectPath</key> <string>../../MacVim.xcodeproj</string> <key>IBOldestOS</key> <integer>5</integer> <key>IBOpenObjects</key> <array> <integer>29</integer> </array> <key>IBSystem Version</key> <string>8S165</string> <key>targetFramework</key> <string>IBCocoaFramework</string> </dict> </plist>
{ "pile_set_name": "Github" }
package types import ( "reflect" "strconv" ) var stringType = reflect.TypeOf((*string)(nil)).Elem() var sliceStringType = reflect.TypeOf([]string(nil)) var intType = reflect.TypeOf((*int)(nil)).Elem() var sliceIntType = reflect.TypeOf([]int(nil)) var int64Type = reflect.TypeOf((*int64)(nil)).Elem() var sliceInt64Type = reflect.TypeOf([]int64(nil)) var float64Type = reflect.TypeOf((*float64)(nil)).Elem() var sliceFloat64Type = reflect.TypeOf([]float64(nil)) func ArrayAppender(typ reflect.Type) AppenderFunc { elemType := typ.Elem() switch elemType { case stringType: return appendSliceStringValue case intType: return appendSliceIntValue case int64Type: return appendSliceInt64Value case float64Type: return appendSliceFloat64Value } appendElem := appender(elemType, true) return func(b []byte, v reflect.Value, quote int) []byte { if v.IsNil() { return AppendNull(b, quote) } if quote == 1 { b = append(b, '\'') } b = append(b, '{') for i := 0; i < v.Len(); i++ { elem := v.Index(i) b = appendElem(b, elem, 2) b = append(b, ',') } if v.Len() > 0 { b[len(b)-1] = '}' // Replace trailing comma. } else { b = append(b, '}') } if quote == 1 { b = append(b, '\'') } return b } } func appendSliceStringValue(b []byte, v reflect.Value, quote int) []byte { ss := v.Convert(sliceStringType).Interface().([]string) return appendSliceString(b, ss, quote) } func appendSliceString(b []byte, ss []string, quote int) []byte { if ss == nil { return AppendNull(b, quote) } if quote == 1 { b = append(b, '\'') } b = append(b, '{') for _, s := range ss { b = AppendString(b, s, 2) b = append(b, ',') } if len(ss) > 0 { b[len(b)-1] = '}' // Replace trailing comma. } else { b = append(b, '}') } if quote == 1 { b = append(b, '\'') } return b } func appendSliceIntValue(b []byte, v reflect.Value, quote int) []byte { ints := v.Convert(sliceIntType).Interface().([]int) return appendSliceInt(b, ints, quote) } func appendSliceInt(b []byte, ints []int, quote int) []byte { if ints == nil { return AppendNull(b, quote) } if quote == 1 { b = append(b, '\'') } b = append(b, '{') for _, n := range ints { b = strconv.AppendInt(b, int64(n), 10) b = append(b, ',') } if len(ints) > 0 { b[len(b)-1] = '}' // Replace trailing comma. } else { b = append(b, '}') } if quote == 1 { b = append(b, '\'') } return b } func appendSliceInt64Value(b []byte, v reflect.Value, quote int) []byte { ints := v.Convert(sliceInt64Type).Interface().([]int64) return appendSliceInt64(b, ints, quote) } func appendSliceInt64(b []byte, ints []int64, quote int) []byte { if ints == nil { return AppendNull(b, quote) } if quote == 1 { b = append(b, '\'') } b = append(b, '{') for _, n := range ints { b = strconv.AppendInt(b, n, 10) b = append(b, ',') } if len(ints) > 0 { b[len(b)-1] = '}' // Replace trailing comma. } else { b = append(b, '}') } if quote == 1 { b = append(b, '\'') } return b } func appendSliceFloat64Value(b []byte, v reflect.Value, quote int) []byte { floats := v.Convert(sliceFloat64Type).Interface().([]float64) return appendSliceFloat64(b, floats, quote) } func appendSliceFloat64(b []byte, floats []float64, quote int) []byte { if floats == nil { return AppendNull(b, quote) } if quote == 1 { b = append(b, '\'') } b = append(b, '{') for _, n := range floats { b = appendFloat(b, n, 2) b = append(b, ',') } if len(floats) > 0 { b[len(b)-1] = '}' // Replace trailing comma. } else { b = append(b, '}') } if quote == 1 { b = append(b, '\'') } return b }
{ "pile_set_name": "Github" }
// compiledir // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Issue 10066: constants are printed in the original form // in export data. This is the opposite of issue 9076. package ignored
{ "pile_set_name": "Github" }
#### <sub><sup><a name="v141-note-1" href="#v141-note-1">:link:</a></sup></sub> fix * A bug introduced by [**v1.4.0**](https://github.com/concourse/concourse/releases/tag/v1.4.0) caused custom resource types that override worker-provided resource types (e.g. `git`, `s3`, `docker-image`) to lead to containers being created repeatedly until your workers couldn't take anymore. Fixed. Our bad. #### <sub><sup><a name="v141-note-2" href="#v141-note-2">:link:</a></sup></sub> fix * The TLS redirecting feature introduced as part of [**v1.3.0**](https://github.com/concourse/concourse/releases/tag/v1.3.0) made [`fly execute`](https://concourse-ci.org/running-tasks.html#fly-execute) work only 50% of the time when running two ATCs. With three ATCs it would work 33.3%, repeating of course, of the time, and so on. [`fly execute`](https://concourse-ci.org/running-tasks.html#fly-execute) now works 100% of the time. #### <sub><sup><a name="v141-note-3" href="#v141-note-3">:link:</a></sup></sub> fix * The commit message format in the [`pool` resource](https://github.com/concourse/pool-resource) has been once again tweaked so as to not incorrectly trigger GitHub's issue reference syntax, thanks to a PR from @geramirez.
{ "pile_set_name": "Github" }
package(default_visibility = ["//visibility:public"]) load( "@io_bazel_rules_go//go:def.bzl", "go_library", ) go_library( name = "go_default_library", srcs = [ "api.pb.go", "constants.go", ], importmap = "k8s.io/kubernetes/vendor/k8s.io/kubelet/pkg/apis/pluginregistration/v1", importpath = "k8s.io/kubelet/pkg/apis/pluginregistration/v1", deps = [ "//vendor/github.com/gogo/protobuf/gogoproto:go_default_library", "//vendor/github.com/gogo/protobuf/proto:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/google.golang.org/grpc:go_default_library", ], ) filegroup( name = "package-srcs", srcs = glob(["**"]), tags = ["automanaged"], visibility = ["//visibility:private"], ) filegroup( name = "all-srcs", srcs = [":package-srcs"], tags = ["automanaged"], )
{ "pile_set_name": "Github" }
# Build flavours Hadrian supports a few predefined _build flavours_, i.e. collections of build settings that fully define a GHC build (see `src/Flavour.hs`). Users can add their own build flavours if need be, as described [here](https://github.com/snowleopard/hadrian/blob/master/doc/user-settings.md#build-flavour). ## Arguments The following table summarises extra arguments passed to GHC in different build flavours. There are four groups of arguments: arguments in `hsDefault` are passed to GHC for all Haskell source files, `hsLibrary` arguments are added when compiling libraries, `hsCompiler` when compiling the `compiler` library, and `hsGhc` when compiling/linking the GHC program. <table> <tr> <th rowspan="3">Flavour</th> <th colspan="8">Extra arguments</th> </tr> <tr> <th colspan="2">hsDefault</td> <th colspan="2">hsLibrary</td> <th colspan="2">hsCompiler</td> <th colspan="2">hsGhc</td> </tr> <tr> <th>stage0</td> <th>stage1+</td> <th>stage0</td> <th>stage1+</td> <th>stage0</td> <th>stage1+</td> <th>stage0</td> <th>stage1+</td> </tr> <tr> <th>default<br></td> <td>-O<br>-H64m<br></td> <td>-O2<br>-H64m</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <th>quick</td> <td>-O0<br>-H64m</td> <td>-O0<br>-H64m</td> <td></td> <td>-O</td> <td>-O</td> <td></td> <td>-O</td> <td></td> </tr> <tr> <th>quickest</td> <td>-O0<br>-H64m</td> <td>-O0<br>-H64m</td> <td></td> <td></td> <td>-O</td> <td></td> <td>-O</td> <td></td> </tr> <tr> <th>perf</td> <td>-O<br>-H64m</td> <td>-O<br>-H64m</td> <td></td> <td>-O2</td> <td>-O</td> <td>-O2</td> <td>-O</td> <td>-O2</td> </tr> <tr> <th>prof</td> <td>-O0<br>-H64m</td> <td>-O0<br>-H64m</td> <td></td> <td>-O</td> <td>-O</td> <td>-O</td> <td>-O</td> <td>-O</td> </tr> <tr> <th>devel1</td> <td>-O<br>-H64m</td> <td>-O<br>-H64m</td> <td></td> <td>-dcore-lint</td> <td>-O0<br>-DDEBUG</td> <td></td> <td>-O0<br>-DDEBUG</td> <td></td> </tr> <tr> <th>devel2</td> <td>-O<br>-H64m</td> <td>-O<br>-H64m</td> <td></td> <td>-dcore-lint</td> <td></td> <td>-O0<br>-DDEBUG</td> <td></td> <td>-O0<br>-DDEBUG</td> </tr> </table> ## Ways Libraries and GHC can be built in different _ways_, e.g. with or without profiling information. The following table lists ways that are built in different flavours. <table> <tr> <th rowspan="2">Flavour</th> <th colspan="2">Library ways</th> <th colspan="2">RTS ways</th> <th colspan="2">Profiled GHC</th> </tr> <tr> <th>stage0</th> <th>stage1+</th> <th>stage0</th> <th>stage1+</th> <th>stage0</th> <th>stage1+</th> </tr> <tr> <th>default<br>perf<br>prof<br>devel1<br>devel2</td> <td>vanilla</td> <td>vanilla<br>profiling<br>dynamic</td> <td>logging<br>debug<br>threaded<br>threadedDebug<br>threadedLogging <br>debugDynamic<br>threadedDynamic<br>threadedDebugDynamic <br>loggingDynamic<br>threadedLoggingDynamic </td> <td> logging<br>debug<br>threaded<br>threadedDebug<br> threadedLogging<br>threadedProfiling <br>debugDynamic<br>threadedDynamic<br>threadedDebugDynamic <br>loggingDynamic<br>threadedLoggingDynamic </td> <td>Only in<br>prof<br>flavour</td> <td>Only in<br>prof<br>flavour</td> </tr> <tr> <th>quick</th> <td>vanilla</td> <td>vanilla<br>dynamic</td> <td>logging<br>debug<br>threaded<br>threadedDebug<br>threadedLogging <br>debugDynamic<br>threadedDynamic<br>threadedDebugDynamic <br>loggingDynamic<br>threadedLoggingDynamic </td> <td>logging<br>debug<br>threaded<br>threadedDebug<br>threadedLogging <br>debugDynamic<br>threadedDynamic<br>threadedDebugDynamic <br>loggingDynamic<br>threadedLoggingDynamic </td> <td>No</td> <td>No</td> </tr> <tr> <th>quickest</th> <td>vanilla</td> <td>vanilla</td> <td>vanilla<br>threaded</td> <td>vanilla<br>threaded</td> <td>No</td> <td>No</td> </tr> </table>
{ "pile_set_name": "Github" }
/* Name: Tomorrow Night - Bright Author: Chris Kempson Port done by Gerard Braad <[email protected]> */ .cm-s-tomorrow-night-bright.CodeMirror { background: #000000; color: #eaeaea; } .cm-s-tomorrow-night-bright div.CodeMirror-selected { background: #424242; } .cm-s-tomorrow-night-bright .CodeMirror-gutters { background: #000000; border-right: 0px; } .cm-s-tomorrow-night-bright .CodeMirror-guttermarker { color: #e78c45; } .cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle { color: #777; } .cm-s-tomorrow-night-bright .CodeMirror-linenumber { color: #424242; } .cm-s-tomorrow-night-bright .CodeMirror-cursor { border-left: 1px solid #6A6A6A; } .cm-s-tomorrow-night-bright span.cm-comment { color: #d27b53; } .cm-s-tomorrow-night-bright span.cm-atom { color: #a16a94; } .cm-s-tomorrow-night-bright span.cm-number { color: #a16a94; } .cm-s-tomorrow-night-bright span.cm-property, .cm-s-tomorrow-night-bright span.cm-attribute { color: #99cc99; } .cm-s-tomorrow-night-bright span.cm-keyword { color: #d54e53; } .cm-s-tomorrow-night-bright span.cm-string { color: #e7c547; } .cm-s-tomorrow-night-bright span.cm-variable { color: #b9ca4a; } .cm-s-tomorrow-night-bright span.cm-variable-2 { color: #7aa6da; } .cm-s-tomorrow-night-bright span.cm-def { color: #e78c45; } .cm-s-tomorrow-night-bright span.cm-bracket { color: #eaeaea; } .cm-s-tomorrow-night-bright span.cm-tag { color: #d54e53; } .cm-s-tomorrow-night-bright span.cm-link { color: #a16a94; } .cm-s-tomorrow-night-bright span.cm-error { background: #d54e53; color: #6A6A6A; } .cm-s-tomorrow-night-bright .CodeMirror-activeline-background { background: #2a2a2a; } .cm-s-tomorrow-night-bright .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
{ "pile_set_name": "Github" }
package scala.meta import java.util.regex.Pattern import com.intellij.psi.{PsiElement, PsiWhiteSpace} import com.intellij.testFramework.fixtures.CodeInsightTestFixture import org.intellij.lang.annotations.Language import org.jetbrains.plugins.scala.ScalaFileType import org.jetbrains.plugins.scala.lang.psi.api.ScalaPsiElement import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile import org.jetbrains.plugins.scala.lang.psi.api.statements.ScCommentOwner import scala.annotation.tailrec import scala.meta.intellij.IDEAContext trait TreeConverterTestUtils { def fixture: CodeInsightTestFixture // we need to go deeper val context: IDEAContext val startToken = "//start" def psiFromText(text: String): ScalaPsiElement = { @tailrec def nextScalaPsiElement(current: PsiElement): ScalaPsiElement = current match { case _: PsiWhiteSpace => nextScalaPsiElement(current.getNextSibling) case sce: ScalaPsiElement => sce case _: PsiElement => nextScalaPsiElement(current.getNextSibling) } val file: ScalaFile = parseTextToFile(text) val startPos = file.getText.indexOf(startToken) if (startPos < 0) file.typeDefinitions.headOption.getOrElse(file.getImportStatements.head) else { val element = file.findElementAt(startPos) element.getParent match { case parent: ScCommentOwner => parent.asInstanceOf[ScalaPsiElement] case _ => nextScalaPsiElement(element) } } } def structuralEquals(tree1: Tree, tree2: Tree): Boolean = { // NOTE: for an exhaustive list of tree field types see // see /foundation/src/main/scala/org/scalameta/ast/internal.scala def loop(x1: Any, x2: Any): Boolean = (x1, x2) match { case (x1: Tree, x2: Tree) => structuralEquals(x1, x2) case (Some(x1), Some(x2)) => loop(x1, x2) case (Seq(xs1@_*), Seq(xs2@_*)) => xs1.zip(xs2).forall { case (x1, x2) => loop(x1, x2)} case (x1, x2) => x1 == x2 } def tagsEqual = true def fieldsEqual = tree1.productIterator.toList.zip(tree2.productIterator.toList).forall { case (x1, x2) => loop(x1, x2)} (tagsEqual && fieldsEqual) || {println(s"${tree1.show[scala.meta.Structure]} <=> ${tree2.show[scala.meta.Structure]}"); false} true } def doTest(text: String, tree: Tree): Unit = { val converted = convert(text) if (!structuralEquals(converted, tree)) { org.junit.Assert.assertEquals("Trees not equal", tree.toString(), converted.toString()) org.junit.Assert.assertTrue(false) } org.junit.Assert.assertEquals("Text comparison failure", tree.toString(), converted.toString()) } protected def convert(text: String): Tree = { val psi = psiFromText(text) context.ideaToMeta(psi) } def parseTextToFile(@Language("Scala") str: String): ScalaFile = { def isTopLevel = Pattern.compile("^\\s*(class|trait|object|import|package).*", Pattern.DOTALL).matcher(str).matches() val text = if (!isTopLevel) s""" |object Dummy { |${if (!str.contains(startToken)) startToken else ""} |$str |} """.stripMargin else str fixture.configureByText(ScalaFileType.INSTANCE, text).asInstanceOf[ScalaFile] } }
{ "pile_set_name": "Github" }
// Copyright 2016 Google Inc. 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 // // https://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. #include "absl/time/internal/cctz/include/cctz/zone_info_source.h" #include "absl/base/config.h" namespace absl { ABSL_NAMESPACE_BEGIN namespace time_internal { namespace cctz { // Defined out-of-line to avoid emitting a weak vtable in all TUs. ZoneInfoSource::~ZoneInfoSource() {} std::string ZoneInfoSource::Version() const { return std::string(); } } // namespace cctz } // namespace time_internal ABSL_NAMESPACE_END } // namespace absl namespace absl { ABSL_NAMESPACE_BEGIN namespace time_internal { namespace cctz_extension { namespace { // A default for cctz_extension::zone_info_source_factory, which simply // defers to the fallback factory. std::unique_ptr<absl::time_internal::cctz::ZoneInfoSource> DefaultFactory( const std::string& name, const std::function< std::unique_ptr<absl::time_internal::cctz::ZoneInfoSource>( const std::string& name)>& fallback_factory) { return fallback_factory(name); } } // namespace // A "weak" definition for cctz_extension::zone_info_source_factory. // The user may override this with their own "strong" definition (see // zone_info_source.h). #if !defined(__has_attribute) #define __has_attribute(x) 0 #endif // MinGW is GCC on Windows, so while it asserts __has_attribute(weak), the // Windows linker cannot handle that. Nor does the MinGW compiler know how to // pass "#pragma comment(linker, ...)" to the Windows linker. #if (__has_attribute(weak) || defined(__GNUC__)) && !defined(__MINGW32__) ZoneInfoSourceFactory zone_info_source_factory __attribute__((weak)) = DefaultFactory; #elif defined(_MSC_VER) && !defined(__MINGW32__) && !defined(_LIBCPP_VERSION) extern ZoneInfoSourceFactory zone_info_source_factory; extern ZoneInfoSourceFactory default_factory; ZoneInfoSourceFactory default_factory = DefaultFactory; #if defined(_M_IX86) #pragma comment( \ linker, \ "/alternatename:?zone_info_source_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@3P6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \ "@ABV?$function@$$A6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \ "@@ZA=?default_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@3P6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \ "@ABV?$function@$$A6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \ "@@ZA") #elif defined(_M_IA_64) || defined(_M_AMD64) || defined(_M_ARM64) #pragma comment( \ linker, \ "/alternatename:?zone_info_source_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@3P6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \ "@AEBV?$function@$$A6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \ "@@ZEA=?default_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@3P6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \ "@AEBV?$function@$$A6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ "@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \ "@@ZEA") #else #error Unsupported MSVC platform #endif // _M_<PLATFORM> #else // Make it a "strong" definition if we have no other choice. ZoneInfoSourceFactory zone_info_source_factory = DefaultFactory; #endif } // namespace cctz_extension } // namespace time_internal ABSL_NAMESPACE_END } // namespace absl
{ "pile_set_name": "Github" }
{% set data = {'page': 'util'} %} {% extends "template/base.html"%} {% block style %} <link rel="stylesheet" href="../../../css/arrowlink_img.css"> {% endblock %} {% block content %} <section id="arrowlink"> <div class="demo-item"> <p class="demo-desc">箭头链接</p> <div class="demo-block"> <div class="ui-arrowlink">箭头链接</div> </div> </div> </section> {% endblock%}
{ "pile_set_name": "Github" }
/* * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package com.sun.security.sasl.ntlm; import com.sun.security.ntlm.NTLMException; import com.sun.security.ntlm.Server; import java.io.IOException; import java.security.GeneralSecurityException; import java.util.Map; import java.util.Random; import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; import javax.security.auth.callback.NameCallback; import javax.security.auth.callback.PasswordCallback; import javax.security.auth.callback.UnsupportedCallbackException; import javax.security.sasl.*; /** * Required callbacks: * - RealmCallback * used as key by handler to fetch password, optional * - NameCallback * used as key by handler to fetch password * - PasswordCallback * handler must enter password for username/realm supplied * * Environment properties that affect the implementation: * * javax.security.sasl.qop * String, quality of protection; only "auth" is accepted, default "auth" * * com.sun.security.sasl.ntlm.version * String, name a specific version to accept: * LM/NTLM: Original NTLM v1 * LM: Original NTLM v1, LM only * NTLM: Original NTLM v1, NTLM only * NTLM2: NTLM v1 with Client Challenge * LMv2/NTLMv2: NTLM v2 * LMv2: NTLM v2, LM only * NTLMv2: NTLM v2, NTLM only * If not specified, use system property "ntlm.version". If also * not specified, all versions are accepted. * * com.sun.security.sasl.ntlm.domain * String, the domain of the server, default is server name (fqdn parameter) * * com.sun.security.sasl.ntlm.random * java.util.Random, the nonce source. Default null, an internal * java.util.Random object will be used * * Negotiated Properties: * * javax.security.sasl.qop * Always "auth" * * com.sun.security.sasl.ntlm.hostname * The hostname for the user, provided by the client * */ final class NTLMServer implements SaslServer { private final static String NTLM_VERSION = "com.sun.security.sasl.ntlm.version"; private final static String NTLM_DOMAIN = "com.sun.security.sasl.ntlm.domain"; private final static String NTLM_HOSTNAME = "com.sun.security.sasl.ntlm.hostname"; private static final String NTLM_RANDOM = "com.sun.security.sasl.ntlm.random"; private final Random random; private final Server server; private byte[] nonce; private int step = 0; private String authzId; private final String mech; private String hostname; private String target; /** * @param mech not null * @param protocol not null for Sasl, ignored in NTLM * @param serverName not null for Sasl, can be null in NTLM. If non-null, * might be used as domain if not provided in props * @param props can be null * @param cbh can be null for Sasl, already null-checked in factory * @throws SaslException */ NTLMServer(String mech, String protocol, String serverName, Map<String, ?> props, final CallbackHandler cbh) throws SaslException { this.mech = mech; String version = null; String domain = null; Random rtmp = null; if (props != null) { domain = (String) props.get(NTLM_DOMAIN); version = (String)props.get(NTLM_VERSION); rtmp = (Random)props.get(NTLM_RANDOM); } random = rtmp != null ? rtmp : new Random(); if (version == null) { version = System.getProperty("ntlm.version"); } if (domain == null) { domain = serverName; } if (domain == null) { throw new SaslException("Domain must be provided as" + " the serverName argument or in props"); } try { server = new Server(version, domain) { public char[] getPassword(String ntdomain, String username) { try { RealmCallback rcb = (ntdomain == null || ntdomain.isEmpty()) ? new RealmCallback("Domain: ") : new RealmCallback("Domain: ", ntdomain); NameCallback ncb = new NameCallback( "Name: ", username); PasswordCallback pcb = new PasswordCallback( "Password: ", false); cbh.handle(new Callback[] { rcb, ncb, pcb }); char[] passwd = pcb.getPassword(); pcb.clearPassword(); return passwd; } catch (IOException ioe) { return null; } catch (UnsupportedCallbackException uce) { return null; } } }; } catch (NTLMException ne) { throw new SaslException( "NTLM: server creation failure", ne); } nonce = new byte[8]; } @Override public String getMechanismName() { return mech; } @Override public byte[] evaluateResponse(byte[] response) throws SaslException { try { step++; if (step == 1) { random.nextBytes(nonce); return server.type2(response, nonce); } else { String[] out = server.verify(response, nonce); authzId = out[0]; hostname = out[1]; target = out[2]; return null; } } catch (NTLMException ex) { throw new SaslException("NTLM: generate response failure", ex); } } @Override public boolean isComplete() { return step >= 2; } @Override public String getAuthorizationID() { if (!isComplete()) { throw new IllegalStateException("authentication not complete"); } return authzId; } @Override public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException { throw new IllegalStateException("Not supported yet."); } @Override public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException { throw new IllegalStateException("Not supported yet."); } @Override public Object getNegotiatedProperty(String propName) { if (!isComplete()) { throw new IllegalStateException("authentication not complete"); } switch (propName) { case Sasl.QOP: return "auth"; case Sasl.BOUND_SERVER_NAME: return target; case NTLM_HOSTNAME: return hostname; default: return null; } } @Override public void dispose() throws SaslException { return; } }
{ "pile_set_name": "Github" }
version https://git-lfs.github.com/spec/v1 oid sha256:7e4b84790ee1d3152fc3ce62bdd8f58394ea55210042c196375644b113a0611f size 1551
{ "pile_set_name": "Github" }
//===-- RandomIRBuilder.cpp -----------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "llvm/FuzzMutate/RandomIRBuilder.h" #include "llvm/ADT/STLExtras.h" #include "llvm/FuzzMutate/Random.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Function.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/IntrinsicInst.h" using namespace llvm; using namespace fuzzerop; Value *RandomIRBuilder::findOrCreateSource(BasicBlock &BB, ArrayRef<Instruction *> Insts) { return findOrCreateSource(BB, Insts, {}, anyType()); } Value *RandomIRBuilder::findOrCreateSource(BasicBlock &BB, ArrayRef<Instruction *> Insts, ArrayRef<Value *> Srcs, SourcePred Pred) { auto MatchesPred = [&Srcs, &Pred](Instruction *Inst) { return Pred.matches(Srcs, Inst); }; auto RS = makeSampler(Rand, make_filter_range(Insts, MatchesPred)); // Also consider choosing no source, meaning we want a new one. RS.sample(nullptr, /*Weight=*/1); if (Instruction *Src = RS.getSelection()) return Src; return newSource(BB, Insts, Srcs, Pred); } Value *RandomIRBuilder::newSource(BasicBlock &BB, ArrayRef<Instruction *> Insts, ArrayRef<Value *> Srcs, SourcePred Pred) { // Generate some constants to choose from. auto RS = makeSampler<Value *>(Rand); RS.sample(Pred.generate(Srcs, KnownTypes)); // If we can find a pointer to load from, use it half the time. Value *Ptr = findPointer(BB, Insts, Srcs, Pred); if (Ptr) { // Create load from the chosen pointer auto IP = BB.getFirstInsertionPt(); if (auto *I = dyn_cast<Instruction>(Ptr)) { IP = ++I->getIterator(); assert(IP != BB.end() && "guaranteed by the findPointer"); } auto *NewLoad = new LoadInst( cast<PointerType>(Ptr->getType())->getElementType(), Ptr, "L", &*IP); // Only sample this load if it really matches the descriptor if (Pred.matches(Srcs, NewLoad)) RS.sample(NewLoad, RS.totalWeight()); else NewLoad->eraseFromParent(); } assert(!RS.isEmpty() && "Failed to generate sources"); return RS.getSelection(); } static bool isCompatibleReplacement(const Instruction *I, const Use &Operand, const Value *Replacement) { if (Operand->getType() != Replacement->getType()) return false; switch (I->getOpcode()) { case Instruction::GetElementPtr: case Instruction::ExtractElement: case Instruction::ExtractValue: // TODO: We could potentially validate these, but for now just leave indices // alone. if (Operand.getOperandNo() >= 1) return false; break; case Instruction::InsertValue: case Instruction::InsertElement: case Instruction::ShuffleVector: if (Operand.getOperandNo() >= 2) return false; break; default: break; } return true; } void RandomIRBuilder::connectToSink(BasicBlock &BB, ArrayRef<Instruction *> Insts, Value *V) { auto RS = makeSampler<Use *>(Rand); for (auto &I : Insts) { if (isa<IntrinsicInst>(I)) // TODO: Replacing operands of intrinsics would be interesting, but // there's no easy way to verify that a given replacement is valid given // that intrinsics can impose arbitrary constraints. continue; for (Use &U : I->operands()) if (isCompatibleReplacement(I, U, V)) RS.sample(&U, 1); } // Also consider choosing no sink, meaning we want a new one. RS.sample(nullptr, /*Weight=*/1); if (Use *Sink = RS.getSelection()) { User *U = Sink->getUser(); unsigned OpNo = Sink->getOperandNo(); U->setOperand(OpNo, V); return; } newSink(BB, Insts, V); } void RandomIRBuilder::newSink(BasicBlock &BB, ArrayRef<Instruction *> Insts, Value *V) { Value *Ptr = findPointer(BB, Insts, {V}, matchFirstType()); if (!Ptr) { if (uniform(Rand, 0, 1)) Ptr = new AllocaInst(V->getType(), 0, "A", &*BB.getFirstInsertionPt()); else Ptr = UndefValue::get(PointerType::get(V->getType(), 0)); } new StoreInst(V, Ptr, Insts.back()); } Value *RandomIRBuilder::findPointer(BasicBlock &BB, ArrayRef<Instruction *> Insts, ArrayRef<Value *> Srcs, SourcePred Pred) { auto IsMatchingPtr = [&Srcs, &Pred](Instruction *Inst) { // Invoke instructions sometimes produce valid pointers but currently // we can't insert loads or stores from them if (Inst->isTerminator()) return false; if (auto PtrTy = dyn_cast<PointerType>(Inst->getType())) { // We can never generate loads from non first class or non sized types if (!PtrTy->getElementType()->isSized() || !PtrTy->getElementType()->isFirstClassType()) return false; // TODO: Check if this is horribly expensive. return Pred.matches(Srcs, UndefValue::get(PtrTy->getElementType())); } return false; }; if (auto RS = makeSampler(Rand, make_filter_range(Insts, IsMatchingPtr))) return RS.getSelection(); return nullptr; }
{ "pile_set_name": "Github" }
go-spew ======= [![Build Status](https://travis-ci.org/davecgh/go-spew.png?branch=master)] (https://travis-ci.org/davecgh/go-spew) [![Coverage Status] (https://coveralls.io/repos/davecgh/go-spew/badge.png?branch=master)] (https://coveralls.io/r/davecgh/go-spew?branch=master) Go-spew implements a deep pretty printer for Go data structures to aid in debugging. A comprehensive suite of tests with 100% test coverage is provided to ensure proper functionality. See `test_coverage.txt` for the gocov coverage report. Go-spew is licensed under the liberal ISC license, so it may be used in open source or commercial projects. If you're interested in reading about how this package came to life and some of the challenges involved in providing a deep pretty printer, there is a blog post about it [here](https://blog.cyphertite.com/go-spew-a-journey-into-dumping-go-data-structures/). ## Documentation [![GoDoc](https://godoc.org/github.com/davecgh/go-spew/spew?status.png)] (http://godoc.org/github.com/davecgh/go-spew/spew) Full `go doc` style documentation for the project can be viewed online without installing this package by using the excellent GoDoc site here: http://godoc.org/github.com/davecgh/go-spew/spew You can also view the documentation locally once the package is installed with the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to http://localhost:6060/pkg/github.com/davecgh/go-spew/spew ## Installation ```bash $ go get -u github.com/davecgh/go-spew/spew ``` ## Quick Start Add this import line to the file you're working in: ```Go import "github.com/davecgh/go-spew/spew" ``` To dump a variable with full newlines, indentation, type, and pointer information use Dump, Fdump, or Sdump: ```Go spew.Dump(myVar1, myVar2, ...) spew.Fdump(someWriter, myVar1, myVar2, ...) str := spew.Sdump(myVar1, myVar2, ...) ``` Alternatively, if you would prefer to use format strings with a compacted inline printing style, use the convenience wrappers Printf, Fprintf, etc with %v (most compact), %+v (adds pointer addresses), %#v (adds types), or %#+v (adds types and pointer addresses): ```Go spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) ``` ## Debugging a Web Application Example Here is an example of how you can use `spew.Sdump()` to help debug a web application. Please be sure to wrap your output using the `html.EscapeString()` function for safety reasons. You should also only use this debugging technique in a development environment, never in production. ```Go package main import ( "fmt" "html" "net/http" "github.com/davecgh/go-spew/spew" ) func handler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html") fmt.Fprintf(w, "Hi there, %s!", r.URL.Path[1:]) fmt.Fprintf(w, "<!--\n" + html.EscapeString(spew.Sdump(w)) + "\n-->") } func main() { http.HandleFunc("/", handler) http.ListenAndServe(":8080", nil) } ``` ## Sample Dump Output ``` (main.Foo) { unexportedField: (*main.Bar)(0xf84002e210)({ flag: (main.Flag) flagTwo, data: (uintptr) <nil> }), ExportedField: (map[interface {}]interface {}) { (string) "one": (bool) true } } ([]uint8) { 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... | 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0| 00000020 31 32 |12| } ``` ## Sample Formatter Output Double pointer to a uint8: ``` %v: <**>5 %+v: <**>(0xf8400420d0->0xf8400420c8)5 %#v: (**uint8)5 %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5 ``` Pointer to circular struct with a uint8 field and a pointer to itself: ``` %v: <*>{1 <*><shown>} %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)<shown>} %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)<shown>} %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)<shown>} ``` ## Configuration Options Configuration of spew is handled by fields in the ConfigState type. For convenience, all of the top-level functions use a global state available via the spew.Config global. It is also possible to create a ConfigState instance that provides methods equivalent to the top-level functions. This allows concurrent configuration options. See the ConfigState documentation for more details. ``` * Indent String to use for each indentation level for Dump functions. It is a single space by default. A popular alternative is "\t". * MaxDepth Maximum number of levels to descend into nested data structures. There is no limit by default. * DisableMethods Disables invocation of error and Stringer interface methods. Method invocation is enabled by default. * DisablePointerMethods Disables invocation of error and Stringer interface methods on types which only accept pointer receivers from non-pointer variables. This option relies on access to the unsafe package, so it will not have any effect when running in environments without access to the unsafe package such as Google App Engine or with the "disableunsafe" build tag specified. Pointer method invocation is enabled by default. * ContinueOnMethod Enables recursion into types after invoking error and Stringer interface methods. Recursion after method invocation is disabled by default. * SortKeys Specifies map keys should be sorted before being printed. Use this to have a more deterministic, diffable output. Note that only native types (bool, int, uint, floats, uintptr and string) and types which implement error or Stringer interfaces are supported, with other types sorted according to the reflect.Value.String() output which guarantees display stability. Natural map order is used by default. * SpewKeys SpewKeys specifies that, as a last resort attempt, map keys should be spewed to strings and sorted by those strings. This is only considered if SortKeys is true. ``` ## Unsafe Package Dependency This package relies on the unsafe package to perform some of the more advanced features, however it also supports a "limited" mode which allows it to work in environments where the unsafe package is not available. By default, it will operate in this mode on Google App Engine. The "disableunsafe" build tag may also be specified to force the package to build without using the unsafe package. ## License Go-spew is licensed under the liberal ISC License.
{ "pile_set_name": "Github" }
$TEST_SERVICES_PLUGIN_REGISTRY_OPT --local-infile=true
{ "pile_set_name": "Github" }
{ "type": "statement", "variant": "list", "statement": [ { "type": "statement", "name": { "type": "identifier", "variant": "table", "name": "element" }, "variant": "create", "format": "table", "definition": [ { "type": "definition", "variant": "column", "name": "code", "definition": [ { "type": "constraint", "variant": "primary key" } ], "datatype": { "type": "datatype", "variant": "integer", "affinity": "integer" } }, { "type": "definition", "variant": "column", "name": "name", "definition": [], "datatype": { "type": "datatype", "variant": "varchar", "affinity": "text", "args": { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "decimal", "value": "60" } ] } } } ] }, { "type": "statement", "name": { "type": "identifier", "variant": "table", "name": "elemor" }, "variant": "create", "format": "table", "definition": [ { "type": "definition", "variant": "column", "name": "codeor", "definition": [ { "type": "constraint", "variant": "not null" } ], "datatype": { "type": "datatype", "variant": "integer", "affinity": "integer" } }, { "type": "definition", "variant": "column", "name": "code", "definition": [ { "type": "constraint", "variant": "not null" } ], "datatype": { "type": "datatype", "variant": "integer", "affinity": "integer" } }, { "type": "definition", "variant": "constraint", "definition": [ { "type": "constraint", "variant": "primary key" } ], "columns": [ { "type": "identifier", "variant": "column", "name": "codeor" }, { "type": "identifier", "variant": "column", "name": "code" } ] } ] }, { "type": "statement", "name": { "type": "identifier", "variant": "table", "name": "elemand" }, "variant": "create", "format": "table", "definition": [ { "type": "definition", "variant": "column", "name": "codeand", "definition": [], "datatype": { "type": "datatype", "variant": "integer", "affinity": "integer" } }, { "type": "definition", "variant": "column", "name": "code", "definition": [], "datatype": { "type": "datatype", "variant": "integer", "affinity": "integer" } }, { "type": "definition", "variant": "column", "name": "attr1", "definition": [], "datatype": { "type": "datatype", "variant": "integer", "affinity": "integer" } }, { "type": "definition", "variant": "column", "name": "attr2", "definition": [], "datatype": { "type": "datatype", "variant": "integer", "affinity": "integer" } }, { "type": "definition", "variant": "column", "name": "attr3", "definition": [], "datatype": { "type": "datatype", "variant": "integer", "affinity": "integer" } }, { "type": "definition", "variant": "constraint", "definition": [ { "type": "constraint", "variant": "primary key" } ], "columns": [ { "type": "identifier", "variant": "column", "name": "codeand" }, { "type": "identifier", "variant": "column", "name": "code" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "element" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "decimal", "value": "1" }, { "type": "literal", "variant": "text", "value": "Elem1" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "element" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "decimal", "value": "2" }, { "type": "literal", "variant": "text", "value": "Elem2" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "element" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "decimal", "value": "3" }, { "type": "literal", "variant": "text", "value": "Elem3" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "element" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "decimal", "value": "4" }, { "type": "literal", "variant": "text", "value": "Elem4" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "element" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "decimal", "value": "5" }, { "type": "literal", "variant": "text", "value": "Elem5" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "elemor" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "decimal", "value": "3" }, { "type": "literal", "variant": "decimal", "value": "4" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "elemor" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "decimal", "value": "3" }, { "type": "literal", "variant": "decimal", "value": "5" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "elemand" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "decimal", "value": "1" }, { "type": "literal", "variant": "decimal", "value": "3" }, { "type": "literal", "variant": "text", "value": "a" }, { "type": "literal", "variant": "text", "value": "b" }, { "type": "literal", "variant": "text", "value": "c" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "elemand" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "decimal", "value": "1" }, { "type": "literal", "variant": "decimal", "value": "2" }, { "type": "literal", "variant": "text", "value": "x" }, { "type": "literal", "variant": "text", "value": "y" }, { "type": "literal", "variant": "text", "value": "z" } ] } ] }, { "type": "statement", "target": { "type": "identifier", "variant": "view", "name": "elemview1" }, "result": { "type": "statement", "variant": "compound", "statement": { "type": "statement", "variant": "select", "result": [ { "type": "expression", "format": "unary", "variant": "cast", "expression": { "type": "identifier", "variant": "column", "name": "element.code" }, "as": { "type": "datatype", "variant": "varchar", "affinity": "text", "args": { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "decimal", "value": "50" } ] } }, "alias": "elemid" }, { "type": "identifier", "variant": "column", "name": "element.code", "alias": "elemcode" }, { "type": "identifier", "variant": "column", "name": "element.name", "alias": "elemname" }, { "type": "identifier", "variant": "column", "name": "elemand.code", "alias": "innercode" }, { "type": "identifier", "variant": "column", "name": "elemand.attr1", "alias": "attr1" }, { "type": "identifier", "variant": "column", "name": "elemand.attr2", "alias": "attr2" }, { "type": "identifier", "variant": "column", "name": "elemand.attr3", "alias": "attr3" }, { "type": "literal", "variant": "decimal", "value": "0", "alias": "level" }, { "type": "literal", "variant": "decimal", "value": "0", "alias": "isorelem" } ], "from": { "type": "map", "variant": "join", "source": { "type": "identifier", "variant": "table", "name": "element" }, "map": [ { "type": "join", "variant": "join", "source": { "type": "identifier", "variant": "table", "name": "elemand" }, "constraint": { "type": "constraint", "variant": "join", "format": "on", "on": { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "elemand.codeand" }, "right": { "type": "identifier", "variant": "column", "name": "element.code" } } } } ] }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "not in", "right": { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "codeor" } ], "from": { "type": "identifier", "variant": "table", "name": "elemor" } }, "left": { "type": "identifier", "variant": "column", "name": "elemand.codeand" } } ] }, "compound": [ { "type": "compound", "variant": "union all", "statement": { "type": "statement", "variant": "select", "result": [ { "type": "expression", "format": "unary", "variant": "cast", "expression": { "type": "identifier", "variant": "column", "name": "elemor.codeor" }, "as": { "type": "datatype", "variant": "varchar", "affinity": "text", "args": { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "decimal", "value": "50" } ] } }, "alias": "elemid" }, { "type": "identifier", "variant": "column", "name": "element.code", "alias": "elemcode" }, { "type": "identifier", "variant": "column", "name": "element.name", "alias": "elemname" }, { "type": "identifier", "variant": "column", "name": "elemor.code", "alias": "innercode" }, { "type": "literal", "variant": "null", "value": "null", "alias": "attr1" }, { "type": "literal", "variant": "null", "value": "null", "alias": "attr2" }, { "type": "literal", "variant": "null", "value": "null", "alias": "attr3" }, { "type": "literal", "variant": "decimal", "value": "0", "alias": "level" }, { "type": "literal", "variant": "decimal", "value": "1", "alias": "isorelem" } ], "from": { "type": "map", "variant": "join", "source": { "type": "identifier", "variant": "table", "name": "elemor" }, "map": [ { "type": "join", "variant": "join", "source": { "type": "identifier", "variant": "table", "name": "element" }, "constraint": { "type": "constraint", "variant": "join", "format": "on", "on": { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "element.code" }, "right": { "type": "identifier", "variant": "column", "name": "elemor.codeor" } } } } ] } } } ], "order": [ { "type": "identifier", "variant": "column", "name": "elemid" }, { "type": "identifier", "variant": "column", "name": "innercode" } ] }, "variant": "create", "format": "view" }, { "type": "statement", "target": { "type": "identifier", "variant": "view", "name": "elemview2" }, "result": { "type": "statement", "variant": "compound", "statement": { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "elemid" }, { "type": "identifier", "variant": "column", "name": "elemcode" }, { "type": "identifier", "variant": "column", "name": "elemname" }, { "type": "identifier", "variant": "column", "name": "innercode" }, { "type": "identifier", "variant": "column", "name": "attr1" }, { "type": "identifier", "variant": "column", "name": "attr2" }, { "type": "identifier", "variant": "column", "name": "attr3" }, { "type": "identifier", "variant": "column", "name": "level" }, { "type": "identifier", "variant": "column", "name": "isorelem" } ], "from": { "type": "identifier", "variant": "table", "name": "elemview1" } }, "compound": [ { "type": "compound", "variant": "union all", "statement": { "type": "statement", "variant": "select", "result": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "||", "left": { "type": "expression", "format": "binary", "variant": "operation", "operation": "||", "left": { "type": "identifier", "variant": "column", "name": "element.elemid" }, "right": { "type": "literal", "variant": "text", "value": "." } }, "right": { "type": "identifier", "variant": "column", "name": "innerelem.elemid" }, "alias": "elemid" }, { "type": "identifier", "variant": "column", "name": "innerelem.elemcode" }, { "type": "identifier", "variant": "column", "name": "innerelem.elemname" }, { "type": "identifier", "variant": "column", "name": "innerelem.innercode" }, { "type": "identifier", "variant": "column", "name": "innerelem.attr1" }, { "type": "identifier", "variant": "column", "name": "innerelem.attr2" }, { "type": "identifier", "variant": "column", "name": "innerelem.attr3" }, { "type": "expression", "format": "binary", "variant": "operation", "operation": "+", "left": { "type": "identifier", "variant": "column", "name": "innerelem.level" }, "right": { "type": "literal", "variant": "decimal", "value": "1" } }, { "type": "identifier", "variant": "column", "name": "innerelem.isorelem" } ], "from": { "type": "map", "variant": "join", "source": { "type": "identifier", "variant": "table", "name": "elemview1", "alias": "element" }, "map": [ { "type": "join", "variant": "join", "source": { "type": "identifier", "variant": "table", "name": "elemview1", "alias": "innerelem" }, "constraint": { "type": "constraint", "variant": "join", "format": "on", "on": { "type": "expression", "format": "binary", "variant": "operation", "operation": "and", "left": { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "element.level" }, "right": { "type": "literal", "variant": "decimal", "value": "0" } }, "right": { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "element.innercode" }, "right": { "type": "identifier", "variant": "column", "name": "innerelem.elemcode" } } } } } ] } } } ], "order": [ { "type": "identifier", "variant": "column", "name": "elemid" }, { "type": "identifier", "variant": "column", "name": "innercode" } ] }, "variant": "create", "format": "view" }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "star", "name": "*" } ], "from": { "type": "identifier", "variant": "table", "name": "elemview1" } }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "star", "name": "*" } ], "from": { "type": "identifier", "variant": "table", "name": "elemview2" } } ] }
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: be9043cdfd89f8d4e9deb8b77a4f559f timeCreated: 1513521572 licenseType: Free DefaultImporter: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
package edu.umd.hooka.alignment; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import org.apache.hadoop.io.Writable; import edu.umd.hooka.alignment.hmm.ATable; /** * Store anything that stores partial counts. * * @author redpony * */ public class PartialCountContainer implements Writable, Cloneable { public static final int CONTENT_ATABLE = 2; public static final int CONTENT_ARRAY = 3; byte type = 0; Writable content = null; public PartialCountContainer() {} private PartialCountContainer(Writable c, byte t) { content = c; type = t; } public PartialCountContainer(Writable content) { this.setContent(content); } public Object clone() { Writable nc = null; if (type == CONTENT_ATABLE) nc = (Writable)((ATable)content).clone(); else if (type == CONTENT_ARRAY) nc = (Writable)((IndexedFloatArray)content).clone(); else throw new RuntimeException("Bad type"); return new PartialCountContainer(nc, type); } public void setContent(Writable content) { if (content instanceof ATable) type=CONTENT_ATABLE; else if (content instanceof IndexedFloatArray) type=CONTENT_ARRAY; else throw new RuntimeException("Don't know how to wrap " + content); this.content = content; } public Writable getContent() { return content; } public int getType() { return type; } public void plusEquals(PartialCountContainer rhs) { if (rhs.type != this.type) throw new RuntimeException("Type mismatch!"); else if (type == CONTENT_ATABLE) ((ATable)content).plusEquals((ATable)rhs.content); else if (type == CONTENT_ARRAY) ((IndexedFloatArray)content).plusEquals((IndexedFloatArray)rhs.content); else throw new RuntimeException("Bad type"); } /** * TODO: atable normalization currently doesn't support * VB or an alpha parameter. This should probably be a * separate param, ie. alpha2 and vb 2. * * @param variationalBayes * @param alpha */ public void normalize(boolean variationalBayes, float alpha) { if (type == CONTENT_ATABLE) ((ATable)content).normalize(); else if (type == CONTENT_ARRAY) { if (variationalBayes) ((IndexedFloatArray)content).normalize_variationalBayes(alpha); else ((IndexedFloatArray)content).normalize(alpha); } else throw new RuntimeException("Bad type"); } public void readFields(DataInput in) throws IOException { type = in.readByte(); if (type == CONTENT_ATABLE) { content = new ATable(); } else if (type == CONTENT_ARRAY) { content = new IndexedFloatArray(); }else { throw new RuntimeException("Bad content type!"); } content.readFields(in); } public void write(DataOutput out) throws IOException { out.writeByte(type); content.write(out); } public String toString() { return "T(" + type + "): " + content; } }
{ "pile_set_name": "Github" }
// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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. package v20180504 import ( "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" ) const APIVersion = "2018-05-04" type Client struct { common.Client } // Deprecated func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) { cpf := profile.NewClientProfile() client = &Client{} client.Init(region).WithSecretId(secretId, secretKey).WithProfile(cpf) return } func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error) { client = &Client{} client.Init(region). WithCredential(credential). WithProfile(clientProfile) return } func NewDataManipulationRequest() (request *DataManipulationRequest) { request = &DataManipulationRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("yunsou", APIVersion, "DataManipulation") return } func NewDataManipulationResponse() (response *DataManipulationResponse) { response = &DataManipulationResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 上传云搜数据的API接口 func (c *Client) DataManipulation(request *DataManipulationRequest) (response *DataManipulationResponse, err error) { if request == nil { request = NewDataManipulationRequest() } response = NewDataManipulationResponse() err = c.Send(request, response) return } func NewDataSearchRequest() (request *DataSearchRequest) { request = &DataSearchRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("yunsou", APIVersion, "DataSearch") return } func NewDataSearchResponse() (response *DataSearchResponse) { response = &DataSearchResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 用于检索云搜中的数据 func (c *Client) DataSearch(request *DataSearchRequest) (response *DataSearchResponse, err error) { if request == nil { request = NewDataSearchRequest() } response = NewDataSearchResponse() err = c.Send(request, response) return }
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0 OR MIT /* * Xen para-virtual sound device * * Copyright (C) 2016-2018 EPAM Systems Inc. * * Author: Oleksandr Andrushchenko <[email protected]> */ #include <xen/events.h> #include <xen/grant_table.h> #include <xen/xen.h> #include <xen/xenbus.h> #include "xen_snd_front.h" #include "xen_snd_front_alsa.h" #include "xen_snd_front_cfg.h" #include "xen_snd_front_evtchnl.h" static irqreturn_t evtchnl_interrupt_req(int irq, void *dev_id) { struct xen_snd_front_evtchnl *channel = dev_id; struct xen_snd_front_info *front_info = channel->front_info; struct xensnd_resp *resp; RING_IDX i, rp; if (unlikely(channel->state != EVTCHNL_STATE_CONNECTED)) return IRQ_HANDLED; mutex_lock(&channel->ring_io_lock); again: rp = channel->u.req.ring.sring->rsp_prod; /* Ensure we see queued responses up to rp. */ rmb(); /* * Assume that the backend is trusted to always write sane values * to the ring counters, so no overflow checks on frontend side * are required. */ for (i = channel->u.req.ring.rsp_cons; i != rp; i++) { resp = RING_GET_RESPONSE(&channel->u.req.ring, i); if (resp->id != channel->evt_id) continue; switch (resp->operation) { case XENSND_OP_OPEN: case XENSND_OP_CLOSE: case XENSND_OP_READ: case XENSND_OP_WRITE: case XENSND_OP_TRIGGER: channel->u.req.resp_status = resp->status; complete(&channel->u.req.completion); break; case XENSND_OP_HW_PARAM_QUERY: channel->u.req.resp_status = resp->status; channel->u.req.resp.hw_param = resp->resp.hw_param; complete(&channel->u.req.completion); break; default: dev_err(&front_info->xb_dev->dev, "Operation %d is not supported\n", resp->operation); break; } } channel->u.req.ring.rsp_cons = i; if (i != channel->u.req.ring.req_prod_pvt) { int more_to_do; RING_FINAL_CHECK_FOR_RESPONSES(&channel->u.req.ring, more_to_do); if (more_to_do) goto again; } else { channel->u.req.ring.sring->rsp_event = i + 1; } mutex_unlock(&channel->ring_io_lock); return IRQ_HANDLED; } static irqreturn_t evtchnl_interrupt_evt(int irq, void *dev_id) { struct xen_snd_front_evtchnl *channel = dev_id; struct xensnd_event_page *page = channel->u.evt.page; u32 cons, prod; if (unlikely(channel->state != EVTCHNL_STATE_CONNECTED)) return IRQ_HANDLED; mutex_lock(&channel->ring_io_lock); prod = page->in_prod; /* Ensure we see ring contents up to prod. */ virt_rmb(); if (prod == page->in_cons) goto out; /* * Assume that the backend is trusted to always write sane values * to the ring counters, so no overflow checks on frontend side * are required. */ for (cons = page->in_cons; cons != prod; cons++) { struct xensnd_evt *event; event = &XENSND_IN_RING_REF(page, cons); if (unlikely(event->id != channel->evt_id++)) continue; switch (event->type) { case XENSND_EVT_CUR_POS: xen_snd_front_alsa_handle_cur_pos(channel, event->op.cur_pos.position); break; } } page->in_cons = cons; /* Ensure ring contents. */ virt_wmb(); out: mutex_unlock(&channel->ring_io_lock); return IRQ_HANDLED; } void xen_snd_front_evtchnl_flush(struct xen_snd_front_evtchnl *channel) { int notify; channel->u.req.ring.req_prod_pvt++; RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&channel->u.req.ring, notify); if (notify) notify_remote_via_irq(channel->irq); } static void evtchnl_free(struct xen_snd_front_info *front_info, struct xen_snd_front_evtchnl *channel) { unsigned long page = 0; if (channel->type == EVTCHNL_TYPE_REQ) page = (unsigned long)channel->u.req.ring.sring; else if (channel->type == EVTCHNL_TYPE_EVT) page = (unsigned long)channel->u.evt.page; if (!page) return; channel->state = EVTCHNL_STATE_DISCONNECTED; if (channel->type == EVTCHNL_TYPE_REQ) { /* Release all who still waits for response if any. */ channel->u.req.resp_status = -EIO; complete_all(&channel->u.req.completion); } if (channel->irq) unbind_from_irqhandler(channel->irq, channel); if (channel->port) xenbus_free_evtchn(front_info->xb_dev, channel->port); /* End access and free the page. */ if (channel->gref != GRANT_INVALID_REF) gnttab_end_foreign_access(channel->gref, 0, page); else free_page(page); memset(channel, 0, sizeof(*channel)); } void xen_snd_front_evtchnl_free_all(struct xen_snd_front_info *front_info) { int i; if (!front_info->evt_pairs) return; for (i = 0; i < front_info->num_evt_pairs; i++) { evtchnl_free(front_info, &front_info->evt_pairs[i].req); evtchnl_free(front_info, &front_info->evt_pairs[i].evt); } kfree(front_info->evt_pairs); front_info->evt_pairs = NULL; } static int evtchnl_alloc(struct xen_snd_front_info *front_info, int index, struct xen_snd_front_evtchnl *channel, enum xen_snd_front_evtchnl_type type) { struct xenbus_device *xb_dev = front_info->xb_dev; unsigned long page; grant_ref_t gref; irq_handler_t handler; char *handler_name = NULL; int ret; memset(channel, 0, sizeof(*channel)); channel->type = type; channel->index = index; channel->front_info = front_info; channel->state = EVTCHNL_STATE_DISCONNECTED; channel->gref = GRANT_INVALID_REF; page = get_zeroed_page(GFP_KERNEL); if (!page) { ret = -ENOMEM; goto fail; } handler_name = kasprintf(GFP_KERNEL, "%s-%s", XENSND_DRIVER_NAME, type == EVTCHNL_TYPE_REQ ? XENSND_FIELD_RING_REF : XENSND_FIELD_EVT_RING_REF); if (!handler_name) { ret = -ENOMEM; goto fail; } mutex_init(&channel->ring_io_lock); if (type == EVTCHNL_TYPE_REQ) { struct xen_sndif_sring *sring = (struct xen_sndif_sring *)page; init_completion(&channel->u.req.completion); mutex_init(&channel->u.req.req_io_lock); SHARED_RING_INIT(sring); FRONT_RING_INIT(&channel->u.req.ring, sring, XEN_PAGE_SIZE); ret = xenbus_grant_ring(xb_dev, sring, 1, &gref); if (ret < 0) { channel->u.req.ring.sring = NULL; goto fail; } handler = evtchnl_interrupt_req; } else { ret = gnttab_grant_foreign_access(xb_dev->otherend_id, virt_to_gfn((void *)page), 0); if (ret < 0) goto fail; channel->u.evt.page = (struct xensnd_event_page *)page; gref = ret; handler = evtchnl_interrupt_evt; } channel->gref = gref; ret = xenbus_alloc_evtchn(xb_dev, &channel->port); if (ret < 0) goto fail; ret = bind_evtchn_to_irq(channel->port); if (ret < 0) { dev_err(&xb_dev->dev, "Failed to bind IRQ for domid %d port %d: %d\n", front_info->xb_dev->otherend_id, channel->port, ret); goto fail; } channel->irq = ret; ret = request_threaded_irq(channel->irq, NULL, handler, IRQF_ONESHOT, handler_name, channel); if (ret < 0) { dev_err(&xb_dev->dev, "Failed to request IRQ %d: %d\n", channel->irq, ret); goto fail; } kfree(handler_name); return 0; fail: if (page) free_page(page); kfree(handler_name); dev_err(&xb_dev->dev, "Failed to allocate ring: %d\n", ret); return ret; } int xen_snd_front_evtchnl_create_all(struct xen_snd_front_info *front_info, int num_streams) { struct xen_front_cfg_card *cfg = &front_info->cfg; struct device *dev = &front_info->xb_dev->dev; int d, ret = 0; front_info->evt_pairs = kcalloc(num_streams, sizeof(struct xen_snd_front_evtchnl_pair), GFP_KERNEL); if (!front_info->evt_pairs) return -ENOMEM; /* Iterate over devices and their streams and create event channels. */ for (d = 0; d < cfg->num_pcm_instances; d++) { struct xen_front_cfg_pcm_instance *pcm_instance; int s, index; pcm_instance = &cfg->pcm_instances[d]; for (s = 0; s < pcm_instance->num_streams_pb; s++) { index = pcm_instance->streams_pb[s].index; ret = evtchnl_alloc(front_info, index, &front_info->evt_pairs[index].req, EVTCHNL_TYPE_REQ); if (ret < 0) { dev_err(dev, "Error allocating control channel\n"); goto fail; } ret = evtchnl_alloc(front_info, index, &front_info->evt_pairs[index].evt, EVTCHNL_TYPE_EVT); if (ret < 0) { dev_err(dev, "Error allocating in-event channel\n"); goto fail; } } for (s = 0; s < pcm_instance->num_streams_cap; s++) { index = pcm_instance->streams_cap[s].index; ret = evtchnl_alloc(front_info, index, &front_info->evt_pairs[index].req, EVTCHNL_TYPE_REQ); if (ret < 0) { dev_err(dev, "Error allocating control channel\n"); goto fail; } ret = evtchnl_alloc(front_info, index, &front_info->evt_pairs[index].evt, EVTCHNL_TYPE_EVT); if (ret < 0) { dev_err(dev, "Error allocating in-event channel\n"); goto fail; } } } front_info->num_evt_pairs = num_streams; return 0; fail: xen_snd_front_evtchnl_free_all(front_info); return ret; } static int evtchnl_publish(struct xenbus_transaction xbt, struct xen_snd_front_evtchnl *channel, const char *path, const char *node_ring, const char *node_chnl) { struct xenbus_device *xb_dev = channel->front_info->xb_dev; int ret; /* Write control channel ring reference. */ ret = xenbus_printf(xbt, path, node_ring, "%u", channel->gref); if (ret < 0) { dev_err(&xb_dev->dev, "Error writing ring-ref: %d\n", ret); return ret; } /* Write event channel ring reference. */ ret = xenbus_printf(xbt, path, node_chnl, "%u", channel->port); if (ret < 0) { dev_err(&xb_dev->dev, "Error writing event channel: %d\n", ret); return ret; } return 0; } int xen_snd_front_evtchnl_publish_all(struct xen_snd_front_info *front_info) { struct xen_front_cfg_card *cfg = &front_info->cfg; struct xenbus_transaction xbt; int ret, d; again: ret = xenbus_transaction_start(&xbt); if (ret < 0) { xenbus_dev_fatal(front_info->xb_dev, ret, "starting transaction"); return ret; } for (d = 0; d < cfg->num_pcm_instances; d++) { struct xen_front_cfg_pcm_instance *pcm_instance; int s, index; pcm_instance = &cfg->pcm_instances[d]; for (s = 0; s < pcm_instance->num_streams_pb; s++) { index = pcm_instance->streams_pb[s].index; ret = evtchnl_publish(xbt, &front_info->evt_pairs[index].req, pcm_instance->streams_pb[s].xenstore_path, XENSND_FIELD_RING_REF, XENSND_FIELD_EVT_CHNL); if (ret < 0) goto fail; ret = evtchnl_publish(xbt, &front_info->evt_pairs[index].evt, pcm_instance->streams_pb[s].xenstore_path, XENSND_FIELD_EVT_RING_REF, XENSND_FIELD_EVT_EVT_CHNL); if (ret < 0) goto fail; } for (s = 0; s < pcm_instance->num_streams_cap; s++) { index = pcm_instance->streams_cap[s].index; ret = evtchnl_publish(xbt, &front_info->evt_pairs[index].req, pcm_instance->streams_cap[s].xenstore_path, XENSND_FIELD_RING_REF, XENSND_FIELD_EVT_CHNL); if (ret < 0) goto fail; ret = evtchnl_publish(xbt, &front_info->evt_pairs[index].evt, pcm_instance->streams_cap[s].xenstore_path, XENSND_FIELD_EVT_RING_REF, XENSND_FIELD_EVT_EVT_CHNL); if (ret < 0) goto fail; } } ret = xenbus_transaction_end(xbt, 0); if (ret < 0) { if (ret == -EAGAIN) goto again; xenbus_dev_fatal(front_info->xb_dev, ret, "completing transaction"); goto fail_to_end; } return 0; fail: xenbus_transaction_end(xbt, 1); fail_to_end: xenbus_dev_fatal(front_info->xb_dev, ret, "writing XenStore"); return ret; } void xen_snd_front_evtchnl_pair_set_connected(struct xen_snd_front_evtchnl_pair *evt_pair, bool is_connected) { enum xen_snd_front_evtchnl_state state; if (is_connected) state = EVTCHNL_STATE_CONNECTED; else state = EVTCHNL_STATE_DISCONNECTED; mutex_lock(&evt_pair->req.ring_io_lock); evt_pair->req.state = state; mutex_unlock(&evt_pair->req.ring_io_lock); mutex_lock(&evt_pair->evt.ring_io_lock); evt_pair->evt.state = state; mutex_unlock(&evt_pair->evt.ring_io_lock); } void xen_snd_front_evtchnl_pair_clear(struct xen_snd_front_evtchnl_pair *evt_pair) { mutex_lock(&evt_pair->req.ring_io_lock); evt_pair->req.evt_next_id = 0; mutex_unlock(&evt_pair->req.ring_io_lock); mutex_lock(&evt_pair->evt.ring_io_lock); evt_pair->evt.evt_next_id = 0; mutex_unlock(&evt_pair->evt.ring_io_lock); }
{ "pile_set_name": "Github" }
#include<iostream> #include<string> #include<stdio.h> #include<stdlib.h> #include<fstream> #include "hash.h" using namespace std; struct node { string name; int frequency; }; struct node** hash::initialise(int siz,string typ) //function to initialise hashtable { size=siz; type=typ; head=new node*[size]; uns=0; suc=0; for(int i=0;i<size;i++) head[i]=NULL; return head; } int Hashfunc(string key) //hash function to distribute keys { int s=0,x; for(int i=0;key[i]!='\0';i++) { x=(int)key[i]; s=s+x; } return s; } struct node* createnode(string key,int Tcount) //functin to create a new node { struct node* temp=new node(); temp->name=key; temp->frequency=Tcount; return temp; } int hash::insert(string key,int Tcount,int count,struct node** head) //function to insert a node { loadfactor=(float)count/size; if(loadfactor<0.75) { struct node* temp; int index=Hashfunc(key); temp=createnode(key,Tcount); int a=index%size; if(head[a]==NULL){ head[a]=temp; count++; suc++; return count;} else { if(head[a]->name==key){ head[a]->frequency=head[a]->frequency+Tcount; return count;} else{ int i=1; int b=a; while(head[b]!=NULL&&i<size) { if(type=="LP") b=(a+i)%size; else b=(a+(i*i))%size; i++; uns++; } if(head[b]==NULL){ head[b]=temp; count++; return count;} else{ head=rehash(size,head); count=insert(key,Tcount,count,head); return count;} } } } else { head=rehash(size,head); count=insert(key,Tcount,count,head); return count; } } struct node** hash::rehash(int siz,struct node** head) //function to rehash the table { int i=0; size=2*siz; struct node** headnew; headnew=initialise(size,type); int count=1; while(i<siz) { if(head[i]!=NULL) { count=insert(head[i]->name,head[i]->frequency,count,headnew); } i++; } head =headnew; return head; } int hash::find(string key) //function to find given key and return its frequency { int a=Hashfunc(key); a=a%size; if(head[a]!=NULL) { if(head[a]->name==key) return head[a]->frequency; int i=1,b; while(i<size) { b=(a+i)%size; if(head[b]->name==key) return head[b]->frequency; else{ i++; } } } return 0; } void hash::deletekey(string key) //function to delete a given key { int a=Hashfunc(key); a=a%size; int i=0,b; if(head[a]!=NULL) { while(i<size) { b=(a+i)%size; if(head[b]->name==key) { head[b]->name="deleted"; head[b]->frequency=0; cout<<head[b]->name<<" "<<head[b]->frequency<<endl; return; } else i++; } } cout<<"This key doesn't exist to delete"<<endl; return; } float hash::load_factor(int count) //function to compute load factor { return (float)count/size; } void hash::disp_stats(int count) //to display stat ie no success and unsuccefull collisins { cout<<"Unsuccesful-"<<uns<<endl; cout<<"Successful-"<<suc<<endl; cout<<load_factor(count)<<endl; }
{ "pile_set_name": "Github" }
import { assert } from 'chai'; import * as RA from '../src'; describe('lengthGt', function () { context( 'given the length of a list is greater than the supplied length', function () { specify('should return true', function () { assert.isTrue(RA.lengthGt(3, [1, 2, 3, 4])); assert.isFalse(RA.lengthGt(3, [1, 2, 3])); assert.isFalse(RA.lengthGt(0, [])); }); } ); context( 'given the length of a string is greater than the supplied length', function () { specify('should return true', function () { assert.isTrue(RA.lengthGt(3, 'abcd')); assert.isFalse(RA.lengthGt(3, 'abc')); assert.isFalse(RA.lengthGt(0, '')); }); } ); context("given a value doesn't have a length property", function () { specify('should return false', function () { assert.isFalse(RA.lengthGt(1, NaN)); assert.isFalse(RA.lengthGt(1, undefined)); assert.isFalse(RA.lengthGt(1, null)); assert.isFalse(RA.lengthGt(1, {})); assert.isFalse(RA.lengthGt(1, true)); assert.isFalse(RA.lengthGt(1, false)); assert.isFalse(RA.lengthGt(1, 5)); }); }); it('should be curried', function () { assert.isTrue(RA.lengthGt(1, [1, 2])); assert.isTrue(RA.lengthGt(1)([1, 2])); }); });
{ "pile_set_name": "Github" }
#pragma once #include "Arduino.h" #include <functional> #include <libb64/cdecode.h> #ifndef HOMIE_MDNS #define HOMIE_MDNS 1 #endif #ifdef ESP32 #include <WiFi.h> #include <Update.h> #if HOMIE_MDNS #include <ESPmDNS.h> #endif #elif defined(ESP8266) #include <ESP8266WiFi.h> #if HOMIE_MDNS #include <ESP8266mDNS.h> #endif #endif // ESP32 #include <AsyncMqttClient.h> #include "../../HomieNode.hpp" #include "../../HomieRange.hpp" #include "../../StreamingOperator.hpp" #include "../Constants.hpp" #include "../Limits.hpp" #include "../Datatypes/Interface.hpp" #include "../Utils/Helpers.hpp" #include "../Uptime.hpp" #include "../Timer.hpp" #include "../ExponentialBackoffTimer.hpp" #include "Boot.hpp" #include "../Utils/ResetHandler.hpp" namespace HomieInternals { class BootNormal : public Boot { public: BootNormal(); ~BootNormal(); void setup(); void loop(); private: struct AdvertisementProgress { bool done = false; enum class GlobalStep { PUB_INIT, PUB_HOMIE, PUB_NAME, PUB_MAC, PUB_LOCALIP, PUB_NODES_ATTR, PUB_STATS, PUB_STATS_INTERVAL, PUB_FW_NAME, PUB_FW_VERSION, PUB_FW_CHECKSUM, PUB_IMPLEMENTATION, PUB_IMPLEMENTATION_CONFIG, PUB_IMPLEMENTATION_VERSION, PUB_IMPLEMENTATION_OTA_ENABLED, PUB_NODES, SUB_IMPLEMENTATION_OTA, SUB_IMPLEMENTATION_RESET, SUB_IMPLEMENTATION_CONFIG_SET, SUB_SET, SUB_BROADCAST, PUB_READY } globalStep; enum class NodeStep { PUB_NAME, PUB_TYPE, PUB_ARRAY, PUB_ARRAY_NODES, PUB_PROPERTIES, PUB_PROPERTIES_ATTRIBUTES } nodeStep; enum class PropertyStep { PUB_NAME, PUB_SETTABLE, PUB_RETAINED, PUB_DATATYPE, PUB_UNIT, PUB_FORMAT } propertyStep; size_t currentNodeIndex; size_t currentArrayNodeIndex; size_t currentPropertyIndex; } _advertisementProgress; Uptime _uptime; Timer _statsTimer; ExponentialBackoffTimer _mqttReconnectTimer; bool _setupFunctionCalled; #ifdef ESP32 WiFiEventId_t _wifiGotIpHandler; WiFiEventId_t _wifiDisconnectedHandler; #elif defined(ESP8266) WiFiEventHandler _wifiGotIpHandler; WiFiEventHandler _wifiDisconnectedHandler; #endif // ESP32 bool _mqttConnectNotified; bool _mqttDisconnectNotified; bool _otaOngoing; bool _flaggedForReboot; uint16_t _mqttOfflineMessageId; char _fwChecksum[32 + 1]; bool _otaIsBase64; base64_decodestate _otaBase64State; size_t _otaBase64Pads; size_t _otaSizeTotal; size_t _otaSizeDone; std::unique_ptr<char[]> _mqttTopic; std::unique_ptr<char[]> _mqttClientId; std::unique_ptr<char[]> _mqttWillTopic; std::unique_ptr<char[]> _mqttPayloadBuffer; std::unique_ptr<char*[]> _mqttTopicLevels; uint8_t _mqttTopicLevelsCount; std::unique_ptr<char[]> _mqttTopicCopy; void _wifiConnect(); #ifdef ESP32 void _onWifiGotIp(WiFiEvent_t event, WiFiEventInfo_t info); void _onWifiDisconnected(WiFiEvent_t event, WiFiEventInfo_t info); #elif defined(ESP8266) void _onWifiGotIp(const WiFiEventStationModeGotIP& event); void _onWifiDisconnected(const WiFiEventStationModeDisconnected& event); #endif // ESP32 void _mqttConnect(); void _advertise(); void _onMqttConnected(); void _onMqttDisconnected(AsyncMqttClientDisconnectReason reason); void _onMqttMessage(char* topic, char* payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total); void _onMqttPublish(uint16_t id); void _prefixMqttTopic(); char* _prefixMqttTopic(PGM_P topic); bool _publishOtaStatus(int status, const char* info = nullptr); void _endOtaUpdate(bool success, uint8_t update_error = UPDATE_ERROR_OK); // _onMqttMessage Helpers void __splitTopic(char* topic); bool __fillPayloadBuffer(char* topic, char* payload, const AsyncMqttClientMessageProperties& properties, size_t len, size_t index, size_t total); bool __handleOTAUpdates(char* topic, char* payload, const AsyncMqttClientMessageProperties& properties, size_t len, size_t index, size_t total); bool __handleBroadcasts(char* topic, char* payload, const AsyncMqttClientMessageProperties& properties, size_t len, size_t index, size_t total); bool __handleResets(char* topic, char* payload, const AsyncMqttClientMessageProperties& properties, size_t len, size_t index, size_t total); bool __handleConfig(char* topic, char* payload, const AsyncMqttClientMessageProperties& properties, size_t len, size_t index, size_t total); bool __handleNodeProperty(char* topic, char* payload, const AsyncMqttClientMessageProperties& properties, size_t len, size_t index, size_t total); }; } // namespace HomieInternals
{ "pile_set_name": "Github" }
import { Meta } from '@ember/-internals/meta'; import { Decorator, DecoratorPropertyDescriptor, isElementDescriptor, setClassicDecorator, } from '@ember/-internals/metal'; import { assert } from '@ember/debug'; import { consumeTag, tagFor, track, UpdatableTag, updateTag } from '@glimmer/validator'; let wrapGetterSetter = function(_target: object, key: string, desc: PropertyDescriptor) { let { get: originalGet } = desc; if (originalGet !== undefined) { desc.get = function() { let propertyTag = tagFor(this, key) as UpdatableTag; let ret; let tag = track(() => { ret = originalGet!.call(this); }); updateTag(propertyTag, tag); consumeTag(tag); return ret; }; } return desc; }; /** `@dependentKeyCompat` is decorator that can be used on _native getters_ that use tracked properties. It exposes the getter to Ember's classic computed property and observer systems, so they can watch it for changes. It can be used in both native and classic classes. Native Example: ```js import { tracked } from '@glimmer/tracking'; import { dependentKeyCompat } from '@ember/object/compat'; import { computed, set } from '@ember/object'; class Person { @tracked firstName; @tracked lastName; @dependentKeyCompat get fullName() { return `${this.firstName} ${this.lastName}`; } } class Profile { constructor(person) { set(this, 'person', person); } @computed('person.fullName') get helloMessage() { return `Hello, ${this.person.fullName}!`; } } ``` Classic Example: ```js import { tracked } from '@glimmer/tracking'; import { dependentKeyCompat } from '@ember/object/compat'; import EmberObject, { computed, observer, set } from '@ember/object'; const Person = EmberObject.extend({ firstName: tracked(), lastName: tracked(), fullName: dependentKeyCompat(function() { return `${this.firstName} ${this.lastName}`; }), }); const Profile = EmberObject.extend({ person: null, helloMessage: computed('person.fullName', function() { return `Hello, ${this.person.fullName}!`; }), onNameUpdated: observer('person.fullName', function() { console.log('person name updated!'); }), }); ``` `dependentKeyCompat()` can receive a getter function or an object containing `get`/`set` methods when used in classic classes, like computed properties. In general, only properties which you _expect_ to be watched by older, untracked clases should be marked as dependency compatible. The decorator is meant as an interop layer for parts of Ember's older classic APIs, and should not be applied to every possible getter/setter in classes. The number of dependency compatible getters should be _minimized_ wherever possible. New application code should not need to use `@dependentKeyCompat`, since it is only for interoperation with older code. @public @method dependentKeyCompat @for @ember/object/compat @static @param {PropertyDescriptor|undefined} desc A property descriptor containing the getter and setter (when used in classic classes) @return {PropertyDecorator} property decorator instance */ export function dependentKeyCompat( target: object, key: string, desc: PropertyDescriptor ): PropertyDescriptor; export function dependentKeyCompat(desc: { get?: Function; set?: Function }): Decorator; export function dependentKeyCompat( target: object | { get?: Function; set?: Function }, key?: string, desc?: PropertyDescriptor ) { if (!isElementDescriptor([target, key, desc])) { desc = target as PropertyDescriptor; let decorator = function( target: object, key: string, _desc: DecoratorPropertyDescriptor, _meta?: Meta, isClassicDecorator?: boolean ) { assert( 'The @dependentKeyCompat decorator may only be passed a method when used in classic classes. You should decorate getters/setters directly in native classes', isClassicDecorator ); assert( 'The dependentKeyCompat() decorator must be passed a getter or setter when used in classic classes', desc !== null && typeof desc === 'object' && (typeof desc.get === 'function' || typeof desc.set === 'function') ); return wrapGetterSetter(target, key, desc!); }; setClassicDecorator(decorator); return decorator as Decorator; } assert( 'The @dependentKeyCompat decorator must be applied to getters/setters when used in native classes', (desc !== null && typeof desc!.get === 'function') || typeof desc!.set === 'function' ); return wrapGetterSetter(target, key!, desc!); } setClassicDecorator(dependentKeyCompat as Decorator);
{ "pile_set_name": "Github" }
## Largest Continuous Sum [![large.jpg](https://s9.postimg.org/6aior6b8f/large.jpg)](https://postimg.org/image/g7tpk8iu3/) ##Solution: The question asks for the largest continuous number. if the array numbersa re positive, all you have to do is add them, however if there is negative numbers in the array, the array index has to rest it self ``` #Find te largest continous sum def largest_sum(arr): current_num = max_num = arr[0] for x in arr[1:] : current_num = max(current_num + x , x) max_num = max(current_num, max_num) return max_num # arr = [1,2,-1,3,4,10,10,-10,-1] arr = [1,2, -3, 4] print largest_sum(arr) ```
{ "pile_set_name": "Github" }
/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright 2018-2019 NXP */ #ifndef __DT_BINDINGS_CLOCK_IMX8MN_H #define __DT_BINDINGS_CLOCK_IMX8MN_H #define IMX8MN_CLK_DUMMY 0 #define IMX8MN_CLK_32K 1 #define IMX8MN_CLK_24M 2 #define IMX8MN_OSC_HDMI_CLK 3 #define IMX8MN_CLK_EXT1 4 #define IMX8MN_CLK_EXT2 5 #define IMX8MN_CLK_EXT3 6 #define IMX8MN_CLK_EXT4 7 #define IMX8MN_AUDIO_PLL1_REF_SEL 8 #define IMX8MN_AUDIO_PLL2_REF_SEL 9 #define IMX8MN_VIDEO_PLL1_REF_SEL 10 #define IMX8MN_DRAM_PLL_REF_SEL 11 #define IMX8MN_GPU_PLL_REF_SEL 12 #define IMX8MN_VPU_PLL_REF_SEL 13 #define IMX8MN_ARM_PLL_REF_SEL 14 #define IMX8MN_SYS_PLL1_REF_SEL 15 #define IMX8MN_SYS_PLL2_REF_SEL 16 #define IMX8MN_SYS_PLL3_REF_SEL 17 #define IMX8MN_AUDIO_PLL1 18 #define IMX8MN_AUDIO_PLL2 19 #define IMX8MN_VIDEO_PLL1 20 #define IMX8MN_DRAM_PLL 21 #define IMX8MN_GPU_PLL 22 #define IMX8MN_VPU_PLL 23 #define IMX8MN_ARM_PLL 24 #define IMX8MN_SYS_PLL1 25 #define IMX8MN_SYS_PLL2 26 #define IMX8MN_SYS_PLL3 27 #define IMX8MN_AUDIO_PLL1_BYPASS 28 #define IMX8MN_AUDIO_PLL2_BYPASS 29 #define IMX8MN_VIDEO_PLL1_BYPASS 30 #define IMX8MN_DRAM_PLL_BYPASS 31 #define IMX8MN_GPU_PLL_BYPASS 32 #define IMX8MN_VPU_PLL_BYPASS 33 #define IMX8MN_ARM_PLL_BYPASS 34 #define IMX8MN_SYS_PLL1_BYPASS 35 #define IMX8MN_SYS_PLL2_BYPASS 36 #define IMX8MN_SYS_PLL3_BYPASS 37 #define IMX8MN_AUDIO_PLL1_OUT 38 #define IMX8MN_AUDIO_PLL2_OUT 39 #define IMX8MN_VIDEO_PLL1_OUT 40 #define IMX8MN_DRAM_PLL_OUT 41 #define IMX8MN_GPU_PLL_OUT 42 #define IMX8MN_VPU_PLL_OUT 43 #define IMX8MN_ARM_PLL_OUT 44 #define IMX8MN_SYS_PLL1_OUT 45 #define IMX8MN_SYS_PLL2_OUT 46 #define IMX8MN_SYS_PLL3_OUT 47 #define IMX8MN_SYS_PLL1_40M 48 #define IMX8MN_SYS_PLL1_80M 49 #define IMX8MN_SYS_PLL1_100M 50 #define IMX8MN_SYS_PLL1_133M 51 #define IMX8MN_SYS_PLL1_160M 52 #define IMX8MN_SYS_PLL1_200M 53 #define IMX8MN_SYS_PLL1_266M 54 #define IMX8MN_SYS_PLL1_400M 55 #define IMX8MN_SYS_PLL1_800M 56 #define IMX8MN_SYS_PLL2_50M 57 #define IMX8MN_SYS_PLL2_100M 58 #define IMX8MN_SYS_PLL2_125M 59 #define IMX8MN_SYS_PLL2_166M 60 #define IMX8MN_SYS_PLL2_200M 61 #define IMX8MN_SYS_PLL2_250M 62 #define IMX8MN_SYS_PLL2_333M 63 #define IMX8MN_SYS_PLL2_500M 64 #define IMX8MN_SYS_PLL2_1000M 65 /* CORE CLOCK ROOT */ #define IMX8MN_CLK_A53_SRC 66 #define IMX8MN_CLK_GPU_CORE_SRC 67 #define IMX8MN_CLK_GPU_SHADER_SRC 68 #define IMX8MN_CLK_A53_CG 69 #define IMX8MN_CLK_GPU_CORE_CG 70 #define IMX8MN_CLK_GPU_SHADER_CG 71 #define IMX8MN_CLK_A53_DIV 72 #define IMX8MN_CLK_GPU_CORE_DIV 73 #define IMX8MN_CLK_GPU_SHADER_DIV 74 /* BUS CLOCK ROOT */ #define IMX8MN_CLK_MAIN_AXI 75 #define IMX8MN_CLK_ENET_AXI 76 #define IMX8MN_CLK_NAND_USDHC_BUS 77 #define IMX8MN_CLK_DISP_AXI 78 #define IMX8MN_CLK_DISP_APB 79 #define IMX8MN_CLK_USB_BUS 80 #define IMX8MN_CLK_GPU_AXI 81 #define IMX8MN_CLK_GPU_AHB 82 #define IMX8MN_CLK_NOC 83 #define IMX8MN_CLK_AHB 84 #define IMX8MN_CLK_AUDIO_AHB 85 /* IPG CLOCK ROOT */ #define IMX8MN_CLK_IPG_ROOT 86 #define IMX8MN_CLK_IPG_AUDIO_ROOT 87 /* IP */ #define IMX8MN_CLK_DRAM_CORE 88 #define IMX8MN_CLK_DRAM_ALT 89 #define IMX8MN_CLK_DRAM_APB 90 #define IMX8MN_CLK_DRAM_ALT_ROOT 91 #define IMX8MN_CLK_DISP_PIXEL 92 #define IMX8MN_CLK_SAI2 93 #define IMX8MN_CLK_SAI3 94 #define IMX8MN_CLK_SAI5 95 #define IMX8MN_CLK_SAI6 96 #define IMX8MN_CLK_SPDIF1 97 #define IMX8MN_CLK_ENET_REF 98 #define IMX8MN_CLK_ENET_TIMER 99 #define IMX8MN_CLK_ENET_PHY_REF 100 #define IMX8MN_CLK_NAND 101 #define IMX8MN_CLK_QSPI 102 #define IMX8MN_CLK_USDHC1 103 #define IMX8MN_CLK_USDHC2 104 #define IMX8MN_CLK_I2C1 105 #define IMX8MN_CLK_I2C2 106 #define IMX8MN_CLK_I2C3 107 #define IMX8MN_CLK_I2C4 118 #define IMX8MN_CLK_UART1 119 #define IMX8MN_CLK_UART2 110 #define IMX8MN_CLK_UART3 111 #define IMX8MN_CLK_UART4 112 #define IMX8MN_CLK_USB_CORE_REF 113 #define IMX8MN_CLK_USB_PHY_REF 114 #define IMX8MN_CLK_ECSPI1 115 #define IMX8MN_CLK_ECSPI2 116 #define IMX8MN_CLK_PWM1 117 #define IMX8MN_CLK_PWM2 118 #define IMX8MN_CLK_PWM3 119 #define IMX8MN_CLK_PWM4 120 #define IMX8MN_CLK_WDOG 121 #define IMX8MN_CLK_WRCLK 122 #define IMX8MN_CLK_CLKO1 123 #define IMX8MN_CLK_CLKO2 124 #define IMX8MN_CLK_DSI_CORE 125 #define IMX8MN_CLK_DSI_PHY_REF 126 #define IMX8MN_CLK_DSI_DBI 127 #define IMX8MN_CLK_USDHC3 128 #define IMX8MN_CLK_CAMERA_PIXEL 129 #define IMX8MN_CLK_CSI1_PHY_REF 130 #define IMX8MN_CLK_CSI2_PHY_REF 131 #define IMX8MN_CLK_CSI2_ESC 132 #define IMX8MN_CLK_ECSPI3 133 #define IMX8MN_CLK_PDM 134 #define IMX8MN_CLK_SAI7 135 #define IMX8MN_CLK_ECSPI1_ROOT 136 #define IMX8MN_CLK_ECSPI2_ROOT 137 #define IMX8MN_CLK_ECSPI3_ROOT 138 #define IMX8MN_CLK_ENET1_ROOT 139 #define IMX8MN_CLK_GPIO1_ROOT 140 #define IMX8MN_CLK_GPIO2_ROOT 141 #define IMX8MN_CLK_GPIO3_ROOT 142 #define IMX8MN_CLK_GPIO4_ROOT 143 #define IMX8MN_CLK_GPIO5_ROOT 144 #define IMX8MN_CLK_I2C1_ROOT 145 #define IMX8MN_CLK_I2C2_ROOT 146 #define IMX8MN_CLK_I2C3_ROOT 147 #define IMX8MN_CLK_I2C4_ROOT 148 #define IMX8MN_CLK_MU_ROOT 149 #define IMX8MN_CLK_OCOTP_ROOT 150 #define IMX8MN_CLK_PWM1_ROOT 151 #define IMX8MN_CLK_PWM2_ROOT 152 #define IMX8MN_CLK_PWM3_ROOT 153 #define IMX8MN_CLK_PWM4_ROOT 154 #define IMX8MN_CLK_QSPI_ROOT 155 #define IMX8MN_CLK_NAND_ROOT 156 #define IMX8MN_CLK_SAI2_ROOT 157 #define IMX8MN_CLK_SAI2_IPG 158 #define IMX8MN_CLK_SAI3_ROOT 159 #define IMX8MN_CLK_SAI3_IPG 160 #define IMX8MN_CLK_SAI5_ROOT 161 #define IMX8MN_CLK_SAI5_IPG 162 #define IMX8MN_CLK_SAI6_ROOT 163 #define IMX8MN_CLK_SAI6_IPG 164 #define IMX8MN_CLK_SAI7_ROOT 165 #define IMX8MN_CLK_SAI7_IPG 166 #define IMX8MN_CLK_SDMA1_ROOT 167 #define IMX8MN_CLK_SDMA2_ROOT 168 #define IMX8MN_CLK_UART1_ROOT 169 #define IMX8MN_CLK_UART2_ROOT 170 #define IMX8MN_CLK_UART3_ROOT 171 #define IMX8MN_CLK_UART4_ROOT 172 #define IMX8MN_CLK_USB1_CTRL_ROOT 173 #define IMX8MN_CLK_USDHC1_ROOT 174 #define IMX8MN_CLK_USDHC2_ROOT 175 #define IMX8MN_CLK_WDOG1_ROOT 176 #define IMX8MN_CLK_WDOG2_ROOT 177 #define IMX8MN_CLK_WDOG3_ROOT 178 #define IMX8MN_CLK_GPU_BUS_ROOT 179 #define IMX8MN_CLK_ASRC_ROOT 180 #define IMX8MN_CLK_GPU3D_ROOT 181 #define IMX8MN_CLK_PDM_ROOT 182 #define IMX8MN_CLK_PDM_IPG 183 #define IMX8MN_CLK_DISP_AXI_ROOT 184 #define IMX8MN_CLK_DISP_APB_ROOT 185 #define IMX8MN_CLK_DISP_PIXEL_ROOT 186 #define IMX8MN_CLK_CAMERA_PIXEL_ROOT 187 #define IMX8MN_CLK_USDHC3_ROOT 188 #define IMX8MN_CLK_SDMA3_ROOT 189 #define IMX8MN_CLK_TMU_ROOT 190 #define IMX8MN_CLK_ARM 191 #define IMX8MN_CLK_NAND_USDHC_BUS_RAWNAND_CLK 192 #define IMX8MN_CLK_GPU_CORE_ROOT 193 #define IMX8MN_CLK_END 194 #endif
{ "pile_set_name": "Github" }
// Copyright David Abrahams 2003. Use, modification and distribution is // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_ITERATOR_MINIMUM_CATEGORY_HPP_INCLUDED_ # define BOOST_ITERATOR_MINIMUM_CATEGORY_HPP_INCLUDED_ # include <boost/static_assert.hpp> # include <boost/type_traits/is_convertible.hpp> # include <boost/type_traits/is_same.hpp> # include <boost/mpl/placeholders.hpp> # include <boost/mpl/aux_/lambda_support.hpp> namespace boost { namespace iterators { namespace detail { template <bool GreaterEqual, bool LessEqual> struct minimum_category_impl; template <class T1, class T2> struct error_not_related_by_convertibility; template <> struct minimum_category_impl<true,false> { template <class T1, class T2> struct apply { typedef T2 type; }; }; template <> struct minimum_category_impl<false,true> { template <class T1, class T2> struct apply { typedef T1 type; }; }; template <> struct minimum_category_impl<true,true> { template <class T1, class T2> struct apply { BOOST_STATIC_ASSERT((is_same<T1,T2>::value)); typedef T1 type; }; }; template <> struct minimum_category_impl<false,false> { template <class T1, class T2> struct apply : error_not_related_by_convertibility<T1,T2> { }; }; } // namespace detail // // Returns the minimum category type or fails to compile // if T1 and T2 are unrelated. // template <class T1 = mpl::_1, class T2 = mpl::_2> struct minimum_category { typedef boost::iterators::detail::minimum_category_impl< ::boost::is_convertible<T1,T2>::value , ::boost::is_convertible<T2,T1>::value > outer; typedef typename outer::template apply<T1,T2> inner; typedef typename inner::type type; BOOST_MPL_AUX_LAMBDA_SUPPORT(2,minimum_category,(T1,T2)) }; template <> struct minimum_category<mpl::_1,mpl::_2> { template <class T1, class T2> struct apply : minimum_category<T1,T2> {}; BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,minimum_category,(mpl::_1,mpl::_2)) }; } // namespace iterators } // namespace boost #endif // BOOST_ITERATOR_MINIMUM_CATEGORY_HPP_INCLUDED_
{ "pile_set_name": "Github" }
--- a/conf/zabbix_server.conf +++ b/conf/zabbix_server.conf @@ -56,7 +56,7 @@ # # Mandatory: no # Default: -# PidFile=/tmp/zabbix_server.pid +PidFile=/tmp/zabbix_server.pid ### Option: DBHost # Database host name.
{ "pile_set_name": "Github" }
// Copyright 2014 Manu Martinez-Almeida. All rights reserved. // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. package render import "net/http" // Data contains ContentType and bytes data. type Data struct { ContentType string Data []byte } // Render (Data) writes data with custom ContentType. func (r Data) Render(w http.ResponseWriter) (err error) { r.WriteContentType(w) _, err = w.Write(r.Data) return } // WriteContentType (Data) writes custom ContentType. func (r Data) WriteContentType(w http.ResponseWriter) { writeContentType(w, []string{r.ContentType}) }
{ "pile_set_name": "Github" }
name = Themer description = Body classes and helpful theme utility functions package = Themeing core = 6.x ; Information added by drupal.org packaging script on 2008-06-30 version = "6.x-2.0" core = "6.x" project = "themer" datestamp = "1214791814"
{ "pile_set_name": "Github" }
# Copyright 2017 The TensorFlow Authors. 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. # ============================================================================== """Tests for slim.nasnet.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from nets.nasnet import nasnet slim = tf.contrib.slim class NASNetTest(tf.test.TestCase): def testBuildLogitsCifarModel(self): batch_size = 5 height, width = 32, 32 num_classes = 10 inputs = tf.random_uniform((batch_size, height, width, 3)) tf.train.create_global_step() with slim.arg_scope(nasnet.nasnet_cifar_arg_scope()): logits, end_points = nasnet.build_nasnet_cifar(inputs, num_classes) auxlogits = end_points['AuxLogits'] predictions = end_points['Predictions'] self.assertListEqual(auxlogits.get_shape().as_list(), [batch_size, num_classes]) self.assertListEqual(logits.get_shape().as_list(), [batch_size, num_classes]) self.assertListEqual(predictions.get_shape().as_list(), [batch_size, num_classes]) def testBuildLogitsMobileModel(self): batch_size = 5 height, width = 224, 224 num_classes = 1000 inputs = tf.random_uniform((batch_size, height, width, 3)) tf.train.create_global_step() with slim.arg_scope(nasnet.nasnet_mobile_arg_scope()): logits, end_points = nasnet.build_nasnet_mobile(inputs, num_classes) auxlogits = end_points['AuxLogits'] predictions = end_points['Predictions'] self.assertListEqual(auxlogits.get_shape().as_list(), [batch_size, num_classes]) self.assertListEqual(logits.get_shape().as_list(), [batch_size, num_classes]) self.assertListEqual(predictions.get_shape().as_list(), [batch_size, num_classes]) def testBuildLogitsLargeModel(self): batch_size = 5 height, width = 331, 331 num_classes = 1000 inputs = tf.random_uniform((batch_size, height, width, 3)) tf.train.create_global_step() with slim.arg_scope(nasnet.nasnet_large_arg_scope()): logits, end_points = nasnet.build_nasnet_large(inputs, num_classes) auxlogits = end_points['AuxLogits'] predictions = end_points['Predictions'] self.assertListEqual(auxlogits.get_shape().as_list(), [batch_size, num_classes]) self.assertListEqual(logits.get_shape().as_list(), [batch_size, num_classes]) self.assertListEqual(predictions.get_shape().as_list(), [batch_size, num_classes]) def testBuildPreLogitsCifarModel(self): batch_size = 5 height, width = 32, 32 num_classes = None inputs = tf.random_uniform((batch_size, height, width, 3)) tf.train.create_global_step() with slim.arg_scope(nasnet.nasnet_cifar_arg_scope()): net, end_points = nasnet.build_nasnet_cifar(inputs, num_classes) self.assertFalse('AuxLogits' in end_points) self.assertFalse('Predictions' in end_points) self.assertTrue(net.op.name.startswith('final_layer/Mean')) self.assertListEqual(net.get_shape().as_list(), [batch_size, 768]) def testBuildPreLogitsMobileModel(self): batch_size = 5 height, width = 224, 224 num_classes = None inputs = tf.random_uniform((batch_size, height, width, 3)) tf.train.create_global_step() with slim.arg_scope(nasnet.nasnet_mobile_arg_scope()): net, end_points = nasnet.build_nasnet_mobile(inputs, num_classes) self.assertFalse('AuxLogits' in end_points) self.assertFalse('Predictions' in end_points) self.assertTrue(net.op.name.startswith('final_layer/Mean')) self.assertListEqual(net.get_shape().as_list(), [batch_size, 1056]) def testBuildPreLogitsLargeModel(self): batch_size = 5 height, width = 331, 331 num_classes = None inputs = tf.random_uniform((batch_size, height, width, 3)) tf.train.create_global_step() with slim.arg_scope(nasnet.nasnet_large_arg_scope()): net, end_points = nasnet.build_nasnet_large(inputs, num_classes) self.assertFalse('AuxLogits' in end_points) self.assertFalse('Predictions' in end_points) self.assertTrue(net.op.name.startswith('final_layer/Mean')) self.assertListEqual(net.get_shape().as_list(), [batch_size, 4032]) def testAllEndPointsShapesCifarModel(self): batch_size = 5 height, width = 32, 32 num_classes = 10 inputs = tf.random_uniform((batch_size, height, width, 3)) tf.train.create_global_step() with slim.arg_scope(nasnet.nasnet_cifar_arg_scope()): _, end_points = nasnet.build_nasnet_cifar(inputs, num_classes) endpoints_shapes = {'Stem': [batch_size, 32, 32, 96], 'Cell_0': [batch_size, 32, 32, 192], 'Cell_1': [batch_size, 32, 32, 192], 'Cell_2': [batch_size, 32, 32, 192], 'Cell_3': [batch_size, 32, 32, 192], 'Cell_4': [batch_size, 32, 32, 192], 'Cell_5': [batch_size, 32, 32, 192], 'Cell_6': [batch_size, 16, 16, 384], 'Cell_7': [batch_size, 16, 16, 384], 'Cell_8': [batch_size, 16, 16, 384], 'Cell_9': [batch_size, 16, 16, 384], 'Cell_10': [batch_size, 16, 16, 384], 'Cell_11': [batch_size, 16, 16, 384], 'Cell_12': [batch_size, 8, 8, 768], 'Cell_13': [batch_size, 8, 8, 768], 'Cell_14': [batch_size, 8, 8, 768], 'Cell_15': [batch_size, 8, 8, 768], 'Cell_16': [batch_size, 8, 8, 768], 'Cell_17': [batch_size, 8, 8, 768], 'Reduction_Cell_0': [batch_size, 16, 16, 256], 'Reduction_Cell_1': [batch_size, 8, 8, 512], 'global_pool': [batch_size, 768], # Logits and predictions 'AuxLogits': [batch_size, num_classes], 'Logits': [batch_size, num_classes], 'Predictions': [batch_size, num_classes]} self.assertItemsEqual(endpoints_shapes.keys(), end_points.keys()) for endpoint_name in endpoints_shapes: tf.logging.info('Endpoint name: {}'.format(endpoint_name)) expected_shape = endpoints_shapes[endpoint_name] self.assertTrue(endpoint_name in end_points) self.assertListEqual(end_points[endpoint_name].get_shape().as_list(), expected_shape) def testAllEndPointsShapesMobileModel(self): batch_size = 5 height, width = 224, 224 num_classes = 1000 inputs = tf.random_uniform((batch_size, height, width, 3)) tf.train.create_global_step() with slim.arg_scope(nasnet.nasnet_mobile_arg_scope()): _, end_points = nasnet.build_nasnet_mobile(inputs, num_classes) endpoints_shapes = {'Stem': [batch_size, 28, 28, 88], 'Cell_0': [batch_size, 28, 28, 264], 'Cell_1': [batch_size, 28, 28, 264], 'Cell_2': [batch_size, 28, 28, 264], 'Cell_3': [batch_size, 28, 28, 264], 'Cell_4': [batch_size, 14, 14, 528], 'Cell_5': [batch_size, 14, 14, 528], 'Cell_6': [batch_size, 14, 14, 528], 'Cell_7': [batch_size, 14, 14, 528], 'Cell_8': [batch_size, 7, 7, 1056], 'Cell_9': [batch_size, 7, 7, 1056], 'Cell_10': [batch_size, 7, 7, 1056], 'Cell_11': [batch_size, 7, 7, 1056], 'Reduction_Cell_0': [batch_size, 14, 14, 352], 'Reduction_Cell_1': [batch_size, 7, 7, 704], 'global_pool': [batch_size, 1056], # Logits and predictions 'AuxLogits': [batch_size, num_classes], 'Logits': [batch_size, num_classes], 'Predictions': [batch_size, num_classes]} self.assertItemsEqual(endpoints_shapes.keys(), end_points.keys()) for endpoint_name in endpoints_shapes: tf.logging.info('Endpoint name: {}'.format(endpoint_name)) expected_shape = endpoints_shapes[endpoint_name] self.assertTrue(endpoint_name in end_points) self.assertListEqual(end_points[endpoint_name].get_shape().as_list(), expected_shape) def testAllEndPointsShapesLargeModel(self): batch_size = 5 height, width = 331, 331 num_classes = 1000 inputs = tf.random_uniform((batch_size, height, width, 3)) tf.train.create_global_step() with slim.arg_scope(nasnet.nasnet_large_arg_scope()): _, end_points = nasnet.build_nasnet_large(inputs, num_classes) endpoints_shapes = {'Stem': [batch_size, 42, 42, 336], 'Cell_0': [batch_size, 42, 42, 1008], 'Cell_1': [batch_size, 42, 42, 1008], 'Cell_2': [batch_size, 42, 42, 1008], 'Cell_3': [batch_size, 42, 42, 1008], 'Cell_4': [batch_size, 42, 42, 1008], 'Cell_5': [batch_size, 42, 42, 1008], 'Cell_6': [batch_size, 21, 21, 2016], 'Cell_7': [batch_size, 21, 21, 2016], 'Cell_8': [batch_size, 21, 21, 2016], 'Cell_9': [batch_size, 21, 21, 2016], 'Cell_10': [batch_size, 21, 21, 2016], 'Cell_11': [batch_size, 21, 21, 2016], 'Cell_12': [batch_size, 11, 11, 4032], 'Cell_13': [batch_size, 11, 11, 4032], 'Cell_14': [batch_size, 11, 11, 4032], 'Cell_15': [batch_size, 11, 11, 4032], 'Cell_16': [batch_size, 11, 11, 4032], 'Cell_17': [batch_size, 11, 11, 4032], 'Reduction_Cell_0': [batch_size, 21, 21, 1344], 'Reduction_Cell_1': [batch_size, 11, 11, 2688], 'global_pool': [batch_size, 4032], # Logits and predictions 'AuxLogits': [batch_size, num_classes], 'Logits': [batch_size, num_classes], 'Predictions': [batch_size, num_classes]} self.assertItemsEqual(endpoints_shapes.keys(), end_points.keys()) for endpoint_name in endpoints_shapes: tf.logging.info('Endpoint name: {}'.format(endpoint_name)) expected_shape = endpoints_shapes[endpoint_name] self.assertTrue(endpoint_name in end_points) self.assertListEqual(end_points[endpoint_name].get_shape().as_list(), expected_shape) def testVariablesSetDeviceMobileModel(self): batch_size = 5 height, width = 224, 224 num_classes = 1000 inputs = tf.random_uniform((batch_size, height, width, 3)) tf.train.create_global_step() # Force all Variables to reside on the device. with tf.variable_scope('on_cpu'), tf.device('/cpu:0'): with slim.arg_scope(nasnet.nasnet_mobile_arg_scope()): nasnet.build_nasnet_mobile(inputs, num_classes) with tf.variable_scope('on_gpu'), tf.device('/gpu:0'): with slim.arg_scope(nasnet.nasnet_mobile_arg_scope()): nasnet.build_nasnet_mobile(inputs, num_classes) for v in tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope='on_cpu'): self.assertDeviceEqual(v.device, '/cpu:0') for v in tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope='on_gpu'): self.assertDeviceEqual(v.device, '/gpu:0') def testUnknownBatchSizeMobileModel(self): batch_size = 1 height, width = 224, 224 num_classes = 1000 with self.test_session() as sess: inputs = tf.placeholder(tf.float32, (None, height, width, 3)) with slim.arg_scope(nasnet.nasnet_mobile_arg_scope()): logits, _ = nasnet.build_nasnet_mobile(inputs, num_classes) self.assertListEqual(logits.get_shape().as_list(), [None, num_classes]) images = tf.random_uniform((batch_size, height, width, 3)) sess.run(tf.global_variables_initializer()) output = sess.run(logits, {inputs: images.eval()}) self.assertEquals(output.shape, (batch_size, num_classes)) def testEvaluationMobileModel(self): batch_size = 2 height, width = 224, 224 num_classes = 1000 with self.test_session() as sess: eval_inputs = tf.random_uniform((batch_size, height, width, 3)) with slim.arg_scope(nasnet.nasnet_mobile_arg_scope()): logits, _ = nasnet.build_nasnet_mobile(eval_inputs, num_classes, is_training=False) predictions = tf.argmax(logits, 1) sess.run(tf.global_variables_initializer()) output = sess.run(predictions) self.assertEquals(output.shape, (batch_size,)) if __name__ == '__main__': tf.test.main()
{ "pile_set_name": "Github" }
namespace Eigen { /** \eigenManualPage TutorialGeometry Space transformations In this page, we will introduce the many possibilities offered by the \ref Geometry_Module "geometry module" to deal with 2D and 3D rotations and projective or affine transformations. \eigenAutoToc Eigen's Geometry module provides two different kinds of geometric transformations: - Abstract transformations, such as rotations (represented by \ref AngleAxis "angle and axis" or by a \ref Quaternion "quaternion"), \ref Translation "translations", \ref Scaling "scalings". These transformations are NOT represented as matrices, but you can nevertheless mix them with matrices and vectors in expressions, and convert them to matrices if you wish. - Projective or affine transformation matrices: see the Transform class. These are really matrices. \note If you are working with OpenGL 4x4 matrices then Affine3f and Affine3d are what you want. Since Eigen defaults to column-major storage, you can directly use the Transform::data() method to pass your transformation matrix to OpenGL. You can construct a Transform from an abstract transformation, like this: \code Transform t(AngleAxis(angle,axis)); \endcode or like this: \code Transform t; t = AngleAxis(angle,axis); \endcode But note that unfortunately, because of how C++ works, you can \b not do this: \code Transform t = AngleAxis(angle,axis); \endcode <span class="note">\b Explanation: In the C++ language, this would require Transform to have a non-explicit conversion constructor from AngleAxis, but we really don't want to allow implicit casting here. </span> \section TutorialGeoElementaryTransformations Transformation types <table class="manual"> <tr><th>Transformation type</th><th>Typical initialization code</th></tr> <tr><td> \ref Rotation2D "2D rotation" from an angle</td><td>\code Rotation2D<float> rot2(angle_in_radian);\endcode</td></tr> <tr class="alt"><td> 3D rotation as an \ref AngleAxis "angle + axis"</td><td>\code AngleAxis<float> aa(angle_in_radian, Vector3f(ax,ay,az));\endcode <span class="note">The axis vector must be normalized.</span></td></tr> <tr><td> 3D rotation as a \ref Quaternion "quaternion"</td><td>\code Quaternion<float> q; q = AngleAxis<float>(angle_in_radian, axis);\endcode</td></tr> <tr class="alt"><td> N-D Scaling</td><td>\code Scaling(sx, sy) Scaling(sx, sy, sz) Scaling(s) Scaling(vecN)\endcode</td></tr> <tr><td> N-D Translation</td><td>\code Translation<float,2>(tx, ty) Translation<float,3>(tx, ty, tz) Translation<float,N>(s) Translation<float,N>(vecN)\endcode</td></tr> <tr class="alt"><td> N-D \ref TutorialGeoTransform "Affine transformation"</td><td>\code Transform<float,N,Affine> t = concatenation_of_any_transformations; Transform<float,3,Affine> t = Translation3f(p) * AngleAxisf(a,axis) * Scaling(s);\endcode</td></tr> <tr><td> N-D Linear transformations \n <em class=note>(pure rotations, \n scaling, etc.)</em></td><td>\code Matrix<float,N> t = concatenation_of_rotations_and_scalings; Matrix<float,2> t = Rotation2Df(a) * Scaling(s); Matrix<float,3> t = AngleAxisf(a,axis) * Scaling(s);\endcode</td></tr> </table> <strong>Notes on rotations</strong>\n To transform more than a single vector the preferred representations are rotation matrices, while for other usages Quaternion is the representation of choice as they are compact, fast and stable. Finally Rotation2D and AngleAxis are mainly convenient types to create other rotation objects. <strong>Notes on Translation and Scaling</strong>\n Like AngleAxis, these classes were designed to simplify the creation/initialization of linear (Matrix) and affine (Transform) transformations. Nevertheless, unlike AngleAxis which is inefficient to use, these classes might still be interesting to write generic and efficient algorithms taking as input any kind of transformations. Any of the above transformation types can be converted to any other types of the same nature, or to a more generic type. Here are some additional examples: <table class="manual"> <tr><td>\code Rotation2Df r; r = Matrix2f(..); // assumes a pure rotation matrix AngleAxisf aa; aa = Quaternionf(..); AngleAxisf aa; aa = Matrix3f(..); // assumes a pure rotation matrix Matrix2f m; m = Rotation2Df(..); Matrix3f m; m = Quaternionf(..); Matrix3f m; m = Scaling(..); Affine3f m; m = AngleAxis3f(..); Affine3f m; m = Scaling(..); Affine3f m; m = Translation3f(..); Affine3f m; m = Matrix3f(..); \endcode</td></tr> </table> <a href="#" class="top">top</a>\section TutorialGeoCommontransformationAPI Common API across transformation types To some extent, Eigen's \ref Geometry_Module "geometry module" allows you to write generic algorithms working on any kind of transformation representations: <table class="manual"> <tr><td> Concatenation of two transformations</td><td>\code gen1 * gen2;\endcode</td></tr> <tr class="alt"><td>Apply the transformation to a vector</td><td>\code vec2 = gen1 * vec1;\endcode</td></tr> <tr><td>Get the inverse of the transformation</td><td>\code gen2 = gen1.inverse();\endcode</td></tr> <tr class="alt"><td>Spherical interpolation \n (Rotation2D and Quaternion only)</td><td>\code rot3 = rot1.slerp(alpha,rot2);\endcode</td></tr> </table> <a href="#" class="top">top</a>\section TutorialGeoTransform Affine transformations Generic affine transformations are represented by the Transform class which internaly is a (Dim+1)^2 matrix. In Eigen we have chosen to not distinghish between points and vectors such that all points are actually represented by displacement vectors from the origin ( \f$ \mathbf{p} \equiv \mathbf{p}-0 \f$ ). With that in mind, real points and vector distinguish when the transformation is applied. <table class="manual"> <tr><td> Apply the transformation to a \b point </td><td>\code VectorNf p1, p2; p2 = t * p1;\endcode</td></tr> <tr class="alt"><td> Apply the transformation to a \b vector </td><td>\code VectorNf vec1, vec2; vec2 = t.linear() * vec1;\endcode</td></tr> <tr><td> Apply a \em general transformation \n to a \b normal \b vector \n </td><td>\code VectorNf n1, n2; MatrixNf normalMatrix = t.linear().inverse().transpose(); n2 = (normalMatrix * n1).normalized();\endcode</td></tr> <tr><td colspan="2">(See subject 5.27 of this <a href="http://www.faqs.org/faqs/graphics/algorithms-faq">faq</a> for the explanations)</td></tr> <tr class="alt"><td> Apply a transformation with \em pure \em rotation \n to a \b normal \b vector (no scaling, no shear)</td><td>\code n2 = t.linear() * n1;\endcode</td></tr> <tr><td> OpenGL compatibility \b 3D </td><td>\code glLoadMatrixf(t.data());\endcode</td></tr> <tr class="alt"><td> OpenGL compatibility \b 2D </td><td>\code Affine3f aux(Affine3f::Identity()); aux.linear().topLeftCorner<2,2>() = t.linear(); aux.translation().start<2>() = t.translation(); glLoadMatrixf(aux.data());\endcode</td></tr> </table> \b Component \b accessors <table class="manual"> <tr><td> full read-write access to the internal matrix</td><td>\code t.matrix() = matN1xN1; // N1 means N+1 matN1xN1 = t.matrix(); \endcode</td></tr> <tr class="alt"><td> coefficient accessors</td><td>\code t(i,j) = scalar; <=> t.matrix()(i,j) = scalar; scalar = t(i,j); <=> scalar = t.matrix()(i,j); \endcode</td></tr> <tr><td> translation part</td><td>\code t.translation() = vecN; vecN = t.translation(); \endcode</td></tr> <tr class="alt"><td> linear part</td><td>\code t.linear() = matNxN; matNxN = t.linear(); \endcode</td></tr> <tr><td> extract the rotation matrix</td><td>\code matNxN = t.rotation(); \endcode</td></tr> </table> \b Transformation \b creation \n While transformation objects can be created and updated concatenating elementary transformations, the Transform class also features a procedural API: <table class="manual"> <tr><th></th><th>procedural API</th><th>equivalent natural API </th></tr> <tr><td>Translation</td><td>\code t.translate(Vector_(tx,ty,..)); t.pretranslate(Vector_(tx,ty,..)); \endcode</td><td>\code t *= Translation_(tx,ty,..); t = Translation_(tx,ty,..) * t; \endcode</td></tr> <tr class="alt"><td>\b Rotation \n <em class="note">In 2D and for the procedural API, any_rotation can also \n be an angle in radian</em></td><td>\code t.rotate(any_rotation); t.prerotate(any_rotation); \endcode</td><td>\code t *= any_rotation; t = any_rotation * t; \endcode</td></tr> <tr><td>Scaling</td><td>\code t.scale(Vector_(sx,sy,..)); t.scale(s); t.prescale(Vector_(sx,sy,..)); t.prescale(s); \endcode</td><td>\code t *= Scaling(sx,sy,..); t *= Scaling(s); t = Scaling(sx,sy,..) * t; t = Scaling(s) * t; \endcode</td></tr> <tr class="alt"><td>Shear transformation \n ( \b 2D \b only ! )</td><td>\code t.shear(sx,sy); t.preshear(sx,sy); \endcode</td><td></td></tr> </table> Note that in both API, any many transformations can be concatenated in a single expression as shown in the two following equivalent examples: <table class="manual"> <tr><td>\code t.pretranslate(..).rotate(..).translate(..).scale(..); \endcode</td></tr> <tr><td>\code t = Translation_(..) * t * RotationType(..) * Translation_(..) * Scaling(..); \endcode</td></tr> </table> <a href="#" class="top">top</a>\section TutorialGeoEulerAngles Euler angles <table class="manual"> <tr><td style="max-width:30em;"> Euler angles might be convenient to create rotation objects. On the other hand, since there exist 24 different conventions, they are pretty confusing to use. This example shows how to create a rotation matrix according to the 2-1-2 convention.</td><td>\code Matrix3f m; m = AngleAxisf(angle1, Vector3f::UnitZ()) * AngleAxisf(angle2, Vector3f::UnitY()) * AngleAxisf(angle3, Vector3f::UnitZ()); \endcode</td></tr> </table> */ }
{ "pile_set_name": "Github" }
pgzip ===== Go parallel gzip compression/decompression. This is a fully gzip compatible drop in replacement for "compress/gzip". This will split compression into blocks that are compressed in parallel. This can be useful for compressing big amounts of data. The output is a standard gzip file. The gzip decompression is modified so it decompresses ahead of the current reader. This means that reads will be non-blocking if the decompressor can keep ahead of your code reading from it. CRC calculation also takes place in a separate goroutine. You should only use this if you are (de)compressing big amounts of data, say **more than 1MB** at the time, otherwise you will not see any benefit, and it will likely be faster to use the internal gzip library or [this package](https://github.com/klauspost/compress). It is important to note that this library creates and reads *standard gzip files*. You do not have to match the compressor/decompressor to get the described speedups, and the gzip files are fully compatible with other gzip readers/writers. A golang variant of this is [bgzf](https://godoc.org/github.com/biogo/hts/bgzf), which has the same feature, as well as seeking in the resulting file. The only drawback is a slightly bigger overhead compared to this and pure gzip. See a comparison below. [![GoDoc][1]][2] [![Build Status][3]][4] [1]: https://godoc.org/github.com/klauspost/pgzip?status.svg [2]: https://godoc.org/github.com/klauspost/pgzip [3]: https://travis-ci.org/klauspost/pgzip.svg [4]: https://travis-ci.org/klauspost/pgzip Installation ==== ```go get github.com/klauspost/pgzip/...``` You might need to get/update the dependencies: ``` go get -u github.com/klauspost/compress ``` Usage ==== [Godoc Doumentation](https://godoc.org/github.com/klauspost/pgzip) To use as a replacement for gzip, exchange ```import "compress/gzip"``` with ```import gzip "github.com/klauspost/pgzip"```. # Changes * Oct 6, 2016: Fixed an issue if the destination writer returned an error. * Oct 6, 2016: Better buffer reuse, should now generate less garbage. * Oct 6, 2016: Output does not change based on write sizes. * Dec 8, 2015: Decoder now supports the io.WriterTo interface, giving a speedup and less GC pressure. * Oct 9, 2015: Reduced allocations by ~35 by using sync.Pool. ~15% overall speedup. Changes in [github.com/klauspost/compress](https://github.com/klauspost/compress#changelog) are also carried over, so see that for more changes. ## Compression The simplest way to use this is to simply do the same as you would when using [compress/gzip](http://golang.org/pkg/compress/gzip). To change the block size, use the added (*pgzip.Writer).SetConcurrency(blockSize, blocks int) function. With this you can control the approximate size of your blocks, as well as how many you want to be processing in parallel. Default values for this is SetConcurrency(1MB, runtime.GOMAXPROCS(0)), meaning blocks are split at 1 MB and up to the number of CPU threads blocks can be processing at once before the writer blocks. Example: ``` var b bytes.Buffer w := gzip.NewWriter(&b) w.SetConcurrency(100000, 10) w.Write([]byte("hello, world\n")) w.Close() ``` To get any performance gains, you should at least be compressing more than 1 megabyte of data at the time. You should at least have a block size of 100k and at least a number of blocks that match the number of cores your would like to utilize, but about twice the number of blocks would be the best. Another side effect of this is, that it is likely to speed up your other code, since writes to the compressor only blocks if the compressor is already compressing the number of blocks you have specified. This also means you don't have worry about buffering input to the compressor. ## Decompression Decompression works similar to compression. That means that you simply call pgzip the same way as you would call [compress/gzip](http://golang.org/pkg/compress/gzip). The only difference is that if you want to specify your own readahead, you have to use `pgzip.NewReaderN(r io.Reader, blockSize, blocks int)` to get a reader with your custom blocksizes. The `blockSize` is the size of each block decoded, and `blocks` is the maximum number of blocks that is decoded ahead. See [Example on playground](http://play.golang.org/p/uHv1B5NbDh) Performance ==== ## Compression See my blog post in [Benchmarks of Golang Gzip](https://blog.klauspost.com/go-gzipdeflate-benchmarks/). Compression cost is usually about 0.2% with default settings with a block size of 250k. Example with GOMAXPROC set to 32 (16 core CPU) Content is [Matt Mahoneys 10GB corpus](http://mattmahoney.net/dc/10gb.html). Compression level 6. Compressor | MB/sec | speedup | size | size overhead (lower=better) ------------|----------|---------|------|--------- [gzip](http://golang.org/pkg/compress/gzip) (golang) | 15.44MB/s (1 thread) | 1.0x | 4781329307 | 0% [gzip](http://github.com/klauspost/compress/gzip) (klauspost) | 135.04MB/s (1 thread) | 8.74x | 4894858258 | +2.37% [pgzip](https://github.com/klauspost/pgzip) (klauspost) | 1573.23MB/s| 101.9x | 4902285651 | +2.53% [bgzf](https://godoc.org/github.com/biogo/hts/bgzf) (biogo) | 361.40MB/s | 23.4x | 4869686090 | +1.85% [pargzip](https://godoc.org/github.com/golang/build/pargzip) (builder) | 306.01MB/s | 19.8x | 4786890417 | +0.12% pgzip also contains a [linear time compression](https://github.com/klauspost/compress#linear-time-compression-huffman-only) mode, that will allow compression at ~250MB per core per second, independent of the content. See the [complete sheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing) for different content types and compression settings. ## Decompression The decompression speedup is there because it allows you to do other work while the decompression is taking place. In the example above, the numbers are as follows on a 4 CPU machine: Decompressor | Time | Speedup -------------|------|-------- [gzip](http://golang.org/pkg/compress/gzip) (golang) | 1m28.85s | 0% [pgzip](https://github.com/klauspost/pgzip) (golang) | 43.48s | 104% But wait, since gzip decompression is inherently singlethreaded (aside from CRC calculation) how can it be more than 100% faster? Because pgzip due to its design also acts as a buffer. When using unbuffered gzip, you are also waiting for io when you are decompressing. If the gzip decoder can keep up, it will always have data ready for your reader, and you will not be waiting for input to the gzip decompressor to complete. This is pretty much an optimal situation for pgzip, but it reflects most common usecases for CPU intensive gzip usage. I haven't included [bgzf](https://godoc.org/github.com/biogo/hts/bgzf) in this comparison, since it only can decompress files created by a compatible encoder, and therefore cannot be considered a generic gzip decompressor. But if you are able to compress your files with a bgzf compatible program, you can expect it to scale beyond 100%. # License This contains large portions of code from the go repository - see GO_LICENSE for more information. The changes are released under MIT License. See LICENSE for more information.
{ "pile_set_name": "Github" }
## DESCRIPTION ## Linear Inequalities and Feasible Regions ## ENDDESCRIPTION ## Tagged by nhamblet ## DBsubject(Operations research) ## DBchapter(Linear programming) ## DBsection(Constrained optimization - planar) ## Institution(Rochester) ## Level(2) ## KEYWORDS('Linear', 'Inequality', 'Feasible Region', 'Vertex') DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGstandard.pl", "PGchoicemacros.pl", "PGcourse.pl" ); TEXT(beginproblem()); $showPartialCorrectAnswers = 0; $A = random(2,9,1); $B = random(2,4,1); $C = random($A+1, 2*$A-1,1); $D = random(2,4,1); $E = random($A+1, 2*$A-1,1); while (($B*$E-$C)/($B*$D-1) >= $A - ($E - $D*($B*$E-$C)/($B*$D-1))) { $C = random($A+1,2*$A-1,1);} $region = random(1,4,1); $Px = ($C-$A)/($B-1); $Py = $A-$Px; $Qy = ($B*$E-$C)/($D*$B-1); $Qx = ($C-$Qy)/$B; $Ry = ($E-$A)/($D-1); $Rx = $A - $Ry; if ($region == 1) { $constraint1 = "x + y \leq $A"; $constraint2 = "$B x + y \geq $C"; $constraint3 = "x + $D y \geq $E"; $shape = "Triangle"; $vertices = 3; @xcoord = ($Px, $Rx, $Qx); @ycoord = ($Py, $Ry, $Qy); } if ($region == 2) { $constraint1 = "x + y \leq $A"; $constraint2 = "$B x + y \leq $C"; $constraint3 = "x + $D y \geq $E"; $shape = "Quadrilateral"; $vertices = 4; @xcoord = (0 , 0, $Px, $Qx); @ycoord = ($E/$D, $A, $Py, $Qy); } if ($region == 3) { $constraint1 = "x + y \leq $A"; $constraint2 = "$B x + y \geq $C"; $constraint3 = "x + $D y \leq $E"; $shape = "Quadrilateral"; $vertices = 4; @xcoord = ($Qx, $Rx, $A, $C/$B); @ycoord = ($Qy, $Ry, 0, 0); } if ($region == 4) { $constraint1 = "x + y \geq $A"; $constraint2 = "$B x + y \geq $C"; $constraint3 = "x + $D y \geq $E"; $shape = "Unbounded"; $vertices = 4; @xcoord = (0, $E, $Rx, $Px); @ycoord = ($C, 0, $Ry, $Py); } BEGIN_TEXT; Given the system of inequalities below, determine the shape of the feasible region and find the vertices of the feasible region. Give the shape as "triangle", "quadrilateral", or "unbounded". Report your vertices starting with the one which has the smallest \(x\)-value. If more than one vertex has the same, smallest \(x\)-value, start with the one that has the smallest \(y\)-value. Proceed clockwise from the first vertex. Leave any unnecessary answer spaces blank. $BR $BR \[ \begin{array}{l} $constraint1 \cr $constraint2 \cr $constraint3 \cr x \geq 0 \cr y \geq 0 \cr \end{array}\] $BR The shape of the feasible region is \{ans_rule(10)\}. $BR $BR The first vertex is (\{ans_rule(5)\},\{ans_rule(5)\}). $BR The second vertex is (\{ans_rule(5)\},\{ans_rule(5)\}). $BR The third vertex is (\{ans_rule(5)\},\{ans_rule(5)\}). $BR The fourth vertex is (\{ans_rule(5)\},\{ans_rule(5)\}). END_TEXT; ANS(str_cmp($shape)); $i = 0; while ($i < $vertices) { ANS(num_cmp($xcoord[$i])); ANS(num_cmp($ycoord[$i])); $i = $i + 1; } while ($i < 4) { ANS(str_cmp("")); ANS(str_cmp("")); $i = $i + 1; } #ANS(num_cmp($xcoord[0])); #ANS(num_cmp($ycoord[0])); #ANS(num_cmp($xcoord[1])); #ANS(num_cmp($ycoord[1])); #ANS(num_cmp($xcoord[2])); #ANS(num_cmp($ycoord[2])); #ANS(num_cmp($xcoord[3])); #ANS(num_cmp($ycoord[3])); ENDDOCUMENT(); # This should be the last executable line in the problem.
{ "pile_set_name": "Github" }
prefix ex: <http://www.example.org/> select * where { ?s ?p ex:o filter exists { ?s ?p ex:o1 filter exists { ?s ?p ex:o2 } } }
{ "pile_set_name": "Github" }
"use strict"; module.exports = static_module_target; // - The default wrapper supports AMD, CommonJS and the global scope (as window.root), in this order. // - You can specify a custom wrapper with the --wrap argument. // - CommonJS modules depend on the minimal build for reduced package size with browserify. // - AMD and global scope depend on the full library for now. var util = require("../util"); var protobuf = require("../.."); static_module_target.description = "Static code without reflection as a module"; function static_module_target(root, options, callback) { require("./static")(root, options, function(err, output) { if (err) { callback(err); return; } try { output = util.wrap(output, protobuf.util.merge({ dependency: "protobufjs/minimal" }, options)); } catch (e) { callback(e); return; } callback(null, output); }); }
{ "pile_set_name": "Github" }
plugins: spark: spark-config-default: - spark.hadoop.mapreduce.fileoutputcommitter.algorithm.version: "2" - spark.kubernetes.allocation.batch.size: "50" - spark.hadoop.fs.s3a.acl.default: "BucketOwnerFullControl" - spark.hadoop.fs.s3n.impl: "org.apache.hadoop.fs.s3a.S3AFileSystem" - spark.hadoop.fs.AbstractFileSystem.s3n.impl: "org.apache.hadoop.fs.s3a.S3A" - spark.hadoop.fs.s3.impl: "org.apache.hadoop.fs.s3a.S3AFileSystem" - spark.hadoop.fs.AbstractFileSystem.s3.impl: "org.apache.hadoop.fs.s3a.S3A" - spark.hadoop.fs.s3a.impl: "org.apache.hadoop.fs.s3a.S3AFileSystem" - spark.hadoop.fs.AbstractFileSystem.s3a.impl: "org.apache.hadoop.fs.s3a.S3A" - spark.hadoop.fs.s3a.multipart.threshold: "536870912" - spark.blacklist.enabled: "true" - spark.blacklist.timeout: "5m" - spark.task.maxfailures: "8"
{ "pile_set_name": "Github" }
/* * Copyright (c) 2005 Arch Rock Corporation * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Arch Rock Corporation nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARCHED * ROCK OR ITS 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. */ /** * * * @author Kaisen Lin * @author Phil Buonadonna */ generic configuration HalPXA27xSpiDMAC(uint8_t valSCR, uint8_t valDSS, bool enableRWOT) { provides interface Init; provides interface SpiByte; provides interface SpiPacket[uint8_t instance]; provides interface HalPXA27xSSPCntl; uses { interface HplPXA27xSSP as SSP; interface HplPXA27xDMAChnl as RxDMA; interface HplPXA27xDMAChnl as TxDMA; interface HplPXA27xDMAInfo as SSPRxDMAInfo; interface HplPXA27xDMAInfo as SSPTxDMAInfo; } } implementation { components new HalPXA27xSpiDMAM(2, valSCR, valDSS, enableRWOT); components HalPXA27xSSPControlP; Init = HalPXA27xSpiDMAM; SpiByte = HalPXA27xSpiDMAM; SpiPacket = HalPXA27xSpiDMAM; HalPXA27xSSPCntl = HalPXA27xSSPControlP; SSP = HalPXA27xSpiDMAM; SSP = HalPXA27xSSPControlP; RxDMA = HalPXA27xSpiDMAM; TxDMA = HalPXA27xSpiDMAM; SSPRxDMAInfo = HalPXA27xSpiDMAM; SSPTxDMAInfo = HalPXA27xSpiDMAM; }
{ "pile_set_name": "Github" }