text
stringlengths
2
99.9k
meta
dict
var baseSlice = require('./_baseSlice'), isIterateeCall = require('./_isIterateeCall'), toInteger = require('./toInteger'); /** * Creates a slice of `array` from `start` up to, but not including, `end`. * * **Note:** This method is used instead of * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are * returned. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function slice(array, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { start = 0; end = length; } else { start = start == null ? 0 : toInteger(start); end = end === undefined ? length : toInteger(end); } return baseSlice(array, start, end); } module.exports = slice;
{ "pile_set_name": "Github" }
#import "GPUImageFilter.h" @interface GPUImageHighlightShadowFilter : GPUImageFilter { GLint shadowsUniform, highlightsUniform; } /** * 0 - 1, increase to lighten shadows. * @default 0 */ @property(readwrite, nonatomic) CGFloat shadows; /** * 0 - 1, decrease to darken highlights. * @default 1 */ @property(readwrite, nonatomic) CGFloat highlights; @end
{ "pile_set_name": "Github" }
{ "name": "HomeApp", "version": "0.0.1", "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "home-config": "file:../home-config", "home-records": "file:../home-records", "immutable": "^3.8.1", "pure-render-decorator": "^1.2.1", "react": "15.4.1", "react-native": "0.39.2", "react-native-material-kit": "git://github.com/youennPennarun/react-native-material-kit.git#cc9ac25", "react-native-selectme": "^1.2.3", "tinycolor2": "^1.4.1" }, "devDependencies": { "babel-jest": "18.0.0", "babel-preset-react-native": "1.9.1", "jest": "18.0.0", "react-test-renderer": "15.4.1" }, "jest": { "preset": "react-native" }, "author": "Viktor Kirilov (deepsybg@gmail.com)", "license": "MIT" }
{ "pile_set_name": "Github" }
[Desktop Entry] Name=GraphQL Playground Comment=GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration) Exec=AppRun Terminal=false Type=Application Icon=graphql-playground-electron X-AppImage-Version=1.3.24.1760 X-AppImage-BuildId=1f2548d0-f8ac-11a7-36a8-65fd833819f1 Categories=Development; [AppImageHub] # Dear upstream developer, please include update information in your AppImage # (e.g., with appimagetool -u) so that users can easily update the AppImage X-AppImage-Signature=no valid OpenPGP data found. the signature could not be verified. Please remember that the signature file (.sig or .asc) should be the first file given on the command line. X-AppImage-Type=2 X-AppImage-Architecture=x86_64
{ "pile_set_name": "Github" }
<?php /** * @group Cache */ class MapCacheLRUTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; /** * @covers MapCacheLRU::newFromArray() * @covers MapCacheLRU::toArray() * @covers MapCacheLRU::getAllKeys() * @covers MapCacheLRU::clear() * @covers MapCacheLRU::getMaxSize() * @covers MapCacheLRU::setMaxSize() */ public function testArrayConversion() { $raw = [ 'd' => 4, 'c' => 3, 'b' => 2, 'a' => 1 ]; $cache = MapCacheLRU::newFromArray( $raw, 3 ); $this->assertEquals( 3, $cache->getMaxSize() ); $this->assertSame( true, $cache->has( 'a' ) ); $this->assertSame( true, $cache->has( 'b' ) ); $this->assertSame( true, $cache->has( 'c' ) ); $this->assertSame( 1, $cache->get( 'a' ) ); $this->assertSame( 2, $cache->get( 'b' ) ); $this->assertSame( 3, $cache->get( 'c' ) ); $this->assertSame( [ 'a' => 1, 'b' => 2, 'c' => 3 ], $cache->toArray() ); $this->assertSame( [ 'a', 'b', 'c' ], $cache->getAllKeys() ); $cache->clear( 'a' ); $this->assertSame( [ 'b' => 2, 'c' => 3 ], $cache->toArray() ); $cache->clear(); $this->assertSame( [], $cache->toArray() ); $cache = MapCacheLRU::newFromArray( [ 'd' => 4, 'c' => 3, 'b' => 2, 'a' => 1 ], 4 ); $cache->setMaxSize( 3 ); $this->assertSame( [ 'c' => 3, 'b' => 2, 'a' => 1 ], $cache->toArray() ); } /** * @covers MapCacheLRU::serialize() * @covers MapCacheLRU::unserialize() */ public function testSerialize() { $cache = new MapCacheLRU( 3 ); $cache->set( 'a', 1 ); $cache->set( 'b', 2 ); $cache->set( 'c', 3 ); $string = serialize( $cache ); $cache = unserialize( $string ); $this->assertSame( [ 'a' => 1, 'b' => 2, 'c' => 3 ], $cache->toArray(), 'entries are preserved' ); $cache->set( 'd', 4 ); $this->assertSame( [ 'b' => 2, 'c' => 3, 'd' => 4 ], $cache->toArray(), 'maxKeys is preserved' ); } /** * @covers MapCacheLRU::has() * @covers MapCacheLRU::get() * @covers MapCacheLRU::set() */ public function testMissing() { $raw = [ 'a' => 1, 'b' => 2, 'c' => 3 ]; $cache = MapCacheLRU::newFromArray( $raw, 3 ); $this->assertFalse( $cache->has( 'd' ) ); $this->assertNull( $cache->get( 'd' ) ); $this->assertNull( $cache->get( 'd', 0.0, null ) ); $this->assertFalse( $cache->get( 'd', 0.0, false ) ); } /** * @covers MapCacheLRU::has() * @covers MapCacheLRU::get() * @covers MapCacheLRU::set() */ public function testLRU() { $raw = [ 'a' => 1, 'b' => 2, 'c' => 3 ]; $cache = MapCacheLRU::newFromArray( $raw, 3 ); $this->assertSame( true, $cache->has( 'c' ) ); $this->assertSame( [ 'a' => 1, 'b' => 2, 'c' => 3 ], $cache->toArray() ); $this->assertSame( 3, $cache->get( 'c' ) ); $this->assertSame( [ 'a' => 1, 'b' => 2, 'c' => 3 ], $cache->toArray() ); $this->assertSame( 1, $cache->get( 'a' ) ); $this->assertSame( [ 'b' => 2, 'c' => 3, 'a' => 1 ], $cache->toArray() ); $cache->set( 'a', 1 ); $this->assertSame( [ 'b' => 2, 'c' => 3, 'a' => 1 ], $cache->toArray() ); $cache->set( 'b', 22 ); $this->assertSame( [ 'c' => 3, 'a' => 1, 'b' => 22 ], $cache->toArray() ); $cache->set( 'd', 4 ); $this->assertSame( [ 'a' => 1, 'b' => 22, 'd' => 4 ], $cache->toArray() ); $cache->set( 'e', 5, 0.33 ); $this->assertSame( [ 'e' => 5, 'b' => 22, 'd' => 4 ], $cache->toArray() ); $cache->set( 'f', 6, 0.66 ); $this->assertSame( [ 'b' => 22, 'f' => 6, 'd' => 4 ], $cache->toArray() ); $cache->set( 'g', 7, 0.90 ); $this->assertSame( [ 'f' => 6, 'g' => 7, 'd' => 4 ], $cache->toArray() ); $cache->set( 'g', 7, 1.0 ); $this->assertSame( [ 'f' => 6, 'd' => 4, 'g' => 7 ], $cache->toArray() ); } /** * @covers MapCacheLRU::has() * @covers MapCacheLRU::get() * @covers MapCacheLRU::set() */ public function testExpiry() { $raw = [ 'a' => 1, 'b' => 2, 'c' => 3 ]; $cache = MapCacheLRU::newFromArray( $raw, 3 ); $now = microtime( true ); $cache->setMockTime( $now ); $cache->set( 'd', 'xxx' ); $this->assertTrue( $cache->has( 'd', 30 ) ); $this->assertEquals( 'xxx', $cache->get( 'd' ) ); $now += 29; $this->assertTrue( $cache->has( 'd', 30 ) ); $this->assertEquals( 'xxx', $cache->get( 'd' ) ); $this->assertEquals( 'xxx', $cache->get( 'd', 30 ) ); $now += 1.5; $this->assertFalse( $cache->has( 'd', 30 ) ); $this->assertEquals( 'xxx', $cache->get( 'd' ) ); $this->assertNull( $cache->get( 'd', 30 ) ); } /** * @covers MapCacheLRU::hasField() * @covers MapCacheLRU::getField() * @covers MapCacheLRU::setField() */ public function testFields() { $raw = [ 'a' => 1, 'b' => 2, 'c' => 3 ]; $cache = MapCacheLRU::newFromArray( $raw, 3 ); $now = microtime( true ); $cache->setMockTime( $now ); $cache->setField( 'PMs', 'Tony Blair', 'Labour' ); $cache->setField( 'PMs', 'Margaret Thatcher', 'Tory' ); $this->assertTrue( $cache->hasField( 'PMs', 'Tony Blair', 30 ) ); $this->assertEquals( 'Labour', $cache->getField( 'PMs', 'Tony Blair' ) ); $this->assertTrue( $cache->hasField( 'PMs', 'Tony Blair', 30 ) ); $now += 29; $this->assertTrue( $cache->hasField( 'PMs', 'Tony Blair', 30 ) ); $this->assertEquals( 'Labour', $cache->getField( 'PMs', 'Tony Blair' ) ); $this->assertEquals( 'Labour', $cache->getField( 'PMs', 'Tony Blair', 30 ) ); $now += 1.5; $this->assertFalse( $cache->hasField( 'PMs', 'Tony Blair', 30 ) ); $this->assertEquals( 'Labour', $cache->getField( 'PMs', 'Tony Blair' ) ); $this->assertNull( $cache->getField( 'PMs', 'Tony Blair', 30 ) ); $this->assertEquals( [ 'Tony Blair' => 'Labour', 'Margaret Thatcher' => 'Tory' ], $cache->get( 'PMs' ) ); $cache->set( 'MPs', [ 'Edwina Currie' => 1983, 'Neil Kinnock' => 1970 ] ); $this->assertEquals( [ 'Edwina Currie' => 1983, 'Neil Kinnock' => 1970 ], $cache->get( 'MPs' ) ); $this->assertEquals( 1983, $cache->getField( 'MPs', 'Edwina Currie' ) ); $this->assertEquals( 1970, $cache->getField( 'MPs', 'Neil Kinnock' ) ); } /** * @covers MapCacheLRU::has() * @covers MapCacheLRU::get() * @covers MapCacheLRU::set() * @covers MapCacheLRU::hasField() * @covers MapCacheLRU::getField() * @covers MapCacheLRU::setField() */ public function testInvalidKeys() { $cache = MapCacheLRU::newFromArray( [], 3 ); try { $cache->has( 3.4 ); $this->fail( "No exception" ); } catch ( UnexpectedValueException $e ) { $this->assertRegExp( '/must be string or integer/', $e->getMessage() ); } try { $cache->get( false ); $this->fail( "No exception" ); } catch ( UnexpectedValueException $e ) { $this->assertRegExp( '/must be string or integer/', $e->getMessage() ); } try { $cache->set( 3.4, 'x' ); $this->fail( "No exception" ); } catch ( UnexpectedValueException $e ) { $this->assertRegExp( '/must be string or integer/', $e->getMessage() ); } try { $cache->hasField( 'x', 3.4 ); $this->fail( "No exception" ); } catch ( UnexpectedValueException $e ) { $this->assertRegExp( '/must be string or integer/', $e->getMessage() ); } try { $cache->getField( 'x', false ); $this->fail( "No exception" ); } catch ( UnexpectedValueException $e ) { $this->assertRegExp( '/must be string or integer/', $e->getMessage() ); } try { $cache->setField( 'x', 3.4, 'x' ); $this->fail( "No exception" ); } catch ( UnexpectedValueException $e ) { $this->assertRegExp( '/must be string or integer/', $e->getMessage() ); } } }
{ "pile_set_name": "Github" }
──────────────────── aaa ──────────────────── bbb
{ "pile_set_name": "Github" }
<testcase> # Similar to test33 <info> <keywords> HTTP HTTP PUT Resume Content-Range </keywords> </info> # Server-side <reply> <data> HTTP/1.1 200 OK swsclose Date: Thu, 09 Nov 2010 14:49:00 GMT Server: test-server/fake Accept-Ranges: bytes Content-Length: 0 Connection: close Content-Type: text/html </data> </reply> # Client-side <client> <server> http </server> <name> HTTP PUT with resume from end of already-uploaded file </name> <file name="log/test1041.txt"> 012345678 012345678 012345678 012345678 012345678 012345678 012345678 012345678 012345678 012345678 </file> <command> http://%HOSTIP:%HTTPPORT/1041 -Tlog/test1041.txt -C - </command> </client> # Verify data after the test has been "shot" <verify> <strip> ^User-Agent:.* </strip> # curl doesn't do a HEAD request on the remote file so it has no idea whether # it can skip part of the file or not. Instead, it sends the entire file. <protocol> PUT /1041 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Content-Range: bytes 0-99/100 Accept: */* Content-Length: 100 Expect: 100-continue 012345678 012345678 012345678 012345678 012345678 012345678 012345678 012345678 012345678 012345678 </protocol> </verify> </testcase>
{ "pile_set_name": "Github" }
#!/usr/bin/env perl use strict; use warnings; use lib ($ENV{EUK_MODULES}); use Fasta_reader; my $usage = "usage: $0 file.fasta\n\n"; my $fasta_file = $ARGV[0] or die $usage; main: { my $fasta_reader = new Fasta_reader($fasta_file); my %seen; while (my $seq_obj = $fasta_reader->next()) { my $header = $seq_obj->get_header(); my $seq = $seq_obj->get_sequence(); my ($trans_id, $gene_id, @rest) = split(/\s+/, $header); if ($seen{$seq}) { next; } $seen{$seq} = 1; print ">$trans_id;$gene_id\n$seq\n"; } exit(0); }
{ "pile_set_name": "Github" }
// // RZRectZoomAnimationController.h // RZTransitions // // Created by Stephen Barnes on 12/13/13. // Copyright 2014 Raizlabs and other contributors // http://raizlabs.com/ // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // #import <Foundation/Foundation.h> #import <CoreGraphics/CGGeometry.h> #import "RZAnimationControllerProtocol.h" @protocol RZRectZoomAnimationDelegate; @interface RZRectZoomAnimationController : NSObject <RZAnimationControllerProtocol> /** * The delegate for information about the positioning of the views. */ @property (weak, nonatomic) id<RZRectZoomAnimationDelegate> rectZoomDelegate; /** * Flag to allow the From View controller to fade its alpha. * Default to YES; */ @property (assign, nonatomic) BOOL shouldFadeBackgroundViewController; /** * Physics animation spring dampening. * Default is 0.6f. */ @property (assign, nonatomic) CGFloat animationSpringDampening; /** * Physics animation spring velocity. * Default is 15.0f. */ @property (assign, nonatomic) CGFloat animationSpringVelocity; @end @protocol RZRectZoomAnimationDelegate <NSObject> /** * The rect that the ToView will go to. This should be relative to the view controller. * * @return The rect to insert the ToView into. */ - (CGRect)rectZoomPosition; @end
{ "pile_set_name": "Github" }
.class public abstract Lcom/facebook/share/model/ShareMessengerActionButton$Builder; .super Ljava/lang/Object; # interfaces .implements Lcom/facebook/share/model/ShareModelBuilder; # annotations .annotation system Ldalvik/annotation/Signature; value = { "<M:", "Lcom/facebook/share/model/ShareMessengerActionButton;", "B:", "Lcom/facebook/share/model/ShareMessengerActionButton$Builder;", ">", "Ljava/lang/Object;", "Lcom/facebook/share/model/ShareModelBuilder", "<TM;TB;>;" } .end annotation # instance fields .field private title:Ljava/lang/String; # direct methods .method public constructor <init>()V .locals 0 invoke-direct {p0}, Ljava/lang/Object;-><init>()V return-void .end method .method static synthetic access$000(Lcom/facebook/share/model/ShareMessengerActionButton$Builder;)Ljava/lang/String; .locals 1 iget-object v0, p0, Lcom/facebook/share/model/ShareMessengerActionButton$Builder;->title:Ljava/lang/String; return-object v0 .end method # virtual methods .method public readFrom(Lcom/facebook/share/model/ShareMessengerActionButton;)Lcom/facebook/share/model/ShareMessengerActionButton$Builder; .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(TM;)TB;" } .end annotation if-nez p1, :cond_0 :goto_0 return-object p0 :cond_0 invoke-virtual {p1}, Lcom/facebook/share/model/ShareMessengerActionButton;->getTitle()Ljava/lang/String; move-result-object v0 invoke-virtual {p0, v0}, Lcom/facebook/share/model/ShareMessengerActionButton$Builder;->setTitle(Ljava/lang/String;)Lcom/facebook/share/model/ShareMessengerActionButton$Builder; move-result-object p0 goto :goto_0 .end method .method public bridge synthetic readFrom(Lcom/facebook/share/model/ShareModel;)Lcom/facebook/share/model/ShareModelBuilder; .locals 1 check-cast p1, Lcom/facebook/share/model/ShareMessengerActionButton; invoke-virtual {p0, p1}, Lcom/facebook/share/model/ShareMessengerActionButton$Builder;->readFrom(Lcom/facebook/share/model/ShareMessengerActionButton;)Lcom/facebook/share/model/ShareMessengerActionButton$Builder; move-result-object v0 return-object v0 .end method .method public setTitle(Ljava/lang/String;)Lcom/facebook/share/model/ShareMessengerActionButton$Builder; .locals 0 .param p1 # Ljava/lang/String; .annotation build Landroid/support/annotation/Nullable; .end annotation .end param .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/String;", ")TB;" } .end annotation iput-object p1, p0, Lcom/facebook/share/model/ShareMessengerActionButton$Builder;->title:Ljava/lang/String; return-object p0 .end method
{ "pile_set_name": "Github" }
// // HTMLNode.m // StackOverflow // // Created by Ben Reeves on 09/03/2010. // Copyright 2010 Ben Reeves. All rights reserved. // #import "HTMLNode.h" #import <libxml/HTMLtree.h> @implementation HTMLNode -(HTMLNode*)parent { return [[HTMLNode alloc] initWithXMLNode:_node->parent]; } -(HTMLNode*)nextSibling { return [[HTMLNode alloc] initWithXMLNode:_node->next]; } -(HTMLNode*)previousSibling { return [[HTMLNode alloc] initWithXMLNode:_node->prev]; } void setAttributeNamed(xmlNode * node, const char * nameStr, const char * value) { char * newVal = (char *)malloc(strlen(value)+1); memcpy (newVal, value, strlen(value)+1); for(xmlAttrPtr attr = node->properties; NULL != attr; attr = attr->next) { if (strcmp((char*)attr->name, nameStr) == 0) { for(xmlNode * child = attr->children; NULL != child; child = child->next) { free(child->content); child->content = (xmlChar*)newVal; break; } break; } } } NSString * getAttributeNamed(xmlNode * node, const char * nameStr) { for(xmlAttrPtr attr = node->properties; NULL != attr; attr = attr->next) { if (strcmp((char*)attr->name, nameStr) == 0) { for(xmlNode * child = attr->children; NULL != child; child = child->next) { return [NSString stringWithCString:(void*)child->content encoding:NSUTF8StringEncoding]; } break; } } return NULL; } -(NSString*)getAttributeNamed:(NSString*)name { const char * nameStr = [name UTF8String]; return getAttributeNamed(_node, nameStr); } //Returns the class name -(NSString*)className { return [self getAttributeNamed:@"class"]; } //Returns the tag name -(NSString*)tagName { return [NSString stringWithCString:(void*)_node->name encoding:NSUTF8StringEncoding]; } -(HTMLNode*)firstChild { return [[HTMLNode alloc] initWithXMLNode:_node->children]; } -(void)findChildrenWithAttribute:(const char*)attribute matchingName:(const char*)className inXMLNode:(xmlNode *)node inArray:(NSMutableArray*)array allowPartial:(BOOL)partial { xmlNode *cur_node = NULL; const char * classNameStr = className; //BOOL found = NO; for (cur_node = node; cur_node; cur_node = cur_node->next) { for(xmlAttrPtr attr = cur_node->properties; NULL != attr; attr = attr->next) { if (strcmp((char*)attr->name, attribute) == 0) { for(xmlNode * child = attr->children; NULL != child; child = child->next) { BOOL match = NO; if (!partial && strcmp((char*)child->content, classNameStr) == 0) match = YES; else if (partial && strstr ((char*)child->content, classNameStr) != NULL) match = YES; if (match) { //Found node HTMLNode * nNode = [[HTMLNode alloc] initWithXMLNode:cur_node]; [array addObject:nNode]; break; } } break; } } [self findChildrenWithAttribute:attribute matchingName:className inXMLNode:cur_node->children inArray:array allowPartial:partial]; } } -(void)findChildTags:(NSString*)tagName inXMLNode:(xmlNode *)node inArray:(NSMutableArray*)array { xmlNode *cur_node = NULL; const char * tagNameStr = [tagName UTF8String]; if (tagNameStr == nil) return; for (cur_node = node; cur_node; cur_node = cur_node->next) { if (cur_node->name && strcmp((char*)cur_node->name, tagNameStr) == 0) { HTMLNode * node = [[HTMLNode alloc] initWithXMLNode:cur_node]; [array addObject:node]; } [self findChildTags:tagName inXMLNode:cur_node->children inArray:array]; } } -(NSArray*)findChildTags:(NSString*)tagName { NSMutableArray * array = [NSMutableArray array]; [self findChildTags:tagName inXMLNode:_node->children inArray:array]; return array; } -(HTMLNode*)findChildTag:(NSString*)tagName inXMLNode:(xmlNode *)node { xmlNode *cur_node = NULL; const char * tagNameStr = [tagName UTF8String]; for (cur_node = node; cur_node; cur_node = cur_node->next) { if (cur_node && cur_node->name && strcmp((char*)cur_node->name, tagNameStr) == 0) { return [[HTMLNode alloc] initWithXMLNode:cur_node]; } HTMLNode * cNode = [self findChildTag:tagName inXMLNode:cur_node->children]; if (cNode != NULL) { return cNode; } } return NULL; } -(HTMLNode*)findChildTag:(NSString*)tagName { return [self findChildTag:tagName inXMLNode:_node->children]; } -(NSArray*)children { xmlNode *cur_node = NULL; NSMutableArray * array = [NSMutableArray array]; for (cur_node = _node->children; cur_node; cur_node = cur_node->next) { HTMLNode * node = [[HTMLNode alloc] initWithXMLNode:cur_node]; [array addObject:node]; } return array; } /* -(NSString*)description { NSString * string = [NSString stringWithFormat:@"<%s>%@\n", _node->name, [self contents]]; for (HTMLNode * child in [self children]) { string = [string stringByAppendingString:[child description]]; } string = [string stringByAppendingString:[NSString stringWithFormat:@"<%s>\n", _node->name]]; return string; }*/ -(HTMLNode*)findChildWithAttribute:(const char*)attribute matchingName:(const char*)name inXMLNode:(xmlNode *)node allowPartial:(BOOL)partial { xmlNode *cur_node = NULL; const char * classNameStr = name; //BOOL found = NO; if (node == NULL) return NULL; for (cur_node = node; cur_node; cur_node = cur_node->next) { for(xmlAttrPtr attr = cur_node->properties; NULL != attr; attr = attr->next) { if (strcmp((char*)attr->name, attribute) == 0) { for(xmlNode * child = attr->children; NULL != child; child = child->next) { BOOL match = NO; if (!partial && strcmp((char*)child->content, classNameStr) == 0) match = YES; else if (partial && strstr ((char*)child->content, classNameStr) != NULL) match = YES; if (match) { return [[HTMLNode alloc] initWithXMLNode:cur_node]; } } break; } } HTMLNode * cNode = [self findChildWithAttribute:attribute matchingName:name inXMLNode:cur_node->children allowPartial:partial]; if (cNode != NULL) { return cNode; } } return NULL; } -(HTMLNode*)findChildWithAttribute:(NSString*)attribute matchingName:(NSString*)className allowPartial:(BOOL)partial { return [self findChildWithAttribute:[attribute UTF8String] matchingName:[className UTF8String] inXMLNode:_node->children allowPartial:partial]; } -(HTMLNode*)findChildOfClass:(NSString*)className { HTMLNode * node = [self findChildWithAttribute:"class" matchingName:[className UTF8String] inXMLNode:_node->children allowPartial:NO]; return node; } -(NSArray*)findChildrenWithAttribute:(NSString*)attribute matchingName:(NSString*)className allowPartial:(BOOL)partial { NSMutableArray * array = [NSMutableArray array]; [self findChildrenWithAttribute:[attribute UTF8String] matchingName:[className UTF8String] inXMLNode:_node->children inArray:array allowPartial:partial]; return array; } -(NSArray*)findChildrenOfClass:(NSString*)className { return [self findChildrenWithAttribute:@"class" matchingName:className allowPartial:NO]; } -(id)initWithXMLNode:(xmlNode*)xmlNode { if (self = [super init]) { _node = xmlNode; } return self; } -(void)appendChildContentsToString:(NSMutableString*)string inNode:(xmlNode*)node { if (node == NULL) return; xmlNode *cur_node = NULL; for (cur_node = node; cur_node; cur_node = cur_node->next) { if (cur_node->content) { [string appendString:[NSString stringWithCString:(void*)cur_node->content encoding:NSUTF8StringEncoding]]; } [self appendChildContentsToString:string inNode:cur_node->children]; } } -(NSString*)contents { if (_node->children && _node->children->content) { return [NSString stringWithCString:(void*)_node->children->content encoding:NSUTF8StringEncoding]; } return nil; } HTMLNodeType nodeType(xmlNode * _node) { if (_node == NULL || _node->name == NULL) return HTMLUnkownNode; const char * tagName = (const char*)_node->name; if (strcmp(tagName, "a") == 0) return HTMLHrefNode; else if (strcmp(tagName, "text") == 0) return HTMLTextNode; else if (strcmp(tagName, "code") == 0) return HTMLCodeNode; else if (strcmp(tagName, "span") == 0) return HTMLSpanNode; else if (strcmp(tagName, "p") == 0) return HTMLPNode; else if (strcmp(tagName, "ul") == 0) return HTMLUlNode; else if (strcmp(tagName, "li") == 0) return HTMLLiNode; else if (strcmp(tagName, "image") == 0) return HTMLImageNode; else if (strcmp(tagName, "ol") == 0) return HTMLOlNode; else if (strcmp(tagName, "strong") == 0) return HTMLStrongNode; else if (strcmp(tagName, "pre") == 0) return HTMLPreNode; else if (strcmp(tagName, "blockquote") == 0) return HTMLBlockQuoteNode; else return HTMLUnkownNode; } -(HTMLNodeType)nodetype { return nodeType(_node); } NSString * allNodeContents(xmlNode*node) { if (node == NULL) return nil; void * contents = xmlNodeGetContent(node); if (contents) { NSString * string = [NSString stringWithCString:contents encoding:NSUTF8StringEncoding]; xmlFree(contents); return string; } return @""; } -(NSString*)allContents { return allNodeContents(_node); } NSString * rawContentsOfNode(xmlNode * node) { xmlBufferPtr buffer = xmlBufferCreateSize(1000); xmlOutputBufferPtr buf = xmlOutputBufferCreateBuffer(buffer, NULL); htmlNodeDumpOutput(buf, node->doc, node, (const char*)node->doc->encoding); xmlOutputBufferFlush(buf); NSString * string = nil; if (buffer->content) { string = [[NSString alloc] initWithBytes:(const void *)xmlBufferContent(buffer) length:xmlBufferLength(buffer) encoding:NSUTF8StringEncoding]; } xmlOutputBufferClose(buf); xmlBufferFree(buffer); return string; } -(NSString*)rawContents { return rawContentsOfNode(_node); } @end
{ "pile_set_name": "Github" }
var fs = require('graceful-fs') function symlinkType (srcpath, type, callback) { callback = (typeof type === 'function') ? type : callback type = (typeof type === 'function') ? false : type if (type) return callback(null, type) fs.lstat(srcpath, function (err, stats) { if (err) return callback(null, 'file') type = (stats && stats.isDirectory()) ? 'dir' : 'file' callback(null, type) }) } function symlinkTypeSync (srcpath, type) { if (type) return type try { var stats = fs.lstatSync(srcpath) } catch (e) { return 'file' } return (stats && stats.isDirectory()) ? 'dir' : 'file' } module.exports = { symlinkType: symlinkType, symlinkTypeSync: symlinkTypeSync }
{ "pile_set_name": "Github" }
/// F# helpers to the Azure Compute API /// Copyright (c) Microsoft Corporation. module Microsoft.FSharpLu.Azure.VM open System open Microsoft.Azure.Storage open Microsoft.FSharpLu open Microsoft.FSharpLu.Async open Microsoft.Azure.Management.Compute open Microsoft.Azure.Management.Compute.Models open Microsoft.Azure.Management.ResourceManager open Microsoft.Azure.Management.ResourceManager.Models open Microsoft.Azure.KeyVault open Microsoft.Rest.Azure open Microsoft.FSharpLu.Azure open Microsoft.FSharpLu.Azure.Context open Microsoft.FSharpLu.Azure.AppInsights open Microsoft.FSharpLu.Azure.Request open Microsoft.FSharpLu.Azure.ResourceGroup open Microsoft.FSharpLu.ErrorHandling type ComputeSubResource = Microsoft.Azure.Management.Compute.Models.SubResource type ComputeResource = Microsoft.Azure.Management.Compute.Models.Resource module Constants = /// Time interval between two retry attempts of a blob copy let BlobCopyRetryPeriod = TimeSpan.FromSeconds(20.0) /// Maximum attempts at copying a blob let BlobCopyMaxiumAttempts = 3 /// Directory where virutal machines' disk VHDS are stored under each storage account let VhdDisksContainer = "vhds" /// Vault key name prefix for the RDP certificate let CertificateKeyNamePrefix = "vmremote-certificate-" /// Azure storage container where captured images are stored let CapturedImagesContainer = "system" /// Name of the vault key containing the VM remote certificate let RemoteCertKey = "WinRMCertificateJsonBlob" /// Name of the vault key containing the VM remote SSH key let RemoteSshKey = "SshPublicKey" /// Maximum length of managed disk name let MaxManagedDiskNameLength = 80 /// The managed disk ARM resource type ID let ManagedDiskResourceType = "Microsoft.Compute/disks" /// The managed image ARM resource type ID let ManagedImageResourceType = "Microsoft.Compute/images" /// VM statuses module Status = module PowerState = let Starting = "PowerState/starting" let Running = "PowerState/running" let Deallocating = "PowerState/deallocating" let Deallocated = "PowerState/deallocated" let Stopped = "PowerState/stopped" module Provision = let Succeeded = "ProvisioningState/succeeded" let Updating = "ProvisioningState/updating" let Failed = "ProvisioningState/failed" module Failure = let TargetDiskBlobAlreadyExists = "ProvisioningState/failed/TargetDiskBlobAlreadyExists" /// Internal predicate expressions use to query states of virutal machines module private InternalPredicates = let vmHasStatus (vm:VirtualMachine) status = vm.InstanceView.Statuses |> Seq.exists (fun s -> s.Code = status) let vmHasStatusWhere (vm:VirtualMachine) condition = vm.InstanceView.Statuses |> Seq.exists condition let vmIsReady (vm:VirtualMachine) = vmHasStatus vm Status.Provision.Succeeded && vmHasStatus vm Status.PowerState.Running let vmIsStopped (vm:VirtualMachine) = // VM is stopped either if // - it is marked as deallocated vmHasStatus vm Status.PowerState.Deallocated // - it has a stopped power state || vmHasStatus vm Status.PowerState.Stopped module TraceTags = /// Track an exception in AppInsight and reraise it let inline failwithException e message tags = TraceTags.trackException e (("customMessage", message)::tags) Async.reraise e type MachineNotFound(groupName: string, machineName:string, innerException:Exception) = inherit Exception(sprintf "Could not find VM instance %s under resource group %s" machineName groupName, innerException) new(groupName, machineName) = MachineNotFound(groupName, machineName, null) let getAvailableOSImages (c:IComputeManagementClient) (location:string) = let location = location.Replace(" ", "") // strip spaces c.VirtualMachineImages.List( location=location, publisherName ="MicrosoftWindowsServer", offer="WindowsServer", skus ="2012-R2-Datacenter") let getLatestAvailableOSImagesName (context:InfrastructureContext) location = getAvailableOSImages context.compute location |> Seq.last /// Returns the URI to the most recent blob with the specified prefix and extesnion under the specified containter let tryGetMostRecentBlobUnder (storage:BlobStorageContext) container prefix extension = async { let! blobs = Blob.listBlobsWithExtension (storage.client) container prefix extension return blobs |> Seq.cast<Microsoft.Azure.Storage.Blob.CloudBlob> // sort by decreasing modified date |> Seq.sortBy (fun b -> DateTimeOffset.MaxValue - b.Properties.LastModified.GetValueOrDefault(DateTimeOffset.MinValue)) |> Seq.tryPick (fun s -> Some s.Uri) // Return the first element } /// Get list of managed disks in the given resource group let public getManagedDisksByResourceGroup (context:Context.InfrastructureContext) resourceGroupName = async { let! token = Async.CancellationToken try return! enumerateAllPagesAsync context.tags (sprintf "Managed disks under resource group %s" resourceGroupName) { getFirstPage = fun () -> context.compute.Disks.ListByResourceGroupAsync(resourceGroupName, token) getNextPage = fun link -> context.compute.Disks.ListByResourceGroupNextAsync(link, token) pageAsList = fun page -> page |> Seq.toList getLink = fun page -> page.NextPageLink } with IsAggregateOf SomeResourceGroupNotFoundException e -> TraceTags.info "Resource group not found" (context.tags @ [ "resourceGroupName", resourceGroupName]) return [] } /// Returns the most recent data disk with the specified prefix and under specified resource group and location let getMostRecentDataDiskUnder (context: Context.InfrastructureContext) resourceGroupName prefix location = async { let! disks = getManagedDisksByResourceGroup context resourceGroupName let mostRecentDisk = disks |> Seq.filter (fun d -> d.Name.StartsWith (sprintf "%s-%s" location prefix)) |> Seq.sortBy (fun d -> DateTime.MaxValue - d.TimeCreated.GetValueOrDefault(DateTime.MinValue)) |> Seq.tryHead match mostRecentDisk with | Some disk -> return disk | None -> return TraceTags.failwith "Could not find a managed data disk under the specified resource group with specified prefix and region" (context.tags @[ "prefix", prefix; "location", location; "resourceGroupName", resourceGroupName]) } /// Returns data disk with the specified name and version under specified resource group and location let getDataDiskUnder (context:Context.InfrastructureContext) resourceGroupName name version (location:string) = async { // Managed disks max name length is 80 characters. The 80 characters contain several sub-sets of information, the region name being one of them. // These sub-sets of data are length restricted. This logic has to be the same as the one // naming managed disk. See function GenerateBlobVersion and function GenerateManagedDiskName in AzureHelpers.psm1 for the logic definition let LocationMaxLength = 10 let location = Text.truncate LocationMaxLength location let diskName = location + version + name if diskName.Length > Constants.MaxManagedDiskNameLength then TraceTags.failwith "Target managed disk name length exceeds maximum allowed length" (context.tags @ [ "MaximumLength", Constants.MaxManagedDiskNameLength.ToString() "diskName" , diskName "diskNameLength", diskName.Length.ToString() ]) let! disks = getManagedDisksByResourceGroup context resourceGroupName let disk = disks |> Seq.tryFind (fun d -> d.Name = diskName) match disk with | Some disk -> return disk | None -> return TraceTags.failwith "Could not find a managed data disk under specified resource group with given name and region" (context.tags @ [ "diskName", diskName; "location", location; "resourceGroupName", resourceGroupName ]) } /// Return true if an ARM resource is of the specified type let isResourceOfType resourceType (genericResource:GenericResource) = String.Equals(genericResource.Type, resourceType, StringComparison.InvariantCultureIgnoreCase) /// Get the disk details from a generic resource /// If details cannot be fetched then log a warning and return None. let tryGetDiskFromGenericResource (context:Context.InfrastructureContext) resourceGroupName (genericResource:GenericResource) = let logTags = context.tags @ [ "id", genericResource.Id; "name", genericResource.Name; "type", genericResource.Type ] if isResourceOfType Constants.ManagedDiskResourceType genericResource then try Some (context.compute.Disks.Get(resourceGroupName, genericResource.Name)) with | :? Microsoft.Rest.Azure.CloudException -> TraceTags.warning "Skipping disk resource: could not get details of managed disk" logTags None else TraceTags.failwith "Resource is not of managed-disk type" logTags /// Get the managed image details from a generic resource /// If details cannot be fetched then log a warning and return None. let tryGetImageFromGenericResource (context:Context.InfrastructureContext) resourceGroupName (genericResource:GenericResource) = let logTags = context.tags @ [ "id", genericResource.Id; "name", genericResource.Name; "type", genericResource.Type ] if isResourceOfType Constants.ManagedImageResourceType genericResource then try Some (context.compute.Images.Get(resourceGroupName, genericResource.Name)) with | :? Microsoft.Rest.Azure.CloudException -> TraceTags.warning "Skipping image resource: could not get details of managed image" logTags None else TraceTags.failwith "Resource is not of managed-image type" logTags /// A filter expression on tags supporting /// wildcard expression '*' matchin any string, /// and `~` matchin any expression contain the specified substring. /// The first element is the tag key, the second is the search expression. type TagFilterExpression = string * string /// Returns true if the set of tags matches the specified tag expression filter let matchTagExpression (tags:System.Collections.Generic.IDictionary<string,string>) ((filterTagName,filterTagValue):TagFilterExpression) = match tags.TryGetValue filterTagName with | true, _ when filterTagValue = "*" -> // The tag exists for the disk resource e.g. ("version","*") true | true, diskTagValue when filterTagValue.Chars(0) = '~' -> // Test if the filter tag value is contained in the disk tag value e.g. ("release","~develop") // If the disk's tag value is "develop,dogfood", this should return true diskTagValue.Contains(filterTagValue.Substring(1)) | true, diskTagValue -> //Test if the filter tag value is equal to the disk tag value diskTagValue = filterTagValue | false, _ -> //The tag does not exists for the disk resource false /// Returns true if the set of tags matches the specified tag filter let matchTagValue (tags:System.Collections.Generic.IDictionary<string,string>) ((tagName, tagValue):string*string) = match tags.TryGetValue tagName with | true, diskTagValue -> diskTagValue = tagValue | false, _ -> false /// Find disks in a resource group filtered by the specified set of filter tags, which are name-value pairs /// - The (tagName, tagValue) pair is used to query resource group. It should not contain any wildcard /// expression (* or ~). (The characters themselves are allowed but won't be interpreted as wildcards) /// - Additional tag filter expressions consisting of pairs (tagName, tagExpression) are used to further /// filter the returned list of disks. The tagExpression can contain wildcards. let listDisksInResourceGroupByTagExpressions (context:Context.InfrastructureContext) resourceGroupName (tagPair:string*string) (tagFilterExpressions:TagFilterExpression list) = async { let! disks = listDisksByResourceGroupAndTag context resourceGroupName tagPair TraceTags.info "Retrieved list of Azure disks." (context.tags @ ["tagPair", sprintf "%A" tagPair "tagFilterExpressions", sprintf "%A" tagFilterExpressions "resourceGroupName", resourceGroupName "disks.Length", disks.Length.ToString()]) return disks |> List.filter (fun disk -> List.forall (matchTagExpression disk.Tags) tagFilterExpressions) } /// List managed images in a resource group filtered by the specified set of filter name-value tag pairs let listImagesInResourceGroupWithTags (context:Context.InfrastructureContext) resourceGroupName (tagPair:string*string) (additionalTagPairs:(string*string) list) = async { let! images = listImagesByResourceGroupAndTag context resourceGroupName tagPair TraceTags.info "Retrieved list of Azure images." (context.tags @ ["tagPair", sprintf "%A" tagPair "additionalTagPairs", sprintf "%A" additionalTagPairs "resourceGroupName", resourceGroupName "images.Length", images.Length.ToString()]) return images |> List.filter (fun image -> List.forall (matchTagValue image.Tags) additionalTagPairs) } /// Convert an absolute blob URI to a relative path under a given storage account and parent directory let public makeRelativeUri parent (absoluteUri:System.Uri) = absoluteUri.LocalPath |> Text.skipPrefixCaseInsensitive ("/" + parent) #if TEST let x storage = tryGetMostRecentVhdUnder storage "vhds" "SFV-" let y storage = getVhds storage "vhds" "S" |> Seq.map (fun x-> x.Uri.AbsolutePath, x.Properties.LastModified.ToString()) |> Seq.sortBy snd #endif /// Azure VM sizes type AzureVmSize = | ExtraSmall | Small | Medium | Large | ExtraLarge /// User credentials on a VM type VMUserCredentials = { Username : string Password : string } /// Definition of a VM that can be used to provision a VM image from Azure marketplace. type GalleryImageSource = { publisher : string offer : string sku : string version: string } /// Various way of definining the disk layout when provisioning a new VM type VMDiskSource = /// Provision OS disk by specializing a managed image specified by Resource Id | OSManagedImage of string /// Provision OS disk from gallery image. | OSGalleryImage of GalleryImageSource exception AzureComputeException of System.Exception /// Stop a VM in Azure let stopVM (c:Context.InfrastructureContext) vmName = async { let tags = c.tags @ [ "vmName", vmName ] try do! c.compute.VirtualMachines.PowerOffAsync(c.groupName, vmName).AsAsync TraceTags.info "VM stopped." tags with e -> TraceTags.failwithException e "Failed to stop VM" tags } let private getAllNetworkInterfaces (vm:VirtualMachine) = vm.NetworkProfile /// Return the list of URI to all disk attached to the VM let private getVMDisksUri context (vm:VirtualMachine) = if isNull vm.StorageProfile.OsDisk.ManagedDisk then vm.StorageProfile.OsDisk.Vhd.Uri ::(vm.StorageProfile.DataDisks |> Seq.map (fun d -> d.Vhd.Uri) |> Seq.toList) else TraceTags.info "This is a VM with managed disks, therefore we don't manage deletion of VHDs." context.tags [] /// Return URI to VHD blob of OS and data disks attached to the specified virtual machine let getVMVhds (context:InfrastructureContext) vmName = async { let! vm = context.compute.VirtualMachines.GetAsync(context.groupName, vmName).AsAsync return getVMDisksUri context vm } /// Returns the full URI to a given VHD blob file /// (accepts both base name and filename with .vhd extension) let private vhdUri s (file:string) = let filename = if file.EndsWith(".vhd", System.StringComparison.InvariantCultureIgnoreCase) then file else file + ".vhd" (blobUri s (sprintf "%s/%s" Constants.VhdDisksContainer filename)).AbsoluteUri /// Copy a VHD blob on Azure. /// Target blob name should not include the .vhd extension let copyVhd (s:BlobStorageContext) (sourceUri:Uri) targetContainer targetBlobName = async { let container = s.client.GetContainerReference(targetContainer) let target = container.GetPageBlobReference(targetBlobName) let! r = target.StartCopyAsync(sourceUri).AsAsync return target.Uri } /// Copy a VHD blob on Azure with resilience to "Server Busy" errors let rec resilientcopyVhd tags (s:BlobStorageContext) (sourceUri:Uri) targetContainer targetBlobName = let rec aux retryCount = async { if retryCount > Constants.BlobCopyMaxiumAttempts then return TraceTags.failwith "Maximum attempt reached at copying blob." tags else try return! copyVhd s sourceUri targetContainer targetBlobName with /// Catch System.AggregateException // of Microsoft.Azure.Storage.StorageException // of "The remote server returned an error: (503) Server Unavailable" | IsAggregateOf (SomeStorageException System.Net.HttpStatusCode.ServiceUnavailable) e -> TraceTags.warning "WARNING: Failed to copy blob from specified URI. Retrying in %ds... " (tags @ [ "sourceUri", sourceUri.AbsoluteUri "targetBlobName", targetBlobName "exception", e.ToString() "retryIn", (int Constants.BlobCopyRetryPeriod.TotalSeconds).ToString() ]) do! Async.Sleep (int Constants.BlobCopyRetryPeriod.TotalMilliseconds) return! aux (retryCount+1) | :? System.IO.IOException as e -> return TraceTags.failwith "Error while copying blob from specified URI" (tags @ [ "sourceUri", sourceUri.AbsoluteUri "targetBlobName", targetBlobName "retryIn", (int Constants.BlobCopyRetryPeriod.TotalSeconds).ToString() ]) } aux 0 /// Desired failure behviour when deleting a blob type DeleteBlobFailureOptions = | Throw | TraceError | TraceWarning /// Match web or Azure storage exceptions let SomeWebOrStorageException : System.Exception -> System.Exception option = function | :? Microsoft.Azure.Storage.StorageException | :? System.Net.WebException as e -> Some e | _ -> None /// Try delete a blob specified by its absolute URI let tryDeleteBlob (storage:BlobStorageContext) (blobUri:Uri) = async { try let! blob = storage.client.GetBlobReferenceFromServerAsync(blobUri).AsAsync let! existed = blob.DeleteIfExistsAsync().AsAsync return Choice1Of2 existed with IsAggregateOf SomeWebOrStorageException e -> return Choice2Of2 e } /// Delete a blob specified by its absolute URI let deleteBlob tags (failureBehaviour:DeleteBlobFailureOptions) (storage:BlobStorageContext) (blobUri:Uri) = async { let fail message = let tags = tags @ [ "blobUri", blobUri.AbsoluteUri "errorMessage", message "severity", sprintf "%A" failureBehaviour ] match failureBehaviour with | Throw -> TraceTags.failwith "Could not delete blob (exception)" tags | TraceError -> TraceTags.error "Could not delete blob (error)" tags | TraceWarning -> TraceTags.warning "Could not delete blob (warning)" tags let! result = tryDeleteBlob storage blobUri match result with | Choice1Of2 true -> return () | Choice1Of2 false -> return fail "The blob did not exist so it could not be deleted" | Choice2Of2 e -> return fail e.Message } /// Extract the parent container and relative path from a blob URI let getBlobContainerAndRelativePathFromUri (blobUri:Uri) = let container = blobUri.Segments.[1].Replace("/","") let relativePathUnderContainer = blobUri.Segments |> Seq.skip 2 |> Text.join "" container, relativePathUnderContainer /// Delete a VHD captured from a VM that was deployed on the specified storage account. /// The blob is specified by the path *relative to the parent container ("system") used by Azure to store captured images*. let deleteCapturedVhdRelative tags (storage:BlobStorageContext) blobRelativePathInContainer = async { let container = storage.client.GetContainerReference(Constants.CapturedImagesContainer) let blob = container.GetBlobReference(blobRelativePathInContainer) let! r = blob.DeleteIfExistsAsync().AsAsync if not r then TraceTags.warning "Captured VHD blob does not exist or has already been deleted" (tags @ [ "BlobUri", blob.Uri.AbsoluteUri ]) } /// Delete blobs specified by Uri let deleteBlobs context storage (blobUris:Uri list) disksExpectedToExist = async { let! results = blobUris |> Seq.map (tryDeleteBlob storage) |> Async.Parallel let blobAndResults = Seq.zip blobUris results let blobMissing (blobUri, deleteResult) = match deleteResult with | Choice1Of2 true -> None | Choice1Of2 false -> Some (sprintf "Blob did not exists: %O" blobUri) | Choice2Of2 _ -> None let hasError (blobUri, deleteResult) = match deleteResult with | Choice1Of2 _ -> None | Choice2Of2 e -> Some <| sprintf "Exception occurred when deleting blob %O: %O" blobUri e let errorBlobs = Seq.choose hasError blobAndResults |> Seq.toList let missingBlobs = Seq.choose blobMissing blobAndResults |> Seq.toList let tags = context.tags @ ([ "blobsToDelete", sprintf "%A" blobUris "missingBlobs", sprintf "%A" missingBlobs]) if not <| List.isEmpty errorBlobs then TraceTags.error "Errors occured when trying to delete blobs" (tags @ [ "errors", sprintf "%A" errorBlobs ]) else if disksExpectedToExist && not <| List.isEmpty missingBlobs then TraceTags.error "Some blobs were not found and could not be deleted" tags } /// Get the list of URIs to all disk VHDs attached to a virtual machine let private getAllVmDisks context (vm:VirtualMachine) = let allVhds = getVMDisksUri context vm let allDiskVhdsUrl = allVhds |> Seq.map Uri |> Seq.toList TraceTags.info "VHDs disks associated with a virtual machine" (context.tags @ [ "diskCount", allDiskVhdsUrl.Length.ToString() "machineName", vm.Name "disks", (allDiskVhdsUrl |> Seq.map (fun v -> v.AbsoluteUri) |> Text.join " \n") ]) allDiskVhdsUrl /// Determine if the status of the VM indicates that the attached disks are expected to exist /// - If the machine has already started then we expect the disk vhd to necessarily exist /// - If the machine has not started yet then the disk VHDs may or may not exist /// This is used to determine whether errors need to be logged when cleaning up the VM and disks blobs are missing. let areVmDisksExpectedToExist vm = let diskExpectedToExist = InternalPredicates.vmHasStatus vm Status.PowerState.Running || InternalPredicates.vmHasStatus vm Status.PowerState.Starting diskExpectedToExist /// Get the list with names of all managed data disks attached to a virtual machine let private getNamesOfAllManagedDataDisks (vm:VirtualMachine) = if isNull vm.StorageProfile.OsDisk.ManagedDisk then Seq.empty else vm.StorageProfile.DataDisks |> Seq.map (fun d -> d.Name) /// Get the name of OsDisk associated with the specified virtual machine let private tryGetManagedOsDiskName (vm:VirtualMachine) = if isNull vm.StorageProfile.OsDisk.ManagedDisk then None else Some vm.StorageProfile.OsDisk.Name /// Returns a managed disk by name and resource group, or None in case it wasn't possible to get the disk let tryGetManagedDisk (context:Context.InfrastructureContext) resourceGroupName diskName = async { let tags = context.tags @ [ "diskName", diskName "resourceGroupName", resourceGroupName ] try let! disk = context.compute.Disks.GetAsync(resourceGroupName, diskName).AsAsync if isNull disk then return None else TraceTags.info "Found a disk with matching name in the resource group." tags return Some disk with | e -> TraceTags.warning "Failed trying to get managed disk under specified resource group" (("exception", e.ToString())::tags) return None } /// Get a managed disk by name and resource group let getManagedDisk (context:Context.InfrastructureContext) resourceGroupName diskName = async { let tags = context.tags @ [ "diskName", diskName "resourceGroupName", resourceGroupName ] try let! disk = context.compute.Disks.GetAsync(resourceGroupName, diskName).AsAsync if isNull disk then return TraceTags.failwith "Managed disk not found in resource group." tags else TraceTags.info "Found a disk with matching name in the resource group." tags return disk with | :? System.Runtime.Serialization.SerializationException as ex -> return TraceTags.failwithException ex "Unable to deserialize the response when trying to get a managed disk." tags | :? Microsoft.Rest.ValidationException as ex -> return TraceTags.failwithException ex "Validation failed when trying to get a managed disk." tags | :? System.ArgumentNullException as ex -> return TraceTags.failwithException ex "Failed trying to get a managed disk. Some of the passed parameters are null." tags | ex -> return TraceTags.failwithException ex "Unable to deserialize the response when trying to get a managed disk." tags } /// Delete a manage disk by name and resource group let deleteManagedDisk (context:Context.InfrastructureContext) resourceGroupName diskName = async { let tags = context.tags @ ([ "diskName", diskName "resourceGroupName", resourceGroupName ]) try let! disk = getManagedDisk context resourceGroupName diskName do! context.compute.Disks.DeleteAsync(resourceGroupName, diskName).AsAsync TraceTags.info "Deletion of managed disk completed." tags with | :? System.Runtime.Serialization.SerializationException as e -> return TraceTags.failwithException e "Unable to deserialize the response when trying to delete a managed image." tags | :? Microsoft.Rest.ValidationException as e -> return TraceTags.failwithException e "Validation failed when trying to delete a managed image." tags | :? System.ArgumentNullException as e -> return TraceTags.failwithException e "Failed trying to delete a managed image. Some of the passed parameters are null." tags | e -> return TraceTags.failwithException e "Failed deleting a managed disk from resource group." tags } /// Create Azure portal url from a resource ID let azurePortalUrlFromResourceId (resourceId: string) = sprintf "%s%s" Constants.portalResource resourceId /// Retrieve VM Azure portal URL and VM IP configurations let getVmIpConfigurations (context:Context.InfrastructureContext) vmName = async { let! vmRequest = context.compute.VirtualMachines.GetWithHttpMessagesAsync(context.groupName, vmName).AsAsync let vm = vmRequest.Body assertStatusCodeIs context.tags System.Net.HttpStatusCode.OK vmRequest.Response.StatusCode "Could not retrieve VM info." let networkInterfaceGroup, networkInterfaceName = match vm.NetworkProfile.NetworkInterfaces.[0].Id.Split([|'/'|]) |> Seq.toList |> List.rev with | n::"networkInterfaces"::"Microsoft.Network"::"providers"::g::"resourceGroups"::_ -> g, n | _ -> TraceTags.failwith "Incorrect network interface URI format" context.tags let token = Threading.CancellationToken() let! net = context.network.NetworkInterfaces.GetWithHttpMessagesAsync(networkInterfaceGroup, networkInterfaceName, cancellationToken = token).AsAsync assertStatusCodeIs context.tags System.Net.HttpStatusCode.OK net.Response.StatusCode "Could not get network interface." // Get public IP address assigned to the VM let! publicIPs = net.Body.IpConfigurations |> Seq.map (fun ipConfig -> async { if isNull ipConfig.PublicIPAddress then return None else let publicIpResourceGroup, publicIpName = match ipConfig.PublicIPAddress.Id.Split([|'/'|]) |> Seq.toList |> List.rev with | n::"publicIPAddresses"::"Microsoft.Network"::"providers"::g::"resourceGroups"::_ -> g,n | _ -> TraceTags.failwith "Incorrect public IP URI format" context.tags let! publicIp = context.network.PublicIPAddresses.GetWithHttpMessagesAsync(publicIpResourceGroup, publicIpName, cancellationToken = token).AsAsync assertStatusCodeIs context.tags System.Net.HttpStatusCode.OK publicIp.Response.StatusCode "Cannot find public IP for load balancer" return Some publicIp.Body } ) |> Async.sequentialCombine return (azurePortalUrlFromResourceId vm.Id), net.Body.IpConfigurations, publicIPs } /// Options accepted by deleteVM [<Flags>] type DeleteVmOptions = /// Delete VHDs mounted as VM disks | DeleteAttachedDisks = 0x01 /// Delete NICs attached to the VM | DeleteAttachedNic = 0x02 /// Do nothing | None = 0x04 /// Delete a VM and its associated VHDs. Returns once the deletion has completed. let deleteVM (c:Context.InfrastructureContext) (storage:BlobStorageContext) (options:DeleteVmOptions) vmName = async { let tags = c.tags @ [ "name", vmName] TraceTags.info "Deleting VM synchronoulsy in ARM" tags let! vm = c.compute.VirtualMachines.GetAsync(c.groupName, vmName).AsAsync // Get the list of underlying VHDs disks: They are not automatically // deleted by ARM upon group deletion let allDiskVhdsUrl = getAllVmDisks c vm let allNics = getAllNetworkInterfaces vm let allManagedDataDisks = getNamesOfAllManagedDataDisks vm let managedOsDisk = tryGetManagedOsDiskName vm // Delete the VM synchronoulsy in ARM try do! c.compute.VirtualMachines.DeleteAsync(c.groupName, vmName).AsAsync TraceTags.info "VM successfully deleted." tags with e -> TraceTags.failwithException e "Failed to delete VM." tags if options.HasFlag DeleteVmOptions.DeleteAttachedDisks then // Azure does not properly cleanup the disks so we need to delete them manually match managedOsDisk with | None -> TraceTags.info "Delete VHDs that were attached to the deleted machine" tags do! deleteBlobs c storage allDiskVhdsUrl (areVmDisksExpectedToExist vm) | Some vmOsDisk -> TraceTags.info "Deleting managed data disks attached to the deleted machine, and its OS disk." tags allManagedDataDisks |> Seq.append [vmOsDisk] |> Seq.map (deleteManagedDisk c c.groupName) |> Async.Parallel |> ignore if options.HasFlag DeleteVmOptions.DeleteAttachedNic then TraceTags.info "Deleting NICs that were attached to deleted machine" tags for nic in allNics.NetworkInterfaces do let nicNameComponents = nic.Id.Split('/') if nicNameComponents.Length > 0 then let nicName = Array.last nicNameComponents let! r = Network.deleteNetworkInterface c c.groupName nicName if not r.Response.IsSuccessStatusCode then TraceTags.error "Could not delete network interface" [ "networkInterace", nic.Id; "statusCode", r.Response.StatusCode.ToString() ] else TraceTags.error "Could not delete network interface: Invalid URI" [ "networkInterace", nic.Id ] } /// Asynchronously delete a VM while keeping its underlying disk VHDs. /// Returns the Azure request Id and the list of VHDs that were attached to the VM. /// There is two level of async: /// - asynchrony of the workflow using F# async {} => the function will not block thread when waiting for intermediate operations to terminate /// - asynchrony of the deletion: the function will return to the caller before the VM is actually deleted. A `RequestId` is returned which can be used by the caller to check the deletion status. /// Almost all our code is aync in the first sense, the suffic `Async` in the function name below indicates asynchrony in the second sense. let deleteVMAsync (c:Context.InfrastructureContext) vmName = async { let tags = c.tags @ [ "name", vmName] TraceTags.info "Deleting VM asynchronoulsy in ARM" tags let! vm = c.compute.VirtualMachines.GetAsync(c.groupName, vmName).AsAsync let disksToDelete = if isNull vm.StorageProfile.OsDisk.ManagedDisk then // For a VM created from VHDs, save the list of VHDs disks for later cleanup // (Azure does not delete VHD files after deleting a VM) Choice1Of2(getAllVmDisks c vm) else // For a VM created form managed images, save the managed osdisk for later cleanup Choice2Of2(c.groupName, vm.StorageProfile.OsDisk.Name) // Request asynchronous deletion of the VM to ARM try let! azureAsyncOperation = c.compute.VirtualMachines.BeginDeleteWithHttpMessagesAsync(c.groupName, vmName).AsAsync TraceTags.info "Deletion of VM successfully requested." (tags@["RequestId", azureAsyncOperation.RequestId]) return azureAsyncOperation.GetAsyncOperationUrl(tags), disksToDelete with e -> return TraceTags.failwithException e "Failed to request deletion of VM." tags } /// Status response of an asynchronous Azure VM operation type AsyncResponse = /// Operation still in progress, need to check again in the specified amount of time | InProgressRetryIn of System.TimeSpan /// Operation completed with the specified status string | CompletedResult of string /// Get result of an asynchronous request /// Return `AsyncResponse.InProgressRetryIn` if operation is still in progress, /// `AsyncResponse.CompletedResult` if it has completed and and throw if an error occurs. let inline private getAsyncRequestResult< ^T when ^T : null> (c:Context.InfrastructureContext) (requestName:string) (asyncRequestUrl:AsyncOperationUrl) = async { let! completionResponse = getAsyncOperationStatusWithOutput< ^T> c.tags c.compute asyncRequestUrl return match completionResponse.Status.Status with | Microsoft.Rest.Azure.AzureAsyncOperation.FailedStatus-> TraceTags.failwith (sprintf "Async operation `%s` failed" requestName) (c.tags @ [ "rawResponseContent", completionResponse.RawResponseContent "error", sprintf "%A" completionResponse.Status.Error "status", sprintf "%A" completionResponse.Status ]) | Microsoft.Rest.Azure.AzureAsyncOperation.CanceledStatus -> TraceTags.failwith (sprintf "Async operation `%s` was cancelled" requestName) (c.tags @ [ "rawResponseContent", completionResponse.RawResponseContent "error", sprintf "%A" completionResponse.Status.Error "status", sprintf "%A" completionResponse.Status ]) | Microsoft.Rest.Azure.AzureAsyncOperation.InProgressStatus -> AsyncResponse.InProgressRetryIn (System.TimeSpan.FromSeconds (float completionResponse.Status.RetryAfter)) | Microsoft.Rest.Azure.AzureAsyncOperation.SuccessStatus -> TraceTags.info (sprintf "Async operation `%s` succeeded" requestName) (c.tags @ [ "rawResponseContent", completionResponse.RawResponseContent "response", (Microsoft.FSharpLu.Json.Compact.serialize completionResponse.Output) "status", (Microsoft.FSharpLu.Json.Compact.serialize completionResponse.Status) ]) AsyncResponse.CompletedResult completionResponse.Status.Status | status -> TraceTags.failwith "Unknown operation status" (c.tags@ ["status", sprintf "%A" status]) } /// Get result of a VM deletion asynchronous request /// Return `AsyncResponse.InProgressRetryIn` if the deletion operation is still in progress, /// `AsyncResponse.CompletedResult` if it has completed and and throw if an error occurs. let getDeleteVmAsyncResult (c:Context.InfrastructureContext) (deleteAsyncRequestUrl:AsyncOperationUrl) = getAsyncRequestResult<AzureAsyncOperation> c "VM deletion" deleteAsyncRequestUrl /// Get result of a VM image capture asynchronous request /// Return `AsyncResponse.InProgressRetryIn` if the capture operation is still in progress, /// `AsyncResponse.CompletedResult` if it has completed and and throw if an error occurs. let getCaptureAsyncResult (c:Context.InfrastructureContext) (captureAsyncRequestUrl:AsyncOperationUrl) = getAsyncRequestResult<AzureOperationResponse<Image>> c "Image capture" captureAsyncRequestUrl /// Private section of the Azure diagnostic specification /// See WAD files tutorial at http://blogs.msdn.com/b/davidhardin/archive/2011/03/29/configuring-wad-via-the-diagnostics-wadcfg-config-file.aspx type AzureDiagnosticConfigPrivate = { storageAccountName : string [<Newtonsoft.Json.JsonIgnore>] getStorageAccountKey : unit -> string storageAccountEndPoint : string } with member x.storageAccountKey with get () = x.getStorageAccountKey() /// Public section of the Azure diagnostic specification type AzureDiagnosticConfigPublic = { /// WadCfg XML config encoded in base 64 xmlCfg : string /// Storage account name where to store the diagnostics StorageAccount : string } /// Azure diagnostic specification type AzureDiagnosticConfig = AzureDiagnosticConfigPublic * AzureDiagnosticConfigPrivate /// Get list of virtual machines deployed in the given resource group let private getVirtualMachine (context:Context.InfrastructureContext) machineName = async { try return! context.compute.VirtualMachines.GetAsync(context.groupName, machineName, expand = Nullable InstanceViewTypes.InstanceView).AsAsync with | IsAggregateOf SomeResourceGroupNotFoundException e -> return raise <| ResourceGroupNotFound(context.groupName, e.Message) | IsAggregateOf SomeResourceNotFoundException e -> return raise <| MachineNotFound(context.groupName, machineName) } // Sets the state of the specified virtual machine to generalized. let generalizeVm (c:Context.InfrastructureContext) vmName = async { let tags = c.tags @ [ "machineName", vmName ] TraceTags.info "Marking VM as generalized" tags try do! c.compute.VirtualMachines.GeneralizeAsync(c.groupName, vmName).AsAsync TraceTags.info "Generalization of VM completed." tags with | e -> return TraceTags.failwithException e "Failed to generalize VM." tags } /// Capture a managed image from the OS disk of a virtual machine. /// Return the capture request Id returned by Azure. let captureOSImageAsync (c:Context.InfrastructureContext) vmName targetResourceGroup capturedImageName = async { let tags = c.tags @ [ "machineName", vmName ] do! generalizeVm c vmName try TraceTags.info "Capturing managed image from VM" tags let! vm = getVirtualMachine c vmName let image = Image ( SourceVirtualMachine = ComputeSubResource(vm.Id), Location = vm.Location, Tags = dict (tags @ ["creationTime", DateTime.UtcNow.ToString("u")]) ) let! captureRequestResponse = c.compute.Images.BeginCreateOrUpdateWithHttpMessagesAsync(targetResourceGroup, capturedImageName, image).AsAsync TraceTags.info "Request submitted to Managed Image API to capture virtual machine." (tags @ [ "machineId", vm.Id "location", vm.Location "targetResourceGroup", targetResourceGroup "capturedImageName", capturedImageName "requestId", captureRequestResponse.RequestId "imageId", captureRequestResponse.Body.Id "response", (Json.Compact.serialize captureRequestResponse.Body) "responseInfo", (sprintf "%A" captureRequestResponse.Response) ]) return captureRequestResponse.Body.Id, captureRequestResponse.GetAsyncOperationUrl(tags) with | e -> return TraceTags.failwithException e "Failed to request image capture of VM." tags } /// Wait for a VHD image capture to complete let waitForCaptureToComplete (c:Context.InfrastructureContext) vmName (captureAsyncRequest:AsyncOperationRequest) (timeout:System.TimeSpan) = async { let! captureCompletion = waitForRequestToCompleteAsync captureAsyncRequest timeout (getAsyncOperationStatusWithOutput<Image> c.tags c.compute) let capturedImage = captureCompletion.Output.Id TraceTags.info "Successfully captured image from VM" (c.tags @ [ "vmName", vmName "capturedImage", capturedImage]) return capturedImage } /// Capture an OS image from a VM, waits for capture to complete and then delete the VM. let captureOSImageAndDeleteVM (c:Context.InfrastructureContext) storage vmName captureTimeout targetResourceGroup capturedImageName deleteVmOptions = async { let! capturedImageId, captureAsyncRequest = captureOSImageAsync c vmName targetResourceGroup capturedImageName let! operationResult = waitForCaptureToComplete c vmName captureAsyncRequest captureTimeout TraceTags.info "Deleting captured VM" (c.tags @ ["machineName", vmName; "asyncResult", operationResult]) do! deleteVM c storage deleteVmOptions vmName return capturedImageId } /// Get list of virtual machines deployed in the given resource group let public getGroupVirtualMachine (context:Context.InfrastructureContext) = async { let! token = Async.CancellationToken try return! enumerateAllPagesAsync context.tags (sprintf "virtual machines under resource group %s" context.groupName) { getFirstPage = fun () -> context.compute.VirtualMachines.ListAsync(context.groupName, token) getNextPage = fun link -> context.compute.VirtualMachines.ListNextAsync(link, token) pageAsList = fun page -> page |> Seq.map (fun vm -> vm.Name) |> Seq.toList getLink = fun page -> page.NextPageLink } with IsAggregateOf SomeResourceGroupNotFoundException e -> TraceTags.info "Resource group not found" (context.tags @ ["resourceGroup", context.groupName]) return [] } /// Get list of managed images in the given resource group let public getManagedImagesByResourceGroup (context:Context.InfrastructureContext) resourceGroupName = async { let! token = Async.CancellationToken try return! enumerateAllPagesAsync context.tags (sprintf "Managed images under resource group %s" resourceGroupName) { getFirstPage = fun () -> context.compute.Images.ListByResourceGroupAsync(resourceGroupName, token) getNextPage = fun link -> context.compute.Images.ListByResourceGroupNextAsync(link, token) pageAsList = fun page -> page |> Seq.toList getLink = fun page -> page.NextPageLink } with IsAggregateOf SomeResourceGroupNotFoundException e -> TraceTags.info "Resource group not found" (context.tags @ ["resourceGroup", context.groupName]) return [] } /// Get a managed image created from a specified VHD in given location and resource group let getManagedImageByOsImage (context: Context.InfrastructureContext) resourceGroupName osImageVhdPath location = async { let tags = context.tags @ [ "osImageVhdPath", osImageVhdPath "resourceGroupName", resourceGroupName "location", location ] try let! images = getManagedImagesByResourceGroup context resourceGroupName let imagesFromOsImage = images |> Seq.tryFind (fun i -> i.StorageProfile.OsDisk.BlobUri.Contains(osImageVhdPath) && i.Location.ToLower() = location) match imagesFromOsImage with | Some targetImage -> TraceTags.info "Found image with matching VHD path, platform and location in the resource group." (tags@[ "targetImage", targetImage.Name]) return targetImage | None -> return TraceTags.failwith "Managed image could not be found for specified VHD path, platform and location under the specified resource group." tags with | :? System.Runtime.Serialization.SerializationException as e -> return TraceTags.failwithException e "Unable to deserialize the response when trying to get a managed image." tags | :? Microsoft.Rest.ValidationException as e -> return TraceTags.failwithException e "Validation failed when trying to get a managed image." tags | :? System.ArgumentNullException as e -> return TraceTags.failwithException e "Failed trying to get a managed image. Some of the passed parameters are null." tags | e -> return TraceTags.failwithException e "Failed to get a managed image with from resource group for the specified OS image, VHD path and location" tags } /// Get a managed image Resource Id by image name let getManagedImageResourceIdByName subscriptionId resourceGroup imageName = sprintf "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/images/%s" subscriptionId resourceGroup imageName /// Get the name and resource group of a managed image by its Resource Id let getManagedImageNameAndResourceGroupById tags (imageResourceId: string) = let imageUri = Uri (Uri Microsoft.FSharpLu.Azure.Constants.management, imageResourceId) match imageUri.Segments |> Seq.toList with | [_; _; _; "resourceGroups/"; resourceGroupName; _; _;"images/"; imageName] -> imageName, resourceGroupName.Replace("/","") | _ -> TraceTags.failwith "Format of managed image resource Id is incorrect." (tags @ [ "imageResourceId", imageResourceId ]) /// Get a managed image with specified Resource Id let tryGetManagedImageByResourceId (context: Context.InfrastructureContext) (imageResourceId:string) = async { let tags = context.tags @ [ "imageResourceId", imageResourceId ] try let imageName, resourceGroupName = getManagedImageNameAndResourceGroupById tags imageResourceId let! image = context.compute.Images.GetAsync(resourceGroupName, imageName).AsAsync if isNull image then return None else TraceTags.info "Found a managed image with matching name in the resource group." tags return Some image with | e -> TraceTags.warning "Failed to retrieve a managed image." (["exception", e.ToString(); "imageResourceId", imageResourceId]@tags) return None } /// Delete a manage image with a specified Resource Id let tryDeleteManagedImage (context:Context.InfrastructureContext) (imageResourceId:string) = async { let tags = context.tags @ ["imageResourceId", imageResourceId "resourceGroup", context.groupName ] try let imageName, resourceGroupName = getManagedImageNameAndResourceGroupById tags imageResourceId let! image = tryGetManagedImageByResourceId context imageResourceId match image with | None -> TraceTags.warning "Managed image was not found, and thus could not be deleted." tags | Some _ -> do! context.compute.Images.DeleteAsync(resourceGroupName, imageName).AsAsync TraceTags.info "Deletion of managed image completed." tags return image with | e -> return TraceTags.failwithException e "Failed deleting a managed image." tags } /// Wait until a given condition is met for the specified VM role instance let vmSatisfiesPredicate (predicate : VirtualMachine -> bool) (context:Context.InfrastructureContext) machineName = async { let! vm = getVirtualMachine context machineName return predicate vm } /// Checks whether a virtual machine with specified name exists under given resource group let vmExists (context:Context.InfrastructureContext) machineName = async { try let! vm = context.compute.VirtualMachines.GetAsync(context.groupName, machineName).AsAsync return true with | IsAggregateOf SomeResourceNotFoundException e | IsAggregateOf SomeNotFoundException e -> return false } /// Polling functions module WaitUntil = /// Wait until a VM exists if untilVmExist is true /// or until it disappear if untilVmExist is false let rec private waitUntilVmExistence untilVmExist (context:Context.InfrastructureContext) machineName = async { let! vmExists = vmExists context machineName if vmExists <> untilVmExist then do! Async.Sleep (int Request.Constants.PollingInterval.TotalMilliseconds) do! waitUntilVmExistence untilVmExist context machineName } let vmExists = waitUntilVmExistence true let vmRemoved = waitUntilVmExistence false /// Wait until a given condition is met for the specified VM role instance let rec private waitUntilVmCondition (condition:VirtualMachine -> bool) (context:Context.InfrastructureContext) machineName = async { let! predicateSatisfied = vmSatisfiesPredicate condition context machineName if predicateSatisfied then return () else do! Async.Sleep (int Request.Constants.PollingInterval.TotalMilliseconds) return! waitUntilVmCondition condition context machineName } /// Wait until a given condition is met for the specified VM role instance or the specified timeout expires let private waitUntilVmConditionTimeout condition desiredStateDescription context machineName (timeout:System.TimeSpan) timeoutOption = async { let waitTask = waitUntilVmCondition condition context machineName let! waitHandle = if timeout <= System.TimeSpan.Zero then Async.StartChild(waitTask) else Async.StartChild(waitTask, (int timeout.TotalMilliseconds)) try do! waitHandle return true with :? System.TimeoutException -> match timeoutOption with | ThrowOnTimeout -> TraceTags.error "Timed-out while waiting for machine to reach desired state." (context.tags @ [ "machineName", machineName "desiredStateDescription", desiredStateDescription "timeout", timeout.ToString() ]) return raise <| System.TimeoutException(sprintf "Machine %s was not %s after %O." machineName desiredStateDescription timeout) | Return -> TraceTags.info "Machine has not reached the desired state in the exepcted time." (context.tags @ [ "machineName", machineName "desiredStateDescription", desiredStateDescription "timeout", timeout.ToString() ]) return false } open InternalPredicates /// Asynchronously wait until the specified VM is ready or a timeout occurs let vmIsReadyTimeout context machineName (timeout:System.TimeSpan) timeoutOption = waitUntilVmConditionTimeout vmIsReady "ready" context machineName timeout timeoutOption /// Asynchronously wait until the specified VM is stopped or a timeout occurs let vmIsStoppedTimeout context machineName (timeout:System.TimeSpan) timeoutOption = waitUntilVmConditionTimeout vmIsStopped "stopped" context machineName timeout timeoutOption /// Asynchronously wait until the specified VM is stopped let vmIsStopped context machineName = waitUntilVmCondition vmIsStopped context machineName /// Returns true if the specified machine is ready or is not found /// Throws ResourceGroupNotFound exception if the VM was part of a ResourceGroup that was deleted let public isVMReady context machineName = vmSatisfiesPredicate InternalPredicates.vmIsReady context machineName let public isVMStoppedOrDeleted context machineName = async { try return! vmSatisfiesPredicate InternalPredicates.vmIsStopped context machineName with :? MachineNotFound -> TraceTags.warning "Machine not found exception." (context.tags @ [ "Machine Name", machineName "Method", "isVMStoppedOrDeleted"]) return true } /// Download a VHD image from Azure let downloadVhd tags (storage:BlobStorageContext) vhdUri toDirectory = async { let uri = Uri(vhdUri) let filename = uri.Segments |> Seq.last TraceTags.info "Downloading VHD from storage blob" (tags @ [ "filename", filename "vhdUri", vhdUri]) let! blob = storage.client.GetBlobReferenceFromServerAsync(uri).AsAsync // copy blob from cloud to local gallery let target = System.IO.Path.Combine(toDirectory, filename) do! blob.DownloadToFileAsync(target, System.IO.FileMode.CreateNew).AsAsync () } /// Stop a VM, capture the OS image as a managed image, wait for the capture to complete and delete the VM. /// Returns the absolute URI to the captured image. /// /// CAUTION: Capture will fail if the machine is in the middle of a shutdown that was initiated /// from within the VM. (Even though the code below specifically stops the VM using the Azure API) /// If this is the case then the caller should call waitUntilVmIsStopped before /// calling this function. let stopVMCaptureOSImageDeleteVM context storage vmName captureTimeout targetResourceGroup capturedImageName deleteVmOptions = async { let tags = context.tags @ ["vmName", vmName] TraceTags.info "Powering off the machine from Azure" tags do! stopVM context vmName TraceTags.info "Waiting until machine has stopped before capture" tags do! WaitUntil.vmIsStopped context vmName TraceTags.info "Capturing machine" tags let! capturedVhdUri = captureOSImageAndDeleteVM context storage vmName captureTimeout targetResourceGroup capturedImageName deleteVmOptions return capturedVhdUri } /// Information required to remotely connect to a VM, returned by getVirtualMachineRemoteInfo type VirtualMachineRemoteInfo = { DnsName: string IpAddress: string Port: int } /// Retrieve frontend IP address, DNS name and port number mapping to the specified virtual machine and port number let getVirtualMachineRemoteInfo(context:InfrastructureContext) vmName vmPort = async { let! vmRequest = context.compute.VirtualMachines.GetWithHttpMessagesAsync(context.groupName, vmName).AsAsync let vm = vmRequest.Body assertStatusCodeIs context.tags System.Net.HttpStatusCode.OK vmRequest.Response.StatusCode "Could not retrieve VM resource information." let networkInterfaceGroup, networkInterfaceName = match vm.NetworkProfile.NetworkInterfaces.[0].Id.Split([|'/'|]) |> Seq.toList |> List.rev with | n::"networkInterfaces"::"Microsoft.Network"::"providers"::g::"resourceGroups"::_ -> g, n | _ -> TraceTags.failwith "Incorrect network interface URI format" context.tags let token = Threading.CancellationToken() let! net = context.network.NetworkInterfaces.GetWithHttpMessagesAsync(networkInterfaceGroup, networkInterfaceName, cancellationToken = token).AsAsync assertStatusCodeIs context.tags System.Net.HttpStatusCode.OK net.Response.StatusCode "Could not get network interface." let loadBalancerGroup, loadBalancerName, loadBalancerRule = // For simplicity we assume that all the rules associated with the network interface // belong to the same load balancer. match net.Body.IpConfigurations.[0].LoadBalancerInboundNatRules.[0].Id.Split([|'/'|]) |> Seq.toList |> List.rev with | z::"inboundNatRules"::y::"loadBalancers"::"Microsoft.Network"::"providers"::x::"resourceGroups"::_ -> x, y, z | _ -> TraceTags.failwith "Incorrect load balancer URI format" context.tags let vmIpConfigId = net.Body.IpConfigurations.[0].Id let! lb = context.network.LoadBalancers.GetWithHttpMessagesAsync(loadBalancerGroup, loadBalancerName, cancellationToken = token).AsAsync assertStatusCodeIs context.tags System.Net.HttpStatusCode.OK lb.Response.StatusCode "Cannot find specified load balancer" // Get the load balancer rule mapping to the requested port let rule = lb.Body.InboundNatRules |> Seq.tryFind (fun r -> r.BackendPort.HasValue && r.BackendPort.Value = vmPort && r.BackendIPConfiguration.Id = vmIpConfigId) |> Option.orDo (fun () -> TraceTags.failwith "Cannot find load balancer rule with requested backend port number" context.tags) // Get public IP address of the load balancer let publicIpResourceGroup, publicIpName = match lb.Body.FrontendIPConfigurations |> Seq.toList with | [] -> TraceTags.failwith "Frontend IP configuration missing" context.tags | fip::_ -> match fip.PublicIPAddress.Id.Split([|'/'|]) |> Seq.toList |> List.rev with | n::"publicIPAddresses"::"Microsoft.Network"::"providers"::g::"resourceGroups"::_ -> g,n | _ -> TraceTags.failwith "Incorrect public IP URI format" context.tags let! publicIps = context.network.PublicIPAddresses.GetWithHttpMessagesAsync(publicIpResourceGroup, publicIpName, cancellationToken = token).AsAsync assertStatusCodeIs context.tags System.Net.HttpStatusCode.OK publicIps.Response.StatusCode "Cannot find public IP for load balancer" /// Retrieve the frontend port number that maps to the requested backend port let frontendPort = rule.FrontendPort.GetValueOrDefault vmPort let dnsname = publicIps.Body.DnsSettings.Fqdn let ipAddress = publicIps.Body.IpAddress return { IpAddress = ipAddress DnsName = dnsname Port = frontendPort } } /// Get RDP Remote Desktop connection file. /// Generate RDP file according to Public IP and Load balancer rule configuration let getRemoteDesktopFile (context:InfrastructureContext) vmName username = let VirtualMachineRdpPort = 3389 // The "Download RDP File" API from RDFE (https://msdn.microsoft.com/library/azure/jj157183.aspx) does not exist in ARM // so we have to implement in ourselves by quering the port number and public DNS address from the load // balancer using Azure ARM API. // See question posted on Yammer: https://www.yammer.com/microsoft.com/#/threads/inGroup?type=in_group&feedId=4716407 async { let! remoteInfo = getVirtualMachineRemoteInfo context vmName VirtualMachineRdpPort // Generate .RDP file content let content = sprintf """ full address:s:%s:%d prompt for credentials:i:1 username:s:%s """ remoteInfo.DnsName remoteInfo.Port username return System.Text.Encoding.ASCII.GetBytes(content) } /// Create a new certificate and upload it to the vault associated with the specified resource group. /// The vault is created if it does not already exist. /// Return the URL to the certificate in the vault /// NOTES: REQUIRES ADMIN RIGHTS AND ELEVATION. For this reason it cannot be called from an Azure Website let createRdpCertificateInAzureVault (azure:Auth.Subscription) (resourceGroup:string) vaultName (certificate:System.Security.Cryptography.X509Certificates.X509Certificate2) (certificatePassword:string) = async { use c = Context.createVaultContext azure.Authentication let vaultUrl = sprintf "https://%s.vault.azure.net/" vaultName let secretName = Constants.CertificateKeyNamePrefix + resourceGroup.Replace("_","") try let! secret = c.GetSecretAsync(vaultUrl, secretName).AsAsync return secret.Id with | :? System.AggregateException as e when (e.InnerException :? Models.KeyVaultErrorException) && (e.InnerException :?> Models.KeyVaultErrorException).Response.StatusCode = System.Net.HttpStatusCode.NotFound -> let vaultEntryEncoded = let contentType = Security.Cryptography.X509Certificates.X509ContentType.Pfx let privateKeyEncoded = let privateKeyBytes : byte[] = certificate.Export(contentType, certificatePassword) : byte[] System.Convert.ToBase64String(privateKeyBytes) sprintf """{ "data": "%s", "dataType" :"pfx", "password": "%s"}""" privateKeyEncoded certificatePassword |> System.Text.Encoding.UTF8.GetBytes |> System.Convert.ToBase64String // Load certificate in vault let! vaultEntry = c.SetSecretAsync(vaultUrl, secretName, vaultEntryEncoded).AsAsync return vaultEntry.Id } /// Deletes the specified virtual machine extension /// Returns true if the extension was found and deleted and false if not found let deleteVmExtensionIfExists (context:InfrastructureContext) machineName customExtensionName = async{ try let! token = Async.CancellationToken do! context.compute.VirtualMachineExtensions.DeleteAsync(context.groupName, machineName, customExtensionName, token) |> Async.AwaitTask |> Async.Ignore return true with | IsAggregateOf SomeResourceNotFoundException e -> TraceTags.info "Extension not found for specifed machine" (context.tags @ [ "customExtensionName", customExtensionName "machineName", machineName "resourceGroup", context.groupName ]) return false } /// Create an Azure managed disk image from the OS disk of an existing OS image and a managed data disk /// The source image and managed disk are assumed to be in the same resource group. let createImageFromManagedOSImageAndDataManagedDisk (c:InfrastructureContext) vmName sourceResourceGroup sourceImageName dataManagedDiskName targetResourceGroup targetImageName = async { try TraceTags.info "Attaching data disk to managed image." (c.tags @ [ "image", vmName "sourceResourceGroup", sourceResourceGroup "sourceImageName", sourceImageName "targetResourceGroup", targetResourceGroup "targetImageName", targetImageName "dataManagedDiskName", dataManagedDiskName ]) let! sourceImage = c.compute.Images.GetAsync(sourceResourceGroup, sourceImageName).AsAsync let! dataManagedDisk = c.compute.Disks.GetAsync(sourceResourceGroup, dataManagedDiskName).AsAsync let parameters = Image( Location = sourceImage.Location, StorageProfile = ImageStorageProfile( OsDisk = ImageOSDisk( OsState = OperatingSystemStateTypes.Generalized, OsType = sourceImage.StorageProfile.OsDisk.OsType, BlobUri = sourceImageName ), DataDisks = [| ImageDataDisk(Lun=1, ManagedDisk = ComputeSubResource(Id = dataManagedDisk.Id)) |] ), Tags = dict ["creationTime", DateTime.UtcNow.ToString("u")] ) let! requestResponse = c.compute.Images.BeginCreateOrUpdateWithHttpMessagesAsync(targetResourceGroup, targetImageName, parameters).AsAsync TraceTags.info "Requested creation of a managed image from an existing disk image" (c.tags @ [ "sourceResourceGroup", sourceResourceGroup "sourceImageName", sourceImageName "targetResourceGroup", targetResourceGroup "targetImageName", targetImageName "dataManagedDiskName", dataManagedDiskName "location", sourceImage.Location "requestId", requestResponse.RequestId "imageId", requestResponse.Body.Id "response", (Json.Compact.serialize requestResponse.Body) "responseInfo", (sprintf "%A" requestResponse.Response) ]) return requestResponse.Body.Id, requestResponse.GetAsyncOperationUrl(c.tags) with | e -> return TraceTags.failwithException e "Failed to request image creation." (c.tags @ [ "sourceResourceGroup", sourceResourceGroup "sourceImageName", sourceImageName "targetResourceGroup", targetResourceGroup "targetImageName", targetImageName ]) } /// Update VM scaleset capacity let setVmScaleSetCapacityAsync (c:Context.InfrastructureContext) resourceGroupName vmScaleSetName (capacity:int) = async { let tags = c.tags @ [ "resourceGroupName", resourceGroupName "vmScaleSetName", vmScaleSetName "capacity", capacity.ToString() ] TraceTags.info "Updating capacity for VM ScaleSet" tags try let! scaleSet = c.compute.VirtualMachineScaleSets.GetAsync(resourceGroupName, vmScaleSetName) |> Async.AwaitTask scaleSet.Sku.Capacity <- Nullable <| int64 capacity let! azureAsyncOperation = c.compute.VirtualMachineScaleSets.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, scaleSet).AsAsync TraceTags.info "Submitted request to update VM scale set capacity." (tags @ ["requestId", azureAsyncOperation.RequestId]) return azureAsyncOperation.GetAsyncOperationUrl(tags) with | IsAggregateOf AnyCloudError error as e -> return TraceTags.failwithException e "Failed to update capacity for VM ScaleSet. (CloudException error)" (tags@["CloudErroCode", error.Code; "CloudErrorMessage", error.Message]) | e -> return TraceTags.failwithException e "Failed to update capacity for VM ScaleSet. (Exception)" tags } /// Gets the result of a VM scale set update request. /// Return None if capture is still in progress, the URI path to the VHD if the capture has completed, /// and throw if an error occurs. let getVMScaleSetUpdateResult (context:Context.InfrastructureContext) (azureAsyncOperationUrl:AsyncOperationUrl) = async { // See https://github.com/Azure/azure-sdk-for-net/blob/master/src/SdkCommon/ClientRuntime.Azure/ClientRuntime.Azure/CommonModels/AzureAsyncOperation.cs // for details of the AzureAsyncOperation type. let! completionResponse = getAsyncOperationStatusWithOutput<AzureAsyncOperation> context.tags context.compute azureAsyncOperationUrl let returnValue = match completionResponse.Status.Status with | Microsoft.Rest.Azure.AzureAsyncOperation.SuccessStatus -> TraceTags.info "Successfully updated VM Scale Set." (context.tags @ [ "output", completionResponse.Output.ToString() ]) OperationStatus.Succeeded completionResponse.Status | Microsoft.Rest.Azure.AzureAsyncOperation.InProgressStatus -> OperationStatus.InProgress | Microsoft.Rest.Azure.AzureAsyncOperation.FailedStatus | Microsoft.Rest.Azure.AzureAsyncOperation.CanceledStatus -> let cloudError = if not (isNull completionResponse.Output) && not (isNull completionResponse.Output.Error) then printCloudError completionResponse.Output.Error 0 else "null" TraceTags.error "Failed to update VM Scale Set." (context.tags @ [ "status", completionResponse.Status.Status "RawResponseContent", completionResponse.RawResponseContent "cloudError", cloudError]) OperationStatus.Failed (completionResponse.Status, cloudError) | status -> TraceTags.error "VM Scale Set update returned an unknown operation status." (context.tags @[ "status", status ]) OperationStatus.Undetermined (completionResponse.Status, azureAsyncOperationUrl) return returnValue }
{ "pile_set_name": "Github" }
# # (C) Copyright 2000-2007 # Wolfgang Denk, DENX Software Engineering, wd@denx.de. # # See file CREDITS for list of people who contributed to this # project. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # include $(TOPDIR)/config.mk LIB := $(obj)libusb_musb.a COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o COBJS-$(CONFIG_MUSB_UDC) += musb_udc.o musb_core.o COBJS-$(CONFIG_USB_BLACKFIN) += blackfin_usb.o COBJS-$(CONFIG_USB_DAVINCI) += davinci.o COBJS-$(CONFIG_USB_OMAP3) += omap3.o COBJS-$(CONFIG_USB_DA8XX) += da8xx.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) all: $(LIB) $(LIB): $(obj).depend $(OBJS) $(AR) $(ARFLAGS) $@ $(OBJS) ######################################################################### # defines $(obj).depend target include $(SRCTREE)/rules.mk sinclude $(obj).depend #########################################################################
{ "pile_set_name": "Github" }
libtcmalloc_minimal_la-internal_logging.lo \ libtcmalloc_minimal_la-internal_logging.o: src/internal_logging.cc \ /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/gnu/stubs.h \ /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.2/include/stddef.h \ /usr/include/bits/types.h /usr/include/bits/wordsize.h \ /usr/include/bits/typesizes.h /usr/include/libio.h \ /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ /usr/include/gconv.h \ /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.2/include/stdarg.h \ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ /usr/include/bits/stdio.h /usr/include/string.h /usr/include/xlocale.h \ src/internal_logging.h src/config.h /usr/include/stdlib.h \ /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ /usr/include/endian.h /usr/include/bits/endian.h \ /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/bits/sigset.h \ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ /usr/include/alloca.h /usr/include/unistd.h \ /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/stdio.h: /usr/include/features.h: /usr/include/sys/cdefs.h: /usr/include/gnu/stubs.h: /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.2/include/stddef.h: /usr/include/bits/types.h: /usr/include/bits/wordsize.h: /usr/include/bits/typesizes.h: /usr/include/libio.h: /usr/include/_G_config.h: /usr/include/wchar.h: /usr/include/bits/wchar.h: /usr/include/gconv.h: /usr/local/lib/gcc/i686-pc-linux-gnu/4.0.2/include/stdarg.h: /usr/include/bits/stdio_lim.h: /usr/include/bits/sys_errlist.h: /usr/include/bits/stdio.h: /usr/include/string.h: /usr/include/xlocale.h: src/internal_logging.h: src/config.h: /usr/include/stdlib.h: /usr/include/bits/waitflags.h: /usr/include/bits/waitstatus.h: /usr/include/endian.h: /usr/include/bits/endian.h: /usr/include/sys/types.h: /usr/include/time.h: /usr/include/sys/select.h: /usr/include/bits/select.h: /usr/include/bits/sigset.h: /usr/include/bits/time.h: /usr/include/sys/sysmacros.h: /usr/include/bits/pthreadtypes.h: /usr/include/bits/sched.h: /usr/include/alloca.h: /usr/include/unistd.h: /usr/include/bits/posix_opt.h: /usr/include/bits/environments.h: /usr/include/bits/confname.h: /usr/include/getopt.h:
{ "pile_set_name": "Github" }
[defaults] roles_path = ../
{ "pile_set_name": "Github" }
/* * Copyright (c) 2010, 2018, 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.javafx.application; import static com.sun.javafx.FXPermissions.CREATE_TRANSPARENT_WINDOW_PERMISSION; import com.sun.javafx.PlatformUtil; import com.sun.javafx.css.StyleManager; import com.sun.javafx.tk.TKListener; import com.sun.javafx.tk.TKStage; import com.sun.javafx.tk.Toolkit; import com.sun.javafx.util.ModuleHelper; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Predicate; import javafx.application.Application; import javafx.application.ConditionalFeature; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.scene.Scene; import javafx.util.FXPermission; public class PlatformImpl { private static AtomicBoolean initialized = new AtomicBoolean(false); private static AtomicBoolean platformExit = new AtomicBoolean(false); private static AtomicBoolean toolkitExit = new AtomicBoolean(false); private static CountDownLatch startupLatch = new CountDownLatch(1); private static AtomicBoolean listenersRegistered = new AtomicBoolean(false); private static TKListener toolkitListener = null; private static volatile boolean implicitExit = true; private static boolean taskbarApplication = true; private static boolean contextual2DNavigation; private static AtomicInteger pendingRunnables = new AtomicInteger(0); private static AtomicInteger numWindows = new AtomicInteger(0); private static volatile boolean firstWindowShown = false; private static volatile boolean lastWindowClosed = false; private static AtomicBoolean reallyIdle = new AtomicBoolean(false); private static Set<FinishListener> finishListeners = new CopyOnWriteArraySet<FinishListener>(); private final static Object runLaterLock = new Object(); private static Boolean isGraphicsSupported; private static Boolean isControlsSupported; private static Boolean isMediaSupported; private static Boolean isWebSupported; private static Boolean isSWTSupported; private static Boolean isSwingSupported; private static Boolean isFXMLSupported; private static Boolean hasTwoLevelFocus; private static Boolean hasVirtualKeyboard; private static Boolean hasTouch; private static Boolean hasMultiTouch; private static Boolean hasPointer; private static boolean isThreadMerged = false; private static String applicationType = ""; private static BooleanProperty accessibilityActive = new SimpleBooleanProperty(); private static CountDownLatch allNestedLoopsExitedLatch = new CountDownLatch(1); private static final boolean verbose = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> Boolean.getBoolean("javafx.verbose")); private static final boolean DEBUG = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> Boolean.getBoolean("com.sun.javafx.application.debug")); // Internal permission used by FXCanvas (SWT interop) private static final FXPermission FXCANVAS_PERMISSION = new FXPermission("accessFXCanvasInternals"); /** * Set a flag indicating whether this application should show up in the * task bar. The default value is true. * * @param taskbarApplication the new value of this attribute */ public static void setTaskbarApplication(boolean taskbarApplication) { PlatformImpl.taskbarApplication = taskbarApplication; } /** * Returns the current value of the taskBarApplication flag. * * @return the current state of the flag. */ public static boolean isTaskbarApplication() { return taskbarApplication; } /** * Sets the name of the this application based on the Application class. * This method is called by the launcher, and is not * called from the FX Application Thread, so we need to do it in a runLater. * We do not need to wait for the result since it will complete before the * Application start() method is called regardless. * * @param appClass the Application class. */ public static void setApplicationName(final Class appClass) { runLater(() -> com.sun.glass.ui.Application.GetApplication().setName(appClass.getName())); } /** * Return whether or not focus navigation between controls is context- * sensitive. * @return true if the context-sensitive algorithm for focus navigation is * used */ public static boolean isContextual2DNavigation() { return contextual2DNavigation; } /** * This method is invoked typically on the main thread. At this point, * the JavaFX Application Thread has not been started. Any attempt * to call startup more than once results in all subsequent calls turning into * nothing more than a runLater call with the provided Runnable being called. * @param r */ public static void startup(final Runnable r) { startup(r, false); } /** * This method is invoked typically on the main thread. At this point, * the JavaFX Application Thread has not been started. If preventDuplicateCalls * is true, calling this method multiple times will result in an * IllegalStateException. If it is false, calling this method multiple times * will result in all subsequent calls turning into * nothing more than a runLater call with the provided Runnable being called. * @param r * @param preventDuplicateCalls */ public static void startup(final Runnable r, boolean preventDuplicateCalls) { // NOTE: if we ever support re-launching an application and/or // launching a second application in the same VM/classloader // this will need to be changed. if (platformExit.get()) { throw new IllegalStateException("Platform.exit has been called"); } if (initialized.getAndSet(true)) { if (preventDuplicateCalls) { throw new IllegalStateException("Toolkit already initialized"); } // If we've already initialized, just put the runnable on the queue. runLater(r); return; } AccessController.doPrivileged((PrivilegedAction<Void>) () -> { applicationType = System.getProperty("com.sun.javafx.application.type"); if (applicationType == null) applicationType = ""; contextual2DNavigation = Boolean.getBoolean( "com.sun.javafx.isContextual2DNavigation"); String s = System.getProperty("com.sun.javafx.twoLevelFocus"); if (s != null) { hasTwoLevelFocus = Boolean.valueOf(s); } s = System.getProperty("com.sun.javafx.virtualKeyboard"); if (s != null) { if (s.equalsIgnoreCase("none")) { hasVirtualKeyboard = false; } else if (s.equalsIgnoreCase("javafx")) { hasVirtualKeyboard = true; } else if (s.equalsIgnoreCase("native")) { hasVirtualKeyboard = true; } } s = System.getProperty("com.sun.javafx.touch"); if (s != null) { hasTouch = Boolean.valueOf(s); } s = System.getProperty("com.sun.javafx.multiTouch"); if (s != null) { hasMultiTouch = Boolean.valueOf(s); } s = System.getProperty("com.sun.javafx.pointer"); if (s != null) { hasPointer = Boolean.valueOf(s); } s = System.getProperty("javafx.embed.singleThread"); if (s != null) { isThreadMerged = Boolean.valueOf(s); if (isThreadMerged && !isSupported(ConditionalFeature.SWING)) { isThreadMerged = false; if (verbose) { System.err.println( "WARNING: javafx.embed.singleThread ignored (javafx.swing module not found)"); } } } return null; }); if (DEBUG) { System.err.println("PlatformImpl::startup : applicationType = " + applicationType); } if ("FXCanvas".equals(applicationType)) { initFXCanvas(); } if (!taskbarApplication) { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { System.setProperty("glass.taskbarApplication", "false"); return null; }); } // Create Toolkit listener and register it with the Toolkit. // Call notifyFinishListeners when we get notified. toolkitListener = new TKListener() { @Override public void changedTopLevelWindows(List<TKStage> windows) { numWindows.set(windows.size()); checkIdle(); } @Override public void exitedLastNestedLoop() { if (platformExit.get()) { allNestedLoopsExitedLatch.countDown(); } checkIdle(); } }; Toolkit.getToolkit().addTkListener(toolkitListener); Toolkit.getToolkit().startup(() -> { startupLatch.countDown(); r.run(); }); //Initialize the thread merging mechanism if (isThreadMerged) { installFwEventQueue(); } } // Pass certain system properties to glass via the device details Map private static void initDeviceDetailsFXCanvas() { // Read the javafx.embed.eventProc system property and store // it in an entry in the glass Application device details map final String eventProcProperty = "javafx.embed.eventProc"; final long eventProc = AccessController.doPrivileged((PrivilegedAction<Long>) () -> Long.getLong(eventProcProperty, 0)); if (eventProc != 0L) { // Set the value for the javafx.embed.eventProc // key in the glass Application map Map map = com.sun.glass.ui.Application.getDeviceDetails(); if (map == null) { map = new HashMap(); com.sun.glass.ui.Application.setDeviceDetails(map); } if (map.get(eventProcProperty) == null) { map.put(eventProcProperty, eventProc); } } } // Add the necessary qualified exports to the calling module private static void addExportsToFXCanvas(Class<?> fxCanvasClass) { final String[] swtNeededPackages = { "com.sun.glass.ui", "com.sun.javafx.cursor", "com.sun.javafx.embed", "com.sun.javafx.stage", "com.sun.javafx.tk" }; if (DEBUG) { System.err.println("addExportsToFXCanvas: class = " + fxCanvasClass); } Object thisModule = ModuleHelper.getModule(PlatformImpl.class); Object javafxSwtModule = ModuleHelper.getModule(fxCanvasClass); for (String pkg : swtNeededPackages) { if (DEBUG) { System.err.println("add export of " + pkg + " from " + thisModule + " to " + javafxSwtModule); } ModuleHelper.addExports(thisModule, pkg, javafxSwtModule); } } // FXCanvas-specific initialization private static void initFXCanvas() { // Verify that we have the appropriate permission final SecurityManager sm = System.getSecurityManager(); if (sm != null) { try { sm.checkPermission(FXCANVAS_PERMISSION); } catch (SecurityException ex) { System.err.println("FXCanvas: no permission to access JavaFX internals"); ex.printStackTrace(); return; } } // Find the calling class, ignoring any stack frames from FX application classes Predicate<StackWalker.StackFrame> classFilter = f -> !f.getClassName().startsWith("javafx.application.") && !f.getClassName().startsWith("com.sun.javafx.application."); final StackWalker walker = AccessController.doPrivileged((PrivilegedAction<StackWalker>) () -> StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE)); Optional<StackWalker.StackFrame> frame = walker.walk( s -> s.filter(classFilter).findFirst()); if (frame.isPresent()) { Class<?> caller = frame.get().getDeclaringClass(); if (DEBUG) { System.err.println("callerClassName = " + caller); } // Verify that the caller is javafx.embed.swt.FXCanvas if ("javafx.embed.swt.FXCanvas".equals(caller.getName())) { initDeviceDetailsFXCanvas(); addExportsToFXCanvas(caller); } } } private static void installFwEventQueue() { invokeSwingFXUtilsMethod("installFwEventQueue"); } private static void removeFwEventQueue() { invokeSwingFXUtilsMethod("removeFwEventQueue"); } private static void invokeSwingFXUtilsMethod(final String methodName) { //Use reflection in case we are running compact profile try { Class swingFXUtilsClass = Class.forName("com.sun.javafx.embed.swing.SwingFXUtilsImpl"); Method installFwEventQueue = swingFXUtilsClass.getDeclaredMethod(methodName); waitForStart(); installFwEventQueue.invoke(null); } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException e) { throw new RuntimeException("Property javafx.embed.singleThread is not supported"); } catch (InvocationTargetException e) { throw new RuntimeException(e); } } private static void waitForStart() { // If the startup runnable has not yet been called, then wait it. // Note that we check the count before calling await() to avoid // the try/catch which is unnecessary after startup. if (startupLatch.getCount() > 0) { try { startupLatch.await(); } catch (InterruptedException ex) { ex.printStackTrace(); } } } public static boolean isFxApplicationThread() { return Toolkit.getToolkit().isFxUserThread(); } public static void runLater(final Runnable r) { runLater(r, false); } private static void runLater(final Runnable r, boolean exiting) { if (!initialized.get()) { throw new IllegalStateException("Toolkit not initialized"); } pendingRunnables.incrementAndGet(); waitForStart(); synchronized (runLaterLock) { if (!exiting && toolkitExit.get()) { // Don't schedule a runnable after we have exited the toolkit pendingRunnables.decrementAndGet(); return; } final AccessControlContext acc = AccessController.getContext(); // Don't catch exceptions, they are handled by Toolkit.defer() Toolkit.getToolkit().defer(() -> { try { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { r.run(); return null; }, acc); } finally { pendingRunnables.decrementAndGet(); checkIdle(); } }); } } public static void runAndWait(final Runnable r) { runAndWait(r, false); } private static void runAndWait(final Runnable r, boolean exiting) { if (isFxApplicationThread()) { try { r.run(); } catch (Throwable t) { System.err.println("Exception in runnable"); t.printStackTrace(); } } else { final CountDownLatch doneLatch = new CountDownLatch(1); runLater(() -> { try { r.run(); } finally { doneLatch.countDown(); } }, exiting); if (!exiting && toolkitExit.get()) { throw new IllegalStateException("Toolkit has exited"); } try { doneLatch.await(); } catch (InterruptedException ex) { ex.printStackTrace(); } } } public static void setImplicitExit(boolean implicitExit) { PlatformImpl.implicitExit = implicitExit; checkIdle(); } public static boolean isImplicitExit() { return implicitExit; } public static void addListener(FinishListener l) { listenersRegistered.set(true); finishListeners.add(l); } public static void removeListener(FinishListener l) { finishListeners.remove(l); listenersRegistered.set(!finishListeners.isEmpty()); if (!listenersRegistered.get()) { checkIdle(); } } private static void notifyFinishListeners(boolean exitCalled) { // Notify listeners if any are registered, else exit directly if (listenersRegistered.get()) { for (FinishListener l : finishListeners) { if (exitCalled) { l.exitCalled(); } else { l.idle(implicitExit); } } } else if (implicitExit || platformExit.get()) { tkExit(); } } // Check for idle, meaning the last top-level window has been closed and // there are no pending Runnables waiting to be run. private static void checkIdle() { // If we aren't initialized yet, then this method is a no-op. if (!initialized.get()) { return; } if (!isFxApplicationThread()) { // Add a dummy runnable to the runLater queue, which will then call // checkIdle() on the FX application thread. runLater(() -> { }); return; } boolean doNotify = false; synchronized (PlatformImpl.class) { int numWin = numWindows.get(); if (numWin > 0) { firstWindowShown = true; lastWindowClosed = false; reallyIdle.set(false); } else if (numWin == 0 && firstWindowShown) { lastWindowClosed = true; } // In case there is an event in process, allow for it to show // another window. If no new window is shown before all pending // runnables (including this one) are done and there is no running // nested loops, then we will shutdown. if (lastWindowClosed && pendingRunnables.get() == 0 && (toolkitExit.get() || !Toolkit.getToolkit().isNestedLoopRunning())) { // System.err.println("Last window closed and no pending runnables"); if (reallyIdle.getAndSet(true)) { // System.err.println("Really idle now"); doNotify = true; lastWindowClosed = false; } else { // System.err.println("Queuing up a dummy idle check runnable"); runLater(() -> { // System.err.println("Dummy runnable"); }); } } } if (doNotify) { notifyFinishListeners(false); } } // package scope method for testing private static final CountDownLatch platformExitLatch = new CountDownLatch(1); static CountDownLatch test_getPlatformExitLatch() { return platformExitLatch; } public static void tkExit() { if (toolkitExit.getAndSet(true)) { return; } if (initialized.get()) { if (platformExit.get()) { PlatformImpl.runAndWait(() -> { if (Toolkit.getToolkit().isNestedLoopRunning()) { Toolkit.getToolkit().exitAllNestedEventLoops(); } else { allNestedLoopsExitedLatch.countDown(); } }, true); try { allNestedLoopsExitedLatch.await(); } catch (InterruptedException e) { throw new RuntimeException("Could not exit all nested event loops"); } } // Always call toolkit exit on FX app thread // System.err.println("PlatformImpl.tkExit: scheduling Toolkit.exit"); PlatformImpl.runAndWait(() -> { // System.err.println("PlatformImpl.tkExit: calling Toolkit.exit"); Toolkit.getToolkit().exit(); }, true); if (isThreadMerged) { removeFwEventQueue(); } Toolkit.getToolkit().removeTkListener(toolkitListener); toolkitListener = null; platformExitLatch.countDown(); } } public static BooleanProperty accessibilityActiveProperty() { return accessibilityActive; } public static void exit() { platformExit.set(true); notifyFinishListeners(true); } private static Boolean checkForClass(String classname) { try { Class.forName(classname, false, PlatformImpl.class.getClassLoader()); return Boolean.TRUE; } catch (ClassNotFoundException cnfe) { return Boolean.FALSE; } } public static boolean isSupported(ConditionalFeature feature) { final boolean supported = isSupportedImpl(feature); if (supported && (feature == ConditionalFeature.TRANSPARENT_WINDOW)) { // some features require the application to have the corresponding // permissions, if the application doesn't have them, the platform // will behave as if the feature wasn't supported final SecurityManager securityManager = System.getSecurityManager(); if (securityManager != null) { try { securityManager.checkPermission(CREATE_TRANSPARENT_WINDOW_PERMISSION); } catch (final SecurityException e) { return false; } } return true; } return supported; } public static interface FinishListener { public void idle(boolean implicitExit); public void exitCalled(); } /** * Set the platform user agent stylesheet to the default. */ public static void setDefaultPlatformUserAgentStylesheet() { setPlatformUserAgentStylesheet(Application.STYLESHEET_MODENA); } private static boolean isModena = false; private static boolean isCaspian = false; /** * Current Platform User Agent Stylesheet is Modena. * * Note: Please think hard before using this as we really want to avoid special cases in the platform for specific * themes. This was added to allow tempory work arounds in the platform for bugs. * * @return true if using modena stylesheet */ public static boolean isModena() { return isModena; } /** * Current Platform User Agent Stylesheet is Caspian. * * Note: Please think hard before using this as we really want to avoid special cases in the platform for specific * themes. This was added to allow tempory work arounds in the platform for bugs. * * @return true if using caspian stylesheet */ public static boolean isCaspian() { return isCaspian; } /** * Set the platform user agent stylesheet to the given URL. This method has special handling for platform theme * name constants. */ public static void setPlatformUserAgentStylesheet(final String stylesheetUrl) { if (isFxApplicationThread()) { _setPlatformUserAgentStylesheet(stylesheetUrl); } else { runLater(() -> _setPlatformUserAgentStylesheet(stylesheetUrl)); } } private static String accessibilityTheme; public static boolean setAccessibilityTheme(String platformTheme) { if (accessibilityTheme != null) { StyleManager.getInstance().removeUserAgentStylesheet(accessibilityTheme); accessibilityTheme = null; } _setAccessibilityTheme(platformTheme); if (accessibilityTheme != null) { StyleManager.getInstance().addUserAgentStylesheet(accessibilityTheme); return true; } return false; } private static void _setAccessibilityTheme(String platformTheme) { // check to see if there is an override to enable a high-contrast theme final String userTheme = AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty("com.sun.javafx.highContrastTheme")); if (isCaspian()) { if (platformTheme != null || userTheme != null) { // caspian has only one high contrast theme, use it regardless of the user or platform theme. accessibilityTheme = "com/sun/javafx/scene/control/skin/caspian/highcontrast.css"; } } else if (isModena()) { // User-defined property takes precedence if (userTheme != null) { switch (userTheme.toUpperCase()) { case "BLACKONWHITE": accessibilityTheme = "com/sun/javafx/scene/control/skin/modena/blackOnWhite.css"; break; case "WHITEONBLACK": accessibilityTheme = "com/sun/javafx/scene/control/skin/modena/whiteOnBlack.css"; break; case "YELLOWONBLACK": accessibilityTheme = "com/sun/javafx/scene/control/skin/modena/yellowOnBlack.css"; break; default: } } else { if (platformTheme != null) { // The following names are Platform specific (Windows 7 and 8) switch (platformTheme) { case "High Contrast White": accessibilityTheme = "com/sun/javafx/scene/control/skin/modena/blackOnWhite.css"; break; case "High Contrast Black": accessibilityTheme = "com/sun/javafx/scene/control/skin/modena/whiteOnBlack.css"; break; case "High Contrast #1": case "High Contrast #2": //TODO #2 should be green on black accessibilityTheme = "com/sun/javafx/scene/control/skin/modena/yellowOnBlack.css"; break; default: } } } } } private static void _setPlatformUserAgentStylesheet(String stylesheetUrl) { isModena = isCaspian = false; // check for command line override final String overrideStylesheetUrl = AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty("javafx.userAgentStylesheetUrl")); if (overrideStylesheetUrl != null) { stylesheetUrl = overrideStylesheetUrl; } final List<String> uaStylesheets = new ArrayList<>(); // check for named theme constants for modena and caspian if (Application.STYLESHEET_CASPIAN.equalsIgnoreCase(stylesheetUrl)) { isCaspian = true; uaStylesheets.add("com/sun/javafx/scene/control/skin/caspian/caspian.css"); if (isSupported(ConditionalFeature.INPUT_TOUCH)) { uaStylesheets.add("com/sun/javafx/scene/control/skin/caspian/embedded.css"); if (com.sun.javafx.util.Utils.isQVGAScreen()) { uaStylesheets.add("com/sun/javafx/scene/control/skin/caspian/embedded-qvga.css"); } if (PlatformUtil.isAndroid()) { uaStylesheets.add("com/sun/javafx/scene/control/skin/caspian/android.css"); } } if (isSupported(ConditionalFeature.TWO_LEVEL_FOCUS)) { uaStylesheets.add("com/sun/javafx/scene/control/skin/caspian/two-level-focus.css"); } if (isSupported(ConditionalFeature.VIRTUAL_KEYBOARD)) { uaStylesheets.add("com/sun/javafx/scene/control/skin/caspian/fxvk.css"); } if (!isSupported(ConditionalFeature.TRANSPARENT_WINDOW)) { uaStylesheets.add("com/sun/javafx/scene/control/skin/caspian/caspian-no-transparency.css"); } } else if (Application.STYLESHEET_MODENA.equalsIgnoreCase(stylesheetUrl)) { isModena = true; uaStylesheets.add("com/sun/javafx/scene/control/skin/modena/modena.css"); if (isSupported(ConditionalFeature.INPUT_TOUCH)) { uaStylesheets.add("com/sun/javafx/scene/control/skin/modena/touch.css"); } // when running on embedded add a extra stylesheet to tune performance of modena theme if (PlatformUtil.isEmbedded()) { uaStylesheets.add("com/sun/javafx/scene/control/skin/modena/modena-embedded-performance.css"); } if (PlatformUtil.isAndroid()) { uaStylesheets.add("com/sun/javafx/scene/control/skin/modena/android.css"); } if (isSupported(ConditionalFeature.TWO_LEVEL_FOCUS)) { uaStylesheets.add("com/sun/javafx/scene/control/skin/modena/two-level-focus.css"); } if (isSupported(ConditionalFeature.VIRTUAL_KEYBOARD)) { uaStylesheets.add("com/sun/javafx/scene/control/skin/caspian/fxvk.css"); } if (!isSupported(ConditionalFeature.TRANSPARENT_WINDOW)) { uaStylesheets.add("com/sun/javafx/scene/control/skin/modena/modena-no-transparency.css"); } } else { uaStylesheets.add(stylesheetUrl); } // Ensure that accessibility starts right _setAccessibilityTheme(Toolkit.getToolkit().getThemeName()); if (accessibilityTheme != null) { uaStylesheets.add(accessibilityTheme); } AccessController.doPrivileged((PrivilegedAction) () -> { StyleManager.getInstance().setUserAgentStylesheets(uaStylesheets); return null; }); } public static void addNoTransparencyStylesheetToScene(final Scene scene) { if (PlatformImpl.isCaspian()) { AccessController.doPrivileged((PrivilegedAction) () -> { StyleManager.getInstance().addUserAgentStylesheet(scene, "com/sun/javafx/scene/control/skin/caspian/caspian-no-transparency.css"); return null; }); } else if (PlatformImpl.isModena()) { AccessController.doPrivileged((PrivilegedAction) () -> { StyleManager.getInstance().addUserAgentStylesheet(scene, "com/sun/javafx/scene/control/skin/modena/modena-no-transparency.css"); return null; }); } } private static boolean isSupportedImpl(ConditionalFeature feature) { switch (feature) { case GRAPHICS: if (isGraphicsSupported == null) { isGraphicsSupported = checkForClass("javafx.stage.Stage"); } return isGraphicsSupported; case CONTROLS: if (isControlsSupported == null) { isControlsSupported = checkForClass( "javafx.scene.control.Control"); } return isControlsSupported; case MEDIA: if (isMediaSupported == null) { isMediaSupported = checkForClass( "javafx.scene.media.MediaView"); if (isMediaSupported && PlatformUtil.isEmbedded()) { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { String s = System.getProperty( "com.sun.javafx.experimental.embedded.media", "false"); isMediaSupported = Boolean.valueOf(s); return null; }); } } return isMediaSupported; case WEB: if (isWebSupported == null) { isWebSupported = checkForClass("javafx.scene.web.WebView"); if (isWebSupported && PlatformUtil.isEmbedded()) { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { String s = System.getProperty( "com.sun.javafx.experimental.embedded.web", "false"); isWebSupported = Boolean.valueOf(s); return null; }); } } return isWebSupported; case SWT: if (isSWTSupported == null) { isSWTSupported = checkForClass("javafx.embed.swt.FXCanvas"); } return isSWTSupported; case SWING: if (isSwingSupported == null) { isSwingSupported = // check for JComponent first, it may not be present checkForClass("javax.swing.JComponent") && checkForClass("javafx.embed.swing.JFXPanel"); } return isSwingSupported; case FXML: if (isFXMLSupported == null) { isFXMLSupported = checkForClass("javafx.fxml.FXMLLoader") && checkForClass("javax.xml.stream.XMLInputFactory"); } return isFXMLSupported; case TWO_LEVEL_FOCUS: if (hasTwoLevelFocus == null) { return Toolkit.getToolkit().isSupported(feature); } return hasTwoLevelFocus; case VIRTUAL_KEYBOARD: if (hasVirtualKeyboard == null) { return Toolkit.getToolkit().isSupported(feature); } return hasVirtualKeyboard; case INPUT_TOUCH: if (hasTouch == null) { return Toolkit.getToolkit().isSupported(feature); } return hasTouch; case INPUT_MULTITOUCH: if (hasMultiTouch == null) { return Toolkit.getToolkit().isSupported(feature); } return hasMultiTouch; case INPUT_POINTER: if (hasPointer == null) { return Toolkit.getToolkit().isSupported(feature); } return hasPointer; default: return Toolkit.getToolkit().isSupported(feature); } } }
{ "pile_set_name": "Github" }
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true"> <f:if condition="{label} && {name}"> <div class="typo3-adminPanel-form-group"> <div class="typo3-adminPanel-form-select"> <label for="{name}" class="typo3-adminPanel-form-select-label"> <f:translate key="{label}" default="{label}" extensionName="adminpanel"/> </label> <select name="TSFE_ADMIN_PANEL[{name}]" id="{name}" class="typo3-adminPanel-form-select-input"> <option value="0"></option> <f:for each="{options}" as="option"> <option value="{option.{optionValue}}" {f:if(condition:'{option.{optionValue}} == {value}', then: 'selected')}> {option.{optionLabel}} </option> </f:for> </select> </div> </div> </f:if> </html>
{ "pile_set_name": "Github" }
const INITIAL_STATE = { value: 'Opa' } export default function(state = INITIAL_STATE, action) { switch(action.type) { case 'VALUE_CHANGED': return { value: action.payload } default: return state } }
{ "pile_set_name": "Github" }
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * 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 . */ #pragma once #define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String) #define NNC_(Context, StringSingular, StringPlural) reinterpret_cast<char const *>(Context "\004" u8##StringSingular "\004" u8##StringPlural) /*-------------------------------------------------------------------- Description: API names for Paragraph, Character and Text cursor properties --------------------------------------------------------------------*/ // Format names #define RID_BORDER_COLOR NC_("RID_ATTRIBUTE_NAMES_MAP", "Color") #define RID_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Border Distance") #define RID_BORDER_INNER_LINE_WIDTH NC_("RID_ATTRIBUTE_NAMES_MAP", "Inner Line Width") #define RID_BORDER_LINE_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Line Distance") #define RID_BORDER_LINE_STYLE NC_("RID_ATTRIBUTE_NAMES_MAP", "Line Style") #define RID_BORDER_LINE_WIDTH NC_("RID_ATTRIBUTE_NAMES_MAP", "Line Width") #define RID_BORDER_OUTER_LINE_WIDTH NC_("RID_ATTRIBUTE_NAMES_MAP", "Outer Line Width") #define RID_BOTTOM_BORDER NC_("RID_ATTRIBUTE_NAMES_MAP", "Bottom Border") #define RID_BOTTOM_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Bottom Border Distance") #define RID_BREAK_TYPE NC_("RID_ATTRIBUTE_NAMES_MAP", "Break Type") #define RID_CATEGORY NC_("RID_ATTRIBUTE_NAMES_MAP", "Category") #define RID_CELL NC_("RID_ATTRIBUTE_NAMES_MAP", "Cell") #define RID_CHAR_AUTO_ESCAPEMENT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Auto Escapement") #define RID_CHAR_AUTO_KERNING NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Auto Kerning") #define RID_CHAR_AUTO_STYLE_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Auto Style Name") #define RID_CHAR_BACK_COLOR NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Back Color") #define RID_CHAR_BACK_TRANSPARENT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Back Transparent") #define RID_CHAR_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Border Distance") #define RID_CHAR_BOTTOM_BORDER NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Bottom Border") #define RID_CHAR_BOTTOM_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Bottom Border Distance") #define RID_CHAR_CASE_MAP NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Case Map") #define RID_CHAR_COLOR NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Color") #define RID_CHAR_COMBINE_IS_ON NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Combine is On") #define RID_CHAR_COMBINE_PREFIX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Combine Prefix") #define RID_CHAR_COMBINE_SUFFIX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Combine Suffix") #define RID_CHAR_CONTOURED NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Contoured") #define RID_CHAR_CROSSED_OUT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Crossed Out") #define RID_CHAR_DIFF_HEIGHT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Difference Height") #define RID_CHAR_DIFF_HEIGHT_ASIAN NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Difference Height Asian") #define RID_CHAR_DIFF_HEIGHT_COMPLEX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Difference Height Complex") #define RID_CHAR_EMPHASIS NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Emphasis") #define RID_CHAR_ESCAPEMENT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Escapement") #define RID_CHAR_ESCAPEMENT_HEIGHT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Escapement Height") #define RID_CHAR_FLASH NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Flash") #define RID_CHAR_FONT_CHAR_SET NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Char Set") #define RID_CHAR_FONT_CHAR_SET_ASIAN NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Char Set Asian") #define RID_CHAR_FONT_CHAR_SET_COMPLEX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Char Set Complex") #define RID_CHAR_FONT_FAMILY NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Family") #define RID_CHAR_FONT_FAMILY_ASIAN NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Family Asian") #define RID_CHAR_FONT_FAMILY_COMPLEX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Family Complex") #define RID_CHAR_FONT_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Name") #define RID_CHAR_FONT_NAME_ASIAN NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Name Asian") #define RID_CHAR_FONT_NAME_COMPLEX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Name Complex") #define RID_CHAR_FONT_PITCH NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Pitch") #define RID_CHAR_FONT_PITCH_ASIAN NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Pitch Asian") #define RID_CHAR_FONT_PITCH_COMPLEX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Pitch Complex") #define RID_CHAR_FONT_STYLE_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Style Name") #define RID_CHAR_FONT_STYLE_NAME_ASIAN NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Style Name Asian") #define RID_CHAR_FONT_STYLE_NAME_COMPLEX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Font Style Name Complex") #define RID_CHAR_HEIGHT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Height") #define RID_CHAR_HEIGHT_ASIAN NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Height Asian") #define RID_CHAR_HEIGHT_COMPLEX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Height Complex") #define RID_CHAR_HIDDEN NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Hidden") #define RID_CHAR_HIGHLIGHT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Highlight") #define RID_CHAR_INTEROP_GRAB_BAG NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Interoperability Grab Bag") #define RID_CHAR_KERNING NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Kerning") #define RID_CHAR_LEFT_BORDER NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Left Border") #define RID_CHAR_LEFT_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Left Border Distance") #define RID_CHAR_LOCALE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Locale") #define RID_CHAR_LOCALE_ASIAN NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Locale Asian") #define RID_CHAR_LOCALE_COMPLEX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Locale Complex") #define RID_CHAR_NO_HYPHENATION NC_("RID_ATTRIBUTE_NAMES_MAP", "Char No Hyphenation") #define RID_CHAR_OVERLINE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Overline") #define RID_CHAR_OVERLINE_COLOR NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Overline Color") #define RID_CHAR_OVERLINE_HAS_COLOR NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Overline Has Color") #define RID_CHAR_POSTURE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Posture") #define RID_CHAR_POSTURE_ASIAN NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Posture Asian") #define RID_CHAR_POSTURE_COMPLEX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Posture Complex") #define RID_CHAR_PROP_HEIGHT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Property Height") #define RID_CHAR_PROP_HEIGHT_ASIAN NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Property Height Asian") #define RID_CHAR_PROP_HEIGHT_COMPLEX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Property Height Complex") #define RID_CHAR_RELIEF NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Relief") #define RID_CHAR_RIGHT_BORDER NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Right Border") #define RID_CHAR_RIGHT_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Right Border Distance") #define RID_CHAR_ROTATION NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Rotation") #define RID_CHAR_ROTATION_IS_FIT_TO_LINE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Rotation is Fit To Line") #define RID_CHAR_SCALE_WIDTH NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Scale Width") #define RID_CHAR_SHADING_VALUE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Shading Value") #define RID_CHAR_SHADOW_FORMAT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Shadow Format") #define RID_CHAR_SHADOWED NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Shadowed") #define RID_CHAR_STRIKEOUT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Strikeout") #define RID_CHAR_STYLE_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Style Name") #define RID_CHAR_STYLE_NAMES NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Style Names") #define RID_CHAR_TOP_BORDER NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Top Border") #define RID_CHAR_TOP_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Top Border Distance") #define RID_CHAR_TRANSPARENCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Transparence") #define RID_CHAR_UNDERLINE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Underline") #define RID_CHAR_UNDERLINE_COLOR NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Underline Color") #define RID_CHAR_UNDERLINE_HAS_COLOR NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Underline Has Color") #define RID_CHAR_WEIGHT NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Weight") #define RID_CHAR_WEIGHT_ASIAN NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Weight Asian") #define RID_CHAR_WEIGHT_COMPLEX NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Weight Complex") #define RID_CHAR_WORD_MODE NC_("RID_ATTRIBUTE_NAMES_MAP", "Char Word Mode") #define RID_CONTINUING_PREVIOUS_SUB_TREE NC_("RID_ATTRIBUTE_NAMES_MAP", "Continuing Previous Tree") #define RID_DISPLAY_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Display Name") #define RID_DOCUMENT_INDEX NC_("RID_ATTRIBUTE_NAMES_MAP", "Document Index") #define RID_DOCUMENT_INDEX_MARK NC_("RID_ATTRIBUTE_NAMES_MAP", "Document Index Mark") #define RID_DROP_CAP_CHAR_STYLE_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Drop Cap Char Style Name") #define RID_DROP_CAP_FORMAT NC_("RID_ATTRIBUTE_NAMES_MAP", "Drop Cap Format") #define RID_DROP_CAP_WHOLE_WORD NC_("RID_ATTRIBUTE_NAMES_MAP", "Drop Cap Whole Word") #define RID_ENDNOTE NC_("RID_ATTRIBUTE_NAMES_MAP", "Endnote") #define RID_FILL_BACKGROUND NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Background") #define RID_FILL_BITMAP NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap") #define RID_FILL_BITMAP_LOGICAL_SIZE NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap Logical Size") #define RID_FILL_BITMAP_MODE NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap Mode") #define RID_FILL_BITMAP_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap Name") #define RID_FILL_BITMAP_OFFSET_X NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap Offset X") #define RID_FILL_BITMAP_OFFSET_Y NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap Offset Y") #define RID_FILL_BITMAP_POSITION_OFFSET_X NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap Position Offset X") #define RID_FILL_BITMAP_POSITION_OFFSET_Y NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap Position Offset Y") #define RID_FILL_BITMAP_RECTANGLE_POINT NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap Rectangle Point") #define RID_FILL_BITMAP_SIZE_X NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap Size X") #define RID_FILL_BITMAP_SIZE_Y NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap Size Y") #define RID_FILL_BITMAP_STRETCH NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap Stretch") #define RID_FILL_BITMAP_TILE NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap Tile") #define RID_FILL_BITMAP_URL NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Bitmap URL") #define RID_FILL_COLOR NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Color") #define RID_FILL_COLOR2 NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Color2") #define RID_FILL_GRADIENT NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Gradient") #define RID_FILL_GRADIENT_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Gradient Name") #define RID_FILL_GRADIENT_STEP_COUNT NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Gradient Step Count") #define RID_FILL_HATCH NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Hatch") #define RID_FILL_HATCH_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Hatch Name") #define RID_FILL_STYLE NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Style") #define RID_FILL_TRANSPARENCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Transparence") #define RID_FILL_TRANSPARENCE_GRADIENT NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Transparence Gradient") #define RID_FILL_TRANSPARENCE_GRADIENT_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Fill Transparence Gradient Name") #define RID_FOLLOW_STYLE NC_("RID_ATTRIBUTE_NAMES_MAP", "Follow Style") #define RID_FOOTNOTE NC_("RID_ATTRIBUTE_NAMES_MAP", "Footnote") #define RID_HIDDEN NC_("RID_ATTRIBUTE_NAMES_MAP", "Hidden") #define RID_HYPERLINK_EVENTS NC_("RID_ATTRIBUTE_NAMES_MAP", "Hyperlink Events") #define RID_HYPERLINK_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Hyperlink Name") #define RID_HYPERLINK_TARGET NC_("RID_ATTRIBUTE_NAMES_MAP", "Hyperlink Target") #define RID_HYPERLINK_URL NC_("RID_ATTRIBUTE_NAMES_MAP", "Hyperlink URL") #define RID_IS_AUTO_UPDATE NC_("RID_ATTRIBUTE_NAMES_MAP", "Is Auto Update") #define RID_IS_PHYSICAL NC_("RID_ATTRIBUTE_NAMES_MAP", "Is Physical") #define RID_LEFT_BORDER NC_("RID_ATTRIBUTE_NAMES_MAP", "Left Border") #define RID_LEFT_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Left Border Distance") #define RID_LIST_AUTO_FORMAT NC_("RID_ATTRIBUTE_NAMES_MAP", "List Auto Format") #define RID_LIST_ID NC_("RID_ATTRIBUTE_NAMES_MAP", "List Id") #define RID_LIST_LABEL_STRING NC_("RID_ATTRIBUTE_NAMES_MAP", "List Label String") #define RID_NESTED_TEXT_CONTENT NC_("RID_ATTRIBUTE_NAMES_MAP", "Nested Text Content") #define RID_NUMBERING_IS_NUMBER NC_("RID_ATTRIBUTE_NAMES_MAP", "Numbering is Number") #define RID_NUMBERING_LEVEL NC_("RID_ATTRIBUTE_NAMES_MAP", "Numbering Level") #define RID_NUMBERING_RULES NC_("RID_ATTRIBUTE_NAMES_MAP", "Numbering Rules") #define RID_NUMBERING_START_VALUE NC_("RID_ATTRIBUTE_NAMES_MAP", "Numbering Start Value") #define RID_NUMBERING_STYLE_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Numbering Style Name") #define RID_OUTLINE_CONTENT_VISIBLE NC_("RID_ATTRIBUTE_NAMES_MAP", "Outline Content Visible") #define RID_OUTLINE_LEVEL NC_("RID_ATTRIBUTE_NAMES_MAP", "Outline Level") #define RID_PAGE_DESC_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Page Desc Name") #define RID_PAGE_NUMBER_OFFSET NC_("RID_ATTRIBUTE_NAMES_MAP", "Page Number Offset") #define RID_PAGE_STYLE_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Page Style Name") #define RID_PAR_RSID NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Rsid") #define RID_PARA_ADJUST NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Adjust") #define RID_PARA_AUTO_STYLE_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Auto Style Name") #define RID_PARA_BACK_COLOR NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Back Color") #define RID_PARA_BACK_GRAPHIC NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Back Graphic") #define RID_PARA_BACK_GRAPHIC_FILTER NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Back Graphic Filter") #define RID_PARA_BACK_GRAPHIC_LOCATION NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Back Graphic Location") #define RID_PARA_BACK_GRAPHIC_URL NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Back Graphic URL") #define RID_PARA_BACK_TRANSPARENT NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Back Transparent") #define RID_PARA_BOTTOM_MARGIN NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Bottom Margin") #define RID_PARA_BOTTOM_MARGIN_RELATIVE NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Bottom Margin Relative") #define RID_PARA_CHAPTER_NUMBERING_LEVEL NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Chapter Numbering Level") #define RID_PARA_CONDITIONAL_STYLE_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Conditional Style Name") #define RID_PARA_CONTEXT_MARGIN NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Context Margin") #define RID_PARA_EXPAND_SINGLE_WORD NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Expand Single Word") #define RID_PARA_FIRST_LINE_INDENT NC_("RID_ATTRIBUTE_NAMES_MAP", "Para First Line Indent") #define RID_PARA_FIRST_LINE_INDENT_RELATIVE NC_("RID_ATTRIBUTE_NAMES_MAP", "Para First Line Indent Relative") #define RID_PARA_HYPHENATION_MAX_HYPHENS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Max Hyphens") #define RID_PARA_HYPHENATION_MAX_LEADING_CHARS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Max Leading Chars") #define RID_PARA_HYPHENATION_MAX_TRAILING_CHARS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Max Trailing Chars") #define RID_PARA_HYPHENATION_NO_CAPS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation No Caps") #define RID_PARA_INTEROP_GRAB_BAG NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Interop Grab Bag") #define RID_PARA_IS_AUTO_FIRST_LINE_INDENT NC_("RID_ATTRIBUTE_NAMES_MAP", "Para is Auto First Line Indent") #define RID_PARA_IS_CHARACTER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Para is Character Distance") #define RID_PARA_IS_CONNECT_BORDER NC_("RID_ATTRIBUTE_NAMES_MAP", "Para is Connect Border") #define RID_PARA_IS_FORBIDDEN_RULES NC_("RID_ATTRIBUTE_NAMES_MAP", "Para is Forbidden Rules") #define RID_PARA_IS_HANGING_PUNCTUATION NC_("RID_ATTRIBUTE_NAMES_MAP", "Para is Hanging Punctuation") #define RID_PARA_IS_HYPHENATION NC_("RID_ATTRIBUTE_NAMES_MAP", "Para is Hyphenation") #define RID_PARA_IS_NUMBERING_RESTART NC_("RID_ATTRIBUTE_NAMES_MAP", "Para is Numbering Restart") #define RID_PARA_KEEP_TOGETHER NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Keep Together") #define RID_PARA_LAST_LINE_ADJUST NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Last Line Adjust") #define RID_PARA_LEFT_MARGIN NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Left Margin") #define RID_PARA_LEFT_MARGIN_RELATIVE NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Left Margin Relative") #define RID_PARA_LINE_NUMBER_COUNT NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Line Number Count") #define RID_PARA_LINE_NUMBER_START_VALUE NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Line Number Start Value") #define RID_PARA_LINE_SPACING NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Line Spacing") #define RID_PARA_ORPHANS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Orphans") #define RID_PARA_REGISTER_MODE_ACTIVE NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Register Mode Active") #define RID_PARA_RIGHT_MARGIN NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Right Margin") #define RID_PARA_RIGHT_MARGIN_RELATIVE NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Right Margin Relative") #define RID_PARA_SHADOW_FORMAT NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Shadow Format") #define RID_PARA_SPLIT NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Split") #define RID_PARA_STYLE_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Style Name") #define RID_PARA_TAB_STOPS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Tab Stops") #define RID_PARA_TOP_MARGIN NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Top Margin") #define RID_PARA_TOP_MARGIN_RELATIVE NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Top Margin Relative") #define RID_PARA_USER_DEFINED_ATTRIBUTES NC_("RID_ATTRIBUTE_NAMES_MAP", "Para User Defined Attributes") #define RID_PARA_VERT_ALIGNMENT NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Vertical Alignment") #define RID_PARA_WIDOWS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Widows") #define RID_REFERENCE_MARK NC_("RID_ATTRIBUTE_NAMES_MAP", "Reference Mark") #define RID_RIGHT_BORDER NC_("RID_ATTRIBUTE_NAMES_MAP", "Right Border") #define RID_RIGHT_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Right Border Distance") #define RID_RSID NC_("RID_ATTRIBUTE_NAMES_MAP", "Rsid") #define RID_RUBY_ADJUST NC_("RID_ATTRIBUTE_NAMES_MAP", "Ruby Adjust") #define RID_RUBY_CHAR_STYLE_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Ruby Char Style Name") #define RID_RUBY_IS_ABOVE NC_("RID_ATTRIBUTE_NAMES_MAP", "Ruby is Above") #define RID_RUBY_POSITION NC_("RID_ATTRIBUTE_NAMES_MAP", "Ruby Position") #define RID_RUBY_TEXT NC_("RID_ATTRIBUTE_NAMES_MAP", "Ruby Text") #define RID_SNAP_TO_GRID NC_("RID_ATTRIBUTE_NAMES_MAP", "Snap to Grid") #define RID_STYLE_INTEROP_GRAB_BAG NC_("RID_ATTRIBUTE_NAMES_MAP", "Style Interop Grab Bag") #define RID_TEXT_FIELD NC_("RID_ATTRIBUTE_NAMES_MAP", "Text Field") #define RID_TEXT_FRAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Text Frame") #define RID_TEXT_PARAGRAPH NC_("RID_ATTRIBUTE_NAMES_MAP", "Text Paragraph") #define RID_TEXT_SECTION NC_("RID_ATTRIBUTE_NAMES_MAP", "Text Section") #define RID_TEXT_TABLE NC_("RID_ATTRIBUTE_NAMES_MAP", "Text Table") #define RID_TEXT_USER_DEFINED_ATTRIBUTES NC_("RID_ATTRIBUTE_NAMES_MAP", "Text User Defined Attributes") #define RID_TOP_BORDER NC_("RID_ATTRIBUTE_NAMES_MAP", "Top Border") #define RID_TOP_BORDER_DISTANCE NC_("RID_ATTRIBUTE_NAMES_MAP", "Top Border Distance") #define RID_UNVISITED_CHAR_STYLE_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Unvisited Char Style Name") #define RID_VISITED_CHAR_STYLE_NAME NC_("RID_ATTRIBUTE_NAMES_MAP", "Visited Char Style Name") #define RID_WRITING_MODE NC_("RID_ATTRIBUTE_NAMES_MAP", "Writing Mode") /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
{ "pile_set_name": "Github" }
#include "test/jemalloc_test.h" #define NTHREADS 2 #define NINCRS 2000000 TEST_BEGIN(test_mtx_basic) { mtx_t mtx; assert_false(mtx_init(&mtx), "Unexpected mtx_init() failure"); mtx_lock(&mtx); mtx_unlock(&mtx); mtx_fini(&mtx); } TEST_END typedef struct { mtx_t mtx; unsigned x; } thd_start_arg_t; static void * thd_start(void *varg) { thd_start_arg_t *arg = (thd_start_arg_t *)varg; unsigned i; for (i = 0; i < NINCRS; i++) { mtx_lock(&arg->mtx); arg->x++; mtx_unlock(&arg->mtx); } return NULL; } TEST_BEGIN(test_mtx_race) { thd_start_arg_t arg; thd_t thds[NTHREADS]; unsigned i; assert_false(mtx_init(&arg.mtx), "Unexpected mtx_init() failure"); arg.x = 0; for (i = 0; i < NTHREADS; i++) { thd_create(&thds[i], thd_start, (void *)&arg); } for (i = 0; i < NTHREADS; i++) { thd_join(thds[i], NULL); } assert_u_eq(arg.x, NTHREADS * NINCRS, "Race-related counter corruption"); } TEST_END int main(void) { return test( test_mtx_basic, test_mtx_race); }
{ "pile_set_name": "Github" }
require_llvm 3.7 install_package "openssl-1.0.2o" "https://www.openssl.org/source/openssl-1.0.2o.tar.gz#ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d" mac_openssl --if has_broken_mac_openssl install_package "rubinius-4.19" "https://rubinius-releases-rubinius-com.s3.amazonaws.com/rubinius-4.19.tar.bz2#6b3a63edf2f04937ce92c1a94e68cf51680621dda3d9139a864999e78b620ace" rbx
{ "pile_set_name": "Github" }
<div class="btn-group navbar-left"> <button id="tocButt" tabindex="1" tabindex="1" type="button" class="btn icon-toc" title="{{strings.toc}} [{{keyboard.TocShowHideToggle}}]" aria-label="{{strings.toc}} [{{keyboard.TocShowHideToggle}}]" accesskey="{{keyboard.accesskeys.TocShowHideToggle}}"> <span class="glyphicon glyphicon-list" aria-hidden="true"></span> </button> </div> <div class="btn-group navbar-right"> <button id="settbutt1" tabindex="1" type="button" class="btn icon-settings" data-toggle="modal" data-target="#settings-dialog" title="{{strings.settings}} [{{keyboard.ShowSettingsModal}}]" aria-label="{{strings.settings}} [{{keyboard.ShowSettingsModal}}]" accesskey="{{keyboard.accesskeys.ShowSettingsModal}}"> <span class="glyphicon glyphicon-cog" aria-hidden="true"></span> </button> <!-- <button style="display: block" tabindex="1" id="buttFullScreenToggle" type="button" class="btn icon-full-screen" title="{{strings.enter_fullscreen}} [{{keyboard.FullScreenToggle}}]" aria-label="{{strings.enter_fullscreen}} [{{keyboard.FullScreenToggle}}]" accesskey="{{keyboard.accesskeys.FullScreenToggle}}"> <span class="glyphicon glyphicon-resize-full" aria-hidden="true"></span> </button> --> </div>
{ "pile_set_name": "Github" }
/* Printable.h - Interface class that allows printing of complex types Copyright (c) 2011 Adrian McEwen. All right reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef Printable_h #define Printable_h #include <stdlib.h> class Print; /** The Printable class provides a way for new classes to allow themselves to be printed. By deriving from Printable and implementing the printTo method, it will then be possible for users to print out instances of this class by passing them into the usual Print::print and Print::println methods. */ class Printable { public: virtual size_t printTo(Print& p) const = 0; }; #endif
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <artifactId>Signature_Wrapping</artifactId> <name>WS-Attacker-Plugin_Signature_Wrapping</name> <inceptionYear>2011</inceptionYear> <developers> <developer> <id>cmainka</id> <name>Christian Mainka</name> <email>Christian.Mainka@rub.de</email> <url>http://www.nds.rub.de/chair/people/cmainka/</url> <organization>NDS</organization> <organizationUrl>http://www.nds.rub.de</organizationUrl> <roles> <role>Architect</role> <role>Developer</role> </roles> </developer> </developers> <parent> <groupId>wsattacker.plugin</groupId> <artifactId>wsattacker-plugins</artifactId> <version>1.9-SNAPSHOT</version> </parent> <!-- For WsuURIDereferencer: XMLSignatureInput, ApacheOctetStreamData, ApacheNodeSetData --> <dependencies> <dependency> <groupId>wsattacker.library</groupId> <artifactId>Schema_Analyzer_Library</artifactId> <version>1.9-SNAPSHOT</version> <type>jar</type> </dependency> <dependency> <groupId>wsattacker.library</groupId> <artifactId>XML_Utilities_Library</artifactId> <version>1.9-SNAPSHOT</version> <type>jar</type> </dependency> <dependency> <groupId>wsattacker.library</groupId> <artifactId>Signature_Wrapping_Library</artifactId> <version>1.9-SNAPSHOT</version> </dependency> <dependency> <groupId>wsattacker.library</groupId> <artifactId>SoapHttpClient</artifactId> <version>1.9-SNAPSHOT</version> <type>jar</type> </dependency> </dependencies> <build> <plugins> <!-- Use a Licence Header --> <plugin> <groupId>com.mycila</groupId> <artifactId>license-maven-plugin</artifactId> <configuration> <properties> <owner>Christian Mainka</owner> </properties> </configuration> </plugin> <!-- Copy required libraries to lib folder --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> </plugin> </plugins> </build> </project>
{ "pile_set_name": "Github" }
#pragma once #include <memory> #include "lv2core/Plugin.hpp" class RnNoiseCommonPlugin; class RnNoiseLv2Plugin : public lv2::Plugin<lv2::NoExtension> { public: RnNoiseLv2Plugin(double sample_rate, const char *bundle_path, const LV2_Feature *const *features, bool *valid); ~RnNoiseLv2Plugin(); void connect_port(uint32_t port, void *data_location) override; void activate() override; void run(uint32_t sample_count) override; void deactivate() override; private: enum class PortIndex { input = 0, output, }; const float *m_inPort{nullptr}; float *m_outPort{nullptr}; std::unique_ptr<RnNoiseCommonPlugin> m_rnNoisePlugin; };
{ "pile_set_name": "Github" }
/* Copyright 2014 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 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 fuzz import ( "fmt" "math/rand" "reflect" "time" ) // fuzzFuncMap is a map from a type to a fuzzFunc that handles that type. type fuzzFuncMap map[reflect.Type]reflect.Value // Fuzzer knows how to fill any object with random fields. type Fuzzer struct { fuzzFuncs fuzzFuncMap defaultFuzzFuncs fuzzFuncMap r *rand.Rand nilChance float64 minElements int maxElements int maxDepth int } // New returns a new Fuzzer. Customize your Fuzzer further by calling Funcs, // RandSource, NilChance, or NumElements in any order. func New() *Fuzzer { return NewWithSeed(time.Now().UnixNano()) } func NewWithSeed(seed int64) *Fuzzer { f := &Fuzzer{ defaultFuzzFuncs: fuzzFuncMap{ reflect.TypeOf(&time.Time{}): reflect.ValueOf(fuzzTime), }, fuzzFuncs: fuzzFuncMap{}, r: rand.New(rand.NewSource(seed)), nilChance: .2, minElements: 1, maxElements: 10, maxDepth: 100, } return f } // Funcs adds each entry in fuzzFuncs as a custom fuzzing function. // // Each entry in fuzzFuncs must be a function taking two parameters. // The first parameter must be a pointer or map. It is the variable that // function will fill with random data. The second parameter must be a // fuzz.Continue, which will provide a source of randomness and a way // to automatically continue fuzzing smaller pieces of the first parameter. // // These functions are called sensibly, e.g., if you wanted custom string // fuzzing, the function `func(s *string, c fuzz.Continue)` would get // called and passed the address of strings. Maps and pointers will always // be made/new'd for you, ignoring the NilChange option. For slices, it // doesn't make much sense to pre-create them--Fuzzer doesn't know how // long you want your slice--so take a pointer to a slice, and make it // yourself. (If you don't want your map/pointer type pre-made, take a // pointer to it, and make it yourself.) See the examples for a range of // custom functions. func (f *Fuzzer) Funcs(fuzzFuncs ...interface{}) *Fuzzer { for i := range fuzzFuncs { v := reflect.ValueOf(fuzzFuncs[i]) if v.Kind() != reflect.Func { panic("Need only funcs!") } t := v.Type() if t.NumIn() != 2 || t.NumOut() != 0 { panic("Need 2 in and 0 out params!") } argT := t.In(0) switch argT.Kind() { case reflect.Ptr, reflect.Map: default: panic("fuzzFunc must take pointer or map type") } if t.In(1) != reflect.TypeOf(Continue{}) { panic("fuzzFunc's second parameter must be type fuzz.Continue") } f.fuzzFuncs[argT] = v } return f } // RandSource causes f to get values from the given source of randomness. // Use if you want deterministic fuzzing. func (f *Fuzzer) RandSource(s rand.Source) *Fuzzer { f.r = rand.New(s) return f } // NilChance sets the probability of creating a nil pointer, map, or slice to // 'p'. 'p' should be between 0 (no nils) and 1 (all nils), inclusive. func (f *Fuzzer) NilChance(p float64) *Fuzzer { if p < 0 || p > 1 { panic("p should be between 0 and 1, inclusive.") } f.nilChance = p return f } // NumElements sets the minimum and maximum number of elements that will be // added to a non-nil map or slice. func (f *Fuzzer) NumElements(atLeast, atMost int) *Fuzzer { if atLeast > atMost { panic("atLeast must be <= atMost") } if atLeast < 0 { panic("atLeast must be >= 0") } f.minElements = atLeast f.maxElements = atMost return f } func (f *Fuzzer) genElementCount() int { if f.minElements == f.maxElements { return f.minElements } return f.minElements + f.r.Intn(f.maxElements-f.minElements+1) } func (f *Fuzzer) genShouldFill() bool { return f.r.Float64() > f.nilChance } // MaxDepth sets the maximum number of recursive fuzz calls that will be made // before stopping. This includes struct members, pointers, and map and slice // elements. func (f *Fuzzer) MaxDepth(d int) *Fuzzer { f.maxDepth = d return f } // Fuzz recursively fills all of obj's fields with something random. First // this tries to find a custom fuzz function (see Funcs). If there is no // custom function this tests whether the object implements fuzz.Interface and, // if so, calls Fuzz on it to fuzz itself. If that fails, this will see if // there is a default fuzz function provided by this package. If all of that // fails, this will generate random values for all primitive fields and then // recurse for all non-primitives. // // This is safe for cyclic or tree-like structs, up to a limit. Use the // MaxDepth method to adjust how deep you need it to recurse. // // obj must be a pointer. Only exported (public) fields can be set (thanks, // golang :/ ) Intended for tests, so will panic on bad input or unimplemented // fields. func (f *Fuzzer) Fuzz(obj interface{}) { v := reflect.ValueOf(obj) if v.Kind() != reflect.Ptr { panic("needed ptr!") } v = v.Elem() f.fuzzWithContext(v, 0) } // FuzzNoCustom is just like Fuzz, except that any custom fuzz function for // obj's type will not be called and obj will not be tested for fuzz.Interface // conformance. This applies only to obj and not other instances of obj's // type. // Not safe for cyclic or tree-like structs! // obj must be a pointer. Only exported (public) fields can be set (thanks, golang :/ ) // Intended for tests, so will panic on bad input or unimplemented fields. func (f *Fuzzer) FuzzNoCustom(obj interface{}) { v := reflect.ValueOf(obj) if v.Kind() != reflect.Ptr { panic("needed ptr!") } v = v.Elem() f.fuzzWithContext(v, flagNoCustomFuzz) } const ( // Do not try to find a custom fuzz function. Does not apply recursively. flagNoCustomFuzz uint64 = 1 << iota ) func (f *Fuzzer) fuzzWithContext(v reflect.Value, flags uint64) { fc := &fuzzerContext{fuzzer: f} fc.doFuzz(v, flags) } // fuzzerContext carries context about a single fuzzing run, which lets Fuzzer // be thread-safe. type fuzzerContext struct { fuzzer *Fuzzer curDepth int } func (fc *fuzzerContext) doFuzz(v reflect.Value, flags uint64) { if fc.curDepth >= fc.fuzzer.maxDepth { return } fc.curDepth++ defer func() { fc.curDepth-- }() if !v.CanSet() { return } if flags&flagNoCustomFuzz == 0 { // Check for both pointer and non-pointer custom functions. if v.CanAddr() && fc.tryCustom(v.Addr()) { return } if fc.tryCustom(v) { return } } if fn, ok := fillFuncMap[v.Kind()]; ok { fn(v, fc.fuzzer.r) return } switch v.Kind() { case reflect.Map: if fc.fuzzer.genShouldFill() { v.Set(reflect.MakeMap(v.Type())) n := fc.fuzzer.genElementCount() for i := 0; i < n; i++ { key := reflect.New(v.Type().Key()).Elem() fc.doFuzz(key, 0) val := reflect.New(v.Type().Elem()).Elem() fc.doFuzz(val, 0) v.SetMapIndex(key, val) } return } v.Set(reflect.Zero(v.Type())) case reflect.Ptr: if fc.fuzzer.genShouldFill() { v.Set(reflect.New(v.Type().Elem())) fc.doFuzz(v.Elem(), 0) return } v.Set(reflect.Zero(v.Type())) case reflect.Slice: if fc.fuzzer.genShouldFill() { n := fc.fuzzer.genElementCount() v.Set(reflect.MakeSlice(v.Type(), n, n)) for i := 0; i < n; i++ { fc.doFuzz(v.Index(i), 0) } return } v.Set(reflect.Zero(v.Type())) case reflect.Array: if fc.fuzzer.genShouldFill() { n := v.Len() for i := 0; i < n; i++ { fc.doFuzz(v.Index(i), 0) } return } v.Set(reflect.Zero(v.Type())) case reflect.Struct: for i := 0; i < v.NumField(); i++ { fc.doFuzz(v.Field(i), 0) } case reflect.Chan: fallthrough case reflect.Func: fallthrough case reflect.Interface: fallthrough default: panic(fmt.Sprintf("Can't handle %#v", v.Interface())) } } // tryCustom searches for custom handlers, and returns true iff it finds a match // and successfully randomizes v. func (fc *fuzzerContext) tryCustom(v reflect.Value) bool { // First: see if we have a fuzz function for it. doCustom, ok := fc.fuzzer.fuzzFuncs[v.Type()] if !ok { // Second: see if it can fuzz itself. if v.CanInterface() { intf := v.Interface() if fuzzable, ok := intf.(Interface); ok { fuzzable.Fuzz(Continue{fc: fc, Rand: fc.fuzzer.r}) return true } } // Finally: see if there is a default fuzz function. doCustom, ok = fc.fuzzer.defaultFuzzFuncs[v.Type()] if !ok { return false } } switch v.Kind() { case reflect.Ptr: if v.IsNil() { if !v.CanSet() { return false } v.Set(reflect.New(v.Type().Elem())) } case reflect.Map: if v.IsNil() { if !v.CanSet() { return false } v.Set(reflect.MakeMap(v.Type())) } default: return false } doCustom.Call([]reflect.Value{v, reflect.ValueOf(Continue{ fc: fc, Rand: fc.fuzzer.r, })}) return true } // Interface represents an object that knows how to fuzz itself. Any time we // find a type that implements this interface we will delegate the act of // fuzzing itself. type Interface interface { Fuzz(c Continue) } // Continue can be passed to custom fuzzing functions to allow them to use // the correct source of randomness and to continue fuzzing their members. type Continue struct { fc *fuzzerContext // For convenience, Continue implements rand.Rand via embedding. // Use this for generating any randomness if you want your fuzzing // to be repeatable for a given seed. *rand.Rand } // Fuzz continues fuzzing obj. obj must be a pointer. func (c Continue) Fuzz(obj interface{}) { v := reflect.ValueOf(obj) if v.Kind() != reflect.Ptr { panic("needed ptr!") } v = v.Elem() c.fc.doFuzz(v, 0) } // FuzzNoCustom continues fuzzing obj, except that any custom fuzz function for // obj's type will not be called and obj will not be tested for fuzz.Interface // conformance. This applies only to obj and not other instances of obj's // type. func (c Continue) FuzzNoCustom(obj interface{}) { v := reflect.ValueOf(obj) if v.Kind() != reflect.Ptr { panic("needed ptr!") } v = v.Elem() c.fc.doFuzz(v, flagNoCustomFuzz) } // RandString makes a random string up to 20 characters long. The returned string // may include a variety of (valid) UTF-8 encodings. func (c Continue) RandString() string { return randString(c.Rand) } // RandUint64 makes random 64 bit numbers. // Weirdly, rand doesn't have a function that gives you 64 random bits. func (c Continue) RandUint64() uint64 { return randUint64(c.Rand) } // RandBool returns true or false randomly. func (c Continue) RandBool() bool { return randBool(c.Rand) } func fuzzInt(v reflect.Value, r *rand.Rand) { v.SetInt(int64(randUint64(r))) } func fuzzUint(v reflect.Value, r *rand.Rand) { v.SetUint(randUint64(r)) } func fuzzTime(t *time.Time, c Continue) { var sec, nsec int64 // Allow for about 1000 years of random time values, which keeps things // like JSON parsing reasonably happy. sec = c.Rand.Int63n(1000 * 365 * 24 * 60 * 60) c.Fuzz(&nsec) *t = time.Unix(sec, nsec) } var fillFuncMap = map[reflect.Kind]func(reflect.Value, *rand.Rand){ reflect.Bool: func(v reflect.Value, r *rand.Rand) { v.SetBool(randBool(r)) }, reflect.Int: fuzzInt, reflect.Int8: fuzzInt, reflect.Int16: fuzzInt, reflect.Int32: fuzzInt, reflect.Int64: fuzzInt, reflect.Uint: fuzzUint, reflect.Uint8: fuzzUint, reflect.Uint16: fuzzUint, reflect.Uint32: fuzzUint, reflect.Uint64: fuzzUint, reflect.Uintptr: fuzzUint, reflect.Float32: func(v reflect.Value, r *rand.Rand) { v.SetFloat(float64(r.Float32())) }, reflect.Float64: func(v reflect.Value, r *rand.Rand) { v.SetFloat(r.Float64()) }, reflect.Complex64: func(v reflect.Value, r *rand.Rand) { panic("unimplemented") }, reflect.Complex128: func(v reflect.Value, r *rand.Rand) { panic("unimplemented") }, reflect.String: func(v reflect.Value, r *rand.Rand) { v.SetString(randString(r)) }, reflect.UnsafePointer: func(v reflect.Value, r *rand.Rand) { panic("unimplemented") }, } // randBool returns true or false randomly. func randBool(r *rand.Rand) bool { if r.Int()&1 == 1 { return true } return false } type charRange struct { first, last rune } // choose returns a random unicode character from the given range, using the // given randomness source. func (r *charRange) choose(rand *rand.Rand) rune { count := int64(r.last - r.first) return r.first + rune(rand.Int63n(count)) } var unicodeRanges = []charRange{ {' ', '~'}, // ASCII characters {'\u00a0', '\u02af'}, // Multi-byte encoded characters {'\u4e00', '\u9fff'}, // Common CJK (even longer encodings) } // randString makes a random string up to 20 characters long. The returned string // may include a variety of (valid) UTF-8 encodings. func randString(r *rand.Rand) string { n := r.Intn(20) runes := make([]rune, n) for i := range runes { runes[i] = unicodeRanges[r.Intn(len(unicodeRanges))].choose(r) } return string(runes) } // randUint64 makes random 64 bit numbers. // Weirdly, rand doesn't have a function that gives you 64 random bits. func randUint64(r *rand.Rand) uint64 { return uint64(r.Uint32())<<32 | uint64(r.Uint32()) }
{ "pile_set_name": "Github" }
/* Generated by RuntimeBrowser Image: /System/Library/PrivateFrameworks/CoreHAP.framework/CoreHAP */ @interface HAPWACScanRequest : NSObject <NSCopying> { id /* block */ _completion; HAPWACScanFilter * _filter; unsigned long long _filterMethod; NSUUID * _uuid; } @property (nonatomic, copy) id /* block */ completion; @property (nonatomic, retain) HAPWACScanFilter *filter; @property (nonatomic, readonly) unsigned long long filterMethod; @property (nonatomic, copy) NSUUID *uuid; - (void).cxx_destruct; - (id /* block */)completion; - (id)copyWithZone:(struct _NSZone { }*)arg1; - (void)dealloc; - (id)filter; - (unsigned long long)filterMethod; - (unsigned long long)hash; - (id)init; - (id)initWithFilter:(id)arg1 completion:(id /* block */)arg2; - (bool)isEqual:(id)arg1; - (bool)isEqualToWACScanRequest:(id)arg1; - (void)setCompletion:(id /* block */)arg1; - (void)setFilter:(id)arg1; - (void)setUuid:(id)arg1; - (id)uuid; @end
{ "pile_set_name": "Github" }
/* * cliff.js: CLI output formatting tools: "Your CLI Formatting Friend". * * (C) 2010, Nodejitsu Inc. * */ var colors = require('colors'), eyes = require('eyes'), winston = require('winston'); var cliff = exports, logger; cliff.__defineGetter__('logger', function () { delete cliff.logger; return cliff.logger = logger; }); cliff.__defineSetter__('logger', function (val) { logger = val; // // Setup winston to use the `cli` formats // if (logger.cli) { logger.cli(); } }); // // Set the default logger for cliff. // cliff.logger = new winston.Logger({ transports: [new winston.transports.Console()] }); // // Expose a default `eyes` inspector. // cliff.inspector = eyes.inspector; cliff.inspect = eyes.inspector({ stream: null, styles: { // Styles applied to stdout all: null, // Overall style applied to everything label: 'underline', // Inspection labels, like 'array' in `array: [1, 2, 3]` other: 'inverted', // Objects which don't have a literal representation, such as functions key: 'grey', // The keys in object literals, like 'a' in `{a: 1}` special: 'grey', // null, undefined... number: 'blue', // 0, 1, 2... bool: 'magenta', // true false regexp: 'green' // /\d+/ } }); // // ### function extractFrom (obj, properties) // #### @obj {Object} Object to extract properties from. // #### @properties {Array} List of properties to output. // Creates an array representing the values for `properties` in `obj`. // cliff.extractFrom = function (obj, properties) { return properties.map(function (p) { return obj[p]; }); }; // // ### function columnMajor (rows) // #### @rows {ArrayxArray} Row-major Matrix to transpose // Transposes the row-major Matrix, represented as an array of rows, // into column major form (i.e. an array of columns). // cliff.columnMajor = function (rows) { var columns = []; rows.forEach(function (row) { for (var i = 0; i < row.length; i += 1) { if (!columns[i]) { columns[i] = []; } columns[i].push(row[i]); } }); return columns; }; // // ### arrayLengths (arrs) // #### @arrs {ArrayxArray} Arrays to calculate lengths for // Creates an array with values each representing the length // of an array in the set provided. // cliff.arrayLengths = function (arrs) { var i, lengths = []; for (i = 0; i < arrs.length; i += 1) { lengths.push(longestElement(arrs[i].map(cliff.stringifyLiteral))); } return lengths; }; // // ### function stringifyRows (rows, colors) // #### @rows {ArrayxArray} Matrix of properties to output in row major form // #### @colors {Array} Set of colors to use for the headers // Outputs the specified `rows` as fixed-width columns, adding // colorized headers if `colors` are supplied. // cliff.stringifyRows = function (rows, colors, options) { var lengths, columns, output = [], headers; options = options || {}; options.columnSpacing = options.columnSpacing || 2; columns = cliff.columnMajor(rows); lengths = cliff.arrayLengths(columns); function stringifyRow(row, colorize) { var rowtext = '', padding, item, i, length; for (i = 0; i < row.length; i += 1) { item = cliff.stringifyLiteral(row[i]); if(colorize) { item = item[colors[i]] || item[colors[colors.length -1]] || item; } length = realLength(item); padding = length < lengths[i] ? lengths[i] - length + options.columnSpacing : options.columnSpacing ; rowtext += item + new Array(padding).join(' '); } output.push(rowtext); } // If we were passed colors, then assume the first row // is the headers for the rows if (colors) { headers = rows.splice(0, 1)[0]; stringifyRow(headers, true); } rows.forEach(function (row) { stringifyRow(row, false); }); return output.join('\n'); }; // // ### function rowifyObjects (objs, properties, colors) // #### @objs {Array} List of objects to create output for // #### @properties {Array} List of properties to output // #### @colors {Array} Set of colors to use for the headers // Extracts the lists of `properties` from the specified `objs` // and formats them according to `cliff.stringifyRows`. // cliff.stringifyObjectRows = cliff.rowifyObjects = function (objs, properties, colors, options) { var rows = [properties].concat(objs.map(function (obj) { return cliff.extractFrom(obj, properties); })); return cliff.stringifyRows(rows, colors, options); }; // // ### function putRows (level, rows, colors) // #### @level {String} Log-level to use // #### @rows {Array} Array of rows to log at the specified level // #### @colors {Array} Set of colors to use for the specified row(s) headers. // Logs the stringified table result from `rows` at the appropriate `level` using // `cliff.logger`. If `colors` are supplied then use those when stringifying `rows`. // cliff.putRows = function (level, rows, colors) { cliff.stringifyRows(rows, colors).split('\n').forEach(function (str) { logger.log(level, str); }); }; // // ### function putObjectRows (level, rows, colors) // #### @level {String} Log-level to use // #### @objs {Array} List of objects to create output for // #### @properties {Array} List of properties to output // #### @colors {Array} Set of colors to use for the headers // Logs the stringified table result from `objs` at the appropriate `level` using // `cliff.logger`. If `colors` are supplied then use those when stringifying `objs`. // cliff.putObjectRows = function (level, objs, properties, colors) { cliff.rowifyObjects(objs, properties, colors).split('\n').forEach(function (str) { logger.log(level, str); }); }; // // ### function putObject (obj, [rewriters, padding]) // #### @obj {Object} Object to log to the command line // #### @rewriters {Object} **Optional** Set of methods to rewrite certain object keys // #### @padding {Number} **Optional** Length of padding to put around the output. // Inspects the object `obj` on the command line rewriting any properties which match // keys in `rewriters` if any. Adds additional `padding` if supplied. // cliff.putObject = function (/*obj, [rewriters, padding] */) { var args = Array.prototype.slice.call(arguments), obj = args.shift(), padding = typeof args[args.length - 1] === 'number' && args.pop(), rewriters = typeof args[args.length -1] === 'object' && args.pop(), keys = Object.keys(obj).sort(), sorted = {}, matchers = {}, inspected; padding = padding || 0; rewriters = rewriters || {}; function pad () { for (var i = 0; i < padding / 2; i++) { logger.data(''); } } keys.forEach(function (key) { sorted[key] = obj[key]; }); inspected = cliff.inspect(sorted); Object.keys(rewriters).forEach(function (key) { matchers[key] = new RegExp(key); }); pad(); inspected.split('\n').forEach(function (line) { Object.keys(rewriters).forEach(function (key) { if (matchers[key].test(line)) { line = rewriters[key](line); } }); logger.data(line); }); pad(); }; cliff.stringifyLiteral = function stringifyLiteral (literal) { switch (cliff.typeOf(literal)) { case 'number' : return literal + ''; case 'null' : return 'null'; case 'undefined': return 'undefined'; case 'boolean' : return literal + ''; default : return literal; } }; cliff.typeOf = function typeOf(value) { var s = typeof(value), types = [Object, Array, String, RegExp, Number, Function, Boolean, Date]; if (s === 'object' || s === 'function') { if (value) { types.forEach(function (t) { if (value instanceof t) { s = t.name.toLowerCase(); } }); } else { s = 'null'; } } return s; }; function realLength(str) { return ("" + str).replace(/\u001b\[\d+m/g,'').length; } function longestElement(a) { var l = 0; for (var i = 0; i < a.length; i++) { var new_l = realLength(a[i]); if (l < new_l) { l = new_l; } } return l; }
{ "pile_set_name": "Github" }
using System; using Microsoft.EntityFrameworkCore; using Cofoundry.Core; using Cofoundry.Core.EntityFramework; namespace Cofoundry.Domain.Data { /// <summary> /// The main Cofoundry entity framework DbContext representing all the main /// entities in the Cofoundry database. Direct access to the DbContext is /// discouraged, instead we advise you use the domain queries and commands /// available in the Cofoundry data repositories, see /// https://github.com/cofoundry-cms/cofoundry/wiki/Data-Access#repositories /// </summary> public partial class CofoundryDbContext : DbContext { private readonly ICofoundryDbContextInitializer _cofoundryDbContextInitializer; public CofoundryDbContext( ICofoundryDbContextInitializer cofoundryDbContextInitializer ) { _cofoundryDbContextInitializer = cofoundryDbContextInitializer; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { _cofoundryDbContextInitializer.Configure(this, optionsBuilder); } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder .HasDefaultSchema(DbConstants.CofoundrySchema) .MapCofoundryContent() .ApplyConfiguration(new SettingMap()) .ApplyConfiguration(new RewriteRuleMap()) ; } #region properties /// <summary> /// This queue keeps track of files belonging to assets that /// have been deleted in the system. The files don't get deleted /// at the same time as the asset record and instead are queued /// and deleted by a background task to avoid issues with file /// locking and other errors that may cause the delete operation /// to fail. It also enabled the file deletion to run in a /// transaction. /// </summary> public DbSet<AssetFileCleanupQueueItem> AssetFileCleanupQueueItems { get; set; } /// <summary> /// <para> /// Custom entity definitions are used to define the identity and /// behavior of a custom entity type. This includes meta data such /// as the name and description, but also the configuration of /// features such as whether the identity can contain a locale /// and whether versioning (i.e. auto-publish) is enabled. /// </para> /// <para> /// Definitions are defined in code by implementing ICustomEntityDefinition /// but they are also stored in the database to help with queries and data /// integrity. /// </para> /// <para> /// The code definition is the source of truth and the database is updated /// at runtime when an entity is added/updated. This is done via /// EnsureCustomEntityDefinitionExistsCommand. /// </para> /// </summary> public DbSet<CustomEntityDefinition> CustomEntityDefinitions { get; set; } /// <summary> /// <para> /// Custom entities are a flexible system for developer defined /// data structures. The identity for these entities are persisted in /// this CustomEntity table, while the majority of data is versioned in /// the CustomEntityVersion table. /// </para> /// <para> /// The CustomEntityVersion table also contains the custom data model /// data, which is serialized as unstructured data. Entity relations /// on the unstructured data model are tracked via the /// UnstructuredDataDependency table. /// </para> /// </summary> public DbSet<CustomEntity> CustomEntities { get; set; } /// <summary> /// <para> /// Custom entities can have one or more version, with a collection /// of versions representing the change history of custom entity /// data. /// </para> /// <para> /// Only one draft version can exist at any one time, and /// only one version may be published at any one time. Although /// you can revert to a previous version, this is done by copying /// the old version data to a new version, so that a full history is /// always maintained. /// </para> /// <param> /// Typically you should query for version data via the /// CustomEntityPublishStatusQuery table, which serves as a quicker /// look up for an applicable version for various PublishStatusQuery /// states. /// </param> /// </summary> public DbSet<CustomEntityVersion> CustomEntityVersions { get; set; } /// <summary> /// Page block data for a specific custom entity version on a custom entity /// details page. /// </summary> public DbSet<CustomEntityVersionPageBlock> CustomEntityVersionPageBlocks { get; set; } /// <summary> /// Lookup cache used for quickly finding the correct version for a /// specific publish status query e.g. 'Latest', 'Published', /// 'PreferPublished'. These records are generated when custom entities /// are published or unpublished. /// </summary> public DbSet<CustomEntityPublishStatusQuery> CustomEntityPublishStatusQueries { get; set; } public DbSet<EntityDefinition> EntityDefinitions { get; set; } public DbSet<DocumentAssetGroupItem> DocumentAssetGroupItems { get; set; } public DbSet<DocumentAssetGroup> DocumentAssetGroups { get; set; } /// <summary> /// Represents a non-image file that has been uploaded to the /// CMS. The name could be misleading here as any file type except /// images are supported, but at least it is less ambigous than the /// term 'file'. /// </summary> public DbSet<DocumentAsset> DocumentAssets { get; set; } public DbSet<DocumentAssetTag> DocumentAssetTags { get; set; } public DbSet<ImageAssetGroupItem> ImageAssetGroupItems { get; set; } public DbSet<ImageAssetGroup> ImageAssetGroups { get; set; } /// <summary> /// Represents an image that has been uploaded to the CMS. /// </summary> public DbSet<ImageAsset> ImageAssets { get; set; } public DbSet<ImageAssetTag> ImageAssetTags { get; set; } /// <summary> /// A Page Template represents a physical view template file and is used /// by a Page to render out content. /// </summary> public DbSet<PageTemplate> PageTemplates { get; set; } /// <summary> /// Each PageTemplate can have zero or more regions which are defined in the /// template file using the CofoundryTemplate helper, /// e.g. @Cofoundry.Template.Region("MyRegionName"). These regions represent /// areas where page blocks can be placed (i.e. insert content). /// </summary> public DbSet<PageTemplateRegion> PageTemplateRegions { get; set; } public DbSet<Locale> Locales { get; set; } /// <summary> /// Pages represent the dynamically navigable pages of your website. Each page uses a template /// which defines the regions of content that users can edit. Pages are a versioned entity and /// therefore have many page version records. At one time a page may only have one draft /// version, but can have many published versions; the latest published version is the one that /// is rendered when the page is published. /// </summary> public DbSet<Page> Pages { get; set; } /// <summary> /// Represents a folder in the dynamic web page heirarchy. There is always a /// single root directory. /// </summary> public DbSet<PageDirectory> PageDirectories { get; set; } public DbSet<PageDirectoryLocale> PageDirectoryLocales { get; set; } /// <summary> /// A block can optionally have display templates associated with it, /// which will give the user a choice about how the data is rendered out /// e.g. 'Wide', 'Headline', 'Large', 'Reversed'. If no template is set then /// the default view is used for rendering. /// </summary> public DbSet<PageBlockTypeTemplate> PageBlockTypeTemplates { get; set; } /// <summary> /// Page block types represent a type of content that can be inserted into a content /// region of a page which could be simple content like 'RawHtml', 'Image' or /// 'PlainText'. Custom and more complex block types can be defined by a /// developer. Block types are typically created when the application /// starts up in the auto-update process. /// </summary> public DbSet<PageBlockType> PageBlockTypes { get; set; } public DbSet<PageGroupItem> PageGroupItems { get; set; } public DbSet<PageGroup> PageGroups { get; set; } public DbSet<PageTag> PageTags { get; set; } /// <summary> /// Pages are a versioned entity and therefore have many page version /// records. At one time a page may only have one draft version, but /// can have many published versions; the latest published version is /// the one that is rendered when the page is published. /// </summary> public DbSet<PageVersion> PageVersions { get; set; } public DbSet<PageVersionBlock> PageVersionBlocks { get; set; } /// <summary> /// Lookup cache used for quickly finding the correct version for a /// specific publish status query e.g. 'Latest', 'Published', /// 'PreferPublished'. These records are generated when pages /// are published or unpublished. /// </summary> public DbSet<PagePublishStatusQuery> PagePublishStatusQueries { get; set; } /// <summary> /// A permission represents an type action a user can /// be permitted to perform. Typically this is associated /// with a specified entity type, but doesn't have to be e.g. /// "read pages", "access dashboard", "delete images". The /// combination of EntityDefinitionCode and PermissionCode /// must be unique /// </summary> public DbSet<Permission> Permissions { get; set; } public DbSet<RewriteRule> RewriteRules { get; set; } /// <summary> /// Roles are an assignable collection of permissions. Every user has to /// be assigned to one role. /// </summary> public DbSet<Role> Roles { get; set; } public DbSet<RolePermission> RolePermissions { get; set; } public DbSet<Setting> Settings { get; set; } public DbSet<Tag> Tags { get; set; } /// <summary> /// Represents the user in the Cofoundry custom identity system. Users can be partitioned into /// different 'User Areas' that enabled the identity system use by the Cofoundry administration area /// to be reused for other purposes, but this isn't a common scenario and often there will only be the Cofoundry UserArea. /// </summary> public DbSet<User> Users { get; set; } /// <summary> /// Users can be partitioned into different 'User Areas' that enabled the identity system use by the Cofoundry administration area /// to be reused for other purposes, but this isn't a common scenario and often there will only be the Cofoundry UserArea. UserAreas /// are defined in code by defining an IUserAreaDefinition /// </summary> public DbSet<UserArea> UserAreas { get; set; } public DbSet<UserPasswordResetRequest> UserPasswordResetRequests { get; set; } /// <summary> /// Contains a record of a relation between one entitiy and another /// when it's defined in unstructured data. Also contains information on how deletions /// should cascade for the relationship. /// </summary> public DbSet<UnstructuredDataDependency> UnstructuredDataDependencies { get; set; } #endregion } }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <meta charset="utf-8"> <title>Scrollboxes with uniform backgrounds should pull that color into their contents</title> <style> div { min-height: 50px; box-model: border-box; } .first, .second { border: 1px solid blue; margin: 50px 0; } .border { border: 1px solid black; } .scrollable { height: auto; overflow: auto; } .scrollarea { width: 5000px; border: none; padding: 10px 0 20px; height: auto; } .scrolled { margin-left: 220px; width: 100px; height: 100px; border-color: red; } body { margin: 0; padding: 0 100px; height: 3000px; } </style> <div class="first" reftest-assigned-layer="page-background"> <!-- This is just a regular box, it should end up in the page background layer. --> </div> <div class="scrollable border"> <div class="scrollarea"> <div class="scrolled border reftest-opaque-layer"> <!-- The background of .scrollable is uniform and opaque, .scrolled should be able to pull up that background color and become opaque itself. --> </div> </div> </div> <div class="second" reftest-assigned-layer="page-background"> <!-- This should share a layer with .first and the page background. --> </div> <script> var scrollable = document.querySelector(".scrollable"); // Make .scrollable start out with active scrolling. scrollable.scrollLeft = 0; scrollable.scrollLeft = 20; </script>
{ "pile_set_name": "Github" }
{"version":3,"file":"mergeScan.js","sources":["../../src/add/operator/mergeScan.ts"],"names":[],"mappings":";;AAAA,8CAA4C"}
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="ASCII"?> <!--This file was created automatically by html2xhtml--> <!--from the HTML stylesheets.--> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0"> <!-- ******************************************************************** $Id: synop.xsl 9829 2013-11-05 20:07:15Z bobstayton $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://docbook.sf.net/release/xsl/current/ for copyright and other information. ******************************************************************** --> <!-- ==================================================================== --> <!-- synopsis is in verbatim --> <!-- ==================================================================== --> <xsl:template match="cmdsynopsis"> <div> <xsl:apply-templates select="." mode="common.html.attributes"/> <p> <xsl:call-template name="id.attribute"> <xsl:with-param name="conditional" select="0"/> </xsl:call-template> <xsl:choose> <xsl:when test="..//processing-instruction('dbcmdlist')"> <!-- * Placing a dbcmdlist PI as a child of a particular element --> <!-- * creates a hyperlinked list of all cmdsynopsis instances --> <!-- * that are descendants of that element; so for any --> <!-- * cmdsynopsis that is a descendant of an element containing --> <!-- * a dbcmdlist PI, we need to output an a@id instance so that --> <!-- * we will have something to link to --> <xsl:call-template name="anchor"> <xsl:with-param name="conditional" select="0"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="anchor"> <xsl:with-param name="conditional" select="1"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> <xsl:apply-templates/> </p> </div> </xsl:template> <xsl:template match="cmdsynopsis/command"> <br/> <xsl:call-template name="inline.monoseq"/> <xsl:text> </xsl:text> </xsl:template> <xsl:template match="cmdsynopsis/command[1]" priority="2"> <xsl:call-template name="inline.monoseq"/> <xsl:text> </xsl:text> </xsl:template> <xsl:template match="group|arg" name="group-or-arg"> <xsl:variable name="choice" select="@choice"/> <xsl:variable name="rep" select="@rep"/> <xsl:variable name="sepchar"> <xsl:choose> <xsl:when test="ancestor-or-self::*/@sepchar"> <xsl:value-of select="ancestor-or-self::*/@sepchar"/> </xsl:when> <xsl:otherwise> <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="preceding-sibling::*"> <xsl:value-of select="$sepchar"/> </xsl:if> <xsl:choose> <xsl:when test="$choice='plain'"> <xsl:value-of select="$arg.choice.plain.open.str"/> </xsl:when> <xsl:when test="$choice='req'"> <xsl:value-of select="$arg.choice.req.open.str"/> </xsl:when> <xsl:when test="$choice='opt'"> <xsl:value-of select="$arg.choice.opt.open.str"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$arg.choice.def.open.str"/> </xsl:otherwise> </xsl:choose> <xsl:apply-templates/> <xsl:choose> <xsl:when test="$rep='repeat'"> <xsl:value-of select="$arg.rep.repeat.str"/> </xsl:when> <xsl:when test="$rep='norepeat'"> <xsl:value-of select="$arg.rep.norepeat.str"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$arg.rep.def.str"/> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="$choice='plain'"> <xsl:value-of select="$arg.choice.plain.close.str"/> </xsl:when> <xsl:when test="$choice='req'"> <xsl:value-of select="$arg.choice.req.close.str"/> </xsl:when> <xsl:when test="$choice='opt'"> <xsl:value-of select="$arg.choice.opt.close.str"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$arg.choice.def.close.str"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="group/arg"> <xsl:variable name="choice" select="@choice"/> <xsl:variable name="rep" select="@rep"/> <xsl:if test="preceding-sibling::*"> <xsl:value-of select="$arg.or.sep"/> </xsl:if> <xsl:call-template name="group-or-arg"/> </xsl:template> <xsl:template match="sbr"> <br/> </xsl:template> <!-- ==================================================================== --> <xsl:template match="synopfragmentref"> <xsl:variable name="target" select="key('id',@linkend)"/> <xsl:variable name="snum"> <xsl:apply-templates select="$target" mode="synopfragment.number"/> </xsl:variable> <em xmlns:xslo="http://www.w3.org/1999/XSL/Transform"> <a href="#{@linkend}"> <xsl:text>(</xsl:text> <xsl:value-of select="$snum"/> <xsl:text>)</xsl:text> </a> <xsl:text>&#160;</xsl:text> <xsl:apply-templates/> </em> </xsl:template> <xsl:template match="synopfragment" mode="synopfragment.number"> <xsl:number format="1"/> </xsl:template> <xsl:template match="synopfragment"> <xsl:variable name="snum"> <xsl:apply-templates select="." mode="synopfragment.number"/> </xsl:variable> <!-- You can't introduce another <p> here, because you're already in a <p> from cmdsynopsis--> <span> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <a id="{$id}"> <xsl:text>(</xsl:text> <xsl:value-of select="$snum"/> <xsl:text>)</xsl:text> </a> <xsl:text> </xsl:text> <xsl:apply-templates/> </span> </xsl:template> <xsl:template match="funcsynopsis"> <xsl:if test="..//processing-instruction('dbfunclist')"> <!-- * Placing a dbfunclist PI as a child of a particular element --> <!-- * creates a hyperlinked list of all funcsynopsis instances that --> <!-- * are descendants of that element; so for any funcsynopsis that is --> <!-- * a descendant of an element containing a dbfunclist PI, we need --> <!-- * to output an a@id instance so that we will have something to --> <!-- * link to --> <span> <xsl:call-template name="id.attribute"> <xsl:with-param name="conditional" select="0"/> </xsl:call-template> </span> <xsl:call-template name="anchor"> <xsl:with-param name="conditional" select="0"/> </xsl:call-template> </xsl:if> <xsl:call-template name="informal.object"/> </xsl:template> <xsl:template match="funcsynopsisinfo"> <pre> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates/> </pre> </xsl:template> <!-- ====================================================================== --> <!-- funcprototype --> <!-- funcprototype ::= (funcdef, (void|varargs|paramdef+)) funcdef ::= (#PCDATA|type|replaceable|function)* paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)* --> <xsl:template match="funcprototype"> <xsl:variable name="html-style"> <xsl:call-template name="pi.dbhtml_funcsynopsis-style"> <xsl:with-param name="node" select="ancestor::funcsynopsis/descendant-or-self::*"/> </xsl:call-template> </xsl:variable> <xsl:variable name="style"> <xsl:choose> <xsl:when test="$html-style != ''"> <xsl:value-of select="$html-style"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$funcsynopsis.style"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <!-- * 2008-02-17. the code no longer relies on the funcsynopsis.tabular.threshold --> <!-- * param at all (the stuff below has been commented out since mid --> <!-- * 2006), so I completely removed the funcsynopsis.tabular.threshold param --> <!-- * .. MikeSmith --> <!-- <xsl:variable name="tabular-p" select="$funcsynopsis.tabular.threshold &gt; 0 and string-length(.) &gt; $funcsynopsis.tabular.threshold"/> --> <xsl:variable name="tabular-p" select="true()"/> <xsl:choose> <xsl:when test="$style = 'kr' and $tabular-p"> <xsl:apply-templates select="." mode="kr-tabular"/> </xsl:when> <xsl:when test="$style = 'kr'"> <xsl:apply-templates select="." mode="kr-nontabular"/> </xsl:when> <xsl:when test="$style = 'ansi' and $tabular-p"> <xsl:apply-templates select="." mode="ansi-tabular"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="." mode="ansi-nontabular"/> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ====================================================================== --> <!-- funcprototype: kr, non-tabular --> <xsl:template match="funcprototype" mode="kr-nontabular"> <p> <xsl:apply-templates mode="kr-nontabular"/> <xsl:if test="paramdef"> <br/> <xsl:apply-templates select="paramdef" mode="kr-funcsynopsis-mode"/> </xsl:if> </p> </xsl:template> <xsl:template match="funcdef" mode="kr-nontabular"> <code> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="kr-nontabular"/> <xsl:text>(</xsl:text> </code> </xsl:template> <xsl:template match="funcdef/function" mode="kr-nontabular"> <xsl:choose> <xsl:when test="$funcsynopsis.decoration != 0"> <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">fsfunc<xsl:apply-templates mode="kr-nontabular"/></strong> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="kr-nontabular"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="void" mode="kr-nontabular"> <code>)</code> <xsl:text>;</xsl:text> </xsl:template> <xsl:template match="varargs" mode="kr-nontabular"> <xsl:text>...</xsl:text> <code>)</code> <xsl:text>;</xsl:text> </xsl:template> <xsl:template match="paramdef" mode="kr-nontabular"> <xsl:apply-templates select="parameter" mode="kr-nontabular"/> <xsl:choose> <xsl:when test="following-sibling::*"> <xsl:text>, </xsl:text> </xsl:when> <xsl:otherwise> <code>)</code> <xsl:text>;</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="paramdef/parameter" mode="kr-nontabular"> <xsl:choose> <xsl:when test="$funcsynopsis.decoration != 0"> <var class="pdparam"> <xsl:apply-templates mode="kr-nontabular"/> </var> </xsl:when> <xsl:otherwise> <code> <xsl:apply-templates mode="kr-nontabular"/> </code> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="paramdef" mode="kr-funcsynopsis-mode"> <xsl:if test="preceding-sibling::paramdef"><br/></xsl:if> <code> <xsl:apply-templates mode="kr-funcsynopsis-mode"/> </code> <xsl:text>;</xsl:text> </xsl:template> <xsl:template match="paramdef/parameter" mode="kr-funcsynopsis-mode"> <xsl:choose> <xsl:when test="$funcsynopsis.decoration != 0"> <var class="pdparam"> <xsl:apply-templates mode="kr-funcsynopsis-mode"/> </var> </xsl:when> <xsl:otherwise> <code> <xsl:apply-templates mode="kr-funcsynopsis-mode"/> </code> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="funcparams" mode="kr-funcsynopsis-mode"> <code>(</code> <xsl:apply-templates mode="kr-funcsynopsis-mode"/> <code>)</code> </xsl:template> <!-- ====================================================================== --> <!-- funcprototype: kr, tabular --> <xsl:template match="funcprototype" mode="kr-tabular"> <table border="{$table.border.off}" class="funcprototype-table"> <xsl:if test="$div.element != 'section'"> <xsl:attribute name="summary">Function synopsis</xsl:attribute> </xsl:if> <xsl:if test="$css.decoration != 0"> <xsl:attribute name="style">cellspacing: 0; cellpadding: 0;</xsl:attribute> </xsl:if> <tr> <td> <xsl:apply-templates select="funcdef" mode="kr-tabular"/> </td> <xsl:apply-templates select="(void|varargs|paramdef)[1]" mode="kr-tabular"/> </tr> <xsl:for-each select="(void|varargs|paramdef)[preceding-sibling::*[not(self::funcdef)]]"> <tr> <td>&#160;</td> <xsl:apply-templates select="." mode="kr-tabular"/> </tr> </xsl:for-each> </table> <xsl:if test="paramdef"> <div class="paramdef-list"> <xsl:apply-templates select="paramdef" mode="kr-funcsynopsis-mode"/> </div> </xsl:if> <div class="funcprototype-spacer">&#160;</div> <!-- hACk: blank div for vertical spacing --> </xsl:template> <xsl:template match="funcdef" mode="kr-tabular"> <code> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="kr-tabular"/> <xsl:text>(</xsl:text> </code> </xsl:template> <xsl:template match="funcdef/function" mode="kr-tabular"> <xsl:choose> <xsl:when test="$funcsynopsis.decoration != 0"> <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">fsfunc<xsl:apply-templates mode="kr-nontabular"/></strong> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="kr-tabular"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="void" mode="kr-tabular"> <td> <code>)</code> <xsl:text>;</xsl:text> </td> <td>&#160;</td> </xsl:template> <xsl:template match="varargs" mode="kr-tabular"> <td> <xsl:text>...</xsl:text> <code>)</code> <xsl:text>;</xsl:text> </td> <td>&#160;</td> </xsl:template> <xsl:template match="paramdef" mode="kr-tabular"> <td> <xsl:apply-templates select="parameter" mode="kr-tabular"/> <xsl:choose> <xsl:when test="following-sibling::*"> <xsl:text>, </xsl:text> </xsl:when> <xsl:otherwise> <code>)</code> <xsl:text>;</xsl:text> </xsl:otherwise> </xsl:choose> </td> <td>&#160;</td> </xsl:template> <xsl:template match="paramdef/parameter" mode="kr-tabular"> <xsl:choose> <xsl:when test="$funcsynopsis.decoration != 0"> <var class="pdparam"> <xsl:apply-templates mode="kr-tabular"/> </var> </xsl:when> <xsl:otherwise> <code> <xsl:apply-templates mode="kr-tabular"/> </code> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="paramdef" mode="kr-tabular-funcsynopsis-mode"> <xsl:variable name="type"> <xsl:choose> <xsl:when test="type"> <xsl:apply-templates select="type" mode="kr-tabular-funcsynopsis-mode"/> </xsl:when> <xsl:when test="normalize-space(parameter/preceding-sibling::node()[not(self::parameter)]) != ''"> <xsl:copy-of select="parameter/preceding-sibling::node()[not(self::parameter)]"/> </xsl:when> </xsl:choose> </xsl:variable> <tr> <xsl:choose> <xsl:when test="$type != '' and funcparams"> <td> <code> <xsl:copy-of select="$type"/> </code> <xsl:text>&#160;</xsl:text> </td> <td> <code> <xsl:choose> <xsl:when test="type"> <xsl:apply-templates select="type/following-sibling::*" mode="kr-tabular-funcsynopsis-mode"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="*" mode="kr-tabular-funcsynopsis-mode"/> </xsl:otherwise> </xsl:choose> </code> </td> </xsl:when> <xsl:when test="funcparams"> <td colspan="2"> <code> <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/> </code> </td> </xsl:when> <xsl:otherwise> <td> <code> <xsl:apply-templates select="parameter/preceding-sibling::node()[not(self::parameter)]" mode="kr-tabular-funcsynopsis-mode"/> </code> <xsl:text>&#160;</xsl:text> </td> <td> <code> <xsl:apply-templates select="parameter" mode="kr-tabular"/> <xsl:apply-templates select="parameter/following-sibling::*[not(self::parameter)]" mode="kr-tabular-funcsynopsis-mode"/> <xsl:text>;</xsl:text> </code> </td> </xsl:otherwise> </xsl:choose> </tr> </xsl:template> <xsl:template match="paramdef/parameter" mode="kr-tabular-funcsynopsis-mode"> <xsl:choose> <xsl:when test="$funcsynopsis.decoration != 0"> <var class="pdparam"> <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/> </var> </xsl:when> <xsl:otherwise> <code> <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/> </code> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="funcparams" mode="kr-tabular-funcsynopsis-mode"> <code>(</code> <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/> <code>)</code> <xsl:text>;</xsl:text> </xsl:template> <!-- ====================================================================== --> <!-- funcprototype: ansi, non-tabular --> <xsl:template match="funcprototype" mode="ansi-nontabular"> <p> <xsl:apply-templates mode="ansi-nontabular"/> </p> </xsl:template> <xsl:template match="funcdef" mode="ansi-nontabular"> <code> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="ansi-nontabular"/> <xsl:text>(</xsl:text> </code> </xsl:template> <xsl:template match="funcdef/function" mode="ansi-nontabular"> <xsl:choose> <xsl:when test="$funcsynopsis.decoration != 0"> <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">fsfunc<xsl:apply-templates mode="ansi-nontabular"/></strong> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="ansi-nontabular"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="void" mode="ansi-nontabular"> <code>void)</code> <xsl:text>;</xsl:text> </xsl:template> <xsl:template match="varargs" mode="ansi-nontabular"> <xsl:text>...</xsl:text> <code>)</code> <xsl:text>;</xsl:text> </xsl:template> <xsl:template match="paramdef" mode="ansi-nontabular"> <xsl:apply-templates mode="ansi-nontabular"/> <xsl:choose> <xsl:when test="following-sibling::*"> <xsl:text>, </xsl:text> </xsl:when> <xsl:otherwise> <code>)</code> <xsl:text>;</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="paramdef/parameter" mode="ansi-nontabular"> <xsl:choose> <xsl:when test="$funcsynopsis.decoration != 0"> <var class="pdparam"> <xsl:apply-templates mode="ansi-nontabular"/> </var> </xsl:when> <xsl:otherwise> <code> <xsl:apply-templates mode="ansi-nontabular"/> </code> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="funcparams" mode="ansi-nontabular"> <code>(</code> <xsl:apply-templates mode="ansi-nontabular"/> <code>)</code> </xsl:template> <!-- ====================================================================== --> <!-- funcprototype: ansi, tabular --> <xsl:template match="funcprototype" mode="ansi-tabular"> <table border="{$table.border.off}" class="funcprototype-table"> <xsl:if test="$div.element != 'section'"> <xsl:attribute name="summary">Function synopsis</xsl:attribute> </xsl:if> <xsl:if test="$css.decoration != 0"> <xsl:attribute name="style">cellspacing: 0; cellpadding: 0;</xsl:attribute> </xsl:if> <tr> <td> <xsl:apply-templates select="funcdef" mode="ansi-tabular"/> </td> <xsl:apply-templates select="(void|varargs|paramdef)[1]" mode="ansi-tabular"/> </tr> <xsl:for-each select="(void|varargs|paramdef)[preceding-sibling::*[not(self::funcdef)]]"> <tr> <td>&#160;</td> <xsl:apply-templates select="." mode="ansi-tabular"/> </tr> </xsl:for-each> </table> <div class="funcprototype-spacer">&#160;</div> <!-- hACk: blank div for vertical spacing --> </xsl:template> <xsl:template match="funcdef" mode="ansi-tabular"> <code> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="ansi-tabular"/> <xsl:text>(</xsl:text> </code> </xsl:template> <xsl:template match="funcdef/function" mode="ansi-tabular"> <xsl:choose> <xsl:when test="$funcsynopsis.decoration != 0"> <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">fsfunc<xsl:apply-templates mode="ansi-nontabular"/></strong> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="kr-tabular"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="void" mode="ansi-tabular"> <td> <code>void)</code> <xsl:text>;</xsl:text> </td> <td>&#160;</td> </xsl:template> <xsl:template match="varargs" mode="ansi-tabular"> <td> <xsl:text>...</xsl:text> <code>)</code> <xsl:text>;</xsl:text> </td> <td>&#160;</td> </xsl:template> <xsl:template match="paramdef" mode="ansi-tabular"> <td> <xsl:apply-templates mode="ansi-tabular"/> <xsl:choose> <xsl:when test="following-sibling::*"> <xsl:text>, </xsl:text> </xsl:when> <xsl:otherwise> <code>)</code> <xsl:text>;</xsl:text> </xsl:otherwise> </xsl:choose> </td> </xsl:template> <xsl:template match="paramdef/parameter" mode="ansi-tabular"> <xsl:choose> <xsl:when test="$funcsynopsis.decoration != 0"> <var class="pdparam"> <xsl:apply-templates mode="ansi-tabular"/> </var> </xsl:when> <xsl:otherwise> <code> <xsl:apply-templates mode="ansi-tabular"/> </code> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="funcparams" mode="ansi-tabular"> <code>(</code> <xsl:apply-templates/> <code>)</code> </xsl:template> <!-- ====================================================================== --> <xsl:variable name="default-classsynopsis-language">java</xsl:variable> <xsl:template match="classsynopsis |fieldsynopsis |methodsynopsis |constructorsynopsis |destructorsynopsis"> <xsl:param name="language"> <xsl:choose> <xsl:when test="@language"> <xsl:value-of select="@language"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$default-classsynopsis-language"/> </xsl:otherwise> </xsl:choose> </xsl:param> <xsl:choose> <xsl:when test="$language='java' or $language='Java'"> <xsl:apply-templates select="." mode="java"/> </xsl:when> <xsl:when test="$language='perl' or $language='Perl'"> <xsl:apply-templates select="." mode="perl"/> </xsl:when> <xsl:when test="$language='idl' or $language='IDL'"> <xsl:apply-templates select="." mode="idl"/> </xsl:when> <xsl:when test="$language='cpp' or $language='c++' or $language='C++'"> <xsl:apply-templates select="." mode="cpp"/> </xsl:when> <xsl:otherwise> <xsl:message> <xsl:text>Unrecognized language on </xsl:text> <xsl:value-of select="local-name(.)"/> <xsl:text>: </xsl:text> <xsl:value-of select="$language"/> </xsl:message> <xsl:apply-templates select="."> <xsl:with-param name="language" select="$default-classsynopsis-language"/> </xsl:apply-templates> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="synop-break"> <xsl:if test="parent::classsynopsis or (following-sibling::fieldsynopsis |following-sibling::methodsynopsis |following-sibling::constructorsynopsis |following-sibling::destructorsynopsis)"> <br/> </xsl:if> </xsl:template> <!-- ===== Java ======================================================== --> <xsl:template match="classsynopsis" mode="java"> <pre> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates select="ooclass[1]" mode="java"/> <xsl:if test="ooclass[preceding-sibling::*]"> <xsl:text> extends</xsl:text> <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="java"/> <xsl:if test="oointerface|ooexception"> <br/> <xsl:text>&#160;&#160;&#160;&#160;</xsl:text> </xsl:if> </xsl:if> <xsl:if test="oointerface"> <xsl:text>implements</xsl:text> <xsl:apply-templates select="oointerface" mode="java"/> <xsl:if test="ooexception"> <br/> <xsl:text>&#160;&#160;&#160;&#160;</xsl:text> </xsl:if> </xsl:if> <xsl:if test="ooexception"> <xsl:text>throws</xsl:text> <xsl:apply-templates select="ooexception" mode="java"/> </xsl:if> <xsl:text>&#160;{</xsl:text> <br/> <xsl:apply-templates select="constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode="java"/> <xsl:text>}</xsl:text> </pre> </xsl:template> <xsl:template match="classsynopsisinfo" mode="java"> <xsl:apply-templates mode="java"/> </xsl:template> <xsl:template match="ooclass|oointerface|ooexception" mode="java"> <xsl:choose> <xsl:when test="preceding-sibling::*"> <xsl:text>, </xsl:text> </xsl:when> <xsl:otherwise> <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="java"/> </span> </xsl:template> <xsl:template match="modifier|package" mode="java"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="java"/> <xsl:if test="following-sibling::*"> <xsl:text>&#160;</xsl:text> </xsl:if> </span> </xsl:template> <xsl:template match="classname" mode="java"> <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="java"/> </span> </xsl:template> <xsl:template match="interfacename" mode="java"> <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="java"/> </span> </xsl:template> <xsl:template match="exceptionname" mode="java"> <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="java"/> </span> </xsl:template> <xsl:template match="fieldsynopsis" mode="java"> <code> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:if test="parent::classsynopsis"> <xsl:text>&#160;&#160;</xsl:text> </xsl:if> <xsl:apply-templates mode="java"/> <xsl:text>;</xsl:text> </code> <xsl:call-template name="synop-break"/> </xsl:template> <xsl:template match="type" mode="java"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="java"/> <xsl:text>&#160;</xsl:text> </span> </xsl:template> <xsl:template match="varname" mode="java"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="java"/> <xsl:text>&#160;</xsl:text> </span> </xsl:template> <xsl:template match="initializer" mode="java"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:text>=&#160;</xsl:text> <xsl:apply-templates mode="java"/> </span> </xsl:template> <xsl:template match="void" mode="java"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:text>void&#160;</xsl:text> </span> </xsl:template> <xsl:template match="methodname" mode="java"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="java"/> </span> </xsl:template> <xsl:template match="methodparam" mode="java"> <xsl:param name="indent">0</xsl:param> <xsl:if test="preceding-sibling::methodparam"> <xsl:text>,</xsl:text> <br/> <xsl:if test="$indent &gt; 0"> <xsl:call-template name="copy-string"> <xsl:with-param name="string">&#160;</xsl:with-param> <xsl:with-param name="count" select="$indent + 1"/> </xsl:call-template> </xsl:if> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="java"/> </span> </xsl:template> <xsl:template match="parameter" mode="java"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="java"/> </span> </xsl:template> <xsl:template mode="java" match="constructorsynopsis|destructorsynopsis|methodsynopsis"> <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/> <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/> <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/> <xsl:variable name="decl"> <xsl:if test="parent::classsynopsis"> <xsl:text>&#160;&#160;</xsl:text> </xsl:if> <xsl:apply-templates select="$start-modifiers" mode="java"/> <!-- type --> <xsl:if test="local-name($notmod[1]) != 'methodname'"> <xsl:apply-templates select="$notmod[1]" mode="java"/> </xsl:if> <xsl:apply-templates select="methodname" mode="java"/> </xsl:variable> <code> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:copy-of select="$decl"/> <xsl:text>(</xsl:text> <xsl:apply-templates select="methodparam" mode="java"> <xsl:with-param name="indent" select="string-length($decl)"/> </xsl:apply-templates> <xsl:text>)</xsl:text> <xsl:if test="exceptionname"> <br/> <xsl:text>&#160;&#160;&#160;&#160;throws&#160;</xsl:text> <xsl:apply-templates select="exceptionname" mode="java"/> </xsl:if> <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"> <xsl:text> </xsl:text> <xsl:apply-templates select="$end-modifiers" mode="java"/> </xsl:if> <xsl:text>;</xsl:text> </code> <xsl:call-template name="synop-break"/> </xsl:template> <!-- ===== C++ ========================================================= --> <xsl:template match="classsynopsis" mode="cpp"> <pre> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates select="ooclass[1]" mode="cpp"/> <xsl:if test="ooclass[preceding-sibling::*]"> <xsl:text>: </xsl:text> <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="cpp"/> <xsl:if test="oointerface|ooexception"> <br/> <xsl:text>&#160;&#160;&#160;&#160;</xsl:text> </xsl:if> </xsl:if> <xsl:if test="oointerface"> <xsl:text> implements</xsl:text> <xsl:apply-templates select="oointerface" mode="cpp"/> <xsl:if test="ooexception"> <br/> <xsl:text>&#160;&#160;&#160;&#160;</xsl:text> </xsl:if> </xsl:if> <xsl:if test="ooexception"> <xsl:text> throws</xsl:text> <xsl:apply-templates select="ooexception" mode="cpp"/> </xsl:if> <xsl:text>&#160;{</xsl:text> <br/> <xsl:apply-templates select="constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode="cpp"/> <xsl:text>}</xsl:text> </pre> </xsl:template> <xsl:template match="classsynopsisinfo" mode="cpp"> <xsl:apply-templates mode="cpp"/> </xsl:template> <xsl:template match="ooclass|oointerface|ooexception" mode="cpp"> <xsl:if test="preceding-sibling::*"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="cpp"/> </span> </xsl:template> <xsl:template match="modifier|package" mode="cpp"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="cpp"/> <xsl:if test="following-sibling::*"> <xsl:text>&#160;</xsl:text> </xsl:if> </span> </xsl:template> <xsl:template match="classname" mode="cpp"> <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="cpp"/> </span> </xsl:template> <xsl:template match="interfacename" mode="cpp"> <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="cpp"/> </span> </xsl:template> <xsl:template match="exceptionname" mode="cpp"> <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="cpp"/> </span> </xsl:template> <xsl:template match="fieldsynopsis" mode="cpp"> <code> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:if test="parent::classsynopsis"> <xsl:text>&#160;&#160;</xsl:text> </xsl:if> <xsl:apply-templates mode="cpp"/> <xsl:text>;</xsl:text> </code> <xsl:call-template name="synop-break"/> </xsl:template> <xsl:template match="type" mode="cpp"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="cpp"/> <xsl:text>&#160;</xsl:text> </span> </xsl:template> <xsl:template match="varname" mode="cpp"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="cpp"/> <xsl:text>&#160;</xsl:text> </span> </xsl:template> <xsl:template match="initializer" mode="cpp"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:text>=&#160;</xsl:text> <xsl:apply-templates mode="cpp"/> </span> </xsl:template> <xsl:template match="void" mode="cpp"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:text>void&#160;</xsl:text> </span> </xsl:template> <xsl:template match="methodname" mode="cpp"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="cpp"/> </span> </xsl:template> <xsl:template match="methodparam" mode="cpp"> <xsl:if test="preceding-sibling::methodparam"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="cpp"/> </span> </xsl:template> <xsl:template match="parameter" mode="cpp"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="cpp"/> </span> </xsl:template> <xsl:template mode="cpp" match="constructorsynopsis|destructorsynopsis|methodsynopsis"> <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/> <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/> <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/> <code> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:if test="parent::classsynopsis"> <xsl:text>&#160;&#160;</xsl:text> </xsl:if> <xsl:apply-templates select="$start-modifiers" mode="cpp"/> <!-- type --> <xsl:if test="local-name($notmod[1]) != 'methodname'"> <xsl:apply-templates select="$notmod[1]" mode="cpp"/> </xsl:if> <xsl:apply-templates select="methodname" mode="cpp"/> <xsl:text>(</xsl:text> <xsl:apply-templates select="methodparam" mode="cpp"/> <xsl:text>)</xsl:text> <xsl:if test="exceptionname"> <br/> <xsl:text>&#160;&#160;&#160;&#160;throws&#160;</xsl:text> <xsl:apply-templates select="exceptionname" mode="cpp"/> </xsl:if> <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"> <xsl:text> </xsl:text> <xsl:apply-templates select="$end-modifiers" mode="cpp"/> </xsl:if> <xsl:text>;</xsl:text> </code> <xsl:call-template name="synop-break"/> </xsl:template> <!-- ===== IDL ========================================================= --> <xsl:template match="classsynopsis" mode="idl"> <pre> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:text>interface </xsl:text> <xsl:apply-templates select="ooclass[1]" mode="idl"/> <xsl:if test="ooclass[preceding-sibling::*]"> <xsl:text>: </xsl:text> <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="idl"/> <xsl:if test="oointerface|ooexception"> <br/> <xsl:text>&#160;&#160;&#160;&#160;</xsl:text> </xsl:if> </xsl:if> <xsl:if test="oointerface"> <xsl:text> implements</xsl:text> <xsl:apply-templates select="oointerface" mode="idl"/> <xsl:if test="ooexception"> <br/> <xsl:text>&#160;&#160;&#160;&#160;</xsl:text> </xsl:if> </xsl:if> <xsl:if test="ooexception"> <xsl:text> throws</xsl:text> <xsl:apply-templates select="ooexception" mode="idl"/> </xsl:if> <xsl:text>&#160;{</xsl:text> <br/> <xsl:apply-templates select="constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode="idl"/> <xsl:text>}</xsl:text> </pre> </xsl:template> <xsl:template match="classsynopsisinfo" mode="idl"> <xsl:apply-templates mode="idl"/> </xsl:template> <xsl:template match="ooclass|oointerface|ooexception" mode="idl"> <xsl:if test="preceding-sibling::*"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="idl"/> </span> </xsl:template> <xsl:template match="modifier|package" mode="idl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="idl"/> <xsl:if test="following-sibling::*"> <xsl:text>&#160;</xsl:text> </xsl:if> </span> </xsl:template> <xsl:template match="classname" mode="idl"> <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="idl"/> </span> </xsl:template> <xsl:template match="interfacename" mode="idl"> <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="idl"/> </span> </xsl:template> <xsl:template match="exceptionname" mode="idl"> <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="idl"/> </span> </xsl:template> <xsl:template match="fieldsynopsis" mode="idl"> <code> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:if test="parent::classsynopsis"> <xsl:text>&#160;&#160;</xsl:text> </xsl:if> <xsl:apply-templates mode="idl"/> <xsl:text>;</xsl:text> </code> <xsl:call-template name="synop-break"/> </xsl:template> <xsl:template match="type" mode="idl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="idl"/> <xsl:text>&#160;</xsl:text> </span> </xsl:template> <xsl:template match="varname" mode="idl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="idl"/> <xsl:text>&#160;</xsl:text> </span> </xsl:template> <xsl:template match="initializer" mode="idl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:text>=&#160;</xsl:text> <xsl:apply-templates mode="idl"/> </span> </xsl:template> <xsl:template match="void" mode="idl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:text>void&#160;</xsl:text> </span> </xsl:template> <xsl:template match="methodname" mode="idl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="idl"/> </span> </xsl:template> <xsl:template match="methodparam" mode="idl"> <xsl:if test="preceding-sibling::methodparam"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="idl"/> </span> </xsl:template> <xsl:template match="parameter" mode="idl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="idl"/> </span> </xsl:template> <xsl:template mode="idl" match="constructorsynopsis|destructorsynopsis|methodsynopsis"> <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/> <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/> <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/> <code> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:if test="parent::classsynopsis"> <xsl:text>&#160;&#160;</xsl:text> </xsl:if> <xsl:apply-templates select="$start-modifiers" mode="idl"/> <!-- type --> <xsl:if test="local-name($notmod[1]) != 'methodname'"> <xsl:apply-templates select="$notmod[1]" mode="idl"/> </xsl:if> <xsl:apply-templates select="methodname" mode="idl"/> <xsl:text>(</xsl:text> <xsl:apply-templates select="methodparam" mode="idl"/> <xsl:text>)</xsl:text> <xsl:if test="exceptionname"> <br/> <xsl:text>&#160;&#160;&#160;&#160;raises(</xsl:text> <xsl:apply-templates select="exceptionname" mode="idl"/> <xsl:text>)</xsl:text> </xsl:if> <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"> <xsl:text> </xsl:text> <xsl:apply-templates select="$end-modifiers" mode="idl"/> </xsl:if> <xsl:text>;</xsl:text> </code> <xsl:call-template name="synop-break"/> </xsl:template> <!-- ===== Perl ======================================================== --> <xsl:template match="classsynopsis" mode="perl"> <pre> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:text>package </xsl:text> <xsl:apply-templates select="ooclass[1]" mode="perl"/> <xsl:text>;</xsl:text> <br/> <xsl:if test="ooclass[preceding-sibling::*]"> <xsl:text>@ISA = (</xsl:text> <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="perl"/> <xsl:text>);</xsl:text> <br/> </xsl:if> <xsl:apply-templates select="constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode="perl"/> </pre> </xsl:template> <xsl:template match="classsynopsisinfo" mode="perl"> <xsl:apply-templates mode="perl"/> </xsl:template> <xsl:template match="ooclass|oointerface|ooexception" mode="perl"> <xsl:if test="preceding-sibling::*"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="perl"/> </span> </xsl:template> <xsl:template match="modifier|package" mode="perl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="perl"/> <xsl:if test="following-sibling::*"> <xsl:text>&#160;</xsl:text> </xsl:if> </span> </xsl:template> <xsl:template match="classname" mode="perl"> <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="perl"/> </span> </xsl:template> <xsl:template match="interfacename" mode="perl"> <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="perl"/> </span> </xsl:template> <xsl:template match="exceptionname" mode="perl"> <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="perl"/> </span> </xsl:template> <xsl:template match="fieldsynopsis" mode="perl"> <code> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:if test="parent::classsynopsis"> <xsl:text>&#160;&#160;</xsl:text> </xsl:if> <xsl:apply-templates mode="perl"/> <xsl:text>;</xsl:text> </code> <xsl:call-template name="synop-break"/> </xsl:template> <xsl:template match="type" mode="perl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="perl"/> <xsl:text>&#160;</xsl:text> </span> </xsl:template> <xsl:template match="varname" mode="perl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="perl"/> <xsl:text>&#160;</xsl:text> </span> </xsl:template> <xsl:template match="initializer" mode="perl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:text>=&#160;</xsl:text> <xsl:apply-templates mode="perl"/> </span> </xsl:template> <xsl:template match="void" mode="perl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:text>void&#160;</xsl:text> </span> </xsl:template> <xsl:template match="methodname" mode="perl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="perl"/> </span> </xsl:template> <xsl:template match="methodparam" mode="perl"> <xsl:if test="preceding-sibling::methodparam"> <xsl:text>, </xsl:text> </xsl:if> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="perl"/> </span> </xsl:template> <xsl:template match="parameter" mode="perl"> <span> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:apply-templates mode="perl"/> </span> </xsl:template> <xsl:template mode="perl" match="constructorsynopsis|destructorsynopsis|methodsynopsis"> <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/> <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/> <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/> <code> <xsl:apply-templates select="." mode="common.html.attributes"/> <xsl:call-template name="id.attribute"/> <xsl:text>sub </xsl:text> <xsl:apply-templates select="methodname" mode="perl"/> <xsl:text> { ... };</xsl:text> </code> <xsl:call-template name="synop-break"/> </xsl:template> <!-- Used when not occurring as a child of classsynopsis --> <xsl:template match="ooclass|oointerface|ooexception"> <xsl:apply-templates/> </xsl:template> <!-- ==================================================================== --> <!-- * DocBook 5 allows linking elements (link, olink, and xref) --> <!-- * within the OO *synopsis elements (classsynopsis, fieldsynopsis, --> <!-- * methodsynopsis, constructorsynopsis, destructorsynopsis) and --> <!-- * their children. So we need to have mode="java|cpp|idl|perl" --> <!-- * per-mode matches for those linking elements in order for them --> <!-- * to be processed as expected. --> <xsl:template match="link|olink|xref" mode="java"> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="link|olink|xref" mode="cpp"> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="link|olink|xref" mode="idl"> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="link|olink|xref" mode="perl"> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="link|olink|xref" mode="ansi-nontabular"> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="link|olink|xref" mode="ansi-tabular"> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="link|olink|xref" mode="kr-nontabular"> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="link|olink|xref" mode="kr-tabular"> <xsl:apply-templates select="."/> </xsl:template> </xsl:stylesheet>
{ "pile_set_name": "Github" }
/* * Copyright (c) 2017 Nathan Osman * * 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. */ #ifndef QHTTPENGINE_BASICAUTHMIDDLEWARE_P_H #define QHTTPENGINE_BASICAUTHMIDDLEWARE_P_H #include <QMap> #include <QObject> namespace QHttpEngine { class BasicAuthMiddlewarePrivate : public QObject { Q_OBJECT public: explicit BasicAuthMiddlewarePrivate(QObject *parent, const QString &realm); const QString realm; QMap<QString, QString> map; }; } #endif // QHTTPENGINE_BASICAUTHMIDDLEWARE_P_H
{ "pile_set_name": "Github" }
module.exports = function describeTasks(api) { api.describeTask({ match: /vue-cli-service styleguidist$/, description: 'Compiles and hot-reloads styleguide for development', link: 'https://vue-styleguidist.github.io/CLI.html#cli-commands-and-options' }) api.describeTask({ match: /vue-cli-service styleguidist:build$/, description: 'Compiles styleguide assets for production', link: 'https://vue-styleguidist.github.io/CLI.html#cli-commands-and-options' }) }
{ "pile_set_name": "Github" }
import Foundation class ConcurrentMap<T: Hashable, U: Any> { private let syncQueue: DispatchQueue private var map: [T: U] = [:] init(_ id: String) { syncQueue = DispatchQueue(label: id, attributes: .concurrent) } var kvPairs: [T: U] { let copy = map return copy } var keys: [T] { return Array(map.keys) } var values: [U] { return Array(map.values) } subscript(_ key: T) -> U? { get { var value: U? = nil syncQueue.sync(flags: .barrier) { value = map[key] } return value } set (newValue) { if let theValue = newValue { // newValue is non-nil syncQueue.sync(flags: .barrier) { map[key] = theValue } } else { // newValue is nil, implying that any existing value should be removed for this key. _ = remove(key) } } } func hasForKey(_ key: T) -> Bool { var hasValue: Bool = false syncQueue.sync(flags: .barrier) { hasValue = map[key] != nil } return hasValue } func remove(_ key: T) -> U? { var removedValue: U? = nil syncQueue.sync(flags: .barrier) { removedValue = map.removeValue(forKey: key) } return removedValue } func removeAll() { syncQueue.sync(flags: .barrier) { map.removeAll() } } } class ConcurrentSet<T: Hashable> { private let syncQueue: DispatchQueue private(set) var set: Set<T> = Set<T>() init(_ id: String) { syncQueue = DispatchQueue(label: id, attributes: .concurrent) } func contains(_ value: T) -> Bool { var hasValue: Bool = false syncQueue.sync(flags: .barrier) { hasValue = set.contains(value) } return hasValue } func insert(_ value: T) { _ = syncQueue.sync(flags: .barrier) { set.insert(value) } } }
{ "pile_set_name": "Github" }
package org.elixir_lang.jps; import com.intellij.util.containers.ContainerUtil; import org.elixir_lang.jps.builder.SourceRootDescriptor; import org.elixir_lang.jps.target.Type; import org.elixir_lang.jps.model.ModuleType; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jps.builders.*; import org.jetbrains.jps.builders.storage.BuildDataPaths; import org.jetbrains.jps.incremental.CompileContext; import org.jetbrains.jps.indices.IgnoredFileIndex; import org.jetbrains.jps.indices.ModuleExcludeIndex; import org.jetbrains.jps.model.JpsModel; import org.jetbrains.jps.model.java.JavaSourceRootProperties; import org.jetbrains.jps.model.java.JavaSourceRootType; import org.jetbrains.jps.model.java.JpsJavaClasspathKind; import org.jetbrains.jps.model.java.JpsJavaExtensionService; import org.jetbrains.jps.model.module.JpsModule; import org.jetbrains.jps.model.module.JpsTypedModuleSourceRoot; import java.io.File; import java.util.*; /** * Created by zyuyou on 15/7/10. */ public class Target extends ModuleBasedTarget<SourceRootDescriptor> { public Target(Type targetType, @NotNull JpsModule module) { super(targetType, module); } @Override public String getId() { return myModule.getName(); } @Override public Collection<BuildTarget<?>> computeDependencies(BuildTargetRegistry targetRegistry, TargetOutputIndex outputIndex) { return computeDependencies(); } public Collection<BuildTarget<?>> computeDependencies(){ List<BuildTarget<?>> dependencies = new ArrayList<BuildTarget<?>>(); Set<JpsModule> modules = JpsJavaExtensionService.dependencies(myModule).includedIn(JpsJavaClasspathKind.compile(isTests())).getModules(); for (JpsModule module : modules){ if(module.getModuleType().equals(ModuleType.INSTANCE)){ dependencies.add(new Target(getElixirTargetType(), module)); } } if(isTests()){ dependencies.add(new Target(Type.PRODUCTION, myModule)); } return dependencies; } @NotNull @Override public List<SourceRootDescriptor> computeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) { List<SourceRootDescriptor> result = new ArrayList<SourceRootDescriptor>(); JavaSourceRootType type = isTests() ? JavaSourceRootType.TEST_SOURCE : JavaSourceRootType.SOURCE; for(JpsTypedModuleSourceRoot<JavaSourceRootProperties> root : myModule.getSourceRoots(type)){ result.add(new SourceRootDescriptor(root.getFile(), this)); } return result; } @Nullable @Override public SourceRootDescriptor findRootDescriptor(String rootId, BuildRootIndex rootIndex) { return ContainerUtil.getFirstItem(rootIndex.getRootDescriptors(new File(rootId), Collections.singletonList(getElixirTargetType()), null)); } @NotNull @Override public String getPresentableName() { return "Elixir '" + myModule.getName() + "' " + (isTests() ? "test" : "production"); } @NotNull @Override public Collection<File> getOutputRoots(CompileContext context) { return ContainerUtil.createMaybeSingletonList(JpsJavaExtensionService.getInstance().getOutputDirectory(myModule, isTests())); } @Override public boolean isTests() { return getElixirTargetType().isTests(); } public Type getElixirTargetType(){ return (Type)getTargetType(); } }
{ "pile_set_name": "Github" }
#! /bin/bash scp -r documentation/html /home/project-web/genn/htdocs/documentation/
{ "pile_set_name": "Github" }
version https://git-lfs.github.com/spec/v1 oid sha256:c17e26c704255ae4a5985531228da140bd69d97a104af4f202755ab33623ac4b size 154844
{ "pile_set_name": "Github" }
/* * UWB radio (channel) management. * * Copyright (C) 2008 Cambridge Silicon Radio Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version * 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <linux/kernel.h> #include <linux/uwb.h> #include <linux/export.h> #include "uwb-internal.h" static int uwb_radio_select_channel(struct uwb_rc *rc) { /* * Default to channel 9 (BG1, TFC1) unless the user has * selected a specific channel or there are no active PALs. */ if (rc->active_pals == 0) return -1; if (rc->beaconing_forced) return rc->beaconing_forced; return 9; } /* * Notify all active PALs that the channel has changed. */ static void uwb_radio_channel_changed(struct uwb_rc *rc, int channel) { struct uwb_pal *pal; list_for_each_entry(pal, &rc->pals, node) { if (pal->channel && channel != pal->channel) { pal->channel = channel; if (pal->channel_changed) pal->channel_changed(pal, pal->channel); } } } /* * Change to a new channel and notify any active PALs of the new * channel. * * When stopping the radio, PALs need to be notified first so they can * terminate any active reservations. */ static int uwb_radio_change_channel(struct uwb_rc *rc, int channel) { int ret = 0; struct device *dev = &rc->uwb_dev.dev; dev_dbg(dev, "%s: channel = %d, rc->beaconing = %d\n", __func__, channel, rc->beaconing); if (channel == -1) uwb_radio_channel_changed(rc, channel); if (channel != rc->beaconing) { if (rc->beaconing != -1 && channel != -1) { /* * FIXME: should signal the channel change * with a Channel Change IE. */ ret = uwb_radio_change_channel(rc, -1); if (ret < 0) return ret; } ret = uwb_rc_beacon(rc, channel, 0); } if (channel != -1) uwb_radio_channel_changed(rc, rc->beaconing); return ret; } /** * uwb_radio_start - request that the radio be started * @pal: the PAL making the request. * * If the radio is not already active, a suitable channel is selected * and beacons are started. */ int uwb_radio_start(struct uwb_pal *pal) { struct uwb_rc *rc = pal->rc; int ret = 0; mutex_lock(&rc->uwb_dev.mutex); if (!pal->channel) { pal->channel = -1; rc->active_pals++; ret = uwb_radio_change_channel(rc, uwb_radio_select_channel(rc)); } mutex_unlock(&rc->uwb_dev.mutex); return ret; } EXPORT_SYMBOL_GPL(uwb_radio_start); /** * uwb_radio_stop - request that the radio be stopped. * @pal: the PAL making the request. * * Stops the radio if no other PAL is making use of it. */ void uwb_radio_stop(struct uwb_pal *pal) { struct uwb_rc *rc = pal->rc; mutex_lock(&rc->uwb_dev.mutex); if (pal->channel) { rc->active_pals--; uwb_radio_change_channel(rc, uwb_radio_select_channel(rc)); pal->channel = 0; } mutex_unlock(&rc->uwb_dev.mutex); } EXPORT_SYMBOL_GPL(uwb_radio_stop); /* * uwb_radio_force_channel - force a specific channel to be used * @rc: the radio controller. * @channel: the channel to use; -1 to force the radio to stop; 0 to * use the default channel selection algorithm. */ int uwb_radio_force_channel(struct uwb_rc *rc, int channel) { int ret = 0; mutex_lock(&rc->uwb_dev.mutex); rc->beaconing_forced = channel; ret = uwb_radio_change_channel(rc, uwb_radio_select_channel(rc)); mutex_unlock(&rc->uwb_dev.mutex); return ret; } /* * uwb_radio_setup - setup the radio manager * @rc: the radio controller. * * The radio controller is reset to ensure it's in a known state * before it's used. */ int uwb_radio_setup(struct uwb_rc *rc) { return uwb_rc_reset(rc); } /* * uwb_radio_reset_state - reset any radio manager state * @rc: the radio controller. * * All internal radio manager state is reset to values corresponding * to a reset radio controller. */ void uwb_radio_reset_state(struct uwb_rc *rc) { struct uwb_pal *pal; mutex_lock(&rc->uwb_dev.mutex); list_for_each_entry(pal, &rc->pals, node) { if (pal->channel) { pal->channel = -1; if (pal->channel_changed) pal->channel_changed(pal, -1); } } rc->beaconing = -1; rc->scanning = -1; mutex_unlock(&rc->uwb_dev.mutex); } /* * uwb_radio_shutdown - shutdown the radio manager * @rc: the radio controller. * * The radio controller is reset. */ void uwb_radio_shutdown(struct uwb_rc *rc) { uwb_radio_reset_state(rc); uwb_rc_reset(rc); }
{ "pile_set_name": "Github" }
compile: xmeasure: sudo modprobe msr sudo ../../RAPL/main "" TypeScript pidigits mem: /usr/bin/time -v ./binarytrees.gpp-9.gpp_run 21 valgrind: valgrind --tool=massif --stacks=yes ./binarytrees.gpp-9.gpp_run 21
{ "pile_set_name": "Github" }
import React from 'react'; import { StyledIcon } from '../StyledIcon'; export const Descend = props => ( <StyledIcon viewBox='0 0 24 24' a11yTitle='Descend' {...props}> <path fill='none' stroke='#000' strokeWidth='2' d='M2,8 L8,2 L14,8 M11,21 L22,21 M11,17 L19,17 M11,13 L16,13 M8,2 L8,22' transform='matrix(1 0 0 -1 0 24)' /> </StyledIcon> );
{ "pile_set_name": "Github" }
test() -> X = try fail() catch module:ex -> ok; module:ex -> ok<caret>
{ "pile_set_name": "Github" }
var convert = require('./convert'), func = convert('rangeStepRight', require('../rangeRight')); func.placeholder = require('./placeholder'); module.exports = func;
{ "pile_set_name": "Github" }
{ "multi":null, "text":"【司机注意啦】昨天下午六点开始,武汉市高清探头全部启动,副驾驶室不系安全带相同处罚,开车时打电话罚款50元,闯黄闪罚200,越线停车罚100,今天起晚六点半至深夜二点,为期60天,全国交警集中查处酒驾,一经查获,一律拘役六个月,五年内不得考证。 相互转告亲友并通知同事避免被罚!(via@乐里街区)", "user":{ "verified":true, "description":true, "gender":"m", "messages":15311, "followers":211228, "location":"湖北 武汉", "time":1306664711, "friends":956, "verified_type":0 }, "has_url":false, "comments":36, "pics":1, "source":"喧客", "likes":0, "time":1346302183, "reposts":233 }
{ "pile_set_name": "Github" }
<?php declare(strict_types=1); namespace PhpParser; interface NodeTraverserInterface { /** * Adds a visitor. * * @param NodeVisitor $visitor Visitor to add */ public function addVisitor(NodeVisitor $visitor); /** * Removes an added visitor. * * @param NodeVisitor $visitor */ public function removeVisitor(NodeVisitor $visitor); /** * Traverses an array of nodes using the registered visitors. * * @param Node[] $nodes Array of nodes * * @return Node[] Traversed array of nodes */ public function traverse(array $nodes) : array; }
{ "pile_set_name": "Github" }
<div data-control="toolbar"> <a href="<?= Backend::url('october/test/themes/create') ?>" class="btn btn-primary oc-icon-plus"> New Theme </a> </div>
{ "pile_set_name": "Github" }
/** * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance * with the License. A copy of the License is located at * * http://www.apache.org/licenses/LICENSE-2.0 * * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * and limitations under the License. */ import * as api from '@aws-cdk/aws-apigateway'; import * as iam from '@aws-cdk/aws-iam'; import * as defaults from '@aws-solutions-constructs/core'; import { Construct } from '@aws-cdk/core'; import * as dynamodb from '@aws-cdk/aws-dynamodb'; import { overrideProps } from '@aws-solutions-constructs/core'; import { LogGroup } from '@aws-cdk/aws-logs'; /** * @summary The properties for the ApiGatewayToDynamoDB class. */ export interface ApiGatewayToDynamoDBProps { /** * Optional user provided props to override the default props * * @default - Default props are used */ readonly dynamoTableProps?: dynamodb.TableProps, /** * Optional user-provided props to override the default props for the API Gateway. * * @default - Default properties are used. */ readonly apiGatewayProps?: api.RestApiProps, /** * Whether to deploy API Gateway Method for Create operation on DynamoDB table. * * @default - false */ readonly allowCreateOperation?: boolean, /** * API Gateway Request template for Create method, required if allowCreateOperation set to true * * @default - None */ readonly createRequestTemplate?: string, /** * Whether to deploy API Gateway Method for Read operation on DynamoDB table. * * @default - true */ readonly allowReadOperation?: boolean, /** * Whether to deploy API Gateway Method for Update operation on DynamoDB table. * * @default - false */ readonly allowUpdateOperation?: boolean, /** * API Gateway Request template for Update method, required if allowUpdateOperation set to true * * @default - None */ readonly updateRequestTemplate?: string, /** * Whether to deploy API Gateway Method for Delete operation on DynamoDB table. * * @default - false */ readonly allowDeleteOperation?: boolean } /** * @summary The ApiGatewayToDynamoDB class. */ export class ApiGatewayToDynamoDB extends Construct { public readonly dynamoTable: dynamodb.Table; public readonly apiGatewayRole: iam.Role; public readonly apiGateway: api.RestApi; public readonly apiGatewayCloudWatchRole: iam.Role; public readonly apiGatewayLogGroup: LogGroup; /** * @summary Constructs a new instance of the ApiGatewayToDynamoDB class. * @param {cdk.App} scope - represents the scope for all the resources. * @param {string} id - this is a a scope-unique id. * @param {CloudFrontToApiGatewayToLambdaProps} props - user provided props for the construct. * @since 0.8.0 * @access public */ constructor(scope: Construct, id: string, props: ApiGatewayToDynamoDBProps) { super(scope, id); let partitionKeyName: string; // Set the default props for DynamoDB table if (props.dynamoTableProps) { const dynamoTableProps: dynamodb.TableProps = overrideProps(defaults.DefaultTableProps, props.dynamoTableProps); partitionKeyName = dynamoTableProps.partitionKey.name; this.dynamoTable = new dynamodb.Table(this, 'DynamoTable', dynamoTableProps); } else { partitionKeyName = defaults.DefaultTableProps.partitionKey.name; this.dynamoTable = new dynamodb.Table(this, 'DynamoTable', defaults.DefaultTableProps); } // Setup the API Gateway [this.apiGateway, this.apiGatewayCloudWatchRole, this.apiGatewayLogGroup] = defaults.GlobalRestApi(this, props.apiGatewayProps); // Setup the API Gateway role this.apiGatewayRole = new iam.Role(this, 'api-gateway-role', { assumedBy: new iam.ServicePrincipal('apigateway.amazonaws.com') }); // Setup the API Gateway Resource const apiGatewayResource: api.Resource = this.apiGateway.root.addResource("{" + partitionKeyName + "}"); // Setup API Gateway Method // Create if (props.allowCreateOperation && props.allowCreateOperation === true && props.createRequestTemplate) { const createRequestTemplate = props.createRequestTemplate.replace("${Table}", this.dynamoTable.tableName); this.addActionToPolicy("dynamodb:PutItem"); defaults.addProxyMethodToApiResource({ service: "dynamodb", action: "PutItem", apiGatewayRole: this.apiGatewayRole, apiMethod: "POST", apiResource: this.apiGateway.root, requestTemplate: createRequestTemplate }); } // Read if (!props.allowReadOperation || props.allowReadOperation === true) { const getRequestTemplate = "{\r\n\"TableName\": \"" + this.dynamoTable.tableName + "\",\r\n \"KeyConditionExpression\": \"" + partitionKeyName + " = :v1\",\r\n \"ExpressionAttributeValues\": {\r\n \":v1\": {\r\n \"S\": \"$input.params('" + partitionKeyName + "')\"\r\n }\r\n }\r\n}"; this.addActionToPolicy("dynamodb:Query"); defaults.addProxyMethodToApiResource({ service: "dynamodb", action: "Query", apiGatewayRole: this.apiGatewayRole, apiMethod: "GET", apiResource: apiGatewayResource, requestTemplate: getRequestTemplate }); } // Update if (props.allowUpdateOperation && props.allowUpdateOperation === true && props.updateRequestTemplate) { const updateRequestTemplate = props.updateRequestTemplate.replace("${Table}", this.dynamoTable.tableName); this.addActionToPolicy("dynamodb:UpdateItem"); defaults.addProxyMethodToApiResource({ service: "dynamodb", action: "UpdateItem", apiGatewayRole: this.apiGatewayRole, apiMethod: "PUT", apiResource: apiGatewayResource, requestTemplate: updateRequestTemplate }); } // Delete if (props.allowDeleteOperation && props.allowDeleteOperation === true) { const deleteRequestTemplate = "{\r\n \"TableName\": \"" + this.dynamoTable.tableName + "\",\r\n \"Key\": {\r\n \"" + partitionKeyName + "\": {\r\n \"S\": \"$input.params('" + partitionKeyName + "')\"\r\n }\r\n },\r\n \"ConditionExpression\": \"attribute_not_exists(Replies)\",\r\n \"ReturnValues\": \"ALL_OLD\"\r\n}"; this.addActionToPolicy("dynamodb:DeleteItem"); defaults.addProxyMethodToApiResource({ service: "dynamodb", action: "DeleteItem", apiGatewayRole: this.apiGatewayRole, apiMethod: "DELETE", apiResource: apiGatewayResource, requestTemplate: deleteRequestTemplate }); } } private addActionToPolicy(action: string) { this.apiGatewayRole.addToPolicy(new iam.PolicyStatement({ resources: [ this.dynamoTable.tableArn ], actions: [ `${action}` ] })); } }
{ "pile_set_name": "Github" }
#Driver Information VendorId = 00000000 DeviceId = 00000000 Class = 000C0003 SubClass = 00300000 Flags = 00000000
{ "pile_set_name": "Github" }
(* * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * This is a part of the Pascal port of ffmpeg. * - Changes and updates by the UltraStar Deluxe Team * * Conversion of libavutil/error.h * avutil version 54.7.100 * *) (** * @file * error code definitions *) (** * @addtogroup lavu_error * * @ *) {* error handling *} const {$IFDEF UNIX} ENOENT = ESysENOENT; EIO = ESysEIO; ENOMEM = ESysENOMEM; EINVAL = ESysEINVAL; EDOM = ESysEDOM; ENOSYS = ESysENOSYS; EILSEQ = ESysEILSEQ; EPIPE = ESysEPIPE; {$ELSE} ENOENT = 2; EIO = 5; ENOMEM = 12; EINVAL = 22; EPIPE = 32; // just an assumption. needs to be checked. EDOM = 33; {$IFDEF MSWINDOWS} // Note: we assume that ffmpeg was compiled with MinGW. // This must be changed if DLLs were compiled with cygwin. ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 {$ENDIF} {$ENDIF} (** * We need the sign of the error, because some platforms have * E* and errno already negated. The previous version failed * with Delphi, because it needed EINVAL defined. * Warning: This code is platform dependent and assumes constants * to be 32 bit. * This version does the following steps: * 1) shr 30: shifts the sign bit to bit position 2 * 2) and $00000002: sets all other bits to zero * positive EINVAL gives 0, negative gives 2 * 3) - 1: positive EINVAL gives -1, negative 1 *) const AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; (* #if EDOM > 0 #define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} #define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} #else {* Some platforms have E* and errno already negated. *} #define AVERROR(e) (e) #define AVUNERROR(e) (e) #endif *) const // Note: function calls as constant-initializers are invalid AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found (** * This is semantically identical to AVERROR_BUG * it has been introduced in Libav after our AVERROR_BUG and with a modified value. *) AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. AVERROR_INPUT_CHANGED = -($636e6701); ///< Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED) AVERROR_OUTPUT_CHANGED = -($636e6702); ///< Output changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_INPUT_CHANGED) (* HTTP & RTSP errors *) AVERROR_HTTP_BAD_REQUEST = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('0') shl 24)); AVERROR_HTTP_UNAUTHORIZED = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('1') shl 24)); AVERROR_HTTP_FORBIDDEN = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('3') shl 24)); AVERROR_HTTP_NOT_FOUND = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('4') shl 24)); AVERROR_HTTP_OTHER_4XX = -(ord($F8) or (ord('4') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); AVERROR_HTTP_SERVER_ERROR = -(ord($F8) or (ord('5') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); AV_ERROR_MAX_STRING_SIZE = 64; (* * Put a description of the AVERROR code errnum in errbuf. * In case of failure the global variable errno is set to indicate the * error. Even in case of failure av_strerror() will print a generic * error message indicating the errnum provided to errbuf. * * @param errnum error code to describe * @param errbuf buffer to which description is written * @param errbuf_size the size in bytes of errbuf * @return 0 on success, a negative value if a description for errnum * cannot be found *) function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; cdecl; external av__util; (** * Fill the provided buffer with a string containing an error string * corresponding to the AVERROR code errnum. * * @param errbuf a buffer * @param errbuf_size size in bytes of errbuf * @param errnum error code to describe * @return the buffer in input, filled with the error description * @see av_strerror() *) function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} // Note: defined in avutil.pas (** * Convenience macro, the return value should be used only directly in * function arguments but never stand-alone. *) function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} // Note: defined in avutil.pas (** * @} *)
{ "pile_set_name": "Github" }
(ns puppetlabs.puppetdb.query.population-test (:require [puppetlabs.puppetdb.query.population :as pop] [clojure.java.jdbc :as sql] [clojure.test :refer :all] [puppetlabs.puppetdb.jdbc :as jdbc] [puppetlabs.puppetdb.scf.storage :refer [deactivate-node!]] [puppetlabs.puppetdb.scf.storage-utils :as sutils :refer [to-jdbc-varchar-array]] [puppetlabs.puppetdb.testutils.db :refer [*db* with-test-db]] [puppetlabs.puppetdb.testutils :refer [with-fixtures]] [puppetlabs.puppetdb.time :refer [now to-timestamp]])) (deftest resource-count (with-test-db (testing "Counting resources" (testing "should return 0 when no resources present" (sutils/vacuum-analyze *db*) (is (= 0 (pop/num-resources)))) (testing "should only count current resources" (jdbc/insert-multi! :certnames [{:certname "h1" :id 1} {:certname "h2" :id 2}]) (deactivate-node! "h2") (jdbc/insert-multi! :catalogs [{:id 1 :hash (sutils/munge-hash-for-storage "c1") :api_version 1 :catalog_version "1" :certname "h1" :producer_timestamp (to-timestamp (now))} {:id 2 :hash (sutils/munge-hash-for-storage "c2") :api_version 1 :catalog_version "1" :certname "h2" :producer_timestamp (to-timestamp (now))}]) (jdbc/insert-multi! :resource_params_cache [{:resource (sutils/munge-hash-for-storage "01") :parameters nil} {:resource (sutils/munge-hash-for-storage "02") :parameters nil} {:resource (sutils/munge-hash-for-storage "03") :parameters nil}]) (jdbc/insert-multi! :catalog_resources [{:certname_id 1 :resource (sutils/munge-hash-for-storage "01") :type "Foo" :title "Bar" :exported true :tags (to-jdbc-varchar-array [])} ;; c2's resource shouldn'sutils/munge-hash-for-storage t be counted, as they don't correspond to an active node {:certname_id 2 :resource (sutils/munge-hash-for-storage "01") :type "Foo" :title "Baz" :exported true :tags (to-jdbc-varchar-array [])} {:certname_id 1 :resource (sutils/munge-hash-for-storage "02") :type "Foo" :title "Boo" :exported true :tags (to-jdbc-varchar-array [])} {:certname_id 1 :resource (sutils/munge-hash-for-storage "03") :type "Foo" :title "Goo" :exported true :tags (to-jdbc-varchar-array [])}]) (sutils/vacuum-analyze *db*) (is (= 4 (pop/num-resources))))))) (deftest node-count (with-test-db (testing "Counting nodes" (testing "should return 0 when no resources present" (is (= 0 (pop/num-active-nodes)))) (testing "should only count active nodes" (jdbc/insert-multi! :certnames [{:certname "h1"} {:certname "h2"}]) (is (= 2 (pop/num-active-nodes))) (deactivate-node! "h1") (is (= 1 (pop/num-active-nodes))) (is (= 1 (pop/num-inactive-nodes))))))) (deftest resource-dupes (with-test-db (testing "Computing resource duplication" (testing "should return 0 when no resources present" (sutils/vacuum-analyze *db*) (is (= 0 (pop/pct-resource-duplication)))) (testing "should equal (total-unique) / total" (jdbc/insert-multi! :certnames [{:certname "h1"} {:certname "h2"}]) (jdbc/insert-multi! :catalogs [{:id 1 :hash (sutils/munge-hash-for-storage "c1") :api_version 1 :transaction_uuid (sutils/munge-uuid-for-storage "68b08e2a-eeb1-4322-b241-bfdf151d294b") :catalog_version "1" :certname "h1" :producer_timestamp (to-timestamp (now))} {:id 2 :hash (sutils/munge-hash-for-storage "c2") :api_version 1 :transaction_uuid (sutils/munge-uuid-for-storage "68b08e2a-eeb1-4322-b241-bfdf151d294b") :catalog_version "1" :certname "h2" :producer_timestamp (to-timestamp (now))}]) (jdbc/insert-multi! :resource_params_cache [{:resource (sutils/munge-hash-for-storage "01") :parameters nil} {:resource (sutils/munge-hash-for-storage "02") :parameters nil} {:resource (sutils/munge-hash-for-storage "03") :parameters nil}]) (jdbc/insert-multi! :catalog_resources [{:certname_id 1 :resource (sutils/munge-hash-for-storage "01") :type "Foo" :title "Bar" :exported true :tags (to-jdbc-varchar-array [])} {:certname_id 2 :resource (sutils/munge-hash-for-storage "01") :type "Foo" :title "Baz" :exported true :tags (to-jdbc-varchar-array [])} {:certname_id 1 :resource (sutils/munge-hash-for-storage "02") :type "Foo" :title "Boo" :exported true :tags (to-jdbc-varchar-array [])} {:certname_id 1 :resource (sutils/munge-hash-for-storage "03") :type "Foo" :title "Goo" :exported true :tags (to-jdbc-varchar-array [])}]) (let [total 4 unique 3 dupes (/ (- total unique) total)] (sutils/vacuum-analyze *db*) (is (= dupes (pop/pct-resource-duplication*))) (is (not (= dupes (pop/pct-resource-duplication)))))))))
{ "pile_set_name": "Github" }
/** * 将字符串数据进行整理,变成XML的可读类 */ function XML(data){ var _root = this; var xml = null; var arr = new Array(); var btype if(data != null){ if(data instanceof Array){ arr = data; }else{ if(window.DOMParser){ xml = (new DOMParser()).parseFromString(data, "text/xml").childNodes; }else{ xml = new ActiveXObject("Microsoft.XMLDOM"); xml.loadXML(data); xml = xml.childNodes; } for(var n = 0;n<xml.length;n++){ arr.push(xml[n]); } } } /** * 获取元素的属性 * @param name 属性名称 * @param value 属性值,可以不填写 */ this.qname = function(name,value){//setAttribute,getAttribute if(!name){ return arr[0].attributes; } var outStr = ""; for(var i = 0;i<arr.length;i++){ if(value != null){ arr[i].setAttribute(name,value); } outStr += arr[i].getAttribute(name) + ","; } return outStr.substr(0,outStr.length - 1); } /** * 长度 */ this.length = function (){ return arr.length; } /** * 查找节点内容 */ this.child = function (nodeName){ if(nodeName && nodeName.charAt(0) == '@'){ return this.qname(nodeName.substring(1)); }else if(nodeName && nodeName.charAt(0) == '['){ nodeName = nodeName.substr(1,nodeName.length - 2); var values = nodeName.split("."); var p = this.child(values[0]); var t = null; for(var n = 1;n<values.length;n++){ t = values[n]; if(t.charAt(t.length - 1) == ')'){ p = p.at(t.substring(3,t.length - 1)); continue; } p = p.child(t); } return p; } var a = new Array(); var ch = null; for(var i = 0;i<arr.length;i++){ ch = arr[i].childNodes; for(var j = 0;j<ch.length;j++){ if(nodeName == null || ch[j].nodeName == nodeName){ a.push(ch[j]); } } } return new XML(a); } /** * 制定具体位置 */ this.at = function (pos){ var a = new Array(); a.push(arr[pos]); return new XML(a); } /** * 节点赋值 */ this.node = function(value){ if(value){ for(var i = 0;i<arr.length;i++){ if(typeof(value) == "string"){ arr[i].parentNode.replaceChild(new XML(value)._nodeValue(0),arr[i]); } } } } this._nodeValue = function(p){ return arr[p]; } /** * 获取XML格式内容 */ this.toXMLString = function(){ var outStr = ""; var i = 0; switch(browser){ case "ie5+": for(i = 0;i<arr.length;i++){ outStr += arr[i].xml; } break; case "other" : for(i = 0;i<arr.length;i++){ outStr += (new XMLSerializer()).serializeToString(arr[i]); } break; } return outStr; } /** * 获取JSON数据 */ this.toJSON = function(){ var obj = {}; var arr = null; for(var i = 0;i<this.length();i++){ arr = this.at(i).child('@'); for(var j = 0;j<arr.length;j++){ obj[arr[j].name] = arr[j].value; } } return obj; }; /** * 获取JSON数组 */ this.toJSONArray = function(){ var list = []; var obj = null; var arr = null; for(var i = 0;i<this.length();i++){ arr = this.at(i).child('@'); obj = {}; for(var j = 0;j<arr.length;j++){ obj["@"+arr[j].name] = arr[j].value; } var child = this.at(i).child(); for(j = 0;j<child.length();j++){ obj[child.at(j).getName()] = child.at(j).toString(); } list.push(obj); } return list; }; this.appendChild = function (data){ var child = new XML("<response>" + data + "</response>").child(); var len = child.length(); if(arr.length == 1){ for(var i = 0;i<len;i++){ arr[0].appendChild(child._nodeValue(i)); } } } /** * 删除指定元素 * @param nodeName * @return */ this.removeChild = function(nodeName){ var len = 0; var pos = null; var child = null; for(var i = 0;i<arr.length;i++){ pos = arr[i]; if(nodeName instanceof XML){ child = nodeName; }else{ child = new XML([arr[i]]).child(nodeName); } len = child.length(); for(var j = 0;j<len;j++){ pos.removeChild(child._nodeValue(j)); } } } this.getName = function(){ return arr.length>0 ? arr[0].nodeName : null; } /** * 重写toString方法 */ this.toString = function(){ var outStr = ""; for(var i = 0;i<arr.length;i++){ if(arr[i].childNodes.length != 0){ outStr += arr[i].childNodes[0].wholeText; } } return outStr; } }//XML
{ "pile_set_name": "Github" }
require("long-stack-traces"); var fs=require("fs") _ = require("underscore"); window = null; suite("tests suite", function () { test("define suites", function (done) { this.timeout(15000); var jsdom = require("jsdom"); jsdom.env( "some.html", [], function (errors, domWindow) { function fakeWorkerProcess() { window.self = domWindow; window.workerDispatch = function () { }; } //region fakes window = domWindow; fakeWorkerProcess(); Modernizr = {}; Modernizr['websocketsbinary'] = true; WebSocket = require("websocket").client; //endregion fakes //region test-environment sinon = require("sinon"); assert = require("chai").assert; require("../lib/base64"), Canvas = require('canvas'), Image = Canvas.Image, BigInteger = require("../lib/biginteger").BigInteger, window.$=require("../lib/jquery-2.0.3"), window.bowser = require("../lib/bowser"), require("../lib/virtualjoystick"), require("../lib/utils"), require("../lib/CollisionDetector.js"), require("../lib/GlobalPool"), require("../lib/GenericObjectPool"), require("../spiceobjects/spiceobjects"), require("../spiceobjects/generated/protocol"), require("../lib/graphicdebug"), require("../lib/images/lz"), require("../lib/images/bitmap"), require("../lib/images/png"), require("../lib/runqueue"), require("../lib/queue"), require("../lib/ImageUncompressor"), require("../lib/SyncAsyncHandler"), require("../lib/stuckkeyshandler"), require("../lib/timelapsedetector"), require("../lib/displayRouter"), require("../lib/rasterEngine"), require("../lib/DataLogger"), require("../network/socket"), require("../network/socketqueue"), require("../network/packetlinkfactory"), require("../network/packetcontroller"), require("../network/packetextractor"), require("../network/packetreassembler"), require("../network/reassemblerfactory"), require("../network/sizedefiner"), require("../network/packetlinkfactory"), require("../network/spicechannel"), require("../network/busconnection"), require("../network/clusternodechooser"), require("../network/websocketwrapper"), require("../network/connectioncontrol"), require("../application/agent"), require("../application/spiceconnection"), require("../application/spiceconnection"), require("../application/clientgui"), require("../application/packetprocess"), require("../application/packetfilter"), require("../application/packetfactory"), require("../application/application"), require("../application/virtualmouse"), require("../application/imagecache"), require("../application/rasteroperation"), require("../application/stream"), require("../application/inputmanager"), require("../process/displayprocess"), require("../process/displaypreprocess"), require("../process/inputprocess"), require("../process/cursorprocess"), require("../process/mainprocess"), require("../process/busprocess"), require("../keymaps/keymapes"), require("../keymaps/keymapus"), require("../keymaps/keymap"), require("../testlibs/fakewebsocket"), require("../node_modules/mocha/mocha"); wdi.GlobalPool.createCanvas = function () { return new Canvas(200, 200); } var files = fs.readdirSync(__dirname); _.each(files, function(item) { if (!item.match(/\.test\.js/g)||item.match(/graphic.*test/g)) { return; } require("./"+item.slice(0, -3)); }); wdi.exceptionHandling = false; wdi.GlobalPool.init(); //endregion test-environment done(); } ); }); });
{ "pile_set_name": "Github" }
#!/usr/bin/env python # # License: BSD # https://raw.github.com/yujinrobot/kobuki/hydro-devel/kobuki_testsuite/LICENSE # ############################################################################## # Python Imports ############################################################################## import random from math import degrees, radians ############################################################################## # Ros Imports ############################################################################## import rospy from tf.transformations import euler_from_quaternion from geometry_msgs.msg import Twist from nav_msgs.msg import Odometry from kobuki_msgs.msg import BumperEvent, CliffEvent ############################################################################## # Local imports ############################################################################## import utils ''' Implements a safe wandering random motion using bump and cliff sensors. API: init(speed,distance) : (re)initialise parameters stop() - stop. execute() - pass this to a thread to run shutdown() - cleanup @param topic names @type strings ''' class SafeWandering(object): ''' Initialise everything, then starts with start() API: start() - start to wander. stop() - stop wandering. set_vels(lin_xvel,stepback_xvel,ang_zvel) @param topic names @type strings ''' def __init__(self, cmd_vel_topic, odom_topic, bumper_topic, cliff_topic ): self.bumper_subscriber = rospy.Subscriber(bumper_topic, BumperEvent, self.bumper_event_callback) self.cliff_subscriber = rospy.Subscriber(cliff_topic, CliffEvent, self.cliff_event_callback) self.odom_subscriber = rospy.Subscriber(odom_topic, Odometry, self.odometry_callback) self.cmd_vel_publisher = rospy.Publisher(cmd_vel_topic, Twist, queue_size=10) self.rate = rospy.Rate(50) self.ok = True self.theta = 0.0 self.theta_goal = 0.0 self._stop = False self._running = False self._lin_xvel = 0.18 self._stepback_xvel = -0.1 self._ang_zvel = 1.8 def init(self, speed, stepback_speed, angular_speed): self._lin_xvel = speed self._stepback_xvel = stepback_speed self._ang_zvel = angular_speed def shutdown(self): self.stop() while self._running: self.rate.sleep() #self.cmd_vel_publisher.unregister() This one creates an error for some reason, probably because climbing_frame already unregisters. self.odom_subscriber.unregister() self.bumper_subscriber.unregister() self.cliff_subscriber.unregister() def command(self, twist): ''' Lowest level of command - i.e. this is where the fine grained looping happens so we check for aborts here. Don't waste time doing anything if this is the case. ''' if self._stop or rospy.is_shutdown(): return False self.cmd_vel_publisher.publish(twist) self.rate.sleep() return True def go(self): twist = Twist() while self.ok: twist.linear.x = self._lin_xvel if not self.command(twist): return False return True def stepback(self): twist = Twist() for i in range(0,35): twist.linear.x = self._stepback_xvel if not self.command(twist): return False return True def turn(self): twist = Twist() while not self.reached(): twist.angular.z = self._ang_zvel * utils.sign(utils.wrap_to_pi(self.theta_goal - self.theta)) if not self.command(twist): return False self.ok = True return True def reached(self): if abs(utils.wrap_to_pi(self.theta_goal - self.theta)) < radians(5.0): return True else: return False def stop(self): self._stop = True def execute(self): if self._running: rospy.logerr("Kobuki TestSuite: already executing wandering, ignoring the request") return self._stop = False self._running = True while True: if not self.go() or not self.stepback() or not self.turn(): break self._running = False if not rospy.is_shutdown(): cmd = Twist() cmd.linear.x = 0.0 self.cmd_vel_publisher.publish(cmd) ########################################################################## # Callbacks ########################################################################## def odometry_callback(self, data): quat = data.pose.pose.orientation q = [quat.x, quat.y, quat.z, quat.w] roll, pitch, yaw = euler_from_quaternion(q) self.theta = yaw def bumper_event_callback(self, data): if data.state == BumperEvent.PRESSED: self.ok = False if data.bumper == BumperEvent.LEFT: self.theta_goal = self.theta - 3.141592*random.uniform(0.2, 1.0) elif data.bumper == BumperEvent.RIGHT: self.theta_goal = self.theta + 3.141592*random.uniform(0.2, 1.0) else: self.theta_goal = utils.wrap_to_pi(self.theta + 3.141592*random.uniform(-1.0, 1.0)) def cliff_event_callback(self, data): if data.state == CliffEvent.CLIFF: self.ok = False # print "Cliff event: %s,%s"%(str(data.sensor),str(data.state)) if data.sensor == CliffEvent.LEFT: self.theta_goal = self.theta - 3.141592*random.uniform(0.2, 1.0) elif data.sensor == CliffEvent.RIGHT: self.theta_goal = self.theta + 3.141592*random.uniform(0.2, 1.0) else: self.theta_goal = utils.wrap_to_pi(self.theta + 3.141592*random.uniform(-1.0, 1.0))
{ "pile_set_name": "Github" }
/* PARTIO SOFTWARE Copyright 2010 Disney Enterprises, 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. * The names "Disney", "Walt Disney Pictures", "Walt Disney Animation Studios" or the names of its contributors may NOT be used to endorse or promote products derived from this software without specific prior written permission from Walt Disney Pictures. Disclaimer: THIS SOFTWARE IS PROVIDED BY WALT DISNEY PICTURES AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT AND TITLE ARE DISCLAIMED. IN NO EVENT SHALL WALT DISNEY PICTURES, THE COPYRIGHT HOLDER 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 BASED 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 DAMAGES. */ #ifndef _ParticlesHeaders_h_ #define _ParticlesHeaders_h_ #include "../Partio.h" namespace Partio{ class ParticleHeaders:public ParticlesDataMutable { public: ParticleHeaders(); void release() const; protected: virtual ~ParticleHeaders(); int numAttributes() const; int numFixedAttributes() const; int numParticles() const; bool attributeInfo(const char* attributeName,ParticleAttribute& attribute) const; bool fixedAttributeInfo(const char* attributeName,FixedAttribute& attribute) const; bool attributeInfo(const int attributeInfo,ParticleAttribute& attribute) const; bool fixedAttributeInfo(const int attributeInfo,FixedAttribute& attribute) const; int registerIndexedStr(const ParticleAttribute& attribute,const char* str); int registerFixedIndexedStr(const FixedAttribute& attribute,const char* str); int lookupIndexedStr(const ParticleAttribute& attribute,const char* str) const; int lookupFixedIndexedStr(const FixedAttribute& attribute,const char* str) const; void setIndexedStr(const ParticleAttribute& attribute,int indexedStrHandle,const char* str); void setFixedIndexedStr(const FixedAttribute& attribute,int indexedStrHandle,const char* str); const std::vector<std::string>& indexedStrs(const ParticleAttribute& attr) const; const std::vector<std::string>& fixedIndexedStrs(const FixedAttribute& attr) const; virtual void dataAsFloat(const ParticleAttribute& attribute,const int indexCount, const ParticleIndex* particleIndices,const bool sorted,float* values) const; void sort(); void findPoints(const float bboxMin[3],const float bboxMax[3],std::vector<ParticleIndex>& points) const; float findNPoints(const float center[3],int nPoints,const float maxRadius, std::vector<ParticleIndex>& points,std::vector<float>& pointDistancesSquared) const; int findNPoints(const float center[3],int nPoints,const float maxRadius, ParticleIndex *points, float *pointDistancesSquared, float *finalRadius2) const; ParticlesDataMutable* computeClustering(const int numNeighbors,const double radiusSearch,const double radiusInside,const int connections,const double density) {assert(false);} ParticleAttribute addAttribute(const char* attribute,ParticleAttributeType type,const int count); FixedAttribute addFixedAttribute(const char* attribute,ParticleAttributeType type,const int count); ParticleIndex addParticle(); iterator addParticles(const int count); const_iterator setupConstIterator(const int index=0) const {return const_iterator();} iterator setupIterator(const int index=0) {return iterator();} private: void* dataInternal(const ParticleAttribute& attribute,const ParticleIndex particleIndex) const; void* fixedDataInternal(const FixedAttribute& attribute) const; void dataInternalMultiple(const ParticleAttribute& attribute,const int indexCount, const ParticleIndex* particleIndices,const bool sorted,char* values) const; private: int particleCount; std::vector<ParticleAttribute> attributes; std::map<std::string,int> nameToAttribute; std::vector<FixedAttribute> fixedAttributes; std::map<std::string,int> nameToFixedAttribute; }; } #endif
{ "pile_set_name": "Github" }
<!DOCTYPE html > <html> <head> <title>CoNLLGenerator - Spark NLP 2.6.1 ScalaDoc - com.johnsnowlabs.util.CoNLLGenerator</title> <meta name="description" content="CoNLLGenerator - Spark NLP 2.6.1 ScalaDoc - com.johnsnowlabs.util.CoNLLGenerator" /> <meta name="keywords" content="CoNLLGenerator Spark NLP 2.6.1 ScalaDoc com.johnsnowlabs.util.CoNLLGenerator" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <link href="../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" /> <link href="../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" /> <script type="text/javascript" src="../../../lib/jquery.js" id="jquery-js"></script> <script type="text/javascript" src="../../../lib/jquery-ui.js"></script> <script type="text/javascript" src="../../../lib/template.js"></script> <script type="text/javascript" src="../../../lib/tools.tooltip.js"></script> <script type="text/javascript"> if(top === self) { var url = '../../../index.html'; var hash = 'com.johnsnowlabs.util.CoNLLGenerator$'; var anchor = window.location.hash; var anchor_opt = ''; if (anchor.length >= 1) anchor_opt = '@' + anchor.substring(1); window.location.href = url + '#' + hash + anchor_opt; } </script> </head> <body class="value"> <div id="definition"> <img alt="Object" src="../../../lib/object_big.png" /> <p id="owner"><a href="../../package.html" class="extype" name="com">com</a>.<a href="../package.html" class="extype" name="com.johnsnowlabs">johnsnowlabs</a>.<a href="package.html" class="extype" name="com.johnsnowlabs.util">util</a></p> <h1>CoNLLGenerator</h1><h3><span class="morelinks"><div>Related Doc: <a href="package.html" class="extype" name="com.johnsnowlabs.util">package util</a> </div></span></h3><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> </div> <h4 id="signature" class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">object</span> </span> <span class="symbol"> <span class="name">CoNLLGenerator</span> </span> </h4> <div id="comment" class="fullcommenttop"><div class="toggleContainer block"> <span class="toggle">Linear Supertypes</span> <div class="superTypes hiddenContent"><span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div> </div></div> <div id="mbrsel"> <div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div> <div id="order"> <span class="filtertype">Ordering</span> <ol> <li class="alpha in"><span>Alphabetic</span></li> <li class="inherit out"><span>By Inheritance</span></li> </ol> </div> <div id="ancestors"> <span class="filtertype">Inherited<br /> </span> <ol id="linearization"> <li class="in" name="com.johnsnowlabs.util.CoNLLGenerator"><span>CoNLLGenerator</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li> </ol> </div><div id="ancestors"> <span class="filtertype"></span> <ol> <li class="hideall out"><span>Hide All</span></li> <li class="showall in"><span>Show All</span></li> </ol> </div> <div id="visbl"> <span class="filtertype">Visibility</span> <ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol> </div> </div> <div id="template"> <div id="allMembers"> <div id="values" class="values members"> <h3>Value Members</h3> <ol><li name="scala.AnyRef#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="!=(x$1:Any):Boolean"></a> <a id="!=(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@!=(x$1:Any):Boolean" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef###" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="##():Int"></a> <a id="##():Int"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@##():Int" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="==(x$1:Any):Boolean"></a> <a id="==(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@==(x$1:Any):Boolean" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.Any#asInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="asInstanceOf[T0]:T0"></a> <a id="asInstanceOf[T0]:T0"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@asInstanceOf[T0]:T0" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="scala.AnyRef#clone" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="clone():Object"></a> <a id="clone():AnyRef"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@clone():Object" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.CloneNotSupportedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#eq" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="eq(x$1:AnyRef):Boolean"></a> <a id="eq(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@eq(x$1:AnyRef):Boolean" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#equals" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="equals(x$1:Any):Boolean"></a> <a id="equals(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@equals(x$1:Any):Boolean" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="com.johnsnowlabs.util.CoNLLGenerator#exportConllFiles" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="exportConllFiles(data:org.apache.spark.sql.DataFrame,outputPath:String):Unit"></a> <a id="exportConllFiles(DataFrame,String):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">exportConllFiles</span><span class="params">(<span name="data">data: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>, <span name="outputPath">outputPath: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@exportConllFiles(data:org.apache.spark.sql.DataFrame,outputPath:String):Unit" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> </li><li name="com.johnsnowlabs.util.CoNLLGenerator#exportConllFiles" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="exportConllFiles(data:org.apache.spark.sql.DataFrame,pipelinePath:String,outputPath:String):Unit"></a> <a id="exportConllFiles(DataFrame,String,String):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">exportConllFiles</span><span class="params">(<span name="data">data: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>, <span name="pipelinePath">pipelinePath: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="outputPath">outputPath: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@exportConllFiles(data:org.apache.spark.sql.DataFrame,pipelinePath:String,outputPath:String):Unit" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> </li><li name="com.johnsnowlabs.util.CoNLLGenerator#exportConllFiles" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="exportConllFiles(data:org.apache.spark.sql.DataFrame,pipelineModel:org.apache.spark.ml.PipelineModel,outputPath:String):Unit"></a> <a id="exportConllFiles(DataFrame,PipelineModel,String):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">exportConllFiles</span><span class="params">(<span name="data">data: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>, <span name="pipelineModel">pipelineModel: <span class="extype" name="org.apache.spark.ml.PipelineModel">PipelineModel</span></span>, <span name="outputPath">outputPath: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@exportConllFiles(data:org.apache.spark.sql.DataFrame,pipelineModel:org.apache.spark.ml.PipelineModel,outputPath:String):Unit" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> </li><li name="com.johnsnowlabs.util.CoNLLGenerator#exportConllFiles" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="exportConllFiles(spark:org.apache.spark.sql.SparkSession,filesPath:String,pipelinePath:String,outputPath:String):Unit"></a> <a id="exportConllFiles(SparkSession,String,String,String):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">exportConllFiles</span><span class="params">(<span name="spark">spark: <span class="extype" name="org.apache.spark.sql.SparkSession">SparkSession</span></span>, <span name="filesPath">filesPath: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="pipelinePath">pipelinePath: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="outputPath">outputPath: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@exportConllFiles(spark:org.apache.spark.sql.SparkSession,filesPath:String,pipelinePath:String,outputPath:String):Unit" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> </li><li name="com.johnsnowlabs.util.CoNLLGenerator#exportConllFiles" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="exportConllFiles(spark:org.apache.spark.sql.SparkSession,filesPath:String,pipelineModel:org.apache.spark.ml.PipelineModel,outputPath:String):Unit"></a> <a id="exportConllFiles(SparkSession,String,PipelineModel,String):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">exportConllFiles</span><span class="params">(<span name="spark">spark: <span class="extype" name="org.apache.spark.sql.SparkSession">SparkSession</span></span>, <span name="filesPath">filesPath: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="pipelineModel">pipelineModel: <span class="extype" name="org.apache.spark.ml.PipelineModel">PipelineModel</span></span>, <span name="outputPath">outputPath: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@exportConllFiles(spark:org.apache.spark.sql.SparkSession,filesPath:String,pipelineModel:org.apache.spark.ml.PipelineModel,outputPath:String):Unit" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> </li><li name="scala.AnyRef#finalize" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="finalize():Unit"></a> <a id="finalize():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@finalize():Unit" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="symbol">classOf[java.lang.Throwable]</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#getClass" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="getClass():Class[_]"></a> <a id="getClass():Class[_]"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@getClass():Class[_]" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#hashCode" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="hashCode():Int"></a> <a id="hashCode():Int"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">hashCode</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@hashCode():Int" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.Any#isInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="isInstanceOf[T0]:Boolean"></a> <a id="isInstanceOf[T0]:Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@isInstanceOf[T0]:Boolean" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="com.johnsnowlabs.util.CoNLLGenerator#makeConLLFormat" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="makeConLLFormat(newPOSDataset:org.apache.spark.sql.Dataset[(Array[String],Array[String],Array[(String,String)],Array[String])]):org.apache.spark.sql.Dataset[(String,String,String,String)]"></a> <a id="makeConLLFormat(Dataset[(Array[String],Array[String],Array[(String,String)],Array[String])]):Dataset[(String,String,String,String)]"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">makeConLLFormat</span><span class="params">(<span name="newPOSDataset">newPOSDataset: <span class="extype" name="org.apache.spark.sql.Dataset">Dataset</span>[(<span class="extype" name="scala.Array">Array</span>[<span class="extype" name="scala.Predef.String">String</span>], <span class="extype" name="scala.Array">Array</span>[<span class="extype" name="scala.Predef.String">String</span>], <span class="extype" name="scala.Array">Array</span>[(<span class="extype" name="scala.Predef.String">String</span>, <span class="extype" name="scala.Predef.String">String</span>)], <span class="extype" name="scala.Array">Array</span>[<span class="extype" name="scala.Predef.String">String</span>])]</span>)</span><span class="result">: <span class="extype" name="org.apache.spark.sql.Dataset">Dataset</span>[(<span class="extype" name="scala.Predef.String">String</span>, <span class="extype" name="scala.Predef.String">String</span>, <span class="extype" name="scala.Predef.String">String</span>, <span class="extype" name="scala.Predef.String">String</span>)]</span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@makeConLLFormat(newPOSDataset:org.apache.spark.sql.Dataset[(Array[String],Array[String],Array[(String,String)],Array[String])]):org.apache.spark.sql.Dataset[(String,String,String,String)]" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> </li><li name="scala.AnyRef#ne" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="ne(x$1:AnyRef):Boolean"></a> <a id="ne(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@ne(x$1:AnyRef):Boolean" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#notify" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notify():Unit"></a> <a id="notify():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@notify():Unit" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#notifyAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notifyAll():Unit"></a> <a id="notifyAll():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@notifyAll():Unit" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#synchronized" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="synchronized[T0](x$1:=&gt;T0):T0"></a> <a id="synchronized[T0](⇒T0):T0"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@synchronized[T0](x$1:=&gt;T0):T0" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#toString" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="toString():String"></a> <a id="toString():String"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.String">String</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@toString():String" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait():Unit"></a> <a id="wait():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@wait():Unit" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long,x$2:Int):Unit"></a> <a id="wait(Long,Int):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@wait(x$1:Long,x$2:Int):Unit" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long):Unit"></a> <a id="wait(Long):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#com.johnsnowlabs.util.CoNLLGenerator$@wait(x$1:Long):Unit" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li></ol> </div> </div> <div id="inheritedMembers"> <div class="parent" name="scala.AnyRef"> <h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3> </div><div class="parent" name="scala.Any"> <h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3> </div> </div> <div id="groupedMembers"> <div class="group" name="Ungrouped"> <h3>Ungrouped</h3> </div> </div> </div> <div id="tooltip"></div> <div id="footer"> </div> </body> </html>
{ "pile_set_name": "Github" }
use { crate::{ hypervisor::{Guest, VcpuIo, VcpuState}, object::*, signal::*, task::{Thread, ThreadFlag}, }, alloc::sync::Arc, core::convert::TryInto, rvm::{self, Vcpu as VcpuInner}, spin::Mutex, }; /// Virtual CPU within a Guest, which allows for execution within the virtual machine. pub struct Vcpu { base: KObjectBase, _counter: CountHelper, thread: Arc<Thread>, inner: Mutex<VcpuInner>, } impl_kobject!(Vcpu); define_count_helper!(Vcpu); impl Vcpu { /// Create a new VCPU within a guest. pub fn new(guest: Arc<Guest>, entry: u64, thread: Arc<Thread>) -> ZxResult<Arc<Self>> { if thread.flags().contains(ThreadFlag::VCPU) { return Err(ZxError::BAD_STATE); } let inner = Mutex::new(VcpuInner::new(entry, guest.rvm_guest())?); thread.update_flags(|flags| flags.insert(ThreadFlag::VCPU)); Ok(Arc::new(Vcpu { base: KObjectBase::new(), _counter: CountHelper::new(), thread, inner, })) } /// Check whether `current_thread` is the thread of the VCPU. pub fn same_thread(&self, current_thread: &Arc<Thread>) -> bool { Arc::ptr_eq(&self.thread, current_thread) } /// Inject a virtual interrupt. pub fn virtual_interrupt(&self, vector: u32) -> ZxResult { self.inner .lock() .virtual_interrupt(vector) .map_err(From::from) } /// Resume execution of the VCPU. pub fn resume(&self) -> ZxResult<PortPacket> { self.inner.lock().resume()?.try_into() } /// Read state from the VCPU. pub fn read_state(&self) -> ZxResult<VcpuState> { self.inner.lock().read_state().map_err(From::from) } /// Write state to the VCPU. pub fn write_state(&self, state: &VcpuState) -> ZxResult { self.inner.lock().write_state(state).map_err(From::from) } /// Write IO state to the VCPU. pub fn write_io_state(&self, state: &VcpuIo) -> ZxResult { self.inner.lock().write_io_state(state).map_err(From::from) } } impl Drop for Vcpu { fn drop(&mut self) { self.thread .update_flags(|flags| flags.remove(ThreadFlag::VCPU)); } } impl From<rvm::BellPacket> for PacketGuestBell { fn from(bell: rvm::BellPacket) -> Self { Self { addr: bell.addr, ..Default::default() } } } impl From<rvm::IoPacket> for PacketGuestIo { fn from(io: rvm::IoPacket) -> Self { Self { port: io.port, access_size: io.access_size, input: io.input, data: io.data, ..Default::default() } } } impl From<rvm::MmioPacket> for PacketGuestMem { fn from(mem: rvm::MmioPacket) -> Self { #[cfg(target_arch = "x86_64")] Self { addr: mem.addr, inst_len: mem.inst_len, inst_buf: mem.inst_buf, default_operand_size: mem.default_operand_size, ..Default::default() } } } impl TryInto<PortPacket> for rvm::RvmExitPacket { type Error = ZxError; #[allow(unsafe_code)] fn try_into(self) -> ZxResult<PortPacket> { use rvm::RvmExitPacketKind; let data = match self.kind { RvmExitPacketKind::GuestBell => { PayloadRepr::GuestBell(unsafe { self.inner.bell.into() }) } RvmExitPacketKind::GuestIo => PayloadRepr::GuestIo(unsafe { self.inner.io.into() }), RvmExitPacketKind::GuestMmio => { PayloadRepr::GuestMem(unsafe { self.inner.mmio.into() }) } _ => return Err(ZxError::NOT_SUPPORTED), }; Ok(PortPacketRepr { key: self.key, status: ZxError::OK, data, } .into()) } }
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "filename" : "SmallBird_11.png", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
/* copyright Steve Dekorte, 2004 license BSD revised description A Binary Stream that supports tagged items. */ #ifndef BSTREAM_DEFINED #define BSTREAM_DEFINED 1 #include "Common.h" #include "UArray.h" #include "BStreamTag.h" #ifdef __cplusplus extern "C" { #endif //typedef struct UArray UArray; typedef struct { UArray *ba; size_t index; unsigned char ownsUArray; UArray *tmp; UArray *errorBa; int flipEndian; unsigned char *typeBuf; } BStream; /* #define BStream_ba_(self, v) self->ba = v; #define BStream_ba(self) (self->ba) #define BStream_index_(self, v) self->index = v; #define BStream_index(self) (self->index) #define BStream_ownsUArray_(self, v) self->ownsUArray = v; #define BStream_ownsUArray(self) (self->ownsUArray) #define BStream_tmp_(self, v) self->tmp = v; #define BStream_tmp(self) (self->tmp) #define BStream_errorBa_(self, v) self->errorBa = v; #define BStream_errorBa(self) (self->errorBa) #define BStream_flipEndian_(self, v) self->flipEndian = v; #define BStream_flipEndian(self) (self->flipEndian) #define BStream_typeBuf_(self, v) self->typeBuf = v; #define BStream_typeBufs(self) (self->typeBuf) */ BASEKIT_API BStream *BStream_new(void); BASEKIT_API BStream *BStream_clone(BStream *self); BASEKIT_API void BStream_free(BStream *self); BASEKIT_API char *BStream_errorString(BStream *self); BASEKIT_API void BStream_setUArray_(BStream *self, UArray *ba); BASEKIT_API void BStream_setData_length_(BStream *self, unsigned char *data, size_t length); BASEKIT_API UArray *BStream_byteArray(BStream *self); BASEKIT_API void BStream_empty(BStream *self); BASEKIT_API int BStream_isEmpty(BStream *self); // writing -------------------------------------- BASEKIT_API void BStream_writeByte_(BStream *self, unsigned char v); BASEKIT_API void BStream_writeUint8_(BStream *self, uint8_t v); BASEKIT_API void BStream_writeUint32_(BStream *self, uint32_t v); BASEKIT_API void BStream_writeInt32_(BStream *self, int32_t v); #if !defined(__SYMBIAN32__) BASEKIT_API void BStream_writeInt64_(BStream *self, int64_t v); #endif BASEKIT_API void BStream_writeDouble_(BStream *self, double v); BASEKIT_API void BStream_writeData_length_(BStream *self, const unsigned char *data, size_t length); BASEKIT_API void BStream_writeCString_(BStream *self, const char *s); BASEKIT_API void BStream_writeUArray_(BStream *self, UArray *ba); // reading -------------------------------------- BASEKIT_API unsigned char BStream_readByte(BStream *self); BASEKIT_API uint8_t BStream_readUint8(BStream *self); BASEKIT_API uint32_t BStream_readUint32(BStream *self); BASEKIT_API int32_t BStream_readInt32(BStream *self); #if !defined(__SYMBIAN32__) BASEKIT_API int64_t BStream_readInt64(BStream *self); #endif BASEKIT_API double BStream_readDouble(BStream *self); BASEKIT_API uint8_t *BStream_readDataOfLength_(BStream *self, size_t length); BASEKIT_API void BStream_readUArray_(BStream *self, UArray *b); BASEKIT_API UArray *BStream_readUArray(BStream *self); BASEKIT_API const char *BStream_readCString(BStream *self); // tagged writing -------------------------------------- BASEKIT_API void BStream_writeTaggedUint8_(BStream *self, uint8_t v); BASEKIT_API void BStream_writeTaggedUint32_(BStream *self, uint32_t v); BASEKIT_API void BStream_writeTaggedInt32_(BStream *self, int32_t v); #if !defined(__SYMBIAN32__) BASEKIT_API void BStream_writeTaggedInt64_(BStream *self, int64_t v); #endif BASEKIT_API void BStream_writeTaggedDouble_(BStream *self, double v); BASEKIT_API void BStream_writeTaggedData_length_(BStream *self, const unsigned char *data, size_t length); BASEKIT_API void BStream_writeTaggedCString_(BStream *self, const char *s); BASEKIT_API void BStream_writeTaggedUArray_(BStream *self, UArray *ba); // tagged reading -------------------------------------- BASEKIT_API uint8_t BStream_readTaggedUint8(BStream *self); BASEKIT_API uint32_t BStream_readTaggedUint32(BStream *self); BASEKIT_API int32_t BStream_readTaggedInt32(BStream *self); #if !defined(__SYMBIAN32__) BASEKIT_API int64_t BStream_readTaggedInt64(BStream *self); #endif BASEKIT_API double BStream_readTaggedDouble(BStream *self); BASEKIT_API void BStream_readTaggedUArray_(BStream *self, UArray *b); BASEKIT_API UArray *BStream_readTaggedUArray(BStream *self); BASEKIT_API const char *BStream_readTaggedCString(BStream *self); BASEKIT_API void BStream_show(BStream *self); #ifdef __cplusplus } #endif #endif
{ "pile_set_name": "Github" }
import { useQuery } from 'urql'; import gql from 'graphql-tag'; import ErrorMessage from './ErrorMessage'; import PostUpvoter from './PostUpvoter'; export const allPostsQuery = gql` query allPosts($first: Int!, $skip: Int!) { allPosts(orderBy: createdAt_DESC, first: $first, skip: $skip) { id title votes url createdAt } _allPostsMeta { count } } `; export const allPostsQueryVars = { skip: 0, first: 10, }; export default function PostList() { const [allPostsResult] = useQuery({ query: allPostsQuery, variables: allPostsQueryVars, }); if (allPostsResult.error) { return <ErrorMessage message="Error loading posts." />; } else if (allPostsResult.fetching || !allPostsResult.data) { return <div>Loading</div>; } const { allPosts, _allPostsMeta } = allPostsResult.data; return ( <section> <ul> {allPosts.map((post, index) => ( <li key={post.id}> <div> <span>{index + 1}. </span> <a href={post.url}>{post.title}</a> <PostUpvoter id={post.id} votes={post.votes} /> </div> </li> ))} </ul> <style jsx>{` section { padding-bottom: 20px; } li { display: block; margin-bottom: 10px; } div { align-items: center; display: flex; } a { font-size: 14px; margin-right: 10px; text-decoration: none; padding-bottom: 0; border: 0; } span { font-size: 14px; margin-right: 5px; } ul { margin: 0; padding: 0; } button:before { align-self: center; border-style: solid; border-width: 6px 4px 0 4px; border-color: #ffffff transparent transparent transparent; content: ''; height: 0; margin-right: 5px; width: 0; } `}</style> </section> ); }
{ "pile_set_name": "Github" }
@media screen { .MediaAwareComponent:before { content: 'Media: screen'; } } @media print { .MediaAwareComponent:before { content: 'Media: print'; } }
{ "pile_set_name": "Github" }
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [1.0.11] - 2020-01-29 ### Fixed - Fix tests in node.js v12+, #179. ## [1.0.10] - 2019-02-28 ### Fixed - Fix minified version, #161. ## [1.0.9] - 2019-02-28 ### Fixed - Fix `new Buffer()` warning, #154. ## [1.0.8] - 2019-01-14 ### Fixed - Fix raw inflate with dictionary, #155. ## [1.0.7] - 2018-11-29 ### Fixed - Fixed RangeError in Crome 72, #150. ## [1.0.6] - 2017-09-14 ### Changed - Improve @std/esm compatibility. ## [1.0.5] - 2017-03-17 ### Changed - Maintenance. More formal `zlib` attribution and related changes, #93. Thanks to @bastien-roucaries for the help. ## [1.0.4] - 2016-12-15 ### Changed - Bump dev dependencies. ### Fixed - Make sure `err.message` is filled on throw. ### Added - Code examples for utf-16 string encoding & object compression. ## [1.0.3] - 2016-07-25 ### Fixed - Maintenance: re-release to properly display latest version in npm registry and badges. Because `npm publish` timestamp used instead of versions. ## [1.0.2] - 2016-07-21 ### Fixed - Fixed nasty bug in deflate (wrong `d_buf` offset), which could cause broken data in some rare cases. - Also released as 0.2.9 to give chance to old dependents, not updated to 1.x version. ## [1.0.1] - 2016-04-01 ### Added - Added dictionary support. Thanks to @dignifiedquire. ## [1.0.0] - 2016-02-17 ### Changed - Maintenance release (semver, coding style). ## [0.2.8] - 2015-09-14 ### Fixed - Fixed regression after 0.2.4 for edge conditions in inflate wrapper (#65). Added more tests to cover possible cases. ## [0.2.7] - 2015-06-09 ### Added - Added Z_SYNC_FLUSH support. Thanks to @TinoLange. ## [0.2.6] - 2015-03-24 ### Added - Allow ArrayBuffer input. ## [0.2.5] - 2014-07-19 ### Fixed - Workaround for Chrome 38.0.2096.0 script parser bug, #30. ## [0.2.4] - 2014-07-07 ### Fixed - Fixed bug in inflate wrapper, #29 ## [0.2.3] - 2014-06-09 ### Changed - Maintenance release, dependencies update. ## [0.2.2] - 2014-06-04 ### Fixed - Fixed iOS 5.1 Safari issue with `apply(typed_array)`, #26. ## [0.2.1] - 2014-05-01 ### Fixed - Fixed collision on switch dynamic/fixed tables. ## [0.2.0] - 2014-04-18 ### Added - Added custom gzip headers support. - Added strings support. - More coverage tests. ### Fixed - Improved memory allocations for small chunks. - ZStream properties rename/cleanup. ## [0.1.1] - 2014-03-20 ### Fixed - Bugfixes for inflate/deflate. ## [0.1.0] - 2014-03-15 ### Added - First release. [1.0.10]: https://github.com/nodeca/pako/compare/1.0.10...1.0.11 [1.0.10]: https://github.com/nodeca/pako/compare/1.0.9...1.0.10 [1.0.9]: https://github.com/nodeca/pako/compare/1.0.8...1.0.9 [1.0.8]: https://github.com/nodeca/pako/compare/1.0.7...1.0.8 [1.0.7]: https://github.com/nodeca/pako/compare/1.0.6...1.0.7 [1.0.6]: https://github.com/nodeca/pako/compare/1.0.5...1.0.6 [1.0.5]: https://github.com/nodeca/pako/compare/1.0.4...1.0.5 [1.0.4]: https://github.com/nodeca/pako/compare/1.0.3...1.0.4 [1.0.3]: https://github.com/nodeca/pako/compare/1.0.2...1.0.3 [1.0.2]: https://github.com/nodeca/pako/compare/1.0.1...1.0.2 [1.0.1]: https://github.com/nodeca/pako/compare/1.0.0...1.0.1 [1.0.0]: https://github.com/nodeca/pako/compare/0.2.8...1.0.0 [0.2.8]: https://github.com/nodeca/pako/compare/0.2.7...0.2.8 [0.2.7]: https://github.com/nodeca/pako/compare/0.2.6...0.2.7 [0.2.6]: https://github.com/nodeca/pako/compare/0.2.5...0.2.6 [0.2.5]: https://github.com/nodeca/pako/compare/0.2.4...0.2.5 [0.2.4]: https://github.com/nodeca/pako/compare/0.2.3...0.2.4 [0.2.3]: https://github.com/nodeca/pako/compare/0.2.2...0.2.3 [0.2.2]: https://github.com/nodeca/pako/compare/0.2.1...0.2.2 [0.2.1]: https://github.com/nodeca/pako/compare/0.2.0...0.2.1 [0.2.0]: https://github.com/nodeca/pako/compare/0.1.1...0.2.0 [0.1.1]: https://github.com/nodeca/pako/compare/0.1.0...0.1.1 [0.1.0]: https://github.com/nodeca/pako/releases/tag/0.1.0
{ "pile_set_name": "Github" }
{ "symbol": "BXC", "name": "BonusCloud", "type": "ERC20", "address": "0xdeCF7Be29F8832E9C2Ddf0388c9778B8Ba76af43", "ens_address": "", "decimals": 18, "website": "https://bonuscloud.io/", "logo": { "src": "", "width": "", "height": "", "ipfs_hash": "" }, "support": { "email": "", "url": "" }, "social": { "blog": "", "chat": "", "facebook": "", "forum": "", "github": "", "gitter": "", "instagram": "", "linkedin": "", "reddit": "", "slack": "", "telegram": "", "twitter": "", "youtube": "" } }
{ "pile_set_name": "Github" }
<Context > <Resource name="jdbc/TestDS" auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" username="xx" password="xx" driverClassName="com.mysql.jdbc.Driver" validationQuery="SELECT 1" testOnBorrow="true" maxActive="10" maxIdle="5" minIdle="2" removeAbandoned="true" url="jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=UTF-8&amp;autoReconnect=true"/> </Context>
{ "pile_set_name": "Github" }
<?php /* @homepage <https://github.com/semsol/arc2> @license W3C Software License and GPL class: ARC2 DC Extractor author: Benjamin Nowack version: 2010-11-16 */ ARC2::inc('RDFExtractor'); class ARC2_DcExtractor extends ARC2_RDFExtractor { function __construct($a, &$caller) { parent::__construct($a, $caller); } function __init() { parent::__init(); $this->a['ns']['dc'] = 'http://purl.org/dc/elements/1.1/'; } /* */ function extractRDF() { $t_vals = array(); $t = ''; foreach ($this->nodes as $n) { foreach (array('title', 'link', 'meta') as $tag) { if ($n['tag'] == $tag) { $m = 'extract' . ucfirst($tag); list ($t_vals, $t) = $this->$m($n, $t_vals, $t); } } } if ($t) { $doc = $this->getFilledTemplate($t, $t_vals, $n['doc_base']); $this->addTs(ARC2::getTriplesFromIndex($doc)); } } /* */ function extractTitle($n, $t_vals, $t) { if ($t_vals['title'] = $this->getPlainContent($n)) { $t .= '<' . $n['doc_url'] . '> dc:title ?title . '; } return array($t_vals, $t); } /* */ function extractLink($n, $t_vals, $t) { if ($this->hasRel($n, 'alternate') || $this->hasRel($n, 'meta')) { if ($href = $this->v('href uri', '', $n['a'])) { $t .= '<' . $n['doc_url'] . '> rdfs:seeAlso <' . $href . '> . '; if ($v = $this->v('type', '', $n['a'])) { $t .= '<' .$href. '> dc:format "' . $v . '" . '; } if ($v = $this->v('title', '', $n['a'])) { $t .= '<' .$href. '> dc:title "' . $v . '" . '; } } } return array($t_vals, $t); } function extractMeta($n, $t_vals, $t) { if ($this->hasAttribute('http-equiv', $n, 'Content-Type') || $this->hasAttribute('http-equiv', $n, 'content-type')) { if ($v = $this->v('content', '', $n['a'])) { $t .= '<' . $n['doc_url'] . '> dc:format "' . $v . '" . '; } } return array($t_vals, $t); } /* */ }
{ "pile_set_name": "Github" }
import os import struct import pytest import numpy as np from numpy.testing import assert_equal import nengo.utils.nco as nco from nengo.exceptions import CacheIOError from nengo.utils.nco import Subfile @pytest.fixture(name="data") def fixture_data(): return "0123456789\n123456789" @pytest.fixture(name="testfile") def fixture_testfile(data, tmpdir): f = tmpdir.join("file.txt") f.write(data) return f def write_custom_nco_header(fileobj, magic_string="NCO", version=0): magic_string = magic_string.encode("utf-8") header_format = "@{}sBLLLL".format(len(magic_string)) assert struct.calcsize(header_format) == nco.HEADER_SIZE header = struct.pack(header_format, magic_string, version, 0, 1, 2, 3) fileobj.write(header) class TestSubfile: def test_reads_only_from_start_to_end(self, data, testfile): with testfile.open() as f: assert Subfile(f, 2, 6).read() == data[2:6] with testfile.open() as f: assert Subfile(f, 2, 6).read(8) == data[2:6] with testfile.open() as f: assert Subfile(f, 2, 6).readline() == data[2:6] with testfile.open() as f: assert Subfile(f, 2, 6).readline(8) == data[2:6] def test_respects_read_size(self, data, testfile): with testfile.open() as f: assert Subfile(f, 2, 6).read(2) == data[2:4] with testfile.open() as f: assert Subfile(f, 2, 6).readline(2) == data[2:4] def test_readline(self, data, testfile): with testfile.open() as f: assert Subfile(f, 2, 14).readline() == data[2:11] with testfile.open() as f: assert Subfile(f, 2, 14).readline(15) == data[2:11] def test_readinto(self, data, testfile): b = bytearray(4) with testfile.open("rb") as f: assert Subfile(f, 2, 6).readinto(b) == 4 assert b == b"2345" def test_seek(self, data, testfile): with testfile.open() as f: sf = Subfile(f, 2, 6) sf.seek(2) assert sf.read() == data[4:6] with testfile.open() as f: sf = Subfile(f, 2, 6) sf.read(1) sf.seek(2, os.SEEK_CUR) assert sf.read() == data[5:6] with testfile.open() as f: sf = Subfile(f, 2, 6) sf.seek(-2, os.SEEK_END) assert sf.read() == data[4:6] def test_seek_before_start(self, data, testfile): with testfile.open() as f: sf = Subfile(f, 2, 6) sf.seek(-2) assert sf.read() == data[2:6] with testfile.open() as f: sf = Subfile(f, 2, 6) sf.read(1) sf.seek(-4, os.SEEK_CUR) assert sf.read() == data[2:6] with testfile.open() as f: sf = Subfile(f, 2, 6) sf.seek(-8, os.SEEK_END) assert sf.read() == data[2:6] def test_seek_after_end(self, testfile): with testfile.open() as f: sf = Subfile(f, 2, 6) sf.seek(8) assert sf.read() == "" with testfile.open() as f: sf = Subfile(f, 2, 6) sf.read(1) sf.seek(8, os.SEEK_CUR) assert sf.read() == "" with testfile.open() as f: sf = Subfile(f, 2, 6) sf.seek(8, os.SEEK_END) assert sf.read() == "" def test_tell(self, data, testfile): with testfile.open() as f: sf = Subfile(f, 2, 6) assert sf.tell() == 0 sf.seek(3) assert sf.tell() == 3 def test_read_errors(self, tmpdir): # use a bad magic string filepath = str(tmpdir.join("bad_magic_cache_file.txt")) with open(filepath, "wb") as fh: write_custom_nco_header(fh, magic_string="BAD") with open(filepath, "rb") as fh: with pytest.raises(CacheIOError, match="Not a Nengo cache object file"): nco.read(fh) # use a bad version number filepath = str(tmpdir.join("bad_version_cache_file.txt")) with open(filepath, "wb") as fh: write_custom_nco_header(fh, version=255) with open(filepath, "rb") as fh: with pytest.raises(CacheIOError, match="NCO protocol version 255 is"): nco.read(fh) def test_nco_roundtrip(tmpdir): tmpfile = tmpdir.join("test.nco") pickle_data = {"0": 237, "str": "foobar"} array = np.array([[4, 3], [2, 1]]) with tmpfile.open("wb") as f: nco.write(f, pickle_data, array) with tmpfile.open("rb") as f: pickle_data2, array2 = nco.read(f) assert pickle_data == pickle_data2 assert_equal(array, array2)
{ "pile_set_name": "Github" }
// Code generated by smithy-go-codegen DO NOT EDIT. package ecs import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecs/types" smithy "github.com/awslabs/smithy-go" "github.com/awslabs/smithy-go/middleware" smithyhttp "github.com/awslabs/smithy-go/transport/http" ) // Lists the services that are running in a specified cluster. func (c *Client) ListServices(ctx context.Context, params *ListServicesInput, optFns ...func(*Options)) (*ListServicesOutput, error) { stack := middleware.NewStack("ListServices", smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } addawsAwsjson11_serdeOpListServicesMiddlewares(stack) awsmiddleware.AddRequestInvocationIDMiddleware(stack) smithyhttp.AddContentLengthMiddleware(stack) AddResolveEndpointMiddleware(stack, options) v4.AddComputePayloadSHA256Middleware(stack) retry.AddRetryMiddlewares(stack, options) addHTTPSignerV4Middleware(stack, options) awsmiddleware.AddAttemptClockSkewMiddleware(stack) addClientUserAgent(stack) smithyhttp.AddErrorCloseResponseBodyMiddleware(stack) smithyhttp.AddCloseResponseBodyMiddleware(stack) stack.Initialize.Add(newServiceMetadataMiddleware_opListServices(options.Region), middleware.Before) addRequestIDRetrieverMiddleware(stack) addResponseErrorMiddleware(stack) for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err := handler.Handle(ctx, params) if err != nil { return nil, &smithy.OperationError{ ServiceID: ServiceID, OperationName: "ListServices", Err: err, } } out := result.(*ListServicesOutput) out.ResultMetadata = metadata return out, nil } type ListServicesInput struct { // The maximum number of service results returned by ListServices in paginated // output. When this parameter is used, ListServices only returns maxResults // results in a single page along with a nextToken response element. The remaining // results of the initial request can be seen by sending another ListServices // request with the returned nextToken value. This value can be between 1 and 100. // If this parameter is not used, then ListServices returns up to 10 results and a // nextToken value if applicable. MaxResults *int32 // The short name or full Amazon Resource Name (ARN) of the cluster that hosts the // services to list. If you do not specify a cluster, the default cluster is // assumed. Cluster *string // The nextToken value returned from a ListServices request indicating that more // results are available to fulfill the request and further calls will be needed. // If maxResults was provided, it is possible the number of results to be fewer // than maxResults. This token should be treated as an opaque identifier that is // only used to retrieve the next items in a list and not for other programmatic // purposes. NextToken *string // The scheduling strategy for services to list. SchedulingStrategy types.SchedulingStrategy // The launch type for the services to list. LaunchType types.LaunchType } type ListServicesOutput struct { // The nextToken value to include in a future ListServices request. When the // results of a ListServices request exceed maxResults, this value can be used to // retrieve the next page of results. This value is null when there are no more // results to return. NextToken *string // The list of full ARN entries for each service associated with the specified // cluster. ServiceArns []*string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata } func addawsAwsjson11_serdeOpListServicesMiddlewares(stack *middleware.Stack) { stack.Serialize.Add(&awsAwsjson11_serializeOpListServices{}, middleware.After) stack.Deserialize.Add(&awsAwsjson11_deserializeOpListServices{}, middleware.After) } func newServiceMetadataMiddleware_opListServices(region string) awsmiddleware.RegisterServiceMetadata { return awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "ecs", OperationName: "ListServices", } }
{ "pile_set_name": "Github" }
local nmap = require "nmap" local os = require "os" local shortport = require "shortport" local stdnse = require "stdnse" local string = require "string" local table = require "table" description = [[ Attempts to extract system information (OS, hardware, etc.) from the Sun Service Tags service agent (UDP port 6481). Based on protocol specs from http://arc.opensolaris.org/caselog/PSARC/2006/638/stdiscover_protocolv2.pdf http://arc.opensolaris.org/caselog/PSARC/2006/638/stlisten_protocolv2.pdf http://arc.opensolaris.org/caselog/PSARC/2006/638/ServiceTag_API_CLI_v07.pdf ]] --- -- @usage -- nmap -sU -p 6481 --script=servicetags <target> -- @output -- | servicetags: -- | URN: urn:st:3bf76681-5e68-415b-f980-abcdef123456 -- | System: SunOS -- | Release: 5.10 -- | Hostname: myhost -- | Architecture: sparc -- | Platform: SUNW,SPARC-Enterprise-T5120::Generic_142900-13 -- | Manufacturer: Sun Microsystems, Inc. -- | CPU Manufacturer: Sun Microsystems, Inc. -- | Serial Number: ABC123456 -- | HostID: 12345678 -- | RAM: 16256 -- | CPUs: 1 -- | Cores: 4 -- | Virtual CPUs: 32 -- | CPU Name: UltraSPARC-T2 -- | CPU Clock Rate: 1165 -- | Service Tags -- | Solaris 10 Operating System -- | Product Name: Solaris 10 Operating System -- | Instance URN: urn:st:90592a79-974d-ebcc-c17a-b87b8eee5f1f -- | Product Version: 10 -- | Product URN: urn:uuid:5005588c-36f3-11d6-9cec-fc96f718e113 -- | Product Parent URN: urn:uuid:596ffcfa-63d5-11d7-9886-ac816a682f92 -- | Product Parent: Solaris Operating System -- | Product Defined Instance ID: -- | Timestamp: 2010-08-10 07:35:40 GMT -- | Container: global -- | Source: SUNWstosreg -- | SUNW,SPARC-Enterprise-T5120 SPARC System -- | Product Name: SUNW,SPARC-Enterprise-T5120 SPARC System -- | Instance URN: urn:st:51c61acd-9f37-65af-a667-c9925a5b0ee9 -- | Product Version: -- | Product URN: urn:st:hwreg:SUNW,SPARC-Enterprise-T5120:Sun Microsystems:sparc -- | Product Parent URN: urn:st:hwreg:System:Sun Microsystems -- | Product Parent: System -- | Product Defined Instance ID: -- | Timestamp: 2010-08-10 07:35:41 GMT -- | Container: global -- | Source: SUNWsthwreg -- | Explorer -- | Product Name: Explorer -- | Instance URN: urn:st:2dc5ab61-9bb5-409b-e910-fa39840d0d85 -- | Product Version: 6.4 -- | Product URN: urn:uuid:9cb70a38-7d15-11de-9d26-080020a9ed93 -- | Product Parent URN: -- | Product Parent: -- | Product Defined Instance ID: -- | Timestamp: 2010-08-10 07:35:42 GMT -- | Container: global -- |_ Source: Explorer -- version 1.0 author = "Matthew Flanagan" license = "Same as Nmap--See https://nmap.org/book/man-legal.html" categories = {"default", "discovery", "safe"} -- Mapping from XML element names to human-readable table labels. local XML_TO_TEXT = { -- Information about the agent. system = "System", release = "Release", host = "Hostname", architecture = "Architecture", platform = "Platform", manufacturer = "Manufacturer", cpu_manufacturer = "CPU Manufacturer", serial_number = "Serial Number", hostid = "HostID", physmem = "RAM", sockets = "CPUs", cores = "Cores", virtcpus = "Virtual CPUs", name = "CPU Name:", clockrate = "CPU Clock Rate", -- Information about an individual svctag. product_name = "Product Name", instance_urn = "Instance URN", product_version = "Product Version", product_urn = "Product URN", product_parent_urn = "Product Parent URN", product_parent = "Product Parent", product_defined_inst_id = "Product Defined Instance ID", product_vendor = "Product Vendor", timestamp = "Timestamp", container = "Container", source = "Source", platform_arch = "Platform Arch", installer_uid = "Installer UID", version = "Version", } --- -- Runs on UDP port 6481 portrule = shortport.portnumber(6481, "udp", {"open", "open|filtered"}) local get_agent, get_svctag_list, get_svctag --- -- Sends Service Tags discovery packet to host, -- and extracts service information from results action = function(host, port) -- create the socket used for our connection local socket = nmap.new_socket() -- set a reasonable timeout value socket:set_timeout(5000) -- do some exception handling / cleanup local catch = function() socket:close() end local try = nmap.new_try(catch) -- connect to the potential service tags discoverer try(socket:connect(host, port)) local payload payload = "[PROBE] ".. tostring(os.time()) .. "\r\n" try(socket:send(payload)) local status local response -- read in any response we might get response = try(socket:receive()) socket:close() -- since we got something back, the port is definitely open nmap.set_port_state(host, port, "open") -- buffer to hold script output local output = {} -- We should get a response back that has contains one line for the -- agent URN and TCP port local urn, xport, split split = stdnse.strsplit(" ", response) urn = split[1] xport = split[2] table.insert(output, "URN: " .. urn) if xport ~= nil then get_agent(host, xport, output) -- Check if any other service tags are registered and enumerate them local svctags_list status, svctags_list = get_svctag_list(host, xport, output) if status then local svctags = {} local tag for _, svctag in ipairs(svctags_list) do svctags['name'] = "Service Tags" status, tag = get_svctag(host, port, svctag) if status then svctags[#svctags + 1] = tag end end table.insert(output, svctags) end end port.name = "servicetags" nmap.set_port_version(host, port) return stdnse.format_output(true, output) end function get_agent(host, port, output) local socket = nmap.new_socket() local status, err, response socket:set_timeout(5000) status, err = socket:connect(host.ip, port, "tcp") if not status then return nil, err end status, err = socket:send("GET /stv1/agent/ HTTP/1.0\r\n") if not status then socket:close() return nil, err end status, response = socket:receive_buf("</st1:response>", true) if not status then socket:close() return nil, response end socket:close() for elem, contents in string.gmatch(response, "<([^>]+)>([^<]-)</%1>") do if XML_TO_TEXT[elem] then table.insert(output, string.format("%s: %s", XML_TO_TEXT[elem], contents)) end end return true, output end function get_svctag_list(host, port) local socket = nmap.new_socket() local status, err, response socket:set_timeout(5000) status, err = socket:connect(host.ip, port, "tcp") if not status then return nil, err end status, err = socket:send("GET /stv1/svctag/ HTTP/1.0\r\n") if not status then socket:close() return nil, err end status, response = socket:receive_buf("</service_tags>", true) if not status then socket:close() return nil, response end socket:close() local svctags = {} for svctag in string.gmatch(response, "<link type=\"service_tag\" href=\"(.-)\" />") do svctags[#svctags + 1] = svctag end return true, svctags end function get_svctag(host, port, svctag) local socket = nmap.new_socket() local status, err, response socket:set_timeout(5000) status, err = socket:connect(host.ip, port, "tcp") if not status then return nil, err end status, err = socket:send("GET " .. svctag .. " HTTP/1.0\r\n") if not status then socket:close() return nil, err end status, response = socket:receive_buf("</st1:response>", true) if not status then socket:close() return nil, response end socket:close() local tag = {} for elem, contents in string.gmatch(response, "<([^>]+)>([^<]-)</%1>") do if elem == "product_name" then tag['name'] = contents end if XML_TO_TEXT[elem] then table.insert(tag, string.format("%s: %s", XML_TO_TEXT[elem], contents)) end end return true, tag end
{ "pile_set_name": "Github" }
##Package: MM ##Status: Completed,Checked ---------------------------------------------------------------------------------------------------- @@JvAnimate.pas Summary Contains the TJvAnimate component. Author Sébastien Buysse ---------------------------------------------------------------------------------------------------- @@TJvAnimate.HintColor Summary Determines the color of the hint box. Description Use HintColor to specify the hint box color. A default color value of clInfoBk is set for the HintColor property in the constructor of the control. To change the HintColor assign it a new TColor value. ---------------------------------------------------------------------------------------------------- @@TJvAnimate <TITLEIMG TJvAnimate> #JVCLInfo <GROUP JVCL.CommCtrl,JVCL.Graphics.Animations> <FLAG Component> Summary Enhanced TAnimate control. Description The TJvAnimate component provides you with an enhanced TAnimate component that provides a HintColor property as well as additional events. ---------------------------------------------------------------------------------------------------- @@TJvAnimate.OnParentColorChange Summary Occurs when the color of the parent control changes. Description Write an OnParentColorChange event handler to take specific action when the parent's Color property changes.
{ "pile_set_name": "Github" }
# Formidable [![Build Status](https://secure.travis-ci.org/felixge/node-formidable.png?branch=master)](http://travis-ci.org/felixge/node-formidable) ## Purpose A node.js module for parsing form data, especially file uploads. ## Current status This module was developed for [Transloadit](http://transloadit.com/), a service focused on uploading and encoding images and videos. It has been battle-tested against hundreds of GB of file uploads from a large variety of clients and is considered production-ready. ## Features * Fast (~500mb/sec), non-buffering multipart parser * Automatically writing file uploads to disk * Low memory footprint * Graceful error handling * Very high test coverage ## Changelog ### v1.0.9 * Emit progress when content length header parsed (Tim Koschützki) * Fix Readme syntax due to GitHub changes (goob) * Replace references to old 'sys' module in Readme with 'util' (Peter Sugihara) ### v1.0.8 * Strip potentially unsafe characters when using `keepExtensions: true`. * Switch to utest / urun for testing * Add travis build ### v1.0.7 * Remove file from package that was causing problems when installing on windows. (#102) * Fix typos in Readme (Jason Davies). ### v1.0.6 * Do not default to the default to the field name for file uploads where filename="". ### v1.0.5 * Support filename="" in multipart parts * Explain unexpected end() errors in parser better **Note:** Starting with this version, formidable emits 'file' events for empty file input fields. Previously those were incorrectly emitted as regular file input fields with value = "". ### v1.0.4 * Detect a good default tmp directory regardless of platform. (#88) ### v1.0.3 * Fix problems with utf8 characters (#84) / semicolons in filenames (#58) * Small performance improvements * New test suite and fixture system ### v1.0.2 * Exclude node\_modules folder from git * Implement new `'aborted'` event * Fix files in example folder to work with recent node versions * Make gently a devDependency [See Commits](https://github.com/felixge/node-formidable/compare/v1.0.1...v1.0.2) ### v1.0.1 * Fix package.json to refer to proper main directory. (#68, Dean Landolt) [See Commits](https://github.com/felixge/node-formidable/compare/v1.0.0...v1.0.1) ### v1.0.0 * Add support for multipart boundaries that are quoted strings. (Jeff Craig) This marks the beginning of development on version 2.0 which will include several architectural improvements. [See Commits](https://github.com/felixge/node-formidable/compare/v0.9.11...v1.0.0) ### v0.9.11 * Emit `'progress'` event when receiving data, regardless of parsing it. (Tim Koschützki) * Use [W3C FileAPI Draft](http://dev.w3.org/2006/webapi/FileAPI/) properties for File class **Important:** The old property names of the File class will be removed in a future release. [See Commits](https://github.com/felixge/node-formidable/compare/v0.9.10...v0.9.11) ### Older releases These releases were done before starting to maintain the above Changelog: * [v0.9.10](https://github.com/felixge/node-formidable/compare/v0.9.9...v0.9.10) * [v0.9.9](https://github.com/felixge/node-formidable/compare/v0.9.8...v0.9.9) * [v0.9.8](https://github.com/felixge/node-formidable/compare/v0.9.7...v0.9.8) * [v0.9.7](https://github.com/felixge/node-formidable/compare/v0.9.6...v0.9.7) * [v0.9.6](https://github.com/felixge/node-formidable/compare/v0.9.5...v0.9.6) * [v0.9.5](https://github.com/felixge/node-formidable/compare/v0.9.4...v0.9.5) * [v0.9.4](https://github.com/felixge/node-formidable/compare/v0.9.3...v0.9.4) * [v0.9.3](https://github.com/felixge/node-formidable/compare/v0.9.2...v0.9.3) * [v0.9.2](https://github.com/felixge/node-formidable/compare/v0.9.1...v0.9.2) * [v0.9.1](https://github.com/felixge/node-formidable/compare/v0.9.0...v0.9.1) * [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) * [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) * [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) * [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) * [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) * [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) * [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) * [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) * [v0.1.0](https://github.com/felixge/node-formidable/commits/v0.1.0) ## Installation Via [npm](http://github.com/isaacs/npm): npm install formidable@latest Manually: git clone git://github.com/felixge/node-formidable.git formidable vim my.js # var formidable = require('./formidable'); Note: Formidable requires [gently](http://github.com/felixge/node-gently) to run the unit tests, but you won't need it for just using the library. ## Example Parse an incoming file upload. var formidable = require('formidable'), http = require('http'), util = require('util'); http.createServer(function(req, res) { if (req.url == '/upload' && req.method.toLowerCase() == 'post') { // parse a file upload var form = new formidable.IncomingForm(); form.parse(req, function(err, fields, files) { res.writeHead(200, {'content-type': 'text/plain'}); res.write('received upload:\n\n'); res.end(util.inspect({fields: fields, files: files})); }); return; } // show a file upload form res.writeHead(200, {'content-type': 'text/html'}); res.end( '<form action="/upload" enctype="multipart/form-data" method="post">'+ '<input type="text" name="title"><br>'+ '<input type="file" name="upload" multiple="multiple"><br>'+ '<input type="submit" value="Upload">'+ '</form>' ); }).listen(80); ## API ### formidable.IncomingForm __new formidable.IncomingForm()__ Creates a new incoming form. __incomingForm.encoding = 'utf-8'__ The encoding to use for incoming form fields. __incomingForm.uploadDir = process.env.TMP || '/tmp' || process.cwd()__ The directory for placing file uploads in. You can move them later on using `fs.rename()`. The default directory is picked at module load time depending on the first existing directory from those listed above. __incomingForm.keepExtensions = false__ If you want the files written to `incomingForm.uploadDir` to include the extensions of the original files, set this property to `true`. __incomingForm.type__ Either 'multipart' or 'urlencoded' depending on the incoming request. __incomingForm.maxFieldsSize = 2 * 1024 * 1024__ Limits the amount of memory a field (not file) can allocate in bytes. If this value is exceeded, an `'error'` event is emitted. The default size is 2MB. __incomingForm.hash = false__ If you want checksums calculated for incoming files, set this to either `'sha1'` or `'md5'`. __incomingForm.bytesReceived__ The amount of bytes received for this form so far. __incomingForm.bytesExpected__ The expected number of bytes in this form. __incomingForm.parse(request, [cb])__ Parses an incoming node.js `request` containing form data. If `cb` is provided, all fields an files are collected and passed to the callback: incomingForm.parse(req, function(err, fields, files) { // ... }); __incomingForm.onPart(part)__ You may overwrite this method if you are interested in directly accessing the multipart stream. Doing so will disable any `'field'` / `'file'` events processing which would occur otherwise, making you fully responsible for handling the processing. incomingForm.onPart = function(part) { part.addListener('data', function() { // ... }); } If you want to use formidable to only handle certain parts for you, you can do so: incomingForm.onPart = function(part) { if (!part.filename) { // let formidable handle all non-file parts incomingForm.handlePart(part); } } Check the code in this method for further inspiration. __Event: 'progress' (bytesReceived, bytesExpected)__ Emitted after each incoming chunk of data that has been parsed. Can be used to roll your own progress bar. __Event: 'field' (name, value)__ Emitted whenever a field / value pair has been received. __Event: 'fileBegin' (name, file)__ Emitted whenever a new file is detected in the upload stream. Use this even if you want to stream the file to somewhere else while buffering the upload on the file system. __Event: 'file' (name, file)__ Emitted whenever a field / file pair has been received. `file` is an instance of `File`. __Event: 'error' (err)__ Emitted when there is an error processing the incoming form. A request that experiences an error is automatically paused, you will have to manually call `request.resume()` if you want the request to continue firing `'data'` events. __Event: 'aborted'__ Emitted when the request was aborted by the user. Right now this can be due to a 'timeout' or 'close' event on the socket. In the future there will be a separate 'timeout' event (needs a change in the node core). __Event: 'end' ()__ Emitted when the entire request has been received, and all contained files have finished flushing to disk. This is a great place for you to send your response. ### formidable.File __file.size = 0__ The size of the uploaded file in bytes. If the file is still being uploaded (see `'fileBegin'` event), this property says how many bytes of the file have been written to disk yet. __file.path = null__ The path this file is being written to. You can modify this in the `'fileBegin'` event in case you are unhappy with the way formidable generates a temporary path for your files. __file.name = null__ The name this file had according to the uploading client. __file.type = null__ The mime type of this file, according to the uploading client. __file.lastModifiedDate = null__ A date object (or `null`) containing the time this file was last written to. Mostly here for compatibility with the [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/). __file.hash = null__ If hash calculation was set, you can read the hex digest out of this var. ## License Formidable is licensed under the MIT license. ## Ports * [multipart-parser](http://github.com/FooBarWidget/multipart-parser): a C++ parser based on formidable ## Credits * [Ryan Dahl](http://twitter.com/ryah) for his work on [http-parser](http://github.com/ry/http-parser) which heavily inspired multipart_parser.js
{ "pile_set_name": "Github" }
![screenshot](https://castawaylabs.github.io/cachet-monitor/screenshot.png) ## Features - [x] Creates & Resolves Incidents - [x] Posts monitor lag to cachet graphs - [x] HTTP Checks (body/status code) - [x] DNS Checks - [x] Updates Component to Partial Outage - [x] Updates Component to Major Outage if already in Partial Outage (works with distributed monitors) - [x] Can be run on multiple servers and geo regions ## Example Configuration **Note:** configuration can be in json or yaml format. [`example.config.json`](https://github.com/CastawayLabs/cachet-monitor/blob/master/example.config.json), [`example.config.yaml`](https://github.com/CastawayLabs/cachet-monitor/blob/master/example.config.yml) files. ```yaml api: # cachet url url: https://demo.cachethq.io/api/v1 # cachet api token token: 9yMHsdioQosnyVK4iCVR insecure: false # https://golang.org/src/time/format.go#L57 date_format: 02/01/2006 15:04:05 MST monitors: # http monitor example - name: google # test url target: https://google.com # strict certificate checking for https strict: true # HTTP method method: POST # set to update component (either component_id or metric_id are required) component_id: 1 # set to post lag to cachet metric (graph) metric_id: 4 # custom templates (see readme for details) # leave empty for defaults template: investigating: subject: "{{ .Monitor.Name }} - {{ .SystemName }}" message: "{{ .Monitor.Name }} check **failed** (server time: {{ .now }})\n\n{{ .FailReason }}" fixed: subject: "I HAVE BEEN FIXED" # seconds between checks interval: 1 # seconds for timeout timeout: 1 # If % of downtime is over this threshold, open an incident threshold: 80 # custom HTTP headers headers: Authorization: Basic <hash> # expected status code (either status code or body must be supplied) expected_status_code: 200 # regex to match body expected_body: "P.*NG" # dns monitor example - name: dns # fqdn target: matej.me. # question type (A/AAAA/CNAME/...) question: mx type: dns # set component_id/metric_id component_id: 2 # poll every 1s interval: 1 timeout: 1 # custom DNS server (defaults to system) dns: 8.8.4.4:53 answers: # exact/regex check - regex: [1-9] alt[1-9].aspmx.l.google.com. - exact: 10 aspmx2.googlemail.com. - exact: 1 aspmx.l.google.com. - exact: 10 aspmx3.googlemail.com. ``` ## Installation 1. Download binary from [release page](https://github.com/CastawayLabs/cachet-monitor/releases) 2. Add the binary to an executable path (/usr/bin, etc.) 3. Create a configuration following provided examples 4. `cachet-monitor -c /etc/cachet-monitor.yaml` pro tip: run in background using `nohup cachet-monitor 2>&1 > /var/log/cachet-monitor.log &`, or use a tmux/screen session ``` Usage: cachet-monitor (-c PATH | --config PATH) [--log=LOGPATH] [--name=NAME] [--immediate] cachet-monitor -h | --help | --version Arguments: PATH path to config.json LOGPATH path to log output (defaults to STDOUT) NAME name of this logger Examples: cachet-monitor -c /root/cachet-monitor.json cachet-monitor -c /root/cachet-monitor.json --log=/var/log/cachet-monitor.log --name="development machine" Options: -c PATH.json --config PATH Path to configuration file -h --help Show this screen. --version Show version --immediate Tick immediately (by default waits for first defined interval) Environment varaibles: CACHET_API override API url from configuration CACHET_TOKEN override API token from configuration CACHET_DEV set to enable dev logging ``` ## Init script If your system is running systemd (like Debian, Ubuntu 16.04, Fedora, RHEL7, or Archlinux) you can use the provided example file: [example.cachet-monitor.service](https://github.com/CastawayLabs/cachet-monitor/blob/master/example.cachet-monitor.service). 1. Simply put it in the right place with `cp example.cachet-monitor.service /etc/systemd/system/cachet-monitor.service` 2. Then do a `systemctl daemon-reload` in your terminal to update Systemd configuration 3. Finally you can start cachet-monitor on every startup with `systemctl enable cachet-monitor.service`! 👍 ## Templates This package makes use of [`text/template`](https://godoc.org/text/template). [Default HTTP template](https://github.com/CastawayLabs/cachet-monitor/blob/master/http.go#L14) The following variables are available: | Root objects | Description | | ------------- | ------------------------------------| | `.SystemName` | system name | | `.API` | `api` object from configuration | | `.Monitor` | `monitor` object from configuration | | `.now` | formatted date string | | Monitor variables | | ------------------ | | `.Name` | | `.Target` | | `.Type` | | `.Strict` | | `.MetricID` | | ... | All monitor variables are available from `monitor.go` ## Vision and goals We made this tool because we felt the need to have our own monitoring software (leveraging on Cachet). The idea is a stateless program which collects data and pushes it to a central cachet instance. This gives us power to have an army of geographically distributed loggers and reveal issues in both latency & downtime on client websites. ## Package usage When using `cachet-monitor` as a package in another program, you should follow what `cli/main.go` does. It is important to call `Validate` on `CachetMonitor` and all the monitors inside. [API Documentation](https://godoc.org/github.com/CastawayLabs/cachet-monitor) # Contributions welcome We'll happily accept contributions for the following (non exhaustive list). - Implement ICMP check - Implement TCP check - Any bug fixes / code improvements - Test cases
{ "pile_set_name": "Github" }
// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 50; objects = { /* Begin PBXBuildFile section */ 8809331E20DBC787008C90CB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8809331D20DBC787008C90CB /* Assets.xcassets */; }; 881FFBBB20C148D4000AFBB5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 881FFBBA20C148D4000AFBB5 /* AppDelegate.swift */; }; 881FFBBD20C148D4000AFBB5 /* art.scnassets in Resources */ = {isa = PBXBuildFile; fileRef = 881FFBBC20C148D4000AFBB5 /* art.scnassets */; }; 881FFBBF20C148D4000AFBB5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 881FFBBE20C148D4000AFBB5 /* ViewController.swift */; }; 881FFBC220C148D4000AFBB5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 881FFBC020C148D4000AFBB5 /* Main.storyboard */; }; 881FFBC720C148D5000AFBB5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 881FFBC520C148D5000AFBB5 /* LaunchScreen.storyboard */; }; 88C1416120C177870023A1F0 /* NodeUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88C1416020C177870023A1F0 /* NodeUtils.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 8809331D20DBC787008C90CB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 881FFBB720C148D4000AFBB5 /* AREasyStart.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AREasyStart.app; sourceTree = BUILT_PRODUCTS_DIR; }; 881FFBBA20C148D4000AFBB5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 881FFBBC20C148D4000AFBB5 /* art.scnassets */ = {isa = PBXFileReference; lastKnownFileType = wrapper.scnassets; path = art.scnassets; sourceTree = "<group>"; }; 881FFBBE20C148D4000AFBB5 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; }; 881FFBC120C148D4000AFBB5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 881FFBC620C148D5000AFBB5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 881FFBC820C148D5000AFBB5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 88C1416020C177870023A1F0 /* NodeUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NodeUtils.swift; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 881FFBB420C148D4000AFBB5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 881FFBAE20C148D4000AFBB5 = { isa = PBXGroup; children = ( 881FFBB920C148D4000AFBB5 /* AREasyStart */, 881FFBB820C148D4000AFBB5 /* Products */, ); sourceTree = "<group>"; }; 881FFBB820C148D4000AFBB5 /* Products */ = { isa = PBXGroup; children = ( 881FFBB720C148D4000AFBB5 /* AREasyStart.app */, ); name = Products; sourceTree = "<group>"; }; 881FFBB920C148D4000AFBB5 /* AREasyStart */ = { isa = PBXGroup; children = ( 881FFBBA20C148D4000AFBB5 /* AppDelegate.swift */, 88C1416020C177870023A1F0 /* NodeUtils.swift */, 881FFBBC20C148D4000AFBB5 /* art.scnassets */, 881FFBBE20C148D4000AFBB5 /* ViewController.swift */, 881FFBC020C148D4000AFBB5 /* Main.storyboard */, 881FFBC520C148D5000AFBB5 /* LaunchScreen.storyboard */, 8809331D20DBC787008C90CB /* Assets.xcassets */, 881FFBC820C148D5000AFBB5 /* Info.plist */, ); path = AREasyStart; sourceTree = "<group>"; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 881FFBB620C148D4000AFBB5 /* AREasyStart */ = { isa = PBXNativeTarget; buildConfigurationList = 881FFBCB20C148D5000AFBB5 /* Build configuration list for PBXNativeTarget "AREasyStart" */; buildPhases = ( 881FFBB320C148D4000AFBB5 /* Sources */, 881FFBB420C148D4000AFBB5 /* Frameworks */, 881FFBB520C148D4000AFBB5 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = AREasyStart; productName = AREasyStart; productReference = 881FFBB720C148D4000AFBB5 /* AREasyStart.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 881FFBAF20C148D4000AFBB5 /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0940; LastUpgradeCheck = 0940; ORGANIZATIONNAME = "Manuela Rink"; TargetAttributes = { 881FFBB620C148D4000AFBB5 = { CreatedOnToolsVersion = 9.4; LastSwiftMigration = 1000; }; }; }; buildConfigurationList = 881FFBB220C148D4000AFBB5 /* Build configuration list for PBXProject "AREasyStart" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 881FFBAE20C148D4000AFBB5; productRefGroup = 881FFBB820C148D4000AFBB5 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 881FFBB620C148D4000AFBB5 /* AREasyStart */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 881FFBB520C148D4000AFBB5 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 881FFBBD20C148D4000AFBB5 /* art.scnassets in Resources */, 881FFBC720C148D5000AFBB5 /* LaunchScreen.storyboard in Resources */, 8809331E20DBC787008C90CB /* Assets.xcassets in Resources */, 881FFBC220C148D4000AFBB5 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 881FFBB320C148D4000AFBB5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 881FFBBF20C148D4000AFBB5 /* ViewController.swift in Sources */, 88C1416120C177870023A1F0 /* NodeUtils.swift in Sources */, 881FFBBB20C148D4000AFBB5 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 881FFBC020C148D4000AFBB5 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 881FFBC120C148D4000AFBB5 /* Base */, ); name = Main.storyboard; sourceTree = "<group>"; }; 881FFBC520C148D5000AFBB5 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( 881FFBC620C148D5000AFBB5 /* Base */, ); name = LaunchScreen.storyboard; sourceTree = "<group>"; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 881FFBC920C148D5000AFBB5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.4; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; 881FFBCA20C148D5000AFBB5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.4; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; }; 881FFBCC20C148D5000AFBB5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 8W62GL8FE7; INFOPLIST_FILE = AREasyStart/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = com.ms.edustart.AREasyStart; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 881FFBCD20C148D5000AFBB5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 8W62GL8FE7; INFOPLIST_FILE = AREasyStart/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = com.ms.edustart.AREasyStart; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 881FFBB220C148D4000AFBB5 /* Build configuration list for PBXProject "AREasyStart" */ = { isa = XCConfigurationList; buildConfigurations = ( 881FFBC920C148D5000AFBB5 /* Debug */, 881FFBCA20C148D5000AFBB5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 881FFBCB20C148D5000AFBB5 /* Build configuration list for PBXNativeTarget "AREasyStart" */ = { isa = XCConfigurationList; buildConfigurations = ( 881FFBCC20C148D5000AFBB5 /* Debug */, 881FFBCD20C148D5000AFBB5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 881FFBAF20C148D4000AFBB5 /* Project object */; }
{ "pile_set_name": "Github" }
# 常用注解 ## @Temporal @Temporal JPA 映射时间(Temporal)类型 * 1、如果在某类中有Date类型的属性,数据库中存储可能是'yyyy-MM-dd hh:MM:ss'要在查询时获得年月日,在该属性上标注@Temporal(TemporalType.DATE) 会得到形如'yyyy-MM-dd' 格式的日期。 * 2、如果在某类中有Date类型的属性,数据库中存储可能是'yyyy-MM-dd hh:MM:ss'要获得时分秒,在该属性上标注 @Temporal(TemporalType.TIME) 会得到形如'HH:MM:SS' 格式的日期。 * 3、如果在某类中有Date类型的属性,数据库中存储可能是'yyyy-MM-dd hh:MM:ss'要获得'是'yyyy-MM-dd hh:MM:ss',在该属性上标注 @Temporal(TemporalType.TIMESTAMP) 会得到形如'HH:MM:SS' 格式的日期 * java.sql.Date 日期型,精确到年月日,例如“2008-08-08” * java.sql.Time 时间型,精确到时分秒,例如“20:00:00” * java.sql.Timestamp 时间戳,精确到纳秒,例如“2008-08-08 20:00:00.000000001” ## @Qualifier * 在autoware时,由于有两个类实现了EmployeeService接口,所以Spring不知道应该绑定哪个实现类 * @Qualifier注解了,qualifier的意思是合格者,通过这个标示,表明了哪个实现类才是我们所需要的 ## @SpringBootApplication exclude spring boot 集成了很多框架,如果项目中需要完全定制框架。者exclude 对应的autoConfiguration ```java @SpringBootApplication (exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class, RedisAutoConfiguration.class }) ```
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="renderer" content="webkit"> <title>素材火www.sucaihuo.com - 项目详情</title> <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台"> <meta name="description" content="H+是一个完全响应式,基于Bootstrap3最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术"> <link href="css/bootstrap.min.css?v=3.4.0" rel="stylesheet"> <link href="font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet"> <link href="css/animate.css" rel="stylesheet"> <link href="css/style.css?v=2.2.0" rel="stylesheet"> </head> <body> <div id="wrapper"> <nav class="navbar-default navbar-static-side" role="navigation"> <div class="sidebar-collapse"> <ul class="nav" id="side-menu"> <li class="nav-header"> <div class="dropdown profile-element"> <span> <img alt="image" class="img-circle" src="img/profile_small.jpg" /> </span> <a data-toggle="dropdown" class="dropdown-toggle" href="index.html#"> <span class="clear"> <span class="block m-t-xs"> <strong class="font-bold">Beaut-zihan</strong> </span> <span class="text-muted text-xs block">超级管理员 <b class="caret"></b></span> </span> </a> <ul class="dropdown-menu animated fadeInRight m-t-xs"> <li><a href="form_avatar.html">修改头像</a> </li> <li><a href="profile.html">个人资料</a> </li> <li><a href="contacts.html">联系我们</a> </li> <li><a href="mailbox.html">信箱</a> </li> <li class="divider"></li> <li><a href="login.html">安全退出</a> </li> </ul> </div> <div class="logo-element"> H+ </div> </li> <li> <a href="index.html"><i class="fa fa-th-large"></i> <span class="nav-label">主页</span> <span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li><a href="index_1.html">主页示例一</a> </li> <li><a href="index_2.html">主页示例二</a> </li> <li><a href="index_3.html">主页示例三</a> </li> <li><a href="index_4.html">主页示例四</a> </li> </ul> </li> <li> <a href="layouts.html"><i class="fa fa-columns"></i> <span class="nav-label">布局</span><span class="label label-danger pull-right">2.0</span></a> </li> <li> <a href="index.html#"><i class="fa fa fa-globe"></i> <span class="nav-label">v2.0新增</span><span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li><a href="toastr_notifications.html">Toastr通知</a> </li> <li><a href="nestable_list.html">嵌套列表</a> </li> <li><a href="timeline_v2.html">时间轴</a> </li> <li><a href="forum_main.html">论坛</a> </li> <li><a href="code_editor.html">代码编辑器</a> </li> <li><a href="modal_window.html">模态窗口</a> </li> <li><a href="validation.html">表单验证</a> </li> <li><a href="tree_view_v2.html">树形视图</a> </li> <li><a href="chat_view.html">聊天窗口</a> </li> </ul> </li> <li> <a href="index.html#"><i class="fa fa-bar-chart-o"></i> <span class="nav-label">图表</span><span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li><a href="graph_echarts.html">百度ECharts</a> </li> <li><a href="graph_flot.html">Flot</a> </li> <li><a href="graph_morris.html">Morris.js</a> </li> <li><a href="graph_rickshaw.html">Rickshaw</a> </li> <li><a href="graph_peity.html">Peity</a> </li> <li><a href="graph_sparkline.html">Sparkline</a> </li> </ul> </li> <li> <a href="mailbox.html"><i class="fa fa-envelope"></i> <span class="nav-label">信箱 </span><span class="label label-warning pull-right">16</span></a> <ul class="nav nav-second-level"> <li><a href="mailbox.html">收件箱</a> </li> <li><a href="mail_detail.html">查看邮件</a> </li> <li><a href="mail_compose.html">写信</a> </li> </ul> </li> <li> <a href="widgets.html"><i class="fa fa-flask"></i> <span class="nav-label">小工具</span></a> </li> <li> <a href="index.html#"><i class="fa fa-edit"></i> <span class="nav-label">表单</span><span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li><a href="form_basic.html">基本表单</a> </li> <li><a href="form_validate.html">表单验证</a> </li> <li><a href="form_advanced.html">高级插件</a> </li> <li><a href="form_wizard.html">步骤条</a> </li> <li><a href="form_webuploader.html">百度WebUploader</a> </li> <li><a href="form_file_upload.html">文件上传</a> </li> <li><a href="form_editors.html">富文本编辑器</a> </li> <li><a href="form_simditor.html">simditor</a> </li> <li><a href="form_avatar.html">头像裁剪上传</a> </li> <li><a href="layerdate.html">日期选择器layerDate</a> </li> </ul> </li> <li class="active"> <a href="index.html#"><i class="fa fa-desktop"></i> <span class="nav-label">页面</span></a> <ul class="nav nav-second-level"> <li><a href="contacts.html">联系人</a> </li> <li><a href="profile.html">个人资料</a> </li> <li><a href="projects.html">项目</a> </li> <li class="active"><a href="project_detail.html">项目详情</a> </li> <li><a href="file_manager.html">文件管理器</a> </li> <li><a href="calendar.html">日历</a> </li> <li><a href="faq.html">帮助中心</a> </li> <li><a href="timeline.html">时间轴</a> </li> <li><a href="pin_board.html">标签墙</a> </li> <li><a href="invoice.html">单据</a> </li> <li><a href="login.html">登录</a> </li> <li><a href="register.html">注册</a> </li> </ul> </li> <li> <a href="index.html#"><i class="fa fa-files-o"></i> <span class="nav-label">其他页面</span><span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li><a href="search_results.html">搜索结果</a> </li> <li><a href="lockscreen.html">登录超时</a> </li> <li><a href="404.html">404页面</a> </li> <li><a href="500.html">500页面</a> </li> <li><a href="empty_page.html">空白页</a> </li> </ul> </li> <li> <a href="index.html#"><i class="fa fa-flask"></i> <span class="nav-label">UI元素</span><span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li><a href="typography.html">排版</a> </li> <li><a href="icons.html">字体图标</a> </li> <li><a href="iconfont.html">阿里巴巴矢量图标库</a> </li> <li><a href="draggable_panels.html">拖动面板</a> </li> <li><a href="buttons.html">按钮</a> </li> <li><a href="tabs_panels.html">选项卡 & 面板</a> </li> <li><a href="notifications.html">通知 & 提示</a> </li> <li><a href="badges_labels.html">徽章,标签,进度条</a> </li> <li><a href="layer.html">Web弹层组件layer</a> </li> <li><a href="tree_view.html">树形视图</a> </li> </ul> </li> <li> <a href="grid_options.html"><i class="fa fa-laptop"></i> <span class="nav-label">栅格</span></a> </li> <li> <a href="index.html#"><i class="fa fa-table"></i> <span class="nav-label">表格</span><span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li><a href="table_basic.html">基本表格</a> </li> <li><a href="table_data_tables.html">数据表格(DataTables)</a> </li> <li><a href="table_jqgrid.html">jqGrid</a> </li> </ul> </li> <li> <a href="index.html#"><i class="fa fa-picture-o"></i> <span class="nav-label">图库</span><span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li><a href="basic_gallery.html">基本图库</a> </li> <li><a href="carousel.html">图片切换</a> </li> </ul> </li> <li> <a href="index.html#"><i class="fa fa-sitemap"></i> <span class="nav-label">菜单 </span><span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li> <a href="index.html#">三级菜单 <span class="fa arrow"></span></a> <ul class="nav nav-third-level"> <li> <a href="index.html#">三级菜单 01</a> </li> <li> <a href="index.html#">三级菜单 01</a> </li> <li> <a href="index.html#">三级菜单 01</a> </li> </ul> </li> <li><a href="index.html#">二级菜单</a> </li> <li> <a href="index.html#">二级菜单</a> </li> <li> <a href="index.html#">二级菜单</a> </li> </ul> </li> <li> <a href="webim.html"><i class="fa fa-comments"></i> <span class="nav-label">即时通讯</span><span class="label label-danger pull-right">New</span></a> </li> <li> <a href="css_animation.html"><i class="fa fa-magic"></i> <span class="nav-label">CSS动画</span></a> </li> <li> <a href="index.html#"><i class="fa fa-cutlery"></i> <span class="nav-label">工具 </span><span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li><a href="form_builder.html">表单构建器</a> </li> </ul> </li> </ul> </div> </nav> <div id="page-wrapper" class="gray-bg dashbard-1"> <div class="row border-bottom"> <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0"> <div class="navbar-header"> <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="project_detail.html#"><i class="fa fa-bars"></i> </a> <form role="search" class="navbar-form-custom" method="post" action="search_results.html"> <div class="form-group"> <input type="text" placeholder="请输入您需要查找的内容 …" class="form-control" name="top-search" id="top-search"> </div> </form> </div> <ul class="nav navbar-top-links navbar-right"> <li> <span class="m-r-sm text-muted welcome-message"><a href="index.html" title="返回首页"><i class="fa fa-home"></i></a>欢迎使用H+后台主题</span> </li> <li class="dropdown"> <a class="dropdown-toggle count-info" data-toggle="dropdown" href="index.html#"> <i class="fa fa-envelope"></i> <span class="label label-warning">16</span> </a> <ul class="dropdown-menu dropdown-messages"> <li> <div class="dropdown-messages-box"> <a href="profile.html" class="pull-left"> <img alt="image" class="img-circle" src="img/a7.jpg"> </a> <div class="media-body"> <small class="pull-right">46小时前</small> <strong>小四</strong> 项目已处理完结 <br> <small class="text-muted">3天前 2014.11.8</small> </div> </div> </li> <li class="divider"></li> <li> <div class="dropdown-messages-box"> <a href="profile.html" class="pull-left"> <img alt="image" class="img-circle" src="img/a4.jpg"> </a> <div class="media-body "> <small class="pull-right text-navy">25小时前</small> <strong>国民岳父</strong> 这是一条测试信息 <br> <small class="text-muted">昨天</small> </div> </div> </li> <li class="divider"></li> <li> <div class="text-center link-block"> <a href="mailbox.html"> <i class="fa fa-envelope"></i> <strong> 查看所有消息</strong> </a> </div> </li> </ul> </li> <li class="dropdown"> <a class="dropdown-toggle count-info" data-toggle="dropdown" href="index.html#"> <i class="fa fa-bell"></i> <span class="label label-primary">8</span> </a> <ul class="dropdown-menu dropdown-alerts"> <li> <a href="mailbox.html"> <div> <i class="fa fa-envelope fa-fw"></i> 您有16条未读消息 <span class="pull-right text-muted small">4分钟前</span> </div> </a> </li> <li class="divider"></li> <li> <a href="profile.html"> <div> <i class="fa fa-qq fa-fw"></i> 3条新回复 <span class="pull-right text-muted small">12分钟钱</span> </div> </a> </li> <li class="divider"></li> <li> <div class="text-center link-block"> <a href="notifications.html"> <strong>查看所有 </strong> <i class="fa fa-angle-right"></i> </a> </div> </li> </ul> </li> <li> <a href="login.html"> <i class="fa fa-sign-out"></i> 退出 </a> </li> </ul> </nav> </div> <div class="row wrapper border-bottom white-bg page-heading"> <div class="col-sm-4"> <h2>项目详情</h2> <ol class="breadcrumb"> <li> <a href="index.html">主页</a> </li> <li> <strong>项目详情</strong> </li> </ol> </div> </div> <div class="row"> <div class="col-lg-9"> <div class="wrapper wrapper-content animated fadeInUp"> <div class="ibox"> <div class="ibox-content"> <div class="row"> <div class="col-lg-12"> <div class="m-b-md"> <a href="project_detail.html#" class="btn btn-white btn-xs pull-right">编辑项目</a> <h2>阿里巴巴集团</h2> </div> <dl class="dl-horizontal"> <dt>状态:</dt> <dd><span class="label label-primary">进行中</span> </dd> </dl> </div> </div> <div class="row"> <div class="col-lg-5"> <dl class="dl-horizontal"> <dt>项目经理:</dt> <dd>Beaut-zihan</dd> <dt>消息:</dt> <dd>162</dd> <dt>客户:</dt> <dd><a href="project_detail.html#" class="text-navy"> 百度</a> </dd> <dt>版本:</dt> <dd>v1.4.2</dd> </dl> </div> <div class="col-lg-7" id="cluster_info"> <dl class="dl-horizontal"> <dt>最后更新:</dt> <dd>2014年 11月7日 22:03</dd> <dt>创建于:</dt> <dd>2014年 2月16日 03:01</dd> <dt>团队成员:</dt> <dd class="project-people"> <a href="project_detail.html"> <img alt="image" class="img-circle" src="img/a3.jpg"> </a> <a href="project_detail.html"> <img alt="image" class="img-circle" src="img/a1.jpg"> </a> <a href="project_detail.html"> <img alt="image" class="img-circle" src="img/a2.jpg"> </a> <a href="project_detail.html"> <img alt="image" class="img-circle" src="img/a4.jpg"> </a> <a href="project_detail.html"> <img alt="image" class="img-circle" src="img/a5.jpg"> </a> </dd> </dl> </div> </div> <div class="row"> <div class="col-lg-12"> <dl class="dl-horizontal"> <dt>当前进度</dt> <dd> <div class="progress progress-striped active m-b-sm"> <div style="width: 60%;" class="progress-bar"></div> </div> <small>当前已完成项目总进度的 <strong>60%</strong></small> </dd> </dl> </div> </div> <div class="row m-t-sm"> <div class="col-lg-12"> <div class="panel blank-panel"> <div class="panel-heading"> <div class="panel-options"> <ul class="nav nav-tabs"> <li><a href="project_detail.html#tab-1" data-toggle="tab">团队消息</a> </li> <li class=""><a href="project_detail.html#tab-2" data-toggle="tab">最后更新</a> </li> </ul> </div> </div> <div class="panel-body"> <div class="tab-content"> <div class="tab-pane active" id="tab-1"> <div class="feed-activity-list"> <div class="feed-element"> <a href="profile.html#" class="pull-left"> <img alt="image" class="img-circle" src="img/a1.jpg"> </a> <div class="media-body "> <small class="pull-right text-navy">1天前</small> <strong>奔波儿灞</strong> 关注了 <strong>灞波儿奔</strong>. <br> <small class="text-muted">54分钟前 来自 皮皮时光机</small> <div class="actions"> <a class="btn btn-xs btn-white"><i class="fa fa-thumbs-up"></i> 赞 </a> <a class="btn btn-xs btn-danger"><i class="fa fa-heart"></i> 收藏</a> </div> </div> </div> <div class="feed-element"> <a href="profile.html#" class="pull-left"> <img alt="image" class="img-circle" src="img/profile.jpg"> </a> <div class="media-body "> <small class="pull-right">5分钟前</small> <strong>作家崔成浩</strong> 发布了一篇文章 <br> <small class="text-muted">今天 10:20 来自 iPhone 6 Plus</small> </div> </div> <div class="feed-element"> <a href="profile.html#" class="pull-left"> <img alt="image" class="img-circle" src="img/a2.jpg"> </a> <div class="media-body "> <small class="pull-right">2小时前</small> <strong>作家崔成浩</strong> 抽奖中了20万 <br> <small class="text-muted">今天 09:27 来自 Koryolink iPhone</small> <div class="well"> 抽奖,人民币2000元,从转发这个微博的粉丝中抽取一人。11月16日平台开奖。随手一转,万一中了呢? </div> <div class="pull-right"> <a class="btn btn-xs btn-white"><i class="fa fa-thumbs-up"></i> 赞 </a> <a class="btn btn-xs btn-white"><i class="fa fa-heart"></i> 收藏</a> <a class="btn btn-xs btn-primary"><i class="fa fa-pencil"></i> 评论</a> </div> </div> </div> <div class="feed-element"> <a href="profile.html#" class="pull-left"> <img alt="image" class="img-circle" src="img/a3.jpg"> </a> <div class="media-body "> <small class="pull-right">2天前</small> <strong>天猫</strong> 上传了2张图片 <br> <small class="text-muted">11月7日 11:56 来自 微博 weibo.com</small> <div class="photos"> <a target="_blank" href="http://24.media.tumblr.com/20a9c501846f50c1271210639987000f/tumblr_n4vje69pJm1st5lhmo1_1280.jpg"> <img alt="image" class="feed-photo" src="img/p1.jpg"> </a> <a target="_blank" href="http://37.media.tumblr.com/9afe602b3e624aff6681b0b51f5a062b/tumblr_n4ef69szs71st5lhmo1_1280.jpg"> <img alt="image" class="feed-photo" src="img/p3.jpg"> </a> </div> </div> </div> <div class="feed-element"> <a href="profile.html#" class="pull-left"> <img alt="image" class="img-circle" src="img/a4.jpg"> </a> <div class="media-body "> <small class="pull-right text-navy">5小时前</small> <strong>在水一方Y</strong> 关注了 <strong>那二十年的单身</strong>. <br> <small class="text-muted">今天 10:39 来自 iPhone客户端</small> <div class="actions"> <a class="btn btn-xs btn-white"><i class="fa fa-thumbs-up"></i> 赞 </a> <a class="btn btn-xs btn-white"><i class="fa fa-heart"></i> 收藏</a> </div> </div> </div> </div> </div> <div class="tab-pane" id="tab-2"> <table class="table table-striped"> <thead> <tr> <th>状态</th> <th>标题</th> <th>开始时间</th> <th>结束时间</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td> <span class="label label-primary"><i class="fa fa-check"></i> 已完成</span> </td> <td> 文档在线预览功能 </td> <td> 11月7日 22:03 </td> <td> 11月7日 20:11 </td> <td> <p class="small"> 已经测试通过 </p> </td> </tr> <tr> <td> <span class="label label-primary"><i class="fa fa-check"></i> 解决中</span> </td> <td> 会员登录 </td> <td> 11月7日 22:03 </td> <td> 11月7日 20:11 </td> <td> <p class="small"> 测试中 </p> </td> </tr> <tr> <td> <span class="label label-primary"><i class="fa fa-check"></i> 解决中</span> </td> <td> 会员积分 </td> <td> 11月7日 22:03 </td> <td> 11月7日 20:11 </td> <td> <p class="small"> 未测试 </p> </td> </tr> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div class="col-lg-3"> <div class="wrapper wrapper-content project-manager"> <h4>项目描述</h4> <img src="img/wenku_logo.png" class="img-responsive"> <p class="small"> <br>在线互动式文档分享平台,在这里,您可以和千万网友分享自己手中的文档,全文阅读其他用户的文档,同时,也可以利用分享文档获取的积分下载文档 </p> <p class="small font-bold"> <span><i class="fa fa-circle text-warning"></i> 高优先级</span> </p> <h5>项目标签</h5> <ul class="tag-list" style="padding: 0"> <li><a href="project_detail.html"><i class="fa fa-tag"></i> 文档</a> </li> <li><a href="project_detail.html"><i class="fa fa-tag"></i> 分享</a> </li> <li><a href="project_detail.html"><i class="fa fa-tag"></i> 下载</a> </li> </ul> <h5>项目文档</h5> <ul class="list-unstyled project-files"> <li><a href="project_detail.html"><i class="fa fa-file"></i> Project_document.docx</a> </li> <li><a href="project_detail.html"><i class="fa fa-file-picture-o"></i> Logo_zender_company.jpg</a> </li> <li><a href="project_detail.html"><i class="fa fa-stack-exchange"></i> Email_from_Alex.mln</a> </li> <li><a href="project_detail.html"><i class="fa fa-file"></i> Contract_20_11_2014.docx</a> </li> </ul> <div class="m-t-md"> <a href="project_detail.html#" class="btn btn-xs btn-primary">添加文档</a> </div> </div> </div> </div> <div class="footer"> <div class="pull-right"> By:<a href="http://www.zi-han.net" target="_blank">zihan's blog</a> </div> <div> <strong>Copyright</strong> H+ &copy; 2014 </div> </div> </div> </div> </div> <!-- Mainly scripts --> <script src="js/jquery-2.1.1.min.js"></script> <script src="js/bootstrap.min.js?v=3.4.0"></script> <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> <script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script> <!-- Custom and plugin javascript --> <script src="js/hplus.js?v=2.2.0"></script> <script src="js/plugins/pace/pace.min.js"></script> <script> $(document).ready(function () { $('#loading-example-btn').click(function () { btn = $(this); simpleLoad(btn, true) // Ajax example // $.ajax().always(function () { // simpleLoad($(this), false) // }); simpleLoad(btn, false) }); }); function simpleLoad(btn, state) { if (state) { btn.children().addClass('fa-spin'); btn.contents().last().replaceWith(" Loading"); } else { setTimeout(function () { btn.children().removeClass('fa-spin'); btn.contents().last().replaceWith(" Refresh"); }, 2000); } } </script> </body> </html>
{ "pile_set_name": "Github" }
package org.aion.zero.impl.sync; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.UUID; import org.aion.zero.impl.sync.statistics.BlockType; import org.aion.zero.impl.sync.statistics.RequestType; import org.apache.commons.lang3.tuple.Pair; import org.junit.BeforeClass; import org.junit.Test; public class SyncStatsTest { private static final List<String> peers = new ArrayList<>(); @BeforeClass public static void setup() { // mock some peer Ids peers.add(UUID.randomUUID().toString().substring(0, 6)); peers.add(UUID.randomUUID().toString().substring(0, 6)); peers.add(UUID.randomUUID().toString().substring(0, 6)); } @Test public void testAvgBlocksPerSecStat() { SyncStats stats = new SyncStats(0L, true); // ensures correct behaviour on empty stats assertThat(stats.getAvgBlocksPerSec()).isEqualTo(0d); for (int blocks = 1; blocks <= 3; blocks++) { stats.update(blocks); try { Thread.sleep(1000); } catch (InterruptedException e) { } } assertThat(stats.getAvgBlocksPerSec()).isGreaterThan(0d); assertThat(stats.getAvgBlocksPerSec()).isAtMost(2d); } @Test public void testAvgBlocksPerSecStatDisabled() { // disables the stats SyncStats stats = new SyncStats(0L, false); for (int blocks = 1; blocks <= 3; blocks++) { stats.update(blocks); } // ensures nothing changed assertThat(stats.getAvgBlocksPerSec()).isEqualTo(0d); } @Test public void testTotalRequestsToPeersStat() { List<String> peers = new ArrayList<>(this.peers); while (peers.size() < 7) { peers.add(UUID.randomUUID().toString().substring(0, 6)); } // this tests requires at least 6 peers in the list assertThat(peers.size()).isAtLeast(6); SyncStats stats = new SyncStats(0L, true); // ensures correct behaviour on empty stats Map<String, Float> emptyReqToPeers = stats.getPercentageOfRequestsToPeers(); assertThat(emptyReqToPeers.isEmpty()).isTrue(); float processedRequests = 0; for (String peer : peers) { // status requests stats.updateTotalRequestsToPeer(peer, RequestType.STATUS); processedRequests++; // header requests if (peers.subList(0, 5).contains(peer)) { stats.updateTotalRequestsToPeer(peer, RequestType.HEADERS); processedRequests++; } // bodies requests if (peers.subList(0, 4).contains(peer)) { stats.updateTotalRequestsToPeer(peer, RequestType.BODIES); processedRequests++; } // blocks requests if (peers.subList(0, 3).contains(peer)) { stats.updateTotalRequestsToPeer(peer, RequestType.BLOCKS); processedRequests++; } // receipts requests if (peers.subList(0, 2).contains(peer)) { stats.updateTotalRequestsToPeer(peer, RequestType.RECEIPTS); processedRequests++; } // trie_data requests if (peer == peers.get(0)) { stats.updateTotalRequestsToPeer(peer, RequestType.TRIE_DATA); processedRequests++; } } Map<String, Float> reqToPeers = stats.getPercentageOfRequestsToPeers(); // makes sure no additional peers were created assertThat(reqToPeers.size()).isEqualTo(peers.size()); String firstPeer = peers.get(0); String secondPeer = peers.get(1); String thirdPeer = peers.get(2); String fourthPeer = peers.get(3); String fifthPeer = peers.get(4); String sixthPeer = peers.get(5); // by design (the updates above are not symmetrical) reqToPeers.get(peers.get(0)); assertThat(reqToPeers.get(firstPeer)).isGreaterThan(reqToPeers.get(secondPeer)); assertThat(reqToPeers.get(firstPeer)).isEqualTo(6 / processedRequests); assertThat(reqToPeers.get(secondPeer)).isGreaterThan(reqToPeers.get(thirdPeer)); assertThat(reqToPeers.get(secondPeer)).isEqualTo(5 / processedRequests); assertThat(reqToPeers.get(thirdPeer)).isGreaterThan(reqToPeers.get(fourthPeer)); assertThat(reqToPeers.get(thirdPeer)).isEqualTo(4 / processedRequests); assertThat(reqToPeers.get(fourthPeer)).isGreaterThan(reqToPeers.get(fifthPeer)); assertThat(reqToPeers.get(fourthPeer)).isEqualTo(3 / processedRequests); assertThat(reqToPeers.get(fifthPeer)).isGreaterThan(reqToPeers.get(sixthPeer)); assertThat(reqToPeers.get(fifthPeer)).isEqualTo(2 / processedRequests); assertThat(reqToPeers.get(sixthPeer)).isEqualTo(1 / processedRequests); for (String otherPeers : peers.subList(6, peers.size())) { assertThat(reqToPeers.get(otherPeers)).isEqualTo(reqToPeers.get(sixthPeer)); } int blocks = 6; float lastPercentage = (float) 1; float diffThreshold = (float) 0.01; for (String nodeId : reqToPeers.keySet()) { float percentageReq = reqToPeers.get(nodeId); // ensures desc order assertThat(lastPercentage).isAtLeast(percentageReq); lastPercentage = percentageReq; assertThat(percentageReq - (1. * blocks / processedRequests) < diffThreshold).isTrue(); } } @Test public void testTotalRequestsToPeersStatDisabled() { List<String> peers = new ArrayList<>(this.peers); while (peers.size() < 7) { peers.add(UUID.randomUUID().toString().substring(0, 6)); } // this tests requires at least 3 peers in the list assertThat(peers.size()).isAtLeast(6); // disables the stats SyncStats stats = new SyncStats(0L, false); for (String peer : peers) { // status requests stats.updateTotalRequestsToPeer(peer, RequestType.STATUS); // header requests if (peers.subList(0, 5).contains(peer)) { stats.updateTotalRequestsToPeer(peer, RequestType.HEADERS); } // bodies requests if (peers.subList(0, 4).contains(peer)) { stats.updateTotalRequestsToPeer(peer, RequestType.BODIES); } // blocks requests if (peers.subList(0, 3).contains(peer)) { stats.updateTotalRequestsToPeer(peer, RequestType.BLOCKS); } // receipts requests if (peers.subList(0, 2).contains(peer)) { stats.updateTotalRequestsToPeer(peer, RequestType.RECEIPTS); } // trie_data requests if (peer == peers.get(0)) { stats.updateTotalRequestsToPeer(peer, RequestType.TRIE_DATA); } } // ensures still empty assertThat(stats.getPercentageOfRequestsToPeers()).isNull(); } @Test public void testReceivedBlocksByPeer() { SyncStats stats = new SyncStats(0L, true); // ensures correct behaviour on empty stats Map<String, Integer> emptyReceivedBlockReqByPeer = stats.getReceivedBlocksByPeer(); assertThat(emptyReceivedBlockReqByPeer.isEmpty()).isTrue(); int peerNo = 0; int processedBlocks = 0; for (int totalBlocks = peers.size(); totalBlocks > 0; totalBlocks--) { int blocks = totalBlocks; processedBlocks += totalBlocks; while (blocks > 0) { stats.updatePeerBlocks(peers.get(peerNo), 1, BlockType.RECEIVED); blocks--; } peerNo++; } Map<String, Integer> totalBlockResByPeer = stats.getReceivedBlocksByPeer(); assertThat(totalBlockResByPeer.size()).isEqualTo(peers.size()); int total = 3; int lastTotalBlocks = processedBlocks; for (String nodeId : peers) { // ensures desc order assertThat(lastTotalBlocks >= totalBlockResByPeer.get(nodeId)).isTrue(); lastTotalBlocks = totalBlockResByPeer.get(nodeId); assertThat(totalBlockResByPeer.get(nodeId)).isEqualTo(total); assertThat(stats.getBlocksByPeer(nodeId, BlockType.RECEIVED)).isEqualTo(total); total--; } } @Test public void testReceivedBlocksByPeerDisabled() { // disables the stats SyncStats stats = new SyncStats(0L, false); int peerNo = 0; for (int totalBlocks = peers.size(); totalBlocks > 0; totalBlocks--) { int blocks = totalBlocks; while (blocks > 0) { stats.updatePeerBlocks(peers.get(peerNo), 1, BlockType.RECEIVED); blocks--; } peerNo++; } // ensures still empty assertThat(stats.getReceivedBlocksByPeer()).isNull(); } @Test public void testImportedBlocksByPeerStats() { SyncStats stats = new SyncStats(0L, true); // ensures correct behaviour on empty stats assertEquals(stats.getBlocksByPeer(peers.get(0), BlockType.IMPORTED), 0); int peerNo = 0; for (int totalBlocks = peers.size(); totalBlocks > 0; totalBlocks--) { int blocks = totalBlocks; while (blocks > 0) { stats.updatePeerBlocks(peers.get(peerNo), 1, BlockType.IMPORTED); blocks--; } peerNo++; } int imported = 3; for (String nodeId : peers) { assertEquals((long) imported, stats.getBlocksByPeer(nodeId, BlockType.IMPORTED)); imported--; } } @Test public void testImportedBlocksByPeerDisabled() { // disables the stats SyncStats stats = new SyncStats(0L, false); int peerNo = 0; for (int totalBlocks = peers.size(); totalBlocks > 0; totalBlocks--) { int blocks = totalBlocks; while (blocks > 0) { stats.updatePeerBlocks(peers.get(peerNo), 1, BlockType.IMPORTED); blocks--; } peerNo++; } // ensures still empty for (String nodeId : peers) { assertEquals(0, stats.getBlocksByPeer(nodeId, BlockType.IMPORTED)); } } @Test public void testStoredBlocksByPeerStats() { SyncStats stats = new SyncStats(0L, true); // ensures correct behaviour on empty stats assertEquals(stats.getBlocksByPeer(peers.get(0), BlockType.STORED), 0); int peerNo = 0; for (int totalBlocks = peers.size(); totalBlocks > 0; totalBlocks--) { int blocks = totalBlocks; while (blocks > 0) { stats.updatePeerBlocks(peers.get(peerNo), 1, BlockType.STORED); blocks--; } peerNo++; } int stored = 3; for (String nodeId : peers) { assertEquals((long) stored, stats.getBlocksByPeer(nodeId, BlockType.STORED)); stored--; } } @Test public void testStoredBlocksByPeerDisabled() { // disables the stats SyncStats stats = new SyncStats(0L, false); int peerNo = 0; for (int totalBlocks = peers.size(); totalBlocks > 0; totalBlocks--) { int blocks = totalBlocks; while (blocks > 0) { stats.updatePeerBlocks(peers.get(peerNo), 1, BlockType.STORED); blocks--; } peerNo++; } // ensures still empty for (String nodeId : peers) { assertEquals(0, stats.getBlocksByPeer(nodeId, BlockType.STORED)); } } @Test public void testTotalBlockRequestsByPeerStats() { SyncStats stats = new SyncStats(0L, true); // ensures correct behaviour on empty stats Map<String, Integer> emptyTotalBlocksByPeer = stats.getTotalBlockRequestsByPeer(); assertThat(emptyTotalBlocksByPeer.isEmpty()).isTrue(); int blocks = 3; for (String nodeId : peers) { int count = 0; while (count < blocks) { stats.updateTotalBlockRequestsByPeer(nodeId, 1); count++; } blocks--; } Map<String, Integer> totalBlocksByPeer = stats.getTotalBlockRequestsByPeer(); assertThat(totalBlocksByPeer.size()).isEqualTo(peers.size()); int lastTotalBlocks = peers.size(); for (String nodeId : totalBlocksByPeer.keySet()) { // ensures desc order assertThat(lastTotalBlocks >= totalBlocksByPeer.get(nodeId)).isTrue(); lastTotalBlocks = totalBlocksByPeer.get(nodeId); } } @Test public void testTotalBlockRequestsByPeerStatsDisabled() { // disables the stats SyncStats stats = new SyncStats(0L, false); int blocks = 3; for (String nodeId : peers) { int count = 0; while (count < blocks) { stats.updateTotalBlockRequestsByPeer(nodeId, 1); count++; } blocks--; } // ensures still empty assertThat(stats.getTotalBlockRequestsByPeer().isEmpty()).isTrue(); } @Test public void testResponseStatsByPeersEmpty() { SyncStats stats = new SyncStats(0L, true); // ensures correct behaviour on empty stats assertThat(stats.getResponseStats()).isNull(); assertThat(stats.dumpResponseStats()).isEmpty(); // request time is logged but no response is received stats.updateRequestTime("dummy", System.nanoTime(), RequestType.STATUS); stats.updateRequestTime("dummy", System.nanoTime(), RequestType.HEADERS); stats.updateRequestTime("dummy", System.nanoTime(), RequestType.BODIES); stats.updateRequestTime("dummy", System.nanoTime(), RequestType.BLOCKS); stats.updateRequestTime("dummy", System.nanoTime(), RequestType.RECEIPTS); stats.updateRequestTime("dummy", System.nanoTime(), RequestType.TRIE_DATA); assertThat(stats.getResponseStats()).isNull(); assertThat(stats.dumpResponseStats()).isEmpty(); stats = new SyncStats(0L, true); // response time is logged but no request exists stats.updateResponseTime("dummy", System.nanoTime(), RequestType.STATUS); stats.updateResponseTime("dummy", System.nanoTime(), RequestType.HEADERS); stats.updateResponseTime("dummy", System.nanoTime(), RequestType.BODIES); stats.updateResponseTime("dummy", System.nanoTime(), RequestType.BLOCKS); stats.updateResponseTime("dummy", System.nanoTime(), RequestType.RECEIPTS); stats.updateResponseTime("dummy", System.nanoTime(), RequestType.TRIE_DATA); assertThat(stats.getResponseStats()).isNull(); assertThat(stats.dumpResponseStats()).isEmpty(); } @Test public void testResponseStatsByPeers() { SyncStats stats = new SyncStats(0L, true); long time; int entries = 3; // should be updated if more message types are added int requestTypes = 6; for (String nodeId : peers) { int count = 1; while (count <= entries) { time = System.nanoTime(); // status -> type of request 1 stats.updateRequestTime(nodeId, time, RequestType.STATUS); stats.updateResponseTime(nodeId, time + 1_000_000, RequestType.STATUS); // headers -> type of request 2 stats.updateRequestTime(nodeId, time, RequestType.HEADERS); stats.updateResponseTime(nodeId, time + 1_000_000, RequestType.HEADERS); // bodies -> type of request 3 stats.updateRequestTime(nodeId, time, RequestType.BODIES); stats.updateResponseTime(nodeId, time + 1_000_000, RequestType.BODIES); // bodies -> type of request 4 stats.updateRequestTime(nodeId, time, RequestType.BLOCKS); stats.updateResponseTime(nodeId, time + 1_000_000, RequestType.BLOCKS); // bodies -> type of request 5 stats.updateRequestTime(nodeId, time, RequestType.RECEIPTS); stats.updateResponseTime(nodeId, time + 1_000_000, RequestType.RECEIPTS); // bodies -> type of request 6 stats.updateRequestTime(nodeId, time, RequestType.TRIE_DATA); stats.updateResponseTime(nodeId, time + 1_000_000, RequestType.TRIE_DATA); count++; } } Map<String, Map<String, Pair<Double, Integer>>> responseStats = stats.getResponseStats(); for (Map.Entry<String, Map<String, Pair<Double, Integer>>> e : responseStats.entrySet()) { // 7 entries for each: «all» «status» «headers» «bodies» «blocks» «receipts» «trie_data» assertThat(e.getValue().size()).isEqualTo(7); if (e.getKey().equals("overall")) { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()) .isEqualTo(peers.size() * entries * requestTypes); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(peers.size() * entries); } } } else { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(entries * requestTypes); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(entries); } } } } // System.out.println(stats.dumpResponseStats()); } @Test public void testResponseStatsByPeersStatusOnly() { SyncStats stats = new SyncStats(0L, true); long time; int entries = 3; for (String nodeId : peers) { int count = 1; while (count <= entries) { time = System.nanoTime(); // status stats.updateRequestTime(nodeId, time, RequestType.STATUS); stats.updateResponseTime(nodeId, time + 1_000_000, RequestType.STATUS); count++; } } Map<String, Map<String, Pair<Double, Integer>>> responseStats = stats.getResponseStats(); for (Map.Entry<String, Map<String, Pair<Double, Integer>>> e : responseStats.entrySet()) { // 7 entries for each: «all» «status» «headers» «bodies» «blocks» «receipts» «trie_data» assertThat(e.getValue().size()).isEqualTo(7); if (e.getKey().equals("overall")) { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all") || sub.getKey().equals("status")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(peers.size() * entries); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(0d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(0); } } } else { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all") || sub.getKey().equals("status")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(entries); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(0d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(0); } } } } // System.out.println(stats.dumpResponseStats()); } @Test public void testResponseStatsByPeersHeadersOnly() { SyncStats stats = new SyncStats(0L, true); long time; int entries = 3; for (String nodeId : peers) { int count = 1; while (count <= entries) { time = System.nanoTime(); // headers stats.updateRequestTime(nodeId, time, RequestType.HEADERS); stats.updateResponseTime(nodeId, time + 1_000_000, RequestType.HEADERS); count++; } } Map<String, Map<String, Pair<Double, Integer>>> responseStats = stats.getResponseStats(); for (Map.Entry<String, Map<String, Pair<Double, Integer>>> e : responseStats.entrySet()) { // 7 entries for each: «all» «status» «headers» «bodies» «blocks» «receipts» «trie_data» assertThat(e.getValue().size()).isEqualTo(7); if (e.getKey().equals("overall")) { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all") || sub.getKey().equals("headers")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(peers.size() * entries); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(0d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(0); } } } else { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all") || sub.getKey().equals("headers")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(entries); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(0d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(0); } } } } // System.out.println(stats.dumpResponseStats()); } @Test public void testResponseStatsByPeersBodiesOnly() { SyncStats stats = new SyncStats(0L, true); long time; int entries = 3; for (String nodeId : peers) { int count = 1; while (count <= entries) { time = System.nanoTime(); // bodies stats.updateRequestTime(nodeId, time, RequestType.BODIES); stats.updateResponseTime(nodeId, time + 1_000_000, RequestType.BODIES); count++; } } Map<String, Map<String, Pair<Double, Integer>>> responseStats = stats.getResponseStats(); for (Map.Entry<String, Map<String, Pair<Double, Integer>>> e : responseStats.entrySet()) { // 7 entries for each: «all» «status» «headers» «bodies» «blocks» «receipts» «trie_data» assertThat(e.getValue().size()).isEqualTo(7); if (e.getKey().equals("overall")) { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all") || sub.getKey().equals("bodies")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(peers.size() * entries); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(0d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(0); } } } else { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all") || sub.getKey().equals("bodies")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(entries); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(0d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(0); } } } } // System.out.println(stats.dumpResponseStats()); } @Test public void testResponseStatsByPeersBlocksOnly() { SyncStats stats = new SyncStats(0L, true); long time; int entries = 3; for (String nodeId : peers) { int count = 1; while (count <= entries) { time = System.nanoTime(); // blocks stats.updateRequestTime(nodeId, time, RequestType.BLOCKS); stats.updateResponseTime(nodeId, time + 1_000_000, RequestType.BLOCKS); count++; } } Map<String, Map<String, Pair<Double, Integer>>> responseStats = stats.getResponseStats(); for (Map.Entry<String, Map<String, Pair<Double, Integer>>> e : responseStats.entrySet()) { // 7 entries for each: «all» «status» «headers» «bodies» «blocks» «receipts» «trie_data» assertThat(e.getValue().size()).isEqualTo(7); if (e.getKey().equals("overall")) { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all") || sub.getKey().equals("blocks")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(peers.size() * entries); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(0d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(0); } } } else { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all") || sub.getKey().equals("blocks")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(entries); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(0d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(0); } } } } // System.out.println(stats.dumpResponseStats()); } @Test public void testResponseStatsByPeersReceiptsOnly() { SyncStats stats = new SyncStats(0L, true); long time; int entries = 3; for (String nodeId : peers) { int count = 1; while (count <= entries) { time = System.nanoTime(); // blocks stats.updateRequestTime(nodeId, time, RequestType.RECEIPTS); stats.updateResponseTime(nodeId, time + 1_000_000, RequestType.RECEIPTS); count++; } } Map<String, Map<String, Pair<Double, Integer>>> responseStats = stats.getResponseStats(); for (Map.Entry<String, Map<String, Pair<Double, Integer>>> e : responseStats.entrySet()) { // 7 entries for each: «all» «status» «headers» «bodies» «blocks» «receipts» «trie_data» assertThat(e.getValue().size()).isEqualTo(7); if (e.getKey().equals("overall")) { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all") || sub.getKey().equals("receipts")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(peers.size() * entries); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(0d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(0); } } } else { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all") || sub.getKey().equals("receipts")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(entries); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(0d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(0); } } } } // System.out.println(stats.dumpResponseStats()); } @Test public void testResponseStatsByPeersTrieDataOnly() { SyncStats stats = new SyncStats(0L, true); long time; int entries = 3; for (String nodeId : peers) { int count = 1; while (count <= entries) { time = System.nanoTime(); // blocks stats.updateRequestTime(nodeId, time, RequestType.TRIE_DATA); stats.updateResponseTime(nodeId, time + 1_000_000, RequestType.TRIE_DATA); count++; } } Map<String, Map<String, Pair<Double, Integer>>> responseStats = stats.getResponseStats(); for (Map.Entry<String, Map<String, Pair<Double, Integer>>> e : responseStats.entrySet()) { // 7 entries for each: «all» «status» «headers» «bodies» «blocks» «receipts» «trie_data» assertThat(e.getValue().size()).isEqualTo(7); if (e.getKey().equals("overall")) { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all") || sub.getKey().equals("trie_data")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(peers.size() * entries); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(0d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(0); } } } else { for (Map.Entry<String, Pair<Double, Integer>> sub : e.getValue().entrySet()) { if (sub.getKey().equals("all") || sub.getKey().equals("trie_data")) { // check average assertThat(sub.getValue().getLeft()).isEqualTo(1_000_000d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(entries); } else { // check average assertThat(sub.getValue().getLeft()).isEqualTo(0d); // check entries assertThat(sub.getValue().getRight()).isEqualTo(0); } } } } // System.out.println(stats.dumpResponseStats()); } @Test public void testAverageResponseTimeByPeersStatsDisabled() { // disables the stats SyncStats stats = new SyncStats(0L, false); int requests = 3; for (String nodeId : peers) { int count = requests; while (count > 0) { // status updates stats.updateRequestTime(nodeId, System.nanoTime(), RequestType.STATUS); stats.updateResponseTime(nodeId, System.nanoTime(), RequestType.STATUS); // headers updates stats.updateRequestTime(nodeId, System.nanoTime(), RequestType.HEADERS); stats.updateResponseTime(nodeId, System.nanoTime(), RequestType.HEADERS); // bodies updates stats.updateRequestTime(nodeId, System.nanoTime(), RequestType.BODIES); stats.updateResponseTime(nodeId, System.nanoTime(), RequestType.BODIES); count--; } requests--; } // ensures still empty assertThat(stats.getResponseStats()).isNull(); } }
{ "pile_set_name": "Github" }
|Hash|Type|Family|First_Seen|Name| |:--|:--|:--|:--|:--| |[f65e5bb6e35a3e28c2c878824293d939](https://www.virustotal.com/gui/file/f65e5bb6e35a3e28c2c878824293d939)|Win32 EXE|Delf|2019-07-14 21:04:25|music-14072019-2-473575936542-34728623-mp3.exe| |[ddf69fdd195deaca359d223f3ba90153](https://www.virustotal.com/gui/file/ddf69fdd195deaca359d223f3ba90153)|RAR|Delf|2019-07-14 16:15:11|music love.xz| |[57a2f9250b07844f444e9bce8b3a75e3](https://www.virustotal.com/gui/file/57a2f9250b07844f444e9bce8b3a75e3)|ZIP|Delf|2019-07-14 09:36:24|music%20love.zip| |[8b48cec7cb30ff0f02b06c51aa15f24f](https://www.virustotal.com/gui/file/8b48cec7cb30ff0f02b06c51aa15f24f)|Android||2019-03-19 12:35:43|Upgrade.apk| |[f5a5a440afa5132ad9ce723ed73cb1c5](https://www.virustotal.com/gui/file/f5a5a440afa5132ad9ce723ed73cb1c5)|Win32 EXE|Delf|2019-02-11 11:40:21|/media/freddie/Seagate Expansion Drive/aptmalware/SampleLibraryAUG2019/APTC23/AnnualReportFeb.bin| |[e121531a15f2eaa34dce89f3fec70cfd](https://www.virustotal.com/gui/file/e121531a15f2eaa34dce89f3fec70cfd)|Win32 EXE|Delf|2018-11-07 13:23:48|/media/freddie/Seagate Expansion Drive/aptmalware/SampleLibraryAUG2019/APTC23/HexDownload.exe.bin| |[6eff53e85a9ce9f1d99c812270093581](https://www.virustotal.com/gui/file/6eff53e85a9ce9f1d99c812270093581)|Win32 EXE|Delf|2018-10-22 22:57:50|/media/freddie/Seagate Expansion Drive/aptmalware/SampleLibraryAUG2019/APTC23/MicropsiaRAT2018.bin| |[9b40a4dabff639125a19599cca941ea1](https://www.virustotal.com/gui/file/9b40a4dabff639125a19599cca941ea1)|Android|androidos|2018-08-13 06:47:35|5dd46064501235c0d02ae9155d6d5f0b526703a8244da5d8299f590b427a3c2e.apk| |[c95fe8de4dd4c770a61e5361898322e8](https://www.virustotal.com/gui/file/c95fe8de4dd4c770a61e5361898322e8)|Android||2018-08-10 21:13:41|3azqs8Bbuw-RR-WfLGnZ20180812-11568-pg8wfj| |[183ec3f5e014f2eaebbdca1e94b5b946](https://www.virustotal.com/gui/file/183ec3f5e014f2eaebbdca1e94b5b946)|Android||2018-08-10 20:28:48|zFUWAe87M9sot9qUiV4x20180812-11549-1tn69f1| |[2a2175eb4ecf720ba7cb62af1cb6cc9a](https://www.virustotal.com/gui/file/2a2175eb4ecf720ba7cb62af1cb6cc9a)|Android||2018-08-10 20:13:11|-ghyZVZvx7EVVR-kx1QJ20180812-27158-1v71lmc| |[0bb965ca6a122ce124cd6905494e1aea](https://www.virustotal.com/gui/file/0bb965ca6a122ce124cd6905494e1aea)|Android||2018-08-10 19:59:12|RBurqSB4WWcV9PjPgKr520180812-7424-1aeflxr| |[f1933220de03dbce36daabda0f75efa8](https://www.virustotal.com/gui/file/f1933220de03dbce36daabda0f75efa8)|Android||2018-08-10 13:21:27|f1933220de03dbce36daabda0f75efa8.apk| |[f9f6155ca91b3d444095051cb344f9b1](https://www.virustotal.com/gui/file/f9f6155ca91b3d444095051cb344f9b1)|Android||2018-08-10 13:17:11|Z7vnaXgrCzWzkyhxqm-o20180812-10864-1ipqiua| |[62786d8387ab005ad0c47ea0e397a68b](https://www.virustotal.com/gui/file/62786d8387ab005ad0c47ea0e397a68b)|Android||2018-08-10 13:08:29|Dm7BY3YH1B_Jn4E-7rPW20180812-20514-uiwmz6| |[16619b1c34c1f44ec12dbe68c366ffb5](https://www.virustotal.com/gui/file/16619b1c34c1f44ec12dbe68c366ffb5)|Android||2018-08-10 13:05:06|t2myJyh7SZEZCBhkkpy-20180812-30209-188xas1| |[9fed5deaedec3f7aa82f08f12c93b63f](https://www.virustotal.com/gui/file/9fed5deaedec3f7aa82f08f12c93b63f)|Android|androidos|2018-08-10 12:19:50|ssrmUthiu63bzswyb8JH20180812-11623-pq3vet| |[0d482c58049c5e930b9a844f4a5f84d4](https://www.virustotal.com/gui/file/0d482c58049c5e930b9a844f4a5f84d4)|Android||2018-08-10 12:09:17|0d482c58049c5e930b9a844f4a5f84d4.apk| |[738b3370230bd3168a97a7171d17ed64](https://www.virustotal.com/gui/file/738b3370230bd3168a97a7171d17ed64)|Win32 EXE||2018-07-17 11:52:53|SearchProtocolHost.exe| |[2c30676af207b3bbb81af097cfd94e88](https://www.virustotal.com/gui/file/2c30676af207b3bbb81af097cfd94e88)|Android|androidos|2018-07-09 14:12:43|BSDYPGkF28gXZiWVQ2fb20180801-26096-xzjwj| |[20d460df4ea1f3d3f4671595812d70ee](https://www.virustotal.com/gui/file/20d460df4ea1f3d3f4671595812d70ee)|Android||2018-07-05 09:11:23|WhatsApp_Update (1).apk| |[af0eeb210cdb22579166928f8a57bfc3](https://www.virustotal.com/gui/file/af0eeb210cdb22579166928f8a57bfc3)|Win32 EXE||2018-06-18 09:46:16|af0eeb210cdb22579166928f8a57bfc3.virus| |[b144fc9e80ea1c835a46442972c69593](https://www.virustotal.com/gui/file/b144fc9e80ea1c835a46442972c69593)|Android||2018-06-13 11:36:33| | |[4a3a4f53b464383b83d9a29a0d41f632](https://www.virustotal.com/gui/file/4a3a4f53b464383b83d9a29a0d41f632)|Android||2018-06-13 10:51:18| | |[b7dc0bc679a3dc342fb00a29b1c02966](https://www.virustotal.com/gui/file/b7dc0bc679a3dc342fb00a29b1c02966)|Android||2018-06-11 23:34:12| | |[4fda51cd2228057d2325f1a47c9c1079](https://www.virustotal.com/gui/file/4fda51cd2228057d2325f1a47c9c1079)|Android||2018-06-11 23:12:09| | |[88f0568f5c3dc15894ccf74860aaf316](https://www.virustotal.com/gui/file/88f0568f5c3dc15894ccf74860aaf316)|Win32 EXE||2018-06-11 20:46:30|88f0568f5c3dc15894ccf74860aaf316.virus| |[fd49128e46d226d70ef3729bd228d6c4](https://www.virustotal.com/gui/file/fd49128e46d226d70ef3729bd228d6c4)|Android||2018-06-11 18:55:04| | |[e5fa0f05720b726b1e88b1943b2ca202](https://www.virustotal.com/gui/file/e5fa0f05720b726b1e88b1943b2ca202)|Android||2018-06-11 14:18:59| | |[11d5e083edb22a3d0f7537732d1b1a53](https://www.virustotal.com/gui/file/11d5e083edb22a3d0f7537732d1b1a53)|Android|bitrep|2018-06-11 11:10:15| | |[29c1a710d0a0669aba6bc3660ed5e667](https://www.virustotal.com/gui/file/29c1a710d0a0669aba6bc3660ed5e667)|Android||2018-06-11 10:54:56| | |[810a7b41656a0583f564def062ce2695](https://www.virustotal.com/gui/file/810a7b41656a0583f564def062ce2695)|Android||2018-06-11 06:12:09| | |[137a5accfff9b62d886b031e2bf9223b](https://www.virustotal.com/gui/file/137a5accfff9b62d886b031e2bf9223b)|Android||2018-06-11 06:11:04| | |[dcc9485edfffa64d78789403d81992c1](https://www.virustotal.com/gui/file/dcc9485edfffa64d78789403d81992c1)|Android||2018-06-11 03:36:02| | |[50f08051149b31c23262a4014c1c3ca5](https://www.virustotal.com/gui/file/50f08051149b31c23262a4014c1c3ca5)|Android||2018-06-10 20:35:00| | |[54753ae15f8b550f1fa540ccbc0408a7](https://www.virustotal.com/gui/file/54753ae15f8b550f1fa540ccbc0408a7)|Android|bitrep|2018-06-10 20:16:11|qBAkXufk7YNG9mDYzzMs20180807-29593-1c4erw4| |[21ad6eed6cc52a723f51fc425035067b](https://www.virustotal.com/gui/file/21ad6eed6cc52a723f51fc425035067b)|Android||2018-06-10 19:44:15| | |[26ca0e3b4f7f435793a466ff0ccbaa45](https://www.virustotal.com/gui/file/26ca0e3b4f7f435793a466ff0ccbaa45)|Android||2018-06-10 16:46:40| | |[de199f48f056d8f2a925f3a27de6b5bd](https://www.virustotal.com/gui/file/de199f48f056d8f2a925f3a27de6b5bd)|Android|bitrep|2018-06-07 08:46:46| | |[05443e9ad15eda809117c88d9e85caa1](https://www.virustotal.com/gui/file/05443e9ad15eda809117c88d9e85caa1)|Android||2018-06-07 08:20:44| | |[35c3aef1347d629bf4e03b34b48a510d](https://www.virustotal.com/gui/file/35c3aef1347d629bf4e03b34b48a510d)|Android||2018-06-06 06:50:39| | |[c5ba37c70cb2ab1d6a51a75b9c1448e3](https://www.virustotal.com/gui/file/c5ba37c70cb2ab1d6a51a75b9c1448e3)|Android||2018-06-06 06:35:54| | |[e5421878b39b03b6bdab730d5938a97c](https://www.virustotal.com/gui/file/e5421878b39b03b6bdab730d5938a97c)|Android||2018-06-05 20:21:06| | |[6a43d50d0f8e57877e4578858fb753a0](https://www.virustotal.com/gui/file/6a43d50d0f8e57877e4578858fb753a0)|Android||2018-06-05 19:53:21| | |[0e569e38563a0244e1118d972938e7c7](https://www.virustotal.com/gui/file/0e569e38563a0244e1118d972938e7c7)|Android|bitrep|2018-06-05 18:32:38|b6abeffe986eb38e411a4fe956280e2028d8bef699d9dd3244bde721a99b1dee.zip| |[10a9dc21e97be61e93088a746fab52a6](https://www.virustotal.com/gui/file/10a9dc21e97be61e93088a746fab52a6)|Android||2018-06-05 18:30:56|5f3b4eddcc72598721b9ca395d1e5881acbd4fc562e09b688b2d42f65d3a4a93.zip| |[c71e240d12be3ef64d0ad85c715aa490](https://www.virustotal.com/gui/file/c71e240d12be3ef64d0ad85c715aa490)|Android|bitrep|2018-06-02 06:37:19|Tetegram Installer7.3.1.apk| |[9dcc05e3a855fd9fdef790801039c09c](https://www.virustotal.com/gui/file/9dcc05e3a855fd9fdef790801039c09c)|Android||2018-06-02 06:29:45|wh_update.apk| |[28fa66f42c6216fe7c628d3d589db114](https://www.virustotal.com/gui/file/28fa66f42c6216fe7c628d3d589db114)|Win32 EXE||2018-05-28 09:24:50|28fa66f42c6216fe7c628d3d589db114.virus| |[5ae06be54ea7911cad447523002144e7](https://www.virustotal.com/gui/file/5ae06be54ea7911cad447523002144e7)|Win32 EXE||2018-05-15 15:49:43|5ae06be54ea7911cad447523002144e7.virus| |[83c7f971ffae27e01f12704fb43d5c04](https://www.virustotal.com/gui/file/83c7f971ffae27e01f12704fb43d5c04)|Android||2018-04-25 23:54:51| | |[fd8c8ae6a261b0e88df06236c5b70be6](https://www.virustotal.com/gui/file/fd8c8ae6a261b0e88df06236c5b70be6)|Win32 EXE|razy|2018-04-22 04:26:15|Interenet Assistant.exe| |[3b33d2b36990a7a4519a1c1ea127cc15](https://www.virustotal.com/gui/file/3b33d2b36990a7a4519a1c1ea127cc15)|Android||2018-04-21 00:56:13|3b33d2b36990a7a4519a1c1ea127cc15.virus| |[81881a0841deaa0ef1ea92c51d8c8845](https://www.virustotal.com/gui/file/81881a0841deaa0ef1ea92c51d8c8845)|Win32 EXE||2018-04-20 04:19:07|Win Graphic Driver.exe| |[a3dc31c456508df7dfac8349eb0d2b65](https://www.virustotal.com/gui/file/a3dc31c456508df7dfac8349eb0d2b65)|DOC||2018-04-18 08:47:09|/media/freddie/Seagate Expansion Drive/aptmalware/SampleLibraryAUG2019/GazaAPTGroup/TheBigBangAPT.doc| |[18864d22331fc6503641f128226aaea8](https://www.virustotal.com/gui/file/18864d22331fc6503641f128226aaea8)|Win32 EXE||2018-04-17 09:50:44|/media/freddie/Seagate Expansion Drive/aptmalware/SampleLibraryAUG2019/GazaAPTGroup/ImplantBigBang.bin| |[2f8face85084bea8adacac36ee2f641f](https://www.virustotal.com/gui/file/2f8face85084bea8adacac36ee2f641f)|Win32 EXE||2018-04-17 09:48:54|التقرير الإعلامي الشهري.exe| |[c7173b137cfdcedc21ea424b66691a57](https://www.virustotal.com/gui/file/c7173b137cfdcedc21ea424b66691a57)|Android||2018-04-17 03:32:39|c7173b137cfdcedc21ea424b66691a57.virus| |[e1de374f37a85ef6e9f46aed612bf1b8](https://www.virustotal.com/gui/file/e1de374f37a85ef6e9f46aed612bf1b8)|Android||2018-04-17 03:32:24|e1de374f37a85ef6e9f46aed612bf1b8.virus| |[69fb0491a4e5fb459005e79b26f121a4](https://www.virustotal.com/gui/file/69fb0491a4e5fb459005e79b26f121a4)|Android||2018-03-30 17:41:25|69fb0491a4e5fb459005e79b26f121a4.virus| |[eb655395e12db9ce0aa75b7892bcfd8a](https://www.virustotal.com/gui/file/eb655395e12db9ce0aa75b7892bcfd8a)|Android||2018-03-17 16:19:08|VirusShare_eb655395e12db9ce0aa75b7892bcfd8a| |[667230ef2ea63a338dfe8db6a3fb12cc](https://www.virustotal.com/gui/file/667230ef2ea63a338dfe8db6a3fb12cc)|Android|androidos|2018-03-17 10:03:33|667230ef2ea63a338dfe8db6a3fb12cc.virus| |[5cdec47f1ce3bd76853c78e403dcbc5b](https://www.virustotal.com/gui/file/5cdec47f1ce3bd76853c78e403dcbc5b)|Android||2018-03-16 17:10:55|5cdec47f1ce3bd76853c78e403dcbc5b.virus| |[b0984e189c1af81d3288e28936ff0a82](https://www.virustotal.com/gui/file/b0984e189c1af81d3288e28936ff0a82)|Android||2018-03-05 12:50:19|b0984e189c1af81d3288e28936ff0a82.virus| |[4f803a88b518d75d08ce65bb7a9818e3](https://www.virustotal.com/gui/file/4f803a88b518d75d08ce65bb7a9818e3)|Android||2018-03-01 20:03:52|4f803a88b518d75d08ce65bb7a9818e3| |[789c0cb1d2cdabcb5538683b58374881](https://www.virustotal.com/gui/file/789c0cb1d2cdabcb5538683b58374881)|Win32 EXE||2018-02-27 18:00:57|789c0cb1d2cdabcb5538683b58374881.virus| |[5e494e94053b73d01b20d48f8d8e0758](https://www.virustotal.com/gui/file/5e494e94053b73d01b20d48f8d8e0758)|Win32 EXE|Banload|2018-02-19 14:24:59|vlc| |[b9165bad0c4ce343e015ed844268271f](https://www.virustotal.com/gui/file/b9165bad0c4ce343e015ed844268271f)|Android||2018-02-13 20:22:33|b9165bad0c4ce343e015ed844268271f.virus| |[172a0c3086da7d98c6084fb7fe8e800d](https://www.virustotal.com/gui/file/172a0c3086da7d98c6084fb7fe8e800d)|Android||2018-02-12 23:21:02|172a0c3086da7d98c6084fb7fe8e800d.virus| |[24a35852d72a2a8eac1b5d3582b04c54](https://www.virustotal.com/gui/file/24a35852d72a2a8eac1b5d3582b04c54)|Android||2018-02-12 06:07:15|24a35852d72a2a8eac1b5d3582b04c54.virus| |[4101b87b1e30e52282768ce5c1b82a90](https://www.virustotal.com/gui/file/4101b87b1e30e52282768ce5c1b82a90)|Android||2018-02-11 08:50:40|99631c8fb08da1387ddd8b16318ce9669ca9e29c| |[25c2e3b2ed107f0682875a4f4d0cbd80](https://www.virustotal.com/gui/file/25c2e3b2ed107f0682875a4f4d0cbd80)|Android||2018-01-31 20:46:12|25c2e3b2ed107f0682875a4f4d0cbd80.virus| |[e3246b90334c641ce6e34b53f6602a02](https://www.virustotal.com/gui/file/e3246b90334c641ce6e34b53f6602a02)|Android||2018-01-25 09:22:07|e3246b90334c641ce6e34b53f6602a02.virus| |[664fbc697b374ddaf02de0de31109929](https://www.virustotal.com/gui/file/664fbc697b374ddaf02de0de31109929)|Android||2018-01-19 12:55:27|NS7M9crjgSZbKU-msTm620180807-29139-cn9noz| |[afcf567d10cc3fe5b6963dbcd5a3e111](https://www.virustotal.com/gui/file/afcf567d10cc3fe5b6963dbcd5a3e111)|Android||2018-01-17 09:03:03|afcf567d10cc3fe5b6963dbcd5a3e111.virus| |[d5003f979ebdf97695cf755427c1fb25](https://www.virustotal.com/gui/file/d5003f979ebdf97695cf755427c1fb25)|Android||2018-01-16 22:21:02|/home/ubuntu/site_disks/jsa.live/files/13271297.apk| |[ea123702bcd889f358f52a5df288ac96](https://www.virustotal.com/gui/file/ea123702bcd889f358f52a5df288ac96)|Android||2018-01-10 11:16:01|ea123702bcd889f358f52a5df288ac96.virus| |[880010844a226d8b586bdad423cd424c](https://www.virustotal.com/gui/file/880010844a226d8b586bdad423cd424c)|Android||2018-01-10 07:36:27|880010844a226d8b586bdad423cd424c.virus| |[f8e754d791edbafc760510bf30012b0b](https://www.virustotal.com/gui/file/f8e754d791edbafc760510bf30012b0b)|Android||2018-01-07 13:02:19|/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/i0ld028a85sg9it3bj92d1hbtkq7qenq/1515326400000/07674850865767386831/*/0B97LrzGnTM61SW1GT1pnSC1LWWs| |[0db81370c3ff514a8a93c54d992bf10a](https://www.virustotal.com/gui/file/0db81370c3ff514a8a93c54d992bf10a)|Android||2018-01-05 12:11:49|0db81370c3ff514a8a93c54d992bf10a.virus| |[d3b5204d71327eb9558354936a03d27f](https://www.virustotal.com/gui/file/d3b5204d71327eb9558354936a03d27f)|Android||2018-01-05 00:20:42|d3b5204d71327eb9558354936a03d27f.virus| |[7441c35b4c3038ea7c6b22324e48c2da](https://www.virustotal.com/gui/file/7441c35b4c3038ea7c6b22324e48c2da)|Android||2018-01-03 17:07:55|7441c35b4c3038ea7c6b22324e48c2da.virus| |[52f877007be5197d2c857894d53d9176](https://www.virustotal.com/gui/file/52f877007be5197d2c857894d53d9176)|Android|androidos|2017-12-30 23:57:40|52f877007be5197d2c857894d53d9176.virus| |[f1a64d507515449a06ff9f267ae1042e](https://www.virustotal.com/gui/file/f1a64d507515449a06ff9f267ae1042e)|Android||2017-12-29 19:42:09|/home/ubuntu/site_disks/jsa.live/files/16186417.apk| |[f6f1553efea628435108abeba25ce321](https://www.virustotal.com/gui/file/f6f1553efea628435108abeba25ce321)|Android||2017-12-26 09:56:39|f6f1553efea628435108abeba25ce321.virus| |[7b0196dbb918af22d5585dea6fd339b0](https://www.virustotal.com/gui/file/7b0196dbb918af22d5585dea6fd339b0)|Android|bitrep|2017-12-26 07:44:21|7b0196dbb918af22d5585dea6fd339b0.virus| |[2a3f9c87aae0658a19069a8d6481008d](https://www.virustotal.com/gui/file/2a3f9c87aae0658a19069a8d6481008d)|Android|bitrep|2017-12-19 00:25:20|2a3f9c87aae0658a19069a8d6481008d.virus| |[f57e1ba3e3b759301ce3a8287b57a75d](https://www.virustotal.com/gui/file/f57e1ba3e3b759301ce3a8287b57a75d)|Android||2017-12-18 11:02:52|f57e1ba3e3b759301ce3a8287b57a75d.virus| |[92f2c86cf9942f8d390fbc90d4686c41](https://www.virustotal.com/gui/file/92f2c86cf9942f8d390fbc90d4686c41)|Android||2017-12-16 19:21:49|1024-d5c0fba9a66eb5558b82ba10a9785434dcb9c9e6| |[f9de98d1825095ea49135212c1d8b016](https://www.virustotal.com/gui/file/f9de98d1825095ea49135212c1d8b016)|Android|androidos|2017-12-12 04:02:15|f9de98d1825095ea49135212c1d8b016.virus| |[26540ae6018a924d43a1cc0b5fb7f807](https://www.virustotal.com/gui/file/26540ae6018a924d43a1cc0b5fb7f807)|Android|androidos|2017-12-08 19:08:32|26540ae6018a924d43a1cc0b5fb7f807.virus| |[e8dfa1a7cf756b9dbe864ef1df6e8706](https://www.virustotal.com/gui/file/e8dfa1a7cf756b9dbe864ef1df6e8706)|Android|androidos|2017-12-04 12:44:27|e8dfa1a7cf756b9dbe864ef1df6e8706.virus| |[9cedeae7cc5c71dad5f8f2a303efa3a1](https://www.virustotal.com/gui/file/9cedeae7cc5c71dad5f8f2a303efa3a1)|Android|androidos|2017-12-02 20:13:58|9cedeae7cc5c71dad5f8f2a303efa3a1.virus| |[9c6a604203d35002458fde61e4adf724](https://www.virustotal.com/gui/file/9c6a604203d35002458fde61e4adf724)|Android||2017-11-28 16:58:51|9c6a604203d35002458fde61e4adf724.virus| |[2e57f58f13c3a4ebe2b3b26b38708516](https://www.virustotal.com/gui/file/2e57f58f13c3a4ebe2b3b26b38708516)|Android||2017-11-25 20:23:29|2e57f58f13c3a4ebe2b3b26b38708516.virus| |[cb7779635de27e920fdc2a7ce7a30477](https://www.virustotal.com/gui/file/cb7779635de27e920fdc2a7ce7a30477)|Android|androidos|2017-11-25 17:14:06|cb7779635de27e920fdc2a7ce7a30477.virus| |[24908a1b942acd533030bd51629006a9](https://www.virustotal.com/gui/file/24908a1b942acd533030bd51629006a9)|Android||2017-10-30 23:22:59|24908a1b942acd533030bd51629006a9.virus| |[c89b74b8e4ffa1e84f8f291f50745adc](https://www.virustotal.com/gui/file/c89b74b8e4ffa1e84f8f291f50745adc)|Android||2017-10-28 02:38:53|c89b74b8e4ffa1e84f8f291f50745adc.virus| |[a4f3bdbb33de033c39b80cc693261db4](https://www.virustotal.com/gui/file/a4f3bdbb33de033c39b80cc693261db4)|Android||2017-10-25 19:37:59|a4f3bdbb33de033c39b80cc693261db4.virus| |[f5771a3ade8d34af023c3e74f7a58e5f](https://www.virustotal.com/gui/file/f5771a3ade8d34af023c3e74f7a58e5f)|Android||2017-10-21 18:27:41|f5771a3ade8d34af023c3e74f7a58e5f.virus| |[9aceb002e71b7a15bded15f18c07267b](https://www.virustotal.com/gui/file/9aceb002e71b7a15bded15f18c07267b)|Android||2017-10-14 08:41:25|9aceb002e71b7a15bded15f18c07267b.virus| |[caba5fdb21cff3b63ed76f440d4cbbe7](https://www.virustotal.com/gui/file/caba5fdb21cff3b63ed76f440d4cbbe7)|Android||2017-10-09 16:06:34|caba5fdb21cff3b63ed76f440d4cbbe7.virus| |[b369b38fbaae41484300856b8d2a1544](https://www.virustotal.com/gui/file/b369b38fbaae41484300856b8d2a1544)|Android||2017-09-20 21:34:45|MeetCam.apk| |[21d984fdf4b503edd325ed01d4c25320](https://www.virustotal.com/gui/file/21d984fdf4b503edd325ed01d4c25320)|Android||2017-09-20 21:31:11|MEET.apk| |[15dca70d17ca9e146362784a81217032](https://www.virustotal.com/gui/file/15dca70d17ca9e146362784a81217032)|Android||2017-09-15 07:53:05|15dca70d17ca9e146362784a81217032.virus| |[bad78190170b5ed204702fda8f17eb5a](https://www.virustotal.com/gui/file/bad78190170b5ed204702fda8f17eb5a)|Android||2017-09-14 07:45:15|bad78190170b5ed204702fda8f17eb5a.virus| |[557fdf84855510862e479d84d156b2fd](https://www.virustotal.com/gui/file/557fdf84855510862e479d84d156b2fd)|Android||2017-09-03 22:36:28|557fdf84855510862e479d84d156b2fd.virus| |[82e6e64f0f7265fcc69b9a834e0e41de](https://www.virustotal.com/gui/file/82e6e64f0f7265fcc69b9a834e0e41de)|Android||2017-08-14 16:17:04|82e6e64f0f7265fcc69b9a834e0e41de.virus| |[b2c7ff62da02bbc61936f67104c4da35](https://www.virustotal.com/gui/file/b2c7ff62da02bbc61936f67104c4da35)|Android||2017-08-08 10:26:29|b2c7ff62da02bbc61936f67104c4da35.virus| |[a7ccd77302da4143c7c4ec5e18246c99](https://www.virustotal.com/gui/file/a7ccd77302da4143c7c4ec5e18246c99)|Android||2017-08-07 06:49:53|/home/spot/Desktop/ELMDetection/ClusterEnsemble2/VirusTotalGooglePlay/Malware/cf2d7545b1f5ec57142727f795e07e85b84cbfe9a8b9f75aa5219495c746d853| |[0f2dfdc4f12b7b739a9f156fc46ceb8a](https://www.virustotal.com/gui/file/0f2dfdc4f12b7b739a9f156fc46ceb8a)|Android||2017-08-03 00:16:25|/8n5nukq9x6cg/bxlijc2ado3ap33/best_chat-.apk| |[53847984ba6f31971e5848b75fdd9bc0](https://www.virustotal.com/gui/file/53847984ba6f31971e5848b75fdd9bc0)|Android||2017-07-31 20:10:22|53847984ba6f31971e5848b75fdd9bc0.virus| |[baf4bbe7733c64392dd568236bd45ce3](https://www.virustotal.com/gui/file/baf4bbe7733c64392dd568236bd45ce3)|Android||2017-07-25 20:16:48|baf4bbe7733c64392dd568236bd45ce3.virus| |[e0c12821f1573f143cf93137f655d08e](https://www.virustotal.com/gui/file/e0c12821f1573f143cf93137f655d08e)|Android||2017-07-11 13:06:48|e0c12821f1573f143cf93137f655d08e.virus| |[c5eb82e759a4bc6b4a586a7b23cc8925](https://www.virustotal.com/gui/file/c5eb82e759a4bc6b4a586a7b23cc8925)|Android||2017-07-06 11:28:44|c5eb82e759a4bc6b4a586a7b23cc8925.virus| |[b76a8428cb7b9d7aa4390e1f61e99bf9](https://www.virustotal.com/gui/file/b76a8428cb7b9d7aa4390e1f61e99bf9)|Android||2017-07-02 03:12:58|/home/spot/Desktop/2ndCodeGraphsExtension/Obfuscation/MalwareApks/46976081c1bcec4daa9701fbe373010c0bcb17463359a91556f09339522b6a13| |[21b1bbe19fc1df71027aa3b14f956679](https://www.virustotal.com/gui/file/21b1bbe19fc1df71027aa3b14f956679)|Android||2017-06-06 18:35:57|21b1bbe19fc1df71027aa3b14f956679.virus| |[ea67a4a35930cfa8a3fd663e265fd991](https://www.virustotal.com/gui/file/ea67a4a35930cfa8a3fd663e265fd991)|Android||2017-06-02 14:35:31|ea67a4a35930cfa8a3fd663e265fd991.virus| |[6afc698831f534f0cbf6798b172d9451](https://www.virustotal.com/gui/file/6afc698831f534f0cbf6798b172d9451)|Android||2017-05-31 02:20:37|6afc698831f534f0cbf6798b172d9451.virus| |[afca5f94700a83924944f1683092ce42](https://www.virustotal.com/gui/file/afca5f94700a83924944f1683092ce42)|Android||2017-05-31 02:20:34|afca5f94700a83924944f1683092ce42.virus| |[cf2263b6f9a0d0ffc7b773ebd9b43a4e](https://www.virustotal.com/gui/file/cf2263b6f9a0d0ffc7b773ebd9b43a4e)|Android||2017-05-29 09:48:20|update facebook.apk| |[2e2c74bb56577b68c2f3c0b61f7cc891](https://www.virustotal.com/gui/file/2e2c74bb56577b68c2f3c0b61f7cc891)|Android||2017-05-26 01:07:56|updatefacebook.apk| |[466915777eb3e0b57021188532f3eeb7](https://www.virustotal.com/gui/file/466915777eb3e0b57021188532f3eeb7)|Android||2017-05-25 20:05:11|update facebook.apk| |[1d9e31787d6eb88d95f2c6a0cbe60ba3](https://www.virustotal.com/gui/file/1d9e31787d6eb88d95f2c6a0cbe60ba3)|Android||2017-05-25 19:00:22|update facebook.apk| |[5ac1a4d07ea0e7dd1b1e0d777a5a304c](https://www.virustotal.com/gui/file/5ac1a4d07ea0e7dd1b1e0d777a5a304c)|Android||2017-05-25 18:13:49|update_facebook.apk| |[d8f4966cb08fdcf628bd0a5af76d75d0](https://www.virustotal.com/gui/file/d8f4966cb08fdcf628bd0a5af76d75d0)|Android||2017-05-24 12:19:49|/1/4/e/4ebb385b0bf460d8561c39af8b69144bfe8c7a4d8607b157784674de653b9a05.file| |[c1e6ef4ccce494546c1810f8894439c0](https://www.virustotal.com/gui/file/c1e6ef4ccce494546c1810f8894439c0)|Android|androidos|2017-05-16 20:03:58|gnat| |[457e0a16b1b544ada28f08b92c1c518f](https://www.virustotal.com/gui/file/457e0a16b1b544ada28f08b92c1c518f)|Android||2017-04-27 12:39:57|b6abeffe986eb38e411a4fe956280e2028d8bef699d9dd3244bde721a99b1dee| |[1c58678fa1ffec5f2f6fdaed54dd6a81](https://www.virustotal.com/gui/file/1c58678fa1ffec5f2f6fdaed54dd6a81)|Android||2017-03-29 02:20:12|1c58678fa1ffec5f2f6fdaed54dd6a81.virus| |[0be8a35a4818bb7e7404edbbe7431cb0](https://www.virustotal.com/gui/file/0be8a35a4818bb7e7404edbbe7431cb0)|Android||2017-03-22 09:26:27|line.apk| |[eedbf1f7a0d392d4cea2ad58ed30a72e](https://www.virustotal.com/gui/file/eedbf1f7a0d392d4cea2ad58ed30a72e)|Android||2017-03-19 05:36:16|eedbf1f7a0d392d4cea2ad58ed30a72e.virus| |[6462bdc3c6a5efb11e066853a757164a](https://www.virustotal.com/gui/file/6462bdc3c6a5efb11e066853a757164a)|Win32 EXE|msilperseus|2017-03-16 16:00:56|Loader.exe| |[55347a2677d5c7716bbcd4c20c363d15](https://www.virustotal.com/gui/file/55347a2677d5c7716bbcd4c20c363d15)|Android||2017-03-13 02:17:40|55347a2677d5c7716bbcd4c20c363d15.virus| |[8d527c848d667945f65cc59315ed5ee7](https://www.virustotal.com/gui/file/8d527c848d667945f65cc59315ed5ee7)|Android||2017-03-13 02:17:37|8d527c848d667945f65cc59315ed5ee7.virus| |[6ad1f9fc5ba68bcd1e6868d44980690d](https://www.virustotal.com/gui/file/6ad1f9fc5ba68bcd1e6868d44980690d)|Android||2017-03-13 02:17:24|6ad1f9fc5ba68bcd1e6868d44980690d.virus| |[78919ee718f9bd683d75b466e4ba70fb](https://www.virustotal.com/gui/file/78919ee718f9bd683d75b466e4ba70fb)|DOS EXE|msilperseus|2017-03-04 21:40:06| | |[b076ec4e69ada4900b16807b45d1a53d](https://www.virustotal.com/gui/file/b076ec4e69ada4900b16807b45d1a53d)|DOS EXE||2017-03-04 21:33:14| | |[bd2a0c55765eb01644346760983dc814](https://www.virustotal.com/gui/file/bd2a0c55765eb01644346760983dc814)|Win32 EXE||2017-03-02 21:22:56|Loader.exe| |[79d499693b9444155d99e19ce9a9a155](https://www.virustotal.com/gui/file/79d499693b9444155d99e19ce9a9a155)|Win32 EXE||2017-03-02 10:02:32|Loader.exe| |[a0582988c774eebeeba2798ccb04b27f](https://www.virustotal.com/gui/file/a0582988c774eebeeba2798ccb04b27f)|Win32 EXE||2017-03-02 06:28:54|Windows Media Help.exe| |[5040d49c11069c43a15cf4d3921b5218](https://www.virustotal.com/gui/file/5040d49c11069c43a15cf4d3921b5218)|Win32 EXE|BestaFera|2017-03-02 06:27:09|System Media Update.exe| |[14afcccac89c31782f5150ae1c8c6267](https://www.virustotal.com/gui/file/14afcccac89c31782f5150ae1c8c6267)|Win32 EXE||2017-02-28 15:01:46|Loader.exe| |[15b923d32ba8efdfee719d503921b91d](https://www.virustotal.com/gui/file/15b923d32ba8efdfee719d503921b91d)|Win32 EXE||2017-02-28 09:41:18|VLC| |[cf79d4d6d911e4c864114ddc2faef750](https://www.virustotal.com/gui/file/cf79d4d6d911e4c864114ddc2faef750)|Android||2017-02-28 00:54:00|cf79d4d6d911e4c864114ddc2faef750.virus| |[97ae35d36c7434ef770e1a7fead55276](https://www.virustotal.com/gui/file/97ae35d36c7434ef770e1a7fead55276)|Win32 EXE|dynamer|2017-02-27 09:09:21|testproj.exe| |[cb336cea05ef664c2796209770f5d624](https://www.virustotal.com/gui/file/cb336cea05ef664c2796209770f5d624)|Win32 EXE|dynamer|2017-02-27 09:04:25|f26caee34184b6a5_igfxtray.exe| |[79e5f56d244044aab2f6760147524c57](https://www.virustotal.com/gui/file/79e5f56d244044aab2f6760147524c57)|Win32 EXE|dynamer|2017-02-27 09:03:22|testproj.exe| |[7897cf3de02a5dfcfd2c32d8c0e08f58](https://www.virustotal.com/gui/file/7897cf3de02a5dfcfd2c32d8c0e08f58)|Win32 EXE|dynamer|2017-02-26 09:47:19|Player| |[869eeb38d25a9366a3a5d62d1b15d940](https://www.virustotal.com/gui/file/869eeb38d25a9366a3a5d62d1b15d940)|Win32 EXE|BestaFera|2017-02-19 17:48:03|869eeb38d25a9366a3a5d62d1b15d940.virus| |[679a56919384a182d633035bc7607f89](https://www.virustotal.com/gui/file/679a56919384a182d633035bc7607f89)|Win32 EXE||2017-02-18 05:55:33|679a56919384a182d633035bc7607f89.virus| |[059a50b5c1bb8bc7944d897984dfb784](https://www.virustotal.com/gui/file/059a50b5c1bb8bc7944d897984dfb784)|Win32 EXE|Delf|2017-02-14 22:46:06|Win10Shell.exe| |[0eba499c6dd0bcf26bb818e0c916b76c](https://www.virustotal.com/gui/file/0eba499c6dd0bcf26bb818e0c916b76c)|Win32 EXE||2017-02-14 20:01:59|Rape Egyption Girl-87634764238-786782346783-78432632478349579242.mp4.exe| |[063f50b4546755efe06bdd4f0422511d](https://www.virustotal.com/gui/file/063f50b4546755efe06bdd4f0422511d)|Android|androidos|2017-02-14 19:37:02|update.apk| |[f046ac1705e31f5d7654e6ba0b5ae772](https://www.virustotal.com/gui/file/f046ac1705e31f5d7654e6ba0b5ae772)|Win32 EXE|BestaFera|2017-02-13 16:52:31| | |[b6507e6ff1bda8b105d3712a038017d6](https://www.virustotal.com/gui/file/b6507e6ff1bda8b105d3712a038017d6)|Win32 EXE|kasperagent|2017-02-12 15:35:05|Update| |[ba062c23a468c803abe787d23350807c](https://www.virustotal.com/gui/file/ba062c23a468c803abe787d23350807c)|Win32 EXE||2017-02-12 11:26:15|VLC| |[116d824285c32a2bdc6ca5443db8b3ce](https://www.virustotal.com/gui/file/116d824285c32a2bdc6ca5443db8b3ce)|Win32 EXE|kasperagent|2017-02-12 08:46:00|mkplayer.exe| |[8868202fa4fa91dba59516fbba23e296](https://www.virustotal.com/gui/file/8868202fa4fa91dba59516fbba23e296)|Win32 EXE|BestaFera|2017-02-09 10:49:37|Update File Manager.exe| |[42cbf5a26fe6ca3a0789de502d107a39](https://www.virustotal.com/gui/file/42cbf5a26fe6ca3a0789de502d107a39)|Win32 EXE|BestaFera|2017-02-09 10:47:57|Update Windows Service.exe| |[11cdabb1a13205c6d4f43206f674b055](https://www.virustotal.com/gui/file/11cdabb1a13205c6d4f43206f674b055)|Win32 EXE|kasperagent|2017-02-05 05:42:33|Update| |[80967033133d4d744bd82266bed76b86](https://www.virustotal.com/gui/file/80967033133d4d744bd82266bed76b86)|Win32 EXE|strictor|2017-02-01 14:12:52|Update| |[20f9250a1fd7534c5d749321c7c28304](https://www.virustotal.com/gui/file/20f9250a1fd7534c5d749321c7c28304)|Win32 EXE|kasperagent|2017-01-31 19:57:51|Update| |[5a05c515dc7fbc7a144c0eb929d7a9c0](https://www.virustotal.com/gui/file/5a05c515dc7fbc7a144c0eb929d7a9c0)|Win32 EXE||2017-01-31 09:05:11|Samsung Magician.exe| |[47430323db04c1b86b46e65e26ba72d2](https://www.virustotal.com/gui/file/47430323db04c1b86b46e65e26ba72d2)|Win32 EXE|BestaFera|2017-01-29 08:07:14|Win10Shell.exe| |[82630eb054431d84420e8cec59370741](https://www.virustotal.com/gui/file/82630eb054431d84420e8cec59370741)|Win32 EXE|Zbot|2017-01-25 21:24:30|WindowsUpdateService.exe| |[304bf45f84b6e5659babb1dd5108d6e2](https://www.virustotal.com/gui/file/304bf45f84b6e5659babb1dd5108d6e2)|Win64 EXE|dynamer|2017-01-25 12:39:27|Wextract| |[206a6e7d382d792551cfcd8110c00f39](https://www.virustotal.com/gui/file/206a6e7d382d792551cfcd8110c00f39)|Win32 EXE|starter|2017-01-25 09:30:51|206a6e7d382d792551cfcd8110c00f39.virus| |[789ed8c1e3f9b1a77a5b6a43c09d2590](https://www.virustotal.com/gui/file/789ed8c1e3f9b1a77a5b6a43c09d2590)|Win32 EXE|BestaFera|2017-01-23 17:00:32|council_of_ministres_decision_15679863995_022654697794218_jpg.exe| |[aef91731409b82100f7129c236869da8](https://www.virustotal.com/gui/file/aef91731409b82100f7129c236869da8)|Win32 EXE||2017-01-22 09:11:22|WindowsHelp.exe| |[e73821e1767efde88b1aef203fe65136](https://www.virustotal.com/gui/file/e73821e1767efde88b1aef203fe65136)|Win32 EXE|BestaFera|2017-01-21 05:00:43|e73821e1767efde88b1aef203fe65136.virus| |[a9b9af173ba34fed95e89482e2f6863c](https://www.virustotal.com/gui/file/a9b9af173ba34fed95e89482e2f6863c)|Win32 EXE|Zbot|2017-01-21 01:15:16|a9b9af173ba34fed95e89482e2f6863c.virus| |[d9fba5b780cc029873a70cf22f5c9cac](https://www.virustotal.com/gui/file/d9fba5b780cc029873a70cf22f5c9cac)|Android||2017-01-17 12:26:09|LINE.apk| |[356c76586babdde4717098675e762900](https://www.virustotal.com/gui/file/356c76586babdde4717098675e762900)|Win32 EXE|BestaFera|2017-01-17 11:05:27|update file manager.exe| |[b525e5ceb7c06e2e94c1604224d2c4dd](https://www.virustotal.com/gui/file/b525e5ceb7c06e2e94c1604224d2c4dd)|Win32 EXE|BestaFera|2017-01-17 11:04:11|win10shell.exe| |[071373765a35fd03bd6d61fd1dfe505b](https://www.virustotal.com/gui/file/071373765a35fd03bd6d61fd1dfe505b)|Win32 EXE|BestaFera|2017-01-17 11:04:04|updatetools.exe| |[56ab37da8336a4a9a80ec9bda2659930](https://www.virustotal.com/gui/file/56ab37da8336a4a9a80ec9bda2659930)|Win32 EXE|BestaFera|2017-01-15 23:19:09|Geneva_Meeting_Center_784785673722346_9823644728509001_doc.exe| |[090edcc95e38d27e686b6329c3bee8fd](https://www.virustotal.com/gui/file/090edcc95e38d27e686b6329c3bee8fd)|Win32 EXE|BestaFera|2017-01-15 23:17:53|3634(1)_487886_10152599432711675287_25093124132199354_n_PDF.exe| |[a6b571bb79a8ddfac8bbf70d744fd9c0](https://www.virustotal.com/gui/file/a6b571bb79a8ddfac8bbf70d744fd9c0)|RAR||2017-01-15 19:55:32|a6b571bb79a8ddfac8bbf70d744fd9c0.virus| |[5b2dc3b75f1944b73c2101ff1077f690](https://www.virustotal.com/gui/file/5b2dc3b75f1944b73c2101ff1077f690)|Win32 EXE|Zbot|2017-01-15 13:47:25|f482eef9bf78c083acb1b4c98e3b4bb3| |[5823f265f46614a005b6367d211eafb7](https://www.virustotal.com/gui/file/5823f265f46614a005b6367d211eafb7)|Win32 EXE|Ramnit|2017-01-13 01:43:05|Update| |[2bb84cfe548fec7fb123d7e46cf67ff4](https://www.virustotal.com/gui/file/2bb84cfe548fec7fb123d7e46cf67ff4)|Win32 EXE||2017-01-10 08:21:24|C:\\Users\\Dan\\Downloads\\6e461a8430f251db38e8911dbacd1e72bce47a89c28956115b702d13ae2b8e3b| |[4e5f20b8b025830fad872a56cb892d7c](https://www.virustotal.com/gui/file/4e5f20b8b025830fad872a56cb892d7c)|Win32 EXE||2017-01-09 13:29:27|VLC| |[09e4e6fa85b802c46bc121fcaecc5666](https://www.virustotal.com/gui/file/09e4e6fa85b802c46bc121fcaecc5666)|Win32 EXE|MSILPerseus|2017-01-08 16:19:03|Loader.exe| |[ad44d53c15fdb39e1460cae6423d1a23](https://www.virustotal.com/gui/file/ad44d53c15fdb39e1460cae6423d1a23)|Win32 EXE|Zbot|2017-01-08 16:18:06| | |[51e5fb808aef2a65eab53b2ccea57dd3](https://www.virustotal.com/gui/file/51e5fb808aef2a65eab53b2ccea57dd3)|Win32 EXE|adoc|2017-01-04 09:57:36|Terminal.exe.bin| |[037410c7ec88795f8cf352104001ea99](https://www.virustotal.com/gui/file/037410c7ec88795f8cf352104001ea99)|Win32 EXE|kasperagent|2017-01-04 09:38:00|Update| |[1b89ac0f5b4ce671e818c87de26938ad](https://www.virustotal.com/gui/file/1b89ac0f5b4ce671e818c87de26938ad)|Win32 EXE||2016-12-29 12:08:59|RaedSituation_Home_Security_487886_10152599711675287_2509_pdf.exe| |[4c1eec2b9b6eefa49ff9f5fd87e77482](https://www.virustotal.com/gui/file/4c1eec2b9b6eefa49ff9f5fd87e77482)|Win32 EXE|BestaFera|2016-12-27 12:36:10|اعادة هيكلة الأجهزة الأمنية_27-12-2016_564534234_pdf.exe| |[f8dae94ad3a1e36c2cf58ba253544ece](https://www.virustotal.com/gui/file/f8dae94ad3a1e36c2cf58ba253544ece)|Win32 EXE|kasperagent|2016-12-26 21:36:33|MX Update| |[ceef61be02dd90cb8d14742a3aaab362](https://www.virustotal.com/gui/file/ceef61be02dd90cb8d14742a3aaab362)|Win32 EXE|kasperagent|2016-12-23 21:39:14|Update| |[662ae23476cc0ef97deaaf97c1ee64b9](https://www.virustotal.com/gui/file/662ae23476cc0ef97deaaf97c1ee64b9)|Win32 EXE|Delf|2016-12-23 09:52:15|E:\sample\事件分析\沙漠猎鹰\4299fbfe74f671ee2c36d71bc808437c\windows_shell_update.exe_| |[211e03c5894f9cc8180bbda80e6fa537](https://www.virustotal.com/gui/file/211e03c5894f9cc8180bbda80e6fa537)|Android||2016-12-22 22:18:36| | |[06410f97ec2a6bc76f693c07735e99d6](https://www.virustotal.com/gui/file/06410f97ec2a6bc76f693c07735e99d6)|Win32 EXE|strictor|2016-12-22 08:45:22|Update| |[3dc99568080033d6772a71fc56875687](https://www.virustotal.com/gui/file/3dc99568080033d6772a71fc56875687)|Win32 EXE|MSILPerseus|2016-12-22 08:45:08|Loader.exe| |[220dd77f7bbbd7ca5fef105e6ab8e35e](https://www.virustotal.com/gui/file/220dd77f7bbbd7ca5fef105e6ab8e35e)|Win32 EXE|MSILPerseus|2016-12-22 01:32:05|Loader.exe| |[e6da1e8bf6b6ffc52c56788500e98eb6](https://www.virustotal.com/gui/file/e6da1e8bf6b6ffc52c56788500e98eb6)|Win32 EXE||2016-12-21 15:22:59|VLC| |[0c97e922b62d2497e37c5c01a807f2ae](https://www.virustotal.com/gui/file/0c97e922b62d2497e37c5c01a807f2ae)|Win32 EXE|strictor|2016-12-21 10:48:29|Update| |[c0dc81e3a45709ccd07984d9248a9c1c](https://www.virustotal.com/gui/file/c0dc81e3a45709ccd07984d9248a9c1c)|Win32 EXE||2016-12-21 10:45:50|Loader.exe| |[a111af210dc777621f79edffb6bed6f3](https://www.virustotal.com/gui/file/a111af210dc777621f79edffb6bed6f3)|Win32 EXE|Delf|2016-12-16 14:33:21|e1e613027958bbd7f24e648959aafe57| |[4572eb0381a86916f8e62514ffac0459](https://www.virustotal.com/gui/file/4572eb0381a86916f8e62514ffac0459)|Android||2016-12-13 17:44:59| | |[2fd81bb4b270791fad5936b4efd3e0df](https://www.virustotal.com/gui/file/2fd81bb4b270791fad5936b4efd3e0df)|Win32 EXE|BestaFera|2016-12-13 13:46:13| | |[0d40eb7d51a4a5ae61bedad3ffee3d56](https://www.virustotal.com/gui/file/0d40eb7d51a4a5ae61bedad3ffee3d56)|Win32 EXE|Zbot|2016-12-13 13:45:20|ملخص إجتماعات اليوم_13-12-2016 -1564863-56478_doc.exe| |[b5792f6671ba5b407a455766ed80fb22](https://www.virustotal.com/gui/file/b5792f6671ba5b407a455766ed80fb22)|Win32 EXE||2016-12-12 17:47:52|VLC| |[1feadd0f95d84d878c22534f6ef0bedc](https://www.virustotal.com/gui/file/1feadd0f95d84d878c22534f6ef0bedc)|Android||2016-12-12 12:20:45| | |[ac9131660f6a614162a01e8cc8948d52](https://www.virustotal.com/gui/file/ac9131660f6a614162a01e8cc8948d52)|Win32 EXE|BestaFera|2016-12-09 20:46:28| | |[3ef88081662712f123d438b44e399c12](https://www.virustotal.com/gui/file/3ef88081662712f123d438b44e399c12)|Win32 EXE|BestaFera|2016-12-09 20:45:19|The details of the assassination of President Arafat_06-12-2016_docx.exe| |[1381c805f00552ad0e467acee867b29e](https://www.virustotal.com/gui/file/1381c805f00552ad0e467acee867b29e)|Win32 EXE||2016-12-08 14:45:28| | |[4eeb610eb430fbdc6eefb0932dcb5475](https://www.virustotal.com/gui/file/4eeb610eb430fbdc6eefb0932dcb5475)|Win32 EXE|kasperagent|2016-12-08 08:47:43|Loader.Properties.Resources.resources| |[c2cb6380a492ee8ded3a694229383505](https://www.virustotal.com/gui/file/c2cb6380a492ee8ded3a694229383505)|Win32 EXE||2016-12-07 11:16:33|Loader.exe| |[7dd560d8cee99f4126b50dca52854a5e](https://www.virustotal.com/gui/file/7dd560d8cee99f4126b50dca52854a5e)|Win32 EXE|msilperseus|2016-12-06 06:26:34|Loader.exe| |[d7825036eb4802fe9a690c852a65eef5](https://www.virustotal.com/gui/file/d7825036eb4802fe9a690c852a65eef5)|Win32 EXE|BestaFera|2016-12-04 07:56:07| | |[f030defa9578b8994f9802ac2c062cd7](https://www.virustotal.com/gui/file/f030defa9578b8994f9802ac2c062cd7)|Win32 EXE||2016-12-04 07:55:29|ملخص إجتماعات اليوم_pdf.exe| |[c548cea3b6d00776f322182a77e94ae5](https://www.virustotal.com/gui/file/c548cea3b6d00776f322182a77e94ae5)|Win32 EXE|kasperagent|2016-12-03 13:03:04|MX Update| |[bd5c3997307fd02175f1ec797596160c](https://www.virustotal.com/gui/file/bd5c3997307fd02175f1ec797596160c)|Win32 EXE|kasperagent|2016-12-03 03:06:11|MX Update| |[7103143145440360cca5c9da7a19eaf7](https://www.virustotal.com/gui/file/7103143145440360cca5c9da7a19eaf7)|Win32 EXE|kasperagent|2016-12-03 02:51:21|MX Update| |[e82ddb04d2f6b7d1327c9c7f7edf3086](https://www.virustotal.com/gui/file/e82ddb04d2f6b7d1327c9c7f7edf3086)|Win32 EXE|msilperseus|2016-12-03 01:33:25|Loader.exe| |[ed8589ef50d6552011f0e867f17b0dac](https://www.virustotal.com/gui/file/ed8589ef50d6552011f0e867f17b0dac)|Win32 EXE|kasperagent|2016-12-03 01:32:15|MX Update| |[1507ebfa9c6fe407c8b8fd44c1019b12](https://www.virustotal.com/gui/file/1507ebfa9c6fe407c8b8fd44c1019b12)|Win32 EXE|MSILPerseus|2016-12-02 19:16:57|Loader.exe| |[9c4026002ab1615aaeab941c2f900386](https://www.virustotal.com/gui/file/9c4026002ab1615aaeab941c2f900386)|Win32 EXE|msilperseus|2016-12-02 05:52:36|Loader.exe| |[ce066f4dbba840e8bc16cd7793b1dd0a](https://www.virustotal.com/gui/file/ce066f4dbba840e8bc16cd7793b1dd0a)|Win32 EXE||2016-12-01 14:45:24|Loader.exe| |[5891445552a501176fd0a493c6d5659b](https://www.virustotal.com/gui/file/5891445552a501176fd0a493c6d5659b)|Android|androidos|2016-11-30 14:23:13|private_pic.apk| |[ae67b0b632230a887bef7a112432aa0d](https://www.virustotal.com/gui/file/ae67b0b632230a887bef7a112432aa0d)|Win32 EXE|kasperagent|2016-11-25 02:10:26|MX Update| |[ad6ede2e93230802568b59b5bab52bd8](https://www.virustotal.com/gui/file/ad6ede2e93230802568b59b5bab52bd8)|Android|androidos|2016-11-24 13:41:41|31a609d0896e49da3a46e3805cb92c0269f3f738| |[4fd4aca3f00507c7dd778efceb4b2f85](https://www.virustotal.com/gui/file/4fd4aca3f00507c7dd778efceb4b2f85)|Win32 EXE||2016-11-19 00:35:12|أهم نقاط إجتماع ذكرى الرئيس الراحل أبوعمار رحمه الله - ورقة رقم 1- page number1.jpg.exe| |[bf376ffc368ddc88d62f47bda82ecf0a](https://www.virustotal.com/gui/file/bf376ffc368ddc88d62f47bda82ecf0a)|Win32 EXE||2016-11-19 00:31:26|bf376ffc368ddc88d62f47bda82ecf0a.virus| |[83a1ebc2cb4c2923003470b1662785c9](https://www.virustotal.com/gui/file/83a1ebc2cb4c2923003470b1662785c9)|Win32 EXE||2016-11-18 05:24:19|Win10Shell.exe| |[205dcaeb61b90c89a2f27de2b9c8b531](https://www.virustotal.com/gui/file/205dcaeb61b90c89a2f27de2b9c8b531)|Win32 EXE||2016-11-18 05:22:32|205dcaeb61b90c89a2f27de2b9c8b531.virus| |[1aeea730e836f9ae71f2d252d8621f97](https://www.virustotal.com/gui/file/1aeea730e836f9ae71f2d252d8621f97)|Win32 EXE|adoc|2016-11-17 10:01:42|ITM1| |[401f2ad5d53e8b387e43801a0353508a](https://www.virustotal.com/gui/file/401f2ad5d53e8b387e43801a0353508a)|Win32 EXE||2016-11-17 10:00:52|Jawwal- New Every Day - Hamla جوال -حملة كل يوم جديد.jpg.exe| |[d0e2dd20690262b4e468739dff8ffd36](https://www.virustotal.com/gui/file/d0e2dd20690262b4e468739dff8ffd36)|Win32 EXE||2016-11-16 21:30:17|Loader.exe| |[19aa2acda92b14c79acb181ca7796bd0](https://www.virustotal.com/gui/file/19aa2acda92b14c79acb181ca7796bd0)|Win32 EXE|MSILPerseus|2016-11-16 14:19:09|Loader.exe| |[8c9053a747cd508d499f5277ae7f33f9](https://www.virustotal.com/gui/file/8c9053a747cd508d499f5277ae7f33f9)|Win32 EXE|Delf|2016-11-14 16:41:23|xxxx.exe| |[84e2d5d5ebcddeec32c6538b121d8301](https://www.virustotal.com/gui/file/84e2d5d5ebcddeec32c6538b121d8301)|Win32 EXE|BestaFera|2016-11-14 14:56:04|Virus.exe| |[ddc685e809af307eecd84454ff8c588d](https://www.virustotal.com/gui/file/ddc685e809af307eecd84454ff8c588d)|Win32 EXE|BestaFera|2016-11-14 08:56:24| | |[86366fc738db6033ae8d56570be9b7b4](https://www.virustotal.com/gui/file/86366fc738db6033ae8d56570be9b7b4)|Win32 EXE|strictor|2016-11-14 08:55:46|Donald-Trump-impersonator-hits-with-bikini-clad-models -hot models.mp4.exe| |[927d544fe71cdd65acf3148acebc30c2](https://www.virustotal.com/gui/file/927d544fe71cdd65acf3148acebc30c2)|Win32 EXE|BestaFera|2016-11-13 11:25:13|drop.exe| |[9e95bd742995e58f27fa4513db92a4c0](https://www.virustotal.com/gui/file/9e95bd742995e58f27fa4513db92a4c0)|Android||2016-11-13 09:10:03|index.html?md5=9e95bd742995e58f27fa4513db92a4c0%0D| |[78b65852b20fbf2a6b2319a1746b6d80](https://www.virustotal.com/gui/file/78b65852b20fbf2a6b2319a1746b6d80)|Win32 EXE|msilperseus|2016-11-09 03:50:10|Loader.exe| |[978f1d1051e5bd0b691e7007c3a742db](https://www.virustotal.com/gui/file/978f1d1051e5bd0b691e7007c3a742db)|Win32 EXE|strictor|2016-11-08 13:54:54|MX Update| |[775c128456a53dec85305a1e78ed5edf](https://www.virustotal.com/gui/file/775c128456a53dec85305a1e78ed5edf)|Win32 EXE|strictor|2016-11-06 21:11:44|MX Update| |[7fae6a64cde709261e488e96da7eb52c](https://www.virustotal.com/gui/file/7fae6a64cde709261e488e96da7eb52c)|Android|androidos|2016-11-06 13:25:58|7fae6a64cde709261e488e96da7eb52c.virus| |[1a602a60afe163a1cf4dae1f82d39e4d](https://www.virustotal.com/gui/file/1a602a60afe163a1cf4dae1f82d39e4d)|Android||2016-11-06 06:46:38|com.app.privatepic.apk| |[e3113604b6e0287648d42cc7051bbec5](https://www.virustotal.com/gui/file/e3113604b6e0287648d42cc7051bbec5)|Win32 EXE|strictor|2016-11-04 02:35:47|MX Update| |[9bf0f6192d7d92191135ec73ec460c9e](https://www.virustotal.com/gui/file/9bf0f6192d7d92191135ec73ec460c9e)|ZIP|msilperseus|2016-11-04 00:23:20|downloadfile_____________.zip| |[240105a1510f6e4f5c40a64c98971bac](https://www.virustotal.com/gui/file/240105a1510f6e4f5c40a64c98971bac)|Win32 EXE|MSILPerseus|2016-11-03 16:00:13|Loader.exe| |[41799f40626f26d8337a7724ef3d1938](https://www.virustotal.com/gui/file/41799f40626f26d8337a7724ef3d1938)|Win32 EXE|msilperseus|2016-11-03 15:16:56|Loader.exe| |[258e8336628e8f6f4dffbbfd3967d64e](https://www.virustotal.com/gui/file/258e8336628e8f6f4dffbbfd3967d64e)|ZIP|msilperseus|2016-11-03 13:22:32|/home/virustotal/sample/258E8336628E8F6F4DFFBBFD3967D64E| |[ee8e6929c64c32bd1a86ea8c50802a09](https://www.virustotal.com/gui/file/ee8e6929c64c32bd1a86ea8c50802a09)|Win32 EXE||2016-10-29 17:37:47|Loader.exe| |[0e069bd6cb62731473822334a2c15353](https://www.virustotal.com/gui/file/0e069bd6cb62731473822334a2c15353)|Win32 EXE|msilperseus|2016-10-29 17:27:44|Loader.exe| |[9075d79f9fec1df5689cca2218d406cd](https://www.virustotal.com/gui/file/9075d79f9fec1df5689cca2218d406cd)|Win32 EXE|msilperseus|2016-10-29 17:16:17|Loader.exe| |[ee017b839131d5ee7891e1dd7b163d84](https://www.virustotal.com/gui/file/ee017b839131d5ee7891e1dd7b163d84)|Android||2016-10-28 17:00:41|207274577| |[cf89ffc87287673727f57c307a2f329d](https://www.virustotal.com/gui/file/cf89ffc87287673727f57c307a2f329d)|Android||2016-10-27 10:38:34|cf89ffc87287673727f57c307a2f329d.virus| |[5cfc132b66f523b1ce907d9aea1ea199](https://www.virustotal.com/gui/file/5cfc132b66f523b1ce907d9aea1ea199)|Android||2016-10-26 20:25:25|com.app.privatepic.apk| |[a3c4effb16ac5710d5099d260220b488](https://www.virustotal.com/gui/file/a3c4effb16ac5710d5099d260220b488)|Win32 EXE|BestaFera|2016-10-24 15:51:32|ITM1| |[d91e3a1beb5a523a7cbdcb46edfe6d76](https://www.virustotal.com/gui/file/d91e3a1beb5a523a7cbdcb46edfe6d76)|Win32 EXE|BestaFera|2016-10-24 15:50:49|2.exe| |[968c1eb13bb073e376f6c3c4e71640be](https://www.virustotal.com/gui/file/968c1eb13bb073e376f6c3c4e71640be)|Android||2016-10-23 08:17:54|com.app.privatepic.apk| |[1e369cf9d270464352e1cec6e55b56f7](https://www.virustotal.com/gui/file/1e369cf9d270464352e1cec6e55b56f7)|Android|androidos|2016-10-21 14:34:29|1e369cf9d270464352e1cec6e55b56f7.virus| |[0414afcf37f60c63c280698c840a612d](https://www.virustotal.com/gui/file/0414afcf37f60c63c280698c840a612d)|Android||2016-10-21 14:27:28| | |[68f3417ccabef6cf6ce3ab9e299e681e](https://www.virustotal.com/gui/file/68f3417ccabef6cf6ce3ab9e299e681e)|Android||2016-10-20 15:15:29| | |[f9155cabbdccc70f5ac86e754986c0a7](https://www.virustotal.com/gui/file/f9155cabbdccc70f5ac86e754986c0a7)|Win32 EXE|Delf|2016-10-19 05:25:41|f9155cabbdccc70f5ac86e754986c0a7.virus| |[ca24f2ff1b3a93215f30f499f6dfcc9a](https://www.virustotal.com/gui/file/ca24f2ff1b3a93215f30f499f6dfcc9a)|Win32 EXE|BestaFera|2016-10-13 04:41:16|ITM1| |[78771eafed8984e240a85e98e97c97e8](https://www.virustotal.com/gui/file/78771eafed8984e240a85e98e97c97e8)|Win32 EXE|BestaFera|2016-10-13 04:40:33|78771eafed8984e240a85e98e97c97e8.virus| |[c1b94ee243c5de0b58d6295a8d054db2](https://www.virustotal.com/gui/file/c1b94ee243c5de0b58d6295a8d054db2)|RAR|BestaFera|2016-10-11 06:58:56|quds.rar| |[ec3186de5be92eff578c20b7c572f7a3](https://www.virustotal.com/gui/file/ec3186de5be92eff578c20b7c572f7a3)|Win32 EXE|msilperseus|2016-10-10 09:05:45|Loader.exe| |[79902094e6d5b7fa06a31e99841d0a71](https://www.virustotal.com/gui/file/79902094e6d5b7fa06a31e99841d0a71)|Win32 EXE||2016-10-09 09:55:50|System Settings Broker| |[f57f7736e4b4cb05d9bbb20660947d6d](https://www.virustotal.com/gui/file/f57f7736e4b4cb05d9bbb20660947d6d)|Win32 EXE||2016-10-08 12:00:56|Loader.exe| |[19a234422f6f1c21906121ad5878e480](https://www.virustotal.com/gui/file/19a234422f6f1c21906121ad5878e480)|Win32 EXE|MSILPerseus|2016-10-07 10:37:14|Loader.exe| |[88afd6bbd9f35b3c1c49b667250b95f8](https://www.virustotal.com/gui/file/88afd6bbd9f35b3c1c49b667250b95f8)|Win32 EXE||2016-10-07 10:02:31|Loader.exe| |[6a5c4d9a83135b745a8714f22f694c9a](https://www.virustotal.com/gui/file/6a5c4d9a83135b745a8714f22f694c9a)|Win32 EXE|kasperagent|2016-10-06 13:53:03| | |[fe23fa6df4d8fb500859f0f76e92552d](https://www.virustotal.com/gui/file/fe23fa6df4d8fb500859f0f76e92552d)|Win32 EXE|MSILPerseus|2016-10-06 13:53:01|Loader.exe| |[e4d0049e5fef02c013b22fd9f5018272](https://www.virustotal.com/gui/file/e4d0049e5fef02c013b22fd9f5018272)|Win32 EXE|MSILPerseus|2016-10-06 02:05:18|Loader.exe| |[5c0e7ab56cdfb0a4dbf0f455e9233fed](https://www.virustotal.com/gui/file/5c0e7ab56cdfb0a4dbf0f455e9233fed)|Win32 EXE|kasperagent|2016-10-03 15:49:41| | |[96d5c2a040fac48ce80d8a435c577d70](https://www.virustotal.com/gui/file/96d5c2a040fac48ce80d8a435c577d70)|Win32 EXE||2016-10-03 04:06:11| | |[1c2ad73d6b74bcb24081ce56fb8c679f](https://www.virustotal.com/gui/file/1c2ad73d6b74bcb24081ce56fb8c679f)|Win32 EXE||2016-10-03 04:03:30|khaliji.exe| |[2c8216106a32319ea6e3634583f317a7](https://www.virustotal.com/gui/file/2c8216106a32319ea6e3634583f317a7)|Win32 EXE||2016-10-02 21:56:08|khaliji.exe| |[5731692c40e4836462280ece7bc0f7de](https://www.virustotal.com/gui/file/5731692c40e4836462280ece7bc0f7de)|Win32 EXE|MSILPerseus|2016-10-02 10:10:54|Loader.exe| |[da22659738065a611a9a491a2332ed6a](https://www.virustotal.com/gui/file/da22659738065a611a9a491a2332ed6a)|Android||2016-09-29 06:00:25|C:\Users\Target\Desktop\lv-chat.apk| |[acc903afe22dcf0eb5f046dcd8db41c1](https://www.virustotal.com/gui/file/acc903afe22dcf0eb5f046dcd8db41c1)|Android||2016-09-28 10:42:31|secure_photos.apk| |[bd75af219f417413a4e0fae8cd89febd](https://www.virustotal.com/gui/file/bd75af219f417413a4e0fae8cd89febd)|Win32 EXE|Zbot|2016-09-27 09:18:33|22.exe| |[222880b8db346a91e05b72a31b8496f7](https://www.virustotal.com/gui/file/222880b8db346a91e05b72a31b8496f7)|Win32 EXE|Zbot|2016-09-27 09:16:48|1s1.exe| |[15605e6e3faa6750acb4f04fd224e78b](https://www.virustotal.com/gui/file/15605e6e3faa6750acb4f04fd224e78b)|Win32 EXE|kasperagent|2016-09-27 09:15:09|11.exe| |[9f4023f2aefc8c4c261bfdd4bd911952](https://www.virustotal.com/gui/file/9f4023f2aefc8c4c261bfdd4bd911952)|Win32 EXE|kasperagent|2016-09-27 09:13:52|2223.exe| |[058769ba93223bede0ba601926693ddc](https://www.virustotal.com/gui/file/058769ba93223bede0ba601926693ddc)|Win32 EXE|kasperagent|2016-09-27 09:11:32|222.exe| |[07e47f06c5ed05a062e674f8d11b01d8](https://www.virustotal.com/gui/file/07e47f06c5ed05a062e674f8d11b01d8)|Win32 EXE|Zbot|2016-09-27 09:06:36|taskwin.exe| |[2fd3fda18ed858c5e51e424ebbad94c0](https://www.virustotal.com/gui/file/2fd3fda18ed858c5e51e424ebbad94c0)|Win32 EXE||2016-09-27 07:53:35|Loader.exe| |[d0d9d6d74f9405cdc924760e3d460d84](https://www.virustotal.com/gui/file/d0d9d6d74f9405cdc924760e3d460d84)|Win32 EXE|Delf|2016-09-22 08:21:40|d0d9d6d74f9405cdc924760e3d460d84.virus| |[882cab29144e1cb9e0512b8f1103b2da](https://www.virustotal.com/gui/file/882cab29144e1cb9e0512b8f1103b2da)|Win32 EXE||2016-08-31 16:47:43|882cab29144e1cb9e0512b8f1103b2da.virus| |[71d505e3abfecd86cf76bb854e60a813](https://www.virustotal.com/gui/file/71d505e3abfecd86cf76bb854e60a813)|Win32 EXE||2016-08-30 01:12:19|khaliji.exe| |[83937cd798833e7bb504ded1cdbbfbfa](https://www.virustotal.com/gui/file/83937cd798833e7bb504ded1cdbbfbfa)|RAR||2016-08-29 21:46:29|khaliji.rar| |[abf252b04d689a2a5720530e6c0252b0](https://www.virustotal.com/gui/file/abf252b04d689a2a5720530e6c0252b0)|Win32 EXE||2016-08-29 17:12:40|487886_10152599711675287693822349087_25087648787392423999354_n.mp4.exe| |[0ff48807e2580d8ec1cc7fbcae2437da](https://www.virustotal.com/gui/file/0ff48807e2580d8ec1cc7fbcae2437da)|RAR||2016-08-29 13:46:04|0ff48807e2580d8ec1cc7fbcae2437da.virus| |[f0d7aee24f3a5108bcc8860ffeb10496](https://www.virustotal.com/gui/file/f0d7aee24f3a5108bcc8860ffeb10496)|Win32 EXE||2016-08-27 12:54:24|Tasreeb.exe| |[ec6c6334946cb48bb2fd646a1966edf9](https://www.virustotal.com/gui/file/ec6c6334946cb48bb2fd646a1966edf9)|Win32 EXE|dynamer|2016-08-27 12:54:15|ITM1| |[77d2289102b8155c3902d1bdf05508c2](https://www.virustotal.com/gui/file/77d2289102b8155c3902d1bdf05508c2)|RAR||2016-08-27 09:17:29|77d2289102b8155c3902d1bdf05508c2.virus| |[20ba6461306aba555c2db3e86e4f959b](https://www.virustotal.com/gui/file/20ba6461306aba555c2db3e86e4f959b)|Win32 EXE|kasperagent|2016-08-19 20:47:41|20ba6461306aba555c2db3e86e4f959b.virus| |[fcea715854365bc43a624f938d6edfcb](https://www.virustotal.com/gui/file/fcea715854365bc43a624f938d6edfcb)|Win32 EXE||2016-07-26 00:05:54|m:\x\40c5eaea273d0ab4f078fd5887b9fcfd2715faa2c4bfbda66ec3967d5058545a.exe| |[f7b0dbc09c3fbef3e0a287e84ca8cebd](https://www.virustotal.com/gui/file/f7b0dbc09c3fbef3e0a287e84ca8cebd)|Win32 EXE|Zbot|2016-07-14 20:37:01|f7b0dbc09c3fbef3e0a287e84ca8cebd.virus| |[cd38d10f4bc730b40be1f80b3034e31e](https://www.virustotal.com/gui/file/cd38d10f4bc730b40be1f80b3034e31e)|Win32 EXE||2016-07-14 18:05:52|/home/virustotal/sample/CD38D10F4BC730B40BE1F80B3034E31E| |[44cc31ab34deb9fb1d78b6b337043bc6](https://www.virustotal.com/gui/file/44cc31ab34deb9fb1d78b6b337043bc6)|Android|androidos|2016-07-13 20:04:58|44cc31ab34deb9fb1d78b6b337043bc6.virus| |[d665bfe8632b1b3194eb68d09237c58f](https://www.virustotal.com/gui/file/d665bfe8632b1b3194eb68d09237c58f)|Win32 EXE||2016-07-13 01:50:10|쨟 êŸ ïªã¤ Ÿéª‘í¤ åï ŸéãéŸç¡ Ÿé¥êïê¡ !.scr| |[f0dd2e20d2dbfeb9cf1bbd9dad0f3826](https://www.virustotal.com/gui/file/f0dd2e20d2dbfeb9cf1bbd9dad0f3826)|Win32 EXE||2016-07-12 05:12:16| | |[5bbb5604bc0f656545dfcbb09820d61a](https://www.virustotal.com/gui/file/5bbb5604bc0f656545dfcbb09820d61a)|Win32 EXE|Delf|2016-07-09 19:55:56|18d8d51e-b8e6-11e8-9965-ec9a744775ac| |[4299fbfe74f671ee2c36d71bc808437c](https://www.virustotal.com/gui/file/4299fbfe74f671ee2c36d71bc808437c)|Win32 EXE||2016-07-09 16:11:30|????? ????? 2016---??????--????----????---Palestine-Tawjehi-------.xsl.scr| |[c74703264e464ac0153157d8d257cb29](https://www.virustotal.com/gui/file/c74703264e464ac0153157d8d257cb29)|Android||2016-06-12 12:41:02|b0b9c140cc57b3e8f39e7323fbca0a2eef75335a| |[a44eac0c1a6e25c9d61dc33ef70b6978](https://www.virustotal.com/gui/file/a44eac0c1a6e25c9d61dc33ef70b6978)|Win32 EXE|kasperagent|2016-05-26 22:34:10|livePCsupport.exe| |[c945ef969a544b020c681ac25d591867](https://www.virustotal.com/gui/file/c945ef969a544b020c681ac25d591867)|Android|androidos|2016-05-25 21:35:10|c945ef969a544b020c681ac25d591867.virus| |[271c61699eb2a673b8543e9377ce7a0a](https://www.virustotal.com/gui/file/271c61699eb2a673b8543e9377ce7a0a)|Win32 EXE|kasperagent|2016-05-06 21:18:10|studio_photos.pdf .scr| |[a42cc1ed872160ee51eaae83d6d3027c](https://www.virustotal.com/gui/file/a42cc1ed872160ee51eaae83d6d3027c)|Win32 EXE|kasperagent|2016-05-06 21:18:05|2016030202.jpg .scr| |[9277c5bc50aa7a32f4c3dabe7ebb0b23](https://www.virustotal.com/gui/file/9277c5bc50aa7a32f4c3dabe7ebb0b23)|Win32 EXE|kasperagent|2016-05-06 21:18:03|2016030201.jpg .scr| |[72cc13ce73c357cab63d6ba491d2d7df](https://www.virustotal.com/gui/file/72cc13ce73c357cab63d6ba491d2d7df)|Win32 EXE|Zbot|2016-04-19 20:54:09|MkPlayer.exe| |[129c5c9ee71b9d46fcb9e789900c2394](https://www.virustotal.com/gui/file/129c5c9ee71b9d46fcb9e789900c2394)|Win32 EXE|kasperagent|2016-04-19 10:55:06|2016030201.jpg .scr| |[a99fbfe3001f579224467092ffb68a30](https://www.virustotal.com/gui/file/a99fbfe3001f579224467092ffb68a30)|Win32 EXE|kasperagent|2016-04-19 05:57:58|لماذا اقتحم السنوار منزل شتيوي.doc.scr| |[c4a2e6d6e7811352eb9102a0479a9265](https://www.virustotal.com/gui/file/c4a2e6d6e7811352eb9102a0479a9265)|Win32 EXE|Zbot|2016-04-18 03:16:26|c4a2e6d6e7811352eb9102a0479a9265.virus| |[1f1108963c01115b8baffb6535b36a5c](https://www.virustotal.com/gui/file/1f1108963c01115b8baffb6535b36a5c)|Win32 EXE|Zbot|2016-04-16 04:51:01| | |[30be94c1b6444deca5e1944cae7af009](https://www.virustotal.com/gui/file/30be94c1b6444deca5e1944cae7af009)|Win32 EXE|dynamer|2016-04-11 14:44:12|Wextract| |[90b4fbd59d799a9ea9410881d1a72e80](https://www.virustotal.com/gui/file/90b4fbd59d799a9ea9410881d1a72e80)|Win32 EXE|Zbot|2016-04-11 13:37:23|C:/Users/seongmin/Documents/VT2/malware/20170828/90b4fbd59d799a9ea9410881d1a72e80.vir| |[2663a331a4c0e0360b7c7834cf7d2138](https://www.virustotal.com/gui/file/2663a331a4c0e0360b7c7834cf7d2138)|Win32 EXE|Zbot|2016-04-11 11:13:08|Windows_Services_Update.exe| |[fe3f29aff51dc9673bc30f85c0005f64](https://www.virustotal.com/gui/file/fe3f29aff51dc9673bc30f85c0005f64)|Win32 EXE||2016-04-11 09:55:48|Wextract| |[4012afd54ecb4b4e01f524a9f1d11a09](https://www.virustotal.com/gui/file/4012afd54ecb4b4e01f524a9f1d11a09)|Win32 EXE||2016-04-11 07:10:16|AngelinaJolie15.scr| |[be99a259abdd09eaf5ccdf1ff4fd0a84](https://www.virustotal.com/gui/file/be99a259abdd09eaf5ccdf1ff4fd0a84)|Win32 EXE|Zbot|2016-04-10 23:11:09|Windows_Services_Update.exe| |[9e5cbd13cf51b95040fa1d4a8369b3df](https://www.virustotal.com/gui/file/9e5cbd13cf51b95040fa1d4a8369b3df)|Win32 EXE|Zbot|2016-04-10 20:56:50|Windows_Services_Update.exe| |[1dc2a1a323f6745d3bfd8ef12aea5c2c](https://www.virustotal.com/gui/file/1dc2a1a323f6745d3bfd8ef12aea5c2c)|Win32 EXE||2016-04-10 18:32:51|Wextract| |[69d1cceb045ff819111a624326340602](https://www.virustotal.com/gui/file/69d1cceb045ff819111a624326340602)|Win32 EXE||2016-04-10 15:09:20|Wextract| |[09e3f6439205672bb41911b20f685305](https://www.virustotal.com/gui/file/09e3f6439205672bb41911b20f685305)|Win32 EXE||2016-04-10 11:18:51|AngelinaJolie12.scr| |[3b909498cf8f87767c7c0437ba5214d3](https://www.virustotal.com/gui/file/3b909498cf8f87767c7c0437ba5214d3)|Win32 EXE||2016-04-10 07:37:09|AngelinaJolie17.scr| |[30265105f1efc626e0b6eab9e5ba4292](https://www.virustotal.com/gui/file/30265105f1efc626e0b6eab9e5ba4292)|Win32 EXE||2016-04-07 20:41:46|30265105f1efc626e0b6eab9e5ba4292.virus| |[877b69d3a4a1107bed3de216d63097e1](https://www.virustotal.com/gui/file/877b69d3a4a1107bed3de216d63097e1)|Win32 EXE|Zbot|2016-04-02 08:51:27|WindowsUpdateService.exe| |[0513cc7750a207fdb62b2ecf655a32bc](https://www.virustotal.com/gui/file/0513cc7750a207fdb62b2ecf655a32bc)|Win64 EXE||2016-04-02 08:35:16|Wextract| |[bf1c8ff4541075312d7c2eef667510e4](https://www.virustotal.com/gui/file/bf1c8ff4541075312d7c2eef667510e4)|Win64 EXE|Zbot|2016-03-30 02:33:58|Wextract| |[7af2778d0c5d2b01ebbb928cdd2c4579](https://www.virustotal.com/gui/file/7af2778d0c5d2b01ebbb928cdd2c4579)|Win32 EXE||2016-03-30 02:28:47|Nicole010.scr| |[c8df50c71ef03450ed3b65b773266185](https://www.virustotal.com/gui/file/c8df50c71ef03450ed3b65b773266185)|Win32 EXE|Zbot|2016-03-30 02:10:42|Windows_Service_Update.exe| |[a2ed15750fb200a5e158adf3930da99a](https://www.virustotal.com/gui/file/a2ed15750fb200a5e158adf3930da99a)|Win32 EXE|Zbot|2016-03-29 17:30:54|MkPlayer.exe| |[b6c65ddb88b9ebf4e5de37d802daa61b](https://www.virustotal.com/gui/file/b6c65ddb88b9ebf4e5de37d802daa61b)|Win32 EXE|Zbot|2016-03-23 15:46:30| | |[3b3e19eb59b1c0e0f1849a9c94ce87c7](https://www.virustotal.com/gui/file/3b3e19eb59b1c0e0f1849a9c94ce87c7)|Win32 EXE|Zbot|2016-03-21 09:21:54|Windows_Service_Update.exe| |[f8f5b9d839be111797336f095c5155e1](https://www.virustotal.com/gui/file/f8f5b9d839be111797336f095c5155e1)|Win64 EXE||2016-03-21 09:05:23|Wextract| |[7472cec8eff3d46a95c6446cee42664a](https://www.virustotal.com/gui/file/7472cec8eff3d46a95c6446cee42664a)|Win32 EXE||2016-03-21 08:48:48|Nicole Kidman.scr| |[5ae2b492adabd26f8993eb7882f3e0d4](https://www.virustotal.com/gui/file/5ae2b492adabd26f8993eb7882f3e0d4)|Win32 EXE|Zbot|2016-03-20 08:31:53|WindowsUpdateService.exe| |[650ea6fafd903eb1f733f6969ce285db](https://www.virustotal.com/gui/file/650ea6fafd903eb1f733f6969ce285db)|Win64 EXE|Zbot|2016-03-20 08:15:08|Wextract| |[2c74dfe9b135414b26a16b1da524212a](https://www.virustotal.com/gui/file/2c74dfe9b135414b26a16b1da524212a)|Win32 EXE|dynamer|2016-03-20 07:59:00|Love04.scr| |[d97819d9bcfd51df406a105c73abe943](https://www.virustotal.com/gui/file/d97819d9bcfd51df406a105c73abe943)|Win32 EXE|Zbot|2016-03-18 06:34:34|WindowsUpdateService.exe| |[6f42e0522b807d2b90aaf050a7be7f44](https://www.virustotal.com/gui/file/6f42e0522b807d2b90aaf050a7be7f44)|Win64 EXE|Zbot|2016-03-17 22:09:05|Wextract| |[55dc61056837ec8829c0f3c8e85cb7b3](https://www.virustotal.com/gui/file/55dc61056837ec8829c0f3c8e85cb7b3)|Win32 EXE|starter|2016-03-17 12:17:44|Love06.scr| |[bcfaa94b32794cb15f2f2ee94e62f8fb](https://www.virustotal.com/gui/file/bcfaa94b32794cb15f2f2ee94e62f8fb)|Win32 EXE|Zbot|2016-02-21 16:36:15|VLC.exe| |[11d5c0f9ac173d39d56df971eb39871c](https://www.virustotal.com/gui/file/11d5c0f9ac173d39d56df971eb39871c)|Win32 EXE|kasperagent|2016-02-21 07:55:41|21طلقة تواجه مصر.doc.scr| |[a43786be4753a8c334fe1a56c6c3cde4](https://www.virustotal.com/gui/file/a43786be4753a8c334fe1a56c6c3cde4)|Win32 EXE|strictor|2016-02-17 17:08:37|VLC.exe| |[c6e91b8e890acc9a7d229e25eddd5456](https://www.virustotal.com/gui/file/c6e91b8e890acc9a7d229e25eddd5456)|Win32 EXE|kasperagent|2016-02-15 09:47:38|c6e91b8e890acc9a7d229e25eddd5456.virus| |[a62df9622812975e8286406e4becaf11](https://www.virustotal.com/gui/file/a62df9622812975e8286406e4becaf11)|Win32 EXE|Zbot|2016-02-14 17:52:47|MKplayer.exe| |[c16ec71e62918453ebc2682ae3181bda](https://www.virustotal.com/gui/file/c16ec71e62918453ebc2682ae3181bda)|Win32 EXE||2015-10-21 13:30:19|DATA.scr| |[7ada27b89b68bf294f547ed64b45ebc0](https://www.virustotal.com/gui/file/7ada27b89b68bf294f547ed64b45ebc0)|Win32 EXE|kasperagent|2015-10-21 13:30:18|N.M.A.scr| |[121e39a5b83376b5e1dc3d3262bffafa](https://www.virustotal.com/gui/file/121e39a5b83376b5e1dc3d3262bffafa)|Win32 EXE|Zbot|2015-10-12 19:25:10|Faces of love Explicit video mp4.scr| |[f63c43dbaf805c9321ec61ea64d70781](https://www.virustotal.com/gui/file/f63c43dbaf805c9321ec61ea64d70781)|Win32 EXE||2015-10-12 12:35:32|VLC media player.exe| |[558f4c4f0b03d00625f551e943fb4e11](https://www.virustotal.com/gui/file/558f4c4f0b03d00625f551e943fb4e11)|Win32 EXE|Zbot|2015-10-11 14:48:33|happy-pirthdy.scr| |[bff8b8c7d07d31c281b504d095ef8de1](https://www.virustotal.com/gui/file/bff8b8c7d07d31c281b504d095ef8de1)|Win32 EXE|Zbot|2015-10-08 16:03:24|doniaaa.scr| |[dc59cd0ed1aba2692bad6dfe13bbf8b2](https://www.virustotal.com/gui/file/dc59cd0ed1aba2692bad6dfe13bbf8b2)|Win32 EXE|Zbot|2015-10-08 16:03:22|suzzzan.scr| |[1e4d141f50380c3dd83885e00081a2f8](https://www.virustotal.com/gui/file/1e4d141f50380c3dd83885e00081a2f8)|Win32 EXE|kasperagent|2015-10-08 14:16:05|heeend.scr| |[86ea790bee92bf054a245d07a3bfa02c](https://www.virustotal.com/gui/file/86ea790bee92bf054a245d07a3bfa02c)|Win32 EXE|kasperagent|2015-10-08 11:40:26|myfile.exe| |[aa565dabb57563bb9c1310bd239c18cc](https://www.virustotal.com/gui/file/aa565dabb57563bb9c1310bd239c18cc)|Win32 EXE|Zbot|2015-10-08 11:36:43|Donea Amjd Video mp4.scr| |[b607580b0c5f463d7ac54fc500a4f298](https://www.virustotal.com/gui/file/b607580b0c5f463d7ac54fc500a4f298)|Win32 EXE|Zbot|2015-10-08 11:36:42|Suzan Batheesh Video mp4?.scr| |[721ae60bbc28c8992f1476b393ee5210](https://www.virustotal.com/gui/file/721ae60bbc28c8992f1476b393ee5210)|Win32 EXE|Zbot|2015-10-07 20:33:54|DE2.exe| |[c01b725e0cb4ea76cc9d70ef2301622f](https://www.virustotal.com/gui/file/c01b725e0cb4ea76cc9d70ef2301622f)|Win32 EXE|kasperagent|2015-08-18 07:58:08|????? ???? .scr| |[0b0d561d832e7382d9b6b73aada91a96](https://www.virustotal.com/gui/file/0b0d561d832e7382d9b6b73aada91a96)|Win32 EXE|kasperagent|2015-08-17 15:03:06|___.doc| |[d1f1a0c736e5f7867802aa7fbba9f35f](https://www.virustotal.com/gui/file/d1f1a0c736e5f7867802aa7fbba9f35f)|Win32 EXE||2015-08-14 14:39:42| | |[fc8cb7e39d5b54740f0cf3d44e3de5e1](https://www.virustotal.com/gui/file/fc8cb7e39d5b54740f0cf3d44e3de5e1)|Win32 EXE||2015-08-13 03:31:49|skype.exe| |[03b14dff4714e11e6cfa5f78d976a432](https://www.virustotal.com/gui/file/03b14dff4714e11e6cfa5f78d976a432)|Win32 EXE||2015-08-12 03:22:31|myfile.exe| |[52b32d172579640474a4537744fc522e](https://www.virustotal.com/gui/file/52b32d172579640474a4537744fc522e)|Win32 EXE|kasperagent|2015-08-10 07:19:45|????? ???? ????????? .scr| |[f1105cb2d34b0b98f8298584c11f66dc](https://www.virustotal.com/gui/file/f1105cb2d34b0b98f8298584c11f66dc)|Win32 EXE|kasperagent|2015-08-09 09:25:30|قواعد هامة للمجاهدين .scr| |[440bb797002b2cae03987f7395405795](https://www.virustotal.com/gui/file/440bb797002b2cae03987f7395405795)|Win32 EXE|kasperagent|2015-08-09 09:21:08|jsx.exe| |[8a574181ed2efe4c2b02efd9a4ac0ece](https://www.virustotal.com/gui/file/8a574181ed2efe4c2b02efd9a4ac0ece)|Win32 EXE|kasperagent|2015-08-06 15:49:37|N.exe| |[34ffb9375de5fb2e5d976316000e561d](https://www.virustotal.com/gui/file/34ffb9375de5fb2e5d976316000e561d)|Android|androidos|2010-08-16 07:49:58|E:\whiteset_benny\brut.googlemaps_f61b10e24cf228f1dc6fae34db749beb901d6c86| |[0b6775113343412fcd75d8b35d2c1520](https://www.virustotal.com/gui/file/0b6775113343412fcd75d8b35d2c1520)|Android||2020-03-04 11:41:19|New_Mygram_IM.apk| |[0b6775113343412fcd75d8b35d2c1520](https://www.virustotal.com/gui/file/0b6775113343412fcd75d8b35d2c1520)|Android||2020-03-04 11:41:19|New_Mygram_IM.apk|
{ "pile_set_name": "Github" }
using System; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin; using Microsoft.Owin.Security.Cookies; using Microsoft.Owin.Security.Google; using Owin; using ATMDashboard.Models; namespace ATMDashboard { public partial class Startup { // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864 public void ConfigureAuth(IAppBuilder app) { // Configure the db context, user manager and signin manager to use a single instance per request app.CreatePerOwinContext(ApplicationDbContext.Create); app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create); app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create); // Enable the application to use a cookie to store information for the signed in user // and to use a cookie to temporarily store information about a user logging in with a third party login provider // Configure the sign in cookie app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/Account/Login"), Provider = new CookieAuthenticationProvider { // Enables the application to validate the security stamp when the user logs in. // This is a security feature which is used when you change a password or add an external login to your account. OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>( validateInterval: TimeSpan.FromMinutes(30), regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager)) } }); app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); // Enables the application to temporarily store user information when they are verifying the second factor in the two-factor authentication process. app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5)); // Enables the application to remember the second login verification factor such as phone or email. // Once you check this option, your second step of verification during the login process will be remembered on the device where you logged in from. // This is similar to the RememberMe option when you log in. app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie); // Uncomment the following lines to enable logging in with third party login providers //app.UseMicrosoftAccountAuthentication( // clientId: "", // clientSecret: ""); //app.UseTwitterAuthentication( // consumerKey: "", // consumerSecret: ""); //app.UseFacebookAuthentication( // appId: "", // appSecret: ""); //app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions() //{ // ClientId = "", // ClientSecret = "" //}); } } }
{ "pile_set_name": "Github" }
require 'lifx/observable' require 'lifx/timers' module LIFX # @api private # @private class GatewayConnection # GatewayConnection handles the UDP and TCP connections to the gateway # A GatewayConnection is created when a new device sends a StatePanGateway include Timers include Logging include Observable MAX_TCP_ATTEMPTS = 3 def initialize @threads = [] @tcp_attempts = 0 @threads << initialize_write_queue end def handle_message(message, ip, transport) payload = message.payload case payload when Protocol::Device::StatePanGateway if use_udp? && !udp_connected? && payload.service == Protocol::Device::Service::UDP # UDP transport here is only for sending directly to bulb # We receive responses via UDP transport listening to broadcast in Network connect_udp(ip, payload.port.to_i) elsif use_tcp? && !tcp_connected? && payload.service == Protocol::Device::Service::TCP && (port = payload.port.snapshot) > 0 connect_tcp(ip, port) end else logger.error("#{self}: Unhandled message: #{message}") end end def use_udp? Config.allowed_transports.include?(:udp) end def use_tcp? Config.allowed_transports.include?(:tcp) end def udp_connected? @udp_transport && @udp_transport.connected? end def tcp_connected? @tcp_transport && @tcp_transport.connected? end def connected? udp_connected? || tcp_connected? end def connect_udp(ip, port) @udp_transport = Transport::UDP.new(ip, port) end def connect_tcp(ip, port) if @tcp_attempts > MAX_TCP_ATTEMPTS logger.info("#{self}: Ignoring TCP service of #{ip}:#{port} due to too many failed attempts.") return end @tcp_attempts += 1 logger.info("#{self}: Establishing connection to #{ip}:#{port}") @tcp_transport = Transport::TCP.new(ip, port) @tcp_transport.add_observer(self, :message_received) do |message: nil, ip: nil, transport: nil| notify_observers(:message_received, message: message, ip: ip, transport: @tcp_transport) end @tcp_transport.listen end def write(message) @queue.push(message) end def close @threads.each do |thr| thr.abort end [@tcp_transport, @udp_transport].compact.each(&:close) end def flush(timeout: nil) proc = lambda do while !@queue.empty? sleep 0.05 end end if timeout Timeout.timeout(timeout, TimeoutError) do proc.call end else proc.call end end def to_s "#<LIFX::GatewayConnection tcp=#{@tcp_transport} tcp_attempts=#{@tcp_attempts} udp=#{@udp_transport}>" end alias_method :inspect, :to_s def set_message_rate(rate) @message_rate = rate end protected MAXIMUM_QUEUE_LENGTH = 10 DEFAULT_MESSAGE_RATE = 5 def message_rate @message_rate || DEFAULT_MESSAGE_RATE end def initialize_write_queue @queue = SizedQueue.new(MAXIMUM_QUEUE_LENGTH) @last_write = Time.now Thread.start do loop do if !connected? sleep 0.1 next end delay = [(1.0 / message_rate) - (Time.now - @last_write), 0].max logger.debug("#{self}: Sleeping for #{delay}") sleep(delay) message = @queue.pop if !message.is_a?(Message) raise ArgumentError.new("Unexpected object in message queue: #{message.inspect}") end if !actually_write(message) logger.error("#{self}: Couldn't write, pushing back onto queue.") @queue << message end @last_write = Time.now end end end def check_connections if @tcp_transport && !tcp_connected? @tcp_transport = nil logger.info("#{self}: TCP connection dropped, clearing.") end if @udp_transport && !udp_connected? @udp_transport = nil logger.info("#{self}: UDP connection dropped, clearing.") end end def actually_write(message) check_connections # TODO: Support force sending over UDP if tcp_connected? if @tcp_transport.write(message) logger.debug("-> #{self} #{@tcp_transport}: #{message}") return true end end if udp_connected? if @udp_transport.write(message) logger.debug("-> #{self} #{@tcp_transport}: #{message}") return true end end false end def observer_callback_definition { message_received: -> (message: nil, ip: nil, transport: nil) {} } end end end
{ "pile_set_name": "Github" }
{ "name": "gladys-caldav", "main": "index.js", "os": [ "darwin", "linux", "win32" ], "cpu": [ "x64", "arm", "arm64" ], "scripts": {}, "dependencies": { "bluebird": "^3.7.0", "dav-request": "^1.8.0", "ical": "^0.6.0", "moment": "^2.24.0", "xmldom": "^0.1.27" } }
{ "pile_set_name": "Github" }
\input{regression-test.tex} \documentclass[degree=bachelor,fontset=fandol]{ustcthesis} \input{info.tex} \begin{document} \START \showoutput \maketitle \clearpage \end{document} \END
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <playground version='5.0' target-platform='ios'> <timeline fileName='timeline.xctimeline'/> </playground>
{ "pile_set_name": "Github" }
// Copyright 2014 The Bazel 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. package com.google.devtools.common.options; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; import com.google.common.base.Splitter; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.google.common.escape.Escaper; import java.text.BreakIterator; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.stream.Collectors; import java.util.stream.Stream; import javax.annotation.Nullable; /** A renderer for usage messages for any combination of options classes. */ class OptionsUsage { private static final Splitter NEWLINE_SPLITTER = Splitter.on('\n'); private static final Joiner COMMA_JOINER = Joiner.on(","); /** * Given an options class, render the usage string into the usage, which is passed in as an * argument. This will not include information about expansions for options using expansion * functions (it would be unsafe to report this as we cannot know what options from other {@link * OptionsBase} subclasses they depend on until a complete parser is constructed). */ static void getUsage(Class<? extends OptionsBase> optionsClass, StringBuilder usage) { OptionsData data = OptionsParser.getOptionsDataInternal(optionsClass); List<OptionDefinition> optionDefinitions = new ArrayList<>(OptionsData.getAllOptionDefinitionsForClass(optionsClass)); optionDefinitions.sort(OptionDefinition.BY_OPTION_NAME); for (OptionDefinition optionDefinition : optionDefinitions) { getUsage(optionDefinition, usage, OptionsParser.HelpVerbosity.LONG, data, false); } } /** * Paragraph-fill the specified input text, indenting lines to 'indent' and * wrapping lines at 'width'. Returns the formatted result. */ static String paragraphFill(String in, int indent, int width) { String indentString = Strings.repeat(" ", indent); StringBuilder out = new StringBuilder(); String sep = ""; for (String paragraph : NEWLINE_SPLITTER.split(in)) { // TODO(ccalvarin) break iterators expect hyphenated words to be line-breakable, which looks // funny for --flag BreakIterator boundary = BreakIterator.getLineInstance(); // (factory) boundary.setText(paragraph); out.append(sep).append(indentString); int cursor = indent; for (int start = boundary.first(), end = boundary.next(); end != BreakIterator.DONE; start = end, end = boundary.next()) { String word = paragraph.substring(start, end); // (may include trailing space) if (word.length() + cursor > width) { out.append('\n').append(indentString); cursor = indent; } out.append(word); cursor += word.length(); } sep = "\n"; } return out.toString(); } /** * Returns the expansion for an option, if any, regardless of if the expansion is from a function * or is statically declared in the annotation. */ private static @Nullable ImmutableList<String> getExpansionIfKnown( OptionDefinition optionDefinition, OptionsData optionsData) { Preconditions.checkNotNull(optionDefinition); return optionsData.getEvaluatedExpansion(optionDefinition); } // Placeholder tag "UNKNOWN" is ignored. private static boolean shouldEffectTagBeListed(OptionEffectTag effectTag) { return !effectTag.equals(OptionEffectTag.UNKNOWN); } // Tags that only apply to undocumented options are excluded. private static boolean shouldMetadataTagBeListed(OptionMetadataTag metadataTag) { return !metadataTag.equals(OptionMetadataTag.HIDDEN) && !metadataTag.equals(OptionMetadataTag.INTERNAL); } /** Appends the usage message for a single option-field message to 'usage'. */ static void getUsage( OptionDefinition optionDefinition, StringBuilder usage, OptionsParser.HelpVerbosity helpVerbosity, OptionsData optionsData, boolean includeTags) { String flagName = getFlagName(optionDefinition); String typeDescription = getTypeDescription(optionDefinition); usage.append(" --").append(flagName); if (helpVerbosity == OptionsParser.HelpVerbosity.SHORT) { usage.append('\n'); return; } // Add the option's type and default information. Stop there for "medium" verbosity. if (optionDefinition.getAbbreviation() != '\0') { usage.append(" [-").append(optionDefinition.getAbbreviation()).append(']'); } if (!typeDescription.equals("")) { usage.append(" (").append(typeDescription).append("; "); if (optionDefinition.allowsMultiple()) { usage.append("may be used multiple times"); } else { // Don't call the annotation directly (we must allow overrides to certain defaults) String defaultValueString = optionDefinition.getUnparsedDefaultValue(); if (optionDefinition.isSpecialNullDefault()) { usage.append("default: see description"); } else { usage.append("default: \"").append(defaultValueString).append("\""); } } usage.append(")"); } usage.append("\n"); if (helpVerbosity == OptionsParser.HelpVerbosity.MEDIUM) { return; } // For verbosity "long," add the full description and expansion, along with the tag // information if requested. if (!optionDefinition.getHelpText().isEmpty()) { usage.append(paragraphFill(optionDefinition.getHelpText(), /*indent=*/ 4, /*width=*/ 80)); usage.append('\n'); } ImmutableList<String> expansion = getExpansionIfKnown(optionDefinition, optionsData); if (expansion == null) { usage.append(paragraphFill("Expands to unknown options.", /*indent=*/ 6, /*width=*/ 80)); usage.append('\n'); } else if (!expansion.isEmpty()) { StringBuilder expandsMsg = new StringBuilder("Expands to: "); for (String exp : expansion) { expandsMsg.append(exp).append(" "); } usage.append(paragraphFill(expandsMsg.toString(), /*indent=*/ 6, /*width=*/ 80)); usage.append('\n'); } if (optionDefinition.hasImplicitRequirements()) { StringBuilder requiredMsg = new StringBuilder("Using this option will also add: "); for (String req : optionDefinition.getImplicitRequirements()) { requiredMsg.append(req).append(" "); } usage.append(paragraphFill(requiredMsg.toString(), 6, 80)); // (indent, width) usage.append('\n'); } if (!includeTags) { return; } // If we are expected to include the tags, add them for high verbosity. Stream<OptionEffectTag> effectTagStream = Arrays.stream(optionDefinition.getOptionEffectTags()) .filter(OptionsUsage::shouldEffectTagBeListed); Stream<OptionMetadataTag> metadataTagStream = Arrays.stream(optionDefinition.getOptionMetadataTags()) .filter(OptionsUsage::shouldMetadataTagBeListed); String tagList = Stream.concat(effectTagStream, metadataTagStream) .map(tag -> tag.toString().toLowerCase()) .collect(Collectors.joining(", ")); if (!tagList.isEmpty()) { usage.append(paragraphFill("Tags: " + tagList, 6, 80)); // (indent, width) usage.append("\n"); } } /** Append the usage message for a single option-field message to 'usage'. */ static void getUsageHtml( OptionDefinition optionDefinition, StringBuilder usage, Escaper escaper, OptionsData optionsData, boolean includeTags) { String plainFlagName = optionDefinition.getOptionName(); String flagName = getFlagName(optionDefinition); String valueDescription = optionDefinition.getValueTypeHelpText(); String typeDescription = getTypeDescription(optionDefinition); // String.format is a lot slower, sometimes up to 10x. // https://stackoverflow.com/questions/925423/is-it-better-practice-to-use-string-format-over-string-concatenation-in-java // // Considering that this runs for every flag in the CLI reference, it's better to use regular // appends here. usage // Add the id of the flag to point anchor hrefs to it .append("<dt id=\"flag--") .append(plainFlagName) .append("\">") // Add the href to the id hash .append("<code><a href=\"#flag--") .append(plainFlagName) .append("\">") .append("--") .append(flagName) .append("</a>"); if (optionDefinition.usesBooleanValueSyntax() || optionDefinition.isVoidField()) { // Nothing for boolean, tristate, boolean_or_enum, or void options. } else if (!valueDescription.isEmpty()) { usage.append("=").append(escaper.escape(valueDescription)); } else if (!typeDescription.isEmpty()) { // Generic fallback, which isn't very good. usage.append("=&lt;").append(escaper.escape(typeDescription)).append("&gt"); } usage.append("</code>"); if (optionDefinition.getAbbreviation() != '\0') { usage.append(" [<code>-").append(optionDefinition.getAbbreviation()).append("</code>]"); } if (optionDefinition.allowsMultiple()) { // Allow-multiple options can't have a default value. usage.append(" multiple uses are accumulated"); } else { // Don't call the annotation directly (we must allow overrides to certain defaults). String defaultValueString = optionDefinition.getUnparsedDefaultValue(); if (optionDefinition.isVoidField()) { // Void options don't have a default. } else if (optionDefinition.isSpecialNullDefault()) { usage.append(" default: see description"); } else { usage.append(" default: \"").append(escaper.escape(defaultValueString)).append("\""); } } usage.append("</dt>\n"); usage.append("<dd>\n"); if (!optionDefinition.getHelpText().isEmpty()) { usage.append(escaper.escape(optionDefinition.getHelpText())); usage.append('\n'); } if (!optionsData.getEvaluatedExpansion(optionDefinition).isEmpty()) { // If this is an expansion option, list the expansion if known, or at least specify that we // don't know. usage.append("<br/>\n"); ImmutableList<String> expansion = getExpansionIfKnown(optionDefinition, optionsData); StringBuilder expandsMsg; if (expansion == null) { expandsMsg = new StringBuilder("Expands to unknown options.<br/>\n"); } else { Preconditions.checkArgument(!expansion.isEmpty()); expandsMsg = new StringBuilder("Expands to:<br/>\n"); for (String exp : expansion) { // TODO(jingwen): We link to the expanded flags here, but unfortunately we don't // currently guarantee that all flags are only printed once. A flag in an OptionBase that // is included by 2 different commands, but not inherited through a parent command, will // be printed multiple times. Clicking on the flag will bring the user to its first // definition. expandsMsg .append("&nbsp;&nbsp;") .append("<code><a href=\"#flag") // Link to the '#flag--flag_name' hash. // Some expansions are in the form of '--flag_name=value', so we drop everything from // '=' onwards. .append(Iterables.get(Splitter.on('=').split(escaper.escape(exp)), 0)) .append("\">") .append(escaper.escape(exp)) .append("</a></code><br/>\n"); } } usage.append(expandsMsg.toString()); } // Add effect tags, if not UNKNOWN, and metadata tags, if not empty. if (includeTags) { Stream<OptionEffectTag> effectTagStream = Arrays.stream(optionDefinition.getOptionEffectTags()) .filter(OptionsUsage::shouldEffectTagBeListed); Stream<OptionMetadataTag> metadataTagStream = Arrays.stream(optionDefinition.getOptionMetadataTags()) .filter(OptionsUsage::shouldMetadataTagBeListed); String tagList = Stream.concat( effectTagStream.map( tag -> String.format( "<a href=\"#effect_tag_%s\"><code>%s</code></a>", tag, tag.name().toLowerCase())), metadataTagStream.map( tag -> String.format( "<a href=\"#metadata_tag_%s\"><code>%s</code></a>", tag, tag.name().toLowerCase()))) .collect(Collectors.joining(", ")); if (!tagList.isEmpty()) { usage.append("<br>Tags: \n").append(tagList); } } usage.append("</dd>\n"); } /** * Returns the available completion for the given option field. The completions are the exact * command line option (with the prepending '--') that one should pass. It is suitable for * completion script to use. If the option expect an argument, the kind of argument is given * after the equals. If the kind is a enum, the various enum values are given inside an accolade * in a comma separated list. For other special kind, the type is given as a name (e.g., * <code>label</code>, <code>float</ode>, <code>path</code>...). Example outputs of this * function are for, respectively, a tristate flag <code>tristate_flag</code>, a enum * flag <code>enum_flag</code> which can take <code>value1</code>, <code>value2</code> and * <code>value3</code>, a path fragment flag <code>path_flag</code>, a string flag * <code>string_flag</code> and a void flag <code>void_flag</code>: * <pre> * --tristate_flag={auto,yes,no} * --notristate_flag * --enum_flag={value1,value2,value3} * --path_flag=path * --string_flag= * --void_flag * </pre> * * @param optionDefinition The field to return completion for * @param builder the string builder to store the completion values */ static void getCompletion(OptionDefinition optionDefinition, StringBuilder builder) { // Return the list of possible completions for this option String flagName = optionDefinition.getOptionName(); Class<?> fieldType = optionDefinition.getType(); builder.append("--").append(flagName); if (fieldType.equals(boolean.class)) { builder.append("\n"); builder.append("--no").append(flagName).append("\n"); } else if (fieldType.equals(TriState.class)) { builder.append("={auto,yes,no}\n"); builder.append("--no").append(flagName).append("\n"); } else if (fieldType.isEnum()) { builder .append("={") .append(COMMA_JOINER.join(fieldType.getEnumConstants()).toLowerCase(Locale.ENGLISH)) .append("}\n"); } else if (fieldType.getSimpleName().equals("Label")) { // String comparison so we don't introduce a dependency to com.google.devtools.build.lib. builder.append("=label\n"); } else if (fieldType.getSimpleName().equals("PathFragment")) { builder.append("=path\n"); } else if (Void.class.isAssignableFrom(fieldType)) { builder.append("\n"); } else { // TODO(bazel-team): add more types. Maybe even move the completion type // to the @Option annotation? builder.append("=\n"); } } private static String getTypeDescription(OptionDefinition optionsDefinition) { return optionsDefinition.getConverter().getTypeDescription(); } static String getFlagName(OptionDefinition optionDefinition) { String name = optionDefinition.getOptionName(); return optionDefinition.usesBooleanValueSyntax() ? "[no]" + name : name; } }
{ "pile_set_name": "Github" }
const stderrWrite = process.stderr._write; export function muteDeprecationWarning() { process.stderr._write = function(chunk, encoding, callback) { const regex = /DeprecationWarning: grpc.load:/; if (regex.test(chunk)) { callback(); } else { stderrWrite.apply(this, (arguments as unknown) as [ any, string, Function ]); } }; return function unmute() { process.stderr._write = stderrWrite; }; }
{ "pile_set_name": "Github" }
#pragma once namespace ai { class CastTimeMultiplier : public Multiplier { public: CastTimeMultiplier(PlayerbotAI* ai) : Multiplier(ai, "cast time") {} public: virtual float GetValue(Action* action); }; class CastTimeStrategy : public Strategy { public: CastTimeStrategy(PlayerbotAI* ai) : Strategy(ai) {} public: virtual void InitMultipliers(std::list<Multiplier*> &multipliers); virtual string getName() { return "cast time"; } }; }
{ "pile_set_name": "Github" }
<?xml version='1.0' encoding='utf-8'?> <section xmlns="https://code.dccouncil.us/schemas/dc-library" xmlns:codified="https://code.dccouncil.us/schemas/codified" xmlns:codify="https://code.dccouncil.us/schemas/codify" xmlns:xi="http://www.w3.org/2001/XInclude" containing-doc="D.C. Code"> <num>23-1322</num> <heading>Detention prior to trial.</heading> <para> <num>(a)</num> <text>The judicial officer shall order the detention of a person charged with an offense for a period of not more than 5 days, excluding Saturdays, Sundays, and holidays, and direct the attorney for the government to notify the appropriate court, probation or parole official, or local or state law enforcement official, if the judicial officer determines that the person charged with an offense:</text> <para> <num>(1)</num> <text>Was at the time the offense was committed, on:</text> <para> <num>(A)</num> <text>Release pending trial for a felony or misdemeanor under local, state, or federal law;</text> </para> <para> <num>(B)</num> <text>Release pending imposition or execution of sentence, appeal of sentence or conviction, or completion of sentence, for any offense under local, state, or federal law; or</text> </para> <para> <num>(C)</num> <text>Probation, parole or supervised release for an offense under local, state, or federal law; and</text> </para> </para> <para> <num>(2)</num> <text>May flee or pose a danger to any other person or the community or, when a hearing under <cite path="§23-1329|(b)">§ 23-1329(b)</cite> is requested, is likely to violate a condition of release. If the official fails or declines to take the person into custody during the 5-day period described in this subsection, the person shall be treated in accordance with other provisions of law governing release pending trial.</text> </para> </para> <para> <num>(b)</num> <para> <num>(1)</num> <text>The judicial officer shall hold a hearing to determine whether any condition or combination of conditions set forth in <cite path="§23-1321|(c)">§ 23-1321(c)</cite> will reasonably assure the appearance of the person as required and the safety of any other person and the community, upon oral motion of the attorney for the government, in a case that involves:</text> <para> <num>(A)</num> <text>A crime of violence, or a dangerous crime, as these terms are defined in <cite path="§23-1331">§ 23-1331</cite>;</text> </para> <para> <num>(B)</num> <text>An offense under section 502 of the District of Columbia Theft and White Collar Crimes Act of 1982, effective December 1, 1982 (<cite doc="D.C. Law 4-164">D.C. Law 4-164</cite>; D.C. Official Code <cite path="§22-722">§ 22-722</cite>);</text> </para> <para> <num>(C)</num> <text>A serious risk that the person will obstruct or attempt to obstruct justice, or threaten, injure, or intimidate, or attempt to threaten, injure, or intimidate a prospective witness or juror; or</text> </para> <para> <num>(D)</num> <text>A serious risk that the person will flee.</text> </para> </para> <para> <num>(2)</num> <text>If, after a hearing pursuant to the provision of subsection (d) of this section, the judicial officer finds by clear and convincing evidence that no condition or combination of conditions will reasonably assure the appearance of the person as required, and the safety of any other person and the community, the judicial officer shall order that the person be detained before trial.</text> </para> </para> <para> <num>(c)</num> <text>There shall be a rebuttable presumption that no condition or combination of conditions of release will reasonably assure the safety of any other person and the community if the judicial officer finds by probable cause that the person:</text> <para> <num>(1)</num> <text>Committed a dangerous crime or a crime of violence, as these crimes are defined in <cite path="§23-1331">§ 23-1331</cite>, while armed with or having readily available a pistol, firearm, imitation firearm, or other deadly or dangerous weapon;</text> </para> <para> <num>(2)</num> <text>Has threatened, injured, intimidated, or attempted to threaten, injure, or intimidate a law enforcement officer, an officer of the court, or a prospective witness or juror in any criminal investigation or judicial proceeding;</text> </para> <para> <num>(3)</num> <text>Committed a dangerous crime or a crime of violence, as these terms are defined in <cite path="§23-1331">§ 23-1331</cite>, and has previously been convicted of a dangerous crime or a crime of violence which was committed while on release pending trial for a local, state, or federal offense;</text> </para> <para> <num>(4)</num> <text>Committed a dangerous crime or a crime of violence while on release pending trial for a local, state, or federal offense;</text> </para> <para> <num>(5)</num> <text>Committed 2 or more dangerous crimes or crimes of violence in separate incidents that are joined in the case before the judicial officer;</text> </para> <para> <num>(6)</num> <text>Committed a robbery in which the victim sustained a physical injury;</text> </para> <para> <num>(7)</num> <text>Violated <cite path="§22-4504|(a)">§ 22-4504(a)</cite> (carrying a pistol without a license), <cite path="§22-4504|(a-1)">§ 22-4504(a-1)</cite> (carrying a rifle or shotgun), <cite path="§22-4504|(b)">§ 22-4504(b)</cite> (possession of a firearm during the commission of a crime of violence or dangerous crime), or <cite path="§22-4503">§ 22-4503</cite> (unlawful possession of a firearm); or</text> </para> <para> <num>(8)</num> <text>Violated [<cite path="7|25|VIII">subchapter VIII of Chapter 25 of Title 7</cite>, <cite path="§7-2508.01">§ 7-2508.01</cite> et seq.], while on probation, parole, or supervised release for committing a dangerous crime or a crime of violence, as these crimes are defined in <cite path="§23-1331">§ 23-1331</cite>, and while armed with or having readily available a firearm, imitation firearm, or other deadly or dangerous weapon as described in <cite path="§22-4502|(a)">§ 22-4502(a)</cite>.</text> </para> </para> <para> <num>(d)</num> <para> <num>(1)</num> <text>The hearing shall be held immediately upon the person’s first appearance before the judicial officer unless that person, or the attorney for the government, seeks a continuance. Except for good cause, a continuance on motion of the person shall not exceed 5 days, and a continuance on motion of the attorney for the government shall not exceed 3 days. During a continuance, the person shall be detained, and the judicial officer, on motion of the attorney for the government or <em>sua sponte</em>, may order that, while in custody, a person who appears to be an addict receive a medical examination to determine whether the person is an addict, as defined in <cite path="§23-1331">§ 23-1331</cite>.</text> </para> <para> <num>(2)</num> <text>At the hearing, the person has the right to be represented by counsel and, if financially unable to obtain adequate representation, to have counsel appointed.</text> </para> <para> <num>(3)</num> <text>The person shall be afforded an opportunity to testify. Testimony of the person given during the hearing shall not be admissible on the issue of guilt in any other judicial proceeding, but the testimony shall be admissible in proceedings under §§ <cite path="§23-1327">23-1327</cite>, <cite path="§23-1328">23-1328</cite>, and <cite path="§23-1329">23-1329</cite>, in perjury proceedings, and for the purpose of impeachment in any subsequent proceedings.</text> </para> <para> <num>(4)</num> <text>The person shall be afforded an opportunity to present witnesses, to cross-examine witnesses who appear at the hearing, and to present information by proffer or otherwise. The rules concerning admissibility of evidence in criminal trials do not apply to the presentation and consideration of information at the hearing.</text> </para> <para> <num>(5)</num> <text>The person shall be detained pending completion of the hearing.</text> </para> <para> <num>(6)</num> <text>The hearing may be reopened at any time before trial if the judicial officer finds that information exists that was not known to the movant at the time of the hearing and that has a material bearing on the issue of whether there are conditions of release that will reasonably assure the appearance of the person as required or the safety of any other person or the community.</text> </para> <para> <num>(7)</num> <text>When a person has been released pursuant to this section and it subsequently appears that the person may be subject to pretrial detention, the attorney for the government may initiate a pretrial detention hearing by ex parte written motion. Upon such motion, the judicial officer may issue a warrant for the arrest of the person and if the person is outside the District of Columbia, the person shall be brought before a judicial officer in the district where the person is arrested and shall then be transferred to the District of Columbia for proceedings in accordance with this section.</text> </para> </para> <para> <num>(e)</num> <text>The judicial officer shall, in determining whether there are conditions of release that will reasonably assure the appearance of the person as required and the safety of any other person and the community, take into account information available concerning:</text> <para> <num>(1)</num> <text>The nature and circumstances of the offense charged, including whether the offense is a crime of violence or dangerous crime as these terms are defined in <cite path="§23-1331">§ 23-1331</cite>, or involves obstruction of justice as defined in <cite path="§22-722">§ 22-722</cite>;</text> </para> <para> <num>(2)</num> <text>The weight of the evidence against the person;</text> </para> <para> <num>(3)</num> <text>The history and characteristics of the person, including:</text> <para> <num>(A)</num> <text>The person’s character, physical and mental condition, family ties, employment, financial resources, length of residence in the community, community ties, past conduct, history relating to drug or alcohol abuse, criminal history, and record concerning appearance at court proceedings; and</text> </para> <para> <num>(B)</num> <text>Whether, at the time of the current offense or arrest, the person was on probation, on parole, on supervised release, or on other release pending trial, sentencing, appeal, or completion of sentence for an offense under local, state, or federal law; and</text> </para> </para> <para> <num>(4)</num> <text>The nature and seriousness of the danger to any person or the community that would be posed by the person’s release.</text> </para> </para> <para> <num>(f)</num> <text>In a release order issued under <cite path="§23-1321|(b)">§ 23-1321(b)</cite> or (c), the judicial officer shall:</text> <para> <num>(1)</num> <text>Include a written statement that sets forth all the conditions to which the release is subject, in a manner sufficiently clear and specific to serve as a guide for the person’s conduct; and</text> </para> <para> <num>(2)</num> <text>Advise the person of:</text> <para> <num>(A)</num> <text>The penalties for violating a condition of release, including the penalties for committing an offense while on pretrial release;</text> </para> <para> <num>(B)</num> <text>The consequences of violating a condition of release, including immediate arrest or issuance of a warrant for the person’s arrest; and</text> </para> <para> <num>(C)</num> <text>The provisions of <cite path="§22-722">§ 22-722</cite>, relating to threats, force, or intimidation of witnesses, jurors, and officers of the court, obstruction of criminal investigations and retaliating against a witness, victim, or an informant.</text> </para> </para> </para> <para> <num>(g)</num> <text>In a detention order issued under subsection (b) of this section, the judicial officer shall:</text> <para> <num>(1)</num> <text>Include written findings of fact and a written statement of the reasons for the detention;</text> </para> <para> <num>(2)</num> <text>Direct that the person be committed to the custody of the Attorney General of the United States for confinement in a corrections facility separate, to the extent practicable, from persons awaiting or serving sentences or being held in custody pending appeal;</text> </para> <para> <num>(3)</num> <text>Direct that the person be afforded reasonable opportunity for private consultation with counsel; and</text> </para> <para> <num>(4)</num> <text>Direct that, on order of a judicial officer or on request of an attorney for the government, the person in charge of the corrections facility in which the person is confined deliver the person to the United States Marshal or other appropriate person for the purpose of an appearance in connection with a court proceeding.</text> </para> </para> <para> <num>(h)</num> <para> <num>(1)</num> <text>The case of the person detained pursuant to subsection (b) of this section shall be placed on an expedited calendar and, consistent with the sound administration of justice, the person shall be indicted before the expiration of 90 days, and shall have trial of the case commence before the expiration of 100 days. However, the time within which the person shall be indicted or shall have the trial of the case commence may be extended for one or more additional periods not to exceed 20 days each on the basis of a petition submitted by the attorney for the government and approved by the judicial officer. The additional period or periods of detention may be granted only on the basis of good cause shown, including due diligence and materiality, and shall be granted only for the additional time required to prepare for the expedited indictment and trial of the person. Good cause may include, but is not limited to, the unavailability of an essential witness, the necessity for forensic analysis of evidence, the ability to conduct a joint trial with a co-defendant or co-defendants, severance of co-defendants which permits only one trial to commence within the time period, complex or major investigations, complex or difficult legal issues, scheduling conflicts which arise shortly before the scheduled trial date, the inability to proceed to trial because of action taken by or at the behest of the defendant, an agreement between the government and the defense to dispose of the case by a guilty plea on or after the scheduled trial date, or the breakdown of a plea on or immediately before the trial date, and allowing reasonable time to prepare for an expedited trial after the circumstance giving rise to a tolling or extension of the 100-day period no longer exists. If the time within which the person must be indicted or the trial must commence is tolled or extended, an indictment must be returned at least 10 days before the new trial date.</text> </para> <para> <num>(2)</num> <text>For the purposes of determining the maximum period of detention under this section, the period shall begin on the latest of:</text> <para> <num>(A)</num> <text>The date the defendant is first detained under subsection (b) of this section by order of a judicial officer of the District of Columbia after arrest;</text> </para> <para> <num>(B)</num> <text>The date the defendant is first detained under subsection (b) of this section by order of a judicial officer of the District of Columbia following a re-arrest or order of detention after having been conditionally released under <cite path="§23-1321">§ 23-1321</cite> or after having escaped;</text> </para> <para> <num>(C)</num> <text>The date on which the trial of a defendant detained under subsection (b) of this section ends in a mistrial;</text> </para> <para> <num>(D)</num> <text>The date on which an order permitting the withdrawal of a guilty plea becomes final;</text> </para> <para> <num>(E)</num> <text>The date on which the defendant reasserts his right to an expedited trial following a waiver of that right;</text> </para> <para> <num>(F)</num> <text>The date on which the defendant, having previously been found incompetent to stand trial, is found competent to stand trial;</text> </para> <para> <num>(G)</num> <text>The date on which an order granting a motion for a new trial becomes final; or</text> </para> <para> <num>(H)</num> <text>The date on which the mandate is filed in the Superior Court after a case is reversed on appeal.</text> </para> </para> <para> <num>(3)</num> <text>After 100 days, as computed under paragraphs (2) and (4) of this section, or such period or periods of detention as extended under paragraph (1) of this section, the defendant shall be treated in accordance with <cite path="§23-1321|(a)">§ 23-1321(a)</cite> unless the trial is in progress, has been delayed by the timely filing of motions, excluding motions for continuance, or has been delayed at the request of the defendant.</text> </para> <para> <num>(4)</num> <text>In computing the 100 days, the following periods shall be excluded:</text> <para> <num>(A)</num> <text>Any period from the filing of the notice of appeal to the issuance of the mandate in an interlocutory appeal;</text> </para> <para> <num>(B)</num> <text>Any period attributable to any examination to determine the defendant’s sanity or lack thereof or his or her mental competency or physical capacity to stand trial;</text> </para> <para> <num>(C)</num> <text>Any period attributable to the inability of the defendant to participate in his or her defense because of mental incompetency or physical incapacity; and</text> </para> <para> <num>(D)</num> <text>Any period in which the defendant is otherwise unavailable for trial.</text> </para> </para> </para> <para> <num>(i)</num> <text>Nothing in this section shall be construed as modifying or limiting the presumption of innocence.</text> </para> <annotations> <annotation doc="Pub. L. 91-358" type="History">July 29, 1970, 84 Stat. 644, Pub. L. 91-358, title II, § 210(a)</annotation> <annotation doc="D.C. Law 4-152" type="History">Sept. 17, 1982, D.C. Law 4-152, § 3, 29 DCR 3479</annotation> <annotation doc="D.C. Law 8-19" type="History">July 28, 1989, D.C. Law 8-19, § 2(a), 36 DCR 2844</annotation> <annotation doc="D.C. Law 8-120" type="History">May 8, 1990, D.C. Law 8-120, § 2(a), 37 DCR 24</annotation> <annotation doc="D.C. Law 9-125" type="History">July 3, 1992, D.C. Law 9-125, § 3, 39 DCR 2134</annotation> <annotation doc="D.C. Law 10-151" type="History">Aug. 20, 1994, D.C. Law 10-151, § 602(a), 41 DCR 2608</annotation> <annotation doc="D.C. Law 10-255" type="History">May 16, 1995, D.C. Law 10-255, § 17, 41 DCR 5193</annotation> <annotation doc="D.C. Law 11-30" type="History">July 25, 1995, D.C. Law 11-30, § 6, 42 DCR 1547</annotation> <annotation doc="D.C. Law 11-273" type="History">June 3, 1997, D.C. Law 11-273, § 3(b), 43 DCR 6168</annotation> <annotation doc="D.C. Law 11-275" type="History">June 3, 1997, D.C. Law 11-275, § 14(f), 44 DCR 1408</annotation> <annotation doc="D.C. Law 13-310" type="History">June 12, 2001, D.C. Law 13-310, § 2(b), 48 DCR 1648</annotation> <annotation doc="D.C. Law 14-134" type="History">May 17, 2002, D.C. Law 14-134, § 7, 49 DCR 408</annotation> <annotation doc="D.C. Law 16-308" type="History">May 5, 2007, D.C. Law 16-308, § 3(a), 54 DCR 942</annotation> <annotation doc="D.C. Law 18-88" type="History">Dec. 10, 2009, D.C. Law 18-88, § 223, 56 DCR 7413</annotation> <annotation doc="D.C. Law 19-171" type="History">Sept. 26, 2012, D.C. Law 19-171, § 78, 59 DCR 6190</annotation> <annotation doc="D.C. Law 19-320" type="History">June 19, 2013, D.C. Law 19-320, § 107(c), 60 DCR 3390</annotation> <annotation type="Emergency Legislation">For temporary (90 days) amendment of this section, see § 107(c) of the Omnibus Criminal Code Amendment Congressional Review Emergency Act of 2013 (D.C. Act 20-44, April 1, 2013, 60 DCR 5381, 20 DCSTAT 1281).</annotation> <annotation type="Emergency Legislation">For temporary amendment of (c)(7), see § 107(c) of the Omnibus Criminal Code Amendments Emergency Amendment Act of 2012 (D.C. Act 19-599, January 14, 2013, 60 DCR 1017).</annotation> <annotation type="Emergency Legislation">For temporary (90 day) amendment of section, see § 402 of Crime Bill Emergency Amendment Act of 2009 (D.C. Act 18-129, June 29, 2009, 56 DCR 5495).</annotation> <annotation type="Emergency Legislation">For temporary (90 day) amendment of section, see § 3(a) of Crime Reduction Initiative (Rebuttable Presumption) Congressional Review Emergency Act of 2007 (D.C. Act 17-24, April 19, 2007, 54 DCR 4033).</annotation> <annotation type="Emergency Legislation">For temporary (90 day) amendment of section, see § 102(a) of Crime Reduction Initiative Congressional Review Emergency Amendment Act of 2007 (D.C. Act 17-9, January 16, 2007, 54 DCR 1471).</annotation> <annotation type="Emergency Legislation">For temporary (90 day) amendment of section, see § 101 of Crime Reduction Initiative Emergency Amendment Act of 2006 (D.C. Act 16-491, October 19, 2006, 53 DCR 8818).</annotation> <annotation type="Emergency Legislation">For temporary (90 day) amendment of section, see § 301 of Enhanced Crime Prevention and Abatement Emergency Amendment Act of 2006 (D.C. Act 16-446, July 21, 2006, 53 DCR 6477).</annotation> <annotation type="Emergency Legislation">For temporary (90 day) amendment of section, see § 2 of Sentencing Reform Technical Amendment Congressional Review Emergency Act of 2002 (D.C. Act 14-240, January 28, 2002, 49 DCR 1024).</annotation> <annotation type="Emergency Legislation">For temporary (90 day) amendment of section, see § 2 of Sentencing Reform Technical Amendment Emergency Act of 2001 (D.C. Act 14-148, October 23, 2001, 48 DCR 10195).</annotation> <annotation type="Emergency Legislation">For temporary amendment of section, see § 602 of the Omnibus Criminal Justice Reform Emergency Amendment Act of 1994 (D.C. Act 10-255, June 22, 1994, 41 DCR 4286).</annotation> <annotation type="Temporary Legislation">Section 4(b) of <cite doc="D.C. Law 14-115">D.C. Law 14-115</cite> provided that the act shall expire after 225 days of its having taken effect.</annotation> <annotation type="Temporary Legislation"><cite doc="D.C. Law 14-115">D.C. Law 14-115</cite>, in subsec. (a)(1)(C), substituted “Probation, parole, or supervised release,” for “Probation, or parole”; and, in subsec. (e)(3)(B), inserted “on supervised release,” following “parole,”.</annotation> <annotation type="Effect of Amendments">The 2013 amendment by <cite doc="D.C. Law 19-320">D.C. Law 19-320</cite> substituted “or <cite path="§22-4503">§ 22-4503</cite> (unlawful possession of a firearm)” for “<cite path="§22-4503">§ 22-4503</cite> (unlawful possession of a firearm) or [<cite path="§22-2511">§ 22-2511</cite>] (presence in a motor vehicle containing a firearm)” in (c)(7).</annotation> <annotation type="Effect of Amendments">The 2012 amendment by <cite doc="D.C. Law 19-171">D.C. Law 19-171</cite> made a technical correction to <cite doc="D.C. Law 18-88">D.C. Law 18-88</cite> which did not affect this section as codified.</annotation> <annotation type="Effect of Amendments"><cite doc="D.C. Law 18-88">D.C. Law 18-88</cite>, in subsec. (c), substituted “probable cause” for “a substantial probability” in the lead-in language, deleted “or” from the end of par. (6), rewrote par. (7), and added par. (8). Prior to amendment, par. (7) of subsec. (c) read as follows: “(7) Committed CPWL, carrying a pistol without a license.”</annotation> <annotation type="Effect of Amendments"><cite doc="D.C. Law 16-308">D.C. Law 16-308</cite>, in subsec. (c), substituted “imitation firearm, or other deadly or dangerous weapon;” for “or imitation firearm;” in par. (1), deleted “; or” from the end of par. (3), substituted a semicolon for a period at the end of par. (4), and added pars. (5), (6), and (7).</annotation> <annotation type="Effect of Amendments"><cite doc="D.C. Law 14-134">D.C. Law 14-134</cite>, in subsec. (a)(1)(C), substituted “Probation, parole, or supervised release” for “Probation or parole”; and in subsec. (e)(3)(B), inserted “on supervised release,” following “parole,”.</annotation> <annotation type="Effect of Amendments">“(2) Include the days detained pending a detention hearing and the days in confinement on temporary detention under subsection (a) of this section whether or not continuous with full pretrial detention. The defendant shall be treated in accordance with <cite path="§23-1321|(a)">§ 23-1321(a)</cite> unless the trial is in progress, has been delayed by the timely filing of motions excluding motions for continuance, or has been delayed at the request of the defendant.”</annotation> <annotation type="Effect of Amendments">“(1) Begin on the date defendant is first detained after arrest; and</annotation> <annotation type="Effect of Amendments">“(h) The case of the person detained pursuant to subsection (b) of this section shall be placed on an expedited calendar and, consistent with the sound administration of justice, the person shall be indicted before the expiration of 90 days, and shall have trial of the case commence before the expiration of 100 days. However, the person may be detained for an additional period not to exceed 20 days from the date of the expiration of the 100-day period on the basis of a petition submitted by the attorney for the government and approved by the judicial officer. The additional period of detention may be granted only on the basis of good cause shown and shall be granted only for the additional time required to prepare for the expedited trial of the person. For the purposes of determining the maximum period of detention under this section, the period shall not exceed 120 days. The period shall:</annotation> <annotation type="Effect of Amendments"><cite doc="D.C. Law 13-310">D.C. Law 13-310</cite>, in subsec. (a), inserted “or misdemeanor” following “felony” in par. (1)(A), and inserted “or, when a hearing under <cite path="§23-1329|(b)">§ 23-1329(b)</cite> is requested, is likely to violate a condition of release” in par. (2); in subsec. (f)(2)(B), substituted “immediate arrest or” for “the immediate”; and rewrote subsec. (h) which had read:</annotation> <annotation type="Prior Codifications">1973 Ed., § 23-1322.</annotation> <annotation type="Prior Codifications">1981 Ed., § 23-1322.</annotation> <annotation type="Section References">This section is referenced in <cite path="§23-1321">§ 23-1321</cite>, <cite path="§23-1323">§ 23-1323</cite>, <cite path="§23-1324">§ 23-1324</cite>, and <cite path="§23-1329">§ 23-1329</cite>.</annotation> </annotations> </section>
{ "pile_set_name": "Github" }
#!/bin/sh if test -f AUTHORS.txt then VF=src/VERSION_FILE.inc else VF=../../VERSION_FILE.inc fi DEF_VER=v0.6 LF=' ' # First see if there is a version file (included in release tarballs), # then try git-describe, then default. if test -f version then VN=$(cat version) || VN="$DEF_VER" elif test -d .git -o -f .git && VN=$(git describe --abbrev=4 HEAD 2>/dev/null) && case "$VN" in *$LF*) (exit 1) ;; v[0-9]*) git update-index -q --refresh test -z "$(git diff-index --name-only HEAD --)" || VN="$VN-dirty" ;; esac then VN=$(echo "$VN" | sed -e 's/-/./g'); else VN="$DEF_VER" fi VN=$(expr "$VN" : v*'\(.*\)') if test -r $VF then VC=$(sed -e 's/^FPGUI_VERSION = //' <$VF) else VC=unset fi test "$VN" = "$VC" || { echo >&2 "FPGUI_VERSION = '$VN';" echo "FPGUI_VERSION = '$VN';" >$VF }
{ "pile_set_name": "Github" }
<?php defined('SYSPATH') or die('No direct script access'); /** * Helper library for the unit tests * * PHP version 5 * LICENSE: This source file is subject to LGPL license * that is available through the world-wide-web at the following URI: * http://www.gnu.org/copyleft/lesser.html * @author Ushahidi Team <team@ushahidi.com> * @package Ushahidi - http://source.ushahididev.com * @copyright Ushahidi - http://www.ushahidi.com * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL) */ // Table prefix for the tables define('TABLE_PREFIX', Kohana::config('database.default.table_prefix')); class testutils_Core { /** * Gets a random value from the id column of the specified database table * * @param string $table_name Database table name from which to fetch the id * @return int */ public static function get_random_id($table_name, $where = '') { // Database instance for the query $db = new Database(); // Fetch all values from the ID column of the table $result = $db->query('SELECT id FROM '.TABLE_PREFIX.$table_name.' '.$where)->as_array(); // Get a random id return (count($result) > 0) ? $result[array_rand($result)]->id : count($result); } } ?>
{ "pile_set_name": "Github" }
// // VVeboImageView.h // vvebo // // Created by Johnil on 14-3-6. // Copyright (c) 2014年 Johnil. All rights reserved. // #import <UIKit/UIKit.h> #import "VVeboImage.h" @interface VVeboImageView : UIImageView @property (nonatomic) float frameDuration; @property (nonatomic) float currentDuration; - (void)playNext; - (void)playGif; - (void)pauseGif; @end
{ "pile_set_name": "Github" }
/* Plugin-SDK (Grand Theft Auto 3) header file Authors: GTA Community. See more here https://github.com/DK22Pac/plugin-sdk Do not delete this comment block. Respect others' work! */ #pragma once #include "PluginBase.h" #include "CVehicle.h" #include "CAutomobile.h" struct CZoneInfo; class CCarCtrl { public: static bool JoinCarWithRoadSystemGotoCoors(CVehicle* vehicle, CVector arg1, bool arg2); };
{ "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.cloudstack.api.agent.test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; import com.cloud.agent.api.ChangeAgentAnswer; import com.cloud.agent.api.ChangeAgentCommand; import com.cloud.host.Status.Event; public class ChangeAgentAnswerTest { ChangeAgentCommand cac = new ChangeAgentCommand(123456789L, Event.AgentConnected); ChangeAgentAnswer caa = new ChangeAgentAnswer(cac, true); @Test public void testGetResult() { boolean b = caa.getResult(); assertTrue(b); } @Test public void testExecuteInSequence() { boolean b = caa.executeInSequence(); assertFalse(b); } }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Static</title> <link rel="stylesheet" href="style.css"> </head> <body> <p>Static site example.</p> </body> </html>
{ "pile_set_name": "Github" }
// Load modules var Url = require('url'); var Hoek = require('hoek'); var Cryptiles = require('cryptiles'); var Crypto = require('./crypto'); var Utils = require('./utils'); // Declare internals var internals = {}; // Generate an Authorization header for a given request /* uri: 'http://example.com/resource?a=b' or object from Url.parse() method: HTTP verb (e.g. 'GET', 'POST') options: { // Required credentials: { id: 'dh37fgj492je', key: 'aoijedoaijsdlaksjdl', algorithm: 'sha256' // 'sha1', 'sha256' }, // Optional ext: 'application-specific', // Application specific data sent via the ext attribute timestamp: Date.now(), // A pre-calculated timestamp nonce: '2334f34f', // A pre-generated nonce localtimeOffsetMsec: 400, // Time offset to sync with server time (ignored if timestamp provided) payload: '{"some":"payload"}', // UTF-8 encoded string for body hash generation (ignored if hash provided) contentType: 'application/json', // Payload content-type (ignored if hash provided) hash: 'U4MKKSmiVxk37JCCrAVIjV=', // Pre-calculated payload hash app: '24s23423f34dx', // Oz application id dlg: '234sz34tww3sd' // Oz delegated-by application id } */ exports.header = function (uri, method, options) { var result = { field: '', artifacts: {} }; // Validate inputs if (!uri || (typeof uri !== 'string' && typeof uri !== 'object') || !method || typeof method !== 'string' || !options || typeof options !== 'object') { return result; } // Application time var timestamp = options.timestamp || Math.floor((Utils.now() + (options.localtimeOffsetMsec || 0)) / 1000) // Validate credentials var credentials = options.credentials; if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) { // Invalid credential object return result; } if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { return result; } // Parse URI if (typeof uri === 'string') { uri = Url.parse(uri); } // Calculate signature var artifacts = { ts: timestamp, nonce: options.nonce || Cryptiles.randomString(6), method: method, resource: uri.pathname + (uri.search || ''), // Maintain trailing '?' host: uri.hostname, port: uri.port || (uri.protocol === 'http:' ? 80 : 443), hash: options.hash, ext: options.ext, app: options.app, dlg: options.dlg }; result.artifacts = artifacts; // Calculate payload hash if (!artifacts.hash && options.hasOwnProperty('payload')) { artifacts.hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType); } var mac = Crypto.calculateMac('header', credentials, artifacts); // Construct header var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''; // Other falsey values allowed var header = 'Hawk id="' + credentials.id + '", ts="' + artifacts.ts + '", nonce="' + artifacts.nonce + (artifacts.hash ? '", hash="' + artifacts.hash : '') + (hasExt ? '", ext="' + Utils.escapeHeaderAttribute(artifacts.ext) : '') + '", mac="' + mac + '"'; if (artifacts.app) { header += ', app="' + artifacts.app + (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"'; } result.field = header; return result; }; // Validate server response /* res: node's response object artifacts: object recieved from header().artifacts options: { payload: optional payload received required: specifies if a Server-Authorization header is required. Defaults to 'false' } */ exports.authenticate = function (res, credentials, artifacts, options) { artifacts = Hoek.clone(artifacts); options = options || {}; if (res.headers['www-authenticate']) { // Parse HTTP WWW-Authenticate header var attributes = Utils.parseAuthorizationHeader(res.headers['www-authenticate'], ['ts', 'tsm', 'error']); if (attributes instanceof Error) { return false; } if (attributes.ts) { var tsm = Crypto.calculateTsMac(attributes.ts, credentials); if (tsm !== attributes.tsm) { return false; } } } // Parse HTTP Server-Authorization header if (!res.headers['server-authorization'] && !options.required) { return true; } var attributes = Utils.parseAuthorizationHeader(res.headers['server-authorization'], ['mac', 'ext', 'hash']); if (attributes instanceof Error) { return false; } artifacts.ext = attributes.ext; artifacts.hash = attributes.hash; var mac = Crypto.calculateMac('response', credentials, artifacts); if (mac !== attributes.mac) { return false; } if (!options.hasOwnProperty('payload')) { return true; } if (!attributes.hash) { return false; } var calculatedHash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, res.headers['content-type']); return (calculatedHash === attributes.hash); }; // Generate a bewit value for a given URI /* * credentials is an object with the following keys: 'id, 'key', 'algorithm'. * options is an object with the following optional keys: 'ext', 'localtimeOffsetMsec' */ /* uri: 'http://example.com/resource?a=b' or object from Url.parse() options: { // Required credentials: { id: 'dh37fgj492je', key: 'aoijedoaijsdlaksjdl', algorithm: 'sha256' // 'sha1', 'sha256' }, ttlSec: 60 * 60, // TTL in seconds // Optional ext: 'application-specific', // Application specific data sent via the ext attribute localtimeOffsetMsec: 400 // Time offset to sync with server time }; */ exports.getBewit = function (uri, options) { // Validate inputs if (!uri || (typeof uri !== 'string' && typeof uri !== 'object') || !options || typeof options !== 'object' || !options.ttlSec) { return ''; } options.ext = (options.ext === null || options.ext === undefined ? '' : options.ext); // Zero is valid value // Application time var now = Utils.now() + (options.localtimeOffsetMsec || 0); // Validate credentials var credentials = options.credentials; if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) { return ''; } if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { return ''; } // Parse URI if (typeof uri === 'string') { uri = Url.parse(uri); } // Calculate signature var exp = Math.floor(now / 1000) + options.ttlSec; var mac = Crypto.calculateMac('bewit', credentials, { ts: exp, nonce: '', method: 'GET', resource: uri.pathname + (uri.search || ''), // Maintain trailing '?' host: uri.hostname, port: uri.port || (uri.protocol === 'http:' ? 80 : 443), ext: options.ext }); // Construct bewit: id\exp\mac\ext var bewit = credentials.id + '\\' + exp + '\\' + mac + '\\' + options.ext; return Utils.base64urlEncode(bewit); }; // Generate an authorization string for a message /* host: 'example.com', port: 8000, message: '{"some":"payload"}', // UTF-8 encoded string for body hash generation options: { // Required credentials: { id: 'dh37fgj492je', key: 'aoijedoaijsdlaksjdl', algorithm: 'sha256' // 'sha1', 'sha256' }, // Optional timestamp: Date.now(), // A pre-calculated timestamp nonce: '2334f34f', // A pre-generated nonce localtimeOffsetMsec: 400, // Time offset to sync with server time (ignored if timestamp provided) } */ exports.message = function (host, port, message, options) { // Validate inputs if (!host || typeof host !== 'string' || !port || typeof port !== 'number' || message === null || message === undefined || typeof message !== 'string' || !options || typeof options !== 'object') { return null; } // Application time var timestamp = options.timestamp || Math.floor((Utils.now() + (options.localtimeOffsetMsec || 0)) / 1000) // Validate credentials var credentials = options.credentials; if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) { // Invalid credential object return null; } if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { return null; } // Calculate signature var artifacts = { ts: timestamp, nonce: options.nonce || Cryptiles.randomString(6), host: host, port: port, hash: Crypto.calculatePayloadHash(message, credentials.algorithm) }; // Construct authorization var result = { id: credentials.id, ts: artifacts.ts, nonce: artifacts.nonce, hash: artifacts.hash, mac: Crypto.calculateMac('message', credentials, artifacts) }; return result; };
{ "pile_set_name": "Github" }
<h3>Link with Button element</h3> <p>When you want the appearance of Link but the on-click behavior is handled separately (by Tooltip for example), omit the <code>url</code> property and the Link component will internally render a <code>&lt;button&gt;</code>.</p> {% include "@bolt-components-link/link.twig" with { text: "Link with button element" } only %}
{ "pile_set_name": "Github" }
export { default } from './View';
{ "pile_set_name": "Github" }
.grid { letter-spacing: -0.31em; *letter-spacing: normal; word-spacing: -0.43em; } button::-moz-focus-inner { border: 0; padding: 0; margin: 0; } .grid .g-u { display: inline-block; zoom: 1; *display: inline; /* IE < 8: fake inline-block */ letter-spacing: normal; word-spacing: normal; vertical-align: top; _vertical-align: text-bottom; } .grid .g-u input { *vertical-align: middle; } .file-input-wrapper { width: 120px; height: 120px; position: absolute; z-index: 12; top: 0; left: 0; overflow: hidden; opacity: 0; } .file-input-wrapper .file-input { display: block; height: 500px; width: 220px; cursor: pointer; font-size: 100px; margin-top: -50px; position: absolute; left: 0; top: -200px; opacity: 0; filter: alpha(opacity = 0); z-index: 14; } .ks-uploader-button { text-decoration: none; } .editorMultipleUploader-button { width: 74px; height: 25px; line-height: 25px; border: 1px solid #c1c8d1; vertical-align: middle; white-space: nowrap; box-shadow: 0 1px 1px #E4E4E4; background: #e8ebee repeat-x left top; margin-right: 6px; overflow: hidden; position: relative; font-size: 12px; cursor: pointer; color: #333333; text-align: center; background-color: #fdfcfc; background: -webkit-gradient(linear, left top, left bottom, from(#fdfcfc), to(#e8ebee)); background: -moz-linear-gradient(top, #fdfcfc, #e8ebee); border-radius: 2px; -webkit-border-radius: 2px; -moz-border-radius: 2px; } .editorMultipleUploader-button .file-input-wrapper { width: 74px; height: 25px; } .imageUploader-button:hover { color: #333333; text-decoration: none; border: 1px solid #369BD7; background-color: #fdfcfc; background: -webkit-gradient(linear, left top, left bottom, from(#fdfcfc), to(#e2f1fc)); background: -moz-linear-gradient(top, #fdfcfc, #e2f1fc); } .imageUploader-button:active { background-color: #e2f1fc; background: -webkit-gradient(linear, left top, left bottom, from(#e2f1fc), to(#e2f1fc)); background: -moz-linear-gradient(top, #e2f1fc, #e2f1fc); outline: 0 none; } .uploader-button-disabled, .uploader-button-disabled:hover { border: 1px solid #EEEEEE; color: #404040; background: #EEEEEE; } .upload-count-wrapper { margin-top: 4px; color: #ccc; } .upload-count-wrapper em { color: #999999; font-style: normal; } .ks-editor-upload-list .ks-editor-progressbar { height: 16px; width: 100px !important; } .ks-editor-upload-list .ks-editor-progressbar .ks-progress-bar-value { background: #d6dee6; height: 16px; } .editor-uploader-queue-wrapper { display: none; font-size: 12px; } .editor-uploader-queue-wrapper table { border-collapse: collapse; border-spacing: 0; } .uploader-footer { margin: 15px 10px; } .uploader-footer .ks-editor-uploader-clear { margin-top: 5px; margin-left: 15px; cursor: pointer; } .editorMultipleUploader-queue .status-wrapper { position: relative; } .editorMultipleUploader-queue .ks-editor-progressbar-title { top: 2px; } .editorMultipleUploader-queue .error-status { color: red; }
{ "pile_set_name": "Github" }
<mat-checkbox [(ngModel)]="_ng_state" (change)="_ng_onStateChange($event)" (click)="_ng_onStateClick($event)"></mat-checkbox> <span class="type far fa-chart-bar"></span> <span class="color" [ngStyle]="{'background': _ng_color}"></span> <span class="request" *ngIf="!entity.getEditState().state()">{{_ng_request}}</span> <input #requestInput *ngIf="entity.getEditState().state()" matInput class="request" placeholder="Request" (keyup)="_ng_onRequestInputKeyUp($event)" (blur)="_ng_onRequestInputBlur()" [(ngModel)]="_ng_request" [errorStateMatcher]="_ng_errorStateMatcher"/>
{ "pile_set_name": "Github" }
/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "time" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. // A group's client should implement this interface. type VolumeAttachmentsGetter interface { VolumeAttachments() VolumeAttachmentInterface } // VolumeAttachmentInterface has methods to work with VolumeAttachment resources. type VolumeAttachmentInterface interface { Create(*v1beta1.VolumeAttachment) (*v1beta1.VolumeAttachment, error) Update(*v1beta1.VolumeAttachment) (*v1beta1.VolumeAttachment, error) UpdateStatus(*v1beta1.VolumeAttachment) (*v1beta1.VolumeAttachment, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error Get(name string, options v1.GetOptions) (*v1beta1.VolumeAttachment, error) List(opts v1.ListOptions) (*v1beta1.VolumeAttachmentList, error) Watch(opts v1.ListOptions) (watch.Interface, error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VolumeAttachment, err error) VolumeAttachmentExpansion } // volumeAttachments implements VolumeAttachmentInterface type volumeAttachments struct { client rest.Interface } // newVolumeAttachments returns a VolumeAttachments func newVolumeAttachments(c *StorageV1beta1Client) *volumeAttachments { return &volumeAttachments{ client: c.RESTClient(), } } // Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. func (c *volumeAttachments) Get(name string, options v1.GetOptions) (result *v1beta1.VolumeAttachment, err error) { result = &v1beta1.VolumeAttachment{} err = c.client.Get(). Resource("volumeattachments"). Name(name). VersionedParams(&options, scheme.ParameterCodec). Do(). Into(result) return } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *volumeAttachments) List(opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } result = &v1beta1.VolumeAttachmentList{} err = c.client.Get(). Resource("volumeattachments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). Do(). Into(result) return } // Watch returns a watch.Interface that watches the requested volumeAttachments. func (c *volumeAttachments) Watch(opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } opts.Watch = true return c.client.Get(). Resource("volumeattachments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). Watch() } // Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *volumeAttachments) Create(volumeAttachment *v1beta1.VolumeAttachment) (result *v1beta1.VolumeAttachment, err error) { result = &v1beta1.VolumeAttachment{} err = c.client.Post(). Resource("volumeattachments"). Body(volumeAttachment). Do(). Into(result) return } // Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *volumeAttachments) Update(volumeAttachment *v1beta1.VolumeAttachment) (result *v1beta1.VolumeAttachment, err error) { result = &v1beta1.VolumeAttachment{} err = c.client.Put(). Resource("volumeattachments"). Name(volumeAttachment.Name). Body(volumeAttachment). Do(). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *volumeAttachments) UpdateStatus(volumeAttachment *v1beta1.VolumeAttachment) (result *v1beta1.VolumeAttachment, err error) { result = &v1beta1.VolumeAttachment{} err = c.client.Put(). Resource("volumeattachments"). Name(volumeAttachment.Name). SubResource("status"). Body(volumeAttachment). Do(). Into(result) return } // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. func (c *volumeAttachments) Delete(name string, options *v1.DeleteOptions) error { return c.client.Delete(). Resource("volumeattachments"). Name(name). Body(options). Do(). Error() } // DeleteCollection deletes a collection of objects. func (c *volumeAttachments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { var timeout time.Duration if listOptions.TimeoutSeconds != nil { timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("volumeattachments"). VersionedParams(&listOptions, scheme.ParameterCodec). Timeout(timeout). Body(options). Do(). Error() } // Patch applies the patch and returns the patched volumeAttachment. func (c *volumeAttachments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VolumeAttachment, err error) { result = &v1beta1.VolumeAttachment{} err = c.client.Patch(pt). Resource("volumeattachments"). SubResource(subresources...). Name(name). Body(data). Do(). Into(result) return }
{ "pile_set_name": "Github" }
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: represent a canonical list of the languages we support, // //============================================================================= #ifndef LANG_H #define LANG_H #ifdef _WIN32 #pragma once #endif // if you change this enum also change language.cpp:s_LanguageNames enum ELanguage { k_Lang_None = -1, k_Lang_First = 0, k_Lang_English = 0, k_Lang_German, k_Lang_French, k_Lang_Italian, k_Lang_Korean, k_Lang_Spanish, k_Lang_Simplified_Chinese, k_Lang_Traditional_Chinese, k_Lang_Russian, k_Lang_Thai, k_Lang_Japanese, k_Lang_Portuguese, k_Lang_Polish, k_Lang_Danish, k_Lang_Dutch, k_Lang_Finnish, k_Lang_Norwegian, k_Lang_Swedish, k_Lang_Romanian, k_Lang_Turkish, k_Lang_Hungarian, k_Lang_Czech, k_Lang_Brazilian, k_Lang_Bulgarian, k_Lang_Greek, k_Lang_Ukrainian, k_Lang_MAX }; #define FOR_EACH_LANGUAGE( eLang ) for ( int eLang = (int)k_Lang_First; eLang < k_Lang_MAX; ++eLang ) ELanguage PchLanguageToELanguage(const char *pchShortName, ELanguage eDefault = k_Lang_English); ELanguage PchLanguageICUCodeToELanguage( const char *pchICUCode, ELanguage eDefault = k_Lang_English ); const char *GetLanguageShortName( ELanguage eLang ); const char *GetLanguageICUName( ELanguage eLang ); const char *GetLanguageVGUILocalization( ELanguage eLang ); const char *GetLanguageName( ELanguage eLang ); #endif /* LANG_H */
{ "pile_set_name": "Github" }
-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAjLom0aOD7siQeu68DwKwSLCLHiNlnHZg+qosqW01elmIA5OM 6Dn5tDLJo1C9duC9Fvc5a0Z9yU7wg5gmDRiEz0QhONVW/pa/hKaDGmJ2p4WEBdUV +2+IpAcWOj1jtn/tBwz/sLf/ER6lE9+vrmCqBycD5BIJ/KyCIaeMo7cZsCieTvCB IciAeJa8oYcWlHwjVmCbTfytCfz63GzpdEEyDsnPyE8t8xWdXc2Tp0EaTLcQd5oi 89wirwRmoeKCthMBq0o5UP3efcB1TwfRkBr/YdMy/FtAfSciwKmjB2N+LdXEu8Pw mgYvKEr3FwTbggCKZF3Xk1044pAjeHTCRpZCVQIDAQABAoIBACkhFstacOrO73se XxQ8Au2bu20Zh08NQhbAucDizChwFlKFQz90AkjqNwhmRpmB4YHey4dQ2N6HFcBA LY7SRa6WCOelYoGR6XOJfvOtJ2SanxVdS8lqtZLLB3IKEyR5ivruj6REgmWsgS6n x569XbQtcPOtWgHhIT9Yyr/mebmEFpoURT+oTvvXsNQPQM0Pzd6mnIgTeCJOEZuD tsEbeji/+cmsEI+k2bCyL93anRz2uOonJm830Trbx9VW4wav/YUlSytMVmOMa/Ia S/gTTWAxbq52ZpAH9cQB5xufdPBJNj+wYldh5IZjwTiW8yZ51e98msipnPoGt6IJ VH7rgMECgYEAwPkgIT6t+aQY3FUej4giP49NTQ+0K36J7ORcClNyyCgqDESly63a SRTF3PcN7km9hn/SdYLAKRFQ1lcxq09oT0PCnswTZWbE3RobHSqCw+J7NbTzwEEb 3aXXJmbULAA/dJgoUGFMy70Wq3ihADsilgonB4Rhnxcj68R6qkcNmm0CgYEAurCi HNjzrarxc2ahSsQrjZClL6CgIGGxf6kIQr4WMdEabHvbtvUMKI9VYrMpG7YnJKWV CqxytdFilkqMKXhSe5dd5kQglIRaoQVXOcBa62RqQvDIR3PnevDcA8izqtIPJ8pY eljnojtuyZG3qSoXcl65cSyfMpDAvqEsIGNmVokCgYBW45WxAm0Jm/bJttX04OIy 5k5zJWAFuYtXDBfZWmuzbkpIjdxtUpGYGG9jKCawpald104nNUFa/H3+lPI7ZZzd G/CU2eTd4qE/wRJ2Vn7cvqylqR2b8nUenx66HtDoIxBvale0oasXjcOYX892sCnJ jza1rsjZ/mxhK23kH+wjHQKBgQCnZ6JGuehwj3vpnlr9n0DqtYzaU2+i+ddfgSRO LQPb8gR+yOXxfnVDnZvUYJF5LvKUswIdyxslnLeJyxk6SpG0D7x8shSA+NoHz7Ey sSEWOTnsAtuk7vLgVEEGB5/MioZaiOCj/TrgR+kFSOxm/b5+qSAisv+iKRkdF4tp E5j9+QKBgCU3e0J5HktxhDgUFi2McqZN1uv8Kn7u7GPr0Q+YVfxyjrPG8oIEddCx brYBUh5o24fBOWYbBJlsvWWvAGWZnVorYaFjgCxglPSCoTN7t8biLdm+hozQy314 PE7xdvDggLEpoSeunUa/VWzTP2SzbIge6gu8x3yF/nDCAxPbk7Ti -----END RSA PRIVATE KEY-----
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <resources> <!--player--> <string name="prefs_appearance_entry_value_default" translatable="false">default</string> <string name="prefs_appearance_entry_value_flat" translatable="false">flat</string> <string name="prefs_appearance_entry_value_spotify" translatable="false">spotify</string> <string name="prefs_appearance_entry_value_fullscreen" translatable="false">fullscreen</string> <string name="prefs_appearance_entry_value_big_image" translatable="false">big_image</string> <string name="prefs_appearance_entry_value_clean" translatable="false">clean</string> <string name="prefs_appearance_entry_value_mini" translatable="false">mini</string> <!-- dark mode Q--> <string name="prefs_dark_mode_2_entry_value_light" translatable="false">light</string> <string name="prefs_dark_mode_2_entry_value_dark" translatable="false">dark</string> <string name="prefs_dark_mode_2_entry_value_follow_system" translatable="false">follow_system</string> <!--icon shape--> <string name="prefs_icon_shape_square" translatable="false">square</string> <string name="prefs_icon_shape_rounded" translatable="false">round</string> <string name="prefs_icon_shape_cut_corner" translatable="false">cut_corner</string> <!--quick action--> <string name="prefs_quick_action_entry_value_hide" translatable="false">hide</string> <string name="prefs_quick_action_entry_value_play" translatable="false">play</string> <string name="prefs_quick_action_entry_value_shuffle" translatable="false">shuffle</string> <string name="prefs_detail_section_entry_value_most_played" translatable="false">most played</string> <string name="prefs_detail_section_entry_value_recently_added" translatable="false">recently added</string> <string name="prefs_detail_section_entry_value_related_artists" translatable="false">related artist</string> <string name="prefs_auto_download_images_entry_value_always">always</string> <string name="prefs_auto_download_images_entry_value_wifi">wifi</string> <string name="prefs_auto_download_images_entry_value_never">never</string> <string-array name="prefs_detail_sections_entry_values_default"> <item>@string/prefs_detail_section_entry_value_most_played</item> <item>@string/prefs_detail_section_entry_value_recently_added</item> <item>@string/prefs_detail_section_entry_value_related_artists</item> </string-array> </resources>
{ "pile_set_name": "Github" }