text
stringlengths 2
1.04M
| meta
dict |
---|---|
// smp.cpp
#include "smp.h"
/**
* Constructor
* @param p (int)
*/
Smp::Smp(int p) : fP(p) {}
/**
* Destructor
*/
Smp::~Smp() {}
/**
* Set the MP to MP:= SP - (p + 4)
* @return none
* @param stack the machine on which the instruction is performed (StackMachine*)
* @exception ExecutionError
*/
void Smp::execute(StackMachine *stack)
{
stack->fMP = stack->fSP - (fP + 4);
// adding cost of this instruction
stack->fTime.count("smp");
}
/**
* Prints the instuction into an outputstream
* @return reference to ostream filled with the printed instruction
* @param os reference to ostream (ostream&)
* @exception none
*/
ostream& Smp::print(ostream &os) const
{
os << "smp " << fP;
return os;
}
| {
"content_hash": "62913a1b8e1998d612bf5554a25f82a8",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 80,
"avg_line_length": 16.697674418604652,
"alnum_prop": 0.6337047353760445,
"repo_name": "arminnh/c-to-p-compiler",
"id": "aa44a3322f883871b989cf7b04dfdd65abd2592d",
"size": "718",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "resources/Pmachine/smp.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ANTLR",
"bytes": "6664"
},
{
"name": "Batchfile",
"bytes": "787"
},
{
"name": "C",
"bytes": "232414"
},
{
"name": "C++",
"bytes": "182564"
},
{
"name": "HTML",
"bytes": "4490"
},
{
"name": "Lex",
"bytes": "8562"
},
{
"name": "Makefile",
"bytes": "5806"
},
{
"name": "OpenEdge ABL",
"bytes": "300393"
},
{
"name": "Python",
"bytes": "897521"
},
{
"name": "Shell",
"bytes": "1214"
},
{
"name": "Yacc",
"bytes": "30329"
}
],
"symlink_target": ""
} |
window.themingStore.models.AbstractModel = Backbone.Model.extend({
/**
* rest url to push or post the product
* @final
*/
url: function ()
{
alert(window.themingStore.restPath);
// FIXME: remove this when it's functional
return window.themingStore.restPath;
/**
* function that helps create the complete url to push an update to an object
* @param identifier
*/
var checkId = (function (identifier)
{
if (this.get(identifier))
{
return '/' + this.get(identifier) + '.json';
}
return '';
}).bind(this);
// actual code begins here
this._checkType();
var basePath = window.themingStore.restPath;
if (basePath[basePath.length - 1] != '/')
{
basePath += '/';
}
if (this.type == 'user')
{
basePath += 'user';
basePath += checkId('uid');
}
else if (this.type == 'file')
{
basePath += 'file';
basePath += checkId('fid');
}
else if (this.type == 'taxonomy')
{
basePath += 'taxonomy_term';
basePath += checkId('tid');
}
else
{
basePath += 'node';
basePath += checkId('nid');
}
return basePath;
},
/**
* This method overrides the get functionality providing a getter that can
* work using drupal regionalized data
*/
get: function (key, defaultValue) {
// if no default value was specified assume null
if (!defaultValue) defaultValue = null;
// get the value from the object using the parent's method
var value = Backbone.Model.prototype.get.call(this, key);
// check if the value is internationalized
if (typeof value == 'object')
{
if (value[this.get('language')])
{
return value[this.get('language')];
}
}
// if we got any value not internationalized, return it
if (value)
{
return value;
}
// no value found, return the default
return defaultValue;
},
/**
* override of the save option, to handle the product type
*/
save: function (data, options)
{
this._checkType();
data.type = this.type;
// call the parent's save
Backbone.Model.prototype.save.call(this, data, options);
},
/**
* fetches information from the rest layer
* rest
* @param options object with options of the fetch
* @final
*/
fetch: function (options)
{
Backbone.Model.prototype.fetch.call(this, options);
this.id = true;
},
/**
* checks if the type is set in the class
* @private
*/
_checkType: function () {
if (!this.type)
{
throw new Error('Need the type of model to proceed')
}
}
}); | {
"content_hash": "6e7acff1a2c00062b0efa961430887b3",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 81,
"avg_line_length": 23.252173913043478,
"alnum_prop": 0.5848915482423336,
"repo_name": "jclaros/tst",
"id": "05bddbaa774b3a0e1746b34aa969a8b6ef05a538",
"size": "2674",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/js/compiled/compiled_part_6_AbstractModel_3.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "573621"
},
{
"name": "JavaScript",
"bytes": "3678261"
},
{
"name": "PHP",
"bytes": "143752"
},
{
"name": "Perl",
"bytes": "2647"
},
{
"name": "Shell",
"bytes": "76"
}
],
"symlink_target": ""
} |
import { Component, Input, Output, OnInit, EventEmitter } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ProjectService } from '../../services/project.service';
import { InstallInfoModel } from '../../models/install-info.model';
import { Subscription } from 'rxjs/Subscription';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import 'bootstrap/dist/css/bootstrap.css';
@Component({
selector: 'installForm',
template: `
<form class="form-inline" [formGroup]="installForm" (ngSubmit)="handleSubmit()">
<div class="form-group" [class.has-danger]="!installForm.valid && installForm.dirty">
<div class="input-group">
<input type="text" class="form-control" formControlName="package" placeholder="package name">
<div class="input-group-addon">@</div>
<input type="text" class="form-control" formControlName="version" placeholder="version">
</div>
<div class="form-control-feedback" [hidden]="installForm.valid">{{getErrorMessage()}}</div>
</div>
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" formControlName="isDev" type="checkbox"> dev
</label>
</div>
<button type="submit" class="btn btn-primary" [disabled]="!installForm.valid">Install</button>
</form>
`
})
export class InstallFormComponent implements OnInit {
@Input()
packagePath: string = '';
@Output()
installPackage: EventEmitter<InstallInfoModel> = new EventEmitter<InstallInfoModel>();
installForm: FormGroup;
constructor(protected fb: FormBuilder, protected projectService: ProjectService) { }
ngOnInit() {
this.buildForm();
}
buildForm() {
this.installForm = this.fb.group({
'package': ['', Validators.required],
'version': [''],
'isDev': [false]
}, {
asyncValidator: (group: FormGroup) => {
return this.projectService.validatePackage(this.packagePath, group.value['package'], group.value['version'])
.catch(err => {
return Observable.create(observer => {
observer.next(err.error);
observer.complete();
});
});
}
});
}
handleSubmit() {
this.installPackage.emit({
packageName: this.installForm.value['package'],
packageVersion: this.installForm.value['version'],
isDev: this.installForm.value['isDev']
});
}
getErrorMessage(): string {
if(this.installForm.errors) {
return this.installForm.errors['package'] || this.installForm.errors['package'];
}
return '';
}
} | {
"content_hash": "a39bdf2dad67d30c59dc2740f426bc1e",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 124,
"avg_line_length": 37.135802469135804,
"alnum_prop": 0.5711436170212766,
"repo_name": "revov/npm-interface",
"id": "5fef3fa3d99c0af9d686f8c772b939b40053e7e5",
"size": "3008",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "renderer/src/app/components/install-form/install-form.component.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1058"
},
{
"name": "JavaScript",
"bytes": "18668"
},
{
"name": "TypeScript",
"bytes": "42694"
}
],
"symlink_target": ""
} |
@interface NSMutableString (FishLamp)
- (BOOL) insertString_fl:(NSString*) substring
beforeString:(NSString*) beforeString
withBackwardsSearch:(BOOL) searchBackwards;
- (BOOL) insertString_fl:(NSString*) substring
afterString:(NSString*) afterString
withBackwardsSearch:(BOOL) searchBackwards;
@end
| {
"content_hash": "d42d4975375e59af6180b9ad7204d614",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 49,
"avg_line_length": 30.636363636363637,
"alnum_prop": 0.7210682492581603,
"repo_name": "fishlamp-released/FishLamp3",
"id": "fb53c7a0deb056319262660a6addcba040f27ae8",
"size": "462",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Classes/Core/Strings/NSMutableString+FishLamp.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "34265"
},
{
"name": "C++",
"bytes": "20186"
},
{
"name": "MATLAB",
"bytes": "1247"
},
{
"name": "Objective-C",
"bytes": "1923708"
},
{
"name": "Ruby",
"bytes": "17531"
}
],
"symlink_target": ""
} |
#ifndef POSTGRESQL_CONNECTION_H_
#define POSTGRESQL_CONNECTION_H_
// BEGIN Includes. ///////////////////////////////////////////////////
// System dependencies.
#include <pqxx/pqxx>
// Application dependencies.
#include <ias/database/interface/database_connection.h>
// END Includes. /////////////////////////////////////////////////////
class PostgresqlConnection : public DatabaseConnection {
public:
// BEGIN Class constants. ////////////////////////////////////////
/**
* A set of constants which need to be used to format the database
* connection string.
*/
static const char kIdentifierHost[];
static const char kIdentifierSchema[];
static const char kIdentifierUsername[];
static const char kIdentifierPassword[];
static const char kIdentifierPort[];
// END Class constants. //////////////////////////////////////////
private:
// BEGIN Private members. ////////////////////////////////////////
/**
* An object which handles the connection with the remote PostgreSQL
* database.
*
* @note By default, this member will be equal to the null reference.
*/
pqxx::connection * mConnection;
// END Private members. //////////////////////////////////////////
// BEGIN Private methods. ////////////////////////////////////////
inline void initialize( void );
// END Private methods. //////////////////////////////////////////
protected:
// BEGIN Protected methods. //////////////////////////////////////
// END Protected methods. ////////////////////////////////////////
public:
// BEGIN Constructors. ///////////////////////////////////////////
PostgresqlConnection( const std::string & username,
const std::string & password,
const std::string & schema,
const std::string & host );
// END Constructors. /////////////////////////////////////////////
// BEGIN Destructor. /////////////////////////////////////////////
virtual ~PostgresqlConnection( void );
// END Destructor. ///////////////////////////////////////////////
// BEGIN Public methods. /////////////////////////////////////////
virtual bool isConnected( void ) const;
virtual bool connect( void );
virtual DatabaseStatement * createStatement( const std::string & sql );
virtual DatabasePreparedStatement * prepareStatement( const std::string & sql );
virtual void * getLink( void );
// END Public methods. ///////////////////////////////////////////
// BEGIN Static methods. /////////////////////////////////////////
// END Static methods. ///////////////////////////////////////////
};
#endif /* POSTGRESQL_CONNECTION_H_ */
| {
"content_hash": "64668b33fe7f8a22a1529193dee3c6d8",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 84,
"avg_line_length": 29.357894736842105,
"alnum_prop": 0.45894585873072785,
"repo_name": "JoeriHermans/Intelligent-Automation-System",
"id": "a5e52e45c9bfd30e4e43040b90ce825640f19c75",
"size": "3595",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/ias/database/postgresql/postgresql_connection.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "5482"
},
{
"name": "C++",
"bytes": "815735"
},
{
"name": "Makefile",
"bytes": "1787"
},
{
"name": "Python",
"bytes": "26325"
},
{
"name": "Shell",
"bytes": "41"
}
],
"symlink_target": ""
} |
static const int xmppLogLevel = XMPP_LOG_LEVEL_WARN;
#else
static const int xmppLogLevel = XMPP_LOG_LEVEL_WARN;
#endif
@implementation XMPPCoreDataStorage
static NSMutableSet *databaseFileNames;
+ (void)initialize
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
databaseFileNames = [[NSMutableSet alloc] init];
});
}
+ (BOOL)registerDatabaseFileName:(NSString *)dbFileName
{
BOOL result = NO;
@synchronized(databaseFileNames)
{
if (![databaseFileNames containsObject:dbFileName])
{
[databaseFileNames addObject:dbFileName];
result = YES;
}
}
return result;
}
+ (void)unregisterDatabaseFileName:(NSString *)dbFileName
{
@synchronized(databaseFileNames)
{
[databaseFileNames removeObject:dbFileName];
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Override Me
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- (NSString *)managedObjectModelName
{
// Override me, if needed, to provide customized behavior.
//
// This method is queried to get the name of the ManagedObjectModel within the app bundle.
// It should return the name of the appropriate file (*.xdatamodel / *.mom / *.momd) sans file extension.
//
// The default implementation returns the name of the subclass, stripping any suffix of "CoreDataStorage".
// E.g., if your subclass was named "XMPPExtensionCoreDataStorage", then this method would return "XMPPExtension".
//
// Note that a file extension should NOT be included.
NSString *className = NSStringFromClass([self class]);
NSString *suffix = @"CoreDataStorage";
if ([className hasSuffix:suffix] && ([className length] > [suffix length]))
{
return [className substringToIndex:([className length] - [suffix length])];
}
else
{
return className;
}
}
- (NSBundle *)managedObjectModelBundle
{
return [NSBundle bundleForClass:[self class]];
}
- (NSString *)defaultDatabaseFileName
{
// Override me, if needed, to provide customized behavior.
//
// This method is queried if the initWithDatabaseFileName:storeOptions: method is invoked with a nil parameter for databaseFileName.
//
// You are encouraged to use the sqlite file extension.
return [NSString stringWithFormat:@"%@.sqlite", [self managedObjectModelName]];
}
- (NSDictionary *)defaultStoreOptions
{
// Override me, if needed, to provide customized behavior.
//
// This method is queried if the initWithDatabaseFileName:storeOptions: method is invoked with a nil parameter for defaultStoreOptions.
NSDictionary *defaultStoreOptions = nil;
if(databaseFileName)
{
defaultStoreOptions = @{ NSMigratePersistentStoresAutomaticallyOption: @(YES),
NSInferMappingModelAutomaticallyOption : @(YES) };
}
return defaultStoreOptions;
}
- (void)willCreatePersistentStoreWithPath:(NSString *)storePath options:(NSDictionary *)theStoreOptions
{
// Override me, if needed, to provide customized behavior.
//
// If you are using a database file with pure non-persistent data (e.g. for memory optimization purposes on iOS),
// you may want to delete the database file if it already exists on disk.
//
// If this instance was created via initWithDatabaseFilename, then the storePath parameter will be non-nil.
// If this instance was created via initWithInMemoryStore, then the storePath parameter will be nil.
}
- (BOOL)addPersistentStoreWithPath:(NSString *)storePath options:(NSDictionary *)theStoreOptions error:(NSError **)errorPtr
{
// Override me, if needed, to completely customize the persistent store.
//
// Adds the persistent store path to the persistent store coordinator.
// Returns true if the persistent store is created.
//
// If this instance was created via initWithDatabaseFilename, then the storePath parameter will be non-nil.
// If this instance was created via initWithInMemoryStore, then the storePath parameter will be nil.
NSPersistentStore *persistentStore;
if (storePath)
{
// SQLite persistent store
NSURL *storeUrl = [NSURL fileURLWithPath:storePath];
persistentStore = [persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType
configuration:nil
URL:storeUrl
options:storeOptions
error:errorPtr];
}
else
{
// In-Memory persistent store
persistentStore = [persistentStoreCoordinator addPersistentStoreWithType:NSInMemoryStoreType
configuration:nil
URL:nil
options:nil
error:errorPtr];
}
return persistentStore != nil;
}
- (void)didNotAddPersistentStoreWithPath:(NSString *)storePath options:(NSDictionary *)theStoreOptions error:(NSError *)error
{
// Override me, if needed, to provide customized behavior.
//
// For example, if you are using the database for non-persistent data and the model changes,
// you may want to delete the database file if it already exists on disk.
//
// E.g:
//
// [[NSFileManager defaultManager] removeItemAtPath:storePath error:NULL];
// [self addPersistentStoreWithPath:storePath error:NULL];
//
// This method is invoked on the storageQueue.
#if TARGET_OS_IPHONE
XMPPLogError(@"%@:\n"
@"=====================================================================================\n"
@"Error creating persistent store:\n%@\n"
@"Chaned core data model recently?\n"
@"Quick Fix: Delete the app from device and reinstall.\n"
@"=====================================================================================",
[self class], error);
#else
XMPPLogError(@"%@:\n"
@"=====================================================================================\n"
@"Error creating persistent store:\n%@\n"
@"Chaned core data model recently?\n"
@"Quick Fix: Delete the database: %@\n"
@"=====================================================================================",
[self class], error, storePath);
#endif
}
- (void)didCreateManagedObjectContext
{
// Override me to provide customized behavior.
// For example, you may want to perform cleanup of any non-persistent data before you start using the database.
//
// This method is invoked on the storageQueue.
}
- (void)willSaveManagedObjectContext
{
// Override me if you need to do anything special just before changes are saved to disk.
//
// This method is invoked on the storageQueue.
}
- (void)didSaveManagedObjectContext
{
// Override me if you need to do anything special after changes have been saved to disk.
//
// This method is invoked on the storageQueue.
}
- (void)mainThreadManagedObjectContextDidMergeChanges
{
// Override me if you want to do anything special when changes get propogated to the main thread.
//
// This method is invoked on the main thread.
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Setup
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@synthesize databaseFileName;
@synthesize storeOptions;
- (void)commonInit
{
saveThreshold = 500;
storageQueue = dispatch_queue_create(class_getName([self class]), NULL);
storageQueueTag = &storageQueueTag;
dispatch_queue_set_specific(storageQueue, storageQueueTag, storageQueueTag, NULL);
myJidCache = [[NSMutableDictionary alloc] init];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(updateJidCache:)
name:XMPPStreamDidChangeMyJIDNotification
object:nil];
}
- (id)init
{
return [self initWithDatabaseFilename:nil storeOptions:nil];
}
- (id)initWithDatabaseFilename:(NSString *)aDatabaseFileName storeOptions:(NSDictionary *)theStoreOptions
{
if ((self = [super init]))
{
if (aDatabaseFileName)
databaseFileName = [aDatabaseFileName copy];
else
databaseFileName = [[self defaultDatabaseFileName] copy];
if(theStoreOptions)
storeOptions = theStoreOptions;
else
storeOptions = [self defaultStoreOptions];
if (![[self class] registerDatabaseFileName:databaseFileName])
{
return nil;
}
[self commonInit];
NSAssert(storageQueue != NULL, @"Subclass forgot to invoke [super commonInit]");
}
return self;
}
- (id)initWithInMemoryStore
{
if ((self = [super init]))
{
[self commonInit];
NSAssert(storageQueue != NULL, @"Subclass forgot to invoke [super commonInit]");
}
return self;
}
- (BOOL)configureWithParent:(id)aParent queue:(dispatch_queue_t)queue
{
// This is the standard configure method used by xmpp extensions to configure a storage class.
//
// Feel free to override this method if needed,
// and just invoke super at some point to make sure everything is kosher at this level as well.
NSParameterAssert(aParent != nil);
NSParameterAssert(queue != NULL);
if (queue == storageQueue)
{
// This class is designed to be run on a separate dispatch queue from its parent.
// This allows us to optimize the database save operations by buffering them,
// and executing them when demand on the storage instance is low.
return NO;
}
return YES;
}
- (NSUInteger)saveThreshold
{
if (dispatch_get_specific(storageQueueTag))
{
return saveThreshold;
}
else
{
__block NSUInteger result;
dispatch_sync(storageQueue, ^{
result = saveThreshold;
});
return result;
}
}
- (void)setSaveThreshold:(NSUInteger)newSaveThreshold
{
dispatch_block_t block = ^{
saveThreshold = newSaveThreshold;
};
if (dispatch_get_specific(storageQueueTag))
block();
else
dispatch_async(storageQueue, block);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Stream JID Caching
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// We cache a stream's myJID to avoid constantly querying the xmppStream for it.
//
// The motivation behind this is the fact that to query the xmppStream for its myJID
// requires going through the xmppStream's internal dispatch queue. (A dispatch_sync).
// It's not necessarily that this is an expensive operation,
// but the storage classes sometimes require this information for just about every operation they perform.
// For a variable that changes infrequently, caching the value can reduce some overhead.
// In addition, if we can stay out of xmppStream's internal dispatch queue,
// we free it to perform more xmpp processing tasks.
- (XMPPJID *)myJIDForXMPPStream:(XMPPStream *)stream
{
if (stream == nil) return nil;
__block XMPPJID *result = nil;
dispatch_block_t block = ^{ @autoreleasepool {
NSNumber *key = [NSNumber xmpp_numberWithPtr:(__bridge void *)stream];
result = (XMPPJID *)[myJidCache objectForKey:key];
if (!result)
{
result = [stream myJID];
if (result)
{
[myJidCache setObject:result forKey:key];
}
}
}};
if (dispatch_get_specific(storageQueueTag))
block();
else
dispatch_sync(storageQueue, block);
return result;
}
- (void)didChangeCachedMyJID:(XMPPJID *)cachedMyJID forXMPPStream:(XMPPStream *)stream
{
// Override me if you'd like to do anything special when this happens.
//
// For example, if your custom storage class prefetches data related to the current user.
}
- (void)updateJidCache:(NSNotification *)notification
{
// Notifications are delivered on the thread/queue that posted them.
// In this case, they are delivered on xmppStream's internal processing queue.
XMPPStream *stream = (XMPPStream *)[notification object];
dispatch_block_t block = ^{ @autoreleasepool {
NSNumber *key = [NSNumber xmpp_numberWithPtr:(__bridge void *)stream];
XMPPJID *cachedJID = [myJidCache objectForKey:key];
if (cachedJID)
{
XMPPJID *newJID = [stream myJID];
if (newJID)
{
if (![cachedJID isEqualToJID:newJID])
{
[myJidCache setObject:newJID forKey:key];
[self didChangeCachedMyJID:newJID forXMPPStream:stream];
}
}
else
{
[myJidCache removeObjectForKey:key];
[self didChangeCachedMyJID:nil forXMPPStream:stream];
}
}
}};
if (dispatch_get_specific(storageQueueTag))
block();
else
dispatch_async(storageQueue, block);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Core Data Setup
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- (NSString *)persistentStoreDirectory
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : NSTemporaryDirectory();
// Attempt to find a name for this application
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
if (appName == nil) {
appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
}
if (appName == nil) {
appName = @"xmppframework";
}
NSString *result = [basePath stringByAppendingPathComponent:appName];
NSFileManager *fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath:result])
{
[fileManager createDirectoryAtPath:result withIntermediateDirectories:YES attributes:nil error:nil];
}
return result;
}
- (NSManagedObjectModel *)managedObjectModel
{
// This is a public method.
// It may be invoked on any thread/queue.
__block NSManagedObjectModel *result = nil;
dispatch_block_t block = ^{ @autoreleasepool {
if (managedObjectModel)
{
result = managedObjectModel;
return;
}
NSString *momName = [self managedObjectModelName];
XMPPLogVerbose(@"%@: Creating managedObjectModel (%@)", [self class], momName);
NSString *momPath = [[self managedObjectModelBundle] pathForResource:momName ofType:@"mom"];
if (momPath == nil)
{
// The model may be versioned or created with Xcode 4, try momd as an extension.
momPath = [[self managedObjectModelBundle] pathForResource:momName ofType:@"momd"];
}
if (momPath)
{
// If path is nil, then NSURL or NSManagedObjectModel will throw an exception
NSURL *momUrl = [NSURL fileURLWithPath:momPath];
managedObjectModel = [[[NSManagedObjectModel alloc] initWithContentsOfURL:momUrl] copy];
}
else
{
XMPPLogWarn(@"%@: Couldn't find managedObjectModel file - %@", [self class], momName);
}
if([NSAttributeDescription instancesRespondToSelector:@selector(setAllowsExternalBinaryDataStorage:)])
{
if(autoAllowExternalBinaryDataStorage)
{
NSArray *entities = [managedObjectModel entities];
for(NSEntityDescription *entity in entities)
{
NSDictionary *attributesByName = [entity attributesByName];
[attributesByName enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if([obj attributeType] == NSBinaryDataAttributeType)
{
[obj setAllowsExternalBinaryDataStorage:YES];
}
}];
}
}
}
result = managedObjectModel;
}};
if (dispatch_get_specific(storageQueueTag))
block();
else
dispatch_sync(storageQueue, block);
return result;
}
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
// This is a public method.
// It may be invoked on any thread/queue.
__block NSPersistentStoreCoordinator *result = nil;
dispatch_block_t block = ^{ @autoreleasepool {
if (persistentStoreCoordinator)
{
result = persistentStoreCoordinator;
return;
}
NSManagedObjectModel *mom = [self managedObjectModel];
if (mom == nil)
{
return;
}
XMPPLogVerbose(@"%@: Creating persistentStoreCoordinator", [self class]);
persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:mom];
if (databaseFileName)
{
// SQLite persistent store
NSString *docsPath = [self persistentStoreDirectory];
NSString *storePath = [docsPath stringByAppendingPathComponent:databaseFileName];
if (storePath)
{
// If storePath is nil, then NSURL will throw an exception
[self willCreatePersistentStoreWithPath:storePath options:storeOptions];
NSError *error = nil;
BOOL didAddPersistentStore = [self addPersistentStoreWithPath:storePath options:storeOptions error:&error];
if(autoRecreateDatabaseFile && !didAddPersistentStore)
{
[[NSFileManager defaultManager] removeItemAtPath:storePath error:NULL];
didAddPersistentStore = [self addPersistentStoreWithPath:storePath options:storeOptions error:&error];
}
if (!didAddPersistentStore)
{
[self didNotAddPersistentStoreWithPath:storePath options:storeOptions error:error];
}
}
else
{
XMPPLogWarn(@"%@: Error creating persistentStoreCoordinator - Nil persistentStoreDirectory",
[self class]);
}
}
else
{
// In-Memory persistent store
[self willCreatePersistentStoreWithPath:nil options:storeOptions];
NSError *error = nil;
if (![self addPersistentStoreWithPath:nil options:storeOptions error:&error])
{
[self didNotAddPersistentStoreWithPath:nil options:storeOptions error:error];
}
}
result = persistentStoreCoordinator;
}};
if (dispatch_get_specific(storageQueueTag))
block();
else
dispatch_sync(storageQueue, block);
return result;
}
- (NSManagedObjectContext *)managedObjectContext
{
// This is a private method.
//
// NSManagedObjectContext is NOT thread-safe.
// Therefore it is VERY VERY BAD to use our private managedObjectContext outside our private storageQueue.
//
// You should NOT remove the assert statement below!
// You should NOT give external classes access to the storageQueue! (Excluding subclasses obviously.)
//
// When you want a managedObjectContext of your own (again, excluding subclasses),
// you can use the mainThreadManagedObjectContext (below),
// or you should create your own using the public persistentStoreCoordinator.
//
// If you even comtemplate ignoring this warning,
// then you need to go read the documentation for core data,
// specifically the section entitled "Concurrency with Core Data".
//
NSAssert(dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
//
// Do NOT remove the assert statment above!
// Read the comments above!
//
if (managedObjectContext)
{
return managedObjectContext;
}
NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
if (coordinator)
{
XMPPLogVerbose(@"%@: Creating managedObjectContext", [self class]);
if ([NSManagedObjectContext instancesRespondToSelector:@selector(initWithConcurrencyType:)])
managedObjectContext =
[[NSManagedObjectContext alloc] initWithConcurrencyType:NSConfinementConcurrencyType];
else
managedObjectContext = [[NSManagedObjectContext alloc] init];
managedObjectContext.persistentStoreCoordinator = coordinator;
managedObjectContext.undoManager = nil;
[self didCreateManagedObjectContext];
}
return managedObjectContext;
}
- (NSManagedObjectContext *)mainThreadManagedObjectContext
{
// NSManagedObjectContext is NOT thread-safe.
// Therefore it is VERY VERY BAD to use this managedObjectContext outside the main thread.
//
// You should NOT remove the assert statement below!
//
// When you want a managedObjectContext of your own for non-main-thread use,
// you should create your own using the public persistentStoreCoordinator.
//
// If you even comtemplate ignoring this warning,
// then you need to go read the documentation for core data,
// specifically the section entitled "Concurrency with Core Data".
//
NSAssert([NSThread isMainThread], @"Context reserved for main thread only");
//
// Do NOT remove the assert statment above!
// Read the comments above!
//
if (mainThreadManagedObjectContext)
{
return mainThreadManagedObjectContext;
}
NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
if (coordinator)
{
XMPPLogVerbose(@"%@: Creating mainThreadManagedObjectContext", [self class]);
if ([NSManagedObjectContext instancesRespondToSelector:@selector(initWithConcurrencyType:)])
mainThreadManagedObjectContext =
[[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
else
mainThreadManagedObjectContext = [[NSManagedObjectContext alloc] init];
mainThreadManagedObjectContext.persistentStoreCoordinator = coordinator;
mainThreadManagedObjectContext.undoManager = nil;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(managedObjectContextDidSave:)
name:NSManagedObjectContextDidSaveNotification
object:nil];
// Todo: If we knew that our private managedObjectContext was going to be the only one writing to the database,
// then a small optimization would be to use it as the object when registering above.
}
return mainThreadManagedObjectContext;
}
- (void)managedObjectContextDidSave:(NSNotification *)notification
{
NSManagedObjectContext *sender = (NSManagedObjectContext *)[notification object];
if ((sender != mainThreadManagedObjectContext) &&
(sender.persistentStoreCoordinator == mainThreadManagedObjectContext.persistentStoreCoordinator))
{
XMPPLogVerbose(@"%@: %@ - Merging changes into mainThreadManagedObjectContext", THIS_FILE, THIS_METHOD);
dispatch_async(dispatch_get_main_queue(), ^{
[mainThreadManagedObjectContext mergeChangesFromContextDidSaveNotification:notification];
[self mainThreadManagedObjectContextDidMergeChanges];
});
}
}
- (BOOL)autoRecreateDatabaseFile
{
__block BOOL result = NO;
dispatch_block_t block = ^{ @autoreleasepool {
result = autoRecreateDatabaseFile;
}};
if (dispatch_get_specific(storageQueueTag))
block();
else
dispatch_sync(storageQueue, block);
return result;
}
- (void)setAutoRecreateDatabaseFile:(BOOL)flag
{
dispatch_block_t block = ^{
autoRecreateDatabaseFile = flag;
};
if (dispatch_get_specific(storageQueueTag))
block();
else
dispatch_sync(storageQueue, block);
}
- (BOOL)autoAllowExternalBinaryDataStorage
{
__block BOOL result = NO;
dispatch_block_t block = ^{ @autoreleasepool {
result = autoAllowExternalBinaryDataStorage;
}};
if (dispatch_get_specific(storageQueueTag))
block();
else
dispatch_sync(storageQueue, block);
return result;
}
- (void)setAutoAllowExternalBinaryDataStorage:(BOOL)flag
{
dispatch_block_t block = ^{
autoAllowExternalBinaryDataStorage = flag;
};
if (dispatch_get_specific(storageQueueTag))
block();
else
dispatch_sync(storageQueue, block);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Utilities
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- (NSUInteger)numberOfUnsavedChanges
{
NSManagedObjectContext *moc = [self managedObjectContext];
NSUInteger unsavedCount = 0;
unsavedCount += [[moc updatedObjects] count];
unsavedCount += [[moc insertedObjects] count];
unsavedCount += [[moc deletedObjects] count];
return unsavedCount;
}
- (void)save
{
// I'm fairly confident that the implementation of [NSManagedObjectContext save:]
// internally checks to see if it has anything to save before it actually does anthing.
// So there's no need for us to do it here, especially since this method is usually
// called from maybeSave below, which already does this check.
[self willSaveManagedObjectContext];
NSError *error = nil;
if ([[self managedObjectContext] save:&error])
{
saveCount++;
[self didSaveManagedObjectContext];
}
else
{
XMPPLogWarn(@"%@: Error saving - %@ %@", [self class], error, [error userInfo]);
[[self managedObjectContext] rollback];
}
}
- (void)maybeSave:(int32_t)currentPendingRequests
{
NSAssert(dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
if ([[self managedObjectContext] hasChanges])
{
if (currentPendingRequests == 0)
{
XMPPLogVerbose(@"%@: Triggering save (pendingRequests=%i)", [self class], currentPendingRequests);
[self save];
}
else
{
NSUInteger unsavedCount = [self numberOfUnsavedChanges];
if (unsavedCount >= saveThreshold)
{
XMPPLogVerbose(@"%@: Triggering save (unsavedCount=%lu)", [self class], (unsigned long)unsavedCount);
[self save];
}
}
}
}
- (void)maybeSave
{
// Convenience method in the very rare case that a subclass would need to invoke maybeSave manually.
[self maybeSave:OSAtomicAdd32(0, &pendingRequests)];
}
- (void)executeBlock:(dispatch_block_t)block
{
// By design this method should not be invoked from the storageQueue.
//
// If you remove the assert statement below, you are destroying the sole purpose for this class,
// which is to optimize the disk IO by buffering save operations.
//
NSAssert(!dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
//
// For a full discussion of this method, please see XMPPCoreDataStorageProtocol.h
//
// dispatch_Sync
// ^
OSAtomicIncrement32(&pendingRequests);
dispatch_sync(storageQueue, ^{ @autoreleasepool {
block();
// Since this is a synchronous request, we want to return as quickly as possible.
// So we delay the maybeSave operation til later.
dispatch_async(storageQueue, ^{ @autoreleasepool {
[self maybeSave:OSAtomicDecrement32(&pendingRequests)];
}});
}});
}
- (void)scheduleBlock:(dispatch_block_t)block
{
// By design this method should not be invoked from the storageQueue.
//
// If you remove the assert statement below, you are destroying the sole purpose for this class,
// which is to optimize the disk IO by buffering save operations.
//
NSAssert(!dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
//
// For a full discussion of this method, please see XMPPCoreDataStorageProtocol.h
//
// dispatch_Async
// ^
OSAtomicIncrement32(&pendingRequests);
dispatch_async(storageQueue, ^{ @autoreleasepool {
block();
[self maybeSave:OSAtomicDecrement32(&pendingRequests)];
}});
}
- (void)scheduleBlockSync:(dispatch_block_t)block
{
// By design this method should not be invoked from the storageQueue.
//
// If you remove the assert statement below, you are destroying the sole purpose for this class,
// which is to optimize the disk IO by buffering save operations.
//
NSAssert(!dispatch_get_specific(storageQueueTag), @"Invoked on incorrect queue");
//
// For a full discussion of this method, please see XMPPCoreDataStorageProtocol.h
//
// dispatch_Async
// ^
OSAtomicIncrement32(&pendingRequests);
dispatch_sync(storageQueue, ^{ @autoreleasepool {
block();
[self maybeSave:OSAtomicDecrement32(&pendingRequests)];
}});
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Memory Management
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (databaseFileName)
{
[[self class] unregisterDatabaseFileName:databaseFileName];
}
#if !OS_OBJECT_USE_OBJC
if (storageQueue)
dispatch_release(storageQueue);
#endif
}
@end
| {
"content_hash": "3961d601b03da0443884b786bd902508",
"timestamp": "",
"source": "github",
"line_count": 949,
"max_line_length": 136,
"avg_line_length": 30.483667017913593,
"alnum_prop": 0.6512150437277472,
"repo_name": "Jianwen-Zheng/0834XMPP",
"id": "fbdcaebb1bc615822087fcba235731d71ebb6e9b",
"size": "29325",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "0834XMPP/0834XMPP/XMPP/Extensions/CoreDataStorage/XMPPCoreDataStorage.m",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "1350790"
},
{
"name": "Ruby",
"bytes": "74"
}
],
"symlink_target": ""
} |
package com.anqit.spanqit.constraint;
/**
* The SPARQL connective operators
*/
enum ConnectiveOperator implements SparqlOperator {
// Logical
AND("&&"),
OR("||"),
// Arithmetic
ADD("+"),
DIVIDE("/"),
MULTIPLY("*"),
SUBTRACT("-");
private String operator;
private ConnectiveOperator(String operator) {
this.operator = operator;
}
@Override
public String getQueryString() {
return operator;
}
} | {
"content_hash": "364a8588e70267f49b4f55947d18504e",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 51,
"avg_line_length": 15.555555555555555,
"alnum_prop": 0.669047619047619,
"repo_name": "anqit/spanqit",
"id": "5c9d6067aedb55b4f0fb8709945c7993ab6a9fc5",
"size": "420",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/anqit/spanqit/constraint/ConnectiveOperator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "147888"
}
],
"symlink_target": ""
} |
package org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.deserializer;
import java.util.Map;
import org.apache.synapse.mediators.AbstractMediator;
import org.eclipse.core.runtime.Assert;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.ui.forms.editor.FormEditor;
import org.wso2.developerstudio.eclipse.gmf.esb.ClassMediator;
import org.wso2.developerstudio.eclipse.gmf.esb.ClassProperty;
import org.wso2.developerstudio.eclipse.gmf.esb.diagram.providers.EsbElementTypes;
import org.wso2.developerstudio.eclipse.gmf.esb.internal.persistence.custom.ClassMediatorExt;
import org.wso2.developerstudio.eclipse.gmf.esb.EsbFactory;
import static org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage.Literals.*;
public class ClassMediatorDeserializer extends AbstractEsbNodeDeserializer<AbstractMediator, ClassMediator> {
@Override
public ClassMediator createNode(IGraphicalEditPart part, AbstractMediator object) {
Assert.isTrue(object instanceof ClassMediatorExt,"Unsupported mediator passed in for deserialization");
ClassMediatorExt mediator = (ClassMediatorExt) object;
final ClassMediator mediatorModel = (ClassMediator) DeserializerUtils.createNode(part, EsbElementTypes.ClassMediator_3506);
setElementToEdit(mediatorModel);
setCommonProperties(mediator, mediatorModel);
executeSetValueCommand(CLASS_MEDIATOR__CLASS_NAME, mediator.getMediatorClass());
@SuppressWarnings("unchecked")
Map<String,Object> properties = mediator.getProperties();
for (Map.Entry<String,Object> entry : properties.entrySet()) {
final ClassProperty property = EsbFactory.eINSTANCE.createClassProperty();
property.setPropertyName(entry.getKey());
property.setPropertyValue(entry.getValue().toString());
executeAddValueCommand(mediatorModel.getProperties(),property, false);
}
return mediatorModel;
}
}
| {
"content_hash": "e034e22ade2b7d1f399a7a6fac55472f",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 125,
"avg_line_length": 42.72727272727273,
"alnum_prop": 0.8202127659574469,
"repo_name": "sohaniwso2/devstudio-tooling-esb",
"id": "b38144a27148b9bce3f1bf26f3029ad55578b71a",
"size": "2487",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/custom/deserializer/ClassMediatorDeserializer.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "41285882"
},
{
"name": "Shell",
"bytes": "6640"
}
],
"symlink_target": ""
} |
@interface NodeNumbersTileView : UIView <Tile>
{
}
- (id) initWithFrame:(CGRect)rect;
@end
| {
"content_hash": "29d873b1ee1fe535eaad5c0454f717ca",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 46,
"avg_line_length": 13.285714285714286,
"alnum_prop": 0.7096774193548387,
"repo_name": "herzbube/littlego",
"id": "954200450dc33f99f79afa4c86b54b5428b68fff",
"size": "2531",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/play/nodetreeview/NodeNumbersTileView.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "3307"
},
{
"name": "C",
"bytes": "89329"
},
{
"name": "C++",
"bytes": "14685"
},
{
"name": "HTML",
"bytes": "77513"
},
{
"name": "Objective-C",
"bytes": "4668721"
},
{
"name": "Objective-C++",
"bytes": "94585"
},
{
"name": "Ruby",
"bytes": "2159"
},
{
"name": "Shell",
"bytes": "34285"
}
],
"symlink_target": ""
} |
module.exports = function(grunt) {
grunt.initConfig({
pkg: {},
handlebars: {
compile: {
options: {
namespace: 'joint.templates.halo',
processName: function(filePath) { // input: templates/handle.html
var pieces = filePath.split('/');
return pieces[pieces.length - 1]; // output: handle.html
}
},
files: {
'dist/template.js': ['templates/*']
}
}
},
watch: {
files: ['*.html'],
tasks: ['handlebars']
},
copy: {
dist: {
files: [
{ src: 'joint.ui.Halo.js', dest: 'dist/joint.ui.Halo.js' },
{ src: 'lib/handlebars.js', dest: 'dist/handlebars.js' }
]
}
},
imageEmbed: {
// Convert images to data-uris for the Halo ui plugin.
dist: {
src: [ 'halo.css' ],
dest: 'dist/halo.css',
options: {
deleteAfterEncoding : false
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-handlebars');
grunt.loadNpmTasks("grunt-image-embed");
grunt.loadNpmTasks("grunt-contrib-copy");
// Default task(s).
grunt.registerTask('default', ['handlebars', 'imageEmbed', 'copy']);
};
| {
"content_hash": "5c2ce11cb552190d3d61470d3a73a11d",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 86,
"avg_line_length": 28.214285714285715,
"alnum_prop": 0.419620253164557,
"repo_name": "LucasBassetti/nemo-platform",
"id": "7d22a3e10b39c05b12f449b4cc28872f0efa9dcb",
"size": "1580",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "br.ufes.inf.nemo.platform/src/main/webapp/core/rappid-api/plugins/ui/Halo/Gruntfile.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "473413"
},
{
"name": "CoffeeScript",
"bytes": "83631"
},
{
"name": "HTML",
"bytes": "439507"
},
{
"name": "Java",
"bytes": "66735"
},
{
"name": "JavaScript",
"bytes": "9285757"
},
{
"name": "Makefile",
"bytes": "285"
},
{
"name": "Shell",
"bytes": "2624"
}
],
"symlink_target": ""
} |
'use strict'
var $ = require('jquery')
var yo = require('yo-yo')
// -------------- styling ----------------------
// var csjs = require('csjs-inject')
var remixLib = require('remix-lib')
var styleGuide = remixLib.ui.styleGuide
var styles = styleGuide()
var css = yo`<style>
.sol.success,
.sol.error,
.sol.warning {
word-wrap: break-word;
cursor: pointer;
position: relative;
margin: 0.5em 0 1em 0;
border-radius: 5px;
line-height: 20px;
padding: 8px 15px;
}
.sol.success pre,
.sol.error pre,
.sol.warning pre {
overflow-y: hidden;
background-color: transparent;
margin: 0;
font-size: 12px;
border: 0 none;
padding: 0;
border-radius: 0;
}
.sol.success .close,
.sol.error .close,
.sol.warning .close {
font-weight: bold;
position: absolute;
color: hsl(0, 0%, 0%); /* black in style-guide.js */
top: 0;
right: 0;
padding: 0.5em;
}
.sol.error {
background-color: ${styles.rightPanel.message_Error_BackgroundColor};
border: .2em dotted ${styles.rightPanel.message_Error_BorderColor};
color: ${styles.rightPanel.message_Error_Color};
}
.sol.warning {
background-color: ${styles.rightPanel.message_Warning_BackgroundColor};
color: ${styles.rightPanel.message_Warning_Color};
}
.sol.success {
background-color: ${styles.rightPanel.message_Success_BackgroundColor};
border: .2em dotted ${styles.rightPanel.message_Success_BorderColor};
color: ${styles.rightPanel.message_Success_Color};
}</style>`
/**
* After refactor, the renderer is only used to render error/warning
* TODO: This don't need to be an object anymore. Simplify and just export the renderError function.
*
*/
function Renderer (appAPI) {
this.appAPI = appAPI
if (document && document.head) {
document.head.appendChild(css)
}
}
/**
* format msg like error or warning,
*
* @param {String or DOMElement} message
* @param {DOMElement} container
* @param {Object} options {useSpan, noAnnotations, click:(Function), type:(warning, error), errFile, errLine, errCol}
*/
Renderer.prototype.error = function (message, container, opt) {
if (container === undefined) return
opt = opt || {}
var text
if (typeof message === 'string') {
text = message
message = yo`<span>${message}</span>`
} else if (message.innerText) {
text = message.innerText
}
var errLocation = text.match(/^([^:]*):([0-9]*):(([0-9]*):)? /)
if (errLocation) {
errLocation = parseRegExError(errLocation)
opt.errFile = errLocation.errFile
opt.errLine = errLocation.errLine
opt.errCol = errLocation.errCol
}
if (!opt.noAnnotations && errLocation) {
this.appAPI.error(errLocation.errFile, {
row: errLocation.errLine,
column: errLocation.errCol,
text: text,
type: opt.type
})
}
var $pre = $(opt.useSpan ? yo`<span />` : yo`<pre />`).html(message)
var $error = $(yo`<div class="sol ${opt.type}"><div class="close"><i class="fa fa-close"></i></div></div>`).prepend($pre)
container.append($error)
$error.click((ev) => {
if (opt.errFile && opt.errLine) {
this.appAPI.errorClick(opt.errFile, opt.errLine, opt.errCol)
} else if (opt.click) {
opt.click(message)
}
})
$error.find('.close').click(function (ev) {
ev.preventDefault()
$error.remove()
return false
})
}
function parseRegExError (err) {
return {
errFile: err[1],
errLine: parseInt(err[2], 10) - 1,
errCol: err[4] ? parseInt(err[4], 10) : 0
}
}
module.exports = Renderer
| {
"content_hash": "b8fa875c9be8dcc14a07ee83185c7d60",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 123,
"avg_line_length": 24.97872340425532,
"alnum_prop": 0.6428165814877911,
"repo_name": "Yann-Liang/browser-solidity",
"id": "7e21c92ec2ab8ff064a3634a3b028ec90d11a770",
"size": "3522",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/ui/renderer.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4168"
},
{
"name": "HTML",
"bytes": "1638"
},
{
"name": "JavaScript",
"bytes": "420047"
},
{
"name": "Shell",
"bytes": "4460"
}
],
"symlink_target": ""
} |
$num_instances=1
# Used to fetch a new discovery token for a cluster of size $num_instances
$new_discovery_url="https://discovery.etcd.io/new?size=#{$num_instances}"
# To automatically replace the discovery token on 'vagrant up', uncomment
# the lines below:
#
#if File.exists?('user-data') && ARGV[0].eql?('up')
# require 'open-uri'
# require 'yaml'
#
# token = open($new_discovery_url).read
#
# data = YAML.load(IO.readlines('user-data')[1..-1].join)
# if data['coreos'].key? 'etcd'
# data['coreos']['etcd']['discovery'] = token
# end
# if data['coreos'].key? 'etcd2'
# data['coreos']['etcd2']['discovery'] = token
# end
#
# # Fix for YAML.load() converting reboot-strategy from 'off' to `false`
# if data['coreos']['update'].key? 'reboot-strategy'
# if data['coreos']['update']['reboot-strategy'] == false
# data['coreos']['update']['reboot-strategy'] = 'off'
# end
# end
#
# yaml = YAML.dump(data)
# File.open('user-data', 'w') { |file| file.write("#cloud-config\n\n#{yaml}") }
#end
#
#
# coreos-vagrant is configured through a series of configuration
# options (global ruby variables) which are detailed below. To modify
# these options, first copy this file to "config.rb". Then simply
# uncomment the necessary lines, leaving the $, and replace everything
# after the equals sign..
# Change basename of the VM
# The default value is "core", which results in VMs named starting with
# "core-01" through to "core-${num_instances}".
$instance_name_prefix="core-solr"
# Change the version of CoreOS to be installed
# To deploy a specific version, simply set $image_version accordingly.
# For example, to deploy version 709.0.0, set $image_version="709.0.0".
# The default value is "current", which points to the current version
# of the selected channel
#$image_version = "current"
# Official CoreOS channel from which updates should be downloaded
#$update_channel='alpha'
# Log the serial consoles of CoreOS VMs to log/
# Enable by setting value to true, disable with false
# WARNING: Serial logging is known to result in extremely high CPU usage with
# VirtualBox, so should only be used in debugging situations
#$enable_serial_logging=false
# Enable port forwarding of Docker TCP socket
# Set to the TCP port you want exposed on the *host* machine, default is 2375
# If 2375 is used, Vagrant will auto-increment (e.g. in the case of $num_instances > 1)
# You can then use the docker tool locally by setting the following env var:
# export DOCKER_HOST='tcp://127.0.0.1:2375'
#$expose_docker_tcp=2375
# Enable NFS sharing of your home directory ($HOME) to CoreOS
# It will be mounted at the same path in the VM as on the host.
# Example: /Users/foobar -> /Users/foobar
#$share_home=false
# Customize VMs
#$vm_gui = false
$vm_memory = 2048
$vm_cpus = 2
# Share additional folders to the CoreOS VMs
# For example,
# $shared_folders = {'/path/on/host' => '/path/on/guest', '/home/foo/app' => '/app'}
# or, to map host folders to guest folders of the same name,
# $shared_folders = Hash[*['/home/foo/app1', '/home/foo/app2'].map{|d| [d, d]}.flatten]
#$shared_folders = {}
# Enable port forwarding from guest(s) to host machine, syntax is: { 80 => 8080 }, auto correction is enabled by default.
$forwarded_ports = {}
| {
"content_hash": "9c91e5521b71640bc0fbce0b061c889c",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 121,
"avg_line_length": 36.73033707865169,
"alnum_prop": 0.6983787090853472,
"repo_name": "itsyitsy/vagrant-docker-solr5",
"id": "79522647de361d4d0e65e75b2790d5dc03d503b6",
"size": "3317",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "config.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "3050"
},
{
"name": "Ruby",
"bytes": "3317"
}
],
"symlink_target": ""
} |
import createTester from './internal/createTester';
import doParallelLimit from './internal/doParallelLimit';
import notId from './internal/notId';
/**
* The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.
*
* @name everyLimit
* @static
* @memberOf module:Collections
* @method
* @see [async.every]{@link module:Collections.every}
* @alias allLimit
* @category Collection
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {number} limit - The maximum number of async operations at a time.
* @param {AsyncFunction} iteratee - An async truth test to apply to each item
* in the collection in parallel.
* The iteratee must complete with a boolean result value.
* Invoked with (item, callback).
* @param {Function} [callback] - A callback which is called after all the
* `iteratee` functions have finished. Result will be either `true` or `false`
* depending on the values of the async tests. Invoked with (err, result).
*/
export default doParallelLimit(createTester(notId, notId));
| {
"content_hash": "fddbe00bac25c64a3540898da60ca5cb",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 114,
"avg_line_length": 43.56,
"alnum_prop": 0.7355371900826446,
"repo_name": "suguru03/async",
"id": "89a69fc019174268ed4916a002b0b5011606b984",
"size": "1089",
"binary": false,
"copies": "3",
"ref": "refs/heads/neo-async",
"path": "lib/everyLimit.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "16195"
},
{
"name": "JavaScript",
"bytes": "463683"
},
{
"name": "Makefile",
"bytes": "3526"
},
{
"name": "Shell",
"bytes": "5085"
}
],
"symlink_target": ""
} |
package pl.consdata.ico.sqcompanion.members;
import org.springframework.data.jpa.repository.JpaRepository;
public interface MemberRepository extends JpaRepository<MemberEntryEntity, String> {
Long countAllByRemoteAndRemoteType(boolean remote, String remoteType);
}
| {
"content_hash": "84237affa9ccc8597ed61379738472c0",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 84,
"avg_line_length": 38.714285714285715,
"alnum_prop": 0.8413284132841329,
"repo_name": "Consdata/sonarqube-companion",
"id": "39f337c53770027006a042a7dc6d1256f6294dff",
"size": "271",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sonarqube-companion-rest/src/main/java/pl/consdata/ico/sqcompanion/members/MemberRepository.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "583"
},
{
"name": "HTML",
"bytes": "6887"
},
{
"name": "Java",
"bytes": "387074"
},
{
"name": "JavaScript",
"bytes": "1688"
},
{
"name": "SCSS",
"bytes": "24330"
},
{
"name": "Shell",
"bytes": "647"
},
{
"name": "TypeScript",
"bytes": "175464"
}
],
"symlink_target": ""
} |
package org.apache.camel.itest.karaf;
import org.apache.camel.test.karaf.AbstractFeatureTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.junit.PaxExam;
@RunWith(PaxExam.class)
public class CamelStAXTest extends AbstractFeatureTest {
public static final String COMPONENT = "stax";
@Test
public void test() throws Exception {
testComponent(COMPONENT);
}
} | {
"content_hash": "eeed20bc384f8049c2f5a44397d6701f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 56,
"avg_line_length": 21.15,
"alnum_prop": 0.7494089834515366,
"repo_name": "erwelch/camel",
"id": "bed6b1e912d434737fc45b7c362c3125a5e1be1c",
"size": "1226",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelStAXTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "106"
},
{
"name": "CSS",
"bytes": "18641"
},
{
"name": "Eagle",
"bytes": "2898"
},
{
"name": "Elm",
"bytes": "5970"
},
{
"name": "FreeMarker",
"bytes": "12394"
},
{
"name": "Groovy",
"bytes": "52623"
},
{
"name": "HTML",
"bytes": "173627"
},
{
"name": "Java",
"bytes": "49012085"
},
{
"name": "JavaScript",
"bytes": "88124"
},
{
"name": "Protocol Buffer",
"bytes": "578"
},
{
"name": "Python",
"bytes": "36"
},
{
"name": "Ruby",
"bytes": "4802"
},
{
"name": "Scala",
"bytes": "321877"
},
{
"name": "Shell",
"bytes": "8776"
},
{
"name": "Tcl",
"bytes": "4974"
},
{
"name": "XQuery",
"bytes": "546"
},
{
"name": "XSLT",
"bytes": "287663"
}
],
"symlink_target": ""
} |
package org.openkilda.floodlight.converter;
import org.openkilda.floodlight.utils.OfAdapter;
import org.openkilda.model.MeterId;
import org.openkilda.model.SwitchId;
import org.openkilda.model.of.MeterSchema;
import org.openkilda.model.of.MeterSchemaBand;
import org.projectfloodlight.openflow.protocol.OFMeterConfig;
import org.projectfloodlight.openflow.protocol.OFMeterFlags;
import org.projectfloodlight.openflow.protocol.OFMeterMod;
import org.projectfloodlight.openflow.protocol.meterband.OFMeterBand;
import org.projectfloodlight.openflow.protocol.meterband.OFMeterBandDrop;
import org.projectfloodlight.openflow.types.DatapathId;
import java.util.Collection;
import java.util.List;
public final class MeterSchemaMapper {
public static final MeterSchemaMapper INSTANCE = new MeterSchemaMapper();
/**
* Produce {@code MeterSchema} from {@code OFMeterConfig}.
*/
public MeterSchema map(DatapathId datapathId, OFMeterConfig meterConfig, boolean isInaccurate) {
MeterSchema.MeterSchemaBuilder schema = MeterSchema.builder()
.switchId(new SwitchId(datapathId.getLong()))
.meterId(new MeterId(meterConfig.getMeterId()));
fillFlags(schema, meterConfig.getFlags());
fillBands(schema, meterConfig.getEntries(), isInaccurate);
return schema.build();
}
/**
* Produce {@code MeterSchema} from {@code OFMeterMod}.
*/
public MeterSchema map(DatapathId datapathId, OFMeterMod meterMod) {
MeterSchema.MeterSchemaBuilder schema = MeterSchema.builder()
.switchId(new SwitchId(datapathId.getLong()))
.meterId(new MeterId(meterMod.getMeterId()));
fillFlags(schema, meterMod.getFlags());
fillBands(schema, OfAdapter.INSTANCE.getMeterBands(meterMod));
return schema.build();
}
/**
* Produce string representation of {@code OFMeterFlags}.
*/
public String mapFlag(OFMeterFlags value) {
return value.name();
}
private void fillFlags(MeterSchema.MeterSchemaBuilder schema, Collection<OFMeterFlags> flagsSet) {
for (OFMeterFlags entry : flagsSet) {
schema.flag(mapFlag(entry));
}
}
private void fillBands(MeterSchema.MeterSchemaBuilder schema, List<OFMeterBand> bandsSequence) {
fillBands(schema, bandsSequence, false);
}
private void fillBands(
MeterSchema.MeterSchemaBuilder schema, List<OFMeterBand> bandsSequence, boolean isInaccurate) {
for (OFMeterBand rawBand : bandsSequence) {
MeterSchemaBand.MeterSchemaBandBuilder band = MeterSchemaBand.builder()
.type(rawBand.getType())
.inaccurate(isInaccurate);
if (rawBand instanceof OFMeterBandDrop) {
OFMeterBandDrop actualBand = (OFMeterBandDrop) rawBand;
band.rate(actualBand.getRate());
band.burstSize(actualBand.getBurstSize());
}
// do not make detailed parsing of other meter's band types
schema.band(band.build());
}
}
private MeterSchemaMapper() {}
}
| {
"content_hash": "a41c53b063af142a83627bb82fb8b2df",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 107,
"avg_line_length": 37.09411764705882,
"alnum_prop": 0.6923564858864574,
"repo_name": "jonvestal/open-kilda",
"id": "51dba0f6d4de170d12fd3123c9e6a1f3c40e29ff",
"size": "3770",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src-java/floodlight-service/floodlight-modules/src/main/java/org/openkilda/floodlight/converter/MeterSchemaMapper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "65404"
},
{
"name": "Dockerfile",
"bytes": "22398"
},
{
"name": "Gherkin",
"bytes": "88336"
},
{
"name": "Groovy",
"bytes": "70766"
},
{
"name": "HTML",
"bytes": "161798"
},
{
"name": "Java",
"bytes": "3580119"
},
{
"name": "JavaScript",
"bytes": "332794"
},
{
"name": "Makefile",
"bytes": "21113"
},
{
"name": "Python",
"bytes": "425871"
},
{
"name": "Shell",
"bytes": "39572"
}
],
"symlink_target": ""
} |
<?php
namespace common\module\mregion\backend\controllers;
use Yii;
use common\module\mregion\record\RegionCityRecord;
use common\module\mregion\search\RegionCitySearch;
use common\core\controller\ControllerBackend;
use yii\web\NotFoundHttpException;
/**
* 区域-市管理
*
* @jrbac 区域-市管理
* CityController implements the CRUD actions for RegionCityRecord model.
*/
class CityController extends ControllerBackend
{
/**
* 区域-市管理 -- 列表
*
* @jrbac 列表
* @return string
*/
public function actionIndex()
{
$searchModel = new RegionCitySearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$dataProvider->setSort(false);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* 区域-市管理 -- 详情
*
* @jrbac 详情
* @param integer $id
* @return string
* @throws NotFoundHttpException
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* 区域-市管理 -- 添加
*
* @jrbac 添加
* @return mixed
*/
public function actionCreate()
{
$model = new RegionCityRecord();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->city_id]);
}
return $this->render('create', [
'model' => $model,
]);
}
/**
* 区域-市管理 -- 编辑
*
* @jrbac 编辑
* @param integer $id
* @return mixed
* @throws NotFoundHttpException
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
$model::clearCacheById($id,'city_id');
return $this->redirect(['view', 'id' => $model->city_id]);
}
return $this->render('update', [
'model' => $model,
]);
}
/**
* 区域-市管理 -- 删除
*
* @jrbac 删除
* @param integer $id
* @return mixed
* @throws NotFoundHttpException
*/
public function actionDelete($id)
{
//is_deleted not found
\Yii::$app->getSession()->setFlash('error','unable to delete.');
return $this->redirect(['index']);
}
/**
* Finds the RegionCityRecord model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return RegionCityRecord the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = RegionCityRecord::findOne($id)) !== null) {
return $model;
}
throw new NotFoundHttpException('The requested page does not exist.');
}
}
| {
"content_hash": "33915f8b629fae6e882ad342fb0a68fb",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 78,
"avg_line_length": 23.1328125,
"alnum_prop": 0.5494765281999324,
"repo_name": "JeanWolf/plat",
"id": "ff3b0115e2d4e96b383d49f7da062f784f7981c8",
"size": "3071",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "common/module/mregion/backend/controllers/CityController.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "452783"
},
{
"name": "HTML",
"bytes": "11626"
},
{
"name": "Hack",
"bytes": "7197"
},
{
"name": "JavaScript",
"bytes": "1241249"
},
{
"name": "PHP",
"bytes": "4545873"
}
],
"symlink_target": ""
} |
import sys
import struct
import os
import threading
import string
################################################################################
if len(sys.argv) >= 9: #JWDEBUG modified to handle the extra python argument
blat_threading_pathfilename = sys.argv[0]
python_path = sys.argv[1] #JWDEBUG adding this extra agrument to call python
blat_path = sys.argv[2]
Nthread1 = int(sys.argv[3])
blat_option = ' '.join(sys.argv[4:-2])
SR_pathfilename = sys.argv[-2]
output_pathfilename = sys.argv[-1]
else:
print("usage: python2.6 blat_threading.py p -t=DNA -q=DNA ~/annotations/hg19/UCSC/hg19/Sequence/WholeGenomeFasta/genome.fa /usr/bin/python intact_SM.fa intact_SM.fa.psl")
print("or ./blat_threading.py p -t=DNA -q=DNA ~/annotations/hg19/UCSC/hg19/Sequence/WholeGenomeFasta/genome.fa /usr/bin/python intact_SM.fa intact_SM.fa.psl")
sys.exit(1)
################################################################################
def GetPathAndName(pathfilename):
ls=pathfilename.split('/')
filename=ls[-1]
path='/'.join(ls[0:-1])+'/'
if path == "/":
path = "./"
return path, filename
################################################################################
SR_path, SR_filename = GetPathAndName(SR_pathfilename)
output_path, output_filename = GetPathAndName(output_pathfilename)
bin_path2, blat_threading= GetPathAndName(blat_threading_pathfilename)
bin_path1 = bin_path2
################################################################################
SR = open(SR_pathfilename,'r')
SR_NR = 0
for line in SR:
SR_NR+=1
SR.close()
Nsplitline = 1 + (SR_NR/Nthread1)
if Nsplitline%2==1:
Nsplitline +=1
ext_ls=[]
j=0
k=0
i=0
while i <Nthread1:
ext_ls.append( '.' + string.lowercase[j] + string.lowercase[k] )
k+=1
if k==26:
j+=1
k=0
i+=1
print "===split SR:==="
splitSR_cmd = "split -l " + str(Nsplitline) + " " + SR_pathfilename + " " + output_path +SR_filename +"."
print splitSR_cmd
os.system(splitSR_cmd)
##########################################
print "===compress SR.aa:==="
i=0
T_blat_SR_ls = []
for ext in ext_ls:
blat_SR_cmd = blat_path + " " + blat_option + ' ' + output_path + SR_filename + ext + ' ' + output_path + SR_filename + ext + ".psl"
print blat_SR_cmd
T_blat_SR_ls.append( threading.Thread(target=os.system, args=(blat_SR_cmd,)) )
T_blat_SR_ls[i].start()
i+=1
for T in T_blat_SR_ls:
T.join()
i=0
T_bestblat_SR_ls = []
for ext in ext_ls:
bestblat_SR_cmd = python_path + ' ' + bin_path2 + "blat_best.py " + output_path + SR_filename + ext + '.psl 0 > ' + output_path + SR_filename + ext + ".bestpsl"
print bestblat_SR_cmd
T_bestblat_SR_ls.append( threading.Thread(target=os.system, args=(bestblat_SR_cmd,)) )
T_bestblat_SR_ls[i].start()
i+=1
for T in T_bestblat_SR_ls:
T.join()
cat_bestpsl_cmd = "cat "
rm_SR_cmd = "rm "
rm_SRpsl_cmd = "rm "
for ext in ext_ls:
cat_bestpsl_cmd = cat_bestpsl_cmd + output_path + SR_filename + ext + ".bestpsl "
rm_SR_cmd = rm_SR_cmd + output_path + SR_filename + ext + ' '
rm_SRpsl_cmd = rm_SRpsl_cmd + output_path + SR_filename + ext + '.psl '
cat_bestpsl_cmd = cat_bestpsl_cmd + " > " + output_pathfilename
print cat_bestpsl_cmd
print rm_SR_cmd
print rm_SRpsl_cmd
os.system(cat_bestpsl_cmd)
os.system(rm_SR_cmd)
os.system(rm_SRpsl_cmd)
| {
"content_hash": "17bfaf1940f106c53b3c37d4b15a681e",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 174,
"avg_line_length": 33.23529411764706,
"alnum_prop": 0.5752212389380531,
"repo_name": "jason-weirather/IDP",
"id": "eed8566e487a068ab8ff3fe7bcf1529554bf6daa",
"size": "3408",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bin/blat_threading.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "297312"
}
],
"symlink_target": ""
} |
#include "config.h"
#include "ScopedDOMDataStore.h"
namespace WebCore {
ScopedDOMDataStore::ScopedDOMDataStore()
: DOMDataStore()
{
m_domNodeMap = new DOMWrapperMap<Node>(&DOMDataStore::weakNodeCallback);
m_domObjectMap = new DOMWrapperMap<void>(&DOMDataStore::weakDOMObjectCallback);
m_activeDomObjectMap = new DOMWrapperMap<void>(&DOMDataStore::weakActiveDOMObjectCallback);
#if ENABLE(SVG)
m_domSvgElementInstanceMap = new DOMWrapperMap<SVGElementInstance>(&DOMDataStore::weakSVGElementInstanceCallback);
#endif
}
ScopedDOMDataStore::~ScopedDOMDataStore()
{
delete m_domNodeMap;
delete m_domObjectMap;
delete m_activeDomObjectMap;
#if ENABLE(SVG)
delete m_domSvgElementInstanceMap;
#endif
}
} // namespace WebCore
| {
"content_hash": "f1d49be3887210d36bbcb7afd3a2c3be",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 118,
"avg_line_length": 26.17241379310345,
"alnum_prop": 0.769433465085639,
"repo_name": "Treeeater/WebPermission",
"id": "db23eeadc87297ef87692c4755a183f37bdf1ab5",
"size": "2321",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "bindings/v8/ScopedDOMDataStore.cpp",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Assembly",
"bytes": "1301"
},
{
"name": "C",
"bytes": "1820540"
},
{
"name": "C++",
"bytes": "38574524"
},
{
"name": "Java",
"bytes": "4882"
},
{
"name": "JavaScript",
"bytes": "2238901"
},
{
"name": "Objective-C",
"bytes": "1768529"
},
{
"name": "PHP",
"bytes": "606"
},
{
"name": "Perl",
"bytes": "699893"
},
{
"name": "Prolog",
"bytes": "142937"
},
{
"name": "Python",
"bytes": "131318"
},
{
"name": "R",
"bytes": "290"
},
{
"name": "Ruby",
"bytes": "3798"
},
{
"name": "Shell",
"bytes": "52312"
}
],
"symlink_target": ""
} |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Satrabel.OpenContent
{
public partial class LogInfo
{
}
}
| {
"content_hash": "bea3b1a80516d4e9758ee0b38ef5fc6d",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 81,
"avg_line_length": 25.941176470588236,
"alnum_prop": 0.41496598639455784,
"repo_name": "janjonas/OpenContent",
"id": "cbbd51d9f37fc1e4ade31a5a1c4a5862bab8e82a",
"size": "443",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "LogInfo.ascx.designer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "50468"
},
{
"name": "Batchfile",
"bytes": "2012"
},
{
"name": "C#",
"bytes": "623469"
},
{
"name": "CSS",
"bytes": "129157"
},
{
"name": "GCC Machine Description",
"bytes": "482"
},
{
"name": "HTML",
"bytes": "74910"
},
{
"name": "JavaScript",
"bytes": "7915133"
},
{
"name": "PowerShell",
"bytes": "6772"
},
{
"name": "Ruby",
"bytes": "1845"
},
{
"name": "Shell",
"bytes": "1462"
}
],
"symlink_target": ""
} |
/**
* Test case for StopThread() jvmti function applied to thread that hangs on
* Object.wait().
*/
#include <iostream>
#include <jvmti.h>
using namespace std;
#define PACKAGE "org/apache/harmony/drlvm/tests/regression/h3341/"
static const char* EXCEPTION_CLASS = "L" PACKAGE "InvokeAgentException;";
#define TURN_EVENT(event, state) { \
jvmtiError err = turn_event(jvmti, event, state, #event); \
if (JVMTI_ERROR_NONE != err) return; \
}
#define CHECK_RESULT(func) \
if (JVMTI_ERROR_NONE != err) { \
cerr << "[JvmtiAgent] ERROR: " << #func << " failed with error: " << err << endl; \
return; \
}
#define CHECK_JNI3(result, func, error_code) { \
if (jni->ExceptionCheck()) { \
cerr << "[JvmtiAgent] ERROR: unexpected exception in " << #func << endl; \
jni->ExceptionDescribe(); \
return error_code; \
} \
if (! (result)) { \
cerr << "[JvmtiAgent] ERROR: get NULL in " << #func << endl; \
return error_code; \
} \
}
#define CHECK_JNI(result, func) CHECK_JNI3(result, func, )
static jvmtiError turn_event(jvmtiEnv* jvmti, jvmtiEvent event, bool state,
const char* event_name)
{
jvmtiError err;
err = jvmti->SetEventNotificationMode(state ? JVMTI_ENABLE : JVMTI_DISABLE,
event, NULL);
if (JVMTI_ERROR_NONE != err) {
cerr << "[JvmtiAgent] ERROR: unable to " << (state ? "en" : "dis")
<< "able " << event_name
<< endl;
}
return err;
}
static void JNICALL VMInit(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread)
{
cerr << endl << "==> VM Init callback" << endl;
TURN_EVENT(JVMTI_EVENT_EXCEPTION, true);
}
static void JNICALL
Exception(jvmtiEnv *jvmti,
JNIEnv* jni,
jthread thread,
jmethodID method,
jlocation location,
jobject exception,
jmethodID catch_method,
jlocation catch_location)
{
jvmtiError err;
jclass exn_class = jni->GetObjectClass(exception);
CHECK_JNI(exn_class, GetObjectClass);
char* class_name = NULL;
err = jvmti->GetClassSignature(exn_class, &class_name, NULL);
CHECK_RESULT(GetClassSignature);
if (0 != strcmp(EXCEPTION_CLASS, class_name))
return;
cerr << endl << "==> Exception callback" << endl;
cerr << " for class: " << class_name << endl;
TURN_EVENT(JVMTI_EVENT_EXCEPTION, false);
jfieldID thread_field = jni->GetFieldID(exn_class, "thread",
"Ljava/lang/Thread;");
CHECK_JNI(thread_field, GetFieldID);
jthread test_thread = jni->GetObjectField(exception, thread_field);
CHECK_JNI(test_thread, GetObjectField);
jfieldID exc_field = jni->GetFieldID(exn_class, "stopException",
"Ljava/lang/Throwable;");
CHECK_JNI(exc_field, GetFieldID);
jthread stop_exception = jni->GetObjectField(exception, exc_field);
CHECK_JNI(stop_exception, GetObjectField);
cerr << "Stopping test thread..." << endl;
err = jvmti->StopThread(test_thread, stop_exception);
CHECK_RESULT(StopThread);
}
JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *vm, char *options, void *reserved)
{
jvmtiEnv *jvmti = NULL;
jvmtiError err;
// Get JVMTI interface pointer
jint iRes = vm->GetEnv((void**)&jvmti, JVMTI_VERSION);
if (JNI_OK != iRes) {
cerr << "[JvmtiAgent] ERROR: unable to get JVMTI environment" << endl;
return -1;
}
// Set events callbacks
jvmtiEventCallbacks callbacks;
memset(&callbacks, 0, sizeof(jvmtiEventCallbacks));
callbacks.VMInit = VMInit;
callbacks.Exception = Exception;
err = jvmti->SetEventCallbacks(&callbacks, sizeof(jvmtiEventCallbacks));
if (JVMTI_ERROR_NONE != err) {
cerr << "[JvmtiAgent] ERROR: unable to register event callbacks" << endl;
return -1;
}
err = jvmti->SetEventNotificationMode(JVMTI_ENABLE,
JVMTI_EVENT_VM_INIT, NULL);
if (JVMTI_ERROR_NONE != err) {
cerr << "[JvmtiAgent] ERROR: unable to enable VMInit event"
<< endl;
return -1;
}
// Set capabilities
jvmtiCapabilities capabilities;
memset(&capabilities, 0, sizeof(jvmtiCapabilities));
capabilities.can_generate_exception_events = 1;
capabilities.can_signal_thread = 1;
err = jvmti->AddCapabilities(&capabilities);
if (JVMTI_ERROR_NONE != err) {
cerr << "[JvmtiAgent] ERROR: unable to possess capabilities" << endl;
return -1;
}
// Agent initialized successfully
return 0;
}
| {
"content_hash": "188f1e061d371240338fd255c783a25b",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 92,
"avg_line_length": 28.89873417721519,
"alnum_prop": 0.6206745510293473,
"repo_name": "freeVM/freeVM",
"id": "f261294dc9c492589b36b82f60cc3bf0f0f40d9e",
"size": "5378",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "enhanced/java/drlvm/src/test/regression/H3341/StopThreadInWait.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "116828"
},
{
"name": "C",
"bytes": "17860389"
},
{
"name": "C++",
"bytes": "19007206"
},
{
"name": "CSS",
"bytes": "217777"
},
{
"name": "Java",
"bytes": "152108632"
},
{
"name": "Objective-C",
"bytes": "106412"
},
{
"name": "Objective-J",
"bytes": "11029421"
},
{
"name": "Perl",
"bytes": "305690"
},
{
"name": "Scilab",
"bytes": "34"
},
{
"name": "Shell",
"bytes": "153821"
},
{
"name": "XSLT",
"bytes": "152859"
}
],
"symlink_target": ""
} |
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var session = require('express-session');
var middleware_session = require('./middlewares/session');
var routes = require('./routes/index');
var login = require('./routes/login');
var logout = require('./routes/logout');
var users = require('./routes/users');
var app = express();
// view engine setup
app.set('env','development');
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use(session({
secret: 'P057Gr35Q7',
resave: false,
saveUninitialized: false
}));
app.use('/login', login);
app.use('/logout', logout);
app.use('/users', users);
app.use('/', middleware_session, routes);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
// error handlers
// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: err
});
});
}
// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: {}
});
});
module.exports = app;
| {
"content_hash": "37e38f6cce0149bc51ed1735458efc49",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 66,
"avg_line_length": 24.28,
"alnum_prop": 0.6611751784733663,
"repo_name": "rianjara/postgresql",
"id": "459f11969a93d0287068fbf8729a37056dd2610b",
"size": "1821",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "111"
},
{
"name": "HTML",
"bytes": "6997"
},
{
"name": "JavaScript",
"bytes": "12274"
}
],
"symlink_target": ""
} |
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var register = function (editor) {
editor.addCommand('mcePrint', function () {
if (global$1.browser.isIE()) {
editor.getDoc().execCommand('print', false, null);
} else {
editor.getWin().print();
}
});
};
var Commands = { register: register };
var register$1 = function (editor) {
editor.ui.registry.addButton('print', {
icon: 'print',
tooltip: 'Print',
onAction: function () {
return editor.execCommand('mcePrint');
}
});
editor.ui.registry.addMenuItem('print', {
text: 'Print...',
icon: 'print',
onAction: function () {
return editor.execCommand('mcePrint');
}
});
};
var Buttons = { register: register$1 };
function Plugin () {
global.add('print', function (editor) {
Commands.register(editor);
Buttons.register(editor);
editor.addShortcut('Meta+P', '', 'mcePrint');
});
}
Plugin();
}());
| {
"content_hash": "218c7583196b8b74fddc6a14c44114f7",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 69,
"avg_line_length": 25,
"alnum_prop": 0.5358333333333334,
"repo_name": "cdnjs/cdnjs",
"id": "f2e91572e95ea3abe5a7755cdc0be447f3f1f572",
"size": "1483",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ajax/libs/tinymce/5.2.0/plugins/print/plugin.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package google
import (
"context"
"log"
"strings"
"testing"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)
func init() {
resource.AddTestSweepers("BigqueryDataTransferConfig", &resource.Sweeper{
Name: "BigqueryDataTransferConfig",
F: testSweepBigqueryDataTransferConfig,
})
}
// At the time of writing, the CI only passes us-central1 as the region
func testSweepBigqueryDataTransferConfig(region string) error {
resourceName := "BigqueryDataTransferConfig"
log.Printf("[INFO][SWEEPER_LOG] Starting sweeper for %s", resourceName)
config, err := sharedConfigForRegion(region)
if err != nil {
log.Printf("[INFO][SWEEPER_LOG] error getting shared config for region: %s", err)
return err
}
err = config.LoadAndValidate(context.Background())
if err != nil {
log.Printf("[INFO][SWEEPER_LOG] error loading: %s", err)
return err
}
t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)
// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}
listTemplate := strings.Split("https://bigquerydatatransfer.googleapis.com/v1/projects/{{project}}/locations/{{location}}/transferConfigs?serviceAccountName={{service_account_name}}", "?")[0]
listUrl, err := replaceVars(d, config, listTemplate)
if err != nil {
log.Printf("[INFO][SWEEPER_LOG] error preparing sweeper list url: %s", err)
return nil
}
res, err := sendRequest(config, "GET", config.Project, listUrl, config.userAgent, nil)
if err != nil {
log.Printf("[INFO][SWEEPER_LOG] Error in response from request %s: %s", listUrl, err)
return nil
}
resourceList, ok := res["configs"]
if !ok {
log.Printf("[INFO][SWEEPER_LOG] Nothing found in response.")
return nil
}
rl := resourceList.([]interface{})
log.Printf("[INFO][SWEEPER_LOG] Found %d items in %s list response.", len(rl), resourceName)
// Keep count of items that aren't sweepable for logging.
nonPrefixCount := 0
for _, ri := range rl {
obj := ri.(map[string]interface{})
if obj["name"] == nil {
log.Printf("[INFO][SWEEPER_LOG] %s resource name was nil", resourceName)
return nil
}
name := GetResourceNameFromSelfLink(obj["name"].(string))
// Skip resources that shouldn't be sweeped
if !isSweepableTestResource(name) {
nonPrefixCount++
continue
}
deleteTemplate := "https://bigquerydatatransfer.googleapis.com/v1/{{name}}"
deleteUrl, err := replaceVars(d, config, deleteTemplate)
if err != nil {
log.Printf("[INFO][SWEEPER_LOG] error preparing delete url: %s", err)
return nil
}
deleteUrl = deleteUrl + name
// Don't wait on operations as we may have a lot to delete
_, err = sendRequest(config, "DELETE", config.Project, deleteUrl, config.userAgent, nil)
if err != nil {
log.Printf("[INFO][SWEEPER_LOG] Error deleting for url %s : %s", deleteUrl, err)
} else {
log.Printf("[INFO][SWEEPER_LOG] Sent delete request for %s resource: %s", resourceName, name)
}
}
if nonPrefixCount > 0 {
log.Printf("[INFO][SWEEPER_LOG] %d items were non-sweepable and skipped.", nonPrefixCount)
}
return nil
}
| {
"content_hash": "3a0204af0b508b169703771a66182380",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 192,
"avg_line_length": 29.80909090909091,
"alnum_prop": 0.6874046965538274,
"repo_name": "GoogleCloudPlatform/k8s-config-connector",
"id": "740f88e61c0f00b822f57c40d5cdb90316d69d5d",
"size": "3823",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "third_party/github.com/hashicorp/terraform-provider-google-beta/google-beta/resource_bigquery_data_transfer_config_sweeper_test.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "13767"
},
{
"name": "Go",
"bytes": "5700747"
},
{
"name": "HTML",
"bytes": "1246"
},
{
"name": "Makefile",
"bytes": "9799"
},
{
"name": "Python",
"bytes": "31671"
},
{
"name": "Shell",
"bytes": "25436"
}
],
"symlink_target": ""
} |
from google.cloud import dialogflowcx_v3beta1
def sample_get_flow_validation_result():
# Create a client
client = dialogflowcx_v3beta1.FlowsClient()
# Initialize request argument(s)
request = dialogflowcx_v3beta1.GetFlowValidationResultRequest(
name="name_value",
)
# Make the request
response = client.get_flow_validation_result(request=request)
# Handle the response
print(response)
# [END dialogflow_v3beta1_generated_Flows_GetFlowValidationResult_sync]
| {
"content_hash": "bc70e5b231d17f18e19267fbe4f5cc8d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 71,
"avg_line_length": 26.68421052631579,
"alnum_prop": 0.7337278106508875,
"repo_name": "googleapis/python-dialogflow-cx",
"id": "1c4e0b2cee44c0eb971c2fb38293c07a301d08d9",
"size": "1917",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_validation_result_sync.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "2050"
},
{
"name": "Python",
"bytes": "10904903"
},
{
"name": "Shell",
"bytes": "30681"
}
],
"symlink_target": ""
} |
#include "sqpcheader.h"
#include "sqopcodes.h"
#include "sqvm.h"
#include "sqfuncproto.h"
#include "sqclosure.h"
#include "sqstring.h"
#include "sqtable.h"
#include "sqarray.h"
#include "squserdata.h"
#include "sqclass.h"
//SQObjectPtr _null_;
//SQObjectPtr _true_(true);
//SQObjectPtr _false_(false);
//SQObjectPtr _one_((SQInteger)1);
//SQObjectPtr _minusone_((SQInteger)-1);
SQSharedState::SQSharedState()
{
_compilererrorhandler = NULL;
_printfunc = NULL;
_errorfunc = NULL;
_debuginfo = false;
_notifyallexceptions = false;
}
#define newsysstring(s) { \
_systemstrings->push_back(SQString::Create(this,s)); \
}
#define newmetamethod(s) { \
_metamethods->push_back(SQString::Create(this,s)); \
_table(_metamethodsmap)->NewSlot(_metamethods->back(),(SQInteger)(_metamethods->size()-1)); \
}
bool CompileTypemask(SQIntVec &res,const SQChar *typemask)
{
SQInteger i = 0;
SQInteger mask = 0;
while(typemask[i] != 0) {
switch(typemask[i]){
case 'o': mask |= _RT_NULL; break;
case 'i': mask |= _RT_INTEGER; break;
case 'f': mask |= _RT_FLOAT; break;
case 'n': mask |= (_RT_FLOAT | _RT_INTEGER); break;
case 's': mask |= _RT_STRING; break;
case 't': mask |= _RT_TABLE; break;
case 'a': mask |= _RT_ARRAY; break;
case 'u': mask |= _RT_USERDATA; break;
case 'c': mask |= (_RT_CLOSURE | _RT_NATIVECLOSURE); break;
case 'b': mask |= _RT_BOOL; break;
case 'g': mask |= _RT_GENERATOR; break;
case 'p': mask |= _RT_USERPOINTER; break;
case 'v': mask |= _RT_THREAD; break;
case 'x': mask |= _RT_INSTANCE; break;
case 'y': mask |= _RT_CLASS; break;
case 'r': mask |= _RT_WEAKREF; break;
case '.': mask = -1; res.push_back(mask); i++; mask = 0; continue;
case ' ': i++; continue; //ignores spaces
default:
return false;
}
i++;
if(typemask[i] == '|') {
i++;
if(typemask[i] == 0)
return false;
continue;
}
res.push_back(mask);
mask = 0;
}
return true;
}
SQTable *CreateDefaultDelegate(SQSharedState *ss,SQRegFunction *funcz)
{
SQInteger i=0;
SQTable *t=SQTable::Create(ss,0);
while(funcz[i].name!=0){
SQNativeClosure *nc = SQNativeClosure::Create(ss,funcz[i].f,0);
nc->_nparamscheck = funcz[i].nparamscheck;
nc->_name = SQString::Create(ss,funcz[i].name);
if(funcz[i].typemask && !CompileTypemask(nc->_typecheck,funcz[i].typemask))
return NULL;
t->NewSlot(SQString::Create(ss,funcz[i].name),nc);
i++;
}
return t;
}
void SQSharedState::Init()
{
_scratchpad=NULL;
_scratchpadsize=0;
#ifndef NO_GARBAGE_COLLECTOR
_gc_chain=NULL;
#endif
_stringtable = (SQStringTable*)SQ_MALLOC(sizeof(SQStringTable));
new (_stringtable) SQStringTable(this);
sq_new(_metamethods,SQObjectPtrVec);
sq_new(_systemstrings,SQObjectPtrVec);
sq_new(_types,SQObjectPtrVec);
_metamethodsmap = SQTable::Create(this,MT_LAST-1);
//adding type strings to avoid memory trashing
//types names
newsysstring(_SC("null"));
newsysstring(_SC("table"));
newsysstring(_SC("array"));
newsysstring(_SC("closure"));
newsysstring(_SC("string"));
newsysstring(_SC("userdata"));
newsysstring(_SC("integer"));
newsysstring(_SC("float"));
newsysstring(_SC("userpointer"));
newsysstring(_SC("function"));
newsysstring(_SC("generator"));
newsysstring(_SC("thread"));
newsysstring(_SC("class"));
newsysstring(_SC("instance"));
newsysstring(_SC("bool"));
//meta methods
newmetamethod(MM_ADD);
newmetamethod(MM_SUB);
newmetamethod(MM_MUL);
newmetamethod(MM_DIV);
newmetamethod(MM_UNM);
newmetamethod(MM_MODULO);
newmetamethod(MM_SET);
newmetamethod(MM_GET);
newmetamethod(MM_TYPEOF);
newmetamethod(MM_NEXTI);
newmetamethod(MM_CMP);
newmetamethod(MM_CALL);
newmetamethod(MM_CLONED);
newmetamethod(MM_NEWSLOT);
newmetamethod(MM_DELSLOT);
newmetamethod(MM_TOSTRING);
newmetamethod(MM_NEWMEMBER);
newmetamethod(MM_INHERITED);
_constructoridx = SQString::Create(this,_SC("constructor"));
_registry = SQTable::Create(this,0);
_consts = SQTable::Create(this,0);
_table_default_delegate = CreateDefaultDelegate(this,_table_default_delegate_funcz);
_array_default_delegate = CreateDefaultDelegate(this,_array_default_delegate_funcz);
_string_default_delegate = CreateDefaultDelegate(this,_string_default_delegate_funcz);
_number_default_delegate = CreateDefaultDelegate(this,_number_default_delegate_funcz);
_closure_default_delegate = CreateDefaultDelegate(this,_closure_default_delegate_funcz);
_generator_default_delegate = CreateDefaultDelegate(this,_generator_default_delegate_funcz);
_thread_default_delegate = CreateDefaultDelegate(this,_thread_default_delegate_funcz);
_class_default_delegate = CreateDefaultDelegate(this,_class_default_delegate_funcz);
_instance_default_delegate = CreateDefaultDelegate(this,_instance_default_delegate_funcz);
_weakref_default_delegate = CreateDefaultDelegate(this,_weakref_default_delegate_funcz);
}
SQSharedState::~SQSharedState()
{
_constructoridx.Null();
_table(_registry)->Finalize();
_table(_consts)->Finalize();
_table(_metamethodsmap)->Finalize();
_registry.Null();
_consts.Null();
_metamethodsmap.Null();
while(!_systemstrings->empty()) {
_systemstrings->back().Null();
_systemstrings->pop_back();
}
_thread(_root_vm)->Finalize();
_root_vm.Null();
_table_default_delegate.Null();
_array_default_delegate.Null();
_string_default_delegate.Null();
_number_default_delegate.Null();
_closure_default_delegate.Null();
_generator_default_delegate.Null();
_thread_default_delegate.Null();
_class_default_delegate.Null();
_instance_default_delegate.Null();
_weakref_default_delegate.Null();
_refs_table.Finalize();
#ifndef NO_GARBAGE_COLLECTOR
SQCollectable *t = _gc_chain;
SQCollectable *nx = NULL;
if(t) {
t->_uiRef++;
while(t) {
t->Finalize();
nx = t->_next;
if(nx) nx->_uiRef++;
if(--t->_uiRef == 0)
t->Release();
t = nx;
}
}
assert(_gc_chain==NULL); //just to proove a theory
while(_gc_chain){
_gc_chain->_uiRef++;
_gc_chain->Release();
}
#endif
sq_delete(_types,SQObjectPtrVec);
sq_delete(_systemstrings,SQObjectPtrVec);
sq_delete(_metamethods,SQObjectPtrVec);
sq_delete(_stringtable,SQStringTable);
if(_scratchpad)SQ_FREE(_scratchpad,_scratchpadsize);
}
SQInteger SQSharedState::GetMetaMethodIdxByName(const SQObjectPtr &name)
{
if(type(name) != OT_STRING)
return -1;
SQObjectPtr ret;
if(_table(_metamethodsmap)->Get(name,ret)) {
return _integer(ret);
}
return -1;
}
#ifndef NO_GARBAGE_COLLECTOR
void SQSharedState::MarkObject(SQObjectPtr &o,SQCollectable **chain)
{
switch(type(o)){
case OT_TABLE:_table(o)->Mark(chain);break;
case OT_ARRAY:_array(o)->Mark(chain);break;
case OT_USERDATA:_userdata(o)->Mark(chain);break;
case OT_CLOSURE:_closure(o)->Mark(chain);break;
case OT_NATIVECLOSURE:_nativeclosure(o)->Mark(chain);break;
case OT_GENERATOR:_generator(o)->Mark(chain);break;
case OT_THREAD:_thread(o)->Mark(chain);break;
case OT_CLASS:_class(o)->Mark(chain);break;
case OT_INSTANCE:_instance(o)->Mark(chain);break;
case OT_OUTER:_outer(o)->Mark(chain);break;
case OT_FUNCPROTO:_funcproto(o)->Mark(chain);break;
default: break; //shutup compiler
}
}
void SQSharedState::RunMark(SQVM *vm,SQCollectable **tchain)
{
SQVM *vms = _thread(_root_vm);
vms->Mark(tchain);
_refs_table.Mark(tchain);
MarkObject(_registry,tchain);
MarkObject(_consts,tchain);
MarkObject(_metamethodsmap,tchain);
MarkObject(_table_default_delegate,tchain);
MarkObject(_array_default_delegate,tchain);
MarkObject(_string_default_delegate,tchain);
MarkObject(_number_default_delegate,tchain);
MarkObject(_generator_default_delegate,tchain);
MarkObject(_thread_default_delegate,tchain);
MarkObject(_closure_default_delegate,tchain);
MarkObject(_class_default_delegate,tchain);
MarkObject(_instance_default_delegate,tchain);
MarkObject(_weakref_default_delegate,tchain);
}
SQInteger SQSharedState::ResurrectUnreachable(SQVM *vm)
{
SQInteger n=0;
SQCollectable *tchain=NULL;
RunMark(vm,&tchain);
SQCollectable *resurrected = _gc_chain;
SQCollectable *t = resurrected;
//SQCollectable *nx = NULL;
_gc_chain = tchain;
SQArray *ret = NULL;
if(resurrected) {
ret = SQArray::Create(this,0);
SQCollectable *rlast = NULL;
while(t) {
rlast = t;
SQObjectType type = t->GetType();
if(type != OT_FUNCPROTO && type != OT_OUTER) {
SQObject sqo;
sqo._type = type;
sqo._unVal.pRefCounted = t;
ret->Append(sqo);
}
t = t->_next;
n++;
}
assert(rlast->_next == NULL);
rlast->_next = _gc_chain;
if(_gc_chain)
{
_gc_chain->_prev = rlast;
}
_gc_chain = resurrected;
}
t = _gc_chain;
while(t) {
t->UnMark();
t = t->_next;
}
if(ret) {
SQObjectPtr temp = ret;
vm->Push(temp);
}
else {
vm->PushNull();
}
return n;
}
SQInteger SQSharedState::CollectGarbage(SQVM *vm)
{
SQInteger n = 0;
SQCollectable *tchain = NULL;
RunMark(vm,&tchain);
SQCollectable *t = _gc_chain;
SQCollectable *nx = NULL;
if(t) {
t->_uiRef++;
while(t) {
t->Finalize();
nx = t->_next;
if(nx) nx->_uiRef++;
if(--t->_uiRef == 0)
t->Release();
t = nx;
n++;
}
}
t = tchain;
while(t) {
t->UnMark();
t = t->_next;
}
_gc_chain = tchain;
return n;
}
#endif
#ifndef NO_GARBAGE_COLLECTOR
void SQCollectable::AddToChain(SQCollectable **chain,SQCollectable *c)
{
c->_prev = NULL;
c->_next = *chain;
if(*chain) (*chain)->_prev = c;
*chain = c;
}
void SQCollectable::RemoveFromChain(SQCollectable **chain,SQCollectable *c)
{
if(c->_prev) c->_prev->_next = c->_next;
else *chain = c->_next;
if(c->_next)
c->_next->_prev = c->_prev;
c->_next = NULL;
c->_prev = NULL;
}
#endif
SQChar* SQSharedState::GetScratchPad(SQInteger size)
{
//TODO: Redo algo
SQInteger newsize;
if(size>0) {
if(_scratchpadsize < size) {
newsize = size + (size>>1);
_scratchpad = (SQChar *)SQ_REALLOC(_scratchpad,_scratchpadsize,newsize);
_scratchpadsize = newsize;
}else if(_scratchpadsize >= (size<<5)) {
newsize = _scratchpadsize >> 1;
_scratchpad = (SQChar *)SQ_REALLOC(_scratchpad,_scratchpadsize,newsize);
_scratchpadsize = newsize;
}
}
return _scratchpad;
}
RefTable::RefTable()
{
AllocNodes(4);
}
void RefTable::Finalize()
{
RefNode *nodes = _nodes;
for(SQUnsignedInteger n = 0; n < _numofslots; n++) {
nodes->obj.Null();
nodes++;
}
}
RefTable::~RefTable()
{
SQ_FREE(_buckets,(_numofslots * sizeof(RefNode *)) + (_numofslots * sizeof(RefNode)));
}
#ifndef NO_GARBAGE_COLLECTOR
void RefTable::Mark(SQCollectable **chain)
{
RefNode *nodes = (RefNode *)_nodes;
for(SQUnsignedInteger n = 0; n < _numofslots; n++) {
if(type(nodes->obj) != OT_NULL) {
SQSharedState::MarkObject(nodes->obj,chain);
}
nodes++;
}
}
#endif
void RefTable::AddRef(SQObject &obj)
{
SQHash mainpos;
RefNode *prev;
RefNode *ref = Get(obj,mainpos,&prev,true);
ref->refs++;
}
SQUnsignedInteger RefTable::GetRefCount(SQObject &obj)
{
SQHash mainpos;
RefNode *prev;
RefNode *ref = Get(obj,mainpos,&prev,true);
return ref->refs;
}
SQBool RefTable::Release(SQObject &obj)
{
SQHash mainpos;
RefNode *prev;
RefNode *ref = Get(obj,mainpos,&prev,false);
if(ref) {
if(--ref->refs == 0) {
SQObjectPtr o = ref->obj;
if(prev) {
prev->next = ref->next;
}
else {
_buckets[mainpos] = ref->next;
}
ref->next = _freelist;
_freelist = ref;
_slotused--;
ref->obj.Null();
//<<FIXME>>test for shrink?
return SQTrue;
}
}
else {
assert(0);
}
return SQFalse;
}
void RefTable::Resize(SQUnsignedInteger size)
{
RefNode **oldbucks = _buckets;
RefNode *t = _nodes;
SQUnsignedInteger oldnumofslots = _numofslots;
AllocNodes(size);
//rehash
SQUnsignedInteger nfound = 0;
for(SQUnsignedInteger n = 0; n < oldnumofslots; n++) {
if(type(t->obj) != OT_NULL) {
//add back;
assert(t->refs != 0);
RefNode *nn = Add(::HashObj(t->obj)&(_numofslots-1),t->obj);
nn->refs = t->refs;
t->obj.Null();
nfound++;
}
t++;
}
assert(nfound == oldnumofslots);
SQ_FREE(oldbucks,(oldnumofslots * sizeof(RefNode *)) + (oldnumofslots * sizeof(RefNode)));
}
RefTable::RefNode *RefTable::Add(SQHash mainpos,SQObject &obj)
{
RefNode *t = _buckets[mainpos];
RefNode *newnode = _freelist;
newnode->obj = obj;
_buckets[mainpos] = newnode;
_freelist = _freelist->next;
newnode->next = t;
assert(newnode->refs == 0);
_slotused++;
return newnode;
}
RefTable::RefNode *RefTable::Get(SQObject &obj,SQHash &mainpos,RefNode **prev,bool add)
{
RefNode *ref;
mainpos = ::HashObj(obj)&(_numofslots-1);
*prev = NULL;
for (ref = _buckets[mainpos]; ref; ) {
if(_rawval(ref->obj) == _rawval(obj) && type(ref->obj) == type(obj))
break;
*prev = ref;
ref = ref->next;
}
if(ref == NULL && add) {
if(_numofslots == _slotused) {
assert(_freelist == 0);
Resize(_numofslots*2);
mainpos = ::HashObj(obj)&(_numofslots-1);
}
ref = Add(mainpos,obj);
}
return ref;
}
void RefTable::AllocNodes(SQUnsignedInteger size)
{
RefNode **bucks;
RefNode *nodes;
bucks = (RefNode **)SQ_MALLOC((size * sizeof(RefNode *)) + (size * sizeof(RefNode)));
nodes = (RefNode *)&bucks[size];
RefNode *temp = nodes;
SQUnsignedInteger n;
for(n = 0; n < size - 1; n++) {
bucks[n] = NULL;
temp->refs = 0;
new (&temp->obj) SQObjectPtr;
temp->next = temp+1;
temp++;
}
bucks[n] = NULL;
temp->refs = 0;
new (&temp->obj) SQObjectPtr;
temp->next = NULL;
_freelist = nodes;
_nodes = nodes;
_buckets = bucks;
_slotused = 0;
_numofslots = size;
}
//////////////////////////////////////////////////////////////////////////
//SQStringTable
/*
* The following code is based on Lua 4.0 (Copyright 1994-2002 Tecgraf, PUC-Rio.)
* http://www.lua.org/copyright.html#4
* http://www.lua.org/source/4.0.1/src_lstring.c.html
*/
SQStringTable::SQStringTable(SQSharedState *ss)
{
_sharedstate = ss;
AllocNodes(4);
_slotused = 0;
}
SQStringTable::~SQStringTable()
{
SQ_FREE(_strings,sizeof(SQString*)*_numofslots);
_strings = NULL;
}
void SQStringTable::AllocNodes(SQInteger size)
{
_numofslots = size;
_strings = (SQString**)SQ_MALLOC(sizeof(SQString*)*_numofslots);
memset(_strings,0,sizeof(SQString*)*_numofslots);
}
SQString *SQStringTable::Add(const SQChar *news,SQInteger len)
{
if(len<0)
len = (SQInteger)scstrlen(news);
SQHash newhash = ::_hashstr(news,len);
SQHash h = newhash&(_numofslots-1);
SQString *s;
for (s = _strings[h]; s; s = s->_next){
if(s->_len == len && (!memcmp(news,s->_val,rsl(len))))
return s; //found
}
SQString *t = (SQString *)SQ_MALLOC(rsl(len)+sizeof(SQString));
new (t) SQString;
t->_sharedstate = _sharedstate;
memcpy(t->_val,news,rsl(len));
t->_val[len] = _SC('\0');
t->_len = len;
t->_hash = newhash;
t->_next = _strings[h];
_strings[h] = t;
_slotused++;
if (_slotused > _numofslots) /* too crowded? */
Resize(_numofslots*2);
return t;
}
void SQStringTable::Resize(SQInteger size)
{
SQInteger oldsize=_numofslots;
SQString **oldtable=_strings;
AllocNodes(size);
for (SQInteger i=0; i<oldsize; i++){
SQString *p = oldtable[i];
while(p){
SQString *next = p->_next;
SQHash h = p->_hash&(_numofslots-1);
p->_next = _strings[h];
_strings[h] = p;
p = next;
}
}
SQ_FREE(oldtable,oldsize*sizeof(SQString*));
}
void SQStringTable::Remove(SQString *bs)
{
SQString *s;
SQString *prev=NULL;
SQHash h = bs->_hash&(_numofslots - 1);
for (s = _strings[h]; s; ){
if(s == bs){
if(prev)
prev->_next = s->_next;
else
_strings[h] = s->_next;
_slotused--;
SQInteger slen = s->_len;
s->~SQString();
SQ_FREE(s,sizeof(SQString) + rsl(slen));
return;
}
prev = s;
s = s->_next;
}
assert(0);//if this fail something is wrong
}
| {
"content_hash": "3a2eed9ae9ac899c7acded3080b6dd9d",
"timestamp": "",
"source": "github",
"line_count": 654,
"max_line_length": 94,
"avg_line_length": 23.96330275229358,
"alnum_prop": 0.6581163859111792,
"repo_name": "pfalcon/squirrel-lang",
"id": "07f5ac2db7d0a2a664938dba8d2f55858de319d7",
"size": "15713",
"binary": false,
"copies": "1",
"ref": "refs/heads/squirrel3-genpurpose",
"path": "squirrel/sqstate.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "52482"
},
{
"name": "C++",
"bytes": "339541"
},
{
"name": "Shell",
"bytes": "727"
},
{
"name": "Squirrel",
"bytes": "88"
}
],
"symlink_target": ""
} |
namespace task_management {
namespace {
TaskManagerIoThreadHelper* g_io_thread_helper = nullptr;
} // namespace
IoThreadHelperManager::IoThreadHelperManager() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
content::BrowserThread::PostTask(
content::BrowserThread::IO,
FROM_HERE,
base::Bind(&TaskManagerIoThreadHelper::CreateInstance));
}
IoThreadHelperManager::~IoThreadHelperManager() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
content::BrowserThread::PostTask(
content::BrowserThread::IO,
FROM_HERE,
base::Bind(&TaskManagerIoThreadHelper::DeleteInstance));
}
// static
void TaskManagerIoThreadHelper::CreateInstance() {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
DCHECK(!g_io_thread_helper);
g_io_thread_helper = new TaskManagerIoThreadHelper;
}
// static
void TaskManagerIoThreadHelper::DeleteInstance() {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
delete g_io_thread_helper;
g_io_thread_helper = nullptr;
}
// static
void TaskManagerIoThreadHelper::OnRawBytesRead(const net::URLRequest& request,
int bytes_read) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (g_io_thread_helper)
g_io_thread_helper->OnNetworkBytesRead(request, bytes_read);
}
TaskManagerIoThreadHelper::TaskManagerIoThreadHelper()
: bytes_read_buffer_() {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
}
TaskManagerIoThreadHelper::~TaskManagerIoThreadHelper() {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
}
// static
void TaskManagerIoThreadHelper::OnMultipleBytesReadIO() {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (!g_io_thread_helper)
return;
DCHECK(!g_io_thread_helper->bytes_read_buffer_.empty());
std::vector<BytesReadParam>* bytes_read_buffer =
new std::vector<BytesReadParam>();
g_io_thread_helper->bytes_read_buffer_.swap(*bytes_read_buffer);
content::BrowserThread::PostTask(
content::BrowserThread::UI,
FROM_HERE,
base::Bind(&TaskManagerImpl::OnMultipleBytesReadUI,
base::Owned(bytes_read_buffer)));
}
void TaskManagerIoThreadHelper::OnNetworkBytesRead(
const net::URLRequest& request, int bytes_read) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
// Only net::URLRequestJob instances created by the ResourceDispatcherHost
// have an associated ResourceRequestInfo and a render frame associated.
// All other jobs will have -1 returned for the render process child and
// routing ids - the jobs may still match a resource based on their origin id,
// otherwise BytesRead() will attribute the activity to the Browser resource.
const content::ResourceRequestInfo* info =
content::ResourceRequestInfo::ForRequest(&request);
int child_id = -1;
int route_id = -1;
if (info)
info->GetAssociatedRenderFrame(&child_id, &route_id);
// Get the origin PID of the request's originator. This will only be set for
// plugins - for renderer or browser initiated requests it will be zero.
int origin_pid = info ? info->GetOriginPID() : 0;
if (bytes_read_buffer_.empty()) {
// Schedule a task to process the received bytes requests a second from now.
// We're trying to calculate the tasks' network usage speed as bytes per
// second so we collect as many requests during one seconds before the below
// delayed TaskManagerIoThreadHelper::OnMultipleBytesReadIO() process them
// after one second from now.
content::BrowserThread::PostDelayedTask(
content::BrowserThread::IO,
FROM_HERE,
base::Bind(TaskManagerIoThreadHelper::OnMultipleBytesReadIO),
base::TimeDelta::FromSeconds(1));
}
bytes_read_buffer_.push_back(
BytesReadParam(origin_pid, child_id, route_id, bytes_read));
}
} // namespace task_management
| {
"content_hash": "e496e59ae049305a9decd362a3591d08",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 80,
"avg_line_length": 32.559322033898304,
"alnum_prop": 0.7191566892243623,
"repo_name": "Pluto-tv/chromium-crosswalk",
"id": "262540ad0931c86ffb6ff71a1ee5c5afbf8d606b",
"size": "4273",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "chrome/browser/task_management/sampling/task_manager_io_thread_helper.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AppleScript",
"bytes": "6973"
},
{
"name": "Arduino",
"bytes": "464"
},
{
"name": "Assembly",
"bytes": "37073"
},
{
"name": "Batchfile",
"bytes": "8451"
},
{
"name": "C",
"bytes": "9548418"
},
{
"name": "C++",
"bytes": "244899104"
},
{
"name": "CSS",
"bytes": "946931"
},
{
"name": "DM",
"bytes": "60"
},
{
"name": "Groff",
"bytes": "2494"
},
{
"name": "HTML",
"bytes": "27337866"
},
{
"name": "Java",
"bytes": "15149798"
},
{
"name": "JavaScript",
"bytes": "20716348"
},
{
"name": "Makefile",
"bytes": "70864"
},
{
"name": "Objective-C",
"bytes": "1764480"
},
{
"name": "Objective-C++",
"bytes": "10068706"
},
{
"name": "PHP",
"bytes": "97817"
},
{
"name": "PLpgSQL",
"bytes": "178732"
},
{
"name": "Perl",
"bytes": "63937"
},
{
"name": "Protocol Buffer",
"bytes": "486852"
},
{
"name": "Python",
"bytes": "8518224"
},
{
"name": "Shell",
"bytes": "486537"
},
{
"name": "Standard ML",
"bytes": "5106"
},
{
"name": "XSLT",
"bytes": "418"
},
{
"name": "nesC",
"bytes": "18347"
}
],
"symlink_target": ""
} |
/*! OpenPGP.js v4.10.9 - 2020-12-07 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function (global){
// GPG4Browsers - An OpenPGP implementation in javascript
// Copyright (C) 2011 Recurity Labs GmbH
//
// 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 3.0 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
/* eslint-disable no-restricted-globals */
/* eslint-disable no-var */
/* eslint-disable vars-on-top */
/**
* @fileoverview Provides functions for communicating with workers
* @see module:openpgp.initWorker
* @see module:openpgp.getWorker
* @see module:openpgp.destroyWorker
* @see module:worker/async_proxy
* @module worker/worker
*/
importScripts('openpgp.js');
var openpgp = global.openpgp;
var randomQueue = [];
var MAX_SIZE_RANDOM_BUFFER = 60000;
/**
* Handle random buffer exhaustion by requesting more random bytes from the main window
* @returns {Promise<Object>} Empty promise whose resolution indicates that the buffer has been refilled
*/
function randomCallback() {
if (!randomQueue.length) {
self.postMessage({ event: 'request-seed', amount: MAX_SIZE_RANDOM_BUFFER });
}
return new Promise(function(resolve) {
randomQueue.push(resolve);
});
}
openpgp.crypto.random.randomBuffer.init(MAX_SIZE_RANDOM_BUFFER, randomCallback);
/**
* Handle messages from the main window.
* @param {Object} event Contains event type and data
*/
self.onmessage = function(event) {
var msg = event.data || {};
switch (msg.event) {
case 'configure':
configure(msg.config);
break;
case 'seed-random':
seedRandom(msg.buf);
var queueCopy = randomQueue;
randomQueue = [];
for (var i = 0; i < queueCopy.length; i++) {
queueCopy[i]();
}
break;
default:
delegate(msg.id, msg.event, msg.options || {});
}
};
/**
* Set config from main context to worker context.
* @param {Object} config The openpgp configuration
*/
function configure(config) {
Object.keys(config).forEach(function(key) {
openpgp.config[key] = config[key];
});
}
/**
* Seed the library with entropy gathered global.crypto.getRandomValues
* as this api is only avalible in the main window.
* @param {ArrayBuffer} buffer Some random bytes
*/
function seedRandom(buffer) {
if (!(buffer instanceof Uint8Array)) {
buffer = new Uint8Array(buffer);
}
openpgp.crypto.random.randomBuffer.set(buffer);
}
const keyCache = new Map();
function getCachedKey(key) {
const armor = key.armor();
if (keyCache.has(armor)) {
return keyCache.get(armor);
}
keyCache.set(armor, key);
return key;
}
/**
* Generic proxy function that handles all commands from the public api.
* @param {String} method The public api function to be delegated to the worker thread
* @param {Object} options The api function's options
*/
function delegate(id, method, options) {
if (method === 'clear-key-cache') {
Array.from(keyCache.values()).forEach(key => {
if (key.isPrivate()) {
key.clearPrivateParams();
}
});
keyCache.clear();
response({ id, event: 'method-return' });
return;
}
if (typeof openpgp[method] !== 'function') {
response({ id:id, event:'method-return', err:'Unknown Worker Event' });
return;
}
// construct ReadableStreams from MessagePorts
openpgp.util.restoreStreams(options);
// parse cloned packets
options = openpgp.packet.clone.parseClonedPackets(options, method);
// cache keys by armor, so that we don't have to repeatedly verify self-signatures
if (options.publicKeys) {
options.publicKeys = options.publicKeys.map(getCachedKey);
}
if (options.privateKeys) {
options.privateKeys = options.privateKeys.map(getCachedKey);
}
openpgp[method](options).then(function(data) {
// clone packets (for web worker structured cloning algorithm)
response({ id:id, event:'method-return', data:openpgp.packet.clone.clonePackets(data) });
}).catch(function(e) {
openpgp.util.print_debug_error(e);
response({
id:id, event:'method-return', err:e.message, stack:e.stack
});
});
}
/**
* Respond to the main window.
* @param {Object} event Contains event type and data
*/
function response(event) {
self.postMessage(event, openpgp.util.getTransferables(event.data, openpgp.config.zero_copy));
}
/**
* Let the main window know the worker has loaded.
*/
postMessage({ event: 'loaded' });
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[1]);
| {
"content_hash": "b4aee3c2a50e7f3cec4530182c5b3d40",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 497,
"avg_line_length": 33.29479768786127,
"alnum_prop": 0.6854166666666667,
"repo_name": "cdnjs/cdnjs",
"id": "0c13508b639fc19a1b98c2682b5895056a26b563",
"size": "5760",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "ajax/libs/openpgp/4.10.9/lightweight/openpgp.worker.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
layout: post
date: 2016-05-22
title: "Enzoani irina Sleeveless Chapel Train Mermaid/Trumpet"
category: Enzoani
tags: [Enzoani,Mermaid/Trumpet,Straps,Chapel Train,Sleeveless]
---
### Enzoani irina
Just **$309.99**
### Sleeveless Chapel Train Mermaid/Trumpet
<table><tr><td>BRANDS</td><td>Enzoani</td></tr><tr><td>Silhouette</td><td>Mermaid/Trumpet</td></tr><tr><td>Neckline</td><td>Straps</td></tr><tr><td>Hemline/Train</td><td>Chapel Train</td></tr><tr><td>Sleeve</td><td>Sleeveless</td></tr></table>
<a href="https://www.readybrides.com/en/enzoani/4848-enzoani-irina.html"><img src="//img.readybrides.com/10277/enzoani-irina.jpg" alt="Enzoani irina" style="width:100%;" /></a>
<!-- break --><a href="https://www.readybrides.com/en/enzoani/4848-enzoani-irina.html"><img src="//img.readybrides.com/10278/enzoani-irina.jpg" alt="Enzoani irina" style="width:100%;" /></a>
<a href="https://www.readybrides.com/en/enzoani/4848-enzoani-irina.html"><img src="//img.readybrides.com/10276/enzoani-irina.jpg" alt="Enzoani irina" style="width:100%;" /></a>
Buy it: [https://www.readybrides.com/en/enzoani/4848-enzoani-irina.html](https://www.readybrides.com/en/enzoani/4848-enzoani-irina.html)
| {
"content_hash": "d83ae40ed25874f1e5ebf5e372e3d1ac",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 243,
"avg_line_length": 79.13333333333334,
"alnum_prop": 0.7186183656276327,
"repo_name": "HOLEIN/HOLEIN.github.io",
"id": "1d85695541115e21c5f83e0afb3b32ca6250a3d8",
"size": "1191",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2016-05-22-Enzoani-irina-Sleeveless-Chapel-Train-MermaidTrumpet.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "83876"
},
{
"name": "HTML",
"bytes": "14547"
},
{
"name": "Ruby",
"bytes": "897"
}
],
"symlink_target": ""
} |
package redshiftserverless
import (
"github.com/aws/aws-sdk-go/private/protocol"
)
const (
// ErrCodeAccessDeniedException for service response error code
// "AccessDeniedException".
//
// You do not have sufficient access to perform this action.
ErrCodeAccessDeniedException = "AccessDeniedException"
// ErrCodeConflictException for service response error code
// "ConflictException".
//
// The submitted action has conflicts.
ErrCodeConflictException = "ConflictException"
// ErrCodeInsufficientCapacityException for service response error code
// "InsufficientCapacityException".
//
// There is an insufficient capacity to perform the action.
ErrCodeInsufficientCapacityException = "InsufficientCapacityException"
// ErrCodeInternalServerException for service response error code
// "InternalServerException".
//
// The request processing has failed because of an unknown error, exception
// or failure.
ErrCodeInternalServerException = "InternalServerException"
// ErrCodeInvalidPaginationException for service response error code
// "InvalidPaginationException".
//
// The provided pagination token is invalid.
ErrCodeInvalidPaginationException = "InvalidPaginationException"
// ErrCodeResourceNotFoundException for service response error code
// "ResourceNotFoundException".
//
// The resource could not be found.
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
// ErrCodeServiceQuotaExceededException for service response error code
// "ServiceQuotaExceededException".
//
// The service limit was exceeded.
ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException"
// ErrCodeThrottlingException for service response error code
// "ThrottlingException".
//
// The request was denied due to request throttling.
ErrCodeThrottlingException = "ThrottlingException"
// ErrCodeTooManyTagsException for service response error code
// "TooManyTagsException".
//
// The request exceeded the number of tags allowed for a resource.
ErrCodeTooManyTagsException = "TooManyTagsException"
// ErrCodeValidationException for service response error code
// "ValidationException".
//
// The input failed to satisfy the constraints specified by an AWS service.
ErrCodeValidationException = "ValidationException"
)
var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
"AccessDeniedException": newErrorAccessDeniedException,
"ConflictException": newErrorConflictException,
"InsufficientCapacityException": newErrorInsufficientCapacityException,
"InternalServerException": newErrorInternalServerException,
"InvalidPaginationException": newErrorInvalidPaginationException,
"ResourceNotFoundException": newErrorResourceNotFoundException,
"ServiceQuotaExceededException": newErrorServiceQuotaExceededException,
"ThrottlingException": newErrorThrottlingException,
"TooManyTagsException": newErrorTooManyTagsException,
"ValidationException": newErrorValidationException,
}
| {
"content_hash": "41762d0224dd8097031cd8d37f67bf02",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 76,
"avg_line_length": 37.03658536585366,
"alnum_prop": 0.7984853473822852,
"repo_name": "aws/aws-sdk-go",
"id": "79aa2ea94efc6922b9d67503c25abb7a67eef181",
"size": "3107",
"binary": false,
"copies": "3",
"ref": "refs/heads/main",
"path": "service/redshiftserverless/errors.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "3388529"
},
{
"name": "Makefile",
"bytes": "6128"
},
{
"name": "Roff",
"bytes": "1330"
}
],
"symlink_target": ""
} |
{-# language CPP #-}
-- | = Name
--
-- VK_EXT_global_priority - device extension
--
-- == VK_EXT_global_priority
--
-- [__Name String__]
-- @VK_EXT_global_priority@
--
-- [__Extension Type__]
-- Device extension
--
-- [__Registered Extension Number__]
-- 175
--
-- [__Revision__]
-- 2
--
-- [__Extension and Version Dependencies__]
--
-- - Requires support for Vulkan 1.0
--
-- [__Deprecation state__]
--
-- - /Promoted/ to @VK_KHR_global_priority@ extension
--
-- [__Contact__]
--
-- - Andres Rodriguez
-- <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_global_priority] @lostgoat%0A*Here describe the issue or question you have about the VK_EXT_global_priority extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
-- 2017-10-06
--
-- [__IP Status__]
-- No known IP claims.
--
-- [__Contributors__]
--
-- - Andres Rodriguez, Valve
--
-- - Pierre-Loup Griffais, Valve
--
-- - Dan Ginsburg, Valve
--
-- - Mitch Singer, AMD
--
-- == Description
--
-- In Vulkan, users can specify device-scope queue priorities. In some
-- cases it may be useful to extend this concept to a system-wide scope.
-- This extension provides a mechanism for callers to set their system-wide
-- priority. The default queue priority is
-- 'Vulkan.Extensions.VK_KHR_global_priority.QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT'.
--
-- The driver implementation will attempt to skew hardware resource
-- allocation in favour of the higher-priority task. Therefore,
-- higher-priority work may retain similar latency and throughput
-- characteristics even if the system is congested with lower priority
-- work.
--
-- The global priority level of a queue shall take precedence over the
-- per-process queue priority
-- ('Vulkan.Core10.Device.DeviceQueueCreateInfo'::@pQueuePriorities@).
--
-- Abuse of this feature may result in starving the rest of the system from
-- hardware resources. Therefore, the driver implementation may deny
-- requests to acquire a priority above the default priority
-- ('Vulkan.Extensions.VK_KHR_global_priority.QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT')
-- if the caller does not have sufficient privileges. In this scenario
-- 'ERROR_NOT_PERMITTED_EXT' is returned.
--
-- The driver implementation may fail the queue allocation request if
-- resources required to complete the operation have been exhausted (either
-- by the same process or a different process). In this scenario
-- 'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED' is returned.
--
-- == New Structures
--
-- - Extending 'Vulkan.Core10.Device.DeviceQueueCreateInfo':
--
-- - 'DeviceQueueGlobalPriorityCreateInfoEXT'
--
-- == New Enums
--
-- - 'QueueGlobalPriorityEXT'
--
-- == New Enum Constants
--
-- - 'EXT_GLOBAL_PRIORITY_EXTENSION_NAME'
--
-- - 'EXT_GLOBAL_PRIORITY_SPEC_VERSION'
--
-- - Extending 'Vulkan.Core10.Enums.Result.Result':
--
-- - 'ERROR_NOT_PERMITTED_EXT'
--
-- - Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
-- - 'STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT'
--
-- == Version History
--
-- - Revision 2, 2017-11-03 (Andres Rodriguez)
--
-- - Fixed VkQueueGlobalPriorityEXT missing _EXT suffix
--
-- - Revision 1, 2017-10-06 (Andres Rodriguez)
--
-- - First version.
--
-- == See Also
--
-- 'DeviceQueueGlobalPriorityCreateInfoEXT', 'QueueGlobalPriorityEXT'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_EXT_global_priority Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_EXT_global_priority ( pattern STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT
, pattern ERROR_NOT_PERMITTED_EXT
, QueueGlobalPriorityEXT
, DeviceQueueGlobalPriorityCreateInfoEXT
, EXT_GLOBAL_PRIORITY_SPEC_VERSION
, pattern EXT_GLOBAL_PRIORITY_SPEC_VERSION
, EXT_GLOBAL_PRIORITY_EXTENSION_NAME
, pattern EXT_GLOBAL_PRIORITY_EXTENSION_NAME
, DeviceQueueGlobalPriorityCreateInfoKHR(..)
, QueueGlobalPriorityKHR(..)
) where
import Data.String (IsString)
import Vulkan.Extensions.VK_KHR_global_priority (DeviceQueueGlobalPriorityCreateInfoKHR)
import Vulkan.Extensions.VK_KHR_global_priority (QueueGlobalPriorityKHR)
import Vulkan.Core10.Enums.Result (Result(ERROR_NOT_PERMITTED_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR))
import Vulkan.Extensions.VK_KHR_global_priority (DeviceQueueGlobalPriorityCreateInfoKHR(..))
import Vulkan.Extensions.VK_KHR_global_priority (QueueGlobalPriorityKHR(..))
-- No documentation found for TopLevel "VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR
-- No documentation found for TopLevel "VK_ERROR_NOT_PERMITTED_EXT"
pattern ERROR_NOT_PERMITTED_EXT = ERROR_NOT_PERMITTED_KHR
-- No documentation found for TopLevel "VkQueueGlobalPriorityEXT"
type QueueGlobalPriorityEXT = QueueGlobalPriorityKHR
-- No documentation found for TopLevel "VkDeviceQueueGlobalPriorityCreateInfoEXT"
type DeviceQueueGlobalPriorityCreateInfoEXT = DeviceQueueGlobalPriorityCreateInfoKHR
type EXT_GLOBAL_PRIORITY_SPEC_VERSION = 2
-- No documentation found for TopLevel "VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION"
pattern EXT_GLOBAL_PRIORITY_SPEC_VERSION :: forall a . Integral a => a
pattern EXT_GLOBAL_PRIORITY_SPEC_VERSION = 2
type EXT_GLOBAL_PRIORITY_EXTENSION_NAME = "VK_EXT_global_priority"
-- No documentation found for TopLevel "VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME"
pattern EXT_GLOBAL_PRIORITY_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern EXT_GLOBAL_PRIORITY_EXTENSION_NAME = "VK_EXT_global_priority"
| {
"content_hash": "816ddb422445f1718c4659b3014092df",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 200,
"avg_line_length": 37.127167630057805,
"alnum_prop": 0.679277596138876,
"repo_name": "expipiplus1/vulkan",
"id": "ecb64ed17b1f1e24d7da44facf1d3b879d9b39d2",
"size": "6423",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/Vulkan/Extensions/VK_EXT_global_priority.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "32098"
},
{
"name": "C++",
"bytes": "507"
},
{
"name": "Dhall",
"bytes": "255"
},
{
"name": "Haskell",
"bytes": "20535939"
},
{
"name": "Nix",
"bytes": "8816"
},
{
"name": "Shell",
"bytes": "10458"
}
],
"symlink_target": ""
} |
class Array
def as_home_files
self.map{|item| item.as_home_file}
end
def as_glob_pattern
File.join(self)
end
end
| {
"content_hash": "8e1c8b116dd192d31669288763b9ebf3",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 38,
"avg_line_length": 14.444444444444445,
"alnum_prop": 0.6615384615384615,
"repo_name": "developwithpassion/expansions",
"id": "a23705561ca3e70653f944e4f1bd7ae437cdec24",
"size": "130",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/expansions/array.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "39640"
}
],
"symlink_target": ""
} |
module.exports = function(config) {
config.set({
plugins: ['karma-jasmine', 'karma-coverage'],
reporters: ['progress']
});
};
| {
"content_hash": "5ca18b3efb764ef6f64772c0278ba30c",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 51,
"avg_line_length": 21.571428571428573,
"alnum_prop": 0.5629139072847682,
"repo_name": "slackmart/ng-mars-forms",
"id": "dfeb14ca2f8dd2660316c253c3dfbcabd1fdef39",
"size": "151",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "karma.conf.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "5955"
},
{
"name": "JavaScript",
"bytes": "23069"
}
],
"symlink_target": ""
} |
// -----------------------------------------------------------------------
// <copyright file="MessageMemorizerActor.cs" company="Petabridge, LLC">
// Copyright (C) 2017 - 2017 Petabridge, LLC <https://petabridge.com>
// </copyright>
// -----------------------------------------------------------------------
using Akka.Actor;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Petabridge.Cmd.QuickStart
{
/// <summary>
/// Actor responsible for memorizing messages that will be saved on the server.
/// </summary>
public class MessageMemorizerActor : ReceiveActor
{
private readonly SortedSet<Message> _messages = new SortedSet<Message>();
public MessageMemorizerActor()
{
Receive<Message>(m =>
{
_messages.Add(m);
Sender.Tell(CommandResponse.Empty);
});
Receive<FetchMessages>(f => f.Since == null, f => // all messages
{
foreach (var msg in _messages)
Sender.Tell(new CommandResponse(msg.ToString(), false));
// by setting final:false we signal to client that more responses are coming
Sender.Tell(CommandResponse.Empty); // tells the client not to expect any more responses (final == true)
});
Receive<FetchMessages>(f =>
{
var acceptableTime = DateTime.UtcNow - f.Since;
var matchingMessages =
_messages.Where(x => x.TimeStamp >= acceptableTime).OrderBy(x => x.TimeStamp).ToList();
foreach (var msg in matchingMessages)
Sender.Tell(new CommandResponse(msg.ToString(), false));
// by setting final:false we signal to client that more responses are coming
Sender.Tell(CommandResponse.Empty); // tells the client not to expect any more responses (final == true)
});
Receive<PurgeMessages>(_ =>
{
_messages.Clear();
Sender.Tell(CommandResponse.Empty);
});
}
public class Message : IComparable<Message>
{
public Message(string msg, DateTime timeStamp, string ip)
{
Msg = msg;
TimeStamp = timeStamp;
Ip = ip;
}
public DateTime TimeStamp { get; }
public string Msg { get; }
public string Ip { get; }
public int CompareTo(Message other)
{
if (ReferenceEquals(this, other)) return 0;
if (ReferenceEquals(null, other)) return 1;
return TimeStamp.CompareTo(other.TimeStamp);
}
public override string ToString()
{
return $"[{Ip}][{TimeStamp.ToShortTimeString()}]: {Msg}";
}
}
public class FetchMessages
{
public FetchMessages(TimeSpan? since = null)
{
Since = since;
}
public TimeSpan? Since { get; }
}
public class PurgeMessages
{
public static readonly PurgeMessages Instance = new PurgeMessages();
private PurgeMessages()
{
}
}
}
} | {
"content_hash": "28f4a69a52805c556d62f0d7dab29f12",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 120,
"avg_line_length": 34.02020202020202,
"alnum_prop": 0.5080166270783848,
"repo_name": "petabridge/petabridge.cmd-quickstart",
"id": "46bc211bbcc93d097d616a7a4e13190fc432cfd5",
"size": "3370",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Petabridge.Cmd.QuickStart/MessageMemorizerActor.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "176"
},
{
"name": "C#",
"bytes": "14924"
},
{
"name": "Dockerfile",
"bytes": "788"
},
{
"name": "F#",
"bytes": "16849"
},
{
"name": "PowerShell",
"bytes": "18267"
},
{
"name": "Shell",
"bytes": "4416"
}
],
"symlink_target": ""
} |
package twilio
import (
"errors"
un "github.com/subosito/underscore"
"net/url"
"strings"
)
type MessageService struct {
client *Client
}
type Message struct {
AccountSid string `json:"account_sid"`
ApiVersion string `json:"api_version"`
Body string `json:"body"`
NumSegments int `json:"num_segments,string"`
NumMedia int `json:"num_media,string"`
DateCreated Timestamp `json:"date_created,omitempty"`
DateSent Timestamp `json:"date_sent,omitempty"`
DateUpdated Timestamp `json:"date_updated,omitempty"`
Direction string `json:"direction"`
From string `json:"from"`
Price Price `json:"price,omitempty"`
Sid string `json:"sid"`
Status string `json:"status"`
To string `json:"to"`
Uri string `json:"uri"`
}
func (m *Message) IsSent() bool {
return m.Status == "sent"
}
type MessageParams struct {
// The text of the message you want to send, limited to 1600 characters.
Body string
// The URL of the media you wish to send out with the message. Currently support: gif, png, and jpeg.
MediaUrl []string
StatusCallback string
ApplicationSid string
}
func (p MessageParams) Validates() error {
if (p.Body == "") && (len(p.MediaUrl) == 0) {
return errors.New(`One of the "Body" or "MediaUrl" is required.`)
}
return nil
}
func (s *MessageService) Create(v url.Values) (*Message, *Response, error) {
u := s.client.EndPoint("Messages")
req, _ := s.client.NewRequest("POST", u.String(), strings.NewReader(v.Encode()))
m := new(Message)
resp, err := s.client.Do(req, m)
if err != nil {
return nil, resp, err
}
return m, resp, err
}
// Shortcut for sending SMS with no optional parameters support.
func (s *MessageService) SendSMS(from, to, body string) (*Message, *Response, error) {
return s.Send(from, to, MessageParams{Body: body})
}
// Send Message with options. It's support required and optional parameters.
//
// One of these parameters is required:
//
// Body : The text of the message you want to send
// MediaUrl : The URL of the media you wish to send out with the message. Currently support: gif, png, and jpeg.
//
// Optional parameters:
//
// StatusCallback : A URL that Twilio will POST to when your message is processed.
// ApplicationSid : Twilio will POST `MessageSid` as well as other statuses to the URL in the `MessageStatusCallback` property of this application
func (s *MessageService) Send(from, to string, params MessageParams) (*Message, *Response, error) {
err := params.Validates()
if err != nil {
return nil, nil, err
}
v := un.StructToMap(¶ms)
v.Set("From", from)
v.Set("To", to)
return s.Create(v)
}
func (s *MessageService) Get(sid string) (*Message, *Response, error) {
u := s.client.EndPoint("Messages", sid)
req, _ := s.client.NewRequest("GET", u.String(), nil)
m := new(Message)
resp, err := s.client.Do(req, m)
if err != nil {
return nil, resp, err
}
return m, resp, err
}
type MessageListParams struct {
To string
From string
DateSent string
PageSize int
}
func (s *MessageService) List(params MessageListParams) ([]Message, *Response, error) {
u := s.client.EndPoint("Messages")
v := un.StructToMap(¶ms)
req, _ := s.client.NewRequest("GET", u.String(), strings.NewReader(v.Encode()))
// Helper struct for handling the listing
type list struct {
Pagination
Messages []Message `json:"messages"`
}
l := new(list)
resp, err := s.client.Do(req, l)
if err != nil {
return nil, resp, err
}
resp.Pagination = l.Pagination
return l.Messages, resp, err
}
| {
"content_hash": "25274344a1ebe97da560a719e4feb031",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 146,
"avg_line_length": 25.771428571428572,
"alnum_prop": 0.6715631929046563,
"repo_name": "titanous/twilio-forwarder",
"id": "62f07b58a6c51970f28f50e0b8afcc2480542b0f",
"size": "3608",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Godeps/_workspace/src/github.com/subosito/twilio/message.go",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Go",
"bytes": "107247"
}
],
"symlink_target": ""
} |
/**
* Import all module depenencies here.
* Add commonly used modules to externals.
*/
import core from '../app.core.module.js';
import <%= yeoman.choices.feature %>Config from './<%= yeoman.choices.feature %>.config.js';
import <%= yeoman.choices.feature %>Route from './<%= yeoman.choices.feature %>.route.js';
import <%= yeoman.choices.feature %>Controller from './<%= yeoman.choices.feature %>.controller.js';
import <%= yeoman.choices.feature %>Service from './<%= yeoman.choices.feature %>.service.js';
import <%= yeoman.choices.feature %>DataService from './<%= yeoman.choices.feature %>.data.service.js';
/**
* Import all feature styles here.
*/
import './<%= yeoman.choices.feature %>.less';
/**
* This is the <%= yeoman.choices.feature %> module. It it the entry point for this website.
* Only declare the module's dependencies in this file.
* @namespace <%= yeoman.choices.Feature %> Module
*/
angular.module('<%= yeoman.choices.feature %>', [
// Shared modules.
core
])
// Register config.
.config(<%= yeoman.choices.feature %>Config)
// Register route.
.config(<%= yeoman.choices.feature %>Route)
// Register controller.
.controller('<%= yeoman.choices.feature %>Controller', <%= yeoman.choices.feature %>Controller)
// Register service.
.factory('<%= yeoman.choices.feature %>Service', <%= yeoman.choices.feature %>Service)
// Register data service.
.factory('<%= yeoman.choices.feature %>DataService', <%= yeoman.choices.feature %>DataService);
export default '<%= yeoman.choices.feature %>'; | {
"content_hash": "72f67a55ba611b813f640220ace3a418",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 103,
"avg_line_length": 43.457142857142856,
"alnum_prop": 0.6936226166995397,
"repo_name": "manapaho/generator-angular-website",
"id": "71b4beb7610358a21894106bd511d8745719d450",
"size": "1521",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "feature/templates/feature.module.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "228952"
},
{
"name": "HTML",
"bytes": "1199081"
},
{
"name": "JavaScript",
"bytes": "1139082"
}
],
"symlink_target": ""
} |
Will be compiling the useful android snippets here -- feel free to pull request! : D
## Suggested Read Through Order:
1. Buttons
2. Intents - snippets for Button actions
3. Animations - snippets for Button actions
3. Action Bar items - top bar buttons
4. Threading (keeping up responsiveness by doing work on separate threads)
## Example:
The "Story Board App" contains examples for using `Buttons` and `Intents`:
https://github.com/Android-at-The-Library/StoryBoard
<!--
The "Send Text at HH:MM" shows different ways to set an alarm, and to automate transmission of important messages.
UI Examples:
"Master Detail" Flow app
"Nav SideBar" App
-->
| {
"content_hash": "519891355093b54b575425e6d1b8c0d4",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 114,
"avg_line_length": 22.79310344827586,
"alnum_prop": 0.7473524962178517,
"repo_name": "gskielian/Collection-Of-Android-Snippets",
"id": "cc75e519df23a92c025700cb31dc9f235a9775d1",
"size": "694",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
@implementation MKTUnsignedIntReturnSetter
- (instancetype)initWithSuccessor:(nullable MKTReturnValueSetter *)successor
{
self = [super initWithType:@encode(unsigned int) successor:successor];
return self;
}
- (void)setReturnValue:(id)returnValue onInvocation:(NSInvocation *)invocation
{
unsigned int value = [returnValue unsignedIntValue];
[invocation setReturnValue:&value];
}
@end
| {
"content_hash": "278f924d72eff482c63103a4d481be7f",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 78,
"avg_line_length": 26.933333333333334,
"alnum_prop": 0.7722772277227723,
"repo_name": "HouseOfRisingSun/SilentRunner",
"id": "d82cac829119d5599f8f00519f63e83457b2b261",
"size": "558",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Carthage/Checkouts/OCMockito/Source/OCMockito/Helpers/ReturnValueSetters/MKTUnsignedIntReturnSetter.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "30543"
},
{
"name": "Objective-C",
"bytes": "659893"
},
{
"name": "Ruby",
"bytes": "1381"
},
{
"name": "Shell",
"bytes": "24011"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
Database of Vascular Plants of Canada (VASCAN)
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "f2b2bb9a961bec4b442aa1a944db2f20",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 46,
"avg_line_length": 10.76923076923077,
"alnum_prop": 0.7,
"repo_name": "mdoering/backbone",
"id": "41fb072173d4f5e1563416a790cd409387b91a79",
"size": "197",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Cyperaceae/Schoenoplectus/Schoenoplectus pungens/ Syn. Scirpus pungens pungens/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
"""
WSGI config for blogproject project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "yummy.settings")
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
application = Cling(get_wsgi_application())
| {
"content_hash": "276483c5dab9a4cc0dfb0454ace0e0d0",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 79,
"avg_line_length": 39.31818181818182,
"alnum_prop": 0.7976878612716763,
"repo_name": "gonzalodelgado/yummy",
"id": "68df5e3c60bf1ba2f1f4679e5e346bc948bf4c99",
"size": "865",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "yummy/wsgi.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "30463"
},
{
"name": "Python",
"bytes": "10169"
}
],
"symlink_target": ""
} |
namespace blink {
TEST(AtomicHTMLTokenTest, EmptyAttributeValueFromHTMLToken) {
HTMLToken token;
token.BeginStartTag('a');
token.AddNewAttribute();
token.BeginAttributeName(3);
token.AppendToAttributeName('b');
token.EndAttributeName(4);
token.AddNewAttribute();
token.BeginAttributeName(5);
token.AppendToAttributeName('c');
token.EndAttributeName(6);
token.BeginAttributeValue(8);
token.EndAttributeValue(8);
AtomicHTMLToken atoken(token);
const blink::Attribute* attribute_b = atoken.GetAttributeItem(
QualifiedName(AtomicString(), "b", AtomicString()));
ASSERT_TRUE(attribute_b);
EXPECT_FALSE(attribute_b->Value().IsNull());
EXPECT_TRUE(attribute_b->Value().IsEmpty());
const blink::Attribute* attribute_c = atoken.GetAttributeItem(
QualifiedName(AtomicString(), "c", AtomicString()));
ASSERT_TRUE(attribute_c);
EXPECT_FALSE(attribute_c->Value().IsNull());
EXPECT_TRUE(attribute_c->Value().IsEmpty());
const blink::Attribute* attribute_d = atoken.GetAttributeItem(
QualifiedName(AtomicString(), "d", AtomicString()));
EXPECT_FALSE(attribute_d);
}
} // namespace blink
| {
"content_hash": "13c6fb1b3a5091eb5a9421e77b6bec12",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 64,
"avg_line_length": 31.75,
"alnum_prop": 0.7279090113735783,
"repo_name": "nwjs/chromium.src",
"id": "618241b9f09f6ef9bb9ea9a79cf0d175dd62f4a4",
"size": "1433",
"binary": false,
"copies": "2",
"ref": "refs/heads/nw70",
"path": "third_party/blink/renderer/core/html/parser/atomic_html_token_test.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<?php
namespace BootHelp\Tests;
use cobisja\BootHelp\ProgressBar;
class ProgressBarTest extends \PHPUnit_Framework_TestCase {
public function testWithPercentageOption() {
/**
* It should generates:
*
* <div class="progress">
* <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="30" style="width: 30%" role="progressbar" class="progress-bar">
* <span class="sr-only">30%</span>
* </div>
* </div>
*/
$percentage = 30;
$progress_bar = new ProgressBar(['percentage'=>$percentage]);
$html = $progress_bar->get_html();
$this->assertTrue($html->is_a('div', ['class'=>'progress']));
$bar = $html->get_child(0);
$this->assertTrue($bar->is_a('div', ['style'=>"width: $percentage%", 'role'=>'progressbar', 'class'=>'progress-bar']));
$this->assertTrue($bar->has_a_child_of_type('span', ['class'=>'sr-only']));
$this->assertEquals($percentage . '%', $bar->get_child(0)->get_content());
}
public function testWithBarLabel() {
/**
* It should generates:
*
* <div class="progress">
* <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="30" style="width: 30%" role="progressbar" class="progress-bar">
* 30%
* </div>
* </div>
*/
$percentage = 30;
$progress_bar = new ProgressBar(['percentage'=>$percentage, 'label'=>true]);
$html = $progress_bar->get_html();
$this->assertTrue($html->is_a('div', ['class'=>'progress']));
$bar = $html->get_child(0);
$this->assertTrue($bar->is_a('div', ['style'=>"width: $percentage%", 'role'=>'progressbar', 'class'=>'progress-bar']));
$this->assertEquals($percentage . '%', $bar->get_content());
}
public function testWithCustomizedBarLabel() {
/**
* It should generates:
*
* <div class="progress">
* <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="30" style="width: 30%" role="progressbar" class="progress-bar">
* thirty percent
* </div>
* </div>
*/
$percentage = 30;
$customized_label = 'thirty percent';
$progress_bar = new ProgressBar(['percentage'=>$percentage, 'label'=>$customized_label]);
$html = $progress_bar->get_html();
$this->assertTrue($html->is_a('div', ['class'=>'progress']));
$bar = $html->get_child(0);
$this->assertTrue($bar->is_a('div', ['style'=>"width: $percentage%", 'role'=>'progressbar', 'class'=>'progress-bar']));
$this->assertEquals($customized_label, $bar->get_content());
}
/**
* @dataProvider get_contexts
*/
public function testSettingContextualOption($context) {
/**
* It should generates:
*
* <div class="progress">
* <div class="progress-bar progress-bar-{$context}" aria-valuemax="100" aria-valuemin="0" aria-valuenow="30" style="width: 30%" role="progressbar">
* <span class="sr-only">30%</span>
* </div>
* </div>
*/
$percentage = 30;
$progress_bar = new ProgressBar(['percentage'=>$percentage, 'context'=>$context]);
$html = $progress_bar->get_html();
$this->assertTrue($html->is_a('div', ['class'=>'progress']));
$bar = $html->get_child(0);
$this->assertTrue($bar->is_a('div', ['style'=>"width: $percentage%", 'role'=>'progressbar']));
$this->assertTrue($bar->has_attribute('class',['progress-bar', 'progress-bar-' . $context]));
}
public function testSettingStripedOption() {
/**
* It should generates:
*
* <div class="progress">
* <div class="progress-bar progress-bar-striped" aria-valuemax="100" aria-valuemin="0" aria-valuenow="30" style="width: 30%" role="progressbar">
* <span class="sr-only">30%</span>
* </div>
* </div>
*/
$percentage = 30;
$progress_bar = new ProgressBar(['percentage'=>$percentage, 'striped'=>true]);
$html = $progress_bar->get_html();
$this->assertTrue($html->is_a('div', ['class'=>'progress']));
$bar = $html->get_child(0);
$this->assertTrue($bar->is_a('div', ['style'=>"width: $percentage%", 'role'=>'progressbar']));
$this->assertTrue($bar->has_attribute('class',['progress-bar', 'progress-bar-striped' ]));
}
public function testSettingAnimatedOption() {
/**
* It should generates:
*
* <div class="progress">
* <div class="progress-bar progress-bar-striped active" aria-valuemax="100" aria-valuemin="0" aria-valuenow="30" style="width: 30%" role="progressbar">
* <span class="sr-only">30%</span>
* </div>
* </div>
*/
$percentage = 30;
$progress_bar = new ProgressBar(['percentage'=>$percentage, 'animated'=>true]);
$html = $progress_bar->get_html();
$this->assertTrue($html->is_a('div', ['class'=>'progress']));
$bar = $html->get_child(0);
$this->assertTrue($bar->is_a('div', ['style'=>"width: $percentage%", 'role'=>'progressbar']));
$this->assertTrue($bar->has_attribute('class', 'active progress-bar progress-bar-striped'));
}
public function testStackedProgressBars() {
/**
* It should generates:
*
* <div class="progress">
* <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="30" style="width: 30%" role="progressbar" class="progress-bar progress-bar-success">
* Completed
* </div>
* <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="40" style="width: 40%" role="progressbar" class="progress-bar progress-bar-warning progress-bar-striped active">
* Pending
* </div>
* </div>
*/
$progress_bar = new ProgressBar([
['percentage'=>30, 'context'=>'success', 'label'=>'Completed'],
['percentage'=>40, 'context'=>'warning', 'animated'=>true, 'label'=>'Pending']
]);
$html = $progress_bar->get_html();
$this->assertTrue($html->is_a('div', ['class'=>'progress']));
$this->assertTrue(2 === $html->number_of_children());
$bar_1 = $html->get_child(0);
$bar_2 = $html->get_child(1);
$this->assertTrue($bar_1->is_a('div', ['style'=>"width: 30%", 'role'=>'progressbar']));
$this->assertTrue($bar_2->is_a('div', ['style'=>"width: 40%", 'role'=>'progressbar']));
}
public function testWithExtraOptions() {
/**
* It should generates:
*
* <div id="container" class="en progress">
* <div data-js="1" id="my-bar" class="progress-bar progress-bar-striped active" aria-valuemax="100" aria-valuemin="0" aria-valuenow="30" style="width: 30%" role="progressbar">
* <span class="sr-only">30%</span>
* </div>
* </div>
*/
$progress_bar = new ProgressBar(
['percentage'=>30, 'id'=>'my-bar', 'data-js'=>1],
['id'=>'container', 'class'=>'en']
);
$html = $progress_bar->get_html();
$this->assertTrue($html->is_a('div', ['class'=>'progress en', 'id'=>'container']));
$bar_container = $html->get_child(0);
$this->assertTrue($bar_container->is_a('div', ['style'=>"width: 30%", 'role'=>'progressbar', 'class'=>'progress-bar']));
$this->assertTrue($bar_container->has_attribute('data-js', 1) && $bar_container->has_attribute('id', 'my-bar'));
}
public function get_contexts() {
return [ ['success'], ['info'], ['warning'], ['danger'] ];
}
}
| {
"content_hash": "9b6d4f64f17ebde4361475cdab3e7e4b",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 188,
"avg_line_length": 41.7989417989418,
"alnum_prop": 0.5339240506329114,
"repo_name": "adrianstaniloiu/boothelp",
"id": "4cb68ebf9fa3bff9058330521f2dc16064e2dd37",
"size": "9138",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tests/src/ProgressBarTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2308"
},
{
"name": "JavaScript",
"bytes": "2193"
},
{
"name": "PHP",
"bytes": "400153"
}
],
"symlink_target": ""
} |
from socket import AF_INET
from socket import AF_INET6
from pyroute2.common import AF_MPLS
from pyroute2.common import basestring
from pyroute2.netlink.rtnl import rt_type
from pyroute2.netlink.rtnl import rt_proto
from pyroute2.netlink.rtnl import rt_scope
from pyroute2.netlink.rtnl import encap_type
from pyroute2.netlink.rtnl.ifinfmsg import ifinfmsg
from pyroute2.netlink.rtnl.ifinfmsg import protinfo_bridge
from pyroute2.netlink.rtnl.ifinfmsg.plugins.vlan import flags as vlan_flags
from pyroute2.netlink.rtnl.rtmsg import rtmsg
from pyroute2.netlink.rtnl.rtmsg import nh as nh_header
from pyroute2.netlink.rtnl.fibmsg import FR_ACT_NAMES
encap_types = {'mpls': 1,
AF_MPLS: 1,
'seg6': 5,
'bpf': 6}
class IPRequest(dict):
def __init__(self, obj=None):
dict.__init__(self)
if obj is not None:
self.update(obj)
def update(self, obj):
if obj.get('family', None):
self['family'] = obj['family']
for key in obj:
if key == 'family':
continue
v = obj[key]
if isinstance(v, dict):
self[key] = dict((x for x in v.items() if x[1] is not None))
elif v is not None:
self[key] = v
class IPRuleRequest(IPRequest):
def update(self, obj):
super(IPRuleRequest, self).update(obj)
# now fix the rest
if 'family' not in self:
self['family'] = AF_INET
if 'priority' not in self:
self['priority'] = 32000
if 'table' in self and 'action' not in self:
self['action'] = 'to_tbl'
for key in ('src_len', 'dst_len'):
if self.get(key, None) is None and key[:3] in self:
self[key] = {AF_INET6: 128, AF_INET: 32}[self['family']]
def __setitem__(self, key, value):
if key.startswith('ipdb_'):
return
if key in ('src', 'dst'):
v = value.split('/')
if len(v) == 2:
value, self['%s_len' % key] = v[0], int(v[1])
elif key == 'action' and isinstance(value, basestring):
value = (FR_ACT_NAMES
.get(value, (FR_ACT_NAMES
.get('FR_ACT_' + value.upper(), value))))
dict.__setitem__(self, key, value)
class IPRouteRequest(IPRequest):
'''
Utility class, that converts human-readable dictionary
into RTNL route request.
'''
resolve = {'encap_type': encap_type,
'type': rt_type,
'proto': rt_proto,
'scope': rt_scope}
def __init__(self, obj=None):
self._mask = []
IPRequest.__init__(self, obj)
def encap_header(self, header):
'''
Encap header transform. Format samples:
{'type': 'mpls',
'labels': '200/300'}
{'type': AF_MPLS,
'labels': (200, 300)}
{'type': 'mpls',
'labels': 200}
{'type': AF_MPLS,
'labels': [{'bos': 0, 'label': 200, 'ttl': 16},
{'bos': 1, 'label': 300, 'ttl': 16}]}
'''
if isinstance(header['type'], int) or \
(header['type'] in ('mpls', AF_MPLS)):
ret = []
override_bos = True
labels = header['labels']
if isinstance(labels, basestring):
labels = labels.split('/')
if not isinstance(labels, (tuple, list, set)):
labels = (labels, )
for label in labels:
if isinstance(label, dict):
# dicts append intact
override_bos = False
ret.append(label)
else:
# otherwise construct label dict
if isinstance(label, basestring):
label = int(label)
ret.append({'bos': 0, 'label': label})
# the last label becomes bottom-of-stack
if override_bos:
ret[-1]['bos'] = 1
return {'attrs': [['MPLS_IPTUNNEL_DST', ret]]}
'''
Seg6 encap header transform. Format samples:
{'type': 'seg6',
'mode': 'encap',
'segs': '2000::5,2000::6'}
{'type': 'seg6',
'mode': 'encap'
'segs': '2000::5,2000::6',
'hmac': 1}
'''
if header['type'] == 'seg6':
# Init step
ret = {}
# Parse segs
segs = header['segs']
# If they are in the form in_addr6,in_addr6
if isinstance(segs, basestring):
# Create an array with the splitted values
temp = segs.split(',')
# Init segs
segs = []
# Iterate over the values
for seg in temp:
# Discard empty string
if seg != '':
# Add seg to segs
segs.append(seg)
# Retrieve mode
mode = header['mode']
# hmac is optional and contains the hmac key
hmac = header.get('hmac', None)
# Construct the new object
ret = {'mode': mode, 'segs': segs}
# If hmac is present convert to u32
if hmac:
# Add to ret the hmac key
ret['hmac'] = hmac & 0xffffffff
# Done return the object
return {'attrs': [['SEG6_IPTUNNEL_SRH', ret]]}
'''
BPF encap header transform. Format samples:
{'type': 'bpf',
'in': {'fd':4, 'name':'firewall'}}
{'type': 'bpf',
'in' : {'fd':4, 'name':'firewall'},
'out' : {'fd':5, 'name':'stats'},
'xmit': {'fd':6, 'name':'vlan_push', 'headroom':4}}
'''
if header['type'] == 'bpf':
attrs = {}
for key, value in header.items():
if key not in ['in', 'out', 'xmit']:
continue
obj = [['LWT_BPF_PROG_FD', value['fd']],
['LWT_BPF_PROG_NAME', value['name']]]
if key == 'in':
attrs['LWT_BPF_IN'] = {'attrs': obj}
elif key == 'out':
attrs['LWT_BPF_OUT'] = {'attrs': obj}
elif key == 'xmit':
attrs['LWT_BPF_XMIT'] = {'attrs': obj}
if 'headroom' in value:
attrs['LWT_BPF_XMIT_HEADROOM'] = value['headroom']
return {'attrs': attrs.items()}
def mpls_rta(self, value):
ret = []
if not isinstance(value, (list, tuple, set)):
value = (value, )
for label in value:
if isinstance(label, int):
label = {'label': label,
'bos': 0}
elif isinstance(label, basestring):
label = {'label': int(label),
'bos': 0}
elif not isinstance(label, dict):
raise ValueError('wrong MPLS label')
ret.append(label)
if ret:
ret[-1]['bos'] = 1
return ret
def __setitem__(self, key, value):
# skip virtual IPDB fields
if key.startswith('ipdb_'):
return
# fix family
if isinstance(value, basestring) and value.find(':') >= 0:
self['family'] = AF_INET6
# work on the rest
if key == 'family' and value == AF_MPLS:
dict.__setitem__(self, 'family', value)
dict.__setitem__(self, 'dst_len', 20)
dict.__setitem__(self, 'table', 254)
dict.__setitem__(self, 'type', 1)
elif key == 'flags' and self.get('family', None) == AF_MPLS:
return
elif key in ('dst', 'src'):
if isinstance(value, dict):
dict.__setitem__(self, key, value)
elif isinstance(value, int):
dict.__setitem__(self, key, {'label': value,
'bos': 1})
elif value != 'default':
value = value.split('/')
mask = None
if len(value) == 1:
dst = value[0]
if self.get('family', 0) == AF_INET:
mask = 32
elif self.get('family', 0) == AF_INET6:
mask = 128
else:
self._mask.append('%s_len' % key)
elif len(value) == 2:
dst = value[0]
mask = int(value[1])
else:
raise ValueError('wrong address spec')
dict.__setitem__(self, key, dst)
if mask is not None:
dict.__setitem__(self, '%s_len' % key, mask)
elif key == 'newdst':
dict.__setitem__(self, 'newdst', self.mpls_rta(value))
elif key in self.resolve.keys():
if isinstance(value, basestring):
value = self.resolve[key][value]
dict.__setitem__(self, key, value)
elif key == 'encap':
if isinstance(value, dict):
# human-friendly form:
#
# 'encap': {'type': 'mpls',
# 'labels': '200/300'}
#
# 'type' is mandatory
if 'type' in value and 'labels' in value:
dict.__setitem__(self, 'encap_type',
encap_types.get(value['type'],
value['type']))
dict.__setitem__(self, 'encap',
self.encap_header(value))
# human-friendly form:
#
# 'encap': {'type': 'seg6',
# 'mode': 'encap'
# 'segs': '2000::5,2000::6'}
#
# 'encap': {'type': 'seg6',
# 'mode': 'inline'
# 'segs': '2000::5,2000::6'
# 'hmac': 1}
#
# 'encap': {'type': 'seg6',
# 'mode': 'encap'
# 'segs': '2000::5,2000::6'
# 'hmac': 0xf}
#
# 'encap': {'type': 'seg6',
# 'mode': 'inline'
# 'segs': ['2000::5', '2000::6']}
#
# 'type', 'mode' and 'segs' are mandatory
if 'type' in value and 'mode' in value and 'segs' in value:
dict.__setitem__(self, 'encap_type',
encap_types.get(value['type'],
value['type']))
dict.__setitem__(self, 'encap',
self.encap_header(value))
elif 'type' in value and ('in' in value or 'out' in value or
'xmit' in value):
dict.__setitem__(self, 'encap_type',
encap_types.get(value['type'],
value['type']))
dict.__setitem__(self, 'encap',
self.encap_header(value))
# assume it is a ready-to-use NLA
elif 'attrs' in value:
dict.__setitem__(self, 'encap', value)
elif key == 'via':
# ignore empty RTA_VIA
if isinstance(value, dict) and \
set(value.keys()) == set(('addr', 'family')) and \
value['family'] in (AF_INET, AF_INET6) and \
isinstance(value['addr'], basestring):
dict.__setitem__(self, 'via', value)
elif key == 'metrics':
if 'attrs' in value:
ret = value
else:
ret = {'attrs': []}
for name in value:
rtax = rtmsg.metrics.name2nla(name)
ret['attrs'].append([rtax, value[name]])
if ret['attrs']:
dict.__setitem__(self, 'metrics', ret)
elif key == 'multipath':
ret = []
for v in value:
if 'attrs' in v:
ret.append(v)
continue
nh = {'attrs': []}
nh_fields = [x[0] for x in nh_header.fields]
for name in nh_fields:
nh[name] = v.get(name, 0)
for name in v:
if name in nh_fields or v[name] is None:
continue
if name == 'encap' and isinstance(v[name], dict):
if v[name].get('type', None) is None or \
v[name].get('labels', None) is None:
continue
nh['attrs'].append(['RTA_ENCAP_TYPE',
encap_types.get(v[name]['type'],
v[name]['type'])])
nh['attrs'].append(['RTA_ENCAP',
self.encap_header(v[name])])
elif name == 'newdst':
nh['attrs'].append(['RTA_NEWDST',
self.mpls_rta(v[name])])
else:
rta = rtmsg.name2nla(name)
nh['attrs'].append([rta, v[name]])
ret.append(nh)
if ret:
dict.__setitem__(self, 'multipath', ret)
elif key == 'family':
for d in self._mask:
if value == AF_INET:
dict.__setitem__(self, d, 32)
elif value == AF_INET6:
dict.__setitem__(self, d, 128)
self._mask = []
dict.__setitem__(self, key, value)
else:
dict.__setitem__(self, key, value)
class CBRequest(IPRequest):
'''
FIXME
'''
commands = None
msg = None
def __init__(self, *argv, **kwarg):
self['commands'] = {'attrs': []}
def __setitem__(self, key, value):
if value is None:
return
if key in self.commands:
self['commands']['attrs'].\
append([self.msg.name2nla(key), value])
else:
dict.__setitem__(self, key, value)
class IPBridgeRequest(IPRequest):
def __setitem__(self, key, value):
if key in ('vlan_info', 'mode', 'vlan_flags'):
if 'IFLA_AF_SPEC' not in self:
dict.__setitem__(self, 'IFLA_AF_SPEC', {'attrs': []})
nla = ifinfmsg.af_spec_bridge.name2nla(key)
self['IFLA_AF_SPEC']['attrs'].append([nla, value])
else:
dict.__setitem__(self, key, value)
class IPBrPortRequest(dict):
def __init__(self, obj=None):
dict.__init__(self)
dict.__setitem__(self, 'attrs', [])
self.allowed = [x[0] for x in protinfo_bridge.nla_map]
if obj is not None:
self.update(obj)
def update(self, obj):
for key in obj:
self[key] = obj[key]
def __setitem__(self, key, value):
key = protinfo_bridge.name2nla(key)
if key in self.allowed:
self['attrs'].append((key, value))
class IPLinkRequest(IPRequest):
'''
Utility class, that converts human-readable dictionary
into RTNL link request.
'''
blacklist = ['carrier',
'carrier_changes']
# get common ifinfmsg NLAs
common = []
for (key, _) in ifinfmsg.nla_map:
common.append(key)
common.append(key[len(ifinfmsg.prefix):].lower())
common.append('family')
common.append('ifi_type')
common.append('index')
common.append('flags')
common.append('change')
def __init__(self, *argv, **kwarg):
self.deferred = []
self.kind = None
self.specific = {}
self.linkinfo = None
self._info_data = None
IPRequest.__init__(self, *argv, **kwarg)
if 'index' not in self:
self['index'] = 0
@property
def info_data(self):
if self._info_data is None:
info_data = ('IFLA_INFO_DATA', {'attrs': []})
self._info_data = info_data[1]['attrs']
self.linkinfo.append(info_data)
return self._info_data
def flush_deferred(self):
# create IFLA_LINKINFO
linkinfo = {'attrs': []}
self.linkinfo = linkinfo['attrs']
dict.__setitem__(self, 'IFLA_LINKINFO', linkinfo)
self.linkinfo.append(['IFLA_INFO_KIND', self.kind])
# load specific NLA names
cls = ifinfmsg.ifinfo.data_map.get(self.kind, None)
if cls is not None:
prefix = cls.prefix or 'IFLA_'
for nla, _ in cls.nla_map:
self.specific[nla] = nla
self.specific[nla[len(prefix):].lower()] = nla
# flush deferred NLAs
for (key, value) in self.deferred:
if not self.set_specific(key, value):
dict.__setitem__(self, key, value)
self.deferred = []
def set_specific(self, key, value):
# FIXME: vlan hack
if self.kind == 'vlan' and key == 'vlan_flags':
if isinstance(value, (list, tuple)):
if len(value) == 2 and \
all((isinstance(x, int) for x in value)):
value = {'flags': value[0],
'mask': value[1]}
else:
ret = 0
for x in value:
ret |= vlan_flags.get(x, 1)
value = {'flags': ret,
'mask': ret}
elif isinstance(value, int):
value = {'flags': value,
'mask': value}
elif isinstance(value, basestring):
value = vlan_flags.get(value, 1)
value = {'flags': value,
'mask': value}
elif not isinstance(value, dict):
raise ValueError()
# the kind is known: lookup the NLA
if key in self.specific:
self.info_data.append((self.specific[key], value))
return True
elif key == 'peer' and self.kind == 'veth':
# FIXME: veth hack
if isinstance(value, dict):
attrs = []
for k, v in value.items():
attrs.append([ifinfmsg.name2nla(k), v])
else:
attrs = [['IFLA_IFNAME', value], ]
nla = ['VETH_INFO_PEER', {'attrs': attrs}]
self.info_data.append(nla)
return True
elif key == 'mode':
# FIXME: ipvlan / tuntap / bond hack
if self.kind == 'tuntap':
nla = ['IFTUN_MODE', value]
else:
nla = ['IFLA_%s_MODE' % self.kind.upper(), value]
self.info_data.append(nla)
return True
return False
def __setitem__(self, key, value):
# ignore blacklisted attributes
if key in self.blacklist:
return
# there must be no "None" values in the request
if value is None:
return
# all the values must be in ascii
try:
if isinstance(value, unicode):
value = value.encode('ascii')
except NameError:
pass
if key == 'kind' and not self.kind:
self.kind = value
self.flush_deferred()
elif self.kind is None:
if key in self.common:
dict.__setitem__(self, key, value)
else:
self.deferred.append((key, value))
else:
if not self.set_specific(key, value):
dict.__setitem__(self, key, value)
| {
"content_hash": "4ad1c214f2d31de22869864dfa42084f",
"timestamp": "",
"source": "github",
"line_count": 558,
"max_line_length": 78,
"avg_line_length": 36.36379928315412,
"alnum_prop": 0.43925878468286433,
"repo_name": "craneworks/python-pyroute2",
"id": "f2ede69fceea127116dd16bc4c816ca2b42bab12",
"size": "20291",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pyroute2/netlink/rtnl/req.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "860914"
}
],
"symlink_target": ""
} |
<?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>
<description>A package for association rule mining over Hadoop, based on the Mahout library</description>
<developers>
<developer>
<name>Luigi Grimaudo</name>
<email>[email protected]</email>
<organization>DBDMG - Politecnico di Torino</organization>
<organizationUrl>http://dbdmg.polito.it</organizationUrl>
</developer>
</developers>
<organization>
<name>Politecnico di Torino</name>
<url>http://www.polito.it</url>
</organization>
<groupId>it.polito.dbdmg.searum</groupId>
<artifactId>searum</artifactId>
<version>0.0.1</version>
<name>SEARUM</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mahout.version>0.8</mahout.version>
<mahout.groupid>org.apache.mahout</mahout.groupid>
</properties>
<dependencies>
<dependency>
<groupId>${mahout.groupid}</groupId>
<artifactId>mahout-core</artifactId>
<version>${mahout.version}</version>
</dependency>
<dependency>
<groupId>${mahout.groupid}</groupId>
<artifactId>mahout-math</artifactId>
<version>${mahout.version}</version>
</dependency>
<dependency>
<groupId>${mahout.groupid}</groupId>
<artifactId>mahout-utils</artifactId>
<version>0.5</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>0.23.10</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>0.20.2</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>0.23.10</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- Maven Assembly Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<!-- get all project dependencies -->
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<!-- MainClass in mainfest make a executable jar -->
<archive>
<manifest>
<mainClass>it.polito.dbdmg.searum.Searum</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<!-- bind to the packaging phase -->
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<url>https://github.com/navxt6/SEARUM</url>
</project>
| {
"content_hash": "6f80657da38ec1ab8ed48940480efd12",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 108,
"avg_line_length": 33.794392523364486,
"alnum_prop": 0.5713495575221239,
"repo_name": "navxt6/SEARUM",
"id": "f49b6144eb1fdfe1f7f1d5e45c75a02139b15739",
"size": "3616",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pom.xml",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "78150"
}
],
"symlink_target": ""
} |
Application for Computer Science students at University of Wrocław
[Wiki](https://github.com/lion92pl/IIUWr/wiki)
| {
"content_hash": "8bac59054d01247346e5766828c566a2",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 68,
"avg_line_length": 39.666666666666664,
"alnum_prop": 0.7815126050420168,
"repo_name": "lion92pl/IIUWr",
"id": "2f9d44d597b83c546d5b73c031a5834d55fac0f8",
"size": "135",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "118149"
},
{
"name": "HTML",
"bytes": "1154939"
}
],
"symlink_target": ""
} |
import java.awt.*;
import javax.swing.*;
public class Terminal extends JFrame
{
final static Font font = new Font("Monospaced", Font.PLAIN, 12);
JTextArea display;
Memory RAM;
int width, height;
int textLoc;
public Terminal(Memory m, int addr, int w, int h)
{
RAM = m;
textLoc = addr;
width = w;
height = h;
setTitle("Multicore Terminal");
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel pane = new JPanel();
display = new JTextArea(height+1, width+1);
display.setFont(font);
display.setBackground(Color.BLACK);
display.setForeground(Color.GREEN);
display.disable();
display.setLineWrap(true);
pane.add(display);
add(pane);
pack();
setVisible(true);
}
public void update()
{
String text = "";
for(int i=0; i<width*height; i++)
{
char c = (char)RAM.read(textLoc+i);
if(Character.isWhitespace(c))
text += ' ';
else
text += (char)RAM.read(textLoc+i);
}
display.setText(text);
}
} | {
"content_hash": "eb58ae20b91a4ffcc2275c087711c2bc",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 65,
"avg_line_length": 19.017857142857142,
"alnum_prop": 0.612206572769953,
"repo_name": "jmptable/multicore",
"id": "d7abc4e5125b3a30ea3b3acd62e2dab303dbe58f",
"size": "1065",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vm/Terminal.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "38061"
},
{
"name": "Processing",
"bytes": "2041"
}
],
"symlink_target": ""
} |
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake/modules)
if (APPLE)
set(CMAKE_CXX_FLAGS "-I${PROJECT_SOURCE_DIR}/lib/wxWidgets/build-debug/lib/wx/include/osx_cocoa-unicode-3.0 -I/${PROJECT_SOURCE_DIR}/lib/wxWidgets/include -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__ -stdlib=libc++ -std=c++11")
set(CMAKE_SHARED_LINKER_FLAGS "-L${PROJECT_SOURCE_DIR}/lib/wxWidgets/build-debug/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau-3.0")
elseif (UNIX AND NOT APPLE)
set(CMAKE_CXX_FLAGS "-I/${PROJECT_SOURCE_DIR}/lib/wxWidgets/build-debug/lib/wx/include/gtk3-unicode-3.0 -I/${PROJECT_SOURCE_DIR}/lib/wxWidgets/include -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread")
set(CMAKE_SHARED_LINKER_FLAGS "-L/${PROJECT_SOURCE_DIR}/lib/wxWidgets/build-debug/lib -pthread -Wl,-rpath,/${PROJECT_SOURCE_DIR}/lib/wxWidgets/build-debug/lib -lwx_gtk3u-3.0")
endif () | {
"content_hash": "c8dc03ad8de8929b024fb238ce89f993",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 265,
"avg_line_length": 78.86666666666666,
"alnum_prop": 0.7379543533389687,
"repo_name": "EtherealT/Beam",
"id": "e31dc4da63d4e50017eb48e5df0605202b283dc9",
"size": "1780",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cmake/configs.cmake",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "106584"
},
{
"name": "CMake",
"bytes": "10983"
},
{
"name": "Shell",
"bytes": "8203"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Bitretsmah.Tests.Integration")]
[assembly: AssemblyProduct("Bitretsmah.Tests.Integration")]
[assembly: AssemblyCopyright("Copyright © Zbigniew Klasik")]
[assembly: ComVisible(false)]
[assembly: Guid("3a58bdf4-0b87-4dfe-b1ad-e3f0a5287341")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] | {
"content_hash": "e681886ae97f356321b3f1b73f64d17f",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 60,
"avg_line_length": 41.2,
"alnum_prop": 0.7839805825242718,
"repo_name": "zbigniew-klasik/Bitretsmah",
"id": "0a4252eab160b6fda0549ba7f88d3aa7d809887c",
"size": "415",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/Bitretsmah.Tests.Integration/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "226495"
},
{
"name": "Shell",
"bytes": "960"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Read me -->
<Preference
android:key="@string/preference_key_read_me"
android:title="@string/preference_option_read_me" />
<Preference
android:key="@string/preference_key_password"
android:title="@string/preference_option_password" />
</PreferenceScreen>
| {
"content_hash": "48c75f45ca193e5a86795d1a44a459b3",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 63,
"avg_line_length": 35.416666666666664,
"alnum_prop": 0.6635294117647059,
"repo_name": "The1andONLYdave/smartwatch_locker",
"id": "57efd474f71333845b8e0d4a5ae9a596b93e5927",
"size": "425",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "SmartWatch Locker 2/res/xml/preference.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "60544"
}
],
"symlink_target": ""
} |
<!doctype html>
<title>WebSockets: Field processing: lowercase 'upgrade' in connection field</title>
<pre>FAIL (script didn't run)</pre>
<script src=/resources/jsframework2.js></script>
<script src=../../constants.js></script>
<script>
assertNotEquals(window.WebSocket, undefined, 'WebSocket not supported');
assertNotThrows(function(){
var ws = new WebSocket(SCHEME_AND_DOMAIN+':8007/handshake_raw?'+encodeURIComponent('HTTP/1.1 101 WebSocket Protocol Handshake\\x0D\\x0AUpgrade: WebSocket\\x0D\\x0AConnection: upgrade\\x0D\\x0ASec-WebSocket-Origin: '+location.protocol+'//'+location.host+'\\x0D\\x0ASec-WebSocket-Location: '));
ws.onclose = ws.onerror = ws.onmessage = assertUnreached;
ws.onopen = function(e) {
debug(e);
ws.onclose = function(e) {
debug(e);
assertEquals(e.wasClean, true);
ws.onclose = assertUnreached;
setTestTimeout(null);
setTimeout(end, 500);
}
ws.close();
}
});
</script> | {
"content_hash": "1d02f56395003a43ee07c06e2f25a003",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 294,
"avg_line_length": 41.30434782608695,
"alnum_prop": 0.7021052631578948,
"repo_name": "operasoftware/presto-testo",
"id": "dc4994f7fbf9b9119ffd15dd1c2e5c1ad2d41da8",
"size": "950",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "wpt/websockets/js/opening-handshake/038.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "2312"
},
{
"name": "ActionScript",
"bytes": "23470"
},
{
"name": "AutoHotkey",
"bytes": "8832"
},
{
"name": "Batchfile",
"bytes": "5001"
},
{
"name": "C",
"bytes": "116512"
},
{
"name": "C++",
"bytes": "279128"
},
{
"name": "CSS",
"bytes": "208905"
},
{
"name": "Groff",
"bytes": "674"
},
{
"name": "HTML",
"bytes": "106576719"
},
{
"name": "Haxe",
"bytes": "3874"
},
{
"name": "Java",
"bytes": "185827"
},
{
"name": "JavaScript",
"bytes": "22531460"
},
{
"name": "Makefile",
"bytes": "13409"
},
{
"name": "PHP",
"bytes": "524372"
},
{
"name": "POV-Ray SDL",
"bytes": "6542"
},
{
"name": "Perl",
"bytes": "321672"
},
{
"name": "Python",
"bytes": "954636"
},
{
"name": "Ruby",
"bytes": "1006850"
},
{
"name": "Shell",
"bytes": "12140"
},
{
"name": "Smarty",
"bytes": "1860"
},
{
"name": "XSLT",
"bytes": "2567445"
}
],
"symlink_target": ""
} |
#include "unity.h"
#include "../ofp_role_request_handler.h"
#include "../ofp_apis.h"
#include "../ofp_role.h"
#include "event.h"
#include "handler_test_utils.h"
static bool test_closed = false;
static const uint64_t dpid = 0xabc;
void
setUp(void) {
}
void
tearDown(void) {
}
static lagopus_result_t
s_ofp_role_request_handle_wrap(struct channel *channel,
struct pbuf *pbuf,
struct ofp_header *xid_header,
struct ofp_error *error) {
return ofp_role_request_handle(channel, pbuf, xid_header, error);
}
static lagopus_result_t
s_ofp_role_reply_create_wrap(struct channel *channel,
struct pbuf **pbuf,
struct ofp_header *xid_header) {
struct ofp_role_request role_request;
role_request.role = OFPCR_ROLE_SLAVE;
role_request.generation_id = 0x01;
return ofp_role_reply_create(channel, pbuf, xid_header, &role_request);
}
void
test_ofp_role_request_handle_normal_pattern(void) {
lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
ret = check_packet_parse(
s_ofp_role_request_handle_wrap,
"04 19 00 18 00 00 00 10 "
/* <--------------------... ofp_role_request
* <---------------------> ofp_header
* <> version
* <> type
* <---> length
* <---------> xid
*/
"00 00 00 03 00 00 00 00 "
/*...-------------------... ofp_role_request
* <---------> role = 3 -> OFPCR_ROLE_SLAVE
* <---------> padding
*/
"00 00 00 00 00 00 00 00 ");
/*...--------------------> ofp_role_request
* <---------------------> generation_id = 0
*/
TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OK, ret,
"ofp_role_request_handle(normal) error.");
}
void
test_ofp_role_request_handle_invalid_unknown_role(void) {
lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
struct ofp_error expected_error = {0, 0, {NULL}};
ofp_error_set(&expected_error, OFPET_ROLE_REQUEST_FAILED, OFPRRFC_BAD_ROLE);
ret = check_packet_parse_expect_error(
s_ofp_role_request_handle_wrap,
"04 19 00 18 00 00 00 10 "
"ff ff ff fe 00 00 00 00 "
/*...-------------------... ofp_role_request
* <---------> role = 0xfffffffe -> unknown role
* <---------> padding
*/
"00 00 00 00 00 00 00 09 ",
&expected_error);
TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
"unknown rule should case error.");
}
void
test_ofp_role_request_handle_invalid_stale_message(void) {
lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
struct ofp_error expected_error = {0, 0, {NULL}};
ofp_error_set(&expected_error, OFPET_ROLE_REQUEST_FAILED, OFPRRFC_STALE);
ret = check_packet_parse_cont(
s_ofp_role_request_handle_wrap,
"04 19 00 18 00 00 00 10 "
"00 00 00 03 00 00 00 00 "
/*...-------------------... ofp_role_request
* <---------> role = 3 -> OFPCR_ROLE_SLAVE
* <---------> padding
*/
"00 00 00 00 00 00 00 09 ");
/*...--------------------> ofp_role_request
* <---------------------> generation_id = 9
*/
TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OK, ret,
"ofp_role_request_handle(normal) error.");
ret = check_packet_parse_expect_error(
s_ofp_role_request_handle_wrap,
"04 19 00 18 00 00 00 10 "
"00 00 00 03 00 00 00 00 "
/*...-------------------... ofp_role_request
* <---------> role = 3 -> OFPCR_ROLE_SLAVE
* <---------> padding
*/
"00 00 00 00 00 00 00 01 ",
&expected_error);
/*...--------------------> ofp_role_request
* <---------------------> generation_id = 1
*/
TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
"stale message should cause error");
}
void
test_ofp_role_request_handle_no_body(void) {
lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
/* Case of decode error.*/
ret = check_packet_parse(s_ofp_role_request_handle_wrap, "");
TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
"ofp_role_request_handle(error) error.");
}
void
test_ofp_role_request_handle_with_null_agument(void) {
/* Case of invlid argument.*/
struct event_manager *em = event_manager_alloc();
struct channel *channel =
channel_alloc_ip4addr("127.0.0.1", "1000", em, 0x01);
struct pbuf pbuf;
struct ofp_header xid_header;
lagopus_result_t ret;
struct ofp_error error;
/* struct ofp_error error; */
ret = ofp_role_request_handle(NULL, &pbuf, &xid_header, &error);
TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
"NULL should be treated as invalid arguments");
ret = ofp_role_request_handle(channel, NULL, &xid_header, &error);
TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
"NULL should be treated as invalid arguments");
ret = ofp_role_request_handle(channel, &pbuf, NULL, &error);
TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
"NULL should be treated as invalid arguments");
ret = ofp_role_request_handle(channel, &pbuf, &xid_header, NULL);
TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
"NULL should be treated as invalid arguments");
channel_free(channel);
event_manager_free(em);
}
void
test_ofp_role_reply_create(void) {
lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
ret = check_packet_create(s_ofp_role_reply_create_wrap,
"04 19 00 18 00 00 00 10 "
"00 00 00 03 00 00 00 00 "
"00 00 00 00 00 00 00 01 ");
TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OK, ret,
"ofp_role_reply_create(normal) error.");
}
void
test_ofp_role_reply_create_with_null_agument(void) {
lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
struct event_manager *em = event_manager_alloc();
struct channel *channel =
channel_alloc_ip4addr("127.0.0.1", "1000", em, 0x01);
struct pbuf *pbuf;
struct ofp_header xid_header;
struct ofp_role_request role_request;
role_request.role = OFPCR_ROLE_SLAVE;
role_request.generation_id = 0x01;
/* TODO add error as a 4th argument */
/* struct ofp_error error; */
ret = ofp_role_reply_create(NULL, &pbuf, &xid_header, &role_request);
TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
"NULL should be treated as invalid arguments");
ret = ofp_role_reply_create(channel, NULL, &xid_header, &role_request);
TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
"NULL should be treated as invalid arguments");
ret = ofp_role_reply_create(channel, &pbuf, NULL, &role_request);
TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
"NULL should be treated as invalid arguments");
channel_free(channel);
event_manager_free(em);
}
void
test_close(void) {
test_closed = true;
}
| {
"content_hash": "b84815fce273f343b40eaf52c281802b",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 78,
"avg_line_length": 34.45794392523364,
"alnum_prop": 0.5614320585842149,
"repo_name": "trojan00/lagopus",
"id": "596b624df583aa78c4440bf298fb6070b74dcdac",
"size": "8003",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/agent/test/ofp_role_request_handler_test.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "4556593"
},
{
"name": "C++",
"bytes": "34199"
},
{
"name": "Lex",
"bytes": "979"
},
{
"name": "Makefile",
"bytes": "14431"
},
{
"name": "Objective-C",
"bytes": "2303"
},
{
"name": "Python",
"bytes": "2973"
},
{
"name": "Shell",
"bytes": "351791"
},
{
"name": "Yacc",
"bytes": "9583"
}
],
"symlink_target": ""
} |
name: Bug report
about: Create a report to help us improve
---
Thanks for stopping by to let us know something could be better!
**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response.
Please run down the following list and make sure you've tried the usual "quick fixes":
- Search the issues already opened: https://github.com/googleapis/python-dataproc-metastore/issues
- Search StackOverflow: https://stackoverflow.com/questions/tagged/google-cloud-platform+python
If you are still having issues, please be sure to include as much information as possible:
#### Environment details
- OS type and version:
- Python version: `python --version`
- pip version: `pip --version`
- `google-cloud-dataproc-metastore` version: `pip show google-cloud-dataproc-metastore`
#### Steps to reproduce
1. ?
2. ?
#### Code example
```python
# example
```
#### Stack trace
```
# example
```
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!
| {
"content_hash": "202d805a1ad9d05c5ef9dada5a8e261b",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 208,
"avg_line_length": 27.30952380952381,
"alnum_prop": 0.7375762859633828,
"repo_name": "googleapis/python-dataproc-metastore",
"id": "f7e2100c43ba76bd4d0ebf02bfd39b8557bf194a",
"size": "1151",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "2050"
},
{
"name": "Python",
"bytes": "1673139"
},
{
"name": "Shell",
"bytes": "30696"
}
],
"symlink_target": ""
} |
#import "NSObject.h"
@class NSData, NSObject<OS_dispatch_semaphore>, _UIAsyncInvocation;
// Not exported
@interface _UIDecompressionInfo : NSObject
{
unsigned long long jpegDecodeRequestID;
NSObject<OS_dispatch_semaphore> *syncSemaphore;
NSObject<OS_dispatch_semaphore> *metadataSemaphore;
NSData *imageData;
struct CGSize maxSize;
int renderingIntent;
_UIAsyncInvocation *terminationInvocation;
_Bool decompressionComplete;
_Bool metadataComplete;
}
- (void)dealloc;
- (id)initWithData:(id)arg1 maxSize:(struct CGSize)arg2 renderingIntent:(int)arg3;
@end
| {
"content_hash": "14635add5e4bc1af7602b9f3e03de6e0",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 82,
"avg_line_length": 23.96,
"alnum_prop": 0.7512520868113522,
"repo_name": "matthewsot/CocoaSharp",
"id": "a3157b4cbf7872856a4cd8249b3948b8c967461c",
"size": "739",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Headers/Frameworks/UIKit/_UIDecompressionInfo.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "259784"
},
{
"name": "C#",
"bytes": "2789005"
},
{
"name": "C++",
"bytes": "252504"
},
{
"name": "Objective-C",
"bytes": "24301417"
},
{
"name": "Smalltalk",
"bytes": "167909"
}
],
"symlink_target": ""
} |
<!--
Copyright 2005-2008 Adobe Systems Incorporated
Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
or a copy at http://stlab.adobe.com/licenses.html)
Some files are held under additional license.
Please see "http://stlab.adobe.com/licenses.html" for more information.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<TITLE>Adobe Software Technology Lab: index.dox File Reference</TITLE>
<META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/>
<LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/>
<LINK REL="alternate" TITLE="stlab.adobe.com RSS" HREF="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1" TYPE="application/rss+xml"/>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
</head>
<body>
<div id='content'>
<table><tr>
<td colspan='5'>
<div id='opensource_banner'>
<table style='width: 100%; padding: 5px;'><tr>
<td align='left'>
<a href='index.html' style='border: none'><img src='stlab2007.jpg' alt="stlab.adobe.com"/></a>
</td>
<td align='right'>
<a href='http://www.adobe.com' style='border: none'><img src='adobe_hlogo.gif' alt="Adobe Systems Incorporated"/></a>
</td>
</tr></table>
</div>
</td></tr><tr>
<td valign="top">
<div id='navtable' height='100%'>
<div style='margin: 5px'>
<h4>Documentation</h4>
<a href="group__asl__overview.html">Overview</a><br/>
<a href="asl_readme.html">Building ASL</a><br/>
<a href="asl_toc.html">Documentation</a><br/>
<a href="http://stlab.adobe.com/wiki/index.php/Supplementary_ASL_Documentation">Library Wiki Docs</a><br/>
<a href="asl_indices.html">Indices</a><br/>
<a href="http://stlab.adobe.com/perforce/">Browse Perforce</a><br/>
<h4>More Info</h4>
<a href="asl_release_notes.html">Release Notes</a><br/>
<a href="http://stlab.adobe.com/wiki/">Wiki</a><br/>
<a href="asl_search.html">Site Search</a><br/>
<a href="licenses.html">License</a><br/>
<a href="success_stories.html">Success Stories</a><br/>
<a href="asl_contributors.html">Contributors</a><br/>
<h4>Media</h4>
<a href="http://sourceforge.net/project/showfiles.php?group_id=132417&package_id=145420">Download</a><br/>
<a href="asl_download_perforce.html">Perforce Depots</a><br/>
<h4>Support</h4>
<a href="http://sourceforge.net/projects/adobe-source/">ASL SourceForge Home</a><br/>
<a href="http://sourceforge.net/mail/?group_id=132417">Mailing Lists</a><br/>
<a href="http://sourceforge.net/forum/?group_id=132417">Discussion Forums</a><br/>
<a href="http://sourceforge.net/tracker/?atid=724218&group_id=132417&func=browse">Report Bugs</a><br/>
<a href="http://sourceforge.net/tracker/?atid=724221&group_id=132417&func=browse">Suggest Features</a><br/>
<a href="asl_contributing.html">Contribute to ASL</a><br/>
<h4>RSS</h4>
<a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417">Short-text news</a><br/>
<a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1">Full-text news</a><br/>
<a href="http://sourceforge.net/export/rss2_projfiles.php?group_id=132417">File releases</a><br/>
<h4>Other Adobe Projects</h4>
<a href="http://sourceforge.net/adobe/">Open @ Adobe</a><br/>
<a href="http://opensource.adobe.com/">Adobe Open Source</a><br/>
<a href="http://labs.adobe.com/">Adobe Labs</a><br/>
<a href="http://stlab.adobe.com/amg/">Adobe Media Gallery</a><br/>
<a href="http://stlab.adobe.com/performance/">C++ Benchmarks</a><br/>
<h4>Other Resources</h4>
<a href="http://boost.org">Boost</a><br/>
<a href="http://www.riaforge.com/">RIAForge</a><br/>
<a href="http://www.sgi.com/tech/stl">SGI STL</a><br/>
</div>
</div>
</td>
<td id='maintable' width="100%" valign="top">
<!-- End Header -->
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
<div class="headertitle">
<h1>index.dox File Reference</h1> </div>
</div>
<div class="contents">
<table class="memberdecls">
</table>
</div>
<!-- Begin Footer -->
</td></tr>
</table>
</div> <!-- content -->
<div class='footerdiv'>
<div id='footersub'>
<ul>
<li><a href="http://www.adobe.com/go/gftray_foot_aboutadobe">Company</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_privacy_security">Online Privacy Policy</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_terms">Terms of Use</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_contact_adobe">Contact Us</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_accessibility">Accessibility</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_report_piracy">Report Piracy</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_permissions_trademarks">Permissions & Trademarks</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_product_license_agreements">Product License Agreements</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_feedback">Send Feedback</a></li>
</ul>
<div>
<p>Copyright © 2006-2007 Adobe Systems Incorporated.</p>
<p>Use of this website signifies your agreement to the <a href="http://www.adobe.com/go/gftray_foot_terms">Terms of Use</a> and <a href="http://www.adobe.com/go/gftray_foot_privacy_security">Online Privacy Policy</a>.</p>
<p>Search powered by <a href="http://www.google.com/" target="new">Google</a></p>
</div>
</div>
</div>
<script type="text/javascript">
_uacct = "UA-396569-1";
urchinTracker();
</script>
</body>
</html>
| {
"content_hash": "5635996d3f8fa1b98102f2bd4ba88129",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 233,
"avg_line_length": 46.42537313432836,
"alnum_prop": 0.6259443819321653,
"repo_name": "brycelelbach/asl",
"id": "0e7b680a4d32a0353db3c2157961e71e06ee5cc8",
"size": "6221",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "documentation/html/index_8dox.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "1846467"
},
{
"name": "Perl",
"bytes": "167978"
},
{
"name": "Shell",
"bytes": "3594"
}
],
"symlink_target": ""
} |
<div>
<div class="well">
<h3>TypeScript File Structure</h3>
<div>
<ul>
<li>Component:
<ul>
<li><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>directives/</li>
<li><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>services/</li>
<li><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>styles/</li>
<li><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>views/</li>
<li>model.ts</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
| {
"content_hash": "ed62c75239f646b7b9e765a9e53db538",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 106,
"avg_line_length": 35.611111111111114,
"alnum_prop": 0.5600624024960998,
"repo_name": "opiepj/angular2.0-App",
"id": "a5718100c170c131a9ea2da7bb3a2d717c8a038a",
"size": "641",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/app/components/dashboard/views/structure.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5028"
},
{
"name": "HTML",
"bytes": "8310"
},
{
"name": "JavaScript",
"bytes": "8114"
},
{
"name": "TypeScript",
"bytes": "26844"
}
],
"symlink_target": ""
} |
<?php
namespace Wtk\Response\Tests\Normalizer;
use Wtk\Response\Tests\ResponseTestCase;
use Wtk\Response\Normalizer\FieldsNormalizer;
use Wtk\Response\Body\Fields;
use Wtk\Response\Body\Field;
/**
* Normalizer tests
*
* @author Wojtek Zalewski <[email protected]>
*/
class FieldsNormalizerTest extends ResponseTestCase
{
public function getNormalizer()
{
return new FieldsNormalizer();
}
public function getFieldsArray()
{
return array(
'foo' => 1,
'bar' => 'baz',
'bat' => array('foo' => true),
'baz' => true,
);
}
public function getFields()
{
$fields = new Fields;
foreach ($this->getFieldsArray() as $key => $value) {
$fields->add(new Field($key, $value));
}
return $fields;
}
public function testEncode()
{
$normalizer = $this->getNormalizer();
$fields = $this->getFields();
$this->assertSame(
$this->getFieldsArray(),
$normalizer->normalize($fields)
);
}
/**
* @expectedException RuntimeException
*/
public function testInvalidInput()
{
$normalizer = $this->getNormalizer();
$normalizer->normalize('invalid_input');
}
}
| {
"content_hash": "c2f3cfe8e49bf5d4930feb45cd31acdf",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 61,
"avg_line_length": 19.294117647058822,
"alnum_prop": 0.5663109756097561,
"repo_name": "wotek/response-builder",
"id": "3dbe5c22b6f308b3eb1b47610b994e12faf7430b",
"size": "1484",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/Wtk/Response/Tests/Normalizer/FieldsNormalizerTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "76280"
}
],
"symlink_target": ""
} |
The library can be imported directly from TS code with:
```typescript
import * as XLSX from 'xlsx';
```
This demo uses an array of arrays as the core data structure. The component
template includes a file input element, a table that updates based on the data,
and a button to export the data.
## Switching between Angular versions
Modules that work with Angular 2 largely work as-is with Angular 4. Switching
between versions is mostly a matter of installing the correct version of the
core and associated modules. This demo includes a `package.json` for Angular 2
and another `package.json` for Angular 4.
Switching to Angular 2 is as simple as:
```bash
$ cp package.json-angular2 package.json
$ npm install
$ ng serve
```
Switching to Angular 4 is as simple as:
```bash
$ cp package.json-angular4 package.json
$ npm install
$ ng serve
```
## XLSX Symlink
In this tree, `node_modules/xlsx` is a symlink pointing back to the root. This
enables testing the development version of the library. In order to use this
demo in other applications, add the `xlsx` dependency:
```bash
$ npm install --save xlsx
```
## SystemJS Configuration
The default angular-cli configuration requires no additional configuration.
Some deployments use the SystemJS loader, which does require configuration. The
SystemJS example shows the required meta and map settings:
```js
SystemJS.config({
meta: {
'xlsx': {
exports: 'XLSX' // <-- tell SystemJS to expose the XLSX variable
}
},
map: {
'xlsx': 'xlsx.full.min.js', // <-- make sure xlsx.full.min.js is in same dir
'fs': '', // <--|
'crypto': '', // <--| suppress native node modules
'stream': '' // <--|
}
});
```
| {
"content_hash": "8f37b09bdef3349b79647ff6b98da6f4",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 80,
"avg_line_length": 25.59090909090909,
"alnum_prop": 0.7158081705150977,
"repo_name": "AshleyLab/stmpVisualization2.0",
"id": "d5db37213d50832079921fd404eb478b9575b4d4",
"size": "1703",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/js-xlsx-master/demos/angular2/README.md",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "54253"
},
{
"name": "HTML",
"bytes": "25751"
},
{
"name": "JavaScript",
"bytes": "191357"
},
{
"name": "Processing",
"bytes": "25869"
},
{
"name": "Python",
"bytes": "25839"
}
],
"symlink_target": ""
} |
from setuptools import setup
version = __import__('ateoto_recipe').__version__
setup(name = 'django-ateoto-recipe',
version = version,
author = 'Matthew McCants',
author_email = '[email protected]',
description = 'Recipe database for ateoto.com',
license = 'BSD',
url = 'https://github.com/Ateoto/django-ateoto-recipe',
packages = ['ateoto_recipe'],
install_requires = ['django>=1.4'])
| {
"content_hash": "dc223813e6064a24d6cf7b13b3c5efc0",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 59,
"avg_line_length": 32.61538461538461,
"alnum_prop": 0.6580188679245284,
"repo_name": "ateoto/django-ateoto-recipe",
"id": "e38243a9a9014a80bb55f11c0ecbbfa4880bed08",
"size": "424",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "setup.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "1330"
}
],
"symlink_target": ""
} |
<resources>
<string name="app_name">EditTagView</string>
</resources>
| {
"content_hash": "f0b9a9439baac90221c6a5f38ef3ed72",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 48,
"avg_line_length": 24.666666666666668,
"alnum_prop": 0.7027027027027027,
"repo_name": "AliSultan/EditTagView",
"id": "bbecec7f5ae9991dfad184666b3b7c85516108b5",
"size": "74",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/src/main/res/values/strings.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "15321"
}
],
"symlink_target": ""
} |
An open source webrtc based implementation of Tetris Arena.
https://opentetrisarena.fn.lc
## License
Code is licensed under the MIT license. See the LICENSE file for more details.
Some of the code under net/ is borrowed from https://github.com/aomarks/bridgesim which is also MIT licensed.
| {
"content_hash": "fe3213204bd66b4d7f1a0f795be54a3c",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 109,
"avg_line_length": 29.5,
"alnum_prop": 0.7830508474576271,
"repo_name": "d4l3k/opentetrisarena",
"id": "c6e4213a1de990f3e5240bb09d6c5ec62517570d",
"size": "439",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "9587"
},
{
"name": "TypeScript",
"bytes": "38680"
}
],
"symlink_target": ""
} |
module BetfairNg
# Declares the module for API interactions
#
module API
# Declares the module for Data types
#
module DataTypes
# Declares UpdateExecutionReport
#
# == Fields
# - customer_ref
# - status
# - error_code
# - market_id
# - instruction_reports
#
class UpdateExecutionReport < Base
# Echo of the customerRef if passed.
# @!attribute [w]
#
field :customer_ref, type: String, required: false
#
# @!attribute [w]
#
field :status, type: "BetfairNg::API::DataTypes::Enums::ExecutionReportStatus", required: true
#
# @!attribute [w]
#
field :error_code, type: "BetfairNg::API::DataTypes::Enums::ExecutionReportErrorCode", required: false
# Echo of marketId passed
# @!attribute [w]
#
field :market_id, type: String, required: false
#
# @!attribute [w]
#
field :instruction_reports, type: BetfairNg::API::DataTypes::List, of: "BetfairNg::API::DataTypes::UpdateInstructionReport", required: false
end
end
end
end
| {
"content_hash": "214c79b82a36c5b3ad64ce793a8e470b",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 144,
"avg_line_length": 21.4,
"alnum_prop": 0.6271028037383177,
"repo_name": "ValMilkevich/betfair_ng",
"id": "cc9c181026154ad5a478f1d9bbeb72add88fcc80",
"size": "1073",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/betfair_ng/api/data_types/update_execution_report.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "291549"
}
],
"symlink_target": ""
} |
Nema17_Driver
==================
**Warning** _currently untested, may contain errors._
A nema 17 mounted stepper motor driver.
Currently still work in progress.
| {
"content_hash": "dae3193c1d38a8de15df856fc7e894ed",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 53,
"avg_line_length": 20.5,
"alnum_prop": 0.6829268292682927,
"repo_name": "10to7/Nema17_driver",
"id": "9d03013ac75bbd0fa0452b73fe6a1ae4513d36c3",
"size": "164",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "IDL",
"bytes": "1896"
}
],
"symlink_target": ""
} |
package gwt.material.design.incubator.client.keyboard.js;
import com.google.gwt.dom.client.Element;
import gwt.material.design.jquery.client.api.Functions;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
/**
* JSInterop class for Keyboard
*
* @author kevzlou7979
* @see <a href="https://franciscohodge.com/projects/simple-keyboard/documentation/">Documentation</a>
*/
@JsType(isNative = true, namespace = JsPackage.GLOBAL)
public class Keyboard {
protected Keyboard() {
}
public Keyboard(KeyboardOptions options) {
}
@JsProperty
public Element keyboardDOM;
/**
* Clear the keyboard’s input.
*/
@JsMethod
public native void clearInput();
/**
* Clear the keyboard’s specific input
* Must have been previously set using the "inputName" prop.
*/
@JsMethod
public native void clearInput(String inputName);
/**
* Get the keyboard’s input (You can also get it from the onChange prop).
*/
@JsMethod
public native String getInput();
/**
* Get the keyboard’s input (You can also get it from the onChange prop).
* Must have been previously set using the "inputName" prop.
*/
@JsMethod
public native String getInput(String inputName);
/**
* Set the keyboard’s input. Useful if you want to track input changes made outside simple-keyboard.
*/
@JsMethod
public native void setInput(String input);
/**
* Set the keyboard’s input. Useful if you want to track input changes made outside simple-keyboard.
* Must have been previously set using the "inputName" prop.
*/
@JsMethod
public native void setInput(String input, String inputName);
/**
* Replaces the entire internal input object. The difference with “setInput” is that “setInput” only changes a
* single key of the input object, while “replaceInput” replaces the full input object.
*/
@JsMethod
public native void replaceInput(Object object);
/**
* Set new option or modify existing ones after initialization. The changes are applied immediately.
*/
@JsMethod
public native void setOptions(KeyboardOptions options);
/**
* Removes keyboard listeners and DOM elements.
*/
@JsMethod
public native void destroy();
/**
* Send a command to all simple-keyboard instances at once (if you have multiple instances).
*/
@JsMethod
public native void dispatch(Functions.Func1<Object> func);
/**
* Get the DOM Element of a button. If there are several buttons with the same name, an array of the DOM Elements
* is returned.
*/
@JsMethod
public native Object getButtonElement(String buttonName);
/**
* Adds an entry to the buttonTheme. Basically a way to add a class to a button.
*/
@JsMethod
public native void addButtonTheme(String buttons, String classNames);
/**
* Removes an entry to the buttonTheme. Basically a way to remove a class previously added to a button through
* buttonTheme or addButtonTheme.
*/
@JsMethod
public native void removeButtonTheme(String buttons, String classNames);
}
| {
"content_hash": "41a37c786603b4a0b3bc28db40f6d35d",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 117,
"avg_line_length": 29.428571428571427,
"alnum_prop": 0.6868932038834952,
"repo_name": "GwtMaterialDesign/gwt-material-addins",
"id": "7e5921e775f1330f9dc755fe1e62a0034c6f9fe8",
"size": "3972",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/gwt/material/design/incubator/client/keyboard/js/Keyboard.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "246666"
},
{
"name": "Java",
"bytes": "1793523"
},
{
"name": "JavaScript",
"bytes": "3347866"
},
{
"name": "Shell",
"bytes": "384"
}
],
"symlink_target": ""
} |
layout: page
title: News
main_nav: false
---
## Brookhaven Veterans Memorial
*5/25/15*

We were able to witness the unveiling of a new bronze memorial
made to honor Brookhaven Veterans. Thank you to the Post Morrow
Foundation for blessing us with the opportunity to work for you in
creating this befitting memorial.
## [Southold’s Own Back to the Future Day](http://www.eastendbeacon.com/2015/10/21/southolds-own-back-to-the-future-day/){:target="_blank"}
*10/21/15*

| {
"content_hash": "047f02cbf784a025b37ad423972488c7",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 139,
"avg_line_length": 26.304347826086957,
"alnum_prop": 0.7520661157024794,
"repo_name": "peconicmonuments/peconicmonuments.github.io",
"id": "5624752242a7eed3e41573931b2715977059d597",
"size": "611",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "news.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "16869"
},
{
"name": "HTML",
"bytes": "10303"
},
{
"name": "Ruby",
"bytes": "166"
}
],
"symlink_target": ""
} |
@interface HTBURLSession_Demo_AppTests : XCTestCase
@end
@implementation HTBURLSession_Demo_AppTests
- (void)setUp
{
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown
{
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample
{
XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
}
@end
| {
"content_hash": "ad08d5c63a3c52a2829cdae75c782ccc",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 107,
"avg_line_length": 20.708333333333332,
"alnum_prop": 0.7022132796780685,
"repo_name": "thehtb/HTBURLSession",
"id": "2f11864f9518d282e5a46e4f64df52825e1dc296",
"size": "715",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "HTBURLSessionTests/HTBURLSessionTests.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "28124"
},
{
"name": "Ruby",
"bytes": "593"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "ed46b18101d3b7194ebfe4f840b1fe15",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "33259194dfa474f41580c47dc4a5ab0d4334c4fc",
"size": "178",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Violaceae/Calceolaria/Calceolaria nigricans/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package com.google.cloud.dialogflow.v2.samples;
// [START dialogflow_v2_generated_intentsclient_getlocation_async]
import com.google.api.core.ApiFuture;
import com.google.cloud.dialogflow.v2.IntentsClient;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.Location;
public class AsyncGetLocation {
public static void main(String[] args) throws Exception {
asyncGetLocation();
}
public static void asyncGetLocation() throws Exception {
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (IntentsClient intentsClient = IntentsClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = intentsClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
}
}
// [END dialogflow_v2_generated_intentsclient_getlocation_async]
| {
"content_hash": "dc37ded76f24ae624bb0101c6a1ed15f",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 100,
"avg_line_length": 41.806451612903224,
"alnum_prop": 0.7592592592592593,
"repo_name": "googleapis/java-dialogflow",
"id": "78f3e27792a55a044612c54ad7e48a2aa769b0e4",
"size": "1891",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "samples/snippets/generated/com/google/cloud/dialogflow/v2/intentsclient/getlocation/AsyncGetLocation.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "801"
},
{
"name": "Java",
"bytes": "35913154"
},
{
"name": "Python",
"bytes": "4930"
},
{
"name": "Shell",
"bytes": "22858"
}
],
"symlink_target": ""
} |
package com.pkrharrison.gameplay.strategy;
/**
* This class is used to represent the results of verifying a strategy node.
*
*
*/
public class VerificationStatus {
private boolean isPassed;
// these are filled in if verification fails
private String failReason;
private StrategyNode failNode;
private final static VerificationStatus passed = new VerificationStatus();
private VerificationStatus() {
this.isPassed = true;
}
private VerificationStatus(String failReason, StrategyNode failNode) {
this.isPassed = false;
this.failReason = failReason;
this.failNode = failNode;
}
public static VerificationStatus passed() {
return passed;
}
public static VerificationStatus failed(String reason, StrategyNode node) {
return new VerificationStatus(reason, node);
}
public boolean isPassed() {
return isPassed;
}
public String getFailReason() {
return failReason;
}
/**
*
* @return the strategy node where verification failed
*/
public StrategyNode getFailNode() {
return failNode;
}
}
| {
"content_hash": "9ceb569db0f2a7e7c39e848ad320782b",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 77,
"avg_line_length": 20.80392156862745,
"alnum_prop": 0.7266729500471254,
"repo_name": "rdanek/poker-harrison",
"id": "a0e85d94be165fe769b63afd5b16dc00ed3aacac",
"size": "1061",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/pkrharrison/gameplay/strategy/VerificationStatus.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "244236"
}
],
"symlink_target": ""
} |
node --harmony-proxies server.js
| {
"content_hash": "b011141ad3e49abe820a0565be7cfaac",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 33,
"avg_line_length": 34,
"alnum_prop": 0.7647058823529411,
"repo_name": "chromaway/faucet",
"id": "b3bf9213d056a2ee464657ce60dd00aad7b293c0",
"size": "34",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "start-server.sh",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2876"
},
{
"name": "HTML",
"bytes": "5228"
},
{
"name": "JavaScript",
"bytes": "1896363"
},
{
"name": "Shell",
"bytes": "34"
}
],
"symlink_target": ""
} |
/*! FixedHeader 3.0.1-dev
* ©2009-2015 SpryMedia Ltd - datatables.net/license
*/
/**
* @summary FixedHeader
* @description Fix a table's header or footer, so it is always visible while
* scrolling
* @version 3.0.1-dev
* @file dataTables.fixedHeader.js
* @author SpryMedia Ltd (www.sprymedia.co.uk)
* @contact www.sprymedia.co.uk/contact
* @copyright Copyright 2009-2015 SpryMedia Ltd.
*
* This source file is free software, available under the following license:
* MIT license - http://datatables.net/license/mit
*
* This source file 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 license files for details.
*
* For details please refer to: http://www.datatables.net
*/
(function(window, document, undefined) {
var factory = function( $, DataTable ) {
"use strict";
var _instCounter = 0;
var FixedHeader = function ( dt, config ) {
// Sanity check - you just know it will happen
if ( ! (this instanceof FixedHeader) ) {
throw "FixedHeader must be initialised with the 'new' keyword.";
}
// Allow a boolean true for defaults
if ( config === true ) {
config = {};
}
dt = new DataTable.Api( dt );
this.c = $.extend( true, {}, FixedHeader.defaults, config );
this.s = {
dt: dt,
position: {
theadTop: 0,
tbodyTop: 0,
tfootTop: 0,
tfootBottom: 0,
width: 0,
left: 0,
tfootHeight: 0,
theadHeight: 0,
windowHeight: $(window).height(),
visible: true
},
headerMode: null,
footerMode: null,
autoWidth: dt.settings()[0].oFeatures.bAutoWidth,
namespace: '.dtfc'+(_instCounter++),
scrollLeft: {
header: -1,
footer: -1
},
enable: true
};
this.dom = {
floatingHeader: null,
thead: $(dt.table().header()),
tbody: $(dt.table().body()),
tfoot: $(dt.table().footer()),
header: {
host: null,
floating: null,
placeholder: null
},
footer: {
host: null,
floating: null,
placeholder: null
}
};
this.dom.header.host = this.dom.thead.parent();
this.dom.footer.host = this.dom.tfoot.parent();
var dtSettings = dt.settings()[0];
if ( dtSettings._fixedHeader ) {
throw "FixedHeader already initialised on table "+dtSettings.nTable.id;
}
dtSettings._fixedHeader = this;
this._constructor();
};
/*
* Variable: FixedHeader
* Purpose: Prototype for FixedHeader
* Scope: global
*/
$.extend( FixedHeader.prototype, {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* API methods
*/
/**
* Enable / disable the fixed elements
*
* @param {boolean} enable `true` to enable, `false` to disable
*/
enable: function ( enable )
{
this.s.enable = enable;
if ( this.c.header ) {
this._modeChange( 'in-place', 'header', true );
}
if ( this.c.footer && this.dom.tfoot.length ) {
this._modeChange( 'in-place', 'footer', true );
}
this.update();
},
/**
* Recalculate the position of the fixed elements and force them into place
*/
update: function ()
{
this._positions();
this._scroll( true );
},
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Constructor
*/
/**
* FixedHeader constructor - adding the required event listeners and
* simple initialisation
*
* @private
*/
_constructor: function ()
{
var that = this;
var dt = this.s.dt;
$(window)
.on( 'scroll'+this.s.namespace, function () {
that._scroll();
} )
.on( 'resize'+this.s.namespace, function () {
that.s.position.windowHeight = $(window).height();
that.update();
} );
dt.on( 'column-reorder.dt.dtfc column-visibility.dt.dtfc draw.dt.dtfc', function () {
that.update();
} );
dt.on( 'destroy.dtfc', function () {
dt.off( '.dtfc' );
$(window).off( that.s.namespace );
} );
this._positions();
this._scroll();
},
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Private methods
*/
/**
* Clone a fixed item to act as a place holder for the original element
* which is moved into a clone of the table element, and moved around the
* document to give the fixed effect.
*
* @param {string} item 'header' or 'footer'
* @param {boolean} force Force the clone to happen, or allow automatic
* decision (reuse existing if available)
* @private
*/
_clone: function ( item, force )
{
var dt = this.s.dt;
var itemDom = this.dom[ item ];
var itemElement = item === 'header' ?
this.dom.thead :
this.dom.tfoot;
if ( ! force && itemDom.floating ) {
// existing floating element - reuse it
itemDom.floating.removeClass( 'fixedHeader-floating fixedHeader-locked' );
}
else {
if ( itemDom.floating ) {
itemDom.placeholder.remove();
itemDom.floating.children().detach();
itemDom.floating.remove();
}
itemDom.floating = $( dt.table().node().cloneNode( false ) )
.removeAttr( 'id' )
.append( itemElement )
.appendTo( 'body' );
// Insert a fake thead/tfoot into the DataTable to stop it jumping around
itemDom.placeholder = itemElement.clone( false );
itemDom.host.append( itemDom.placeholder );
// Clone widths
this._matchWidths( itemDom.placeholder, itemDom.floating );
}
},
/**
* Copy widths from the cells in one element to another. This is required
* for the footer as the footer in the main table takes its sizes from the
* header columns. That isn't present in the footer so to have it still
* align correctly, the sizes need to be copied over. It is also required
* for the header when auto width is not enabled
*
* @param {jQuery} from Copy widths from
* @param {jQuery} to Copy widths to
* @private
*/
_matchWidths: function ( from, to ) {
var type = function ( name ) {
var toWidths = $(name, from)
.map( function () {
return $(this).width();
} ).toArray();
$(name, to).each( function ( i ) {
$(this).width( toWidths[i] );
} );
};
type( 'th' );
type( 'td' );
},
/**
* Remove assigned widths from the cells in an element. This is required
* when inserting the footer back into the main table so the size is defined
* by the header columns and also when auto width is disabled in the
* DataTable.
*
* @param {string} item The `header` or `footer`
* @private
*/
_unsize: function ( item ) {
var el = this.dom[ item ].floating;
if ( el && (item === 'footer' || (item === 'header' && ! this.s.autoWidth)) ) {
$('th, td', el).css( 'width', '' );
}
},
/**
* Reposition the floating elements to take account of horizontal page
* scroll
*
* @param {string} item The `header` or `footer`
* @param {int} scrollLeft Document scrollLeft
* @private
*/
_horizontal: function ( item, scrollLeft )
{
var itemDom = this.dom[ item ];
var position = this.s.position;
var lastScrollLeft = this.s.scrollLeft;
if ( itemDom.floating && lastScrollLeft[ item ] !== scrollLeft ) {
itemDom.floating.css( 'left', position.left - scrollLeft );
lastScrollLeft[ item ] = scrollLeft;
}
},
/**
* Change from one display mode to another. Each fixed item can be in one
* of:
*
* * `in-place` - In the main DataTable
* * `in` - Floating over the DataTable
* * `below` - (Header only) Fixed to the bottom of the table body
* * `above` - (Footer only) Fixed to the top of the table body
*
* @param {string} mode Mode that the item should be shown in
* @param {string} item 'header' or 'footer'
* @param {boolean} forceChange Force a redraw of the mode, even if already
* in that mode.
* @private
*/
_modeChange: function ( mode, item, forceChange )
{
var dt = this.s.dt;
var itemDom = this.dom[ item ];
var position = this.s.position;
if ( mode === 'in-place' ) {
// Insert the header back into the table's real header
if ( itemDom.placeholder ) {
itemDom.placeholder.remove();
itemDom.placeholder = null;
}
this._unsize( item );
itemDom.host.append( item === 'header' ?
this.dom.thead :
this.dom.tfoot
);
if ( itemDom.floating ) {
itemDom.floating.remove();
itemDom.floating = null;
}
}
else if ( mode === 'in' ) {
// Remove the header from the read header and insert into a fixed
// positioned floating table clone
this._clone( item, forceChange );
itemDom.floating
.addClass( 'fixedHeader-floating' )
.css( item === 'header' ? 'top' : 'bottom', this.c[item+'Offset'] )
.css( 'left', position.left+'px' )
.css( 'width', position.width+'px' );
if ( item === 'footer' ) {
itemDom.floating.css( 'top', '' );
}
}
else if ( mode === 'below' ) { // only used for the header
// Fix the position of the floating header at base of the table body
this._clone( item, forceChange );
itemDom.floating
.addClass( 'fixedHeader-locked' )
.css( 'top', position.tfootTop - position.theadHeight )
.css( 'left', position.left+'px' )
.css( 'width', position.width+'px' );
}
else if ( mode === 'above' ) { // only used for the footer
// Fix the position of the floating footer at top of the table body
this._clone( item, forceChange );
itemDom.floating
.addClass( 'fixedHeader-locked' )
.css( 'top', position.tbodyTop )
.css( 'left', position.left+'px' )
.css( 'width', position.width+'px' );
}
this.s.scrollLeft.header = -1;
this.s.scrollLeft.footer = -1;
this.s[item+'Mode'] = mode;
},
/**
* Cache the positional information that is required for the mode
* calculations that FixedHeader performs.
*
* @private
*/
_positions: function ()
{
var dt = this.s.dt;
var table = dt.table();
var position = this.s.position;
var dom = this.dom;
var tableNode = $(table.node());
// Need to use the header and footer that are in the main table,
// regardless of if they are clones, since they hold the positions we
// want to measure from
var thead = tableNode.children('thead');
var tfoot = tableNode.children('tfoot');
var tbody = dom.tbody;
position.visible = tableNode.is(':visible');
position.width = tableNode.outerWidth();
position.left = tableNode.offset().left;
position.theadTop = thead.offset().top;
position.tbodyTop = tbody.offset().top;
position.theadHeight = position.tbodyTop - position.theadTop;
if ( tfoot.length ) {
position.tfootTop = tfoot.offset().top;
position.tfootBottom = position.tfootTop + tfoot.outerHeight();
position.tfootHeight = position.tfootBottom - position.tfootTop;
}
else {
position.tfootTop = position.tbodyTop + tbody.outerHeight();
position.tfootBottom = position.tfootTop;
position.tfootHeight = position.tfootTop;
}
},
/**
* Mode calculation - determine what mode the fixed items should be placed
* into.
*
* @param {boolean} forceChange Force a redraw of the mode, even if already
* in that mode.
* @private
*/
_scroll: function ( forceChange )
{
var windowTop = $(document).scrollTop();
var windowLeft = $(document).scrollLeft();
var position = this.s.position;
var headerMode, footerMode;
if ( ! this.s.enable ) {
return;
}
if ( this.c.header ) {
if ( ! position.visible || windowTop <= position.theadTop - this.c.headerOffset ) {
headerMode = 'in-place';
}
else if ( windowTop <= position.tfootTop - position.theadHeight - this.c.headerOffset ) {
headerMode = 'in';
}
else {
headerMode = 'below';
}
if ( forceChange || headerMode !== this.s.headerMode ) {
this._modeChange( headerMode, 'header', forceChange );
}
this._horizontal( 'header', windowLeft );
}
if ( this.c.footer && this.dom.tfoot.length ) {
if ( ! position.visible || windowTop + position.windowHeight >= position.tfootBottom + this.c.footerOffset ) {
footerMode = 'in-place';
}
else if ( position.windowHeight + windowTop > position.tbodyTop + position.tfootHeight + this.c.footerOffset ) {
footerMode = 'in';
}
else {
footerMode = 'above';
}
if ( forceChange || footerMode !== this.s.footerMode ) {
this._modeChange( footerMode, 'footer', forceChange );
}
this._horizontal( 'footer', windowLeft );
}
}
} );
/**
* Version
* @type {String}
* @static
*/
FixedHeader.version = "3.0.1-dev";
/**
* Defaults
* @type {Object}
* @static
*/
FixedHeader.defaults = {
header: true,
footer: false,
headerOffset: 0,
footerOffset: 0
};
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* DataTables interfaces
*/
// Attach for constructor access
$.fn.dataTable.FixedHeader = FixedHeader;
$.fn.DataTable.FixedHeader = FixedHeader;
// DataTables creation - check if the FixedHeader option has been defined on the
// table and if so, initialise
$(document).on( 'init.dt.dtb', function (e, settings, json) {
if ( e.namespace !== 'dt' ) {
return;
}
var opts = settings.oInit.fixedHeader || DataTable.defaults.fixedHeader;
if ( opts && ! settings._fixedHeader ) {
new FixedHeader( settings, opts );
}
} );
// DataTables API methods
DataTable.Api.register( 'fixedHeader()', function () {} );
DataTable.Api.register( 'fixedHeader.adjust()', function () {
return this.iterator( 'table', function ( ctx ) {
var fh = ctx._fixedHeader;
if ( fh ) {
fh.update();
}
} );
} );
DataTable.Api.register( 'fixedHeader.enable()', function ( flag ) {
return this.iterator( 'table', function ( ctx ) {
var fh = ctx._fixedHeader;
if ( fh ) {
fh.enable( flag !== undefined ? flag : true );
}
} );
} );
DataTable.Api.register( 'fixedHeader.disable()', function ( ) {
return this.iterator( 'table', function ( ctx ) {
var fh = ctx._fixedHeader;
if ( fh ) {
fh.enable( false );
}
} );
} );
return FixedHeader;
}; // /factory
// Define as an AMD module if possible
if ( typeof define === 'function' && define.amd ) {
define( ['jquery', 'datatables'], factory );
}
else if ( typeof exports === 'object' ) {
// Node/CommonJS
factory( require('jquery'), require('datatables') );
}
else if ( jQuery && !jQuery.fn.dataTable.FixedHeader ) {
// Otherwise simply initialise as normal, stopping multiple evaluation
factory( jQuery, jQuery.fn.dataTable );
}
})(window, document);
| {
"content_hash": "d9452011dcb474790784464464ec5cec",
"timestamp": "",
"source": "github",
"line_count": 570,
"max_line_length": 115,
"avg_line_length": 25.152631578947368,
"alnum_prop": 0.6227244193345888,
"repo_name": "joe-meyer/FixedHeader",
"id": "1279c3fa54b50259a9ff8fc8cbdf4c8f319d7ce5",
"size": "14338",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js/dataTables.fixedHeader.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1028"
},
{
"name": "JavaScript",
"bytes": "14338"
},
{
"name": "Shell",
"bytes": "534"
}
],
"symlink_target": ""
} |
namespace COSRead {
bool wait_read (int fd, int maxsecs=0, int maxusecs=0);
bool wait_read (int *fds, uint num_fds, int maxsecs=0, int maxusecs=0);
bool wait_read (int *fds, uint num_fds, bool *flags=NULL, int maxsecs=0, int maxusecs=0);
bool wait_write(int fd, int maxsecs = 0, int maxusecs=0);
bool wait_write(int *fds, uint num_fds, int maxsecs=0, int maxusecs=0);
bool wait_write(int *fds, uint num_fds, bool *flags=NULL, int maxsecs=0, int maxusecs=0);
bool read(int fd, std::string &str);
bool readall(int fd, void *buf, size_t n);
bool write(int fd, char c);
bool write(int fd, const std::string &str);
ssize_t writeall(int fd, const void *buf, size_t n);
bool poll_read (int *fds, uint num_fds, bool *flags, int max_msecs);
bool poll_write(int *fds, uint num_fds, bool *flags, int max_msecs);
}
#endif
| {
"content_hash": "bd74c361bec4473b0d49776daa945086",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 91,
"avg_line_length": 36.65217391304348,
"alnum_prop": 0.6785290628706999,
"repo_name": "colinw7/COS",
"id": "73d964d95fa172cc0d9a0377498432b0402b67a0",
"size": "922",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "include/COSRead.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "700"
},
{
"name": "C++",
"bytes": "117709"
},
{
"name": "Makefile",
"bytes": "874"
},
{
"name": "POV-Ray SDL",
"bytes": "2049"
}
],
"symlink_target": ""
} |
Components.JSPresentationUtils = {};
/**
* @param {?SDK.Target} target
* @param {!Components.Linkifier} linkifier
* @param {!Protocol.Runtime.StackTrace=} stackTrace
* @param {function()=} contentUpdated
* @return {{element: !Element, links: !Array<!Element>}}
*/
Components.JSPresentationUtils.buildStackTracePreviewContents = function(
target, linkifier, stackTrace, contentUpdated) {
const element = createElement('span');
element.style.display = 'inline-block';
const shadowRoot = UI.createShadowRootWithCoreStyles(element, 'components/jsUtils.css');
const contentElement = shadowRoot.createChild('table', 'stack-preview-container');
let totalHiddenCallFramesCount = 0;
let totalCallFramesCount = 0;
/** @type {!Array<!Element>} */
const links = [];
/**
* @param {!Protocol.Runtime.StackTrace} stackTrace
* @return {boolean}
*/
function appendStackTrace(stackTrace) {
let hiddenCallFrames = 0;
for (const stackFrame of stackTrace.callFrames) {
totalCallFramesCount++;
let shouldHide = totalCallFramesCount > 30 && stackTrace.callFrames.length > 31;
const row = createElement('tr');
row.createChild('td').textContent = '\n';
row.createChild('td', 'function-name').textContent = UI.beautifyFunctionName(stackFrame.functionName);
const link = linkifier.maybeLinkifyConsoleCallFrame(target, stackFrame);
if (link) {
link.addEventListener('contextmenu', populateContextMenu.bind(null, link));
const uiLocation = Components.Linkifier.uiLocation(link);
if (uiLocation && Bindings.blackboxManager.isBlackboxedUISourceCode(uiLocation.uiSourceCode))
shouldHide = true;
row.createChild('td').textContent = ' @ ';
row.createChild('td').appendChild(link);
links.push(link);
}
if (shouldHide) {
row.classList.add('blackboxed');
++hiddenCallFrames;
}
contentElement.appendChild(row);
}
totalHiddenCallFramesCount += hiddenCallFrames;
return stackTrace.callFrames.length === hiddenCallFrames;
}
/**
* @param {!Element} link
* @param {!Event} event
*/
function populateContextMenu(link, event) {
const contextMenu = new UI.ContextMenu(event);
event.consume(true);
const uiLocation = Components.Linkifier.uiLocation(link);
if (uiLocation && Bindings.blackboxManager.canBlackboxUISourceCode(uiLocation.uiSourceCode)) {
if (Bindings.blackboxManager.isBlackboxedUISourceCode(uiLocation.uiSourceCode)) {
contextMenu.debugSection().appendItem(
ls`Stop blackboxing`, () => Bindings.blackboxManager.unblackboxUISourceCode(uiLocation.uiSourceCode));
} else {
contextMenu.debugSection().appendItem(
ls`Blackbox script`, () => Bindings.blackboxManager.blackboxUISourceCode(uiLocation.uiSourceCode));
}
}
contextMenu.appendApplicableItems(event);
contextMenu.show();
}
if (!stackTrace)
return {element, links};
appendStackTrace(stackTrace);
let asyncStackTrace = stackTrace.parent;
while (asyncStackTrace) {
if (!asyncStackTrace.callFrames.length) {
asyncStackTrace = asyncStackTrace.parent;
continue;
}
const row = contentElement.createChild('tr');
row.createChild('td').textContent = '\n';
row.createChild('td', 'stack-preview-async-description').textContent =
UI.asyncStackTraceLabel(asyncStackTrace.description);
row.createChild('td');
row.createChild('td');
if (appendStackTrace(asyncStackTrace))
row.classList.add('blackboxed');
asyncStackTrace = asyncStackTrace.parent;
}
if (totalHiddenCallFramesCount) {
const row = contentElement.createChild('tr', 'show-blackboxed-link');
row.createChild('td').textContent = '\n';
const cell = row.createChild('td');
cell.colSpan = 4;
const showAllLink = cell.createChild('span', 'link');
if (totalHiddenCallFramesCount === 1)
showAllLink.textContent = ls`Show 1 more frame`;
else
showAllLink.textContent = ls`Show ${totalHiddenCallFramesCount} more frames`;
showAllLink.addEventListener('click', () => {
contentElement.classList.add('show-blackboxed');
if (contentUpdated)
contentUpdated();
}, false);
}
return {element, links};
};
| {
"content_hash": "5b863551563d4b5dea76fac18e91ca10",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 114,
"avg_line_length": 37.504347826086956,
"alnum_prop": 0.6909343844191977,
"repo_name": "dart-archive/devtools-frontend",
"id": "3e74bea526b0dbb788e23c8cb7079a7ce409ba57",
"size": "6036",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "front_end/components/JSPresentationUtils.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "451571"
},
{
"name": "Dart",
"bytes": "19820"
},
{
"name": "HTML",
"bytes": "37667"
},
{
"name": "Java",
"bytes": "72158"
},
{
"name": "JavaScript",
"bytes": "10035137"
},
{
"name": "Python",
"bytes": "140323"
},
{
"name": "Shell",
"bytes": "66"
}
],
"symlink_target": ""
} |
package javax.swing;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Point;
import java.awt.Rectangle;
/**
* Manages a popup window that displays a Component on top of
* everything else.
*
* <p>To obtain an instance of <code>Popup</code>, use the
* {@link javax.swing.PopupFactory}.
*
* @since 1.4
*
* @author Sascha Brawer ([email protected])
*/
public class Popup
{
/**
* Constructs a new <code>Popup</code> given its owner,
* contents and the screen position where the popup
* will appear.
*
* @param owner the Component to which <code>x</code> and
* <code>y</code> are relative, or <code>null</code> for
* placing the popup relative to the origin of the screen.
*
* @param contents the contents that will be displayed inside
* the <code>Popup</code>.
*
* @param x the horizontal position where the Popup will appear.
*
* @param y the vertical position where the Popup will appear.
*
* @throws IllegalArgumentException if <code>contents</code>
* is <code>null</code>.
*/
protected Popup(Component owner, Component contents,
int x, int y)
{
if (contents == null)
throw new IllegalArgumentException();
// The real stuff happens in the implementation of subclasses,
// for instance JWindowPopup.
}
/**
* Constructs a new <code>Popup</code>.
*/
protected Popup()
{
// Nothing to do here.
}
/**
* Displays the <code>Popup</code> on the screen. Nothing happens
* if it is currently shown.
*/
public void show()
{
// Implemented by subclasses, for instance JWindowPopup.
}
/**
* Removes the <code>Popup</code> from the screen. Nothing happens
* if it is currently hidden.
*/
public void hide()
{
// Implemented by subclasses, for instance JWindowPopup.
}
/**
* A <code>Popup</code> that uses a <code>JWindow</code> for
* displaying its contents.
*
* @see PopupFactory#getPopup
*
* @author Sascha Brawer ([email protected])
*/
static class JWindowPopup
extends Popup
{
/**
* The <code>JWindow</code> used for displaying the contents
* of the popup.
*/
JWindow window;
private Component contents;
/**
* Constructs a new <code>JWindowPopup</code> given its owner,
* contents and the screen position where the popup
* will appear.
*
* @param owner the Component to which <code>x</code> and
* <code>y</code> are relative, or <code>null</code> for
* placing the popup relative to the origin of the screen.
*
* @param contents the contents that will be displayed inside
* the <code>Popup</code>.
*
* @param x the horizontal position where the Popup will appear.
*
* @param y the vertical position where the Popup will appear.
*
* @throws IllegalArgumentException if <code>contents</code>
* is <code>null</code>.
*/
public JWindowPopup(Component owner, Component contents,
int x, int y)
{
/* Checks whether contents is null. */
super(owner, contents, x, y);
this.contents = contents;
window = new JWindow(SwingUtilities.getWindowAncestor(owner));
window.getContentPane().add(contents);
window.setLocation(x, y);
window.setFocusableWindowState(false);
}
/**
* Displays the popup's <code>JWindow</code> on the screen.
* Nothing happens if it is already visible.
*/
public void show()
{
window.setSize(contents.getSize());
window.show();
}
/**
* Removes the popup's <code>JWindow</code> from the
* screen. Nothing happens if it is currently not visible.
*/
public void hide()
{
/* Calling dispose() instead of hide() will conserve native
* system resources, for example memory in an X11 server.
* They will automatically be re-allocated by a call to
* show().
*/
window.dispose();
}
}
/**
* A popup that displays itself within the JLayeredPane of a JRootPane of
* the containment hierarchy of the owner component.
*
* @author Roman Kennke ([email protected])
*/
static class LightweightPopup extends Popup
{
/**
* The owner component for this popup.
*/
Component owner;
/**
* The contents that should be shown.
*/
Component contents;
/**
* The X location in screen coordinates.
*/
int x;
/**
* The Y location in screen coordinates.
*/
int y;
/**
* The panel that holds the content.
*/
private JPanel panel;
/**
* The layered pane of the owner.
*/
private JLayeredPane layeredPane;
/**
* Constructs a new <code>LightweightPopup</code> given its owner,
* contents and the screen position where the popup
* will appear.
*
* @param owner the component that should own the popup window; this
* provides the JRootPane in which we place the popup window
*
* @param contents the contents that will be displayed inside
* the <code>Popup</code>.
*
* @param x the horizontal position where the Popup will appear in screen
* coordinates
*
* @param y the vertical position where the Popup will appear in screen
* coordinates
*
* @throws IllegalArgumentException if <code>contents</code>
* is <code>null</code>.
*/
public LightweightPopup(Component owner, Component contents, int x, int y)
{
super(owner, contents, x, y);
this.owner = owner;
this.contents = contents;
this.x = x;
this.y = y;
JRootPane rootPane = SwingUtilities.getRootPane(owner);
JLayeredPane layeredPane = rootPane.getLayeredPane();
this.layeredPane = layeredPane;
}
/**
* Places the popup within the JLayeredPane of the owner component and
* makes it visible.
*/
public void show()
{
// We insert a JPanel between the layered pane and the contents so we
// can fiddle with the setLocation() method without disturbing a
// JPopupMenu (which overrides setLocation in an unusual manner).
if (panel == null)
{
panel = new JPanel();
panel.setLayout(new FlowLayout(0, 0, 0));
}
panel.add(contents);
panel.setSize(contents.getSize());
Point layeredPaneLoc = layeredPane.getLocationOnScreen();
panel.setLocation(x - layeredPaneLoc.x, y - layeredPaneLoc.y);
layeredPane.add(panel, JLayeredPane.POPUP_LAYER);
panel.repaint();
}
/**
* Removes the popup from the JLayeredPane thus making it invisible.
*/
public void hide()
{
Rectangle bounds = panel.getBounds();
layeredPane.remove(panel);
layeredPane.repaint(bounds.x, bounds.y, bounds.width, bounds.height);
}
}
}
| {
"content_hash": "1f6401d827a25cc399d59a6d31e77b3f",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 79,
"avg_line_length": 26.533834586466167,
"alnum_prop": 0.6157551714366676,
"repo_name": "shaotuanchen/sunflower_exp",
"id": "308cd662d8de7e2deca9e6bc4972a5a79c3a523d",
"size": "8783",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "tools/source/gcc-4.2.4/libjava/classpath/javax/swing/Popup.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "459993"
},
{
"name": "Awk",
"bytes": "6562"
},
{
"name": "Batchfile",
"bytes": "9028"
},
{
"name": "C",
"bytes": "50326113"
},
{
"name": "C++",
"bytes": "2040239"
},
{
"name": "CSS",
"bytes": "2355"
},
{
"name": "Clarion",
"bytes": "2484"
},
{
"name": "Coq",
"bytes": "61440"
},
{
"name": "DIGITAL Command Language",
"bytes": "69150"
},
{
"name": "Emacs Lisp",
"bytes": "186910"
},
{
"name": "Fortran",
"bytes": "5364"
},
{
"name": "HTML",
"bytes": "2171356"
},
{
"name": "JavaScript",
"bytes": "27164"
},
{
"name": "Logos",
"bytes": "159114"
},
{
"name": "M",
"bytes": "109006"
},
{
"name": "M4",
"bytes": "100614"
},
{
"name": "Makefile",
"bytes": "5409865"
},
{
"name": "Mercury",
"bytes": "702"
},
{
"name": "Module Management System",
"bytes": "56956"
},
{
"name": "OCaml",
"bytes": "253115"
},
{
"name": "Objective-C",
"bytes": "57800"
},
{
"name": "Papyrus",
"bytes": "3298"
},
{
"name": "Perl",
"bytes": "70992"
},
{
"name": "Perl 6",
"bytes": "693"
},
{
"name": "PostScript",
"bytes": "3440120"
},
{
"name": "Python",
"bytes": "40729"
},
{
"name": "Redcode",
"bytes": "1140"
},
{
"name": "Roff",
"bytes": "3794721"
},
{
"name": "SAS",
"bytes": "56770"
},
{
"name": "SRecode Template",
"bytes": "540157"
},
{
"name": "Shell",
"bytes": "1560436"
},
{
"name": "Smalltalk",
"bytes": "10124"
},
{
"name": "Standard ML",
"bytes": "1212"
},
{
"name": "TeX",
"bytes": "385584"
},
{
"name": "WebAssembly",
"bytes": "52904"
},
{
"name": "Yacc",
"bytes": "510934"
}
],
"symlink_target": ""
} |
package org.apache.geode.internal.cache.wan.serial;
import org.apache.logging.log4j.Logger;
import org.apache.geode.internal.cache.wan.AbstractGatewaySender;
import org.apache.geode.internal.logging.LogService;
public class RemoteConcurrentSerialGatewaySenderEventProcessor
extends ConcurrentSerialGatewaySenderEventProcessor {
private static final Logger logger = LogService.getLogger();
public RemoteConcurrentSerialGatewaySenderEventProcessor(AbstractGatewaySender sender) {
super(sender);
}
@Override
protected void initializeMessageQueue(String id) {
for (int i = 0; i < sender.getDispatcherThreads(); i++) {
processors.add(new RemoteSerialGatewaySenderEventProcessor(this.sender, id + "." + i));
if (logger.isDebugEnabled()) {
logger.debug("Created the RemoteSerialGatewayEventProcessor_{}->{}", i, processors.get(i));
}
}
}
}
| {
"content_hash": "b4457eb56c03c3c4b507e6710914806e",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 99,
"avg_line_length": 31.964285714285715,
"alnum_prop": 0.7553072625698324,
"repo_name": "prasi-in/geode",
"id": "7d5d5c5d2b8c52855ece6cea00429bbefaaf346b",
"size": "1684",
"binary": false,
"copies": "6",
"ref": "refs/heads/develop",
"path": "geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/RemoteConcurrentSerialGatewaySenderEventProcessor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "106707"
},
{
"name": "Groovy",
"bytes": "2928"
},
{
"name": "HTML",
"bytes": "3984628"
},
{
"name": "Java",
"bytes": "26703981"
},
{
"name": "JavaScript",
"bytes": "1781013"
},
{
"name": "Ruby",
"bytes": "6751"
},
{
"name": "Scala",
"bytes": "236402"
},
{
"name": "Shell",
"bytes": "43900"
}
],
"symlink_target": ""
} |
\documentclass[manual-fr.tex]{subfiles}
\begin{document}
Les features de type \textit{arity} sont définies en fonction du nombre d'arguments qu'elles prennent en paramètre. Il en existe de plusieurs types.\\
Le premier type de \textit{token feature} \textit{arity} est \textit{nullary}. Ce type de feature ne prend aucun argument. Des exemples de features \textit{nullary} sont illustrées dans les figures \ref{fig:feature-nullary-BOS}, \ref{fig:feature-nullary-EOS}, \ref{fig:feature-nullary-lower} et \ref{fig:feature-nullary-substring}. Les différentes actions sont les suivantes :
\begin{itemize}
\item BOS (\textit{boolean feature}) : le mot est-il en début de séquence ?
\item EOS (\textit{boolean feature}) : le mot est-il en fin de séquence ?
\item lower (\textit{string feature}) : transforme la chaine en entrée en minuscules ;
\item substring (\textit{string feature}) : fournit une sous-chaine de la chaine donnée en entrée. Définit les options suivantes :
\begin{itemize}
\item from="[entier]" : l'indice de début de la sous-chaine (défaut : 0)
\item to="[entier]" : l'indice de fin de la sous-chaine. Si 0 est donné, "to" sera la fin de la chaine (défaut : 0)
\end{itemize}
\end{itemize}
\begin{figure}[ht!]
\footnotesize
\begin{xml}
\xunit{nullary}{\xfield{name}{IsFirstWord?} \xfield{action}{BOS}}
\end{xml}
\caption{exemple de la feature \textit{nullary} "BOS".}
\label{fig:feature-nullary-BOS}
\end{figure}
\begin{figure}[ht!]
\footnotesize
\begin{xml}
\xunit{nullary}{\xfield{name}{IsLastWord?} \xfield{action}{EOS}}
\end{xml}
\caption{exemple de la feature \textit{nullary} "EOS".}
\label{fig:feature-nullary-EOS}
\end{figure}
\begin{figure}[ht!]
\footnotesize
\begin{xml}
\xunit{nullary}{\xfield{name}{lower} \xfield{action}{lower}}
\end{xml}
\caption{exemple de la feature \textit{nullary} "lower".}
\label{fig:feature-nullary-lower}
\end{figure}
\begin{figure}[ht!]
\footnotesize
\begin{xml}
\xunit{nullary}{\xfield{name}{radical-3} \xfield{action}{substring} \xfield{to}{-3}}
\end{xml}
\caption{exemple de la feature \textit{nullary} "substring".}
\label{fig:feature-nullary-substring}
\end{figure}
Le deuxième type de \textit{token feature} est la \textit{unary}. Elle prend un unique argument. Un exemple est illustré sur la figure \ref{fig:feature-unary-isUpper}. Les différentes actions sont :
\begin{itemize}
\item isUpper: vérifie si le caractère à l'indice donné est en majuscule.
\end{itemize}
\begin{figure}[ht!]
\footnotesize
\begin{xml}
\xmarker{unary}{ \xfield{name}{StartsWithUpper?} \xfield{action}{isUpper}}{0}
\end{xml}
\caption{exemple de la feature \textit{unary} "isUpper".}
\label{fig:feature-unary-isUpper}
\end{figure}
Le troisième type de \textit{token feature} est la \textit{binary}. Elle prend exactement deux arguments. Un exemple est illustré sur la figure \ref{fig:feature-binary-substitute}. Les différentes actions sont :
\begin{itemize}
\item substitute : substitute une chaine par une autre. Le premier argument est \textit{pattern} et le second est \textit{replace}.
\end{itemize}
\begin{figure}[ht!]
\footnotesize
\begin{xml}
\xmarker{binary}{ \xfield{name}{To-Greek-Alpha} \xfield{action}{substitute}}{\\
\xmarker{pattern}{}{alpha}\\
\xmarker{replace}{}{$\alpha$}\\
}
\end{xml}
\caption{exemple de la feature \textit{binary} "substitue".}
\label{fig:feature-binary-substitute}
\end{figure}
Le quatrième type de \textit{token feature} est la \textit{n-ary}. Elle prend un nombre arbitraire d'argument. Un exemple est illustré sur la figure \ref{fig:feature-nary-sequencer}. Les différentes actions sont :
\begin{itemize}
\item sequencer : effectue une séquences de traitements sur l'élément en entrée. Ces traitements sont systématiquement des \textit{string features}, seul le dernier élément peut être une \textit{string feature} ou une \textit{boolean feature}.
\end{itemize}
\begin{figure}[ht!]
\footnotesize
\begin{xml}
\xmarker{nary}{ \xfield{name}{CharacterClass} \xfield{action}{sequencer}}{\\
\xmarker{binary}{ \xfield{action}{substitute}}{\\
\xmarker{pattern}{}{[A-Z]}\\
\xmarker{replace}{}{A}\\
}\\
\xmarker{binary}{ \xfield{action}{substitute}}{\\
\xmarker{pattern}{}{[a-z]}\\
\xmarker{replace}{}{a}\\
}\\
\xmarker{binary}{ \xfield{action}{substitute}}{\\
\xmarker{pattern}{}{[0-9]}\\
\xmarker{replace}{}{0}\\
}\\
\xmarker{binary}{ \xfield{action}{substitute}}{\\
\xmarker{pattern}{}{[\^{}Aa0]}\\
\xmarker{replace}{}{x}\\
}\\
}
\end{xml}
\caption{exemple de la feature \textit{n-ary} "sequencer". L'exemple ici implémente les classes de caractères (appelées \textit{word shapes} dans \cite{finkel2004exploiting}).}
\label{fig:feature-nary-sequencer}
\end{figure}
\end{document} | {
"content_hash": "51db7d3f6305bcebeeff100fe972b64e",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 376,
"avg_line_length": 42.51724137931034,
"alnum_prop": 0.6964720194647201,
"repo_name": "YoannDupont/SEM",
"id": "b661d844a534f8e9f44852a788e4e3fb72300717",
"size": "4971",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "manual/fr/config-files/enrich/feature-arity.tex",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "230"
},
{
"name": "CSS",
"bytes": "6940"
},
{
"name": "Python",
"bytes": "551652"
},
{
"name": "Shell",
"bytes": "199"
},
{
"name": "TeX",
"bytes": "159226"
}
],
"symlink_target": ""
} |
require 'rails_helper'
describe SessionsController do
describe 'create new sessions' do
context 'GET/ /sessions/new' do
before(:each) do
get :new
end
it 'has a form page' do
expect(response).to be_ok
end
it 'renders a form template' do
expect(response).to render_template(:new)
end
end
end
end
| {
"content_hash": "633c2566e9f08d71d982828ac2658f47",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 49,
"avg_line_length": 16.90909090909091,
"alnum_prop": 0.6048387096774194,
"repo_name": "nyc-fiddler-crabs-2015/Hagwon",
"id": "a30360cbbbe600c9de7158c5b969ded79f071cc0",
"size": "372",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/controllers/sessions_controller_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "11962"
},
{
"name": "HTML",
"bytes": "21471"
},
{
"name": "JavaScript",
"bytes": "6936"
},
{
"name": "Ruby",
"bytes": "52541"
}
],
"symlink_target": ""
} |
sudo apt-get install --only-upgrade dnsmasq=2.59-4ubuntu0.2 -y
sudo apt-get install --only-upgrade dnsmasq-utils=2.59-4ubuntu0.2 -y
sudo apt-get install --only-upgrade dnsmasq-base=2.59-4ubuntu0.2 -y
sudo apt-get install --only-upgrade dnsmasq-base=2.59-4ubuntu0.2 -y
| {
"content_hash": "f59e62ce5949304660a179fe3538f787",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 68,
"avg_line_length": 67,
"alnum_prop": 0.7649253731343284,
"repo_name": "Cyberwatch/cbw-security-fixes",
"id": "9716b4caa322906f946341b2b9a9f28edbf678dd",
"size": "1031",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Ubuntu_12.04_LTS/i386/2015/USN-2593-1.sh",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Shell",
"bytes": "26564468"
}
],
"symlink_target": ""
} |
<!-- start library -->
<script src="assets/js/jquery-2.2.3.js" type="text/javascript"></script>
<script src="assets/js/bootstrap.js" type="text/javascript"></script>
<script src="assets/js/my_server_config.js" type="text/javascript"></script>
<script src="assets/js/my_public_session.js" type="text/javascript"></script>
<link href="assets/css/bootstrap.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/bootstrap-theme.css" rel="stylesheet" type="text/css"/>
<!-- end library -->
<!-- start message box -->
<div class="row"><div class="col-sm-12" id="alert_msg_box"></div></div>
<!-- end message box --> | {
"content_hash": "89dfc4896d08968d6c4224d75487cda0",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 78,
"avg_line_length": 52.416666666666664,
"alnum_prop": 0.6756756756756757,
"repo_name": "mohamedaliff/dpapps",
"id": "a9d3bfafbfd2f0dd7e6acf7af33043e25b75044a",
"size": "629",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "www/profile_details.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "202309"
},
{
"name": "HTML",
"bytes": "8379552"
},
{
"name": "JavaScript",
"bytes": "377974"
},
{
"name": "PHP",
"bytes": "1834013"
}
],
"symlink_target": ""
} |
'use strict';
exports.hostname = process.env.hostname || 'localhost';
exports.port = process.env.PORT || 3000;
exports.mongodb = {
uri: process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || '{{MONGO_URI}}'
};
exports.companyName = 'Tuition';
exports.projectName = 'Tuition';
exports.systemEmail = '{{ADMIN_EMAIL}}';
exports.cryptoKey = 'k3yb0ardc4t';
exports.loginAttempts = {
forIp: 50,
forIpAndUser: 7,
logExpiration: '20m'
};
exports.requireAccountVerification = false;
exports.smtp = {
from: {
name: process.env.SMTP_FROM_NAME || exports.projectName +' Website',
address: process.env.SMTP_FROM_ADDRESS || '{{ADMIN_EMAIL}}'
},
credentials: {
user: process.env.SMTP_USERNAME || '{{SMTP_EMAIL}}',
password: process.env.SMTP_PASSWORD || '{{SMTP_PASSWORD}}',
host: process.env.SMTP_HOST || '{{SMTP_HOST}}',
ssl: true
}
};
exports.oauth = {
twitter: {
// Not yet implemented
key: process.env.TWITTER_OAUTH_KEY || '',
secret: process.env.TWITTER_OAUTH_SECRET || ''
},
facebook: {
key: process.env.FACEBOOK_OAUTH_KEY || '',
secret: process.env.FACEBOOK_OAUTH_SECRET || ''
},
github: {
// Not yet implemented
key: process.env.GITHUB_OAUTH_KEY || '',
secret: process.env.GITHUB_OAUTH_SECRET || ''
},
google: {
key: process.env.GOOGLE_OAUTH_KEY || '',
secret: process.env.GOOGLE_OAUTH_SECRET || ''
},
tumblr: {
// Not yet implemented
key: process.env.TUMBLR_OAUTH_KEY || '',
secret: process.env.TUMBLR_OAUTH_SECRET || ''
}
};
| {
"content_hash": "0d3815f0342a748a36e98903a55703c9",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 77,
"avg_line_length": 28.38888888888889,
"alnum_prop": 0.639269406392694,
"repo_name": "vikassatpute/tuition",
"id": "516c10d4a0ab0dbc8f678636f40e3685411df96a",
"size": "1533",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config.example.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5960"
},
{
"name": "HTML",
"bytes": "105611"
},
{
"name": "JavaScript",
"bytes": "364376"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.bigtop.itest</groupId>
<artifactId>bigtop-smokes</artifactId>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.apache.bigtop.itest</groupId>
<artifactId>giraph-smoke</artifactId>
<version>1.2.0-SNAPSHOT</version>
<name>giraphsmoke</name>
</project>
| {
"content_hash": "f594729a0c820e65f2f24ffcf2d1aaec",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 204,
"avg_line_length": 43.21212121212121,
"alnum_prop": 0.741234221598878,
"repo_name": "amitkabraiiit/bigtop",
"id": "efa7dd69990541bfec3eb70a39a56f479c2897ed",
"size": "1426",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "bigtop-tests/test-artifacts/giraph/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "4822"
},
{
"name": "Groff",
"bytes": "49292"
},
{
"name": "Groovy",
"bytes": "575903"
},
{
"name": "Java",
"bytes": "650838"
},
{
"name": "Makefile",
"bytes": "58207"
},
{
"name": "PigLatin",
"bytes": "15615"
},
{
"name": "Puppet",
"bytes": "144195"
},
{
"name": "Ruby",
"bytes": "26373"
},
{
"name": "Scala",
"bytes": "85334"
},
{
"name": "Shell",
"bytes": "569285"
},
{
"name": "XSLT",
"bytes": "1323"
}
],
"symlink_target": ""
} |
/**
* When applied to an array, this constraint allows you to apply a collection of constraints to each element of the array.
*
* @author Alexey Bob <[email protected]>
*/
'use strict';
//import Validator from './AbstractValidator';
var Validator = require('./AbstractValidator');
//import ObjectExecutionContext from '../../Context/ObjectExecutionContext';
//import SchemaExecutionContext from '../../Context/SchemaExecutionContext';
var ObjectExecutionContext = require('../../Context/ObjectExecutionContext');
var SchemaExecutionContext = require('../../Context/SchemaExecutionContext');
class AllValidator extends Validator {
constructor() {
super(arguments);
var validators = arguments[0]['validators'];
var validationType = arguments[0]['validationType'];
var errorType = arguments[0]['errorType']
var environment = arguments[0]['environment']
this.configuring();
if(this.isEmpty(validators)){
throw new Error('Either option "validators" must be given');
}else if(Object.prototype.toString.call(validators) !== '[object Object]'){
throw new Error(`Expected argument of type \"Array Object\", \"${typeof validators}\" given`);
}
this.setParameter('validators', validators);
this.setParameter('validationType', validationType);
this.setParameter('errorType', errorType);
this.setParameter('environment', environment);
}
configuring() {
this.setDefaultParameters({
'validators': [],
'validationType': 'object', //[object, schema]
'errorType': 'array', // [array, object]
'environment': 'prod' // [prod, dev]
});
}
validate(data, errorType) {
errorType = (errorType == null) ? 'array' : errorType;
this.setErrorType(errorType);
this.resetErrors();
if(this.isEmpty(data)){
return ;
}
if(Object.prototype.toString.call(data) !== '[object Object]'){
if(this.getParameter('environment') == 'dev') {
throw new Error(`Expected argument of type \"Array Object\", \"${typeof data}\" given`);
}else{
this.addError(`Expected argument of type \"Array Object\", \"${typeof data}\" given`);
return;
}
}
var _oec = null;
var _validationType = this.getParameter('validationType');
switch(_validationType){
case 'object':
_oec = new ObjectExecutionContext({data: data, validators: this.getParameter('validators')});
_oec.setEnvironment(this.getParameter('environment'));
_oec.validate(this.getParameter('errorType'));
if(_oec.isInvalid()) {
this.setErrors(_oec.getErrors());
}
break;
case 'schema':
_oec = new SchemaExecutionContext({data: data, schema: this.getParameter('validators')});
_oec.setEnvironment(this.getParameter('environment'));
_oec.validate(this.getParameter('errorType'));
if(_oec.isInvalid()) {
this.setErrors(_oec.getErrors());
}
break;
default:
if(this.getParameter('environment') == 'dev') {
throw new Error(`Unsupported type \"${_validationType}\"`);
}else{
this.addError(`Unsupported type \"${_validationType}\"`);
return;
}
break;
}
}
}
module.exports = AllValidator;
| {
"content_hash": "687ef97b85d97380a3b2ff78771b9051",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 122,
"avg_line_length": 35.55769230769231,
"alnum_prop": 0.5703082747431044,
"repo_name": "alexeybob/bob-validator",
"id": "7df339f626b1952fa7d9ddf169e30e481d243f97",
"size": "3698",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/Constraints/Classes/AllValidator.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "322201"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>equations: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.5.3 / equations - 1.2+8.9</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
equations
<small>
1.2+8.9
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-09-29 23:37:41 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-09-29 23:37:41 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-ocamlbuild base OCamlbuild binary and libraries distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.5.3 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.02.3 The OCaml compiler (virtual package)
ocaml-base-compiler 4.02.3 Official 4.02.3 release
ocaml-config 1 OCaml Switch Configuration
# opam file:
opam-version: "2.0"
authors: [ "Matthieu Sozeau <[email protected]>" "Cyprien Mangin <[email protected]>" ]
dev-repo: "git://github.com/mattam82/Coq-Equations.git"
maintainer: "[email protected]"
homepage: "https://mattam82.github.io/Coq-Equations"
bug-reports: "https://github.com/mattam82/Coq-Equations/issues"
license: "LGPL-2.1-only"
synopsis: "A function definition package for Coq"
description: """
Equations is a function definition plugin for Coq, that allows the
definition of functions by dependent pattern-matching and well-founded,
mutual or nested structural recursion and compiles them into core
terms. It automatically derives the clauses equations, the graph of the
function and its associated elimination principle.
"""
tags: [
"keyword:dependent pattern-matching"
"keyword:functional elimination"
"category:Miscellaneous/Coq Extensions"
"logpath:Equations"
]
build: [
["coq_makefile" "-f" "_CoqProject" "-o" "Makefile"]
[make "-j%{jobs}%"]
]
install: [
[make "install"]
]
depends: [
"coq" {>= "8.9~" & < "8.10~"}
]
url {
src:
"https://github.com/mattam82/Coq-Equations/archive/v1.2-8.9.tar.gz"
checksum: "md5=6a3a984f16825f959eaf0125652edd4f"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-equations.1.2+8.9 coq.8.5.3</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.5.3).
The following dependencies couldn't be met:
- coq-equations -> coq >= 8.9~ -> ocaml >= 4.05.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-equations.1.2+8.9</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "0cd1f3c64e58ab7e844f205bd1a031d3",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 159,
"avg_line_length": 41.29608938547486,
"alnum_prop": 0.5564123376623377,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "ae2a36221c47a90e47f8ee150fde8e5df81fbe04",
"size": "7417",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.02.3-2.0.6/released/8.5.3/equations/1.2+8.9.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
"""Utils for flow related tasks."""
import logging
def GetUserInfo(client, user):
"""Get a User protobuf for a specific user.
Args:
client: A VFSGRRClient object.
user: Username as string. May contain domain like DOMAIN\\user.
Returns:
A User rdfvalue or None
"""
if "\\" in user:
domain, user = user.split("\\", 1)
users = [u for u in client.Get(client.Schema.USER, []) if u.username == user
and u.domain == domain]
else:
users = [u for u in client.Get(client.Schema.USER, [])
if u.username == user]
if not users:
return
else:
return users[0]
# TODO(user): Deprecate this function once Browser History is Artifacted.
def InterpolatePath(path, client, users=None, path_args=None, depth=0):
"""Take a string as a path on a client and interpolate with client data.
Args:
path: A single string/unicode to be interpolated.
client: A VFSGRRClient object.
users: A list of string usernames, or None.
path_args: A dict of additional args to use in interpolation. These take
precedence over any system provided variables.
depth: A counter for recursion depth.
Returns:
A single string if users is None, otherwise a list of strings.
"""
sys_formatters = {
# TODO(user): Collect this during discovery from the registry.
# HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\
# Value: SystemRoot
"systemroot": "c:\\Windows"
}
# Override any system formatters with path_args.
if path_args:
sys_formatters.update(path_args)
if users:
results = []
for user in users:
# Extract and interpolate user specific formatters.
user = GetUserInfo(client, user)
if user:
formatters = dict((x.name, y) for x, y in user.ListFields())
special_folders = dict(
(x.name, y) for x, y in user.special_folders.ListFields())
formatters.update(special_folders)
formatters.update(sys_formatters)
try:
results.append(path.format(**formatters))
except KeyError:
pass # We may be missing values for some users.
return results
else:
try:
path = path.format(**sys_formatters)
except KeyError:
logging.warn("Failed path interpolation on %s", path)
return ""
if "{" in path and depth < 10:
path = InterpolatePath(path, client=client, users=users,
path_args=path_args, depth=depth+1)
return path
| {
"content_hash": "4bcf21c929d5700afb5964a707535621",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 80,
"avg_line_length": 30.682926829268293,
"alnum_prop": 0.6434817170111288,
"repo_name": "spnow/grr",
"id": "3be2d2f394af038abe284dec7e466c0d15003b2f",
"size": "2538",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/flow_utils.py",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
/*
Remove Query Strings From Static Resources
*/
function _remove_query_strings_1( $src ){
$rqs = explode( '?ver', $src );
return $rqs[0];
}
if ( is_admin() ) {
// Remove query strings from static resources disabled in admin
} else {
add_filter( 'script_loader_src', '_remove_query_strings_1', 15, 1 );
add_filter( 'style_loader_src', '_remove_query_strings_1', 15, 1 );
}
function _remove_query_strings_2( $src ) {
$rqs = explode( '&ver', $src );
return $rqs[0];
}
if ( is_admin() ) {
// Remove query strings from static resources disabled in admin
} else {
add_filter( 'script_loader_src', '_remove_query_strings_2', 15, 1 );
add_filter( 'style_loader_src', '_remove_query_strings_2', 15, 1 );
}
| {
"content_hash": "cb4e0bb711a399c0de85baace6f62800",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 70,
"avg_line_length": 26.071428571428573,
"alnum_prop": 0.6356164383561644,
"repo_name": "bbozhev/it-ninja-theme-wordpress",
"id": "fe881b783b9e5af4c368b979d1d4badaa15db7f3",
"size": "730",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "functions/remove-query-string.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3380"
},
{
"name": "JavaScript",
"bytes": "1117"
},
{
"name": "PHP",
"bytes": "30683"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.metaeffekt.core</groupId>
<artifactId>ae-core-plugin-management-pom</artifactId>
<version>0.71.0</version>
<relativePath>../poms/ae-core-plugin-management-pom</relativePath>
</parent>
<artifactId>ae-modules</artifactId>
<packaging>pom</packaging>
<modules>
<module>ae-commons-annotation</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "55f05c09cdb230320162f9bb4df6938a",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 105,
"avg_line_length": 33.078947368421055,
"alnum_prop": 0.588703261734288,
"repo_name": "org-metaeffekt/metaeffekt-core",
"id": "818c030d6a293f4e4afd886abf637c27812f5cba",
"size": "1257",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "2111"
},
{
"name": "Java",
"bytes": "1068845"
},
{
"name": "Shell",
"bytes": "17556"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
namespace ZombieSmashers.map
{
public class MapScriptLine
{
public MapCommands Command;
public int IParam;
public Vector2 VParam;
public String[] SParam;
public MapScriptLine(String line)
{
if (line.Length < 1)
return;
SParam = line.Split(' ');
switch (SParam[0])
{
case "fog":
Command = MapCommands.Fog;
IParam = Convert.ToInt32(SParam[1]);
break;
case "water":
Command = MapCommands.Water;
IParam = Convert.ToInt32(SParam[1]);
break;
case "monster":
Command = MapCommands.Monster;
VParam = new Vector2(
Convert.ToSingle(SParam[2]),
Convert.ToSingle(SParam[3])
);
break;
case "makebucket":
Command = MapCommands.MakeBucket;
IParam = Convert.ToInt32(SParam[1]);
break;
case "addbucket":
Command = MapCommands.AddBucket;
VParam = new Vector2(Convert.ToSingle(SParam[2]),
Convert.ToSingle(SParam[3]));
break;
case "ifnotbucketgoto":
Command = MapCommands.IfNotBucketGoto;
break;
case "wait":
Command = MapCommands.Wait;
IParam = Convert.ToInt32(SParam[1]);
break;
case "setflag":
Command = MapCommands.SetFlag;
break;
case "iftruegoto":
Command = MapCommands.IfTrueGoto;
break;
case "iffalsegoto":
Command = MapCommands.IfFalseGoto;
break;
case "setglobalflag":
Command = MapCommands.SetGlobalFlag;
break;
case "ifglobaltruegoto":
Command = MapCommands.IfGlobalTrueGoto;
break;
case "ifglobalfalsegoto":
Command = MapCommands.IfGlobalFalseGoto;
break;
case "stop":
Command = MapCommands.Stop;
break;
case "tag":
Command = MapCommands.Tag;
break;
case "setleftexit":
Command = MapCommands.SetLeftExit;
break;
case "setleftentrance":
Command = MapCommands.SetLeftEntrance;
VParam = new Vector2(Convert.ToSingle(SParam[1]),
Convert.ToSingle(SParam[2]));
break;
case "setrightexit":
Command = MapCommands.SetRightExit;
break;
case "setrightentrance":
Command = MapCommands.SetRightEntrance;
VParam = new Vector2(Convert.ToSingle(SParam[1]),
Convert.ToSingle(SParam[2]));
break;
case "setintroentrance":
Command = MapCommands.SetIntroEntrance;
VParam = new Vector2(Convert.ToSingle(SParam[1]),
Convert.ToSingle(SParam[2]));
break;
}
}
}
}
| {
"content_hash": "690eb275b0cdfbaf8bf0131dce36a526",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 69,
"avg_line_length": 35.73148148148148,
"alnum_prop": 0.42472143042238925,
"repo_name": "o3a/ZombieSmashersXNA4",
"id": "bffd433c16d1468570a9dc63760deb1c36432e31",
"size": "3859",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "GameZS/GameZS/GameZS/MapClasses/script/MapScriptLine.cs",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "390100"
}
],
"symlink_target": ""
} |
from flask.ext.testing import TestCase
from flask.ext.fillin import FormWrapper
from . import UserSessionTestCase
from dexter.models import Document, db
from tests.fixtures import dbfixture, DocumentData, UserData
class TestEditArticleAnalysis(UserSessionTestCase):
def setUp(self):
super(TestEditArticleAnalysis, self).setUp()
self.fx = dbfixture.data(DocumentData, UserData)
self.fx.setup()
self.login()
def test_edit_article_analysis(self):
res = self.client.get('/articles/%s/analysis' % self.fx.DocumentData.simple.id)
self.assert200(res)
# check that no issues have been selected yet
doc = Document.query.get(self.fx.DocumentData.simple.id)
self.assertEqual(0, len(doc.issues))
f = res.forms[1]
# select an issue
f.fields['issues'] = ['2', ]
res = f.submit(self.client)
self.assertRedirects(res, '/articles/%s/analysis' % self.fx.DocumentData.simple.id)
# check that an issue has been selected
doc = Document.query.get(self.fx.DocumentData.simple.id)
self.assertEqual(1, len(doc.issues))
| {
"content_hash": "3ee887d5c0b021c24d330704a6b0d282",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 91,
"avg_line_length": 31.97222222222222,
"alnum_prop": 0.6741963509991312,
"repo_name": "Code4SA/mma-dexter",
"id": "d6e2f40ca472f5cbd105d0b34f3255fdc57da968",
"size": "1151",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/functional/test_edit_article_analysis.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "74553"
},
{
"name": "HTML",
"bytes": "4956"
},
{
"name": "Haml",
"bytes": "109002"
},
{
"name": "JavaScript",
"bytes": "134851"
},
{
"name": "Mako",
"bytes": "412"
},
{
"name": "Procfile",
"bytes": "192"
},
{
"name": "Python",
"bytes": "1949697"
},
{
"name": "SCSS",
"bytes": "12471"
}
],
"symlink_target": ""
} |
require 'simplecov' and SimpleCov.start do
add_filter "spec/"
add_filter "lib/mojito/utils/rspec.rb"
end
require 'mojito'
require 'mojito/utils/rspec'
describe Mojito::Controllers::Runtime::Methods do
subject do
Mojito::C.runtime_controller Mojito::R::Content, Mojito::Controllers::Runtime::Methods do
on GET() do write 'get' ; halt! end
on POST() do write 'post' ; halt! end
on HEAD() do write 'head' ; halt! end
on PUT() do write 'put' ; halt! end
on DELETE() do write 'delete' ; halt! end
on METHOD(:options) do write 'options' ; halt! end
end.mock_request
end
it { subject.get('/').body.should == 'get' }
it { subject.post('/').body.should == 'post' }
it { subject.head('/').body.should == 'head' }
it { subject.put('/').body.should == 'put' }
it { subject.delete('/').body.should == 'delete' }
it { subject.request('OPTIONS', '/').body.should == 'options' }
end
| {
"content_hash": "fce16aa905e8898a7cd9c329a5022861",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 91,
"avg_line_length": 32.357142857142854,
"alnum_prop": 0.6501103752759382,
"repo_name": "mtrense/mojito",
"id": "664d60bd24fe20a14851ba8d12e09d65e4256898",
"size": "924",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/mojito/controllers/runtime/methods_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "41144"
}
],
"symlink_target": ""
} |
/*
* Licensed under MIT (https://github.com/ligoj/ligoj/blob/master/LICENSE)
*/
package org.ligoj.bootstrap.core.resource.handler;
import org.apache.cxf.message.Message;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
/**
* Test class of {@link CaseInsensitiveEnumInterceptor}
*/
class CaseInsensitiveEnumInterceptorTest {
@Test
void handleMessage() {
var message = Mockito.mock(Message.class);
new CaseInsensitiveEnumInterceptor().handleMessage(message);
Mockito.verify(message).put("enum.conversion.case.sensitive", Boolean.TRUE);
}
}
| {
"content_hash": "eeada5716d6588f48b0b9732492ff6fa",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 78,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.7578397212543554,
"repo_name": "ligoj/bootstrap",
"id": "eb21a86a3eb173090d7b1b9af5082ac6942af343",
"size": "574",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bootstrap-business/src/test/java/org/ligoj/bootstrap/core/resource/handler/CaseInsensitiveEnumInterceptorTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "524"
},
{
"name": "Java",
"bytes": "1141933"
},
{
"name": "Shell",
"bytes": "5852"
}
],
"symlink_target": ""
} |
<?php
namespace Etsy;
class Listing extends EtsyBase {
function findAllShopListingsActive($params) {
if(!isset($params['shop_id'])) {
die();
}
$resource_uri = '/shops/' . $params['shop_id'] . '/listings/active';
//Not needed in the Query String
unset($params['shop_id']);
$params = http_build_query($params);
$response = $this->get($resource_uri, $params);
return $response;
}
} | {
"content_hash": "44ad2eb5d116aa4383858e64d5e764dc",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 70,
"avg_line_length": 16.36,
"alnum_prop": 0.6356968215158925,
"repo_name": "phikai/etsy-php-wrapper",
"id": "fb83abadb044ebe8472f565845c46159eeadb198",
"size": "409",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Etsy/Listing.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "1801"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 柱状图颜色属性 -->
<integer-array name="histogram_color" >
<item>@android:color/darker_gray</item>
<item>@android:color/holo_red_dark</item>
<item>@android:color/holo_green_dark</item>
<item>@android:color/holo_orange_dark</item>
<item>@color/histogram_test</item>
<item>@android:color/holo_blue_dark</item>
<item>@color/colorAccent</item>
</integer-array>
<!-- 饼状图颜色属性 -->
<integer-array name="pie_colors" >
<item>@color/colorPrimary</item>
<item>@android:color/darker_gray</item>
<item>@android:color/holo_red_dark</item>
<item>@android:color/holo_green_dark</item>
<item>@android:color/holo_orange_dark</item>
<item>@android:color/holo_green_light</item>
<item>@android:color/holo_blue_dark</item>
<item>@color/colorAccent</item>
<item>@android:color/black</item>
</integer-array>
</resources> | {
"content_hash": "d40e04712d70380137808a36fcd5faf8",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 52,
"avg_line_length": 39.88,
"alnum_prop": 0.6148445336008024,
"repo_name": "z4321548/zqxchart",
"id": "5b63420bcc3f03a9880060ce8a2a7509105e6b77",
"size": "1025",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/values/arrays.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "63501"
}
],
"symlink_target": ""
} |
with customer_total_return as
(select wr_returning_customer_sk as ctr_customer_sk
,ca_state as ctr_state,
sum(wr_return_amt) as ctr_total_return
from web_returns
,date_dim
,customer_address
where wr_returned_date_sk = d_date_sk
and d_year =2002
and wr_returning_addr_sk = ca_address_sk
group by wr_returning_customer_sk
,ca_state)
select c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag
,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address
,c_last_review_date,ctr_total_return
from customer_total_return ctr1
,customer_address
,customer
where ctr1.ctr_total_return > (select avg(ctr_total_return)*1.2
from customer_total_return ctr2
where ctr1.ctr_state = ctr2.ctr_state)
and ca_address_sk = c_current_addr_sk
and ca_state = 'IL'
and ctr1.ctr_customer_sk = c_customer_sk
order by c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag
,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address
,c_last_review_date,ctr_total_return
limit 100;
-- end query 1 in stream 0 using template query30.tpl
| {
"content_hash": "11ece13b4c580ab05415a1bfbaa55f32",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 97,
"avg_line_length": 41.53333333333333,
"alnum_prop": 0.6765650080256822,
"repo_name": "zdata-inc/oss-greenplum-tpcds",
"id": "1057157ed5de730d8cb2cafb8dced1f564bf48a9",
"size": "1302",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "07_multi_user/e9/4/118.query.30.sql",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1039427"
},
{
"name": "C++",
"bytes": "3759"
},
{
"name": "HTML",
"bytes": "44224"
},
{
"name": "Lex",
"bytes": "6742"
},
{
"name": "Makefile",
"bytes": "36575"
},
{
"name": "Objective-C",
"bytes": "4019"
},
{
"name": "PLSQL",
"bytes": "5951"
},
{
"name": "SQLPL",
"bytes": "7217"
},
{
"name": "Shell",
"bytes": "73912"
},
{
"name": "Smarty",
"bytes": "421691"
},
{
"name": "Yacc",
"bytes": "14186"
}
],
"symlink_target": ""
} |
package org.orienteer.architect.event;
import org.apache.http.util.Args;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import java.io.Serializable;
/**
* Abstract event for modal window
*/
public abstract class AbstractModalWindowEvent implements Serializable {
protected final AjaxRequestTarget target;
public AbstractModalWindowEvent(AjaxRequestTarget target) {
Args.notNull(target, "target");
this.target = target;
}
public abstract void execute(ModalWindow modalWindow);
}
| {
"content_hash": "6eea6b98de217124584aa3c0c828b342",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 72,
"avg_line_length": 26.90909090909091,
"alnum_prop": 0.768581081081081,
"repo_name": "WeaxMe/Orienteer",
"id": "2859fc8f48905828f478b25563bc8211e00cfd0b",
"size": "592",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "orienteer-architect/src/main/java/org/orienteer/architect/event/AbstractModalWindowEvent.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "11931"
},
{
"name": "Dockerfile",
"bytes": "1136"
},
{
"name": "HTML",
"bytes": "53524"
},
{
"name": "Java",
"bytes": "2233417"
},
{
"name": "JavaScript",
"bytes": "216403"
}
],
"symlink_target": ""
} |
<!-- Category Layout Start -->
<!DOCTYPE html>
<html lang="en">
<!-- HEAD Start -->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Blog of Dhruv Shah, blogging mainly about my experiences with tech, engineering and life. Opinions expressed are mine.">
<meta name="author" content="Dhruv Shah">
<meta name="keywords" content="dhruv, shah, technology, github, blog, engineering, research, projects">
<link rel="canonical" href="/~dhruv.shah/old/categories/tech.html">
<title> { Dhruv Shah } | tech</title>
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<!-- Bootstrap Core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Custom CSS -->
<link href="/~dhruv.shah/old/css/grayscale.css" rel="stylesheet">
<!-- Custom Fonts -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link href="//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
<link href="//fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/~dhruv.shah/old/css/rrssb.css" />
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link rel="shortcut icon" type="image/x-icon" href="/~dhruv.shah/old/img/infinity.ico">
<!-- iOS Web App mode -->
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon" sizes="36x36" href="/~dhruv.shah/old/img/web-app/icon-36p.png">
<link rel="apple-touch-icon" sizes="48x48" href="/~dhruv.shah/old/img/web-app/icon-48p.png">
<link rel="apple-touch-icon" sizes="72x72" href="/~dhruv.shah/old/img/web-app/icon-72p.png">
<link rel="apple-touch-icon" sizes="96x96" href="/~dhruv.shah/old/img/web-app/icon-96p.png">
<link rel="apple-touch-icon" sizes="144x144" href="/~dhruv.shah/old/img/web-app/icon-144p.png">
<link rel="apple-touch-icon" sizes="192x192" href="/~dhruv.shah/old/img/web-app/icon-192p.png">
<!-- Android Web App mode -->
<link rel="manifest" href="/~dhruv.shah/old/manifest.json">
<!-- Chrome, Firefox OS and Opera -->
<meta name="theme-color" content="#000000">
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#000000">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
</head>
<!-- HEAD End -->
<body>
<!-- Navigation Start -->
<nav class="navbar navbar-custom navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
<i class="fa fa-bars"></i>
</button>
<a class="navbar-brand" href="/~dhruv.shah/old/">
<div>
<img src="/~dhruv.shah/old/img/key.ico" alt="">
{ Dhruv Shah }
</div>
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right navbar-main-collapse">
<ul class="nav navbar-nav">
<!-- Blog, Post, Tag and Error pages -->
<li>
<a href="/~dhruv.shah/old/#about"> About </a>
</li>
<li>
<a href="/~dhruv.shah/old/blog/"> Blog </a>
</li>
<li>
<a href="/~dhruv.shah/old/#timeline"> Timeline </a>
</li>
<li>
<a href="/~dhruv.shah/old/#contact"> Contact </a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Navigation End -->
<section class="container content-section text-center">
<div class="row">
<div class="col-md-10 col-md-offset-1 col-xs-10 col-xs-offset-1">
<h3 id="#tech">Category: tech</h3>
<div>
</div>
</div>
</div>
</section>
<!-- Footer Start -->
<footer>
<!-- Social Buttons Start -->
<ul class="list-inline social-buttons">
<li><a href="https://github.com/PrieureDeSion" target="_blank"><i class="fa fa-github fa-fw"></i></a></li>
<li><a href="https://facebook.com/dhruv.ilesh" target="_blank"><i class="fa fa-facebook fa-fw"></i></a></li>
<li><a href="https://www.linkedin.com/in/dhruv-ilesh-shah/" target="_blank"><i class="fa fa-linkedin fa-fw"></i></a></li>
</ul>
<!-- Social Buttons End -->
<p><br><br><br><br></p>
<!-- Footer End -->
<!-- Javascript Start -->
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<!-- Plugin JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<!-- Custom Theme JavaScript -->
<!--* Start Bootstrap - Grayscale Bootstrap Theme (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.-->
<script>
function toggleNavCollapse(){50<$(".navbar").offset().top?$(".navbar-fixed-top").addClass("top-nav-collapse"):$(".navbar-fixed-top").removeClass("top-nav-collapse");}
$(document).ready(toggleNavCollapse);
$(window).scroll(toggleNavCollapse);$(function(){$("a.page-scroll").bind("click",function(b){var a=$(this);$("html, body").stop().animate({scrollTop:$(a.attr("href")).offset().top-50},1500,"easeInOutExpo",function(){a.blur()});b.preventDefault()})});$(".navbar-collapse ul li a").click(function(){$(".navbar-toggle:visible").click()});
</script>
<script>
function addTohistory() {
if (!window.location.host.startsWith("127.0.0.1")) {
history.pushState({}, 'tech', 'http://home.iitb.ac.in/~dhruv.shah/old/categories/tech.html');
}
}
</script>
<!-- Javascript End -->
</body>
</html>
<!-- Category Layout End -->
| {
"content_hash": "3e32b6afdd2fb0c8e2a1e29256081bd2",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 335,
"avg_line_length": 26.269662921348313,
"alnum_prop": 0.5808383233532934,
"repo_name": "PrieureDeSion/PrieureDeSion.github.io",
"id": "49b556f6d8885f1e19b5817e5f03dedb87caa47c",
"size": "7015",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "old/categories/tech.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "11092"
},
{
"name": "HTML",
"bytes": "637472"
},
{
"name": "JavaScript",
"bytes": "2898"
},
{
"name": "Jupyter Notebook",
"bytes": "1566"
},
{
"name": "Ruby",
"bytes": "13317"
},
{
"name": "Shell",
"bytes": "214"
}
],
"symlink_target": ""
} |
import sys
import os
import io
from jinja2 import Environment, FileSystemLoader, FunctionLoader
import urllib
import base64
import copy
import gc
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import seaborn as sns
import scipy.stats as stats
# pip install https://github.com/Geosyntec/python-pdfkit/archive/master.zip
import pdfkit
from ..utils import (html_template, css_template)
import wqio
sns.set(style='ticks', context='paper')
mpl.rcParams['text.usetex'] = False
mpl.rcParams['lines.markeredgewidth'] = .5
mpl.rcParams['font.family'] = ['sans-serif']
mpl.rcParams['mathtext.default'] = 'regular'
def make_table(loc):
# make table
singlevarfmtr = '{0:.3f}'
doublevarfmtr = '{0:.3f}; {1:.3f}'
multilinefmtr = '{0:.3f}\n({1:.3f}; {2:.3f})'
if loc.logmean is None:
logmean = np.nan
else:
logmean = loc.logmean
if loc.geomean is None:
geomean = np.nan
else:
geomean = loc.geomean
if loc.logstd is None:
logstd = np.nan
else:
logstd = loc.logstd
if loc.logmean_conf_interval is None:
logmean_conf_interval = [np.nan, np.nan]
else:
logmean_conf_interval = loc.logmean_conf_interval
if loc.geomean_conf_interval is None:
geomean_conf_interval = [np.nan, np.nan]
else:
geomean_conf_interval = loc.geomean_conf_interval
rows = [
['Count', singlevarfmtr.format(loc.N)],
['Number of NDs', singlevarfmtr.format(loc.ND)],
['Min; Max ({})'.format(loc.definition['unit']),
doublevarfmtr.format(loc.min,loc.max)],
['Mean ({})\n(95% confidence interval)'.format(loc.definition['unit']),
multilinefmtr.format(
loc.mean, *loc.mean_conf_interval)],
['Standard Deviation ({})'.format(loc.definition['unit']),
singlevarfmtr.format(loc.std)],
['Log. Mean\n(95% confidence interval)', multilinefmtr.format(
logmean, *logmean_conf_interval).replace('nan', '-')],
['Log. Standard Deviation', singlevarfmtr.format(logstd).replace('nan', '-')],
['Geo. Mean ({})\n(95% confidence interval)'.format(loc.definition['unit']),
multilinefmtr.format(
geomean, *geomean_conf_interval).replace('nan', '-')],
['Coeff. of Variation', singlevarfmtr.format(loc.cov)],
['Skewness', singlevarfmtr.format(loc.skew)],
['Median ({})\n(95% confidence interval)'.format(loc.definition['unit']),
multilinefmtr.format(
loc.median, *loc.median_conf_interval)],
['Quartiles ({})'.format(loc.definition['unit']),
doublevarfmtr.format(loc.pctl25, loc.pctl75)],
]
return pd.DataFrame(rows, columns=['Statistic', 'Result'])
def make_report(loc, savename, analyte=None, geolocation=None, statplot_options={}):
""" Produces a statistical report for the specified analyte.
Parameters
----------
loc : wqio.Location
The Location object to be summarized.
savename : str
Filename/path of the output pdf
analyte : str, optional
Optional name for the analyte in the ``loc``'s data.
statplot_options : dict, optional
Dictionary of keyward arguments to be passed to
wqio.Location.statplot
Returns
-------
None
See also
--------
wqio.Location
wqio.Location.statplot
"""
if loc.full_data.shape[0] >= 3:
if analyte is None:
analyte = loc.definition.get("analyte", "unknown")
if geolocation is None:
geolocation = loc.definition.get("geolocation", "unknown")
unit = loc.definition['unit']
thershold = loc.definition['thershold']
if 'ylabel' not in statplot_options:
statplot_options['ylabel'] = analyte + ' ' + '(' + unit + ')'
if 'xlabel' not in statplot_options:
statplot_options['xlabel'] = 'Monitoring Location' #used to be geolocation
# make the table
table = make_table(loc)
table_html = table.to_html(index=False, justify='left').replace('\\n', '\n')
# wqio figure - !can move args to main func later!
fig = loc.statplot(**statplot_options)
ax1, ax2 = fig.get_axes()
ax1xlim = ax1.get_xlim()
ax2xlim = ax2.get_xlim()
if loc.dataframe[loc.dataframe[loc.cencol]].shape[0] > 0:
# print(loc.dataframe.head())
qntls, ranked = stats.probplot(loc.data, fit=False)
xvalues = stats.norm.cdf(qntls) * 100
figdata = loc.dataframe.sort(columns='modeled')
figdata['xvalues'] = xvalues
figdata = figdata[figdata[loc.cencol]]
ax2.plot(figdata.xvalues, figdata['modeled'], linestyle='', marker='s',
color='tomato', label='Extrapolated values')
ax2.plot(ax2xlim, [thershold]*2, color=sns.color_palette()[-1], label='Threshold')
handles, labels = ax2.get_legend_handles_labels()
labels[0] = 'Data'
ax2.legend(handles, labels, loc='best')
ax2.set_xlabel('Percent less than value')
ax1.set_xlim(ax1xlim)
ax2.set_xlim(ax2xlim)
ax2ylim = ax2.get_ylim()
ax1.set_ylim(ax2ylim)
fig.tight_layout()
# force figure to a byte object in memory then encode
boxplot_img = io.BytesIO()
fig.savefig(boxplot_img, format="png", dpi=300)
boxplot_img.seek(0)
boxplot_uri = ('data:image/png;base64,'
+ urllib.parse.quote(base64.b64encode(boxplot_img.read())))
# box plot legend
figl, axl = plt.subplots(1,1, figsize=(7,10))
img = mpimg.imread('box.png')
axl.imshow(img)
axl.xaxis.set_visible(False)
axl.yaxis.set_visible(False)
sns.despine(ax=axl, top=True, right=True, left=True, bottom=True)
legend_img = io.BytesIO()
figl.savefig(legend_img, format="png", dpi=300, bbox_inches='tight')
legend_img.seek(0)
legend_uri = ('data:image/png;base64,'
+ urllib.parse.quote(base64.b64encode(legend_img.read())))
# html magic
env = Environment(loader=FileSystemLoader(r'.\utils'))
template = env.from_string(html_template.getvalue())
# create pdf report
template_vars = {'analyte' : analyte,
'location': geolocation,
'analyte_table': table_html,
'legend': legend_uri,
'boxplot': boxplot_uri}
html_out = template.render(template_vars)
csst = copy.copy(css_template)
try:
print('Creating report {}'.format(savename))
pdf = pdfkit.from_string(html_out, savename, css=csst)
except OSError as e:
raise OSError('The tool cannot write to the destination path. '
'Please check that the destination pdf is not open.\n'
'Trace back:\n{}'.format(e))
plt.close(fig)
del boxplot_img
del figl
else:
print('{} does not have greater than 3 data points, skipping...'.format(savename))
print('\n')
gc.collect()
class PdfReport(object):
""" Class to generate generic 1-page reports from wqio objects.
Parameters
----------
path : str
Filepath to the CSV file containing input data.
analytecol : str (default = 'analyte')
Column in the input file that contains the analyte name.
rescol : str (default='res')
Column in the input file that contains the result values.
qualcol : str (default='qual')
Column in the input file that contains the data qualifiers
labeling data as right-censored (non-detect) or not.
ndvals : list of strings
List of values found in ``qualcol`` that flag data as being
right-censored (non-detect). Any value in ``qualcol`` that is
*not* in this list will be assumed to denote an uncensored
(detected value).
bsIter : int (default = 10000)
Number of iterations used to refined statistics via a bias-
corrected and accelerated (BCA) bootstrapping method.
useROS : bool (default is True)
Toggles the use of regression-on-order statistics to estimate
censored (non-detect) values when computing summary statistics.
Examples
--------
>>> import wqreports
>>> report = wqreports.PdfReport("~/data/arsenic.csv", ndvals=['U', 'UJ', '<'])
>>> report.make_report(...)
"""
def __init__(self, path, analytecol='analyte', rescol='res',
qualcol='qual', unitcol='unit', locationcol='location',
thersholdcol='threshold', ndvals=['U'], bsIter=5000,
useROS=False):
self.filepath = path
self.ndvals = ndvals
self.final_ndval = 'ND'
self.bsIter = bsIter
self.useROS = useROS
self.analytecol = analytecol
self.unitcol = unitcol
self.locationcol = locationcol
self.thersholdcol = thersholdcol
self.rescol = rescol
self.qualcol = qualcol
self._rawdata = None
self._cleandata = None
self._analytes = None
self._geolocations = None
self._thresholds = None
self._locations = None
@property
def rawdata(self):
""" Raw data as parsed by pandas.read_csv(self.filepath)
"""
if self._rawdata is None:
self._rawdata = pd.read_csv(
self.filepath,
dtype={
self.analytecol: str,
self.unitcol: str,
self.locationcol: str,
self.thersholdcol: np.float64,
self.rescol: np.float64,
self.qualcol: str,
})
return self._rawdata
@property
def cleandata(self):
""" Cleaned data with simpler qualifiers.
"""
if self._cleandata is None:
self._cleandata = (
self.rawdata
.replace({self.qualcol:{_: self.final_ndval for _ in self.ndvals}})
)
return self._cleandata
@property
def analytes(self):
""" Simple list of the analytes to be analyzed.
"""
if self._analytes is None:
self._analytes = self.cleandata[self.analytecol].unique().tolist()
self._analytes.sort()
return self._analytes
@property
def geolocations(self):
"""Simple list of the physical locations in the dataset.
"""
if self._geolocations is None:
self._geolocations = self.cleandata[self.locationcol].unique().tolist()
self._geolocations.sort()
return self._geolocations
@property
def thresholds(self):
"""Simple dictionary of thresholds per each analyte.
"""
if self._thresholds is None:
thresholds = (self.cleandata.loc[:,[self.analytecol, self.thersholdcol]]
.drop_duplicates())
tshape = thresholds.shape[0]
thresholds = thresholds.set_index(self.analytecol).loc[:,self.thersholdcol]
thresholds = thresholds.to_dict()
if tshape != len(thresholds):
e = ('An analyte has mroe than one thershold value, please'
' check the input data')
raise ValueError(e)
self._thresholds = thresholds
return self._thresholds
@property
def locations(self):
""" Simple list of wqio.Location objects for each analyte.
"""
if self._locations is None:
self._locations = {}
gb = self.cleandata.groupby([self.locationcol, self.analytecol])
for gl, a in gb.groups.keys():
loc = self._make_location(gl, a)
loc.definition.update({"analyte": a, "geolocation": gl})
self._locations[(gl, a)] = loc
return self._locations
def _make_location(self, location, analyte):
""" Make a wqio.Location from an analyte.
Parameters
----------
analyte : string
The pollutant to be included in the Location.
Returns
-------
loc : wqio.Location
A wqio.Location object for the provided analyte.
"""
if analyte not in self.analytes:
raise ValueError("{} is not in the dataset".format(analyte))
if location not in self.geolocations:
raise ValueError("{} is not in the dataset".format(location))
# get target analyte
querystring = "{} == @location and {} == @analyte".format(self.locationcol, self.analytecol)
data = self.cleandata.query(querystring)
if data[self.unitcol].unique().shape[0] > 1:
e = 'More than one unit detected for {}-{}. Please check the input file'
raise ValueError(e)
loc = wqio.features.Location(data, bsIter=self.bsIter, ndval=self.final_ndval,
rescol=self.rescol, qualcol=self.qualcol,
useROS=self.useROS, include=True)
loc.definition = {
'unit': data[self.unitcol].iloc[0],
'thershold': self.thresholds[analyte]
}
return loc
def export_pdfs(self, output_path, basename=None, **statplot_options):
""" Export 1-pg summary PDF for each analyte in the data.
Parameters
----------
output_path : string
Folder path in which all PDFs will be saved
basename : string, optional
Prefix for the filename of each PDF. If omitted, the
filename will simply the be analyte.
statplot_options : optional keyword arguments
Options passed directly to wqio.Location.statplot
"""
if basename is None:
basename = ""
for (geolocation, analyte), loc in self.locations.items():
san_geolocation = wqio.utils.processFilename(geolocation)
san_analyte = wqio.utils.processFilename(analyte)
filename = os.path.join(output_path, '{}{}{}.pdf'.format(
basename, san_geolocation, san_analyte))
# need to make a copy so that the dict does not get changed in
# the low functions
spo = copy.copy(statplot_options)
make_report(loc, filename, analyte=analyte, geolocation=geolocation,
statplot_options=spo)
| {
"content_hash": "bc9b34404d042c91a004496aa293e169",
"timestamp": "",
"source": "github",
"line_count": 417,
"max_line_length": 100,
"avg_line_length": 35.249400479616305,
"alnum_prop": 0.5841894006394993,
"repo_name": "lucashtnguyen/wqreports",
"id": "9c86912c527a9860dd5546b9c566dcc4e0a677f5",
"size": "14699",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "wqreports/core/pdfreport.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "38"
},
{
"name": "CSS",
"bytes": "3705"
},
{
"name": "HTML",
"bytes": "225"
},
{
"name": "Python",
"bytes": "33295"
}
],
"symlink_target": ""
} |
FROM balenalib/jetson-tx1-ubuntu:focal-build
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
\
# .NET Core dependencies
libc6 \
libgcc1 \
libgssapi-krb5-2 \
libicu66 \
libssl1.1 \
libstdc++6 \
zlib1g \
&& rm -rf /var/lib/apt/lists/*
ENV \
# Configure web servers to bind to port 80 when present
ASPNETCORE_URLS=http://+:80 \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true
# Install .NET Core
ENV DOTNET_VERSION 5.0.12
RUN curl -SL --output dotnet.tar.gz "https://dotnetcli.blob.core.windows.net/dotnet/Runtime/$DOTNET_VERSION/dotnet-runtime-$DOTNET_VERSION-linux-arm64.tar.gz" \
&& dotnet_sha512='a8089fad8d21a4b582aa6c3d7162d56a21fee697fd400f050a772f67c2ace5e4196d1c4261d3e861d6dc2e5439666f112c406104d6271e5ab60cda80ef2ffc64' \
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
ENV ASPNETCORE_VERSION 5.0.12
RUN curl -SL --output aspnetcore.tar.gz "https://dotnetcli.blob.core.windows.net/dotnet/aspnetcore/Runtime/$ASPNETCORE_VERSION/aspnetcore-runtime-$ASPNETCORE_VERSION-linux-arm64.tar.gz" \
&& aspnetcore_sha512='70570177896943613f0cddeb046ffccaafb1c8245c146383e45fbcfb27779c70dff1ab22c2b13a14bf096173c9279e0a386f61665106a3abb5f623b50281a652' \
&& echo "$aspnetcore_sha512 aspnetcore.tar.gz" | sha512sum -c - \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf aspnetcore.tar.gz -C /usr/share/dotnet ./shared/Microsoft.AspNetCore.App \
&& rm aspnetcore.tar.gz
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/44e597e40f2010cdde15b3ba1e397aea3a5c5271/scripts/assets/tests/[email protected]" \
&& echo "Running test-stack@dotnet" \
&& chmod +x [email protected] \
&& bash [email protected] \
&& rm -rf [email protected]
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Ubuntu focal \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \ndotnet 5.0-aspnet \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | {
"content_hash": "6dd774d4136367acd5088bf4620c0a09",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 680,
"avg_line_length": 56.142857142857146,
"alnum_prop": 0.7146946564885496,
"repo_name": "resin-io-library/base-images",
"id": "7be5dddc3715a37e6dab64aacf25853f4f2c32d2",
"size": "3165",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "balena-base-images/dotnet/jetson-tx1/ubuntu/focal/5.0-aspnet/build/Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "71234697"
},
{
"name": "JavaScript",
"bytes": "13096"
},
{
"name": "Shell",
"bytes": "12051936"
},
{
"name": "Smarty",
"bytes": "59789"
}
],
"symlink_target": ""
} |
import { Ng2cliPage } from './app.po';
describe('ng2cli App', () => {
let page: Ng2cliPage;
beforeEach(() => {
page = new Ng2cliPage();
});
it('should display message saying app works', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('app works!');
});
});
| {
"content_hash": "42545dc4dcaee078812f9b0907f95d25",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 58,
"avg_line_length": 21.5,
"alnum_prop": 0.5880398671096345,
"repo_name": "yurlovm/asp.net_4.6_angular_webpack",
"id": "23aef3fc84b0e64e009e3beb0c3875d98e6df65c",
"size": "301",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "WebApiAngular/e2e/app.e2e-spec.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "42009"
},
{
"name": "CSS",
"bytes": "3300"
},
{
"name": "HTML",
"bytes": "1597"
},
{
"name": "JavaScript",
"bytes": "19311"
},
{
"name": "TypeScript",
"bytes": "44658"
}
],
"symlink_target": ""
} |
module Squall
# Handles IP assignments for virtual machines
class IpAddressJoin < Base
# Public: List IP address assignments for a virtual machine.
#
# virtual_machine_id - Virtual machine ID to lookup
#
# Returns an Array.
def list(virtual_machine_id)
response = request(:get, "/virtual_machines/#{virtual_machine_id}/ip_addresses.json")
response.collect { |ip| ip['ip_address_join'] }
end
# Public: Assigns an IP address to a VM.
#
# virtual_machine_id - Virtual machine ID to assign IP to
# options - Params for IP assignment:
# :ip_address_id - ID of the IP address
# :network_interface_id - ID of the network interface
#
# Returns a Hash.
def assign(virtual_machine_id, options = {})
response = request(:post, "/virtual_machines/#{virtual_machine_id}/ip_addresses.json", default_params(options))
response['ip_address_join']
end
# Public: Deletes an IP address assignment from a VM
#
# virtual_machine_id - Virtual machine ID to remove IP join from
# ip_address_id - IP Address ID to remove, see `#assign`.
#
# Returns a Hash.
def delete(virtual_machine_id, ip_address_id)
request(:delete, "/virtual_machines/#{virtual_machine_id}/ip_addresses/#{ip_address_id}.json")
end
end
end
| {
"content_hash": "10ff7f4a00309d515597cb39b0e4740e",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 117,
"avg_line_length": 37.486486486486484,
"alnum_prop": 0.6308579668348955,
"repo_name": "webinabox/squall",
"id": "824f103d8bf794bdf6e15915111cefdf24b70912",
"size": "1387",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/squall/ip_address_join.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "101936"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../../style.css');
@import url('../../../../../tree.css');
</style>
<script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../../clover.js" type="text/javascript"></script>
<script src="../../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../../cloud.js" type="text/javascript"></script>
<title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title>
</head>
<body>
<div id="page">
<header id="header" role="banner">
<nav class="aui-header aui-dropdown2-trigger-group" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo aui-header-logo-clover">
<a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a>
</h1>
</div>
<div class="aui-header-secondary">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online documentation" target="_blank"
href="http://openclover.org/documentation">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="aui-page-panel-inner">
<div class="aui-page-panel-nav aui-page-panel-nav-clover">
<div class="aui-page-header-inner" style="margin-bottom: 20px;">
<div class="aui-page-header-image">
<a href="http://cardatechnologies.com" target="_top">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</a>
</div>
<div class="aui-page-header-main" >
<h1>
<a href="http://cardatechnologies.com" target="_top">
ABA Route Transit Number Validator 1.0.1-SNAPSHOT
</a>
</h1>
</div>
</div>
<nav class="aui-navgroup aui-navgroup-vertical">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading packages-nav-heading">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui package-filter-container">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="package-filter-no-results-message hidden">
<small>No results found.</small>
</p>
<div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator">
<div class="packages-tree-container"></div>
<div class="clover-packages-lozenges"></div>
</div>
</div>
</div>
</nav> </div>
<section class="aui-page-panel-content">
<div class="aui-page-panel-content-clover">
<div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li>
<li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li>
<li><a href="test-Test_AbaRouteValidator_13b.html">Class Test_AbaRouteValidator_13b</a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test testAbaNumberCheck_28611_good
</h1>
<table class="aui">
<thead>
<tr>
<th>Test</th>
<th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th>
<th><label title="When the test execution was started">Start time</label></th>
<th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th>
<th><label title="A failure or error message if the test is not successful.">Message</label></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_13b.html?line=33928#src-33928" >testAbaNumberCheck_28611_good</a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:42:52
</td>
<td>
0.0 </td>
<td>
<div></div>
<div class="errorMessage"></div>
</td>
</tr>
</tbody>
</table>
<div> </div>
<table class="aui aui-table-sortable">
<thead>
<tr>
<th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th>
<th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_28611_good</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=33913#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a>
</td>
<td>
<span class="sortValue">0.7352941</span>73.5%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td>
</tr>
</tbody>
</table>
</div> <!-- class="aui-page-panel-content-clover" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1
on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT.
</li>
</ul>
<ul>
<li>OpenClover is free and open-source software. </li>
</ul>
</section>
</footer> </section> <!-- class="aui-page-panel-content" -->
</div> <!-- class="aui-page-panel-inner" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html> | {
"content_hash": "52e4ac7c0267f4e6e0ae8712d0d62095",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 297,
"avg_line_length": 43.942583732057415,
"alnum_prop": 0.5099085365853658,
"repo_name": "dcarda/aba.route.validator",
"id": "b5248bc6fa01102dde541f70d146ab93cc2d99cc",
"size": "9184",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_13b_testAbaNumberCheck_28611_good_q61.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "18715254"
}
],
"symlink_target": ""
} |
package com.tomkasp.common.web.rest;
import com.tomkasp.FitappApp;
import com.tomkasp.common.domain.Authority;
import com.tomkasp.common.domain.User;
import com.tomkasp.common.repository.AuthorityRepository;
import com.tomkasp.common.repository.UserRepository;
import com.tomkasp.common.security.AuthoritiesConstants;
import com.tomkasp.common.service.MailService;
import com.tomkasp.common.service.UserService;
import com.tomkasp.common.service.dto.UserDTO;
import com.tomkasp.common.web.rest.vm.ManagedUserVM;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import javax.inject.Inject;
import javax.transaction.Transactional;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
/**
* Test class for the AccountResource REST controller.
*
* @see UserService
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = FitappApp.class)
public class AccountResourceIntTest {
@Inject
private UserRepository userRepository;
@Inject
private AuthorityRepository authorityRepository;
@Inject
private UserService userService;
@Mock
private UserService mockUserService;
@Mock
private MailService mockMailService;
private MockMvc restUserMockMvc;
private MockMvc restMvc;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
doNothing().when(mockMailService).sendActivationEmail((User) anyObject(), anyString());
AccountResource accountResource = new AccountResource();
ReflectionTestUtils.setField(accountResource, "userRepository", userRepository);
ReflectionTestUtils.setField(accountResource, "userService", userService);
ReflectionTestUtils.setField(accountResource, "mailService", mockMailService);
AccountResource accountUserMockResource = new AccountResource();
ReflectionTestUtils.setField(accountUserMockResource, "userRepository", userRepository);
ReflectionTestUtils.setField(accountUserMockResource, "userService", mockUserService);
ReflectionTestUtils.setField(accountUserMockResource, "mailService", mockMailService);
this.restMvc = MockMvcBuilders.standaloneSetup(accountResource).build();
this.restUserMockMvc = MockMvcBuilders.standaloneSetup(accountUserMockResource).build();
}
@Test
public void testNonAuthenticatedUser() throws Exception {
restUserMockMvc.perform(get("/api/authenticate")
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().string(""));
}
@Test
public void testAuthenticatedUser() throws Exception {
restUserMockMvc.perform(get("/api/authenticate")
.with(request -> {
request.setRemoteUser("test");
return request;
})
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().string("test"));
}
@Test
public void testGetExistingAccount() throws Exception {
Set<Authority> authorities = new HashSet<>();
Authority authority = new Authority();
authority.setName(AuthoritiesConstants.ADMIN);
authorities.add(authority);
User user = new User();
user.setLogin("test");
user.setFirstName("john");
user.setLastName("doe");
user.setEmail("[email protected]");
user.setAuthorities(authorities);
when(mockUserService.getUserWithAuthorities()).thenReturn(user);
restUserMockMvc.perform(get("/api/account")
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.login").value("test"))
.andExpect(jsonPath("$.firstName").value("john"))
.andExpect(jsonPath("$.lastName").value("doe"))
.andExpect(jsonPath("$.email").value("[email protected]"))
.andExpect(jsonPath("$.authorities").value(AuthoritiesConstants.ADMIN));
}
@Test
public void testGetUnknownAccount() throws Exception {
when(mockUserService.getUserWithAuthorities()).thenReturn(null);
restUserMockMvc.perform(get("/api/account")
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isInternalServerError());
}
@Test
@Transactional
public void testRegisterValid() throws Exception {
ManagedUserVM validUser = new ManagedUserVM(
null, // id
"joe", // login
"password", // password
"Joe", // firstName
"Shmoe", // lastName
"[email protected]", // e-mail
true, // activated
"en", // langKey
new HashSet<>(Arrays.asList(AuthoritiesConstants.USER)),
null, // createdBy
null, // createdDate
null, // lastModifiedBy
null // lastModifiedDate
);
restMvc.perform(
post("/api/register")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(validUser)))
.andExpect(status().isCreated());
Optional<User> user = userRepository.findOneByLogin("joe");
assertThat(user.isPresent()).isTrue();
}
@Test
@Transactional
public void testRegisterInvalidLogin() throws Exception {
ManagedUserVM invalidUser = new ManagedUserVM(
null, // id
"funky-log!n", // login <-- invalid
"password", // password
"Funky", // firstName
"One", // lastName
"[email protected]", // e-mail
true, // activated
"en", // langKey
new HashSet<>(Arrays.asList(AuthoritiesConstants.USER)),
null, // createdBy
null, // createdDate
null, // lastModifiedBy
null // lastModifiedDate
);
restUserMockMvc.perform(
post("/api/register")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(invalidUser)))
.andExpect(status().isBadRequest());
Optional<User> user = userRepository.findOneByEmail("[email protected]");
assertThat(user.isPresent()).isFalse();
}
@Test
@Transactional
public void testRegisterInvalidEmail() throws Exception {
ManagedUserVM invalidUser = new ManagedUserVM(
null, // id
"bob", // login
"password", // password
"Bob", // firstName
"Green", // lastName
"invalid", // e-mail <-- invalid
true, // activated
"en", // langKey
new HashSet<>(Arrays.asList(AuthoritiesConstants.USER)),
null, // createdBy
null, // createdDate
null, // lastModifiedBy
null // lastModifiedDate
);
restUserMockMvc.perform(
post("/api/register")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(invalidUser)))
.andExpect(status().isBadRequest());
Optional<User> user = userRepository.findOneByLogin("bob");
assertThat(user.isPresent()).isFalse();
}
@Test
@Transactional
public void testRegisterInvalidPassword() throws Exception {
ManagedUserVM invalidUser = new ManagedUserVM(
null, // id
"bob", // login
"123", // password with only 3 digits
"Bob", // firstName
"Green", // lastName
"[email protected]", // e-mail
true, // activated
"en", // langKey
new HashSet<>(Arrays.asList(AuthoritiesConstants.USER)),
null, // createdBy
null, // createdDate
null, // lastModifiedBy
null // lastModifiedDate
);
restUserMockMvc.perform(
post("/api/register")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(invalidUser)))
.andExpect(status().isBadRequest());
Optional<User> user = userRepository.findOneByLogin("bob");
assertThat(user.isPresent()).isFalse();
}
@Test
@Transactional
public void testRegisterDuplicateLogin() throws Exception {
// Good
ManagedUserVM validUser = new ManagedUserVM(
null, // id
"alice", // login
"password", // password
"Alice", // firstName
"Something", // lastName
"[email protected]", // e-mail
true, // activated
"en", // langKey
new HashSet<>(Arrays.asList(AuthoritiesConstants.USER)),
null, // createdBy
null, // createdDate
null, // lastModifiedBy
null // lastModifiedDate
);
// Duplicate login, different e-mail
ManagedUserVM duplicatedUser = new ManagedUserVM(validUser.getId(), validUser.getLogin(), validUser.getPassword(), validUser.getLogin(), validUser.getLastName(),
"[email protected]", true, validUser.getLangKey(), validUser.getAuthorities(), validUser.getCreatedBy(), validUser.getCreatedDate(), validUser.getLastModifiedBy(), validUser.getLastModifiedDate());
// Good user
restMvc.perform(
post("/api/register")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(validUser)))
.andExpect(status().isCreated());
// Duplicate login
restMvc.perform(
post("/api/register")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(duplicatedUser)))
.andExpect(status().is4xxClientError());
Optional<User> userDup = userRepository.findOneByEmail("[email protected]");
assertThat(userDup.isPresent()).isFalse();
}
@Test
@Transactional
public void testRegisterDuplicateEmail() throws Exception {
// Good
ManagedUserVM validUser = new ManagedUserVM(
null, // id
"john", // login
"password", // password
"John", // firstName
"Doe", // lastName
"[email protected]", // e-mail
true, // activated
"en", // langKey
new HashSet<>(Arrays.asList(AuthoritiesConstants.USER)),
null, // createdBy
null, // createdDate
null, // lastModifiedBy
null // lastModifiedDate
);
// Duplicate e-mail, different login
ManagedUserVM duplicatedUser = new ManagedUserVM(validUser.getId(), "johnjr", validUser.getPassword(), validUser.getLogin(), validUser.getLastName(),
validUser.getEmail(), true, validUser.getLangKey(), validUser.getAuthorities(), validUser.getCreatedBy(), validUser.getCreatedDate(), validUser.getLastModifiedBy(), validUser.getLastModifiedDate());
// Good user
restMvc.perform(
post("/api/register")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(validUser)))
.andExpect(status().isCreated());
// Duplicate e-mail
restMvc.perform(
post("/api/register")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(duplicatedUser)))
.andExpect(status().is4xxClientError());
Optional<User> userDup = userRepository.findOneByLogin("johnjr");
assertThat(userDup.isPresent()).isFalse();
}
@Test
@Transactional
public void testRegisterAdminIsIgnored() throws Exception {
ManagedUserVM validUser = new ManagedUserVM(
null, // id
"badguy", // login
"password", // password
"Bad", // firstName
"Guy", // lastName
"[email protected]", // e-mail
true, // activated
"en", // langKey
new HashSet<>(Arrays.asList(AuthoritiesConstants.ADMIN)),
null, // createdBy
null, // createdDate
null, // lastModifiedBy
null // lastModifiedDate
);
restMvc.perform(
post("/api/register")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(validUser)))
.andExpect(status().isCreated());
Optional<User> userDup = userRepository.findOneByLogin("badguy");
assertThat(userDup.isPresent()).isTrue();
assertThat(userDup.get().getAuthorities()).hasSize(1)
.containsExactly(authorityRepository.findOne(AuthoritiesConstants.USER));
}
@Test
@Transactional
public void testSaveInvalidLogin() throws Exception {
UserDTO invalidUser = new UserDTO(
"funky-log!n", // login <-- invalid
"Funky", // firstName
"One", // lastName
"[email protected]", // e-mail
true, // activated
"en", // langKey
new HashSet<>(Arrays.asList(AuthoritiesConstants.USER))
);
restUserMockMvc.perform(
post("/api/account")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(invalidUser)))
.andExpect(status().isBadRequest());
Optional<User> user = userRepository.findOneByEmail("[email protected]");
assertThat(user.isPresent()).isFalse();
}
}
| {
"content_hash": "7aca5932d8b3ef0bf2dee3b32052d1d8",
"timestamp": "",
"source": "github",
"line_count": 396,
"max_line_length": 211,
"avg_line_length": 40.916666666666664,
"alnum_prop": 0.5723631426279084,
"repo_name": "tomkasp/fitapp",
"id": "6f315e6607f3259f3975f21cbe1093d9b6a26e6d",
"size": "16203",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/com/tomkasp/common/web/rest/AccountResourceIntTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5006"
},
{
"name": "CSS",
"bytes": "171728"
},
{
"name": "HTML",
"bytes": "183734"
},
{
"name": "Java",
"bytes": "486138"
},
{
"name": "JavaScript",
"bytes": "228015"
},
{
"name": "Scala",
"bytes": "3295"
},
{
"name": "Shell",
"bytes": "7058"
},
{
"name": "TypeScript",
"bytes": "757"
}
],
"symlink_target": ""
} |
Subsets and Splits