text
stringlengths 2
1.04M
| meta
dict |
---|---|
ACCEPTED
#### According to
Interim Register of Marine and Nonmarine Genera
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "7ea249b3281d136a50b386df91eceeed",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 47,
"avg_line_length": 10.923076923076923,
"alnum_prop": 0.7183098591549296,
"repo_name": "mdoering/backbone",
"id": "d67da75747f537e7d6e84b32d6f9093bef3ea90f",
"size": "198",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Protozoa/Acritarcha/Priscogalea/Priscogalea barbara/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
angular.module('job')
.controller('TranslationsController', ['_', '$scope', 'TranslationsService', '$modal',
function (_, $scope, TranslationsService, $modal) {
$scope.loadPage = true;
$scope.disabledExport = false;
$scope.disabledUpdateLanguagesList = false;
$scope.tableHeader = [{
name: 'Name',
class: 'col-md-4 background-white'
}, {
name: 'Alias',
class: 'col-md-4 background-white'
}, {
name: 'Public',
class: 'col-md-2 background-white'
}, {
name: 'Import Translations',
class: 'col-md-2 background-white'
}];
TranslationsService.getLanguages(function (err, languages) {
if (err) {
return console.error(err);
}
$scope.languages = languages;
$scope.loadPage = false;
});
$scope.exportLanguagesFile = function () {
$scope.disabledExport = true;
let modalInstance = $modal.open({
templateUrl: '/components/administrator/translations/export/export.template.html',
controller: 'ExportController',
size: 'sm'
});
modalInstance.result.then(function () {
$scope.disabledExport = false;
}, function () {
$scope.disabledExport = false;
});
};
$scope.updateLanguagesList = function () {
TranslationsService.updateLanguagesList(function (err, languages) {
if (err) {
console.error(err);
return;
}
$scope.languages = languages;
$scope.originalLanguages = angular.copy(languages);
$scope.disabledUpdateLanguagesList = false;
});
};
$scope.updateLanguageStatus = function (languageId, status) {
let options = {
query: {id: languageId},
params: {isPublic: status}
};
TranslationsService.updateLanguage(options, function (err) {
if (err) {
console.error(err);
}
});
};
$scope.importTranslations = function (language) {
let modalInstance = $modal.open({
templateUrl: '/components/administrator/translations/import/import.template.html',
controller: 'ImportController',
size: 'sm',
resolve: {
params: function () {
return {
language: language
};
}
}
});
modalInstance.result.then(function () {
});
};
$scope.updateLanguageAlias = function (languageId, alias) {
let options = {
query: {id: languageId},
params: {alias: alias}
};
TranslationsService.updateLanguage(options, function (err) {
if (err) {
console.error(err);
}
});
};
$scope.dropType = function () {
let elmTbodyTr = angular.element('tbody tr');
let hasClassActive = elmTbodyTr.hasClass('active');
if (hasClassActive) {
elmTbodyTr.removeClass('active');
}
if (angular.equals($scope.originalLanguages, $scope.languages)) {
$scope.language = null;
return;
}
let query = _.map(this.languages, (data) => {
let queryData = {};
queryData.id = data._id;
queryData.position = data.position;
return queryData;
});
TranslationsService.updateLanguagePosition({languages: query}, function (err) {
if (err) {
console.error(err);
return;
}
$scope.language = null;
$scope.originalLanguages = angular.copy($scope.languages);
});
};
$scope.overType = function (language) {
if ($scope.language && $scope.language !== language) {
let position = $scope.language.position;
_.forEach($scope.languages, function (originLanguage) {
if (originLanguage.code !== $scope.language.code) {
return;
}
if (language.position > 0) {
$scope.language.position = language.position;
language.position = position;
}
});
}
};
$scope.putType = function (event, language) {
if ($scope.language) {
return;
}
let elm = angular.element(event.target);
let className = _.head(elm).className;
if (className.indexOf('not-dragging') !== -1) {
return;
}
if (language.code !== 'en') {
event.preventDefault();
elm.parent('tr').addClass('active');
$scope.language = language;
}
};
}]);
| {
"content_hash": "b11b23b88b8c630aaf23072246024ea2",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 92,
"avg_line_length": 27.520231213872833,
"alnum_prop": 0.5244696492333544,
"repo_name": "valor-software/dollar-street-cms-pages",
"id": "e92eeb7aed9219087cde32b2b28199f5511d8472",
"size": "4761",
"binary": false,
"copies": "1",
"ref": "refs/heads/development",
"path": "src/components/administrator/translations/translations.controller.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "365838"
},
{
"name": "CoffeeScript",
"bytes": "36273"
},
{
"name": "Dockerfile",
"bytes": "696"
},
{
"name": "HTML",
"bytes": "274178"
},
{
"name": "JavaScript",
"bytes": "3991162"
},
{
"name": "Makefile",
"bytes": "1552"
},
{
"name": "Shell",
"bytes": "780"
}
],
"symlink_target": ""
} |
<<<<<<< HEAD
# clarifai-android-starter
This is a simple project to get you started using the Clarifai API in Android apps. It uses the [Clarifai Java Client](https://github.com/Clarifai/clarifai-java) to perform image recognition on photos stored on your device. Full Clarifai API documentation can be found at [developer.clarifai.com](http://developer.clarifai.com/).
<img src="https://i.imgur.com/56EUw5D.jpg" width="200">
## Building and Running
1. Go to [developer.clarifai.com/applications](https://developer.clarifai.com/applications), click
on your application, and copy the "Client ID" and "Client Secret" values (if you don't already
have an account or application, you'll need to create them first).
Replace the values of `CLIENT_ID` and `CLIENT_SECRET` in
[Credentials.java](app/src/main/java/com/clarifai/androidstarter/Credentials.java) with the ones
you copied.
2. Open the project in Android Studio and press the "Play" button in the toolbar to build,
install, and run the app.
Alternately, you can build and install from the command-line with:
```./gradlew installDebug```
## RecognitionActivity
[RecognitionActivity](app/src/main/java/com/clarifai/androidstarter/RecognitionActivity.java) is a simple Activity that prompts the user to select a photo from their photo library and then sends it to the Clarifai API for tagging. This Activity demonstrates how to prepare the image for sending to Clarifai and how to handle the response.
## Next steps
Feel free to use this project as a base for building your app. You can also use the ClarifaiClient from other projects by adding the following dependency to your [app/build.gradle](app/build.gradle) file:
```compile 'com.clarifai:clarifai-api-java:1.2.0'```
More information on the client and usage examples can be found [here](https://github.com/Clarifai/clarifai-java).
=======
# Hack_Project
https://github.com/clarifai
https://github.com/nostra13/Android-Universal-Image-Loader
https://github.com/boxme/PhotoGallery
>>>>>>> 8d76f24d9ed3a0ea6aad41fb54a263ee63362e4c
| {
"content_hash": "739da6c627934ab6010d3734518696c0",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 339,
"avg_line_length": 55.91891891891892,
"alnum_prop": 0.7699371677138714,
"repo_name": "Spartahacks2016/Hack_Project",
"id": "b423c9c4d04fd8551227a849f88226efae73a0bd",
"size": "2069",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "26167"
}
],
"symlink_target": ""
} |
@interface ViewController ()
@property (nonatomic, strong) ObjectivePGP *pgp;
@property (weak) IBOutlet NSTextField *recipientsPublicKeyTextField;
@property (weak) IBOutlet NSTextField *messageTextField;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.window.title = @"Hello PGP";
}
- (void)setRepresentedObject:(id)representedObject {
[super setRepresentedObject:representedObject];
}
- (IBAction)pressedEncrypt:(id)sender {
self.pgp = [[ObjectivePGP alloc] init];
NSError *error = nil;
NSData *keyData = [self.recipientsPublicKeyTextField.stringValue dataUsingEncoding:NSASCIIStringEncoding];
[self.pgp importKeysFromData:keyData allowDuplicates:YES];
NSArray *keys = [self.pgp getKeysOfType:PGPKeyPublic];
NSData *stringToEncrypt = [self.messageTextField.stringValue dataUsingEncoding:NSASCIIStringEncoding];
NSData *encryptedData = [self.pgp encryptData:stringToEncrypt usingPublicKey:keys[0] armored:YES error:&error];
if (encryptedData && !error) {
self.messageTextField.stringValue = [[NSString alloc] initWithData:encryptedData encoding:NSASCIIStringEncoding];
}
}
@end
| {
"content_hash": "c244b4495601dc34daffa6c0c2a666f5",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 121,
"avg_line_length": 36.06060606060606,
"alnum_prop": 0.7588235294117647,
"repo_name": "weiran/Hello-PGP",
"id": "abe8258f6bbf61afab6d0d0daf411690a6fd518a",
"size": "1403",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Hello PGP/ViewController.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "2597"
},
{
"name": "Ruby",
"bytes": "137"
}
],
"symlink_target": ""
} |
var RaceMatch = require('../src/RaceMatch.js');
var RaceDriver = require('../src/RaceDriver.js');
var RaceEvent = require('../src/RaceEvent.js');
var Vue = require('vue');
window._ = require('lodash');
Vue.config.productionTip = false;
new Vue({
el: '#app',
data: {
drivers: [],
raceEvent: null,
},
computed: {
sortedDrivers: function(){
return _.chain(this.drivers).orderBy('number').groupBy('group').sort().value();
}
},
mounted: function() {
this.clearDrivers();
},
methods: {
race: function() {
var event = (new RaceEvent(this.drivers));
event.run(false);
this.raceEvent = event;
},
shuffleHeats: function(){
function Shuffle(o) {
for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
return o;
};
Shuffle(this.raceEvent.heats);
this.raceEvent.heats.__ob__.dep.notify();
},
addDriver: function() {
this.drivers.push(new RaceDriver);
this.race();
},
removeDriver: function() {
if (this.drivers.length <= 4) {
return;
}
this.drivers.pop();
this.race();
},
clearDrivers: function() {
this.drivers.length = 0;
for (var i = 0; i < 4; i++) {
this.drivers.push(new RaceDriver);
}
this.race();
},
exampleData: function() {
this.drivers.length = 0;
this.drivers.push(new RaceDriver(30, 'John Doe', '4A', 'OKM'));
this.drivers.push(new RaceDriver(31, 'John Doe', '4A', 'Munkebo'));
this.drivers.push(new RaceDriver(50, 'John Doe', '4B', 'Tommerup'));
this.drivers.push(new RaceDriver(51, 'John Doe', '4B', 'Sanderum'));
this.drivers.push(new RaceDriver(60, 'John Doe', '5A', 'Næsby'));
this.drivers.push(new RaceDriver(61, 'John Doe', '5A', 'OKM'));
this.drivers.push(new RaceDriver(90, 'John Doe', '5B', 'Munkebo'));
this.drivers.push(new RaceDriver(91, 'John Doe', '5B', 'Sanderum'));
this.drivers.push(new RaceDriver(92, 'John Doe', '5B', 'Næsby'));
this.drivers.push(new RaceDriver(100, 'John Longname Doe', '6A', 'OKM'));
this.race();
},
getDriver: function(id) {
if (this.drivers[id-1]) {
return this.drivers[id-1];
}
return;
},
heatDrivers: function(group, round) {
var drivers = this.raceEvent.matches[group].getHeatDrivers(round-1);
for (var i = drivers.length - 1; i >= 0; i--) {
if (drivers[i] == '') {
drivers[i] = '@';
}
}
return drivers.join(' - ');
},
print: function() {
window.print();
},
},
}); | {
"content_hash": "83a9b309e8db48d677c49e9a0cc02916",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 103,
"avg_line_length": 22.925925925925927,
"alnum_prop": 0.5953150242326333,
"repo_name": "stefanoruth/SpeedwayMatchSystem",
"id": "0e47a07dffd62c4a802e6bd32f678798c98dda22",
"size": "2478",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "resources/app.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "378"
},
{
"name": "JavaScript",
"bytes": "15365"
}
],
"symlink_target": ""
} |
title: Avatar Image
---
[Insert description here] | {
"content_hash": "c9aefe1c2089c13f8ac78d670be623dd",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 25,
"avg_line_length": 13.25,
"alnum_prop": 0.6981132075471698,
"repo_name": "paddeee/patternlab",
"id": "02ebd1bc987f6ef6a3e4b010908036c67c4bb135",
"size": "58",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "source/_patterns/00-atoms/images/avatar.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "360115"
},
{
"name": "HTML",
"bytes": "53909"
},
{
"name": "JavaScript",
"bytes": "25967"
}
],
"symlink_target": ""
} |
package lila
package object push extends PackageObject with WithPlay
| {
"content_hash": "74dd2d70c11fd07cc183a0ece9e5dd88",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 55,
"avg_line_length": 23.333333333333332,
"alnum_prop": 0.8571428571428571,
"repo_name": "JimmyMow/lila",
"id": "c1f345ce89935ba9cf06cc6f4a836d9fefeea9d5",
"size": "70",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/push/src/main/package.scala",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "849"
},
{
"name": "CSS",
"bytes": "248322"
},
{
"name": "Cycript",
"bytes": "19988"
},
{
"name": "Emacs Lisp",
"bytes": "32380"
},
{
"name": "Erlang",
"bytes": "20806"
},
{
"name": "Fancy",
"bytes": "119"
},
{
"name": "GAP",
"bytes": "13128"
},
{
"name": "GLSL",
"bytes": "2357"
},
{
"name": "HTML",
"bytes": "362327"
},
{
"name": "Hy",
"bytes": "20324"
},
{
"name": "Io",
"bytes": "4866"
},
{
"name": "Java",
"bytes": "21088"
},
{
"name": "JavaScript",
"bytes": "485030"
},
{
"name": "Makefile",
"bytes": "16157"
},
{
"name": "Mathematica",
"bytes": "20412"
},
{
"name": "NewLisp",
"bytes": "19837"
},
{
"name": "OCaml",
"bytes": "2098"
},
{
"name": "Perl6",
"bytes": "20652"
},
{
"name": "PostScript",
"bytes": "3253"
},
{
"name": "Python",
"bytes": "1959"
},
{
"name": "Ruby",
"bytes": "32145"
},
{
"name": "Scala",
"bytes": "1901170"
},
{
"name": "Shell",
"bytes": "15591"
},
{
"name": "Slash",
"bytes": "18735"
},
{
"name": "Smalltalk",
"bytes": "19762"
},
{
"name": "SystemVerilog",
"bytes": "19468"
},
{
"name": "UrWeb",
"bytes": "17222"
}
],
"symlink_target": ""
} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Overview of Distributions</title>
<link rel="stylesheet" href="../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="../../index.html" title="Math Toolkit 2.2.1">
<link rel="up" href="../stat_tut.html" title="Statistical Distributions Tutorial">
<link rel="prev" href="../stat_tut.html" title="Statistical Distributions Tutorial">
<link rel="next" href="overview/headers.html" title="Headers and Namespaces">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../stat_tut.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../stat_tut.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overview/headers.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.stat_tut.overview"></a><a class="link" href="overview.html" title="Overview of Distributions">Overview of Distributions</a>
</h3></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="overview/headers.html">Headers and
Namespaces</a></span></dt>
<dt><span class="section"><a href="overview/objects.html">Distributions
are Objects</a></span></dt>
<dt><span class="section"><a href="overview/generic.html">Generic operations
common to all distributions are non-member functions</a></span></dt>
<dt><span class="section"><a href="overview/complements.html">Complements
are supported too - and when to use them</a></span></dt>
<dt><span class="section"><a href="overview/parameters.html">Parameters
can be calculated</a></span></dt>
<dt><span class="section"><a href="overview/summary.html">Summary</a></span></dt>
</dl></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2006-2010, 2012-2014 Nikhar Agrawal,
Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert
Holin, Bruno Lalande, John Maddock, Johan Råde, Gautam Sewani, Benjamin Sobotta,
Thijs van den Berg, Daryle Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../stat_tut.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../stat_tut.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overview/headers.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {
"content_hash": "ae5ff69b2edd2425c3e2c550a2872b02",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 437,
"avg_line_length": 66.03389830508475,
"alnum_prop": 0.6383470225872689,
"repo_name": "TyRoXx/cdm",
"id": "d675df160379cd26f9b3f8325172c5abd876e6b7",
"size": "3896",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "original_sources/boost_1_59_0/libs/math/doc/html/math_toolkit/stat_tut/overview.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "218230"
},
{
"name": "Batchfile",
"bytes": "34328"
},
{
"name": "C",
"bytes": "23017824"
},
{
"name": "C#",
"bytes": "40804"
},
{
"name": "C++",
"bytes": "179294109"
},
{
"name": "CMake",
"bytes": "229784"
},
{
"name": "CSS",
"bytes": "315409"
},
{
"name": "Cuda",
"bytes": "26521"
},
{
"name": "FORTRAN",
"bytes": "1856"
},
{
"name": "Groff",
"bytes": "23714"
},
{
"name": "HTML",
"bytes": "153539062"
},
{
"name": "IDL",
"bytes": "14"
},
{
"name": "Java",
"bytes": "39299"
},
{
"name": "JavaScript",
"bytes": "224840"
},
{
"name": "Lex",
"bytes": "1231"
},
{
"name": "Makefile",
"bytes": "1049441"
},
{
"name": "Max",
"bytes": "36857"
},
{
"name": "Objective-C",
"bytes": "304843"
},
{
"name": "Objective-C++",
"bytes": "4227"
},
{
"name": "PHP",
"bytes": "64977"
},
{
"name": "Perl",
"bytes": "75786"
},
{
"name": "Perl6",
"bytes": "2053"
},
{
"name": "Python",
"bytes": "1962213"
},
{
"name": "QML",
"bytes": "593"
},
{
"name": "QMake",
"bytes": "16692"
},
{
"name": "Rebol",
"bytes": "354"
},
{
"name": "Shell",
"bytes": "1374741"
},
{
"name": "Tcl",
"bytes": "1172"
},
{
"name": "TeX",
"bytes": "32117"
},
{
"name": "XSLT",
"bytes": "549658"
},
{
"name": "Yacc",
"bytes": "19623"
}
],
"symlink_target": ""
} |
require 'spec_helper'
RSpec.describe HerokuAPI, type: :functional do
context '.currently_available_memory' do
let_doubles(:current_memory, :current_plan)
it 'is defined by the current plan and its associated memory' do
expect(described_class).to \
receive(:current_redis_cloud_plan).and_return(current_plan)
expect(described_class).to \
receive(:available_memory)
.with(current_plan).and_return(current_memory)
expect(described_class.currently_available_memory(**@heroku_params)).to \
eq(current_memory)
end
end # context '.currently_available_memory'
end
| {
"content_hash": "ac27f04a948db4bb20adc490324daa57",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 79,
"avg_line_length": 38.9375,
"alnum_prop": 0.7014446227929374,
"repo_name": "RobertDober/redis_cloud_auto_upgrade",
"id": "e8b2e9131c9aeba2a31e32741bcfbdf5084d44eb",
"size": "653",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/functional/heroku_api/currently_available_memory_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Makefile",
"bytes": "119"
},
{
"name": "Ruby",
"bytes": "30457"
}
],
"symlink_target": ""
} |
using System.Web.Http;
[assembly: WebActivator.PreApplicationStartMethod(
typeof(ReferralReboot.App_Start.BreezeWebApiConfig), "RegisterBreezePreStart")]
namespace ReferralReboot.App_Start {
///<summary>
/// Inserts the Breeze Web API controller route at the front of all Web API routes
///</summary>
///<remarks>
/// This class is discovered and run during startup; see
/// http://blogs.msdn.com/b/davidebb/archive/2010/10/11/light-up-your-nupacks-with-startup-code-and-webactivator.aspx
///</remarks>
public static class BreezeWebApiConfig {
public static void RegisterBreezePreStart() {
GlobalConfiguration.Configuration.Routes.MapHttpRoute(
name: "BreezeApi",
routeTemplate: "breeze/{controller}/{action}"
);
}
}
} | {
"content_hash": "a71a3d669c6373e8fec7aa1ef30d7a1b",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 119,
"avg_line_length": 35.54545454545455,
"alnum_prop": 0.7161125319693095,
"repo_name": "kmlewis/_old_stuff",
"id": "dbec9b260700bb3db8e55034281968995b44e961",
"size": "782",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ReferralTracker/ReferralReboot/App_Start/BreezeWebApiConfig.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "204"
},
{
"name": "C#",
"bytes": "198119"
},
{
"name": "CSS",
"bytes": "102145"
},
{
"name": "HTML",
"bytes": "83756"
},
{
"name": "JavaScript",
"bytes": "3939243"
}
],
"symlink_target": ""
} |
//
// CHRDispatchTimer.h
// Chronos
//
// Copyright (c) 2015 Comyar Zaheri. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
#pragma mark - Imports
@import Foundation;
#import "CHRRepeatingTimer.h"
#import <libkern/OSAtomic.h>
#pragma mark - CHRDispatchTimer Interface
/**
The CHRDispatchTimer class allows you to create Grand Central Dispatch-based
timer objects. A timer waits until a certain time interval has elapsed and then
fires, executing a given block.
A timer has limited accuracy when determining the exact moment to fire; the
actual time at which a timer fires can potentially be a significant period of
time after the scheduled firing time.
*/
@interface CHRDispatchTimer : NSObject <CHRRepeatingTimer>
- (instancetype)init NS_UNAVAILABLE;
// -----
// @name Creating a Dispatch Timer
// -----
#pragma mark Creating a Dispatch Timer
/**
Initializes a CHRDispatchTimer object.
The execution block will be executed on the default execution queue.
@param interval
The execution interval, in seconds.
@param executionBlock
The block to execute at the given interval.
@return The newly initialized CHRDispatch object.
*/
- (instancetype)initWithInterval:(NSTimeInterval)interval
executionBlock:(CHRRepeatingTimerExecutionBlock)executionBlock;
/**
Initializes a CHRDispatchTimer object.
@param interval
The execution interval, in seconds.
@param executionBlock
The block to execute at the given interval.
@param executionQueue
The queue that should execute the executionBlock.
@return The newly initialized CHRDispatch object.
*/
- (instancetype)initWithInterval:(NSTimeInterval)interval
executionBlock:(CHRRepeatingTimerExecutionBlock)executionBlock
executionQueue:(dispatch_queue_t)executionQueue;
/**
Initializes a CHRDispatchTimer object.
@param interval
The execution interval, in seconds.
@param executionBlock
The block to execute at the given interval.
@param executionQueue
The queue that should execute the executionBlock.
@param failureBlock
The block to execute if the timer fails to initialize.
@return The newly initialized CHRDispatch object.
*/
- (instancetype)initWithInterval:(NSTimeInterval)interval
executionBlock:(CHRRepeatingTimerExecutionBlock)executionBlock
executionQueue:(dispatch_queue_t)executionQueue
failureBlock:(CHRTimerInitFailureBlock)failureBlock
NS_DESIGNATED_INITIALIZER;
/**
Creates and initializes a new CHRDispatchTimer object.
The execution block will be executed on the default execution queue.
@param interval
The execution interval, in seconds.
@param executionBlock
The block to execute at the given interval.
@return The newly created CHRDispatch object.
*/
+ (CHRDispatchTimer *)timerWithInterval:(NSTimeInterval)interval
executionBlock:(CHRRepeatingTimerExecutionBlock)executionBlock;
/**
Creates and initializes a new CHRDispatchTimer object.
@param interval
The execution interval, in seconds.
@param executionBlock
The block to execute at the given interval.
@param executionQueue
The queue that should execute the executionBlock.
@return The newly created CHRDispatch object.
*/
+ (CHRDispatchTimer *)timerWithInterval:(NSTimeInterval)interval
executionBlock:(CHRRepeatingTimerExecutionBlock)executionBlock
executionQueue:(dispatch_queue_t)executionQueue;
/**
Creates and initializes a new CHRDispatchTimer object.
@param interval
The execution interval, in seconds.
@param executionBlock
The block to execute at the given interval.
@param executionQueue
The queue that should execute the executionBlock.
@param failureBlock
The block to execute if the timer fails to initialize.
@return The newly created CHRDispatch object.
*/
+ (CHRDispatchTimer *)timerWithInterval:(NSTimeInterval)interval
executionBlock:(CHRRepeatingTimerExecutionBlock)executionBlock
executionQueue:(dispatch_queue_t)executionQueue
failureBlock:(CHRTimerInitFailureBlock)failureBlock;
// -----
// @name Properties
// -----
#pragma mark Properties
/**
The receiver's execution interval, in seconds.
*/
@property (readonly) NSTimeInterval interval;
@end
| {
"content_hash": "9ecc678ad79c9136f804673a0d300a65",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 88,
"avg_line_length": 35.56521739130435,
"alnum_prop": 0.7099196646873909,
"repo_name": "comyarzaheri/Chronos",
"id": "6b1e4353d9f3b710f899f0da19873b80f9fffa09",
"size": "5726",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Chronos/Classes/CHRDispatchTimer.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2010"
},
{
"name": "Objective-C",
"bytes": "47021"
},
{
"name": "Ruby",
"bytes": "573"
}
],
"symlink_target": ""
} |
import { isDefined } from '@collectable/core';
import { SortedMapStructure, getFirstItem } from '../internals';
export function firstValue<K, V, U> (map: SortedMapStructure<K, V, U>): V|undefined {
const item = getFirstItem(map._sorted);
return isDefined(item) ? item[1] : void 0;
}
| {
"content_hash": "ed3965a5950f9e1cd25808db3949df56",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 85,
"avg_line_length": 41.142857142857146,
"alnum_prop": 0.7048611111111112,
"repo_name": "frptools/collectable",
"id": "2dfe928c9d783ec7633db0e216b24297361f9a64",
"size": "288",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/sorted-map/src/functions/firstValue.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "TypeScript",
"bytes": "591574"
}
],
"symlink_target": ""
} |
package org.codehaus.griffon.formatter;
import griffon.annotations.core.Nullable;
import griffon.formatter.ParseException;
/**
* @author Andres Almiray
* @since 3.0.0
*/
public class ByteFormatter extends AbstractNumberFormatter<Byte> {
public ByteFormatter() {
this(null);
}
public ByteFormatter(@Nullable String pattern) {
super(pattern);
}
@Nullable
@Override
public Byte parse(@Nullable String str) throws ParseException {
if (isBlank(str)) { return null; }
try {
return numberFormat.parse(str).byteValue();
} catch (java.text.ParseException e) {
throw new ParseException(e);
}
}
}
| {
"content_hash": "343cfa776c2f6997dfe5be2e3b5149c2",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 67,
"avg_line_length": 23.266666666666666,
"alnum_prop": 0.6432664756446992,
"repo_name": "griffon/griffon",
"id": "790e7d39294706c4a05e1797ebb7316bcc0e529e",
"size": "1359",
"binary": false,
"copies": "1",
"ref": "refs/heads/development_3_X",
"path": "subprojects/griffon-converter-impl/src/main/java/org/codehaus/griffon/formatter/ByteFormatter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "303"
},
{
"name": "CSS",
"bytes": "4899"
},
{
"name": "Groovy",
"bytes": "1563732"
},
{
"name": "HTML",
"bytes": "36093"
},
{
"name": "Java",
"bytes": "4798259"
}
],
"symlink_target": ""
} |
//
// KHMeListViewController.m
// knock Honey
//
// Created by 刘毕涛 on 2016/11/14.
// Copyright © 2016年 liubitao. All rights reserved.
//
#import "KHMeListViewController.h"
#import "KHSnatchModel.h"
#import "KHAllTableViewCell.h"
#import "KHSnatchingTableViewCell.h"
#import "KHTabbarViewController.h"
#import "KHDetailViewController.h"
#import "YWCover.h"
#import "YWPopView.h"
#import "KHCodeViewController.h"
#import "KHProductModel.h"
#import "KHOtherPersonController.h"
@interface KHMeListViewController ()<UITableViewDataSource,UITableViewDelegate,DZNEmptyDataSetDelegate,DZNEmptyDataSetSource,khAllCellDegelage,khEdCellDegelage,YWCoverDelegate>{
NSInteger _currentPage;
CGFloat _huadong;
}
@property (nonatomic,strong) NSMutableArray *dataArray;
@property (nonatomic,strong) KHCodeViewController *codeVC;
@property (nonatomic,assign) BOOL loading;
@end
static NSString *ingGoodsCell = @"ingGoodsCell";
static NSString *edGoodsCell = @"edGoodsCell";
@implementation KHMeListViewController
- (KHCodeViewController *)codeVC{
if (!_codeVC) {
_codeVC = [[KHCodeViewController alloc]init];
}
return _codeVC;
}
- (NSMutableArray *)dataArray{
if (!_dataArray) {
_dataArray = [NSMutableArray array];
}
return _dataArray;
}
- (UITableView *)tableView{
if (!_tableView) {
_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, KscreenWidth,_otherType ? kScreenHeight - 190 - 46:kScreenHeight - kNavigationBarHeight- 60) style:UITableViewStylePlain];
_tableView.dataSource = self;
_tableView.delegate = self;
_tableView.emptyDataSetSource = self;
_tableView.emptyDataSetDelegate = self;
[_tableView setCustomSeparatorInset:UIEdgeInsetsZero];
_tableView.tableFooterView = [UIView new];
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KscreenWidth, 1)];
view.backgroundColor = UIColorHex(#DCDCDC);
_tableView.tableHeaderView = view;
}
return _tableView;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.automaticallyAdjustsScrollViewInsets = NO;
[self.view addSubview:self.tableView];
//下拉刷新
__weak typeof(self) weakSelf = self;
self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
[weakSelf getData];
//结束刷新
[weakSelf.tableView.mj_header endRefreshing];
}];
[self.tableView.mj_header beginRefreshing];
self.tableView.mj_footer = [MJRefreshAutoFooter footerWithRefreshingBlock:^{
[weakSelf getMoreData];
[weakSelf.tableView.mj_footer endRefreshing];
}];
[self.tableView registerNib:[UINib nibWithNibName:@"KHSnatchingTableViewCell" bundle:nil] forCellReuseIdentifier:edGoodsCell];
[self.tableView registerNib:[UINib nibWithNibName:@"KHAllTableViewCell" bundle:nil] forCellReuseIdentifier:ingGoodsCell];
}
- (void)setLoading:(BOOL)loading{
if (self.loading == loading) {
return;
}
_loading = loading;
[self.tableView reloadEmptyDataSet];
}
- (void)getData{
NSMutableDictionary *parameter = [Utils parameter];
if (_userID) {
parameter[@"userid"] = _userID;
}else{
parameter[@"userid"] = [YWUserTool account].userid;
}
parameter[@"p"] = @1;
parameter[@"type"] = _type;
[YWHttptool GET:PortOrder_list parameters:parameter success:^(id responseObject) {
self.loading = YES;
_currentPage = 1;
self.dataArray = [KHSnatchModel kh_objectWithKeyValuesArray:responseObject[@"result"]];
[self.tableView reloadData];
} failure:^(NSError *error){
self.loading = YES;
}];
}
- (void)getMoreData{
NSMutableDictionary *parameter = [Utils parameter];
if (_userID) {
parameter[@"userid"] = _userID;
}else{
parameter[@"userid"] = [YWUserTool account].userid;
}
parameter[@"p"] = [NSNumber numberWithInteger:++_currentPage];
parameter[@"type"] = _type;
[YWHttptool GET:PortOrder_list parameters:parameter success:^(id responseObject) {
if ([responseObject[@"isError"] integerValue]) {
return ;
}
[self.dataArray addObjectsFromArray:[KHSnatchModel kh_objectWithKeyValuesArray:responseObject[@"result"]]];
[self.tableView reloadData];
} failure:^(NSError *error){
}];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return self.dataArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
KHSnatchModel *model = self.dataArray[indexPath.row];
if (model.isopen.integerValue == 1) {
KHSnatchingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:edGoodsCell forIndexPath:indexPath];
cell.delegate = self;
[cell setModel:model];
return cell;
}else{
KHAllTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ingGoodsCell forIndexPath:indexPath];
cell.delegate = self;
[cell setModel:model];
return cell;
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
KHSnatchModel *model= self.dataArray[indexPath.row];
if (model.isopen.integerValue == 1) {
return 240;
}else{
return 155;
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
[MBProgressHUD showMessage:@"加载中..."];
NSMutableDictionary *parameter = [Utils parameter];
KHSnatchModel *model = self.dataArray[indexPath.row];
parameter[@"goodsid"] = model.goodsid;
parameter[@"qishu"] = model.qishu;
if ([YWUserTool account]) {
parameter[@"userid"] = [YWUserTool account].userid;
}
[YWHttptool GET:PortGoodsdetails parameters:parameter success:^(id responseObject) {
[MBProgressHUD hideHUD];
if ([responseObject[@"isError"] integerValue])return;
KHDetailViewController *DetailVC = [[KHDetailViewController alloc]init];
DetailVC.model = [KHProductModel kh_objectWithKeyValues:responseObject[@"result"]];
DetailVC.goodsid = model.goodsid;
DetailVC.qishu = model.qishu;
if (model.isopen.integerValue == 1) {
DetailVC.showType = TreasureDetailHeaderTypeWon;
}else{
DetailVC.showType = TreasureDetailHeaderTypeNotParticipate;
}
KHBaseViewController *parentVC = (KHBaseViewController *)self.parentViewController;
[parentVC hideBottomBarPush:DetailVC];
} failure:^(NSError *error) {
[MBProgressHUD hideHUD];
[MBProgressHUD showError:@"网络连接有误"];
}];
}
#pragma mark - cell代理
- (void)tableViewLookup:(KHSnatchModel *)model{
KHCodeViewController *vc = self.codeVC;
NSArray *array = [model.codes componentsSeparatedByString:@","];
vc.dataArray = array.mutableCopy;
if (model.lottery){
vc.winCode = model.lottery.wincode;
}
[vc.ColloctionView reloadData];
//弹出蒙版
YWCover *cover = [YWCover show];
cover.delegate = self;
[cover setDimBackground:YES];
// 弹出pop菜单
YWPopView *menu = [YWPopView showInRect:CGRectZero];
menu.center = self.view.center;
menu.transform = CGAffineTransformMakeScale(0, 0);
[UIView animateWithDuration:0.5
animations:^{
menu.transform = CGAffineTransformIdentity;
}];
menu.contentView = vc.view;
}
//点击蒙版的时候调用
- (void)coverDidClickCover:(YWCover *)cover{
// 隐藏pop菜单
[YWPopView hide];
}
- (void)tableViewWithBuy:(KHSnatchModel *)model{
NSMutableDictionary *parameter = [Utils parameter];
parameter[@"userid"] = [YWUserTool account].userid;
parameter[@"goodsid"] = model.goodsid;
parameter[@"qishu"] = model.qishu;
[YWHttptool GET:PortAddCart parameters:parameter success:^(id responseObject) {
NSLog(@"%@",responseObject);
if ([responseObject[@"isError"] integerValue]) return ;
[AppDelegate getAppDelegate].value = [responseObject[@"result"][@"count_cart"] integerValue];
//刷新购物车
[[NSNotificationCenter defaultCenter]postNotificationName:@"refreshCart" object:nil userInfo:nil];
KHTabbarViewController *tabbarVC = (KHTabbarViewController *)[AppDelegate getAppDelegate].window.rootViewController;
[tabbarVC.tabBar setBadgeValue:[AppDelegate getAppDelegate].value AtIndex:3];
} failure:^(NSError *error){
}];
[self.tabBarController setSelectedIndex:3];
[self.navigationController popToRootViewControllerAnimated:NO];
}
#pragma mark - DZNEmptyDataSetSource, DZNEmptyDataSetDelegate
- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
return [UIImage imageNamed:@"empty_placeholder"];
}
- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView
{
NSString *text = @"暂无此纪录";
return [[NSAttributedString alloc] initWithString:text attributes:@{
NSFontAttributeName:SYSTEM_FONT(15)
}];
}
- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView{
return -64;
}
- (UIImage *)buttonImageForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state{
return IMAGE_NAMED(@"duobao");
}
- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView{
return YES;
}
- (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView{
return self.loading;
}
- (void)emptyDataSet:(UIScrollView *)scrollView didTapButton:(UIButton *)button{
[self.navigationController popToRootViewControllerAnimated:NO];
UITabBarController *tabBarVC = (UITabBarController *)[AppDelegate getAppDelegate].window.rootViewController;
[tabBarVC setSelectedIndex:0];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
| {
"content_hash": "b4520f43d48d4c6602e875731b5d17f4",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 194,
"avg_line_length": 35.54761904761905,
"alnum_prop": 0.6870155965936274,
"repo_name": "liubitao/honey",
"id": "68698ea7509e4392275a2b979eb134cceb077ad4",
"size": "10560",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "knock Honey/个人中心/夺宝纪录/Viewcontroller/KHMeListViewController.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "4531"
},
{
"name": "Objective-C",
"bytes": "1651199"
},
{
"name": "Ruby",
"bytes": "389"
}
],
"symlink_target": ""
} |
id: 56533eb9ac21ba0edf2244bf
title: Ambito locale e funzioni
challengeType: 1
videoUrl: 'https://scrimba.com/c/cd62NhM'
forumTopicId: 18227
dashedName: local-scope-and-functions
---
# --description--
Le variabili che sono dichiarate all'interno di una funzione, così come i parametri della funzione, hanno un ambito di applicazione (scope) <dfn>locale</dfn>. Ciò significa che sono visibili solo all'interno di quella funzione.
Ecco una funzione `myTest` con una variabile locale chiamata `loc`.
```js
function myTest() {
var loc = "foo";
console.log(loc);
}
myTest();
console.log(loc);
```
La chiamata alla funzione `myTest()` mostrerà la stringa `foo` nella console. La linea `console.log(loc)` genererà un errore, perché `loc` non è definita al di fuori della funzione.
# --instructions--
L'editor ha due `console.log` per aiutarti a vedere cosa sta succedendo. Controlla la console mentre scrivi il codice per vedere come cambia. Dichiara una variabile locale `myVar` all'interno di `myLocalScope` ed esegui i test.
**Nota:** La console mostrerà ancora `ReferenceError: myVar is not defined`, ma questo non causerà il fallimento dei test.
# --hints--
Il codice non dovrebbe contenere una variabile globale `myVar`.
```js
function declared() {
myVar;
}
assert.throws(declared, ReferenceError);
```
Dovresti aggiungere una variabile locale `myVar`.
```js
assert(
/functionmyLocalScope\(\)\{.*(var|let|const)myVar[\s\S]*}/.test(
__helpers.removeWhiteSpace(code)
)
);
```
# --seed--
## --seed-contents--
```js
function myLocalScope() {
// Only change code below this line
console.log('inside myLocalScope', myVar);
}
myLocalScope();
// Run and check the console
// myVar is not defined outside of myLocalScope
console.log('outside myLocalScope', myVar);
```
# --solutions--
```js
function myLocalScope() {
// Only change code below this line
var myVar;
console.log('inside myLocalScope', myVar);
}
myLocalScope();
// Run and check the console
// myVar is not defined outside of myLocalScope
console.log('outside myLocalScope', myVar);
```
| {
"content_hash": "fb7d5311f12fad0071fbd165feca63af",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 227,
"avg_line_length": 24.541176470588237,
"alnum_prop": 0.7272291466922339,
"repo_name": "raisedadead/FreeCodeCamp",
"id": "cd289d6d2e2525e0a87a6a45bddfb7e06fd001f8",
"size": "2098",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "curriculum/challenges/italian/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "190263"
},
{
"name": "HTML",
"bytes": "160430"
},
{
"name": "JavaScript",
"bytes": "546705"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace jaytwo.AspNet.SingleSignOn.WebHost.Content
{
public partial class Unauthorized : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public string GetSignOutUrl()
{
return VirtualPathUtility.ToAbsolute(SsoAppHost.Instance.SignOutHandlerPath);
}
}
} | {
"content_hash": "a622d104abcb1447f5c7df941fb68383",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 89,
"avg_line_length": 23.714285714285715,
"alnum_prop": 0.6867469879518072,
"repo_name": "jakegough/jaytwo.AspNet.SingleSignOn",
"id": "b38d1b22568367ea90689446f69858f70ddfd2c7",
"size": "500",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "jaytwo.AspNet.SingleSignOn/WebHost/Content/Unauthorized.aspx.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "1749"
},
{
"name": "Batchfile",
"bytes": "532"
},
{
"name": "C#",
"bytes": "171508"
}
],
"symlink_target": ""
} |
<file>
<destination>${destination}</destination>
<type>folder</type>
<uuidstructure>${uuidstructure}</uuidstructure>
<datelastmodified>${datelastmodified}</datelastmodified>
<userlastmodified>Admin</userlastmodified>
<datecreated>${datecreated}</datecreated>
<usercreated>Admin</usercreated>
<flags>0</flags>
<properties/>
<relations/>
<accesscontrol>
<accessentry>
<uuidprincipal>ROLE.WORKPLACE_USER</uuidprincipal>
<flags>514</flags>
<permissionset>
<allowed>5</allowed>
<denied>0</denied>
</permissionset>
</accessentry>
</accesscontrol>
</file> | {
"content_hash": "ecc84380b0a7c74aa907a102ca685d34",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 62,
"avg_line_length": 31.454545454545453,
"alnum_prop": 0.6170520231213873,
"repo_name": "zstd/opencms-thymeleaf",
"id": "bcba80bdc2d8b368c3e797c8864b6a3bda970157",
"size": "692",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/manifest/system/modules.ocmsfolder.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "149"
},
{
"name": "Java",
"bytes": "10094"
}
],
"symlink_target": ""
} |
#include "ruby.h"
#ifdef __human68k__
int _stacksize = 262144;
#endif
#if defined __MINGW32__
int _CRT_glob = 0;
#endif
#if defined(__MACOS__) && defined(__MWERKS__)
#include <console.h>
#endif
/* to link startup code with ObjC support */
#if (defined(__APPLE__) || defined(__NeXT__)) && defined(__MACH__)
static void objcdummyfunction( void ) { objc_msgSend(); }
#endif
int
main(argc, argv, envp)
int argc;
char **argv, **envp;
{
#ifdef _WIN32
NtInitialize(&argc, &argv);
#endif
#if defined(__MACOS__) && defined(__MWERKS__)
argc = ccommand(&argv);
#endif
{
RUBY_INIT_STACK
ruby_init();
ruby_options(argc, argv);
ruby_run();
}
return 0;
}
| {
"content_hash": "9456ad78e39ac805fbb7958da65e5a36",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 66,
"avg_line_length": 17.26829268292683,
"alnum_prop": 0.5889830508474576,
"repo_name": "jtimberman/omnibus",
"id": "bee9a4b15b16ee0bc3e983924cd2d8b6b9959358",
"size": "974",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "source/ruby-enterprise-1.8.7-2011.01/source/main.c",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Xml.Linq;
using System.Dynamic;
namespace DynamicRest {
public sealed class XmlNodeList : DynamicObject, IEnumerable {
private List<XElement> _elements;
internal XmlNodeList(IEnumerable<XElement> elements)
: base() {
_elements = new List<XElement>(elements);
}
public override bool TryConvert(ConvertBinder binder, out object result) {
Type targetType = binder.Type;
if (targetType == typeof(IEnumerable)) {
result = this;
return true;
}
return base.TryConvert(binder, out result);
}
public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result) {
if (indexes.Length == 1) {
XElement element = _elements[Convert.ToInt32(indexes[0])];
result = new XmlNode(element);
return true;
}
return base.TryGetIndex(binder, indexes, out result);
}
public override bool TryGetMember(GetMemberBinder binder, out object result) {
if (String.Compare("Length", binder.Name, StringComparison.Ordinal) == 0) {
result = _elements.Count;
return true;
}
return base.TryGetMember(binder, out result);
}
#region Implementation of IEnumerable
IEnumerator IEnumerable.GetEnumerator() {
return new NodeEnumerator(_elements.GetEnumerator());
}
#endregion
private sealed class NodeEnumerator : IEnumerator {
private IEnumerator<XElement> _elementEnumerator;
public NodeEnumerator(IEnumerator<XElement> elementEnumerator) {
_elementEnumerator = elementEnumerator;
}
public object Current {
get {
XElement element = _elementEnumerator.Current;
return new XmlNode(element);
}
}
public bool MoveNext() {
return _elementEnumerator.MoveNext();
}
public void Reset() {
_elementEnumerator.Reset();
}
}
}
}
| {
"content_hash": "6e42dd999d853a9e53ed3df8c6be3b1e",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 102,
"avg_line_length": 30.17948717948718,
"alnum_prop": 0.5683942225998301,
"repo_name": "nikhilk/dynamicrest",
"id": "c17461f34d5170d61f42d7b6eb3d5a45379dc525",
"size": "2667",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DynamicRest/XmlNodeList.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C#",
"bytes": "70014"
}
],
"symlink_target": ""
} |
require "test_helper"
# Single instance model test.
class InstanceValidationDuplicatesPreventTest < ActiveSupport::TestCase
test "instance prevent duplicate" do
instance = instances(:triodia_in_brassard)
assert instance.valid?, "Starting instance must be valid for this test."
dup = instance.dup
assert_raises(ActiveRecord::RecordInvalid,
"Duplicate instance shouldn't be saved") do
dup.save!
end
end
end
| {
"content_hash": "58fef12d742ae409ab76f05578de732e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 76,
"avg_line_length": 32.42857142857143,
"alnum_prop": 0.7202643171806168,
"repo_name": "bio-org-au/nsl-editor",
"id": "55108a7126b572b8edfc9cab128efe40530ec912",
"size": "1145",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/models/instance/validations/duplicates/prevent_test.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "53964"
},
{
"name": "CoffeeScript",
"bytes": "32497"
},
{
"name": "Dockerfile",
"bytes": "658"
},
{
"name": "HTML",
"bytes": "724160"
},
{
"name": "JavaScript",
"bytes": "82408"
},
{
"name": "PLpgSQL",
"bytes": "181444"
},
{
"name": "Ruby",
"bytes": "2827413"
},
{
"name": "SQLPL",
"bytes": "169"
},
{
"name": "Shell",
"bytes": "1496"
},
{
"name": "TSQL",
"bytes": "16000"
}
],
"symlink_target": ""
} |
/**
* ========================================================
* SmartSelect - A smart jquery multiple select plugin
* ========================================================
*
* @author Hong Zhang <[email protected]>
* @version 1.0.21
*/
/**
* @param {window.jQuery} $
* @param {undefined} undefined
* @returns {undefined}
*/
;(function($, undefined) {
//'use strict';
// PLUGIN NAMING
// ====================================================
// phossa projects prefix
var pluginPrefix = 'pa';
// current project name
var pluginName = 'smartselect';
// event namescope
var eventSuffix = '.' + pluginPrefix + '.' + pluginName;
// plugin fullname
var fullName = pluginPrefix + '.' + pluginName;
// SMARTSELECT PLUGIN
// ====================================================
/**
* @description construct the plugin, and attach to an element (<SELECT>)
* @constructor
* @param {HTMLElement} element
* @param {Object} options
* @returns {SmartSelect}
*/
function SmartSelect(element, options) {
// normally the <SELECT>
this.element = element;
// caching
this.$element = $(element);
// merge user-provided options with default settings
this.options = $.extend(true, {}, this.defaults, options);
// shorthands
this.o = this.options;
this.x = this.options.text;
this.s = this.options.style;
this.e = this.options.event;
this.m = this.options.marker;
this.t = this.options.template;
this.a = this.options.attribute;
// callbacks
this.c = {};
for (var evt in this.callback) {
if (this.callback.hasOwnProperty(evt)) {
this.c[evt] = $.merge([], this.callback[evt]);
if (this.o.callback[evt])
this.addCallback(evt, this.o.callback[evt]);
}
}
// plugin initialization
this._init();
};
SmartSelect.VERSION = '1.0.21';
// SMARTSELECT PROTOTYPE
// ====================================================
SmartSelect.prototype = {
/**
* @description default settings
*/
defaults: {
// ============================
// common settings
// ============================
/**
* @description multiple select, enabled by default
* @type {Boolean}
*/
multiple: true,
/**
* @description set to optimized mode.
* @type {Boolean}
*/
optimized: false,
/**
* @description delayed init to speed up plugin loading
* @type {Boolean}
*/
delayedInit: true,
/**
* @description debug switch, 0 for no debug
* @type {Integer}
*/
debug: 0,
/**
* @description debug level, 2 - 20
* @type {Integer}
*/
debugLevel: 16,
/**
* @description max data-level allowed
* @type {Integer}
*/
maxLevels: 5,
/**
* @description set search timeout
* @type {Boolean}
*/
searchTimeout: false,
/**
* @description alert callback
* @param {String} text
* @returns {undefined}
*/
alert: function(text) {
alert(text);
},
/**
* @description confirm callback
* @param {String} text
* @returns {Boolean}
*/
confirm: function(text) {
return confirm(text);
},
/**
* @description special callback to get option special label
* @param {jQuery} $li
* @param {SmartSelect} self
* @returns {String}
*/
getSpecialLabel: function($li, self) {
return $li.find('input').val();
},
/**
* @description special callback to set option special value
* @param {String} value
* @param {jQuery|undefined} $li
* @param {SmartSelect} self
*/
setSpecialValue: function(value, $li, self) {
var val = value.split(self.o.specialValueSeperator);
if (val[1] !== undefined) {
if ($li === undefined && val[0] !== undefined) {
$li = self._getOptionByValue(val[0]);
}
$li.find('input').val(val[1]);
}
},
/**
* @description special callback to get option special value
* @param {jQuery} $li
* @param {SmartSelect} self
* @returns {String}
*/
getSpecialValue: function($li, self) {
return $li.attr(self.a.dataValue) +
self.o.specialValueSeperator +
$li.find('input').val();
},
/**
* @description close dropdown after a selection
* @type {Boolean}
*/
closeOnSelect: false,
/**
* @description close other smartselect dropdowns
* @type {Boolean}
*/
closeOtherSmartSelect: true,
/**
* @description close smartselect dropdowns if clicked outside
* @type {Boolean}
*/
closeOnClickOutside: false,
/**
* @description default values, array of strings
* @type {Array}
*/
defaultValues: null,
/**
* @description initial selected values, array of strings
* @type {Array}
*/
initialValues: [],
/**
* @description always keep original <SELECT> in sync
* @type {Boolean}
*/
keepInSync: true,
/**
* @description click group to expand this group
* @type {Boolean}
*/
clickGroupOpen: true,
/**
* @description display selected options in button
* @type {Boolean}
*/
showSelectedInLabel: true,
/**
* @description max number of selected option text to display
* @type {Integer}
*/
showSelectedCount: 2,
/**
* @description callback to display selected option text.
* @example
* var showMyLabel = function(labels) {
* var txt = this.o.text.selectLabel + ': ';
* for(var i = 0; i < labels.length; i++) {
* txt += labels[i];
* }
* return txt;
* }
* showMyLabel.call(this, labels);
*
* @type {Function(Array): String}
*/
showSelectedCallback: null,
/**
* @description seperator used in displaying option text
* @type {String}
*/
showSelectedSeperator: ',',
/**
* @description seperator used in get/set special value
* @type {String}
*/
specialValueSeperator: '::',
/**
* @description default view, can be combined with '+'
* @example
*
* 'root': view root level only
* 'view': respect 'data-view'
* 'selected': selected options and its upper levels
* 'expand': expand all levels
* 'level1': expand up to data-level = 1
* 'level2': expand up to data-level = 2
*
* @type {String}
*/
defaultView: 'root+selected+view',
/**
* @description auto click this.$buttonView after ...
* @type {Boolean}
*/
viewAfterCheckAll: true,
viewAfterCancel: true,
viewAfterAlias: true,
/**
* @description force click buttonUnCheck trigger event
* @type {Boolean}
* @since 1.0.21
*/
forceUnCheckTriggerEvent: false,
/**
* @description close after click an alias
* @type {Boolean}
*/
closeAfterAlias: true,
/**
* @descript search by 'label', 'value' or 'both'
* @type {String}
*/
searchBy: 'label',
/**
* @description search case-insensitive or not
* @type {Boolean}
*/
searchCaseInsensitive: true,
/**
* @description number of selected options required
* @type {Integer}
*/
atLeast: 0,
/**
* @description max number of selected options allowed, 0 is no limit
* @type {Integer}
*/
atMost: 0,
/**
* @description must selected options in array of values
* @type {Array}
*/
mustSelect: [],
/**
* @description upper/lower level exclusive or not
* @type {Boolean}
*/
dataLevelInclusive: false,
// ============================
// style class names
// ============================
style: {
// container
container: 'dropdown',
// select button
select: 'dropdown-toggle btn btn-default',
selectIcon: '',
selectLabel: '',
selectCaret: 'caret',
// dropdown style
dropdown: 'dropdown-menu',
// toolbar style
toolbarPos: '',
toolbar: 'btn-group-vertical',
// toolbar button style
button: 'btn btn-default',
// toolbar button with dropdown
buttonGroup: 'btn-group',
buttonToggle: 'btn btn-default dropdown-toggle',
buttonCaret: 'caret',
buttonDropdown: 'dropdown-menu pull-right',
// <li> input style
liInput: 'form-group-sm',
inputBox: 'form-control',
// button icons
buttonView: 'fa fa-fw fa-eye',
buttonUnfold: 'fa fa-fw fa-folder-o',
buttonFoldOpen: 'fa fa-fw fa-folder-open-o',
buttonCancel: 'fa fa-fw fa-undo',
buttonCheckAll: 'fa fa-fw fa-check',
buttonUnCheck: 'fa fa-fw fa-times',
buttonSearch: 'fa fa-fw fa-search',
// folder icons
folderOpen: 'fa fa-folder-open-o',
folderClose: 'fa fa-folder-o',
// divider
divider: 'divider',
// checker style
checker: 'fa fa-fw fa-check-square-o',
checkerNo: 'fa fa-fw fa-square-o',
// dropup style
dropup: 'dropup',
// alias
buttonAlias: 'fa fa-fw fa-star-o',
alias: '',
aliasIcon: 'fa fa-star-o',
aliasCaret: 'fa fa-times'
},
// ============================
// predefined marker names
// ============================
marker: {
// display markers
container: 'smartselect',
label: 'ss-label',
caret: 'ss-caret',
icon: 'ss-icon',
toolbar: 'ss-toolbar',
// divider marker
divider: 'ss-divider',
// hide marker & prefix
hide: 'ss-hide',
// status markers, compatible with bootstrap
open: 'open',
active: 'active',
disabled: 'disabled',
// folder marker
folder: 'ss-folder',
folderOpen: 'ss-open',
folderClose: 'ss-close',
// toolbutton
button: 'ss-button',
// optgroup marker
group: 'ss-group',
noGroup: 'ss-nogrp',
// option marker
option: 'ss-option',
// checker
checker: 'ss-checker',
checkerNo: 'ss-checkno',
// no click bubble up
noBubble: 'ss-nobubble',
// alias line
alias: 'ss-alias'
},
// ============================
// html templates
// ============================
template: {
// container
container: '<div></div>',
// select button
select: '<button type="button"><i class="ss-icon"></i><span class="ss-label"></span><i class="ss-caret"></i></button>',
// dropdown
dropdown: '<ul></ul>',
// toolbar
toolbar: '<li><div role="toolbar"></div></li>',
// tool button
button: '<button type="button"><i class="ss-icon"></i></button>',
// button for toggle
buttonToggle: '<button type="button"><i class="ss-icon"></i><i class="ss-caret"></i></button>',
// button group
buttonGroup: '<div></div>',
// button input box
liInput: '<li><div><input type="text" /></div></li>',
// divider
divider: '<li class="ss-divider"></li>',
// alias
alias: '<li class="ss-alias"><a><i class="ss-icon"></i><i class="ss-caret"></i><span class="ss-label"></span></a></li>',
// folder
folder: '<i class="ss-folder ss-close"></i><i class="ss-folder ss-open"></i>'
},
// ============================
// toolbar & buttons
// ============================
toolbar: {
buttonSearch: true,
buttonAlias: true,
buttonView: 'root+selected',
buttonUnfold: true,
buttonCancel: true,
buttonCheckAll: true,
buttonUnCheck: true
},
// ============================
// event
// ============================
event: {
click: 'click',
buttonClick: 'click',
optionSelect: 'click',
dropdownToggle: 'click'
},
// ============================
// predefined attributes for <OPTION> and <OPTGROUP>
// ============================
attribute: {
dataView: 'data-view',
dataMust: 'data-must',
dataLevel: 'data-level',
dataValue: 'data-value',
dataUpper: 'data-upper',
dataAtMost: 'data-atmost',
dataSpecial: 'data-special',
dataDivider: 'data-divider',
dataAtLeast: 'data-atleast',
dataExclusive: 'data-exclusive',
dataInclusive: 'data-inclusive',
dataLevelInclusive: 'data-level-inc',
dataGroupExclusive: 'data-group-exclusive'
},
// ============================
// text
// ============================
text: {
// default select button text
selectLabel: 'Smart Select',
labelTemplate: '# selected',
disabled: 'Disabled',
// button title
buttonSearch: 'search options',
buttonAlias: 'option aliases',
buttonView: 'view only selected',
buttonUnfold: 'expanded view',
buttonCancel: 'cancel selected options',
buttonCheckAll: 'select all',
buttonUnCheck: 'deselect all',
// placeholder
aliasPlaceholder: 'Save as alias',
searchPlaceholder: 'Search ...',
// error messages
groupExcludeError: '"data-atleast" can not use with "data-group-exclusive"',
callbackError: 'unknown callback ',
valueSetError: 'set value error ',
invalidOptionError: 'invalid option',
badArgumentError: 'bad argument ',
emptyValuesError: 'no option selected',
aliasDupError: 'alias duplicated',
duplicationError: 'duplicated option found'
},
// ============================
// status change event handlers
// ============================
handler: {},
// ============================
// user-defined callbacks
// ============================
callback: {},
/**
* @description data, instead of extracting from <SELECT>
* @type {Array}
*/
data: [],
/**
* @description predefined aliases
* @type {Object}
*/
aliases: {}
},
/**
* @description internal callbacks
* @type {Object}
*/
callback: {
onPluginLoad: [
// resolve conflict options
'_fixPluginOptions',
// hide original <SELECT>
'_hideOriginalSelect'
],
onPluginLoaded:[
// set default values first
'_setDefaultValues',
// verify empty logic
'_fixEmptyLogic',
// sync to <SELECT>
'_flushSelect',
// update display label
'_setSelectLabel',
// set lable to alias name if matches
'_matchAliasName',
// force sync select
'_syncSelect',
// disabled initially ?
// added 1.0.21
'_disabledSelect'
],
onDropdownShow: [
// apply delayed init for first time
'_delayedInit'
],
onDropdownShown: [
// save old values for buttonCancel
'_saveOldValues',
// update folder icons
'_updateIcons'
],
onDropdownHide: [],
onDropdownHidden: [
// force sync to <SELECT> on dropdown hidden
'_syncSelect'
],
onOptionChange: [],
onOptionChanged: [
// flush to <SELECT> (not forced)
'_flushSelect',
// update display label
'_setSelectLabel',
// set lable to alias name if matches
'_matchAliasName',
// closeOnSelect in single select case
'_closeOnSelect'
],
onOptionDisable: [],
onOptionDisabled: [
'_fixEmptyLogic'
],
onOptionSelect: [
// check atMost
'_atMost'
],
onOptionSelected: [
// verify select logic
'_fixSelectLogic'
],
onOptionDeselect: [
// verify unselect/empty logic
'_fixEmptyLogic'
],
onOptionDeselected: []
},
// ============================
// public methods
// ============================
/**
* @description select options base on values, clear all first,
* @param {Array} values array of strings
* @param {Boolean} clear set to FALSE to disable clearing
* @returns {Object} this
* @public
*/
selectOptions: function(values, clear) {
this._debug('selectOptions');
// whole plugin disbled ?
if (this.isDisabled()) return this;
if (this._triggerEvent('onOptionChange')) {
// uncheck everything
if (clear !== false) this._clearValues();
// set values
this._setValues(values);
// fix logic for possible missings
if (clear !== false) this._fixEmptyLogic();
this._triggerEvent('onOptionChanged');
}
return this;
},
/**
* @description deselect options base on values
* @param {Array} values
* @returns {Object} this
* @public
*/
deselectOptions: function(values) {
this._debug('deselectOptions');
// whole plugin disbled ?
if (this.isDisabled()) return this;
if (this._triggerEvent('onOptionChange')) {
// unset values
this._unSetValues(values);
this._triggerEvent('onOptionChanged');
}
return this;
},
/**
* @description get selected values in array
* @returns {Array}
* @public
*/
getValues: function() {
this._debug('getValues');
// whole plugin disbled ?
if (this.isDisabled()) return [];
var result = this.getSelectedPairs();
return result.value;
},
/**
* @description is whole select disabled ?
* @returns {Boolean}
* @public
*/
isDisabled: function() {
return this.$select.hasClass(this.m.disabled);
},
/**
* @description disable the plugin
* @returns {Object} this
* @public
*/
disableSelect: function() {
this._debug('disableSelect');
if (this.isDisabled()) return this;
// force close dropdown
this.closeDropdown();
// disable select
this.$select.addClass(this.m.disabled);
// update label with a disabled notice
this._setSelectLabel(this.x.disabled);
// added 1.0.21, sync with <SELECT>
if (this._isSelect) {
this.$element.prop('disabled', true);
}
return this;
},
/**
* @description enable the plugin
* @returns {Object} this
* @public
*/
enableSelect: function() {
this._debug('enableSelect');
if (this.isDisabled()) {
this.$select.removeClass(this.m.disabled);
this._triggerEvent('onOptionChanged');
// added 1.0.21, sync with <SELECT>
if (this._isSelect) {
this.$element.prop('disabled', false);
}
}
return this;
},
/**
* @description disable options base on given values
* @param {Array} values
* @returns {Object} this
* @public
*/
disableOptions: function(values) {
this._debug('disableOptions');
if (this.isDisabled()) return this;
var $todo = $();
if (values) {
for (var i in values) {
var $li = this._getOptionByValue(values[i]);
if (!$li.hasClass(this.m.disabled)) {
$todo = $todo.add($li);
}
}
} else {
$todo = this.$dropdown
.find('.' + this.m.option).not('.' + this.m.disabled);
}
var self = this;
$todo.each(function() {
var $li = $(this);
$li.addClass(self.m.disabled);
self._triggerEvent('onOptionDisabled', $li);
});
this._triggerEvent('onOptionChanged');
return this;
},
/**
* @descriptoin enable options base on given values
* @param {Array} values
* @returns {Object} this
* @public
*/
enableOptions: function(values) {
this._debug('enableOptions');
if (this.isDisabled()) return this;
// enable
var $disabled = $();
if (values) {
for (var i in values) {
var $li = this._getOptionByValue(values[i]);
if ($li.hasClass(this.m.disabled)) {
$disabled = $disabled.add($li);
}
}
} else {
$disabled = this.$dropdown
.find('.' + this.m.disabled + '.' + this.m.option);
}
// enable those
var self = this;
$disabled.each(function() {
var $li = $(this);
$li.removeClass(self.m.disabled);
self._triggerEvent('onOptionEnabled', $li);
});
this._triggerEvent('onOptionChanged');
return this;
},
/**
* @description add an option to the plugin
* @example
* var info = {
* label: 'text',
* value: 'x',
* }
*
* @param {Object} info
* @param {ValueString,HTHMLElement,jQuery} after
* @param {ValueString,HTHMLElement,jQuery} parent
* @returns {Object} this
* @public
*/
addOption: function(info, after, parent) {
this._debug('addOption');
var self = this;
// check duplcates
var $opt = this._getOptionByValue(info.value);
if ($opt.length) {
// trigger a status event
$opt.trigger('optionDuplicated' + eventSuffix);
return this;
}
// tmp variables
var $s, $g, uids = [];
// parent provided (option or group)
if (parent) {
var $p = this._getOptionByValue(parent);
// parent is a group
if ($p.hasClass(this.m.group)) {
$g = $p;
info.level = 1;
// parent is an option
} else {
$g = this._getGroup($p);
this._getUpperLevels($p, function($x) {
var level = parseInt($x.attr(self.a.dataLevel));
uids[level] = $x.attr('id');
});
info.level = parseInt($p.attr(self.a.dataLevel)) + 1;
// add folder to the parent
if ($p.find('.' + this.m.folder).length === 0) {
$p.children('a').append(this.t.folder);
$p.find('.' + this.m.folder + '.' + this.m.folderOpen)
.addClass(this.s.folderOpen);
$p.find('.' + this.m.folder + '.' + this.m.folderClose)
.addClass(this.s.folderClose);
}
}
// do have a group
if ($g.length) {
uids[0] = $g.attr('id');
info.ingroup = true;
}
// find <LI> to insert after
$s = this.$dropdown.find('.' + $p.attr('id')).last();
if ($s.length === 0) $s = $p;
// after an option
} else if (after) {
$s = this._getOptionByValue(after);
$g = this._getGroup($s);
this._getUpperLevels($s, function($x) {
var level = parseInt($x.attr(self.a.dataLevel));
uids[level] = $x.attr('id');
}, false);
if ($g.length) {
uids[0] = $g.attr('id');
info.ingroup = true;
}
info.level = parseInt($s.attr(self.a.dataLevel));
// if $s has sublevels, add after subs
if (this.$dropdown.find('.' + $s.attr('id')).length) {
$s = this.$dropdown.find('.' + $s.attr('id')).last();
}
// insert to the root of this.$dropdown (end)
} else {
info.level = 1;
}
// default no group
if (info.ingroup === undefined) info.ingroup = false;
// build html
var oid = this._getOid();
var html = this._buildOptionHtml(info, oid, uids);
// find position to insert
$s ? $s.after(html) : this.$dropdown.append(html);
// insert to data mapping
var mapping = this.$dropdown.data('mapping');
mapping[info.value] = oid;
this.$dropdown.data('mapping', mapping);
// trigger a status event
this._getOptionByValue(info.value).trigger('optionAdded' + eventSuffix);
// adjust viewing
if (this.$dropdown.is(':visible')) {
this._expandAllLevels();
this._updateIcons();
}
return this;
},
/**
* @description remove an option
* @param {ValueString} value
* @returns {Object} this
* @public
*/
removeOption: function(value) {
this._debug('removeOption');
var $opt = this._getOptionByValue(value);
if ($opt.length) {
// delete html
$opt.remove();
// update mapping
var mapping = this.$dropdown.data('mapping');
delete mapping[value];
this.$dropdown.data('mapping', mapping);
// trigger a status event
this.$element.trigger('optionRemoved' + eventSuffix);
// changed
this._triggerEvent('onOptionChanged');
this._updateIcons();
}
return this;
},
/**
* @description get group object base on the given name to match
* @param {String|jQuery} name name to match or a jquery
* @returns {jQuery}
* @public
*/
getGroup: function(name) {
this._debug('getGroup');
if (name.jquery) return name;
var $gp = $();
var self = this;
this.$dropdown.find('.' + this.m.group)
.each(function() {
var label = $(this).find('.' + self.m.label).text();
if (label.indexOf(name) > -1) {
$gp = $(this);
return false;
}
});
return $gp;
},
/**
* @description get selected value/label in object
* @returns {Object}
* @public
*/
getSelectedPairs: function() {
this._debug('getSelectedPairs');
if (this.isDisabled()) return undefined;
var result = { value: [], label: {}, text: [] };
var self = this;
this._getSelectedOptions().each(function() {
var $jq = $(this);
var val = self._getOptionValue($jq);
var txt = self._getOptionLabel($jq);
result.label[val] = txt;
result.value[result.value.length] = val;
result.text[result.text.length] = txt;
});
return result;
},
/**
* @description open dropdown
* @returns {Object} this
* @public
*/
openDropdown: function() {
return this.toggleDropdown(false);
},
/**
* @description close dropdown
* @returns {Object} this
* @public
*/
closeDropdown: function() {
return this.toggleDropdown(true);
},
/**
* @description toggle dropdown
* @param {Boolean} hideDropdown TRUE force hide, FALSE force open
* @returns {Object} this
* @public
*/
toggleDropdown: function(hideDropdown) {
this._debug('toggleDropdown');
if (this.isDisabled()) return this;
var hide = this.$container.hasClass(this.m.open) ? true : false;
if (hideDropdown === false) hide = false;
if (hideDropdown === true) hide = true;
// hide
if (hide) {
if (this._triggerEvent('onDropdownHide', this.$container)) {
this.$container.removeClass(this.m.open);
this._triggerEvent('onDropdownHidden', this.$container);
}
// show
} else {
if (this._triggerEvent('onDropdownShow', this.$container)) {
if (this.o.closeOtherSmartSelect) {
$('.' + this.m.container)
.filter('.' + this.m.open)
.not(this.$container)
.each(function() {
var elem = $(this).data(fullName);
$(elem).data(fullName).closeDropdown();
});
}
this.$container.addClass(this.m.open);
this._triggerEvent('onDropdownShown', this.$container);
}
}
return this;
},
/**
* @description expand this option
* @param {ValueString,HTHMLElement,jQuery} li
* @returns {Object} this
* @public
*/
unfoldOption: function(li) {
this._getOptionByValue(li).find('.' + this.m.folderClose).trigger('click');
},
/**
* @description select or deselect an option
* @param {ValueString,HTHMLElement,jQuery} li
* @param {Boolean} triggerChange set FALSE to disable
* @param {Boolean} setOption TRUE force select, FALSE force deselect
* @returns {Object} this
* @public
*/
toggleOption: function(li, triggerChange, setOption) {
this._debug('toggleOption');
if (this.isDisabled()) return this;
// select by value
var $li = li.jquery ? li : this._getOptionByValue(li);
if ($li.length === 0) {
throw new Error(this.x.invalidOptionError);
return this;
}
// trigger 'onOptionChanged' or not
var trigger = triggerChange === false ? false : true;
// disabled?
if ($li.hasClass(this.m.disabled)) return this;
// before change
if (trigger && !this._triggerEvent('onOptionChange', $li))
return this;
var active = $li.hasClass(this.m.active);
// unselect
if (setOption === false || active) {
this._deselectOption(li);
}
// select
if (setOption === true || !active) {
this._selectOption(li);
}
// after change
if (trigger && !this._triggerEvent('onOptionChanged', $li))
return this;
return this;
},
/**
* @descript add a callback for procedural event callbacks
* @param {EventString} event short event name
* @param {Callback,Array} callback or array of callbacks
* @returns {Object} this
* @public
*/
addCallback: function(event, callback) {
this._debug('addCallback');
if (this.c[event]) {
if ($.isArray(callback)) {
$.merge(this.c[event], callback);
} else {
this.c[event].push(callback);
}
} else {
this.o.alert(this.x.callbackError + event);
}
return this;
},
/**
* @description force select an option
* @param {ValueString,HTHMLElement,jQuery} li
* @param {Boolean} triggerChange FALSE to disable
* @returns {Object} this
* @public
*/
selectOption: function(li, triggerChange) {
this._debug('selectOption');
// force select
return this.toggleOption(li, triggerChange, true);
},
/**
* @description force select an option
* @param {ValueString,HTHMLElement,jQuery} li
* @param {Boolean} triggerChange FALSE to disable
* @returns {Object} this
* @public
*/
deselectOption: function(li, triggerChange) {
this._debug('deselectOption');
// force deselect
return this.toggleOption(li, triggerChange, false);
},
/**
* @description select all options
* @returns {Object} this
* @public
*/
selectAllOptions: function() {
this._debug('selectAllOptions');
if (this.isDisabled()) return this;
// always clear value first
this._clearValues();
// get all non-disabled groups
var $groups = this._getGroup().not('.' + this.m.disabled);
// select in group
var self = this;
$groups.each(function() {
var $grp = $(this);
self.selectGroupOptions($grp, false);
});
// select all options in root
self.selectGroupOptions();
return this;
},
/**
* @description deselect all options
* @param {Boolean} forceTriggerEvent TRUE to force trigger event
* @returns {Object} this
* @public
*/
deselectAllOptions: function(forceTriggerEvent) {
this._debug('deselectAllOptions');
if (this.isDisabled()) return this;
/* added 1.0.20 */
if (forceTriggerEvent === true) {
this.deselectOptions(this.getValues());
} else {
this.$dropdown
.find('.' + this.m.active + '.' + this.m.option)
.not('.' + this.m.disabled)
.removeClass(this.m.active);
}
// fire callbacks without trigger event
this._fireCallbacks('onPluginLoaded', this.$element);
return this;
},
/**
* @description select all options in a group
* @param {String,jQuery} $group undefined means root level
* @param {Boolean} triggerChange FALSE to disable
* @returns {Object} this
* @public
*/
selectGroupOptions: function($group, triggerChange) {
this._debug('selectGroupOptions');
if (this.isDisabled()) return this;
var inc = this._isLevelInclusive($group);
if ($group) {
$group = this.getGroup($group);
var gid = $group.attr('id');
var $opts = this.$dropdown
.find('.' + gid + '.' + this.m.option +
(inc ? '' : '.' + this.a.dataLevel + '-1'))
.not('.' + this.m.disabled) // ignore disabled options
.not('.' + this.a.dataSpecial); // ignore special options
} else {
var $opts = this.$dropdown
.find('.' + this.m.noGroup + '.' + this.m.option +
(inc ? '' : '.' + this.a.dataLevel + '-1'))
.not('.' + this.m.disabled)
.not('.' + this.a.dataSpecial);
}
if (this._isGroupMultiple($group) && !this._isAtMost()) {
// test first one (might conflit with other groups etc.)
this._selectOption($opts.first());
// select the rest
this._quickSelectOptions($opts, triggerChange);
} else {
return this._selectMatchedOptions($opts, true, true, triggerChange);
}
},
/**
* @description deselect all options in one group
* @param {String,jQuery} $group undefined means root level
* @param {Boolean} triggerChange FALSE to disable
* @returns {Object} this
* @public
*/
deselectGroupOptions: function($group, triggerChange) {
this._debug('deselectGroupOptions');
if (this.isDisabled()) return this;
if ($group) {
$group = this.getGroup($group);
var gid = $group.attr('id');
var $opts = this.$dropdown
.find('.' + this.m.active + '.' + gid)
.filter('.' + this.m.option)
.not('.' + this.m.disabled);
} else {
var $opts = this.$dropdown
.find('.' + this.m.active + '.' + this.m.option)
.filter('.' + this.m.noGroup)
.not('.' + this.m.disabled);
}
if ($opts.length === 0) return this;
if (this._isGroupMultiple($group)) {
// deselect all active
this._quickSelectOptions($opts, triggerChange, false);
} else {
// deselct those matched
this._selectMatchedOptions($opts, false, true, triggerChange);
}
return this;
},
/**
* @description set alias 'name' with 'value'
* @param {String,Object} name or object
* @param {Array} value array of value strings
* @param {Boolean} syncLabel FALSE to disable sync label
* @param {Boolean} syncAlias FALSE to disable sync alias
* @returns {Object} this
* @public
*/
addAlias: function(name, value, syncLabel, syncAlias) {
this._debug('addAlias');
if (this.isDisabled()) return this;
// add single alias
if (typeof name === 'string') {
if (!$.isArray(value)) value = [ value ];
// remove duplication
for (var n in this.o.aliases) {
// remove same values
if (this._arrayEqual(this.o.aliases[n], value)) {
if (this.o.confirm(this.x.aliasDupError)) {
this.removeAlias(n, false, false);
} else {
return this;
}
}
// remove same name
if (n === name) {
if (this.o.confirm(this.x.aliasDupError)) {
this.removeAlias(n, false, false);
} else {
return this;
}
}
}
this.o.aliases[name] = value;
// add multiple aliases
} else {
for (var n in name) {
this.addAlias(n, name[n], false, false);
}
this._matchAliasName();
return this;
}
// update button label with alias name if matches
if (syncLabel !== false) this._matchAliasName();
// add alias line
this._addAliasLine(name);
// trigger a status change event
if (syncAlias !== false) {
this.$element.trigger('aliasChange' + eventSuffix);
}
return this;
},
/**
* @description remove alias 'name'
* @param {String,Array} name
* @param {Boolean} syncLabel FALSE to disable sync label
* @param {Boolean} syncAlias FALSE to disable sync alias
* @returns {Object} this
* @public
*/
removeAlias: function(name, syncLabel, syncAlias) {
this._debug('removeAlias');
if (this.isDisabled()) return this;
// remove a single alias
if (typeof name === 'string') {
delete this.o.aliases[name];
// remove array of aliases
} else if ($.isArray(name)) {
for (var i in name) {
this.removeAlias(name[i], false, false);
}
this._setSelectLabel();
this._matchAliasName();
this.$element.trigger('aliasChange' + eventSuffix);
return this;
}
// update button label with alias name if matches
if (syncLabel !== false) {
this._setSelectLabel();
this._matchAliasName();
}
// remove the alias in this.$buttonAlias
if (this.$buttonAlias) {
var self = this;
this.$buttonAlias.find('.' + this.m.label)
.each(function() {
if ($(this).text() === name) {
$(this).closest('.' + self.m.alias).remove();
}
});
}
// trigger a status change event
if (syncAlias !== false) {
this.$element.trigger('aliasChange' + eventSuffix);
}
return this;
},
/**
* @description click on alias 'name'
* @param {String} name
* @returns {Object} this
* @public
*/
selectAlias: function(name) {
this.$buttonAlias.find('.' + this.m.label)
.each(function() {
if ($(this).text() === name) {
$(this).click();
return false;
}
});
return this;
},
/**
* @description force sync plugin with original <SELECT>
* @returns {Object} this
* @public
*/
syncSelect: function() {
this._debug('syncSelect');
this._syncSelect();
return this;
},
// ============================
// private methods
// ============================
/**
* @description plugin initialization
* @private
*/
_init: function() {
this._debug('_init');
// before plugin load
if (this._triggerEvent('onPluginLoad')) {
// get data
var data = [];
if (this._isSelect) {
this._extractSelectData(data);
} else {
data = this.o.data;
}
this._buildPlugin(data);
// after plugin loaded
this._triggerEvent('onPluginLoaded');
}
},
/**
* @description show debug messages in console
* @param {String} str
* @param {Integer} level
* @private
*/
_debug: function(str, level) {
var start = 2;
try {
if (level === undefined) {
level = 0;
var func = arguments.callee.caller;
while (func) {
if (++level > 20) break;
func = func.caller;
}
}
} catch (e) {
level = 2;
}
if (this.o.debug && level <= this.o.debugLevel) {
console.log(this._stringRepeat(' ', level - start) +
level + ' ' + str + ' ' + ++this.o.debug
);
}
},
/**
* @description select the option, no sync to <SELECT>
* @param {ValueString,HTHMLElement,jQuery} li
* @param {Boolean} triggerEvent FALSE to disable
* @returns {Boolean}
* @private
*/
_selectOption: function(li, triggerEvent) {
this._debug('_selectOption');
// special value case ?
if (typeof li === 'string' &&
li.indexOf(this.o.specialValueSeperator) > -1) {
var setValue = li;
}
// select by value
var $li = li.jquery ? li : this._getOptionByValue(li);
if ($li.length === 0) return false;
// set special value
if (setValue) {
this.o.setSpecialValue(setValue, $li, this);
}
// trigger 'onOptionSelected' or not
var trigger = triggerEvent === false ? false : true;
// selected already ?
if ($li.hasClass(this.m.active)) return true;
// disabled?
if ($li.hasClass(this.m.disabled)) return false;
// trigger event
if (trigger && !this._triggerEvent('onOptionSelect', $li))
return false;
// update status
$li.addClass(this.m.active);
// trigger event
if (trigger && !this._triggerEvent('onOptionSelected', $li))
return false;
return true;
},
/**
* @description deselect the option, no sync to <SELECT>
* @param {ValueString,HTHMLElement,jQuery} li
* @param {Boolean} triggerEvent FALSE to disable
* @returns {Boolean}
* @private
*/
_deselectOption: function(li, triggerEvent) {
this._debug('_deselectOption');
// unselect by value
var $li = li.jquery ? li : this._getOptionByValue(li);
if ($li.length === 0) return false;
// trigger 'onOptionDeselect' or not
var trigger = triggerEvent === false ? false : true;
// unselected already ?
if (!$li.hasClass(this.m.active)) return true;
// disabled?
if ($li.hasClass(this.m.disabled)) return false;
// trigger event
if (trigger && !this._triggerEvent('onOptionDeselect', $li))
return false;
// update status
$li.removeClass(this.m.active);
// trigger event
if (trigger && !this._triggerEvent('onOptionDeselected', $li))
return false;
return true;
},
/**
* @description trigger a procedural event and fire predefined callbacks
* @param {EventString} event short event name
* @param {jQuery} $target if undefined, use this.$element
* @returns {Boolean}
* @private
*/
_triggerEvent: function(event, $target) {
this._debug('EVENT ' + event);
var $tg = $target ? $target : this.$element;
// wakeup event listeners
$tg.trigger(event + eventSuffix);
// fire callbacks
return this._fireCallbacks(event, $tg);
},
/**
* @description fireup callbacks
* @param {EventString} event short event name
* @param {jQuery} $tg event target
* @returns {Boolean}
* @private
*/
_fireCallbacks: function(event, $tg) {
var cb = this.c[event];
var res = true;
for (var i in cb) {
if (typeof cb[i] === 'string') {
res = this[cb[i]].call(this, $tg, event);
} else {
res = cb[i].call(this, $tg, event);
}
if (res === false) return false;
}
return true;
},
/**
* @description toggle folder icon display
* @param {jQuery} $li
* @private
*/
_toggleFolder: function($li) {
this._debug('_toggleFolder');
var self = this;
$li.each(function(i, element) {
var $jq = $(element);
var $subs = self.$dropdown.find('.' + $jq.attr('id'));
var level = $jq.hasClass(self.m.group) ?
1 : parseInt($jq.attr(self.a.dataLevel)) + 1;
// collapse
if ($jq.hasClass(self.m.open)) {
$jq.removeClass(self.m.open);
$subs.addClass(self.m.hide + '-' + level);
// expand
} else {
$jq.addClass(self.m.open);
$subs.removeClass(self.m.hide + '-' + level);
}
});
},
/**
* @description get option by its value or other ids
* @param {ValueString,HTHMLElement,jQuery} val
* @returns {jQuery}
* @private
*/
_getOptionByValue: function(val) {
this._debug('_getOptionByValue');
// DOM
if (val.nodeName !== undefined) return $(val);
// jquery
if (val.jquery) return val;
// value
val = val.toString();
// special value case
if (val.indexOf(this.o.specialValueSeperator) > -1) {
val = val.split(this.o.specialValueSeperator)[0];
}
var data = this.$dropdown.data('mapping');
if (data[val]) return $('#' + data[val]);
return $();
},
/**
* @description get the group for $li OR all groups if undefined
* @param {jQuery} $li
* @returns {jQuery}
* @private
*/
_getGroup: function($li) {
this._debug('_getGroup');
var $grp = $();
var $groups = this.$dropdown.find('.' + this.m.group);
if ($li) {
$groups.each(function() {
var $jq = $(this);
var gid = $jq.attr('id');
if ($li.hasClass(gid)) {
$grp = $jq;
return false;
}
});
return $grp;
} else {
return $groups;
}
},
/**
* @description select matched options
* @param {jQuery} $jq
* @param {Boolean} select FALSE to deselect
* @param {Boolean} triggerEvent FALSE to disable trigger
* @param {Boolean} triggerChange FALSE to disable trigger
* @returns {Object} this
* @private
*/
_selectMatchedOptions: function(
$jq, select, triggerEvent, triggerChange
) {
this._debug('_selectMatchedOptions');
// trigger 'opOptionChange'
var trigger = triggerChange === false ? false : true;
if (trigger && !this._triggerEvent('onOptionChange')) return this;
var self = this;
$jq.each(function() {
var $ob = $(this);
if (select === false) {
self._deselectOption($ob, triggerEvent);
} else {
self._selectOption($ob, triggerEvent);
}
});
if (trigger) this._triggerEvent('onOptionChanged');
return this;
},
/**
* @description just mark selected/deselected, no logic verified
* @param {jQuery} $jq
* @param {Boolean} triggerChange
* @param {Boolean} select
* @returns {Object} this
* @private
*/
_quickSelectOptions: function($jq, triggerChange, select) {
this._debug('_quickSelectOptions');
var trigger = triggerChange === false ? false : true;
if (trigger && !this._triggerEvent('onOptionChange')) return this;
if (select === false) {
$jq.removeClass(this.m.active);
} else {
$jq.addClass(this.m.active);
}
if (trigger) this._triggerEvent('onOptionChanged');
return this;
},
/**
* @description update button label with alias name if matches
* @returns {Boolean}
* @private
*/
_matchAliasName: function() {
this._debug('_matchAliasName');
if (this.o.showSelectedInLabel) {
var v = this.getSelectedPairs().value;
var a = this.o.aliases;
if (v.length) {
for (var n in a) {
this._toString(a[n]);
if (a.hasOwnProperty(n) &&
this._arrayEqual(v, a[n])
){
this.$select
.find('.' + this.m.label)
.html(n);
break;
}
}
}
}
return true;
},
/**
* @description add current selections as one alias
* @param {String} name
* @returns {undefined}
* @private
* @TODO
*/
_addAliasLine: function(name) {
if (this.$buttonAlias) {
this._debug('_addAliasLine');
var self = this;
var $ul = this.$buttonAlias.find('ul');
var $li = $(this.t.alias).appendTo($ul);
$li.find('.' + this.m.label).addClass(this.s.alias).text(name);
$li.find('.' + this.m.icon).addClass(this.s.aliasIcon);
$li.find('.' + this.m.caret).addClass(this.s.aliasCaret);
$ul.find('.' + this.m.alias).off()
.on ( // click on alias
this.e.click,
'.' + this.m.label,
function(e) {
var n = $(e.target).closest('.' + self.m.alias)
.find('.' + self.m.label).text();
// set value
if (self.o.aliases[n].length > 30 && self.o.optimized) {
self._quickSelectValues(self.o.aliases[n]);
} else {
self.selectOptions(self.o.aliases[n]);
}
// stop bubbling
e.stopPropagation();
e.preventDefault();
// close alias button self
self.$buttonAlias.removeClass(self.m.open);
// view status
if (self.o.viewAfterAlias &&
self.$buttonView) {
self.$buttonView.trigger('click');
}
// dropdrown status
if (self.o.closeAfterAlias) {
self.$select.trigger('click');
}
}
)
.on( // delete alias
this.e.click,
'.' + this.m.caret,
function(e) {
var n = $(e.target).closest('.' + self.m.alias)
.find('.' + self.m.label).text();
self.removeAlias(n);
e.stopPropagation();
e.preventDefault();
}
);
}
},
/**
* @description update all the folder icons inside dropdown
* @returns {Object} this
* @private
* @TODO
*/
_updateIcons: function() {
this._debug('_updateIcons');
// update visible folder icons
this.$dropdown.find('.' + this.m.folder).filter(':visible')
.each($.proxy(function(i, element) {
var $jq = $(element);
var $li = $jq.closest('li');
var id = $li.attr('id');
var lev = parseInt($li.attr(this.a.dataLevel)) + 1;
var $sub= this.$dropdown
.find('.' + id + '.' + this.a.dataLevel + '-' + lev);
if ($sub.filter(':hidden').length) {
$li.removeClass(this.m.open);
} else if ($sub.length) {
$li.addClass(this.m.open);
} else {
$li.find('.' + this.m.folder).remove();
}
}, this));
// update toolbar folder icon
if (this.$buttonUnfold) {
if (this.$dropdown.find('.' + this.m.option)
.not('.' + this.m.disabled).filter(':hidden').length) {
this.$buttonUnfold.find('.' + this.m.icon)
.removeClass(this.s.buttonFoldOpen)
.addClass(this.s.buttonUnfold);
} else {
this.$buttonUnfold.find('.' + this.m.icon)
.removeClass(this.s.buttonUnfold)
.addClass(this.s.buttonFoldOpen);
}
}
return this;
},
/**
* @description extract data from the original <SELECT>
* @param {Array} data
* @param {jQuery} $element
* @returns {Array}
* @private
*/
_extractSelectData: function(data, $element) {
var a = this.a;
var self = this;
// extract <SELECT>
if ($element === undefined) {
this._debug('_extractSelectData');
// atLeast
var atLeast = this.$element.attr(a.dataAtLeast);
if (atLeast !== undefined) {
this.o.atLeast = parseInt(atLeast);
}
// atMost
var atMost = this.$element.attr(a.dataAtMost);
if (atMost !== undefined) {
this.o.atMost = parseInt(atMost);
}
// is this <SELECT> disabled initially ?
// added 1.0.21
if (this.$element.attr('disabled') !== undefined) {
this.o.disabled = true;
}
}
// extract <OPTION>, <OPTGROUP>
($element ? $element : this.$element)
.children()
.each(function(i, node){
var $node = $(node), row = {};
if (node.nodeName === 'OPTION') {
// it is a divider
if ($node.attr(a.dataDivider) !== undefined) {
row[a.dataDivider] = true;
data[data.length] = row;
return true;
}
// normal option
row.value = $node.val();
row.label = $node.text();
row.ingroup = $element !== undefined;
// added 1.0.21
// parse disable attr in orig <SELECT>
if ($node.attr('disabled') !== undefined) {
row.disabled = true;
}
if ($node.attr('selected') !== undefined) {
var len = self.o.initialValues.length;
if (!self._isMultiple && len) {
// single select
// ignore selected if initialValues set already
} else {
self.o.initialValues[len] = row.value;
}
}
// level default to 1
row.level = parseInt($node.attr(a.dataLevel) ?
$node.attr(a.dataLevel) : 1);
// data-view
var view = $node.attr(a.dataView);
if (view !== undefined) {
row[a.dataView] = row.level + (view.length ? parseInt(view) : 1);
}
// data-must
if ($node.attr(a.dataMust) !== undefined) {
row[a.dataMust] = true;
}
// data-inclusive
var inc = $node.attr(a.dataInclusive);
if (inc !== undefined) row[a.dataInclusive] = inc.length ? inc : '_';
data[data.length] = row;
} else {
row.group = true;
row.label = $node.attr('label');
// data-group-exclusive
var exc = $node.attr(a.dataGroupExclusive);
if (exc !== undefined) {
row[a.dataGroupExclusive] = exc.length ? exc : '_';
}
// data-exclusive
if ($node.attr(a.dataExclusive) !== undefined || !self._isMultiple) {
row[a.dataExclusive] = true;
}
// data-level-inclusive
if ($node.attr(a.dataLevelInclusive) !== undefined) {
row[a.dataLevelInclusive] = true;
}
// data-atleast
if ($node.attr(a.dataAtLeast) !== undefined) {
if (row[a.dataGroupExclusive]) {
this.o.alert(self.o.text.groupExcludeError);
} else {
var l = $node.attr(a.dataAtLeast);
row[a.dataAtLeast] = l.length ? parseInt(l) : 1;
}
}
// data-atmost
if ($node.attr(a.dataAtMost) !== undefined) {
row[a.dataAtMost] = parseInt($node.attr(a.dataAtMost));
}
// data-view
var view = $node.attr(a.dataView);
if (view !== undefined) {
row[a.dataView] = view.length ? parseInt(view) : 1;
}
data[data.length] = row;
self._extractSelectData(data, $node);
}
});
},
/**
* @description build the plugin html
* @param {Array} data
* @returns {Object} this
* @private
*/
_buildPlugin: function(data) {
this._debug('_buildPlugin');
this._buildContainer()
._buildSelect()
._buildDropdown()
._buildOption(data);
// delayed init ?
if (this.o.delayedInit) {
this._delayed = false;
} else {
this._delayedInit();
}
return this;
},
/**
* @description build the plugin container
* @returns {Object} this
* @private
*/
_buildContainer: function() {
this._debug('_buildContainer');
this.$container = $(this.t.container)
.addClass(this.m.container + ' ' + this.s.container)
.insertAfter(this.$element)
.data(fullName, this.element);
return this;
},
/**
* @description build select button
* @returns {Object} this
* @private
*/
_buildSelect: function() {
this._debug('_buildSelect');
this.$select = $(this.t.select)
.addClass(this.s.select)
.appendTo(this.$container);
this.$select.find('.' + this.m.icon)
.addClass(this.s.selectIcon);
this.$select.find('.' + this.m.label)
.addClass(this.s.selectLabel)
.html(this.x.selectLabel);
this.$select.find('.' + this.m.caret)
.addClass(this.s.selectCaret);
return this;
},
/**
* @description build the dropdown
* @returns {Object} this
* @private
*/
_buildDropdown: function() {
this._debug('_buildDropdown');
// prepare unique id
this._theId = this._uniqueId();
this.$dropdown = $(this.t.dropdown)
.addClass(this.s.dropdown)
.appendTo(this.$container)
.attr('id', this._theId);
// dropdown toggle
this.$select.off().not('.' + this.m.disabled)
.on(
this.e.click,
$.proxy(function(e) {
this.toggleDropdown();
}, this)
);
return this;
},
/**
* @description build the toolbar
* @returns {Object} this
* @private
*/
_buildToolbar: function() {
this._debug('_buildToolbar');
var t = this.o.toolbar;
if (t) {
// toolbar
this.$toolbar = $(this.t.toolbar)
.addClass(this.m.toolbar)
.addClass(this.s.toolbarPos)
.prependTo(this.$dropdown)
.children()
.addClass(this.s.toolbar);
// add buttons
for (var btn in t) {
if (t.hasOwnProperty(btn) && t[btn] && this['_' + btn]) {
this['_' + btn]();
}
}
}
return this;
},
/**
* @description create a new button
* @param {ClassString} iconClass
* @param {Boolean} toggle is it a dropdown button
* @returns {jQuery}
* @private
*/
_buildToolbtn: function(iconClass, toggle) {
var $btn;
if (toggle) {
$btn = $(this.t.buttonToggle).addClass(this.s.buttonToggle);
} else {
$btn = $(this.t.button).addClass(this.s.button)
.addClass(this.m.button);
}
$btn.children('.' + this.m.icon).addClass(iconClass);
if (toggle) {
$btn.children('.' + this.m.caret).addClass(this.s.buttonCaret);
}
return $btn;
},
/**
* @description add buttonView to toolbar
* @private
*/
_buttonView: function() {
this._debug('_buttonView');
var v = typeof this.o.toolbar.buttonView === 'string' ?
this.o.toolbar.buttonView : 'root+selected';
this.$buttonView = this._buildToolbtn(this.s.buttonView)
.attr('title', this.x.buttonView)
.appendTo(this.$toolbar)
.on(this.e.buttonClick,
$.proxy(function() {
this._setDefaultView(v);
this._updateIcons();
}, this)
);
},
/**
* @description add buttonUnfold to toolbar
* @private
*/
_buttonUnfold: function() {
this._debug('_buttonUnfold');
this.$buttonUnfold = this._buildToolbtn(this.s.buttonUnfold)
.attr('title', this.x.buttonUnfold)
.appendTo(this.$toolbar)
.on(
this.e.buttonClick,
$.proxy(function() {
this._expandAllLevels();
// update icon
this._updateIcons();
}, this)
);
},
/**
* @description add buttonCheckAll to toolbar
* @private
*/
_buttonCheckAll: function() {
this._debug('_buttonCheckAll');
// only isMultiple
if (this._isMultiple) {
this.$buttonCheckAll = this._buildToolbtn(this.s.buttonCheckAll)
.attr('title', this.x.buttonCheckAll)
.appendTo(this.$toolbar)
.on(
this.e.buttonClick,
$.proxy(function() {
// check all
this.selectAllOptions();
// view selected only
if (this.o.viewAfterCheckAll &&
this.$buttonView
) {
// trigger view
this.$buttonView.trigger('click');
} else {
// update icon
this._updateIcons();
}
}, this)
);
}
},
/**
* @description add buttonUnCheck to toolbar
* @private
*/
_buttonUnCheck: function() {
this._debug('_buttonUnCheck');
// only isMultiple
if (this._isMultiple) {
this.$buttonUnCheck = this._buildToolbtn(this.s.buttonUnCheck)
.attr('title', this.x.buttonUnCheck)
.appendTo(this.$toolbar)
.on(
this.e.buttonClick,
$.proxy(function() {
// uncheck
this.deselectAllOptions(
this.o.forceUnCheckTriggerEvent
);
// view selected only
if (this.o.viewAfterCheckAll &&
this.$buttonView
) {
// get default view
this._setDefaultView(this.o.defaultView);
}
this._updateIcons();
}, this)
);
}
},
/**
* @description add buttonCancel to toolbar
* @private
*/
_buttonCancel: function() {
this._debug('_buttonCancel');
this.$buttonCancel = this._buildToolbtn(this.s.buttonCancel)
.attr('title', this.x.buttonCancel)
.appendTo(this.$toolbar)
.on(
this.e.buttonClick,
$.proxy(function() {
// reset to old values
if (this._isChanged()) {
this.selectOptions(this.$buttonCancel.data('cancel'));
}
// view selected only
if (this.o.viewAfterCancel &&
this.$buttonView) {
// trigger view
this.$buttonView.trigger('click');
} else {
// update icon
this._updateIcons();
}
}, this)
);
},
/**
* @description add buttonAlias to toolbar
* @private
*/
_buttonAlias: function() {
this._debug('_buttonAlias');
var self = this;
// <div> container
this.$buttonAlias = $(this.t.buttonGroup)
.addClass(this.s.buttonGroup + ' ' + this.m.button)
.attr('title', this.x.buttonAlias)
.appendTo(this.$toolbar)
.append(this._buildToolbtn(this.s.buttonAlias, true))
.on(
this.e.buttonClick,
'button',
function() {
if (!self.$buttonAlias.hasClass(self.m.open)) {
self.$buttonAlias.addClass(self.m.open);
self.$save.focus();
} else {
self.$buttonAlias.removeClass(self.m.open);
}
}
);
// add dropdown UL
var $dropdown = $(this.t.dropdown).addClass(this.s.buttonDropdown);
this.$buttonAlias.append($dropdown);
// input box
var $input = $(this.t.liInput)
.addClass(this.s.liInput)
.appendTo($dropdown);
// config input
this.$save = $input.find('input')
.addClass(this.s.inputBox)
.attr('placeholder', this.x.aliasPlaceholder)
.on('keydown', function(e) {
// RETURN entered
if (e.which === 13 && self.$save.val() !== '') {
var vals = self.getSelectedPairs().value;
if (vals.length) {
self.addAlias(
self.$save.val(),
self.getSelectedPairs().value
);
self.$save.val('');
self.$buttonAlias.removeClass(self.m.open);
} else {
self.o.alert(self.x.emptyValuesError);
}
}
});
// add aliases
for (var n in this.o.aliases) {
this._addAliasLine(n);
}
},
/**
* @description add buttonSearch to toolbar
* @private
*/
_buttonSearch: function() {
this._debug('buttonSearch');
var self = this;
// <div> container
this.$buttonSearch = $(this.t.buttonGroup)
.addClass(this.s.buttonGroup + ' ' + this.s.dropup +
' ' + this.m.button)
.attr('title', this.x.buttonSearch)
.appendTo(this.$toolbar)
.append(this._buildToolbtn(this.s.buttonSearch, true))
.on(
this.e.buttonClick,
'button',
function(e) {
self.$buttonSearch.toggleClass(self.m.open)
.siblings().removeClass(self.m.open);
self.$buttonSearch.find('input').focus();
}
);
// add dropdown
var $dropdown = $(this.t.dropdown).addClass(this.s.buttonDropdown);
this.$buttonSearch.append($dropdown);
// input box
var $input = $(this.t.liInput)
.addClass(this.s.liInput)
.appendTo($dropdown);
// config input box
var self = this;
$input.find('input').addClass(this.s.inputBox)
.attr('placeholder', this.x.searchPlaceholder)
.on('focus keyup', function(e) {
// ignore RETURN
if (e.which === 13) return false;
var str = $(this).val();
if (self.o.searchTimeout) {
clearTimeout(self.o.searchTimeout);
}
self.o.searchTimeout = setTimeout(function () {
// start search
self._searchOptions(str);
// update icons
self._updateIcons();
}, 250);
});
},
/**
* @description build options to this.$dropdown
* @param {Array} data
* @returns {Object} this
* @private
*/
_buildOption: function(data) {
this._debug('_buildOption');
// option value/id mapping stored in this.$dropdown
var mapping = {};
var html = '', gid = '', oid = '';
var uids = [ '' ];
var len = data.length;
for (var i = 0; i < len; ++i) {
var row = data[i];
// optgroup
if (row.group) {
gid = this._getOid();
html += this._buildOptGroupHtml(row, gid);
uids = [ gid ];
// atleast option in this group
if (row[this.a.dataAtLeast]) this._oneInGroup = true;
// divider
} else if (row[this.a.dataDivider]) {
html += this._buildDividerHtml();
// option
} else {
oid = this._getOid();
mapping[row.value] = oid;
// fix row.level
if (row.level === undefined) row.level = 1;
var next = data[i+1];
if (next && next.level && next.level > row.level) row.children = true;
uids[parseInt(row.level)] = oid;
html += this._buildOptionHtml(row, oid, uids);
}
}
this.$dropdown.empty().data('mapping', mapping).append(html);
return this;
},
/**
* @description bypass logic verification, quick set lots of values
* @param {Array} values
* @param {Boolean} clear
* @returns {Object} this
* @private
*/
_quickSelectValues: function(values, clear) {
this._debug('_quickSelectValues');
if (this._triggerEvent('onOptionChange')) {
// uncheck everything
if (clear !== false) this._clearValues();
var data = this.$dropdown.data('mapping');
var val;
for (var i in values) {
val = values[i];
if (data[val]) $('#' + data[val]).addClass(this.m.active);
}
// fix logic for possible missings
if (clear !== false) this._fixEmptyLogic();
this._triggerEvent('onOptionChanged');
}
return this;
},
/**
* @description compare to the last saved values for cancelling
* @returns {Boolean}
* @private
*/
_isChanged: function() {
this._debug('_isChanged');
if (this.$buttonCancel) {
var old = this.$buttonCancel.data('cancel');
var val = this.getSelectedPairs().value;
if (this._arrayEqual(old, val)) return false;
}
return true;
},
/**
* @description auto generate option id
* @private
*/
_getOid: function() {
if (this._ocnt === undefined) this._ocnt = 0;
return this._theId + '-opt' + ++this._ocnt;
},
/**
* @description build divider html
* @returns {HTMLString}
* @private
*/
_buildDividerHtml: function() {
return this.t.divider;
},
/**
* @descriptioin build optgroup html
* @param {Object} row
* @param {IDString} gid
* @returns {HTMLString}
* @private
* @TODO
*/
_buildOptGroupHtml: function(row, gid) {
var html =
// id
'<li id="' + gid +
// optgroup marker
'" class="' + this.m.group + ' ' + this.m.hide + ' ' +
// data-exclusive
(row[this.a.dataExclusive] ? this.a.dataExclusive + ' ' : '') +
// data-level-inclusive class
(row[this.a.dataLevelInclusive] ? this.a.dataLevelInclusive + ' ' : '') +
// data-view
(row[this.a.dataView] ? this.a.dataView + ' ' : '') +
// end of classes
'" ' +
// data-level attribute
this.a.dataLevel + '="0" ' +
// data-atmost attribute
(row[this.a.dataAtMost] ? this.a.dataAtMost + '="' + row[this.a.dataAtMost] + '" ' : '') +
// data-atleast attribute
(row[this.a.dataAtLeast] ? this.a.dataAtLeast + '="' + row[this.a.dataAtLeast] + '" ' : '') +
// data-view attribute
(row[this.a.dataView] ? this.a.dataView + '="' + row[this.a.dataView] + '" ' : '') +
// data-group-exclusive attribute
(row[this.a.dataGroupExclusive] ?
this.a.dataGroupExclusive + '="' + row[this.a.dataGroupExclusive] + '" ' : ''
) +
// li label
'><a><span class="'+ this.m.label +'">' + row.label + '</span>' +
// folder
this.t.folder + '</a></li>';
return html;
},
/**
* @description build optgroup html
* @param {Object} row
* @param {IDString} oid
* @param {Array} uids
* @returns {HTMLString}
* @private
* @TODO
*/
_buildOptionHtml: function(row, oid, uids) {
this._debug('_buildOptionHtml');
// guess in group or not
if (row.ingroup === undefined) {
if (uids[0] !== undefined && uids[0] !== '') {
row.ingroup = true;
} else {
row.ingroup = false;
}
}
// all upper level ids
var myuids = [];
for(var i = row.ingroup === false ? 1 : 0; i < row.level; i++) {
myuids[i] = uids[i];
}
var html =
// id
'<li id="' + oid + '" ' +
// classes
'class="' + this.m.option + ' ' +
// in group ?
(row.ingroup === false ? this.m.noGroup + ' ' : '') +
// hide
this.m.hide + ' ' + (row.ingroup === false ? '' : this.m.hide + '-' + row.level + ' ') +
// upper level ids as class name
myuids.join(' ') + ' ' +
// data-view class
(row[this.a.dataView] ? this.a.dataView + ' ' : '') +
// data-must class
(row[this.a.dataMust] ? this.a.dataMust + ' ' : '') +
// data-input marker
(row[this.a.dataSpecial] ? this.a.dataSpecial + ' ' : '') +
// added 1.0.21 for initially disabled option
(row.disabled === true ? this.m.disabled + ' ' : '') +
// data-level class
this.a.dataLevel + '-' + row.level +
// end of classes
'" ' +
// data-upper attribute
(row.level > 1 ? this.a.dataUpper + '="' + myuids[row.level - 1] + '" ' : '') +
// data-inclusive attribute
(row[this.a.dataInclusive] ?
this.a.dataInclusive + '="' + row[this.a.dataInclusive] + '" ' : '') +
// data-view attribute
(row[this.a.dataView] ? this.a.dataView + '="' + row[this.a.dataView] + '" ' : '') +
// data-value attribute
this.a.dataValue + '="' + row.value + '" ' +
// data-level attribute
this.a.dataLevel + '="' + row.level + '" ' +
// checker icon
'><a><i class="' + this.m.checker + ' ' + this.s.checker + '"></i>' +
'<i class="' + this.m.checkerNo + ' ' + this.s.checkerNo + '"></i>' +
// label or row.html
(row.html ? row.html : ('<span class="' + this.m.label +'">' + row.label + '</span>')) +
// folder
(row.children ? this.t.folder : '')
// end option
+ '</a></li>';
return html;
},
/**
* @description close opened dropdowns in toolbar
* @private
*/
_closeToolbar: function() {
if (this.$toolbar) {
this._debug('_closeToolbar');
this.$toolbar.removeClass(this.m.open)
.find('.' + this.m.open)
.removeClass(this.m.open);
}
},
/**
* @description bind most of the events
* @returns {Object} this
* @private
*/
_bindEvents: function() {
this._debug('_bindEvents');
var self = this;
var m = this.m;
// click inside dropdown
this.$dropdown.off()
.on( // click outside toolbar
this.e.click,
function() {
self._closeToolbar();
}
)
.on( // stop bubble out of toolbar
this.e.click,
'.' + m.toolbar,
function(e) {
e.stopPropagation();
e.preventDefault();
return false;
}
)
.on( // click on the toolbar button
this.e.click,
'.' + m.button,
function(e) {
$(e.target)
.closest('.' + self.m.button)
.siblings()
.removeClass(m.open);
}
)
.on( // click on folder icon
this.e.click,
'.' + m.folder,
function(e) {
self._toggleFolder($(e.target).closest('li'));
self._closeToolbar();
self._updateIcons();
return false;
}
)
.on( // click on group
this.e.click,
'.' + m.group,
function(e) {
if (self.o.clickGroupOpen) {
self._toggleFolder($(e.target).closest('.' + m.group));
self._updateIcons();
}
}
)
.on( // click on option
this.e.click,
'.' + m.option,
function(e) {
var $p = $(e.target).parentsUntil('.' + m.option).andSelf();
// stop bubbling
if ($p.filter('.' + m.noBubble).length) {
} else {
self.toggleOption($(this));
}
}
);
// click out of $container will trigger close dropdowns
if (this.o.closeOnClickOutside) {
$(document).on(
this.e.click,
function(e) {
if ($(e.target).parents('.' + self.m.container).length === 0) {
$('.' + self.m.container)
.filter('.' + self.m.open)
.each(function() {
var elem = $(this).data(fullName);
$(elem).data(fullName).closeDropdown();
});
}
}
);
}
return this;
},
/**
* @description expand or collapse all levels
* @param {Boolean} forceCollapse TRUE to force collpase
* @param {Boolean} viewGroup FALSE to hide groups
* @private
*/
_expandAllLevels: function(forceCollapse, viewGroup) {
this._debug('_expandAllLevels');
var self = this;
// collapse
if (forceCollapse) {
this.$dropdown
.find('.' + this.m.option)
.each(function(i, element) {
var $li = $(element);
$li.addClass(self.m.hide + '-' + $li.attr(self.a.dataLevel));
});
if (viewGroup === false) {
this.$dropdown.find('.' + this.m.group)
.addClass(self.m.hide + '-0');
} else {
this.$dropdown.find('.' + this.m.group)
.removeClass(self.m.hide + '-0');
}
// open
} else {
this.$dropdown.find('.' + this.m.option)
.removeClass(this._allHideClasses);
this.$dropdown.find('.' + this.m.group)
.removeClass(this.m.hide + '-0');
}
},
/**
* @description get upper levels and fireup callback
* @param {jQuery} $li
* @param {Callback} callback
* @param {Boolean} andSelf FALSE to not include $li self
* @returns {jQuery}
* @private
*/
_getUpperLevels: function($li, callback, andSelf) {
this._debug('_getUpperLevels');
var level = parseInt($li.attr(this.a.dataLevel));
if (andSelf !== false) callback($li);
if (level > 1) {
var $up = $('#' + $li.attr(this.a.dataUpper));
if (andSelf === false) callback($up);
this._getUpperLevels($up, callback);
}
},
/**
* @description get value of an option
* @param {jQuery} $li
* @returns {String}
* @private
*/
_getOptionValue: function($li) {
this._debug('_getOptionValue');
return $li.hasClass(this.a.dataSpecial) ?
this.o.getSpecialValue($li, this) :
$li.attr(this.a.dataValue);
},
/**
* @description get label of an option
* @param {jQuery} $li
* @returns {String}
* @private
*/
_getOptionLabel: function($li) {
this._debug('_getOptionLabel');
return $li.hasClass(this.a.dataSpecial) ?
this.o.getSpecialLabel($li, this) :
$li.children('a').text();
},
/**
* @description get all selected options
* @param {Boolean} skipDisabled FALSE to include disabled options
* @returns {jQuery}
* @private
*/
_getSelectedOptions: function(skipDisabled) {
this._debug('_getSelectedOptions');
var $res = this.$dropdown.find('.' + this.m.active + '.' + this.m.option);
if (skipDisabled === false) {
return $res;
} else {
return $res.not('.' + this.m.disabled);
}
},
/**
* @description select options base on values, no sync to <SELECT>
* @param {Array} values
* @returns {Object} this
* @private
*/
_setValues: function(values) {
this._debug('_setValues');
this._toString(values);
for (var i in values) {
if (!this._selectOption(values[i])) {
this.o.alert(this.x.valueSetError + values[i]);
};
}
return this;
},
/**
* @description deselect options base on values, no sync to <SELECT>
* @param {Array} values
* @returns {Object} this
* @private
*/
_unSetValues: function(values) {
this._debug('_unSetValues');
this._toString(values);
for (var i in values) {
if (!this._deselectOption(values[i])) {
this.o.alert(this.x.valueSetError + values[i]);
};
}
return this;
},
/**
* @description deselect everthing, without logic verification
* @returns {Object} this
* @private
*/
_clearValues: function() {
this._debug('_clearValues');
this.$dropdown
.find('.' + this.m.active + '.' + this.m.option)
.not('.' + this.m.disabled)
.removeClass(this.m.active);
return this;
},
/**
* @description the search options from 'str'
* @param {String} str
* @returns {jQuery}
* @private
*/
_searchOptions: function(str) {
this._debug('_searchOptions');
var self = this;
// trim
str = str.replace(/(^\s*)|(\s*$)/g, '');
if (str === '') {
// expand all
this._expandAllLevels();
} else {
// collapse all (including root)
this._expandAllLevels(true, false);
// show only matched
this.$dropdown
.find('.' + this.m.option)
.not('.' + this.m.disabled)
.each(function() {
var $opt = $(this);
// get value & label
var value = self._getOptionValue($opt);
var label = self._getOptionLabel($opt);
// construct 'toSrch'
var toSrch = label;
if (self.o.searchBy === 'value') {
toSrch = value;
} else if (self.o.searchBy === 'both') {
toSrch = label + ' ' + value;
}
if (self.o.searchCaseInsensitive) {
str = str.toLowerCase();
toSrch = toSrch.toLowerCase();
}
// match found
if (toSrch.indexOf(str) > -1) {
self._getUpperLevels($opt, function($x) {
$x.removeClass(self._allHideClasses);
});
self._getGroup($opt).removeClass(self.m.hide + '-0');
}
});
this._updateIcons();
}
},
/**
* @description generate an unique id for this.$dropdown
* @returns {String}
* @private
*/
_uniqueId: function() {
this._debug('_uniqueId');
return 's' + (Math.random() + 1).toString(36).slice(-5);
},
/**
* @description check exists of multiple classes in $jq
* @param {jQuery} $jq
* @param {ClassString} c multiple class names string
* @returns {Boolean}
* @private
*/
_hasClasses: function($jq, c) {
this._debug('_hasClasses');
var a = c.split(' ');
for(var i = 0, l = a.length; i < l; i++){
if(!$jq.hasClass(a[i])) return false;
}
return true;
},
/**
* @description convert element to string in an array
* @param {Array} a
* @private
*/
_toString: function(a) {
this._debug('_toString');
for(var i in a) {
a[i] = a[i].toString();
}
},
/**
* @description wether 2 options are peer/sibling
* @param {jQuery} $one
* @param {jQuery} $two
* @returns {Boolean}
* @private
*/
_isPeer: function($one, $two) {
this._debug('_isPeer');
return $one.attr(this.a.dataUpper) === $two.attr(this.a.dataUpper);
},
/**
* @description compare 2 options in the same group is inclusive or not
* @param {jQuery} $one
* @param {jQuery} $two
* @returns {Boolean}
* @private
*/
_isDataInclusive: function($one, $two) {
this._debug('_isDataInclusive');
if (this._isPeer($one, $two)) {
var o = $one.attr(this.a.dataInclusive);
var t = $two.attr(this.a.dataInclusive);
return this._charOverlap(o, t);
}
return false;
},
/**
* @description figure out two groups exclusive with each other or not
* @param {jQuery} $one
* @param {jQuery} $two
* @returns {Boolean}
* @private
*/
_isGroupExclusive: function($one, $two) {
this._debug('_isGroupExclusive');
var o = $one ? $one.attr(this.a.dataGroupExclusive) : undefined;
var t = $two ? $two.attr(this.a.dataGroupExclusive) : undefined;
return !this._charOverlap(
o === undefined ? '.' : o,
t === undefined ? '.' : t
);
},
/**
* @description check $group is multiple or data-exclusive
* @param {jQuery} $group
* @returns {Boolean}
* @private
*/
_isGroupMultiple: function($group) {
this._debug('_isGroupMultiple');
// in group
if ($group && $group.length) {
return !$group.hasClass(this.a.dataExclusive);
// in root
} else {
return !(this._isMultiple && this._isDataExclusive);
}
},
/**
* @description check $group|root is level inclusive or not
* @param {jQuery} $group
* @returns {Boolean}
* @private
*/
_isLevelInclusive: function($group) {
this._debug('_isLevelInclusive');
if ($group && $group.length) {
return $group.hasClass(this.a.dataLevelInclusive) ||
this.o.dataLevelInclusive;
} else {
return this.o.dataLevelInclusive;
}
},
/**
* @description test 2 strings have same chars
* @example
* A = "a b c";
* B = "1 2 a";
*
* @param {String} A
* @param {String} B
* @returns {Boolean}
* @private
*/
_charOverlap: function(A, B) {
this._debug('_charOverlap');
var a = A ? A.split(' ') : [];
var b = B ? B.split(' ') : [];
var match = a.filter(function(n) {
return b.indexOf(n) !== -1;
});
return match.length ? true : false;
},
/**
* @description test 2 arrays have same values (order may different)
* @param {Array} a
* @param {Array} b
* @returns {Boolean}
* @private
*/
_arrayEqual: function(a, b) {
this._debug('_arrayEqual');
if (a.length !== b.length ||
a.filter(function(n) {
return b.indexOf(n) === -1;
}).length + b.filter(function(n) {
return a.indexOf(n) === -1;
}).length > 0
) return false;
return true;
},
/**
* @description repeat string
* @param {String} str
* @param {Integer} num
* @returns {String}
*/
_stringRepeat: function(str, num) {
var tmp = '';
for (var i = 0; i < num; i++) tmp += str;
return tmp;
},
/**
* @description resolve some option issues before plugin load
* @returns {Boolean}
* @private
*/
_fixPluginOptions: function() {
this._debug('_fixPluginOptions');
// is plugin attached to a <SELECT> ?
this._isSelect = this.element.nodeName === 'SELECT';
// is this a multiple-select ?
this._isMultiple = this.o.multiple ? true : false;
if (this._isSelect && this.$element.attr('multiple') === undefined) {
this._isMultiple = false;
}
// is data exclusive in <SELECT> root level ?
if (this._isSelect &&
this.$element.attr(this.a.dataExclusive) !== undefined
) {
this._isDataExclusive = true;
}
// for single select, closeOnSelect
if (!this._isMultiple) this.o.closeOnSelect = true;
// optimized ?
if (this.o.optimized) {
this.o.delayedInit = true;
this.o.keepInSync = false;
this.o.debug = 0;
}
// if 'defaultValues' is set, then set 'atLeast'
if (this.o.defaultValues !== null && !this.o.atLeast) {
this.o.atLeast = 1;
}
// simple handlers
for (var i in this.o.handler) {
if (this.o.handler.hasOwnProperty(i)) {
this.$element.on(i + eventSuffix, this.o.handler[i]);
}
}
// hide-* class
this._allHideClasses = '';
for (var i = 1; i <= this.o.maxLevels ; i++) {
this._allHideClasses += this.m.hide + '-' + i + ' ';
}
return true;
},
/**
* @description hide the original <SELECT> element
* @returns {Boolean}
* @private
*/
_hideOriginalSelect: function() {
this._debug('_hideOriginalSelect');
if (this._isSelect) this.$element.hide();
return true;
},
/**
* @description set default values, no verification
* @private
*/
_setDefaultValues: function() {
this._debug('_setDefaultValues');
this._clearValues();
// check initial values first
if (this.o.initialValues.length) {
this._setValues(this.o.initialValues);
this.o.initialValues.length = 0;
// check default values
} else if (this.o.defaultValues !== null) {
this._setValues(this.o.defaultValues);
}
return true;
},
/**
* added 1.0.21
*
* @description initial <SELECT> is disabled or not
* @private
*/
_disabledSelect: function() {
this._debug('_setDefaultValues');
if (this._isSelect && this.o.disabled === true) {
this.disableSelect();
}
},
/**
* @description fix logic when deselect, disable or plugin loaded
* @param {jQuery} $target
* @param {EventString} event short event name
* @returns {Boolean}
* @private
*/
_fixEmptyLogic: function($target, event) {
this._debug('_fixEmptyLogic');
if (this._mustSelect($target, event) &&
this._atLeastInGroup($target, event) &&
this._atLeast($target, event)) {
return true;
}
return false;
},
/**
* @description at least # should be selected in this.$dropdown
* @param {jQuery} $target
* @param {String} event
* @returns {Boolean}
* @private
*/
_atLeast: function($target, event) {
this._debug('_atLeast');
if (!this.o.atLeast) return true;
// selected
var $selected = this._getSelectedOptions();
var req = this.o.atLeast;
// onOptionDeselect
if (event === 'onOptionDeselect') {
// more than enough checked
if ($selected.not($target).length + 1 > req) return true;
// reset to default values
if (req === 1 && this.o.defaultValues !== null) {
this._setValues(this.o.defaultValues);
if ($.inArray(this._getOptionValue($target),
this.o.defaultValues) === -1) return true;
}
// disable this unselect action
this.$element.trigger('atLeast' + eventSuffix);
return false;
// onOptionDisabled
} else if (event === 'onOptionDisabled') {
// more than enough checked
if ($selected.length >= req) return true;
// reset to default values
if (req === 1 && this.o.defaultValues !== null) {
this._setValues(this.o.defaultValues);
}
$selected = this._getSelectedOptions();
if ($selected.length >= req) return true;
// select others
this._selectMatchedOptions(
this.$dropdown.find('.' + this.m.option)
.not('.' + this.m.disabled)
.not('.' + this.m.active)
.slice(0, req - $selected.length),
true, true, false
);
return true;
// onPluginLoaded & etc.
} else {
// selected already
if ($selected.length >= req) return true;
// default values
if (this.o.defaultValues !== null) {
this._setValues(this.o.defaultValues);
$selected = this._getSelectedOptions();
}
// check agin
if ($selected.length < req) {
this._selectMatchedOptions(
this.$dropdown.find('.' + this.m.option)
.not('.' + this.m.disabled)
.not('.' + this.m.active)
.slice(0, req - $selected.length),
true, true, false
);
}
}
return true;
},
/**
* @description must select these values in this.o.mustSelect array
* @param {jQuery} $target
* @param {EventString} event short event name
* @returns {Boolean}
* @private
*/
_mustSelect: function($target, event) {
this._debug('_mustSelect');
if (this.o.mustSelect.length > 0) {
var ms = this.o.mustSelect;
for (var i in ms) {
var $x = this._getOptionByValue(ms[i]);
$x.addClass(this.a.dataMust);
}
this.o.mustSelect.length = 0;
}
var $must = this.$dropdown.find('.' + this.a.dataMust)
.not('.' + this.m.disabled);
if ($must.length === 0) return true;
// onOptionDeselect
if (event === 'onOptionDeselect') {
// match found, disable this unselect
if ($must.filter($target).length) {
this.$element.trigger('mustSelect' + eventSuffix);
return false;
}
return true;
// onPluginLoaded
} else if (event === 'onPluginLoaded') {
this._selectMatchedOptions($must, true, true, false);
}
return true;
},
/**
* @description at most # of selections should be selected
* @param {jQuery} $target
* @param {EventString} event short event name
* @returns {Boolean}
* @private
*/
_atMost: function($target, event) {
this._debug('_atMost');
if (!this._isAtMost()) return true;
var $group = this._getGroup($target);
// check group
if ($group.length) {
if ($group.is('[' + this.a.dataAtMost + ']')) {
var most = parseInt($group.attr(this.a.dataAtMost));
if (this.$dropdown
.find('.' + this.m.active + '.' + $group.attr('id'))
.not('.' + this.m.disabled).length === most) {
this.$element.trigger('atMost' + eventSuffix);
return false;
}
}
}
// check overall
if (!this.o.atMost) return true;
// selected
var $selected = this._getSelectedOptions();
// not enough checked
if ($selected.length < this.o.atMost) return true;
// disable this select action
this.$element.trigger('atMost' + eventSuffix);
return false;
},
/**
* @description test 'atMost' in root and all the groups
* @returns {Boolean}
* @private
*/
_isAtMost: function() {
if (this._atmost !== undefined) return this._atmost;
// root level
if (this.o.atMost) {
this._atmost = true;
return this._atmost;
}
// group level
if (this.$dropdown
.find('.' + this.m.group)
.not('.' + this.m.disabled)
.filter('[' + this.a.dataAtMost + ']').length) {
this._atmost = true;
return this._atmost;
}
this._atmost = false;
return this._atmost;
},
/**
* @description make sure at least # selected in the optgroup
* @param {jQuery} $target
* @param {EventString} event short event name
* @returns {Boolean}
* @private
*/
_atLeastInGroup: function($target, event) {
this._debug('_atLeastInGroup');
// no data-atleast group exists
if (!this._oneInGroup) return true;
// onOptionDeselect
if (event === 'onOptionDeselect') {
// get the group
var $group = this._getGroup($target);
// not group found
if ($group.length === 0) return true;
// $group is not a data-atleast group
if (!$group.is('[' + this.a.dataAtLeast + ']')) return true;
// more than atleast opts in this group selected
var least = parseInt($group.attr(this.a.dataAtLeast));
if (this._getSelectedOptions()
.filter('.' + $group.attr('id')).length > least) return true;
// disable unselect
this.$element.trigger('atLeast' + eventSuffix);
return false;
// onOptionDisabled
} else if (event === 'onOptionDisabled') {
// get the group
var $group = this._getGroup($target);
// not group found
if ($group.length === 0) return true;
// $group is not a data-atleast group
if (!$group.is('[' + this.a.dataAtLeast + ']')) return true;
// more than atleast opts in this group selected
var gid = $group.attr('id');
var least = parseInt($group.attr(this.a.dataAtLeast));
var done = this._getSelectedOptions().filter('.' + gid).length;
if (done >= least) return true;
// select others
this._selectMatchedOptions(
this.$dropdown.find('.' + gid)
.not('.' + this.m.disabled)
.not('.' + this.m.active)
.slice(0, least - done),
true, true, false
);
return true;
// onPluginLoaded or etc.
} else {
// set the least options in groups
var self = this;
this._getGroup().filter('[' + this.a.dataAtLeast + ']')
.each(function() {
var $grp = $(this);
var least = parseInt($grp.attr(self.a.dataAtLeast));
var done = self._getSelectedOptions()
.filter('.' + $grp.attr('id')).length;
if (done >= least) return true;
self._selectMatchedOptions(
self.$dropdown
.children('.' + $grp.attr('id'))
.not('.' + self.m.disabled)
.slice(0, least),
true, true, false
);
});
}
return true;
},
/**
* @description on selecting $target, deselect other conflict options
* @param {jQuery} $target
* @returns {Boolean}
* @private
*/
_fixSelectLogic: function($target) {
this._debug('_fixSelectLogic');
// selected options other than the $target
var $other = this._getSelectedOptions().not($target);
// no other selected
if ($other.length === 0) return true;
var self = this;
// single selection, unselect others
if (this._isMultiple === false) {
$other.each(function() {
self._deselectOption(this);
});
return true;
}
// $target's group, get $() for non-grouped options
var $group = this._getGroup($target);
// $target's level
var level = parseInt($target.attr(this.a.dataLevel));
// deal with other groups
var $grps = this.$dropdown
.find('.' + this.m.group)
.not('.' + this.m.disabled)
.not($group);
// uncheck those exclusive groups or root
var glist = [];
$grps.each(function() {
glist[glist.length] = $(this);
});
for (var i in glist) {
var $grp = glist[i];
if (self._isGroupExclusive($group, $grp)) {
self.deselectGroupOptions($grp, false);
}
}
if ($group.length && self._isGroupExclusive($group)) {
self.deselectGroupOptions(undefined, false);
}
// same group or same in root
// data-exclusive
if (!this._isGroupMultiple($group)) {
var $sgOpts = this.$dropdown
.find('.' + this.m.active + '.' + this.m.option)
.filter('.' + ($group.length ? $group.attr('id') : this.m.noGroup))
.not('.' + this.m.disabled).not($target);
$sgOpts.each(function() {
var $li = $(this);
if (!self._isDataInclusive($target, $li)) {
self._deselectOption($li);
}
});
}
// !data-level-inclusive, unselect related
if (!this._isLevelInclusive($group)) {
// active descendants
this.$dropdown
.find('.' + $target.attr('id') + '.' + this.m.active)
.not('.' + this.m.disabled)
.removeClass(this.m.active);
// peers & ancenstor && differnt branches
var $sgOpts = this.$dropdown
.find('.' + this.m.active + '.' + this.m.option)
.filter('.' + ($group.length ? $group.attr('id') : this.m.noGroup))
.not('.' + this.m.disabled).not($target);
if (level > 1 && $sgOpts.length) {
var upper = $target.attr(this.a.dataUpper);
var $peers = this.$dropdown
.find('.' + upper)
.filter('.' + this.a.dataLevel + '-' + level)
.not('.' + this.m.disabled);
var p = $peers.not('.' + this.m.active).length;
// only $target in this level has non-active peer
if ($peers.length === 1 || p > 0) {
// uncheck uppers
this._getUpperLevels($target, function($x) {
if ($x.hasClass(self.m.active)) {
self._deselectOption($x);
}
}, false);
// all checked in same level
} else if (p === 0) {
// check upper
this._selectOption($('#' + upper));
}
}
}
return true;
},
/**
* @description set the select button text
* @param {String} txt
* @returns {Boolean}
* @private
*/
_setSelectLabel: function(txt) {
if (this.o.showSelectedInLabel) {
this._debug('_setSelectLabel');
var longString;
if (typeof txt === 'string') {
var text = txt;
longString = txt;
} else {
// default text
var text = this.x.selectLabel;
longString = text;
// selected option text
var labels = this.getSelectedPairs().text;
if (labels.length) {
longString = labels.join(',');
if (this.o.showSelectedCallback) {
text = this.o.showSelectedCallback.call(this, labels);
} else {
if (labels.length <= this.o.showSelectedCount) {
text = labels.join(this.o.showSelectedSeperator);
} else {
text = this.x.labelTemplate.replace('#', labels.length);
}
}
}
}
// set it
this.$select
.find('.' + this.m.label)
.attr('title', longString)
.html(text);
}
return true;
},
/**
* @description save old selected values if $buttonCancel exists
* @returns {Boolean}
* @private
*/
_saveOldValues: function() {
this._debug('_saveOldValues');
if (this.$buttonCancel) {
this.$buttonCancel.data('cancel', this.getSelectedPairs().value);
}
return true;
},
/**
* @description run delayed init
* @returns {Boolean}
* @private
*/
_delayedInit: function() {
// once only
if (this._delayed === true) return true;
this._debug('_delayedInit');
// add folder icon in this.$dropdown
this.$dropdown.find('.' + this.m.folder + '.' + this.m.folderOpen)
.addClass(this.s.folderOpen);
this.$dropdown.find('.' + this.m.folder + '.' + this.m.folderClose)
.addClass(this.s.folderClose);
// add divider class
this.$dropdown.find('.' + this.m.divider).addClass(this.s.divider);
// build toolbar & bind events
this._buildToolbar()._bindEvents();
// set initial viewing status
this._setDefaultView();
// turn off switch
this._delayed = true;
return true;
},
/**
* @description set default view
* @param {String} view
* @private
*/
_setDefaultView: function(view) {
var self = this;
var views = (view ? view : this.o.defaultView).split('+');
// expand all
if ($.inArray('expand', views) > -1) {
this._expandAllLevels();
return true;
}
// collapse all first (group showed)
this._expandAllLevels(true);
// root level
if ($.inArray('root', views) > -1) {
this.$dropdown.find('.' + this.m.noGroup)
.removeClass(this._allHideClasses);
}
// level1
if ($.inArray('level1', views) > -1) {
this.$dropdown.find('.' + this.m.option)
.filter('['+ this.a.dataLevel + '=1]')
.removeClass(this._allHideClasses);
}
// level2
if ($.inArray('level2', views) > -1) {
this.$dropdown.find('.' + this.m.option)
.filter('['+ this.a.dataLevel + '=1]')
.removeClass(this._allHideClasses);
this.$dropdown.find('.' + this.m.option)
.filter('['+ this.a.dataLevel + '=2]')
.removeClass(this._allHideClasses);
}
// selected
if ($.inArray('selected', views) > -1) {
this.$dropdown
.find('.' + this.m.active + '.' + this.m.option)
.not('.' + this.m.disabled)
.each(function(i, li) {
var $li = $(li);
self._getUpperLevels($li, function($x) {
$x.removeClass(self._allHideClasses);
});
});
}
// honor data-view
if ($.inArray('view', views) > -1) {
this.$dropdown
.find('.' + this.a.dataView)
.not('.' + this.m.disabled)
.each(function(i, li) {
var $li = $(li);
// show uppers first
self._getUpperLevels($li, function($x) {
$x.removeClass(self._allHideClasses);
});
// show lower levels
var id = $li.attr('id');
var v = parseInt($li.attr(self.a.dataView));
v = v < 4 ? v : 1; // hacking
for (var i = 1; i <= v; ++i) {
self.$dropdown.find('.' + id + '.' + self.a.dataLevel + '-' + i)
.removeClass(self._allHideClasses);
}
});
}
return true;
},
/**
* @description close dropdown on select one option
* @private
*/
_closeOnSelect: function() {
if (this.o.closeOnSelect) {
this.$select.trigger('click');
}
},
/**
* @description force sync plugin values with original <SELECT>
* @returns {Boolean}
* @private
*/
_syncSelect: function() {
if (this._isSelect) {
this._debug('_syncSelect');
var old = this.o.keepInSync;
this.o.keepInSync = true;
this._flushSelect();
this.o.keepInSync = old;
}
return true;
},
/**
* @description flush(not forced) plugin with original <SELECT>
* @returns {Boolean}
* @private
*/
_flushSelect: function() {
if (this._isSelect && this.o.keepInSync) {
this._debug('_flushSelect');
// new values
var vals = this.getSelectedPairs().value;
// empty first
this.$element.find('option:selected').prop('selected', false);
if (vals.length) {
this.$element.find('option').each(function() {
var v = $(this).val();
if ($.inArray(v, vals) > -1) {
$(this).prop('selected', true);
}
});
}
}
return true;
}
};
// PLUGIN DEFINITION
// ====================================================
/**
* @param {Object} options
* @param {Object} extras
*/
function Plugin(options, extras) {
return this.each(function () {
var $this = $(this);
// destroy
if (options === 'destroy') {
$this.data(fullName, false);
return;
}
var data = $this.data(fullName);
// init
if (!data) {
$this.data(fullName, (data = new SmartSelect(this, options)));
return;
}
// methods
if (typeof options === 'string') data[options].apply(data, extras);
});
};
var old = $.fn[pluginName];
$.fn[pluginName] = Plugin;
$.fn[pluginName].Constructor = SmartSelect;
// get smartselect object
$.fn['get' + pluginName] = function() {
return this.first().data(fullName);
};
// NO CONFLICT
// ====================================================
$.fn[pluginName].noConflict = function () {
$.fn[pluginName] = old;
return this;
};
})( window.jQuery );
| {
"content_hash": "50289b2cb4fcc091132198e75c592046",
"timestamp": "",
"source": "github",
"line_count": 4204,
"max_line_length": 145,
"avg_line_length": 31.55708848715509,
"alnum_prop": 0.41503474891833625,
"repo_name": "umerm-work/spine",
"id": "45e6b0b6b0e7a854482c05a66928c50c0a353500",
"size": "132666",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "assets/js/jquery.smartselect.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "421"
},
{
"name": "CSS",
"bytes": "50876"
},
{
"name": "HTML",
"bytes": "8257875"
},
{
"name": "JavaScript",
"bytes": "359580"
},
{
"name": "PHP",
"bytes": "3362420"
}
],
"symlink_target": ""
} |
'use strict';
class RecrawlWarning {
constructor(root, count) {
this.root = root;
this.count = count;
}
static findByRoot(root) {
for (let i = 0; i < this.RECRAWL_WARNINGS.length; i++) {
const warning = this.RECRAWL_WARNINGS[i];
if (warning.root === root) {
return warning;
}
}
return undefined;
}
static isRecrawlWarningDupe(warningMessage) {
if (typeof warningMessage !== 'string') {
return false;
}
const match = warningMessage.match(this.REGEXP);
if (!match) {
return false;
}
const count = Number(match[1]);
const root = match[2];
const warning = this.findByRoot(root);
if (warning) {
// only keep the highest count, assume count to either stay the same or
// increase.
if (warning.count >= count) {
return true;
} else {
// update the existing warning to the latest (highest) count
warning.count = count;
return false;
}
} else {
this.RECRAWL_WARNINGS.push(new RecrawlWarning(root, count));
return false;
}
}
}
RecrawlWarning.RECRAWL_WARNINGS = [];
RecrawlWarning.REGEXP =
/Recrawled this watch (\d+) times, most recently because:\n([^:]+)/;
module.exports = RecrawlWarning;
| {
"content_hash": "5e26f0c2d57395fdb9a0b933764047c1",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 77,
"avg_line_length": 22.875,
"alnum_prop": 0.6034348165495707,
"repo_name": "GoogleCloudPlatform/prometheus-engine",
"id": "a89af20e126d0c33c39ffcd38971c6a2d4a6ab39",
"size": "1411",
"binary": false,
"copies": "3",
"ref": "refs/heads/main",
"path": "third_party/prometheus_ui/base/web/ui/node_modules/jest-haste-map/build/watchers/RecrawlWarning.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "4035"
},
{
"name": "Go",
"bytes": "574177"
},
{
"name": "Makefile",
"bytes": "5189"
},
{
"name": "Shell",
"bytes": "11915"
}
],
"symlink_target": ""
} |
package natlab.toolkits.analysis.core;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
import natlab.utils.NodeFinder;
import analysis.BackwardAnalysis;
import ast.ASTNode;
import ast.AssignStmt;
import ast.CellIndexExpr;
import ast.DotExpr;
import ast.Expr;
import ast.MatrixExpr;
import ast.NameExpr;
import ast.ParameterizedExpr;
import ast.Script;
import ast.Stmt;
public class LivenessAnalysis extends
BackwardAnalysis<Set<String>> {
public LivenessAnalysis(ASTNode<?> tree) {
super(tree);
}
@Override
public void caseStmt(Stmt s) {
outFlowSets.put(s, copy(currentOutSet));
caseASTNode(s);
inFlowSets.put(s, copy(currentInSet));
}
private NameExpr getLValue(Expr lv) {
while (!(lv instanceof NameExpr)) {
if (lv instanceof ParameterizedExpr) {
lv = ((ParameterizedExpr) lv).getTarget();
} else if (lv instanceof CellIndexExpr) {
lv = ((CellIndexExpr) lv).getTarget();
} else if (lv instanceof DotExpr) {
lv = ((DotExpr) lv).getTarget();
}
}
return (NameExpr) lv;
}
@Override
public void caseNameExpr(NameExpr ne) {
currentInSet.add(ne.getName().getID());
}
@Override
public void caseAssignStmt(AssignStmt s) {
outFlowSets.put(s, copy(currentOutSet));
Set<NameExpr> lValues = new HashSet<>();
if (s.getLHS() instanceof MatrixExpr) {
for (Expr expr : ((MatrixExpr) s.getLHS()).getRow(0).getElements()) {
lValues.add(getLValue(expr));
}
} else {
lValues.add(getLValue(s.getLHS()));
}
for (NameExpr n : lValues) {
currentOutSet.remove(n.getName().getID());
}
caseASTNode(s.getRHS());
currentOutSet.addAll(NodeFinder.find(NameExpr.class, s)
.filter(name -> !lValues.contains(name))
.map(name -> name.getName().getID())
.collect(Collectors.toList()));
inFlowSets.put(s, copy(currentInSet));
}
private void caseFunctionOrScript(ASTNode<?> node, ast.List<Stmt> stmts) {
currentOutSet = newInitialFlow();
currentInSet = copy(currentOutSet);
outFlowSets.put(node, currentOutSet);
stmts.analyze(this);
inFlowSets.put(node, currentInSet);
}
@Override
public void caseFunction(ast.Function node) {
caseFunctionOrScript(node, node.getStmts());
}
@Override
public void caseScript(Script node) {
caseFunctionOrScript(node, node.getStmts());
}
@Override
public Set<String> copy(Set<String> source) {
return new HashSet<>(source);
}
@Override
public Set<String> merge(Set<String> in1, Set<String> in2) {
Set<String> out = new HashSet<>(in1);
out.addAll(in2);
return out;
}
@Override
public Set<String> newInitialFlow() {
return new HashSet<>();
}
}
| {
"content_hash": "531ab3cecd64f717049a763f3e120fee",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 76,
"avg_line_length": 24.767857142857142,
"alnum_prop": 0.6687094448449892,
"repo_name": "Sable/mclab-core",
"id": "9d7bcc87882ae6828cf0a89512f33bbcb53e86d3",
"size": "2774",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "languages/Natlab/src/natlab/toolkits/analysis/core/LivenessAnalysis.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "387"
},
{
"name": "Batchfile",
"bytes": "559"
},
{
"name": "C",
"bytes": "466526"
},
{
"name": "C++",
"bytes": "19994"
},
{
"name": "CSS",
"bytes": "3032"
},
{
"name": "Emacs Lisp",
"bytes": "2535"
},
{
"name": "GAP",
"bytes": "320936"
},
{
"name": "HTML",
"bytes": "359828"
},
{
"name": "Java",
"bytes": "5242198"
},
{
"name": "Lex",
"bytes": "114133"
},
{
"name": "M4",
"bytes": "3863"
},
{
"name": "Makefile",
"bytes": "5969"
},
{
"name": "Matlab",
"bytes": "1207"
},
{
"name": "OCaml",
"bytes": "6276"
},
{
"name": "Objective-C",
"bytes": "723006"
},
{
"name": "Python",
"bytes": "569613"
},
{
"name": "Ruby",
"bytes": "21165"
},
{
"name": "Shell",
"bytes": "3574"
},
{
"name": "Smalltalk",
"bytes": "417"
},
{
"name": "VimL",
"bytes": "5978"
},
{
"name": "Yacc",
"bytes": "3743"
}
],
"symlink_target": ""
} |
This chapter will explain all of the fields available in `composer.json`.
## JSON schema
We have a [JSON schema](http://json-schema.org) that documents the format and
can also be used to validate your `composer.json`. In fact, it is used by the
`validate` command. You can find it at:
[`res/composer-schema.json`](https://github.com/composer/composer/blob/master/res/composer-schema.json).
## Root Package
The root package is the package defined by the `composer.json` at the root of
your project. It is the main `composer.json` that defines your project
requirements.
Certain fields only apply when in the root package context. One example of
this is the `config` field. Only the root package can define configuration.
The config of dependencies is ignored. This makes the `config` field
`root-only`.
If you clone one of those dependencies to work on it, then that package is the
root package. The `composer.json` is identical, but the context is different.
> **Note:** A package can be the root package or not, depending on the context.
> For example, if your project depends on the `monolog` library, your project
> is the root package. However, if you clone `monolog` from GitHub in order to
> fix a bug in it, then `monolog` is the root package.
## Properties
### name
The name of the package. It consists of vendor name and project name,
separated by `/`.
Examples:
* monolog/monolog
* igorw/event-source
Required for published packages (libraries).
### description
A short description of the package. Usually this is just one line long.
Required for published packages (libraries).
### version
The version of the package.
This must follow the format of `X.Y.Z` with an optional suffix of `-dev`,
`-alphaN`, `-betaN` or `-RCN`.
Examples:
1.0.0
1.0.2
1.1.0
0.2.5
1.0.0-dev
1.0.0-alpha3
1.0.0-beta2
1.0.0-RC5
Optional if the package repository can infer the version from somewhere, such
as the VCS tag name in the VCS repository. In that case it is also recommended
to omit it.
> **Note:** Packagist uses VCS repositories, so the statement above is very
> much true for Packagist as well. Specifying the version yourself will
> most likely end up creating problems at some point due to human error.
### type
The type of the package. It defaults to `library`.
Package types are used for custom installation logic. If you have a package
that needs some special logic, you can define a custom type. This could be a
`symfony-bundle`, a `wordpress-plugin` or a `typo3-module`. These types will
all be specific to certain projects, and they will need to provide an
installer capable of installing packages of that type.
Out of the box, composer supports three types:
- **library:** This is the default. It will simply copy the files to `vendor`.
- **metapackage:** An empty package that contains requirements and will trigger
their installation, but contains no files and will not write anything to the
filesystem. As such, it does not require a dist or source key to be
installable.
- **composer-installer:** A package of type `composer-installer` provides an
installer for other packages that have a custom type. Read more in the
[dedicated article](articles/custom-installers.md).
Only use a custom type if you need custom logic during installation. It is
recommended to omit this field and have it just default to `library`.
### keywords
An array of keywords that the package is related to. These can be used for
searching and filtering.
Examples:
logging
events
database
redis
templating
Optional.
### homepage
An URL to the website of the project.
Optional.
### time
Release date of the version.
Must be in `YYYY-MM-DD` or `YYYY-MM-DD HH:MM:SS` format.
Optional.
### license
The license of the package. This can be either a string or an array of strings.
The recommended notation for the most common licenses is (alphabetical):
Apache-2.0
BSD-2-Clause
BSD-3-Clause
BSD-4-Clause
GPL-2.0
GPL-2.0+
GPL-3.0
GPL-3.0+
LGPL-2.1
LGPL-2.1+
LGPL-3.0
LGPL-3.0+
MIT
Optional, but it is highly recommended to supply this. More identifiers are
listed at the [SPDX Open Source License Registry](http://www.spdx.org/licenses/).
For closed-source software, you may use `"proprietary"` as the license identifier.
An Example:
{
"license": "MIT"
}
For a package, when there is a choice between licenses ("disjunctive license"),
multiple can be specified as array.
An Example for disjunctive licenses:
{
"license": [
"LGPL-2.1",
"GPL-3.0+"
]
}
Alternatively they can be separated with "or" and enclosed in parenthesis;
{
"license": "(LGPL-2.1 or GPL-3.0+)"
}
Similarly when multiple licenses need to be applied ("conjunctive license"),
they should be separated with "and" and enclosed in parenthesis.
### authors
The authors of the package. This is an array of objects.
Each author object can have following properties:
* **name:** The author's name. Usually his real name.
* **email:** The author's email address.
* **homepage:** An URL to the author's website.
* **role:** The authors' role in the project (e.g. developer or translator)
An example:
{
"authors": [
{
"name": "Nils Adermann",
"email": "[email protected]",
"homepage": "http://www.naderman.de",
"role": "Developer"
},
{
"name": "Jordi Boggiano",
"email": "[email protected]",
"homepage": "http://seld.be",
"role": "Developer"
}
]
}
Optional, but highly recommended.
### support
Various information to get support about the project.
Support information includes the following:
* **email:** Email address for support.
* **issues:** URL to the Issue Tracker.
* **forum:** URL to the Forum.
* **wiki:** URL to the Wiki.
* **irc:** IRC channel for support, as irc://server/channel.
* **source:** URL to browse or download the sources.
An example:
{
"support": {
"email": "[email protected]",
"irc": "irc://irc.freenode.org/composer"
}
}
Optional.
### Package links
All of the following take an object which maps package names to
[version constraints](01-basic-usage.md#package-versions).
Example:
{
"require": {
"monolog/monolog": "1.0.*"
}
}
All links are optional fields.
`require` and `require-dev` additionally support stability flags (root-only).
These allow you to further restrict or expand the stability of a package beyond
the scope of the [minimum-stability](#minimum-stability) setting. You can apply
them to a constraint, or just apply them to an empty constraint if you want to
allow unstable packages of a dependency's dependency for example.
Example:
{
"require": {
"monolog/monolog": "1.0.*@beta",
"acme/foo": "@dev"
}
}
`require` and `require-dev` additionally support explicit references (i.e.
commit) for dev versions to make sure they are locked to a given state, even
when you run update. These only work if you explicitly require a dev version
and append the reference with `#<ref>`. Note that while this is convenient at
times, it should not really be how you use packages in the long term. You
should always try to switch to tagged releases as soon as you can, especially
if the project you work on will not be touched for a while.
Example:
{
"require": {
"monolog/monolog": "dev-master#2eb0c0978d290a1c45346a1955188929cb4e5db7",
"acme/foo": "1.0.x-dev#abc123"
}
}
It is possible to inline-alias a package constraint so that it matches a
constraint that it otherwise would not. For more information [see the
aliases article](articles/aliases.md).
#### require
Lists packages required by this package. The package will not be installed
unless those requirements can be met.
#### require-dev <span>(root-only)</span>
Lists packages required for developing this package, or running
tests, etc. The dev requirements of the root package only will be installed
if `install` or `update` is ran with `--dev`.
Packages listed here and their dependencies can not overrule the resolution
found with the packages listed in require. This is even true if a different
version of a package would be installable and solve the conflict. The reason
is that `install --dev` produces the exact same state as just `install`, apart
from the additional dev packages.
If you run into such a conflict, you can specify the conflicting package in
the require section and require the right version number to resolve the
conflict.
#### conflict
Lists packages that conflict with this version of this package. They
will not be allowed to be installed together with your package.
#### replace
Lists packages that are replaced by this package. This allows you to fork a
package, publish it under a different name with its own version numbers, while
packages requiring the original package continue to work with your fork because
it replaces the original package.
This is also useful for packages that contain sub-packages, for example the main
symfony/symfony package contains all the Symfony Components which are also
available as individual packages. If you require the main package it will
automatically fulfill any requirement of one of the individual components,
since it replaces them.
Caution is advised when using replace for the sub-package purpose explained
above. You should then typically only replace using `self.version` as a version
constraint, to make sure the main package only replaces the sub-packages of
that exact version, and not any other version, which would be incorrect.
#### provide
List of other packages that are provided by this package. This is mostly
useful for common interfaces. A package could depend on some virtual
`logger` package, any library that implements this logger interface would
simply list it in `provide`.
### suggest
Suggested packages that can enhance or work well with this package. These are
just informational and are displayed after the package is installed, to give
your users a hint that they could add more packages, even though they are not
strictly required.
The format is like package links above, except that the values are free text
and not version constraints.
Example:
{
"suggest": {
"monolog/monolog": "Allows more advanced logging of the application flow"
}
}
### autoload
Autoload mapping for a PHP autoloader.
Currently [`PSR-0`](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md)
autoloading, `classmap` generation and `files` are supported. PSR-0 is the recommended way though
since it offers greater flexibility (no need to regenerate the autoloader when you add
classes).
#### PSR-0
Under the `psr-0` key you define a mapping from namespaces to paths, relative to the
package root. Note that this also supports the PEAR-style non-namespaced convention.
The PSR-0 references are all combined, during install/update, into a single key => value
array which may be found in the generated file `vendor/composer/autoload_namespaces.php`.
Example:
{
"autoload": {
"psr-0": {
"Monolog": "src/",
"Vendor\\Namespace\\": "src/",
"Vendor_Namespace_": "src/"
}
}
}
If you need to search for a same prefix in multiple directories,
you can specify them as an array as such:
{
"autoload": {
"psr-0": { "Monolog": ["src/", "lib/"] }
}
}
The PSR-0 style is not limited to namespace declarations only but may be
specified right down to the class level. This can be useful for libraries with
only one class in the global namespace. If the php source file is also located
in the root of the package, for example, it may be declared like this:
{
"autoload": {
"psr-0": { "UniqueGlobalClass": "" }
}
}
If you want to have a fallback directory where any namespace can be, you can
use an empty prefix like:
{
"autoload": {
"psr-0": { "": "src/" }
}
}
#### Classmap
The `classmap` references are all combined, during install/update, into a single
key => value array which may be found in the generated file
`vendor/composer/autoload_classmap.php`. This map is built by scanning for
classes in all `.php` and `.inc` files in the given directories/files.
You can use the classmap generation support to define autoloading for all libraries
that do not follow PSR-0. To configure this you specify all directories or files
to search for classes.
Example:
{
"autoload": {
"classmap": ["src/", "lib/", "Something.php"]
}
}
#### Files
If you want to require certain files explicitly on every request then you can use
the 'files' autoloading mechanism. This is useful if your package includes PHP functions
that cannot be autoloaded by PHP.
Example:
{
"autoload": {
"files": ["src/MyLibrary/functions.php"]
}
}
### include-path
> **DEPRECATED**: This is only present to support legacy projects, and all new code
> should preferably use autoloading. As such it is a deprecated practice, but the
> feature itself will not likely disappear from Composer.
A list of paths which should get appended to PHP's `include_path`.
Example:
{
"include-path": ["lib/"]
}
Optional.
### target-dir
Defines the installation target.
In case the package root is below the namespace declaration you cannot
autoload properly. `target-dir` solves this problem.
An example is Symfony. There are individual packages for the components. The
Yaml component is under `Symfony\Component\Yaml`. The package root is that
`Yaml` directory. To make autoloading possible, we need to make sure that it
is not installed into `vendor/symfony/yaml`, but instead into
`vendor/symfony/yaml/Symfony/Component/Yaml`, so that the autoloader can load
it from `vendor/symfony/yaml`.
To do that, `autoload` and `target-dir` are defined as follows:
{
"autoload": {
"psr-0": { "Symfony\\Component\\Yaml": "" }
},
"target-dir": "Symfony/Component/Yaml"
}
Optional.
### minimum-stability <span>(root-only)</span>
This defines the default behavior for filtering packages by stability. This
defaults to `stable`, so if you rely on a `dev` package, you should specify
it in your file to avoid surprises.
All versions of each package are checked for stability, and those that are less
stable than the `minimum-stability` setting will be ignored when resolving
your project dependencies. Specific changes to the stability requirements of
a given package can be done in `require` or `require-dev` (see
[package links](#package-links)).
Available options (in order of stability) are `dev`, `alpha`, `beta`, `RC`,
and `stable`.
### repositories <span>(root-only)</span>
Custom package repositories to use.
By default composer just uses the packagist repository. By specifying
repositories you can get packages from elsewhere.
Repositories are not resolved recursively. You can only add them to your main
`composer.json`. Repository declarations of dependencies' `composer.json`s are
ignored.
The following repository types are supported:
* **composer:** A composer repository is simply a `packages.json` file served
via the network (HTTP, FTP, SSH), that contains a list of `composer.json`
objects with additional `dist` and/or `source` information. The `packages.json`
file is loaded using a PHP stream. You can set extra options on that stream
using the `options` parameter.
* **vcs:** The version control system repository can fetch packages from git,
svn and hg repositories.
* **pear:** With this you can import any pear repository into your composer
project.
* **package:** If you depend on a project that does not have any support for
composer whatsoever you can define the package inline using a `package`
repository. You basically just inline the `composer.json` object.
For more information on any of these, see [Repositories](05-repositories.md).
Example:
{
"repositories": [
{
"type": "composer",
"url": "http://packages.example.com"
},
{
"type": "composer",
"url": "https://packages.example.com",
"options": {
"ssl": {
"verify_peer": "true"
}
}
},
{
"type": "vcs",
"url": "https://github.com/Seldaek/monolog"
},
{
"type": "pear",
"url": "http://pear2.php.net"
},
{
"type": "package",
"package": {
"name": "smarty/smarty",
"version": "3.1.7",
"dist": {
"url": "http://www.smarty.net/files/Smarty-3.1.7.zip",
"type": "zip"
},
"source": {
"url": "http://smarty-php.googlecode.com/svn/",
"type": "svn",
"reference": "tags/Smarty_3_1_7/distribution/"
}
}
}
]
}
> **Note:** Order is significant here. When looking for a package, Composer
will look from the first to the last repository, and pick the first match.
By default Packagist is added last which means that custom repositories can
override packages from it.
### config <span>(root-only)</span>
A set of configuration options. It is only used for projects.
The following options are supported:
* **process-timeout:** Defaults to `300`. The duration processes like git clones
can run before Composer assumes they died out. You may need to make this
higher if you have a slow connection or huge vendors.
* **use-include-path:** Defaults to `false`. If true, the Composer autoloader
will also look for classes in the PHP include path.
* **github-protocols:** Defaults to `["git", "https", "http"]`. A list of
protocols to use for github.com clones, in priority order. Use this if you are
behind a proxy or have somehow bad performances with the git protocol.
* **github-oauth:** A list of domain names and oauth keys. For example using
`{"github.com": "oauthtoken"}` as the value of this option will use `oauthtoken`
to access private repositories on github and to circumvent the low IP-based
rate limiting of their API.
* **vendor-dir:** Defaults to `vendor`. You can install dependencies into a
different directory if you want to.
* **bin-dir:** Defaults to `vendor/bin`. If a project includes binaries, they
will be symlinked into this directory.
* **cache-dir:** Defaults to `$home/cache` on unix systems and
`C:\Users\<user>\AppData\Local\Composer` on Windows. Stores all the caches
used by composer. See also [COMPOSER_HOME](03-cli.md#composer-home).
* **cache-files-dir:** Defaults to `$cache-dir/files`. Stores the zip archives
of packages.
* **cache-repo-dir:** Defaults to `$cache-dir/repo`. Stores repository metadata
for the `composer` type and the VCS repos of type `svn`, `github` and `*bitbucket`.
* **cache-vcs-dir:** Defaults to `$cache-dir/vcs`. Stores VCS clones for
loading VCS repository metadata for the `git`/`hg` types and to speed up installs.
* **cache-files-ttl:** Defaults to `15552000` (6 months). Composer caches all
dist (zip, tar, ..) packages that it downloads. Those are purged after six
months of being unused by default. This option allows you to tweak this
duration (in seconds) or disable it completely by setting it to 0.
* **cache-files-maxsize:** Defaults to `300MiB`. Composer caches all
dist (zip, tar, ..) packages that it downloads. When the garbage collection
is periodically ran, this is the maximum size the cache will be able to use.
Older (less used) files will be removed first until the cache fits.
* **notify-on-install:** Defaults to `true`. Composer allows repositories to
define a notification URL, so that they get notified whenever a package from
that repository is installed. This option allows you to disable that behaviour.
Example:
{
"config": {
"bin-dir": "bin"
}
}
### scripts <span>(root-only)</span>
Composer allows you to hook into various parts of the installation process
through the use of scripts.
See [Scripts](articles/scripts.md) for events details and examples.
### extra
Arbitrary extra data for consumption by `scripts`.
This can be virtually anything. To access it from within a script event
handler, you can do:
$extra = $event->getComposer()->getPackage()->getExtra();
Optional.
### bin
A set of files that should be treated as binaries and symlinked into the `bin-dir`
(from config).
See [Vendor Binaries](articles/vendor-binaries.md) for more details.
Optional.
← [Command-line interface](03-cli.md) | [Repositories](05-repositories.md) →
| {
"content_hash": "3e160bb64afb6c08bbf1900ad2760160",
"timestamp": "",
"source": "github",
"line_count": 659,
"max_line_length": 104,
"avg_line_length": 32.48710166919575,
"alnum_prop": 0.6873744686813956,
"repo_name": "1stvamp/composer",
"id": "2742612a0ad2aeec543c7bedb05e7a93c25d872c",
"size": "21426",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/04-schema.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "3417070"
},
{
"name": "Ruby",
"bytes": "194"
}
],
"symlink_target": ""
} |
package JFlex.gui;
import java.awt.Component;
/**
* Constraints for layout elements of GridLayout
*
* @author Gerwin Klein
* @version JFlex 1.3.5, $Revision: 1.11 $, $Date: 2001/10/08 10:08:13 $
*/
public class GridPanelConstraint {
int x, y, width, height, handle;
Component component;
public GridPanelConstraint(int x, int y, int width, int height,
int handle, Component component) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.handle = handle;
this.component = component;
}
}
| {
"content_hash": "ad7a9c0bcd04db2f840aa29768209904",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 72,
"avg_line_length": 23.23076923076923,
"alnum_prop": 0.6043046357615894,
"repo_name": "ombt/ombt",
"id": "7c153278fd82e723d3a09ea97e779a36be426f31",
"size": "2067",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ihgp.mine/src/jflex/JFlex/src/JFlex/gui/GridPanelConstraint.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "AngelScript",
"bytes": "387"
},
{
"name": "Assembly",
"bytes": "337961"
},
{
"name": "Awk",
"bytes": "19196"
},
{
"name": "Batchfile",
"bytes": "1455"
},
{
"name": "C",
"bytes": "18492457"
},
{
"name": "C#",
"bytes": "7338"
},
{
"name": "C++",
"bytes": "11440913"
},
{
"name": "CSS",
"bytes": "28033"
},
{
"name": "Fortran",
"bytes": "103924"
},
{
"name": "GLSL",
"bytes": "4629"
},
{
"name": "HTML",
"bytes": "116310"
},
{
"name": "Harbour",
"bytes": "12291"
},
{
"name": "Java",
"bytes": "477588"
},
{
"name": "JavaScript",
"bytes": "26054"
},
{
"name": "Lex",
"bytes": "137956"
},
{
"name": "Makefile",
"bytes": "951705"
},
{
"name": "PHP",
"bytes": "16"
},
{
"name": "Perl",
"bytes": "5625197"
},
{
"name": "Python",
"bytes": "10696"
},
{
"name": "QMake",
"bytes": "2403"
},
{
"name": "R",
"bytes": "220944"
},
{
"name": "Raku",
"bytes": "191928"
},
{
"name": "Roff",
"bytes": "819974"
},
{
"name": "SWIG",
"bytes": "504140"
},
{
"name": "Scilab",
"bytes": "25999"
},
{
"name": "Shell",
"bytes": "1584381"
},
{
"name": "SourcePawn",
"bytes": "374363"
},
{
"name": "TSQL",
"bytes": "53230"
},
{
"name": "Tcl",
"bytes": "1475389"
},
{
"name": "VBA",
"bytes": "194"
},
{
"name": "XS",
"bytes": "10959"
},
{
"name": "Yacc",
"bytes": "1012991"
}
],
"symlink_target": ""
} |
import sys
sys.path.append("..")
import iac.app.libreoffice.calc as localc
import iac.app.libreoffice.writer as lowriter
import iac.app.gnumeric as gnumeric
| {
"content_hash": "2a6b9c16bbc789fce403906b05167ede",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 45,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.7974683544303798,
"repo_name": "Risto-Stevcev/iac-protocol",
"id": "7bbb3b5d85af34030708742a7e660c283c7f0d0f",
"size": "158",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "iac/interfaces.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "27273"
},
{
"name": "Shell",
"bytes": "5047"
}
],
"symlink_target": ""
} |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="sv" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Chopcoin</source>
<translation>Om Chopcoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>Chopcoin</b> version</source>
<translation><b>Chopcoin</b>-version</translation>
</message>
<message>
<location line="+57"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source>
<translation>
Detta är experimentell mjukvara.
Distribuerad under mjukvarulicensen MIT/X11, se den medföljande filen COPYING eller http://www.opensource.org/licenses/mit-license.php.
Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användning i OpenSSL Toolkit (http://www.openssl.org/) och kryptografisk mjukvara utvecklad av Eric Young ([email protected]) samt UPnP-mjukvara skriven av Thomas Bernard.</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation>Copyright</translation>
</message>
<message>
<location line="+0"/>
<source>The Chopcoin developers</source>
<translation>Chopcoin-utvecklarna</translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Adressbok</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>Dubbel-klicka för att ändra adressen eller etiketten</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Skapa ny adress</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopiera den markerade adressen till systemets Urklipp</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>&Ny adress</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your Chopcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation>Detta är dina Chopcoin-adresser för att ta emot betalningar. Du kan ge varje avsändare en egen adress så att du kan hålla reda på vem som betalar dig.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation>&Kopiera adress</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Visa &QR-kod</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a Chopcoin address</source>
<translation>Signera ett meddelande för att bevisa att du äger denna adress</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Signera &Meddelande</translation>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation>Ta bort den valda adressen från listan</translation>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation>Exportera informationen i den nuvarande fliken till en fil</translation>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation>&Exportera</translation>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified Chopcoin address</source>
<translation>Verifiera meddelandet för att vara säker på att den var signerad med den specificerade Chopcoin-adressen</translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation>&Verifiera Meddelande</translation>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Radera</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your Chopcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation>Detta är dina Chopcoin adresser för att skicka betalningar. Kolla alltid summan och den mottagande adressen innan du skickar Chopcoins.</translation>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation>Kopiera &etikett</translation>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation>&Editera</translation>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation>Skicka &Chopcoins</translation>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation>Exportera Adressbok</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kommaseparerad fil (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Fel vid export</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Kunde inte skriva till filen %1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Etikett</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adress</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(Ingen etikett)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Lösenords Dialog</translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Ange lösenord</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Nytt lösenord</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Upprepa nytt lösenord</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Ange plånbokens nya lösenord. <br/> Använd ett lösenord på <b>10 eller fler slumpmässiga tecken,</b> eller <b>åtta eller fler ord.</b></translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Kryptera plånbok</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Denna operation behöver din plånboks lösenord för att låsa upp plånboken.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Lås upp plånbok</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Denna operation behöver din plånboks lösenord för att dekryptera plånboken.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Dekryptera plånbok</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Ändra lösenord</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Ange plånbokens gamla och nya lösenord.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Bekräfta kryptering av plånbok</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR LITECOINS</b>!</source>
<translation>VARNING: Om du krypterar din plånbok och glömmer ditt lösenord, kommer du att <b>FÖRLORA ALLA DINA TILLGÅNGAR</b>!</translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Är du säker på att du vill kryptera din plånbok?</translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation>VIKTIGT: Alla tidigare säkerhetskopior du har gjort av plånbokens fil ska ersättas med den nya genererade, krypterade plånboks filen. Av säkerhetsskäl kommer tidigare säkerhetskopior av den okrypterade plånboks filen blir oanvändbara när du börjar använda en ny, krypterad plånbok.</translation>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Varning: Caps Lock är påslaget!</translation>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>Plånboken är krypterad</translation>
</message>
<message>
<location line="-56"/>
<source>Chopcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your chopcoins from being stolen by malware infecting your computer.</source>
<translation>Programmet kommer nu att stänga ner för att färdigställa krypteringen. Tänk på att en krypterad plånbok inte skyddar mot stöld om din dator är infekterad med en keylogger.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Kryptering av plånbok misslyckades</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Kryptering av plånbok misslyckades på grund av ett internt fel. Din plånbok blev inte krypterad.</translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>De angivna lösenorden överensstämmer inte.</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation>Upplåsning av plånbok misslyckades</translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Lösenordet för dekryptering av plånbok var felaktig.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Dekryptering av plånbok misslyckades</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Plånbokens lösenord har ändrats.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+233"/>
<source>Sign &message...</source>
<translation>Signera &meddelande...</translation>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation>Synkroniserar med nätverk...</translation>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation>&Översikt</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Visa översiktsvy av plånbok</translation>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation>&Transaktioner</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Bläddra i transaktionshistorik</translation>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Redigera listan med lagrade adresser och etiketter</translation>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Visa listan med adresser för att ta emot betalningar</translation>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation>&Avsluta</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Avsluta programmet</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about Chopcoin</source>
<translation>Visa information om Chopcoin</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Om &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Visa information om Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Alternativ...</translation>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation>&Kryptera plånbok...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Säkerhetskopiera plånbok...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&Byt Lösenord...</translation>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation>Importerar block från disk...</translation>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation>Återindexerar block på disken...</translation>
</message>
<message>
<location line="-347"/>
<source>Send coins to a Chopcoin address</source>
<translation>Skicka mynt till en Chopcoin-adress</translation>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for Chopcoin</source>
<translation>Ändra konfigurationsalternativ för Chopcoin</translation>
</message>
<message>
<location line="+9"/>
<source>Backup wallet to another location</source>
<translation>Säkerhetskopiera plånboken till en annan plats</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Byt lösenord för kryptering av plånbok</translation>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation>&Debug fönster</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Öppna debug- och diagnostikkonsolen</translation>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation>&Verifiera meddelande...</translation>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>Chopcoin</source>
<translation>Chopcoin</translation>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation>Plånbok</translation>
</message>
<message>
<location line="+101"/>
<source>&Send</source>
<translation>&Skicka</translation>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation>&Ta emot</translation>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation>&Adresser</translation>
</message>
<message>
<location line="+22"/>
<source>&About Chopcoin</source>
<translation>&Om Chopcoin</translation>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>&Visa / Göm</translation>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation>Visa eller göm huvudfönstret</translation>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation>Kryptera de privata nycklar som tillhör din plånbok</translation>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your Chopcoin addresses to prove you own them</source>
<translation>Signera meddelanden med din Chopcoinadress för att bevisa att du äger dem</translation>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified Chopcoin addresses</source>
<translation>Verifiera meddelanden för att vara säker på att de var signerade med den specificerade Chopcoin-adressen</translation>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>&Arkiv</translation>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation>&Inställningar</translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation>&Hjälp</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Verktygsfält för Tabbar</translation>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location line="+47"/>
<source>Chopcoin client</source>
<translation>Chopcoin-klient</translation>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to Chopcoin network</source>
<translation><numerusform>%n aktiv anslutning till Chopcoin-nätverket</numerusform><numerusform>%n aktiva anslutningar till Chopcoin-nätverket</numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation>Ingen block-källa tillgänglig...</translation>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation>Bearbetat %1 av %2 (uppskattade) block av transaktionshistorik.</translation>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation>Bearbetat %1 block i transaktionshistoriken.</translation>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation><numerusform>%n timme</numerusform><numerusform>%n timmar</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation><numerusform>%n dag</numerusform><numerusform>%n dagar</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation><numerusform>%n vecka</numerusform><numerusform>%n veckor</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation>%1 efter</translation>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation>Senast mottagna block genererades %1 sen.</translation>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation>Transaktioner efter denna kommer inte ännu vara synliga.</translation>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation>Fel</translation>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation>Varning</translation>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation>Information</translation>
</message>
<message>
<location line="+70"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation>Transaktionen överskrider storleksgränsen. Du kan dock fortfarande skicka den mot en kostnad av %1, som går till noderna som behandlar din transaktion och bidrar till nätverket. Vill du betala denna avgift?</translation>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation>Uppdaterad</translation>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation>Hämtar senaste...</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation>Bekräfta överföringsavgift</translation>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation>Transaktion skickad</translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation>Inkommande transaktion</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Datum: %1
Belopp: %2
Typ: %3
Adress: %4
</translation>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation>URI hantering</translation>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid Chopcoin address or malformed URI parameters.</source>
<translation>URI går inte att tolkas! Detta kan orsakas av en ogiltig Chopcoin-adress eller felaktiga URI parametrar.</translation>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Denna plånbok är <b>krypterad</b> och för närvarande <b>olåst</b></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Denna plånbok är <b>krypterad</b> och för närvarande <b>låst</b></translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+111"/>
<source>A fatal error occurred. Chopcoin can no longer continue safely and will quit.</source>
<translation>Ett allvarligt fel har uppstått. Chopcoin kan inte längre köras säkert och kommer att avslutas.</translation>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+104"/>
<source>Network Alert</source>
<translation>Nätverkslarm</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Redigera Adress</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Etikett</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Den etikett som är associerad med detta adressboksinlägg</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Adress</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>Adressen som är associerad med detta adressboksinlägg. Detta kan enbart ändras för sändande adresser.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation>Ny mottagaradress</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Ny avsändaradress</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Redigera mottagaradress</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Redigera avsändaradress</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Den angivna adressen "%1" finns redan i adressboken.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid Chopcoin address.</source>
<translation>Den angivna adressen "%1" är inte en giltig Chopcoin-adress.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Plånboken kunde inte låsas upp.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Misslyckades med generering av ny nyckel.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>Chopcoin-Qt</source>
<translation>Chopcoin-Qt</translation>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>version</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Användning:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation>kommandoradsalternativ</translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>UI alternativ</translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Ändra språk, till exempel "de_DE" (förvalt: systemets språk)</translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Starta som minimerad</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation>Visa startbilden vid uppstart (förvalt: 1)</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Alternativ</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Allmänt</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>
<translation>Valfri transaktionsavgift per kB som ser till att dina transaktioner behandlas snabbt. De flesta transaktioner är 1 kB.</translation>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>Betala överförings&avgift</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start Chopcoin after logging in to the system.</source>
<translation>Starta Chopcoin automatiskt efter inloggning.</translation>
</message>
<message>
<location line="+3"/>
<source>&Start Chopcoin on system login</source>
<translation>&Starta Chopcoin vid systemstart</translation>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation>Återställ alla klient inställningar till förvalen.</translation>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation>&Återställ Alternativ</translation>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation>&Nätverk</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the Chopcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Öppna automatiskt Chopcoin-klientens port på routern. Detta fungerar endast om din router har UPnP aktiverat.</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Tilldela port med hjälp av &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the Chopcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation>Anslut till Chopcoin-nätverket genom en SOCKS-proxy (t.ex. när du ansluter genom Tor).</translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>&Anslut genom SOCKS-proxy:</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>Proxy-&IP: </translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>Proxyns IP-adress (t.ex. 127.0.0.1)</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Port: </translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Proxyns port (t.ex. 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS &Version:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>SOCKS version av proxyn (t.ex. 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Fönster</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Visa endast en systemfältsikon vid minimering.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Minimera till systemfältet istället för aktivitetsfältet</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Minimera applikationen istället för att stänga ner den när fönstret stängs. Detta innebär att programmet fotrsätter att köras tills du väljer Avsluta i menyn.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>M&inimera vid stängning</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Visa</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>Användargränssnittets &språk: </translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting Chopcoin.</source>
<translation>Användargränssnittets språk kan ställas in här. Denna inställning träder i kraft efter en omstart av Chopcoin.</translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&Måttenhet att visa belopp i: </translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Välj en måttenhet att visa när du skickar mynt.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show Chopcoin addresses in the transaction list or not.</source>
<translation>Anger om Chopcoin-adresser skall visas i transaktionslistan.</translation>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>&Visa adresser i transaktionslistan</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>&OK</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Avbryt</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>&Verkställ</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation>standard</translation>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation>Bekräfta att alternativen ska återställs</translation>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation>Vissa inställningar kan behöva en omstart av klienten för att börja gälla.</translation>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation>Vill du fortsätta?</translation>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation>Varning</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting Chopcoin.</source>
<translation>Denna inställning träder i kraft efter en omstart av Chopcoin.</translation>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Den medföljande proxy adressen är ogiltig.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Formulär</translation>
</message>
<message>
<location line="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Chopcoin network after a connection is established, but this process has not completed yet.</source>
<translation>Den visade informationen kan vara inaktuell. Plånboken synkroniseras automatiskt med Chopcoin-nätverket efter att anslutningen är upprättad, men denna process har inte slutförts ännu.</translation>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation>Saldo:</translation>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>Obekräftade:</translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation>Plånbok</translation>
</message>
<message>
<location line="+107"/>
<source>Immature:</source>
<translation>Omogen:</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation>Den genererade balansen som ännu inte har mognat</translation>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Nyligen genomförda transaktioner</b></translation>
</message>
<message>
<location line="-101"/>
<source>Your current balance</source>
<translation>Ditt nuvarande saldo</translation>
</message>
<message>
<location line="+29"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation>Totalt antal transaktioner som ännu inte bekräftats, och som ännu inte räknas med i aktuellt saldo</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation>osynkroniserad</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start chopcoin: click-to-pay handler</source>
<translation>Kan inte starta chopcoin: klicka-och-betala handhavare</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation>QR-kod dialogruta</translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation>Begär Betalning</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Belopp:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Etikett:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Meddelande:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>&Spara som...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation>Fel vid skapande av QR-kod från URI.</translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation>Det angivna beloppet är ogiltigt, vänligen kontrollera.</translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>URI:n är för lång, försöka minska texten för etikett / meddelande.</translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation>Spara QR-kod</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>PNG-bilder (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Klientnamn</translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+339"/>
<source>N/A</source>
<translation>ej tillgänglig</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Klient-version</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>&Information</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>Använder OpenSSL version</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>Uppstartstid</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Nätverk</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Antalet anslutningar</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation>På testnet</translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>Blockkedja</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Aktuellt antal block</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation>Beräknade totala block</translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>Sista blocktid</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>&Öppna</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation>Kommandoradsalternativ</translation>
</message>
<message>
<location line="+7"/>
<source>Show the Chopcoin-Qt help message to get a list with possible Chopcoin command-line options.</source>
<translation>Visa Chopcoin-Qt hjälpmeddelande för att få en lista med möjliga Chopcoin kommandoradsalternativ.</translation>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation>&Visa</translation>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&Konsol</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>Kompileringsdatum</translation>
</message>
<message>
<location line="-104"/>
<source>Chopcoin - Debug window</source>
<translation>Chopcoin - Debug fönster</translation>
</message>
<message>
<location line="+25"/>
<source>Chopcoin Core</source>
<translation>Chopcoin Kärna</translation>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>Debugloggfil</translation>
</message>
<message>
<location line="+7"/>
<source>Open the Chopcoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation>Öppna Chopcoin debug-loggfilen som finns i datakatalogen. Detta kan ta några sekunder för stora loggfiler.</translation>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Rensa konsollen</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the Chopcoin RPC console.</source>
<translation>Välkommen till Chopcoin RPC-konsollen.</translation>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Använd upp- och ner-pilarna för att navigera i historiken, och <b>Ctrl-L</b> för att rensa skärmen.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Skriv <b>help</b> för en översikt av alla kommandon.</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+124"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Skicka pengar</translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation>Skicka till flera mottagare samtidigt</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>Lägg till &mottagare</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>Ta bort alla transaktions-fält</translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Rensa &alla</translation>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation>Balans:</translation>
</message>
<message>
<location line="+10"/>
<source>123.456 BTC</source>
<translation>123,456 BTC</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Bekräfta sändordern</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&Skicka</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> till %2 (%3)</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Bekräfta skickade mynt</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Är du säker på att du vill skicka %1?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation> och </translation>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Mottagarens adress är inte giltig, vänligen kontrollera igen.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Det betalade beloppet måste vara större än 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Värdet överstiger ditt saldo.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Totalvärdet överstiger ditt saldo när transaktionsavgiften %1 är pålagd.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Dubblett av adress funnen, kan bara skicka till varje adress en gång per sändning.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation>Fel: Transaktionen gick inte att skapa!</translation>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Fel: Transaktionen avslogs. Detta kan hända om några av mynten i plånboken redan spenderats, t.ex om du använt en kopia av wallet.dat och mynt spenderades i kopian men inte markerats som spenderas här.</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Formulär</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>&Belopp:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Betala &Till:</translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Adressen som betalningen skall skickas till (t.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Ange ett namn för den här adressen och lägg till den i din adressbok</translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>&Etikett:</translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation>Välj adress från adresslistan</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Klistra in adress från Urklipp</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation>Ta bort denna mottagare</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a Chopcoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Ange en Chopcoin-adress (t.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>Signaturer - Signera / Verifiera ett Meddelande</translation>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation>&Signera Meddelande</translation>
</message>
<message>
<location line="+6"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation>Du kan signera meddelanden med dina adresser för att bevisa att du äger dem. Var försiktig med vad du signerar eftersom phising-attacker kan försöka få dig att skriva över din identitet till någon annan. Signera bara väldetaljerade påståenden du kan gå i god för.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Adressen att signera meddelandet med (t.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation>Välj en adress från adressboken</translation>
</message>
<message>
<location line="-203"/>
<location line="+213"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-203"/>
<source>Paste address from clipboard</source>
<translation>Klistra in adress från Urklipp</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>Skriv in meddelandet du vill signera här</translation>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation>Signatur</translation>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation>Kopiera signaturen till systemets Urklipp</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this Chopcoin address</source>
<translation>Signera meddelandet för att bevisa att du äger denna adress</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Signera &Meddelande</translation>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation>Rensa alla fält</translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Rensa &alla</translation>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation>&Verifiera Meddelande</translation>
</message>
<message>
<location line="+6"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation>Skriv in din adress, meddelande (se till att du kopierar radbrytningar, mellanslag, tabbar, osv. exakt) och signatur nedan för att verifiera meddelandet. Var noga med att inte läsa in mer i signaturen än vad som finns i det signerade meddelandet, för att undvika att luras av en man-in-the-middle attack.</translation>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Adressen som meddelandet var signerat med (t.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified Chopcoin address</source>
<translation>Verifiera meddelandet för att vara säker på att den var signerad med den angivna Chopcoin-adressen</translation>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation>Verifiera &Meddelande</translation>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation>Rensa alla fält</translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a Chopcoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Ange en Chopcoin-adress (t.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Klicka "Signera Meddelande" för att få en signatur</translation>
</message>
<message>
<location line="+3"/>
<source>Enter Chopcoin signature</source>
<translation>Ange Chopcoin-signatur</translation>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>Den angivna adressen är ogiltig.</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>Vad god kontrollera adressen och försök igen.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation>Den angivna adressen refererar inte till en nyckel.</translation>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>Upplåsningen av plånboken avbröts.</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>Privata nyckel för den angivna adressen är inte tillgänglig.</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Signeringen av meddelandet misslyckades.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Meddelandet är signerat.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Signaturen kunde inte avkodas.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Kontrollera signaturen och försök igen.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>Signaturen matchade inte meddelandesammanfattningen.</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Meddelandet verifikation misslyckades.</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Meddelandet är verifierad.</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>The Chopcoin developers</source>
<translation>Chopcoin-utvecklarna</translation>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation>Öppet till %1</translation>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation>%1/nerkopplad</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/obekräftade</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 bekräftelser</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Status</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation><numerusform>, sänd genom %n nod</numerusform><numerusform>, sänd genom %n noder</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>Källa</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Genererad</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>Från</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>Till</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation>egen adress</translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>etikett</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Kredit</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation><numerusform>mognar om %n block</numerusform><numerusform>mognar om %n fler block</numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>inte accepterad</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Belasta</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Transaktionsavgift</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Nettobelopp</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Meddelande</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Kommentar</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>Transaktions-ID</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>Genererade mynt måste vänta 120 block innan de kan användas. När du skapade detta block sändes det till nätverket för att läggas till i blockkedjan. Om blocket inte kommer in i kedjan kommer det att ändras till "accepteras inte" och kommer ej att gå att spendera. Detta kan ibland hända om en annan nod genererar ett block nästan samtidigt som dig.</translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>Debug information</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Transaktion</translation>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation>Inputs</translation>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Mängd</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>sant</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>falsk</translation>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation>, har inte lyckats skickas ännu</translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation><numerusform>Öppet för %n mer block</numerusform><numerusform>Öppet för %n mer block</numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation>okänd</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Transaktionsdetaljer</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Den här panelen visar en detaljerad beskrivning av transaktionen</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+225"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Typ</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adress</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Mängd</translation>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation><numerusform>Öppet för %n mer block</numerusform><numerusform>Öppet för %n mer block</numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>Öppet till %1</translation>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation>Offline (%1 bekräftelser)</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>Obekräftad (%1 av %2 bekräftelser)</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Bekräftad (%1 bekräftelser)</translation>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation><numerusform>Genererade balansen kommer att finnas tillgänglig när den mognar om %n mer block</numerusform><numerusform>Genererade balansen kommer att finnas tillgänglig när den mognar om %n fler block</numerusform></translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Det här blocket togs inte emot av några andra noder och kommer antagligen inte att bli godkänt.</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Genererad men inte accepterad</translation>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation>Mottagen med</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Mottaget från</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Skickad till</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Betalning till dig själv</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Genererade</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(n/a)</translation>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Transaktionsstatus. Håll muspekaren över för att se antal bekräftelser.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Tidpunkt då transaktionen mottogs.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Transaktionstyp.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Transaktionens destinationsadress.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Belopp draget eller tillagt till balans.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation>Alla</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Idag</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Denna vecka</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Denna månad</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Föregående månad</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Det här året</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Period...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Mottagen med</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Skickad till</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Till dig själv</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Genererade</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Övriga</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Sök efter adress eller etikett </translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Minsta mängd</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Kopiera adress</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopiera etikett</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopiera belopp</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation>Kopiera transaktions ID</translation>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Ändra etikett</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Visa transaktionsdetaljer</translation>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation>Exportera Transaktionsdata</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kommaseparerad fil (*. csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Bekräftad</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Typ</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Etikett</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adress</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Mängd</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Fel vid export</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Kunde inte skriva till filen %1.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Intervall:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>till</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation>Skicka pengar</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation>&Exportera</translation>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation>Exportera informationen i den nuvarande fliken till en fil</translation>
</message>
<message>
<location line="+193"/>
<source>Backup Wallet</source>
<translation>Säkerhetskopiera Plånbok</translation>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation>Plånboks-data (*.dat)</translation>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation>Säkerhetskopiering misslyckades</translation>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation>Det inträffade ett fel när plånboken skulle sparas till den nya platsen.</translation>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation>Säkerhetskopiering lyckades</translation>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation>Plånbokens data har sparats till den nya platsen.</translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+94"/>
<source>Chopcoin version</source>
<translation>Chopcoin version</translation>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation>Användning:</translation>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or chopcoind</source>
<translation>Skicka kommando till -server eller chopcoind</translation>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation>Lista kommandon</translation>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation>Få hjälp med ett kommando</translation>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation>Inställningar:</translation>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: chopcoin.conf)</source>
<translation>Ange konfigurationsfil (förvalt: chopcoin.conf)</translation>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: chopcoind.pid)</source>
<translation>Ange pid fil (förvalt: chopcoind.pid)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Ange katalog för data</translation>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Sätt databas cache storleken i megabyte (förvalt: 25)</translation>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 9333 or testnet: 19333)</source>
<translation>Lyssna efter anslutningar på <port> (förvalt: 9333 eller testnet: 19333)</translation>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Ha som mest <n> anslutningar till andra klienter (förvalt: 125)</translation>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Anslut till en nod för att hämta klientadresser, och koppla från</translation>
</message>
<message>
<location line="+82"/>
<source>Specify your own public address</source>
<translation>Ange din egen publika adress</translation>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Tröskelvärde för att koppla ifrån klienter som missköter sig (förvalt: 100)</translation>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Antal sekunder att hindra klienter som missköter sig från att ansluta (förvalt: 86400)</translation>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation>Ett fel uppstod vid upprättandet av RPC port %u för att lyssna på IPv4: %s</translation>
</message>
<message>
<location line="+27"/>
<source>Listen for JSON-RPC connections on <port> (default: 9332 or testnet: 19332)</source>
<translation>Lyssna på JSON-RPC-anslutningar på <port> (förvalt: 9332 eller testnet: 19332)</translation>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Tillåt kommandon från kommandotolken och JSON-RPC-kommandon</translation>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Kör i bakgrunden som tjänst och acceptera kommandon</translation>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation>Använd testnätverket</translation>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Acceptera anslutningar utifrån (förvalt: 1 om ingen -proxy eller -connect)</translation>
</message>
<message>
<location line="-80"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=chopcoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "Chopcoin Alert" [email protected]
</source>
<translation>%s, du behöver sätta ett rpclösensord i konfigurationsfilen:
%s
Det är rekommenderat att använda följande slumpade lösenord:
rpcuser=chopcoinrpc
rpcpassword=%s
(du behöver inte komma ihåg lösenordet)
Användarnamnet och lösenordet FÅR INTE bara detsamma.
Om filen inte existerar, skapa den med enbart ägarläsbara filrättigheter.
Det är också rekommenderat att sätta alertnotify så du meddelas om problem;
till exempel: alertnotify=echo %%s | mail -s "Chopcoin Alert" [email protected]
</translation>
</message>
<message>
<location line="+17"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation>Ett fel uppstod vid upprättandet av RPC port %u för att lyssna på IPv6, faller tillbaka till IPV4: %s</translation>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation>Bind till given adress och lyssna alltid på den. Använd [värd]:port notation för IPv6</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. Chopcoin is probably already running.</source>
<translation>Kan inte låsa data-mappen %s. Chopcoin körs förmodligen redan.</translation>
</message>
<message>
<location line="+3"/>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Fel: Transaktionen avslogs! Detta kan hända om några av mynten i plånboken redan spenderats, t.ex om du använt en kopia av wallet.dat och mynt spenderades i kopian men inte markerats som spenderas här.</translation>
</message>
<message>
<location line="+4"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>
<translation>Fel: Denna transaktion kräver en transaktionsavgift på minst %s på grund av dess storlek, komplexitet, eller användning av senast mottagna chopcoins!</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation>Exekvera kommando när ett relevant meddelande är mottagen (%s i cmd är utbytt med ett meddelande)</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>Exekvera kommando när en plånbokstransaktion ändras (%s i cmd är ersatt av TxID)</translation>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation>Sätt den maximala storleken av hög-prioriterade/låg-avgifts transaktioner i byte (förvalt: 27000)</translation>
</message>
<message>
<location line="+6"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation>Detta är ett förhands testbygge - använd på egen risk - använd inte för mining eller handels applikationer</translation>
</message>
<message>
<location line="+5"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Varning: -paytxfee är satt väldigt hög! Detta är avgiften du kommer betala för varje transaktion.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation>Varning: Visade transaktioner kanske inte är korrekt! Du kan behöva uppgradera, eller andra noder kan behöva uppgradera.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Chopcoin will not work properly.</source>
<translation>Varning: Vänligen kolla så att din dators datum och tid är korrekt! Om din klocka går fel kommer Chopcoin inte fungera korrekt.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation>Varning: fel vid läsning av wallet.dat! Alla nycklar lästes korrekt, men transaktionsdatan eller adressbokens poster kanske saknas eller är felaktiga.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation>Varning: wallet.dat korrupt, datan har räddats! Den ursprungliga wallet.dat har sparas som wallet.{timestamp}.bak i %s; om ditt saldo eller transaktioner är felaktiga ska du återställa från en säkerhetskopia.</translation>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation>Försök att rädda de privata nycklarna från en korrupt wallet.dat</translation>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation>Block skapande inställningar:</translation>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation>Koppla enbart upp till den/de specificerade noden/noder</translation>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation>Korrupt blockdatabas har upptäckts</translation>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>Hitta egen IP-adress (förvalt: 1 under lyssning och utan -externalip)</translation>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation>Vill du bygga om blockdatabasen nu?</translation>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation>Fel vid initiering av blockdatabasen</translation>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation>Fel vid initiering av plånbokens databasmiljö %s!</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation>Fel vid inläsning av blockdatabasen</translation>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation>Fel vid öppning av blockdatabasen</translation>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation>Fel: Hårddiskutrymme är lågt!</translation>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation>Fel: Plånboken är låst, det går ej att skapa en transaktion!</translation>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation>Fel: systemfel:</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>Misslyckades att lyssna på någon port. Använd -listen=0 om du vill detta.</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation>Misslyckades att läsa blockinformation</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation>Misslyckades att läsa blocket</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation>Misslyckades att synkronisera blockindex</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation>Misslyckades att skriva blockindex</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation>Misslyckades att skriva blockinformation</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation>Misslyckades att skriva blocket</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation>Misslyckades att skriva filinformation</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation>Misslyckades att skriva till myntdatabas</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation>Misslyckades att skriva transaktionsindex</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation>Misslyckades att skriva ångradata</translation>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation>Sök efter klienter med DNS sökningen (förvalt: 1 om inte -connect)</translation>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation>Generera mynt (förvalt: 0)</translation>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation>Hur många block att kontrollera vid uppstart (standardvärde: 288, 0 = alla)</translation>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation>Hur grundlig blockverifikationen är (0-4, förvalt: 3)</translation>
</message>
<message>
<location line="+19"/>
<source>Not enough file descriptors available.</source>
<translation>Inte tillräckligt med filbeskrivningar tillgängliga.</translation>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation>Återskapa blockkedjans index från nuvarande blk000??.dat filer</translation>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation>Ange antalet trådar för att hantera RPC anrop (standard: 4)</translation>
</message>
<message>
<location line="+26"/>
<source>Verifying blocks...</source>
<translation>Verifierar block...</translation>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation>Verifierar plånboken...</translation>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation>Importerar block från extern blk000??.dat fil</translation>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation>Ange antalet skriptkontrolltrådar (upp till 16, 0 = auto, <0 = lämna så många kärnor lediga, förval: 0)</translation>
</message>
<message>
<location line="+77"/>
<source>Information</source>
<translation>Information</translation>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation>Ogiltig -tor adress: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation>Ogiltigt belopp för -minrelaytxfee=<belopp>: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation>Ogiltigt belopp för -mintxfee=<belopp>: '%s'</translation>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation>Upprätthåll ett fullständigt transaktionsindex (förval: 0)</translation>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>Maximal buffert för mottagning per anslutning, <n>*1000 byte (förvalt: 5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>Maximal buffert för sändning per anslutning, <n>*1000 byte (förvalt: 5000)</translation>
</message>
<message>
<location line="+2"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation>Acceptera bara blockkedjans matchande inbyggda kontrollpunkter (förvalt: 1)</translation>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation>Anslut enbart till noder i nätverket <net> (IPv4, IPv6 eller Tor)</translation>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation>Skriv ut extra felsökningsinformation. Gäller alla andra -debug* alternativ</translation>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation>Skriv ut extra felsökningsinformation om nätverk</translation>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation>Skriv ut tid i felsökningsinformationen</translation>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the Chopcoin Wiki for SSL setup instructions)</source>
<translation>SSL-inställningar: (se Chopcoin-wikin för SSL-setup instruktioner)</translation>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation>Välj socks-proxy version att använda (4-5, förvalt: 5)</translation>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Skicka trace-/debuginformation till terminalen istället för till debug.log</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>Skicka trace-/debuginformation till debugger</translation>
</message>
<message>
<location line="+5"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation>Sätt maximal blockstorlek i byte (förvalt: 250000)</translation>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>Sätt minsta blockstorlek i byte (förvalt: 0)</translation>
</message>
<message>
<location line="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>Krymp debug.log filen vid klient start (förvalt: 1 vid ingen -debug)</translation>
</message>
<message>
<location line="+1"/>
<source>Signing transaction failed</source>
<translation>Signering av transaktion misslyckades</translation>
</message>
<message>
<location line="+2"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Ange timeout för uppkoppling i millisekunder (förvalt: 5000)</translation>
</message>
<message>
<location line="+4"/>
<source>System error: </source>
<translation>Systemfel:</translation>
</message>
<message>
<location line="+4"/>
<source>Transaction amount too small</source>
<translation>Transaktions belopp för liten</translation>
</message>
<message>
<location line="+1"/>
<source>Transaction amounts must be positive</source>
<translation>Transaktionens belopp måste vara positiva</translation>
</message>
<message>
<location line="+1"/>
<source>Transaction too large</source>
<translation>Transaktionen är för stor</translation>
</message>
<message>
<location line="+7"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Använd UPnP för att mappa den lyssnande porten (förvalt: 0)</translation>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Använd UPnP för att mappa den lyssnande porten (förvalt: 1 under lyssning)</translation>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation>Använd en proxy för att nå tor (förvalt: samma som -proxy)</translation>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation>Användarnamn för JSON-RPC-anslutningar</translation>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation>Varning</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>Varning: denna version är föråldrad, uppgradering krävs!</translation>
</message>
<message>
<location line="+1"/>
<source>You need to rebuild the databases using -reindex to change -txindex</source>
<translation>Du måste återskapa databaserna med -reindex för att ändra -txindex</translation>
</message>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation>wallet.dat korrupt, räddning misslyckades</translation>
</message>
<message>
<location line="-50"/>
<source>Password for JSON-RPC connections</source>
<translation>Lösenord för JSON-RPC-anslutningar</translation>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Tillåt JSON-RPC-anslutningar från specifika IP-adresser</translation>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Skicka kommandon till klient på <ip> (förvalt: 127.0.0.1)</translation>
</message>
<message>
<location line="-120"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Exekvera kommando när det bästa blocket ändras (%s i cmd är utbytt av blockhash)</translation>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation>Uppgradera plånboken till senaste formatet</translation>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Sätt storleken på nyckelpoolen till <n> (förvalt: 100)</translation>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Sök i blockkedjan efter saknade plånboks transaktioner</translation>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Använd OpenSSL (https) för JSON-RPC-anslutningar</translation>
</message>
<message>
<location line="-26"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Serverns certifikatfil (förvalt: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Serverns privata nyckel (förvalt: server.pem)</translation>
</message>
<message>
<location line="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Accepterade krypteringsalgoritmer (förvalt: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation>Det här hjälp medelandet</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Det går inte att binda till %s på den här datorn (bind returnerade felmeddelande %d, %s)</translation>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation>Anslut genom socks-proxy</translation>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Tillåt DNS-sökningar för -addnode, -seednode och -connect</translation>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation>Laddar adresser...</translation>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Fel vid inläsningen av wallet.dat: Plånboken är skadad</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of Chopcoin</source>
<translation>Fel vid inläsningen av wallet.dat: Plånboken kräver en senare version av Chopcoin</translation>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart Chopcoin to complete</source>
<translation>Plånboken behöver skrivas om: Starta om Chopcoin för att färdigställa</translation>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation>Fel vid inläsning av plånboksfilen wallet.dat</translation>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Ogiltig -proxy adress: '%s'</translation>
</message>
<message>
<location line="+56"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Okänt nätverk som anges i -onlynet: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>Okänd -socks proxy version begärd: %i</translation>
</message>
<message>
<location line="-96"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>Kan inte matcha -bind adress: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>Kan inte matcha -externalip adress: '%s'</translation>
</message>
<message>
<location line="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Ogiltigt belopp för -paytxfee=<belopp>:'%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation>Ogiltig mängd</translation>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation>Otillräckligt med chopcoins</translation>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation>Laddar blockindex...</translation>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Lägg till en nod att koppla upp mot och försök att hålla anslutningen öppen</translation>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. Chopcoin is probably already running.</source>
<translation>Det går inte att binda till %s på den här datorn. Chopcoin är förmodligen redan igång.</translation>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Avgift per KB att lägga till på transaktioner du skickar</translation>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation>Laddar plånbok...</translation>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation>Kan inte nedgradera plånboken</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation>Kan inte skriva standardadress</translation>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation>Söker igen...</translation>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation>Klar med laddning</translation>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation>Att använda %s alternativet</translation>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation>Fel</translation>
</message>
<message>
<location line="-31"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>Du behöver välja ett rpclösensord i konfigurationsfilen:
%s
Om filen inte existerar, skapa den med filrättigheten endast läsbar för ägaren.</translation>
</message>
</context>
</TS>
| {
"content_hash": "aeae63bd0c560142d86d28ff15471389",
"timestamp": "",
"source": "github",
"line_count": 2939,
"max_line_length": 395,
"avg_line_length": 39.61075195644777,
"alnum_prop": 0.6337359125893348,
"repo_name": "chop0/chopcoin",
"id": "3f16ade72291b213575a7ce3ac5e2431dbae1bdb",
"size": "117154",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/qt/locale/bitcoin_sv.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "56020"
},
{
"name": "C++",
"bytes": "3634807"
},
{
"name": "CSS",
"bytes": "2254"
},
{
"name": "HTML",
"bytes": "101230"
},
{
"name": "Makefile",
"bytes": "13384"
},
{
"name": "NSIS",
"bytes": "6106"
},
{
"name": "Objective-C",
"bytes": "1052"
},
{
"name": "Objective-C++",
"bytes": "5864"
},
{
"name": "Python",
"bytes": "69714"
},
{
"name": "QMake",
"bytes": "14714"
},
{
"name": "Roff",
"bytes": "18284"
},
{
"name": "Shell",
"bytes": "20611"
}
],
"symlink_target": ""
} |
<?xml version="${version}" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<!--
This file exists so the maven-war-plugin doesn't complain when the webapp is staged.
-->
<web-app>
<display-name>${artifactId} Chrome CRX Webapp</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
| {
"content_hash": "2a0b610d9abe041a65b99cf9044830e7",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 86,
"avg_line_length": 26.352941176470587,
"alnum_prop": 0.6763392857142857,
"repo_name": "KlavierCat/crx-maven-plugin",
"id": "721f89e4129dda465025fe3ba73e21c08b291aee",
"size": "534",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "24728"
},
{
"name": "HTML",
"bytes": "117202"
},
{
"name": "Java",
"bytes": "26150"
},
{
"name": "JavaScript",
"bytes": "122154"
}
],
"symlink_target": ""
} |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/space/engine/shared_engine_overdriver_mk1.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "efddb4c564c38bb18850a8b085272f7c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 89,
"avg_line_length": 24.46153846153846,
"alnum_prop": 0.7012578616352201,
"repo_name": "obi-two/Rebelion",
"id": "dcd27a30341b9b32eb80d80dec8d30eb94c33b8c",
"size": "463",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "data/scripts/templates/object/draft_schematic/space/engine/shared_engine_overdriver_mk1.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "11818"
},
{
"name": "C",
"bytes": "7699"
},
{
"name": "C++",
"bytes": "2293610"
},
{
"name": "CMake",
"bytes": "39727"
},
{
"name": "PLSQL",
"bytes": "42065"
},
{
"name": "Python",
"bytes": "7499185"
},
{
"name": "SQLPL",
"bytes": "41864"
}
],
"symlink_target": ""
} |
package org.apache.jena.sparql.function.user;
import java.util.List;
import java.util.Map;
import org.apache.jena.sparql.core.Var ;
import org.apache.jena.sparql.expr.* ;
import org.apache.jena.sparql.sse.builders.ExprBuildException ;
/**
* An expression transformer that will expand user defined function expressions
* so they do not explicitly rely on other user defined functions.
* <p>
* See {@link UserDefinedFunctionFactory#getPreserveDependencies()} for discussion of what this means in practise
* </p>
*/
public class ExprTransformExpand extends ExprTransformCopy {
private Map<String, UserDefinedFunctionDefinition> definitions;
/**
* Creates a new transformer
* @param defs User defined function definitions
*/
public ExprTransformExpand(Map<String, UserDefinedFunctionDefinition> defs) {
if (defs == null) throw new IllegalArgumentException("defs cannot be null");
this.definitions = defs;
}
@Override
public Expr transform(ExprFunctionN func, ExprList args) {
ExprFunction f = func.getFunction();
if (this.shouldExpand(f)) {
UserDefinedFunctionDefinition def = this.definitions.get(f.getFunction().getFunctionIRI());
UserDefinedFunction uFunc = (UserDefinedFunction) def.newFunctionInstance();
//Need to watch out for the case where the arguments supplied to the invoked
//function are in a different order to the arguments supplied to the defined
//function
//Thus we will build the list of arguments used to expand the inner function
//manually
List<Var> defArgs = def.getArgList();
ExprList subArgs = new ExprList();
for (int i = 0; i < args.size(); i++) {
Expr arg = args.get(i);
String var = arg.getVarName();
if (var == null) {
//Non-variable args may be passed as-is
subArgs.add(arg);
} else {
//Variable args must be checked to ensure they are within the number of
//arguments of the invoked function
//We then use the arg as-is to substitute
if (i > defArgs.size()) throw new ExprBuildException("Unable to expand function dependency, the function <" + def.getUri() + "> is called but uses an argument ?" + var + " which is not an argument to the outer function");
subArgs.add(arg);
}
}
//Expand the function
uFunc.build(def.getUri(), subArgs);
return uFunc.getActualExpr();
} else {
return super.transform(func, args);
}
}
private boolean shouldExpand(ExprFunction func) {
return this.definitions.containsKey(func.getFunctionIRI());
}
}
| {
"content_hash": "9929fa444a6bb398fd375ab840cca1c3",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 241,
"avg_line_length": 39.62162162162162,
"alnum_prop": 0.6156207366984994,
"repo_name": "jianglili007/jena",
"id": "57fe17c17651b17835c1cee1150360180233b567",
"size": "3737",
"binary": false,
"copies": "14",
"ref": "refs/heads/master",
"path": "jena-arq/src/main/java/org/apache/jena/sparql/function/user/ExprTransformExpand.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "145"
},
{
"name": "AspectJ",
"bytes": "3446"
},
{
"name": "Batchfile",
"bytes": "16824"
},
{
"name": "C++",
"bytes": "5037"
},
{
"name": "CSS",
"bytes": "26180"
},
{
"name": "Elixir",
"bytes": "2548"
},
{
"name": "HTML",
"bytes": "100718"
},
{
"name": "Java",
"bytes": "24969664"
},
{
"name": "JavaScript",
"bytes": "980003"
},
{
"name": "Lex",
"bytes": "82672"
},
{
"name": "Perl",
"bytes": "37209"
},
{
"name": "Ruby",
"bytes": "354871"
},
{
"name": "Shell",
"bytes": "223651"
},
{
"name": "Smarty",
"bytes": "17096"
},
{
"name": "Thrift",
"bytes": "3201"
},
{
"name": "Web Ontology Language",
"bytes": "518275"
},
{
"name": "XSLT",
"bytes": "101830"
}
],
"symlink_target": ""
} |
package org.aludratest.service.gui.component;
/** Represents a checkbox in a GUI.
* @author Joerg Langnickel
* @author Volker Bergmann */
public interface Checkbox extends Element<Checkbox> {
/** Selects or deselects a Checkbox due to overgiven String If the text is null or marked as null the operation is not
* executed.
* @param selectString 'true' or 'false' */
public void select(String selectString);
/** Selects the checkbox. */
public void select();
/** Unselects the checkbox. */
public void deselect();
/** Asserts that the checkbox is checked. */
public void assertChecked();
/** Asserts that the checkbox is in the in the state expected by the passed text If the text is null or marked as null the
* operation is not executed.
* @param text <code>"true"</code> or <code>"false"</code>. Anything else (non-null) will be interpreted as <code>false</code> */
public void assertChecked(String text);
/** Returns if the checkbox is currently checked or not.
*
* @return <code>true</code> if the checkbox is currently checked (has a checkmark in its box), <code>false</code> otherwise. */
public boolean isChecked();
}
| {
"content_hash": "cb0184e81b93f39ef1f5c9e7723403a2",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 133,
"avg_line_length": 35.76470588235294,
"alnum_prop": 0.6842105263157895,
"repo_name": "AludraTest/aludratest",
"id": "4430c76e429208e785b8ad09205fee4db4d48d3b",
"size": "1837",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/org/aludratest/service/gui/component/Checkbox.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "159"
},
{
"name": "CSS",
"bytes": "661"
},
{
"name": "FreeMarker",
"bytes": "112"
},
{
"name": "Java",
"bytes": "2012051"
},
{
"name": "JavaScript",
"bytes": "4912"
},
{
"name": "Shell",
"bytes": "118"
},
{
"name": "XSLT",
"bytes": "6092"
}
],
"symlink_target": ""
} |
// Author: [email protected] (Joshua Marantz)
#ifndef NET_INSTAWEB_UTIL_PUBLIC_GOOGLE_MESSAGE_HANDLER_H_
#define NET_INSTAWEB_UTIL_PUBLIC_GOOGLE_MESSAGE_HANDLER_H_
// TODO(huibao): Remove this forwarding header and update references.
#include "pagespeed/kernel/base/google_message_handler.h"
#endif // NET_INSTAWEB_UTIL_PUBLIC_GOOGLE_MESSAGE_HANDLER_H_
| {
"content_hash": "50e753ce75fdadc6ef8a32deca84bd26",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 69,
"avg_line_length": 32.81818181818182,
"alnum_prop": 0.778393351800554,
"repo_name": "webhost/mod_pagespeed",
"id": "292ec91623fa4d1f0ab59cf5eebd62ad596a6001",
"size": "956",
"binary": false,
"copies": "2",
"ref": "refs/heads/latest-stable",
"path": "net/instaweb/util/public/google_message_handler.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "1639"
},
{
"name": "C",
"bytes": "30586"
},
{
"name": "C++",
"bytes": "12033228"
},
{
"name": "CSS",
"bytes": "65947"
},
{
"name": "HTML",
"bytes": "203277"
},
{
"name": "JavaScript",
"bytes": "2365110"
},
{
"name": "Makefile",
"bytes": "33813"
},
{
"name": "Objective-C++",
"bytes": "1308"
},
{
"name": "PHP",
"bytes": "661"
},
{
"name": "Perl",
"bytes": "14872"
},
{
"name": "Protocol Buffer",
"bytes": "57074"
},
{
"name": "Python",
"bytes": "190375"
},
{
"name": "Shell",
"bytes": "314042"
}
],
"symlink_target": ""
} |
A curated list of awesome Go frameworks, libraries and software. Inspired by [awesome-python](https://github.com/vinta/awesome-python).
### Contributing
Please take a quick gander at the [contribution guidelines](https://github.com/avelino/awesome-go/blob/master/CONTRIBUTING.md) first. Thanks to all [contributors](https://github.com/avelino/awesome-go/graphs/contributors); you rock!
[Join us on Slack](https://gophers.slack.com/messages/awesome/) to chat with other awesome-go maintainers!
#### *If you see a package or project here that is no longer maintained or is not a good fit, please submit a pull request to improve this file. Thank you!*
### Contents
- [Awesome Go](#awesome-go)
- [Audio & Music](#audiomusic)
- [Authentication & OAuth](#authentication--oauth)
- [Command Line](#command-line)
- [Configuration](#configuration)
- [Continuous Integration](#continuous-integration)
- [CSS Preprocessors](#css-preprocessors)
- [Data Structures](#data-structures)
- [Database](#database)
- [Database Drivers](#database-drivers)
- [Date & Time](#date--time)
- [Distributed Systems](#distributed-systems)
- [Email](#email)
- [Embeddable Scripting Languages](#embeddable-scripting-languages)
- [Financial](#financial)
- [Forms](#forms)
- [Game Development](#game-development)
- [Generation & Generics](#generation--generics)
- [GUI](#gui)
- [Hardware](#hardware)
- [Images](#images)
- [Logging](#logging)
- [Machine Learning](#machine-learning)
- [Messaging](#messaging)
- [Miscellaneous](#miscellaneous)
- [Natural Language Processing](#natural-language-processing)
- [Networking](#networking)
- [OpenGL](#opengl)
- [ORM](#orm)
- [Package Management](#package-management)
- [Resource Embedding](#resource-embedding)
- [Science and Data Analysis](#science-and-data-analysis)
- [Security](#security)
- [Serialization](#serialization)
- [Template Engines](#template-engines)
- [Testing](#testing)
- [Text Processing](#text-processing)
- [Third-party APIs](#third-party-apis)
- [Utilities](#utilities)
- [Validation](#validation)
- [Version Control](#version-control)
- [Video](#video)
- [Web Frameworks](#web-frameworks)
- [Middlewares](#middlewares)
- [Actual middlewares](#actual-middlewares)
- [Libraries for creating HTTP middlewares](#libraries-for-creating-http-middlewares)
- [Windows](#windows)
- [Tools](#tools)
- [Code Analysis](#code-analysis)
- [Editor Plugins](#editor-plugins)
- [Go Tools](#go-tools)
- [Software Packages](#software-packages)
- [DevOps Tools](#devops-tools)
- [Other Software](#other-software)
- [Server Applications](#server-applications)
- [Resources](#resources)
- [Benchmarks](#benchmarks)
- [Conferences](#conferences)
- [E-Books](#e-books)
- [Twitter](#twitter)
- [Websites](#websites)
- [Tutorials](#tutorials)
## Audio/Music
*Libraries for manipulating audio.*
* [flac](https://github.com/eaburns/flac) - A native Go FLAC decoder.
* [go-sox](https://github.com/krig/go-sox) - libsox bindings for go.
* [PortAudio](https://code.google.com/p/portaudio-go/) - Go bindings for the PortAudio audio I/O library.
* [portmidi](https://github.com/rakyll/portmidi) - Go bindings for PortMidi.
* [taglib](https://github.com/wtolson/go-taglib) - Go bindings for taglib.
* [vorbis](https://github.com/mccoyst/vorbis) - A "native" Go Vorbis decoder (uses CGO, but has no dependencies).
* [waveform](https://github.com/mdlayher/waveform) - Go package capable of generating waveform images from audio streams.
## Authentication & OAuth
*Libraries for implementing authentications schemes.*
* [Go-AWS-Auth](https://github.com/smartystreets/go-aws-auth) - AWS (Amazon Web Services) request signing library.
* [go-jose](https://github.com/square/go-jose) - A fairly complete implementation of the JOSE working group's JSON Web Token, JSON Web Signatures, and JSON Web Encryption specs.
* [go.auth](https://github.com/bradrydzewski/go.auth) - Authentication API for Go web applications.
* [gorbac](https://github.com/mikespook/gorbac) - provides a lightweight role-based access control (RBAC) implementation in Golang.
* [goth](https://github.com/markbates/goth) - provides a simple, clean, and idiomatic way to use OAuth and OAuth2. Handles multiple provides out of the box.
* [httpauth](https://github.com/goji/httpauth) - HTTP Authentication middleware.
* [jwt-go](https://github.com/dgrijalva/jwt-go) - Golang implementation of JSON Web Tokens (JWT).
* [oauth2](https://github.com/golang/oauth2) - Successor of goauth2. Generic OAuth 2.0 package that comes with JWT, Google APIs, Compute Engine and App Engine support.
* [osin](https://github.com/RangelReale/osin) - Golang OAuth2 server library.
* [permissions2](https://github.com/xyproto/permissions2) - Library for keeping track of users, login states and permissions. Uses secure cookies and bcrypt.
* [yubigo](https://github.com/GeertJohan/yubigo) - a Yubikey client package that provides a simple API to integrate the Yubico Yubikey into a go application.
## Command Line
### Standard CLI
*Libraries for building standard or basic Command Line applications*
* [cli-init](https://github.com/tcnksm/cli-init) - The easy way to start building Golang command line application.
* [cobra](https://github.com/spf13/cobra) - A Commander for modern Go CLI interactions
* [codegangsta/cli](https://github.com/codegangsta/cli) - A small package for building command line apps in Go.
* [kingpin](https://github.com/alecthomas/kingpin) - A command line and flag parser supporting sub commands.
* [liner](https://github.com/peterh/liner) - A Go readline-like library for command-line interfaces.
* [mitchellh/cli](https://github.com/mitchellh/cli) - A Go library for implementing command-line interfaces.
* [ukautz/clif](https://github.com/ukautz/clif) - A small command line interface framework.
### Advanced Console UIs
*Libraries for building Console Applications and Console User Interfaces*
* [chalk](https://github.com/ttacon/chalk) - Intuitive package for prettifying terminal/console output.
* [color](https://github.com/fatih/color) - Versatile package for colored terminal output.
* [go-colortext](https://github.com/daviddengcn/go-colortext) - Go library for color output in terminals.
* [gocui](https://github.com/jroimartin/gocui) - Minimalist Go library aimed at creating Console User Interfaces.
* [gommon/color](https://github.com/labstack/gommon/tree/master/color) - Style terminal text.
* [termbox-go](https://github.com/nsf/termbox-go) - Termbox is a library for creating cross-platform text-based interfaces.
* [termtables](https://github.com/apcera/termtables) - A Go port of the Ruby library [terminal-tables](https://github.com/visionmedia/terminal-table) for simple ASCII table generation as well as providing markdown and HTML output
* [termui](https://github.com/gizak/termui) - Go terminal dashboard based on **termbox-go** and inspired by [blessed-contrib](https://github.com/yaronn/blessed-contrib).
## Configuration
*Libraries for configuration parsing*
* [config](https://github.com/olebedev/config) - JSON or YAML configuration wrapper with environment variables and flags parsing.
* [env](https://github.com/caarlos0/env) - Parse environment variables to Go structs (with defaults).
* [envcfg](https://github.com/tomazk/envcfg) - Un-marshaling environment variables to Go structs.
* [envconf](https://github.com/ian-kent/envconf) - Configuration from environment
* [envconfig](https://github.com/vrischmann/envconfig) - Read your configuration from environment variables.
* [gofigure](https://github.com/ian-kent/gofigure) - Go application configuration made easy
* [ini](https://github.com/go-ini/ini) - Go package for read and write INI files
* [mini](https://github.com/FogCreek/mini) - A golang package for parsing ini-style configuration files
* [viper](https://github.com/spf13/viper) - Go configuration with fangs
## Continuous Integration
*Tools for help with continuous integration*
* [goveralls](https://github.com/mattn/goveralls) - Go integration for Coveralls.io continuous code coverage tracking system.
* [overalls](https://github.com/bluesuncorp/overalls) - Multi-Package go project coverprofile for tools like goveralls
## CSS Preprocessors
*Libraries for preprocessing CSS files*
* [c6](https://github.com/c9s/c6) - High performance SASS compatible-implementation compiler written in Go
* [gcss](https://github.com/yosssi/gcss) - Pure Go CSS Preprocessor.
## Data Structures
*Generic datastructures and algorithms in Go.*
* [bitset](https://github.com/willf/bitset) - Go package implementing bitsets.
* [bloom](https://github.com/surge/bloom) - Bloom filters implemented in Go.
* [boomfilters](https://github.com/tylertreat/BoomFilters) - probabilistic data structures for processing continuous, unbounded streams
* [cuckoofilter](https://github.com/seiflotfy/cuckoofilter) - Cuckoo filter: a good alternative to a counting bloom filter implemented in Go.
* [encoding](https://github.com/surge/encoding) - Integer Compression Libraries for Go.
* [go-datastructures](https://github.com/Workiva/go-datastructures) - a collection of useful, performant, and thread-safe data structures
* [golang-set](https://github.com/deckarep/golang-set) - Thread-Safe and Non-Thread-Safe high-performance sets for Go.
* [goskiplist](https://github.com/ryszard/goskiplist) - A skip list implementation in Go.
* [mafsa](https://github.com/smartystreets/mafsa) - MA-FSA implementation with Minimal Perfect Hashing
* [skiplist](https://github.com/gansidui/skiplist) - Skiplist implementation in Go
* [trie](https://github.com/derekparker/trie) - Trie implementation in Go
* [ttlcache](https://github.com/diegobernardes/ttlcache) - An in-memory LRU string-interface{} map with expiration for golang
* [willf/bloom](https://github.com/willf/bloom) - Go package implementing Bloom filters.
## Database
*Databases implemented in Go.*
* [bolt](https://github.com/boltdb/bolt) - A low-level key/value database for Go.
* [cache2go](https://github.com/muesli/cache2go) - An in-memory key:value cache which supports automatic invalidation based on timeouts.
* [couchcache](https://github.com/codingsince1985/couchcache) - A RESTful caching micro-service backed by Couchbase server.
* [diskv](https://github.com/peterbourgon/diskv) - A home-grown disk-backed key-value store.
* [forestdb](https://github.com/couchbase/goforestdb) - Go bindings for ForestDB.
* [GCache](https://github.com/bluele/gcache) - Cache library with support for expirable Cache, LFU, LRU and ARC.
* [go-cache](https://github.com/pmylund/go-cache) - An in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications.
* [goleveldb](https://github.com/syndtr/goleveldb) - An implementation of the [LevelDB](https://github.com/google/leveldb) key/value database in the Go.
* [groupcache](https://github.com/golang/groupcache) - Groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases.
* [influxdb](https://github.com/influxdb/influxdb) - Scalable datastore for metrics, events, and real-time analytics
* [ledisdb](https://github.com/siddontang/ledisdb) - Ledisdb is a high performance NoSQL like Redis based on LevelDB.
* [levigo](https://github.com/jmhodges/levigo) - Levigo is a Go wrapper for LevelDB.
* [tiedot](https://github.com/HouzuoGuo/tiedot) - Your NoSQL database powered by Golang.
*Database tools.*
* [go-mysql](https://github.com/siddontang/go-mysql) - A go toolset to handle MySQL protocol and replication.
* [go-mysql-elasticsearch](https://github.com/siddontang/go-mysql-elasticsearch) - Sync your MySQL data into Elasticsearch automatically.
* [goose](https://bitbucket.org/liamstask/goose) - Database migration tool. You can manage your database's evolution by creating incremental SQL or Go scripts.
* [kingshard](https://github.com/flike/kingshard) - kingshard is a high performance proxy for MySQL powered by Golang.
* [myreplication](https://github.com/2tvenom/myreplication) - MySql binary log replication listener. Support statement and row based replication.
* [orchestrator](https://github.com/outbrain/orchestrator) - MySQL replication topology manager & visualizer
* [pgweb](https://github.com/sosedoff/pgweb) - A web-based PostgreSQL database browser
* [pravasan](https://github.com/pravasan/pravasan) - Simple Migration tool - currently for MySQL but planning to support soon for Postgres, SQLite, MongoDB, etc.,
* [sql-migrate](https://github.com/rubenv/sql-migrate) - Database migration tool. Allows embedding migrations into the application using go-bindata.
* [vitess](https://github.com/youtube/vitess) - vitess provides servers and tools which facilitate scaling of MySQL databases for large scale web services.
*SQL query builder, libraries for building and using SQL.*
* [Dotsql](https://github.com/gchaincl/dotsql) - Go library that helps you keep sql files in one place and use it with ease.
* [goqu](https://github.com/doug-martin/goqu) - An idiomatic SQL builder and query library.
* [scaneo](https://github.com/variadico/scaneo) - Generate Go code to convert database rows into arbitrary structs.
* [Squirrel](https://github.com/lann/squirrel) - Go library that helps you build SQL queries.
## Database Drivers
*Libraries for connecting and operating databases.*
* Relational Databases
* [firebirdsql](https://github.com/nakagami/firebirdsql) - Firebird RDBMS SQL driver for Go
* [go-adodb](https://github.com/mattn/go-adodb) - Microsoft ActiveX Object DataBase driver for go that using database/sql.
* [go-bqstreamer](https://github.com/rounds/go-bqstreamer) - BigQuery fast and concurrent stream insert.
* [go-mssqldb](https://github.com/denisenkom/go-mssqldb) - Microsoft MSSQL driver prototype in go language.
* [go-oci8](https://github.com/mattn/go-oci8) - Oracle driver for go that using database/sql.
* [go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) - MySQL driver for Go.
* [go-sqlite3](https://github.com/mattn/go-sqlite3) - SQLite3 driver for go that using database/sql.
* [gofreetds](https://github.com/minus5/gofreetds) Microsoft MSSQL driver. Go wrapper over [FreeTDS](http://www.freetds.org).
* [pq](https://github.com/lib/pq) - Pure Go Postgres driver for database/sql.
* NoSQL Databases
* [aerospike-client-go](https://github.com/aerospike/aerospike-client-go) - Aerospike client in Go language.
* [cayley](https://github.com/google/cayley) - A graph database with support for multiple backends.
* [go-couchbase](https://github.com/couchbase/go-couchbase) - Couchbase client in Go
* [go-couchdb](https://github.com/fjl/go-couchdb) - Yet another CouchDB HTTP API wrapper for Go
* [gocb](https://github.com/couchbaselabs/gocb) - Official Couchbase Go SDK
* [gocql](http://gocql.github.io) - A Go language driver for Apache Cassandra.
* [gomemcache](https://github.com/bradfitz/gomemcache/) - memcache client library for the Go programming language.
* [gorethink](https://github.com/dancannon/gorethink) - Go language driver for RethinkDB
* [mgo](http://godoc.org/labix.org/v2/mgo) - MongoDB driver for the Go language that implements a rich and well tested selection of features under a very simple API following standard Go idioms.
* [neo4j](https://github.com/cihangir/neo4j) - Neo4j Rest API Bindings for Golang
* [Neo4j-GO](https://github.com/davemeehan/Neo4j-GO) - Neo4j REST Client in golang.
* [neoism](https://github.com/jmcvetta/neoism) - Neo4j client for Golang
* [redigo](https://github.com/garyburd/redigo) - Redigo is a Go client for the Redis database.
* [redis](https://github.com/go-redis/redis) - Redis client for Golang
* [redis](https://github.com/hoisie/redis) - A simple, powerful Redis client for Go.
* Search and Analytic Databases
* [bleve](https://github.com/blevesearch/bleve) - A modern text indexing library for go.
* [elastic](https://github.com/olivere/elastic) - Elasticsearch client for Google Go.
* [elastigo](https://github.com/mattbaird/elastigo) - A Elasticsearch client library.
* [goes](https://github.com/belogik/goes) - A library to interact with Elasticsearch.
## Date & Time
*Libraries for working with dates and times.*
* [now](https://github.com/jinzhu/now) - Now is a time toolkit for golang.
* [timeutil](https://github.com/leekchan/timeutil) - Useful extensions (Timedelta, Strftime, ...) to the golang's time package.
## Distributed Systems
*Packages that help with building Distributed Systems.*
* [go-jump](https://github.com/dgryski/go-jump) - A port of Google's "Jump" Consistent Hash function.
* [gorpc](https://github.com/valyala/gorpc) - Simple, fast and scalable RPC library for high load.
* [grpc-go](https://github.com/grpc/grpc-go) - The Go language implementation of gRPC. HTTP/2 based RPC.
* [raft](https://github.com/hashicorp/raft) - Golang implementation of the Raft consensus protocol, by HashiCorp.
* [torrent](https://github.com/anacrolix/torrent) - BitTorrent client package.
* [dht](https://godoc.org/github.com/anacrolix/torrent/dht) - BitTorrent Kademlia DHT implementation.
## Email
*Libraries that implement email creation and sending*
* [douceur](https://github.com/aymerick/douceur) - CSS inliner for your HTML emails.
* [email](https://github.com/jordan-wright/email) - A robust and flexible email library for Go.
* [go-dkim](https://github.com/toorop/go-dkim) - A DKIM library, to sign & verify email.
* [Gomail](https://github.com/go-gomail/gomail/) - Gomail is a very simple and powerful package to send emails.
* [MailHog](https://github.com/mailhog/MailHog) - Email and SMTP testing with web and API interface
* [SendGrid](https://github.com/sendgrid/sendgrid-go) - SendGrid's Go library for sending email
* [smtp](https://github.com/mailhog/smtp) - SMTP server protocol state machine
## Embeddable Scripting Languages
*Embedding other languages inside your go code*
* [agora](https://github.com/PuerkitoBio/agora) - Dynamically typed, embeddable programming language in Go
* [anko](https://github.com/mattn/anko) - Scriptable interpreter written in Go
* [gisp](https://github.com/jcla1/gisp) - Simple LISP in Go
* [go-duktape](https://github.com/olebedev/go-duktape) - Duktape JavaScript engine bindings for Go
* [go-lua](https://github.com/Shopify/go-lua) - A port of the Lua 5.2 VM to pure Go
* [go-python](https://github.com/sbinet/go-python) - naive go bindings to the CPython C-API
* [golua](https://github.com/aarzilli/golua) - Go bindings for Lua C API
* [gopher-lua](https://github.com/yuin/gopher-lua) - a Lua 5.1 VM and compiler written in Go
* [otto](https://github.com/robertkrimen/otto) - A JavaScript interpreter written in Go
* [purl](https://github.com/ian-kent/purl) - Perl 5.18.2 embedded in Go
## Financial
*Packages for accounting and finance*
* [accounting](https://github.com/leekchan/accounting) - money and currency formatting for golang
* [decimal](https://github.com/shopspring/decimal) - Arbitrary-precision fixed-point decimal numbers
## Forms
*Libraries for working with forms.*
* [bind](https://github.com/robfig/bind) - Bind form data to any Go values
* [binding](https://github.com/mholt/binding) - Binds form and JSON data from net/http Request to struct.
* [formam](https://github.com/monoculum/formam) - decode form's values into a struct.
* [forms](https://github.com/albrow/forms) - A framework-agnostic library for parsing and validating form/JSON data which supports multipart forms and files.
* [nosurf](https://github.com/justinas/nosurf) - A CSRF protection middleware for Go.
## Game Development
*Awesome game development libraries.*
* [GarageEngine](https://github.com/vova616/GarageEngine) - 2d game engine written in Go working on OpenGL.
* [glop](https://github.com/runningwild/glop) - Glop (Game Library Of Power) is a fairly simple cross-platform game library.
* [go-astar](https://github.com/beefsack/go-astar) - Go implementation of the A* path finding algorithm
* [go-collada](https://github.com/GlenKelley/go-collada) - Go package for working with the Collada file format.
* [go3d](https://github.com/ungerik/go3d) - A performance oriented 2D/3D math package for Go
* [gonet](https://github.com/xtaci/gonet) - A game server skeleton implemented with golang
* [Leaf](https://github.com/name5566/leaf) - A lightweight game server framework
## Generation & Generics
*Tools to enhance the language with features like generics via code generation*
* [gen](https://github.com/clipperhouse/gen) - Code generation tool for ‘generics’-like functionality.
* [go-linq](https://github.com/ahmetalpbalkan/go-linq) - .NET LINQ-like query methods for Go.
* [pkgreflect](https://github.com/ungerik/pkgreflect) - A Go preprocessor for package scoped reflection.
## GUI
*Libraries for building GUI Applications*
* [go-gtk](http://mattn.github.io/go-gtk/) - Go bindings for GTK
* [go-qml](https://github.com/go-qml/qml) - QML support for the Go language
* [gosx-notifier](https://github.com/deckarep/gosx-notifier) - OSX Desktop Notifications library for Go.
* [gotk3](https://github.com/conformal/gotk3) - Go bindings for GTK3.
* [gxui](https://github.com/google/gxui) - A Go cross platform UI library.
* [ui](https://github.com/andlabs/ui) - Platform-native GUI library for Go.
* [walk](https://github.com/lxn/walk) - Windows application library kit for Go.
## Hardware
*Libraries, tools, and tutorials for interacting with hardware.*
See [go-hardware](https://github.com/rakyll/go-hardware) for a comprehensive list.
## Images
*Libraries for manipulating images.*
* [bimg](https://github.com/h2non/bimg) - Small package for fast and efficient image processing using libvips
* [geopattern](https://github.com/pravj/geopattern) - Create beautiful generative image patterns from a string.
* [gift](https://github.com/disintegration/gift) - Package of image processing filters.
* [go-cairo](https://github.com/ungerik/go-cairo) - Go binding for the cairo graphics library.
* [go-gd](https://github.com/bolknote/go-gd) - Go binding for GD library
* [go-nude](https://github.com/koyachi/go-nude) - Nudity detection with Go.
* [go-opencv](https://github.com/lazywei/go-opencv) - Go bindings for OpenCV.
* [go-webcolors](https://github.com/jyotiska/go-webcolors) - Port of webcolors library from Python to Go.
* [imagick](https://github.com/gographics/imagick) - Go binding to ImageMagick's MagickWand C API.
* [imaginary](https://github.com/h2non/imaginary) - Fast and simple HTTP microservice for image resizing
* [imaging](https://github.com/disintegration/imaging) - Simple Go image processing package.
* [img](https://github.com/hawx/img) - A selection of image manipulation tools.
* [picfit](https://github.com/thoas/picfit) - An image resizing server written in Go
* [resize](https://github.com/nfnt/resize) - Image resizing for the Go with common interpolation methods.
* [rez](https://github.com/bamiaux/rez) - Image resizing in pure Go and SIMD.
* [smartcrop](https://github.com/muesli/smartcrop) - Finds good crops for arbitrary images and crop sizes
* [svgo](https://github.com/ajstarks/svgo) - Go Language Library for SVG generation.
* [tga](https://github.com/ftrvxmtrx/tga) - Package tga is a TARGA image format decoder/encoder.
## Logging
*Libraries for generating and working with log files.*
* [glog](https://github.com/golang/glog) - Leveled execution logs for Go.
* [go-log](https://github.com/siddontang/go-log) - Log lib supports level and multi handlers.
* [go-log](https://github.com/ian-kent/go-log) - A log4j implementation in Go.
* [go-logger](https://github.com/apsdehal/go-logger) - Simple logger of Go Programs, with level handlers.
* [log-voyage](https://github.com/firstrow/logvoyage) - Full-featured logging saas written in golang.
* [logex](https://github.com/go-logex/logex) - An golang log lib, supports tracking and level, wrap by standard log lib
* [logrus](https://github.com/Sirupsen/logrus) - a structured logger for Go.
* [logrusly](https://github.com/sebest/logrusly) - [logrus](https://github.com/sirupsen/logrus) plug-in to send errors to a [Loggly](https://www.loggly.com/).
* [logutils](https://github.com/hashicorp/logutils) - Utilities for slightly better logging in Go (Golang) extending the standard logger.
* [logxi](https://github.com/mgutz/logxi) - A 12-factor app logger that is fast and makes you happy.
* [lumberjack](https://github.com/natefinch/lumberjack) - Simple rolling logger, implements io.WriteCloser.
* [mlog](https://github.com/jbrodriguez/mlog) - A simple logging module for go, with 5 levels, an optional rotating logfile feature and stdout/stderr output.
* [seelog](https://github.com/cihub/seelog) - logging functionality with flexible dispatching, filtering, and formatting.
* [stdlog](https://github.com/alexcesaro/log) - Stdlog is an object-oriented library providing leveled logging. It is very useful for cron jobs.
* [tail](https://github.com/ActiveState/tail) - A Go package striving to emulate the features of the BSD tail program.
## Machine Learning
*Libraries for Machine Learning.*
* [bayesian](https://github.com/jbrukh/bayesian) - Naive Bayesian Classification for Golang.
* [CloudForest](https://github.com/ryanbressler/CloudForest) - Fast, flexible, multi-threaded ensembles of decision trees for machine learning in pure Go.
* [go-fann](https://github.com/white-pony/go-fann) - Go bindings for Fast Artificial Neural Networks(FANN) library.
* [go-galib](https://github.com/thoj/go-galib) - Genetic Algorithms library written in Go / golang
* [go-pr](https://github.com/daviddengcn/go-pr) - Pattern recognition package in Go lang.
* [gobrain](https://github.com/goml/gobrain) - Neural Networks written in go
* [godist](https://github.com/e-dard/godist) - Various probability distributions, and associated methods.
* [GoLearn](https://github.com/sjwhitworth/golearn) - General Machine Learning library for Go.
* [golinear](https://github.com/danieldk/golinear) - liblinear bindings for Go
* [goRecommend](https://github.com/timkaye11/goRecommend) - Recommendation Algorithms library written in Go.
* [libsvm](https://github.com/datastream/libsvm) - libsvm golang version derived work based on LIBSVM 3.14.
* [mlgo](https://code.google.com/p/mlgo/) - This project aims to provide minimalistic machine learning algorithms in Go.
* [neural-go](https://github.com/schuyler/neural-go) - A multilayer perceptron network implemented in Go, with training via backpropagation.
* [probab](https://code.google.com/p/probab/) - Probability distribution functions. Bayesian inference. Written in pure Go.
* [regommend](https://github.com/muesli/regommend) - Recommendation & collaborative filtering engine
* [shield](https://github.com/eaigner/shield) - Bayesian text classifier with flexible tokenizers and storage backends for Go
## Messaging
*Libraries that implement messaging systems*
* [dbus](https://github.com/godbus/dbus) - Native Go bindings for D-Bus.
* [EventBus](https://github.com/asaskevich/EventBus) - The lightweight event bus with async compatibility.
* [go-notify](https://github.com/TheCreeper/go-notify) - Native implementation of the freedesktop notification spec.
* [go-nsq](https://github.com/bitly/go-nsq) - the official Go package for NSQ
* [gopush-cluster](https://github.com/Terry-Mao/gopush-cluster) - gopush-cluster is a go push server cluster.
* [machinery](https://github.com/RichardKnop/machinery) - An asynchronous task queue/job queue based on distributed message passing.
* [NATS](https://github.com/apcera/nats) - A lightweight and highly performant publish-subscribe and distributed queueing messaging system.
* [oplog](https://github.com/dailymotion/oplog) - A generic oplog/replication system for REST APIs
* [pubsub](https://github.com/tuxychandru/pubsub) - A simple pubsub package for go.
* [sarama](https://github.com/Shopify/sarama) - A Go library for Apache Kafka.
* [Uniqush-Push](https://github.com/uniqush/uniqush-push) - A redis backed unified push service for server-side notifications to mobile devices.
* [zmq4](https://github.com/pebbe/zmq4) - A Go interface to ZeroMQ version 4. Also available for [version 3](https://github.com/pebbe/zmq3) and [version 2](https://github.com/pebbe/zmq2).
## Miscellaneous
*These libraries were placed here because none of the other categories seemed to fit*
* [autoflags](https://github.com/artyom/autoflags) - Go package to automatically define command line flags from struct fields.
* [browscap_go](https://github.com/fromYukki/browscap_go) - GoLang Library for [Browser Capabilities Project](http://browscap.org/).
* [go-flags](https://github.com/jessevdk/go-flags) - go command line option parser
* [go-multierror](https://github.com/hashicorp/go-multierror) - A Go (golang) package for representing a list of errors as a single error.
* [gopsutil](https://github.com/shirou/gopsutil) - A cross-platform library for retrieving process and system utilization(CPU, Memory, Disks, etc).
* [jobs](https://github.com/albrow/jobs) - A persistent and flexible background jobs library.
* [notify](https://github.com/rjeczalik/notify) - File system event notification library with simple API, similar to os/signal.
* [xkg](https://github.com/go-xkg/xkg) - X Keyboard Grabber
* [xstrings](https://github.com/huandu/xstrings) - A collection of useful string functions ported from other languages.
## Natural Language Processing
*Libraries for working with human languages.*
* [go-eco](https://code.google.com/p/go-eco/) - Similarity, dissimilarity and distance matrices; diversity, equitability and inequality measures; species richness estimators; coenocline models.
* [go-nlp](https://github.com/nuance/go-nlp) - Utilities for working with discrete probability distributions and other tools useful for doing NLP work.
* [go-stem](https://github.com/agonopol/go-stem) - Implementation of the porter stemming algorithm.
* [golibstemmer](https://github.com/rjohnsondev/golibstemmer) - Go bindings for the snowball libstemmer library including porter 2
* [gounidecode](https://github.com/fiam/gounidecode) - Unicode transliterator (also known as unidecode) for Go
* [icu](https://github.com/goodsign/icu) - Cgo binding for icu4c C library detection and conversion functions. Guaranteed compatibility with version 50.1.
* [libtextcat](https://github.com/goodsign/libtextcat) - Cgo binding for libtextcat C library. Guaranteed compatibility with version 2.2.
* [MMSEGO](https://github.com/awsong/MMSEGO) - This is a GO implementation of [MMSEG](http://technology.chtsai.org/mmseg/) which a Chinese word splitting algorithm.
* [paicehusk](https://github.com/Rookii/paicehusk) - Golang implementation of the Paice/Husk Stemming Algorithm
* [porter](https://github.com/a2800276/porter) - This is a fairly straighforward port of Martin Porter's C implementation of the Porter stemming algorithm.
* [porter2](https://github.com/surge/porter2) - Really fast Porter 2 stemmer.
* [segment](https://github.com/blevesearch/segment) - A Go library for performing Unicode Text Segmentation as described in [Unicode Standard Annex #29](http://www.unicode.org/reports/tr29/)
* [snowball](https://github.com/goodsign/snowball) - Snowball stemmer port (cgo wrapper) for Go. Provides word stem extraction functionality [Snowball native](http://snowball.tartarus.org/).
* [stemmer](https://github.com/dchest/stemmer) - Stemmer packages for Go programming language. Includes English and German stemmers.
* [textcat](https://github.com/pebbe/textcat) - A Go package for n-gram based text categorization, with support for utf-8 and raw text
## Networking
*Libraries for working with various layers of the network*
* [arp](https://github.com/mdlayher/arp) - Package arp implements the ARP protocol, as described in RFC 826.
* [buffstreams](https://github.com/stabbycutyou/buffstreams) - Streaming protocolbuffer data over TCP made easy
* [canopus](https://github.com/zubairhamed/canopus) - CoAP Client/Server implementation (RFC 7252)
* [dhcp6](https://github.com/mdlayher/dhcp6) - Package dhcp6 implements a DHCPv6 server, as described in RFC 3315.
* [dns](https://github.com/miekg/dns) - Go library for working with DNS
* [ethernet](https://github.com/mdlayher/ethernet) - Package ethernet implements marshaling and unmarshaling of IEEE 802.3 Ethernet II frames and IEEE 802.1Q VLAN tags.
* [ftp](https://github.com/jlaffaye/ftp) - Package ftp implements a FTP client as described in [RFC 959](http://tools.ietf.org/html/rfc959).
* [go-stun](https://github.com/ccding/go-stun) - A go implementation of the STUN client (RFC 3489 and RFC 5389).
* [gopacket](https://github.com/google/gopacket) - A Go library for packet processing with libpacp bindings
* [gopcap](https://github.com/akrennmair/gopcap) - A Go wrapper for libpcap
* [gosnmp](https://github.com/soniah/gosnmp) - Native Go library for performing SNMP actions
* [gotcp](https://github.com/gansidui/gotcp) - A Go package for quickly writing tcp applications
* [graval](https://github.com/koofr/graval) - An experimental FTP server framework.
* [linkio](https://github.com/ian-kent/linkio) - Network link speed simulation for Reader/Writer interfaces
* [mdns](https://github.com/hashicorp/mdns) - Simple mDNS (Multicast DNS) client/server library in Golang
* [portproxy](https://github.com/aybabtme/portproxy) - Simple TCP proxy which adds CORS support to API's which don't support it.
* [raw](https://github.com/mdlayher/raw) - Package raw enables reading and writing data at the device driver level for a network interface.
* [sftp](https://github.com/pkg/sftp) - Package sftp implements the SSH File Transfer Protocol as described in https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt.
* [tcp_server](https://github.com/firstrow/tcp_server) - A Go library for building tcp servers faster.
* [utp](https://github.com/anacrolix/utp) - Go uTP micro transport protocol implementation.
## OpenGL
*Libraries for using OpenGL in Go.*
* [gl](https://github.com/go-gl/gl) - Go bindings for OpenGL (generated via glow).
* [glfw](https://github.com/go-gl/glfw) - Go bindings for GLFW 3.
* [goxjs/gl](https://github.com/goxjs/gl) - Go cross-platform OpenGL bindings (OS X, Linux, Windows, browsers, iOS, Android).
* [goxjs/glfw](https://github.com/goxjs/glfw) - Go cross-platform glfw library for creating an OpenGL context and receiving events.
* [mathgl](https://github.com/go-gl/mathgl) - Pure Go math package specialized for 3D math, with inspiration from GLM.
## ORM
*Libraries that implement Object-Relational Mapping or datamapping techniques.*
* [beego orm](https://github.com/astaxie/beego/tree/master/orm) - A powerful orm framework for go.
* [go-store](https://github.com/gosuri/go-store) - A simple and fast Redis backed key-value store library for Go.
* [gomodel](https://github.com/cosiner/gomodel) - A lightweight, fast, orm-like library helps interactive with database.
* [GORM](https://github.com/jinzhu/gorm) - The fantastic ORM library for Golang, aims to be developer friendly.
* [gorp](https://github.com/go-gorp/gorp) - Go Relational Persistence, ORM-ish library for Go.
* [hood](https://github.com/eaigner/hood) - Database agnostic ORM for Go.
* [QBS](https://github.com/coocood/qbs) - Stands for Query By Struct. A Go ORM.
* [upper.io/db](https://github.com/upper/db) - Single interface for interacting with different data sources through the use of adapters that wrap mature database drivers.
* [Xorm](https://github.com/go-xorm/xorm) - Simple and powerful ORM for Go.
* [Zoom](https://github.com/albrow/zoom) - A blazing-fast datastore and querying engine built on Redis.
## Package Management
*Libraries for package and dependency management.*
* [gigo](https://github.com/LyricalSecurity/gigo) - PIP-like dependency tool for golang, with support for private repositories and hashes.
* [godep](https://github.com/tools/godep) - dependency tool for go, godep helps build packages reproducibly by fixing their dependencies.
* [gom](https://github.com/mattn/gom) - Go Manager - bundle for go.
* [goop](https://github.com/nitrous-io/goop) - A simple dependency manager for Go (golang), inspired by Bundler.
* [gopm](https://github.com/gpmgo/gopm) - Go Package Manager
* [gpm](https://github.com/pote/gpm) - Barebones dependency manager for Go.
* [johnny-deps](https://github.com/VividCortex/johnny-deps) - Minimal dependency version using Git
* [nut](https://github.com/jingweno/nut) - Vendor Go dependencies
* [VenGO](https://github.com/DamnWidget/VenGO) - create and manage exportable isolated go virtual environments
## Resource Embedding
* [go-bindata](https://github.com/jteeuwen/go-bindata) - Package that converts any file into managable Go source code.
* [go-resources](https://github.com/omeid/go-resources) - Unfancy resources embedding with Go.
* [go.rice](https://github.com/GeertJohan/go.rice) - go.rice is a Go package that makes working with resources such as html,js,css,images and templates very easy.
* [vfsgen](https://github.com/shurcooL/vfsgen) - Generates a vfsdata.go file that statically implements the given virtual filesystem.
## Science and Data Analysis
*Libraries for scientific computing and data analyzing.*
* [blas](https://github.com/ziutek/blas) - Implementation of BLAS (Basic Linear Algebra Subprograms)
* [chart](https://github.com/vdobler/chart) - Simple Chart Plotting library for Go. Supports many graphs types.
* [evaler](https://github.com/soniah/evaler) - A simple floating point arithmetic expression evaluator
* [ewma](https://github.com/VividCortex/ewma) - Exponentially-weighted moving averages
* [geom](https://github.com/skelterjohn/geom) - 2D geometry for golang
* [go-fn](https://code.google.com/p/go-fn/) - Mathematical functions written in Go language, that are not covered by math pkg
* [go-gt](https://code.google.com/p/go-gt/) - Graph theory algorithms written in "Go" language
* [go.matrix](https://github.com/skelterjohn/go.matrix) - linear algebra for go (has been stalled)
* [gocomplex](https://code.google.com/p/gocomplex/) - A complex number library for the Go programming language.
* [gofrac](https://github.com/anschelsc/gofrac) - A (goinstallable) fractions library for go with support for basic arithmetic.
* [gohistogram](https://github.com/VividCortex/gohistogram) - Approximate histograms for data streams
* [gonum/mat64](https://github.com/gonum/matrix) - The general purpose package for matrix computation. Package mat64 provides basic linear algebra operations for float64 matrices.
* [gonum/plot](https://github.com/gonum/plot) - gonum/plot provides an API for building and drawing plots in Go.
* [goraph](https://github.com/gyuho/goraph) - A pure Go graph theory library(data structure, algorith visualization)
* [gostat](https://code.google.com/p/gostat/) - A statistics library for the go language
* [mudlark-go](https://code.google.com/p/mudlark-go-pkgs/) - A collection of packages providing (hopefully) useful code for use in software using Google's Go programming language.
* [pagerank](https://github.com/alixaxel/pagerank) - Weighted PageRank algorithm implemented in Go
* [streamtools](https://github.com/nytlabs/streamtools) - general purpose, graphical tool for dealing with streams of data.
* [vectormath](https://github.com/spate/vectormath) - Vectormath for Go, an adaptation of the scalar C functions from Sony's Vector Math library, as found in the Bullet-2.79 source code. (currently inactive)
## Security
*Libraries that are used to help make your application more secure.*
* [BadActor](https://github.com/jaredfolkins/badactor) - An in-memory, application-driven jailer built in the spirit of fail2ban
* [go-yara](https://github.com/hillu/go-yara) - Go Bindings for [YARA](https://github.com/plusvic/yara), the "pattern matching swiss knife for malware researchers (and everyone else)"
## Serialization
*Libraries and tools for binary serialization*
* [cbor](https://github.com/2tvenom/cbor) - Golang library for working with cbor binary format
* [go-capnproto](https://github.com/glycerine/go-capnproto) - Cap'n Proto library and parser for go
* [bambam](https://github.com/glycerine/bambam) - generator for Cap'n Proto schemas from go.
* [gogoprotobuf](https://github.com/gogo/protobuf) - Protocol Buffers for Go with Gadgets
* [goprotobuf](https://github.com/golang/protobuf) - Go support, in the form of a library and protocol compiler plugin, for Google's protocol buffers.
* [mapstructure](https://github.com/mitchellh/mapstructure) - Go library for decoding generic map values into native Go structures.
* [php_session_decoder](https://github.com/yvasiyarov/php_session_decoder) - GoLang library for working with PHP session format and PHP Serialize/Unserialize functions
* [structomap](https://github.com/tuvistavie/structomap) - Library to easily and dynamically generate maps from static structures.
## Server Applications
* [algernon](https://github.com/xyproto/algernon) - HTTP/2 web server with built-in support for Lua, Markdown, GCSS and Amber.
* [Caddy](https://github.com/mholt/caddy) - Caddy is an alternative, HTTP/2 web server that's easy to configure and use.
* [etcd](https://github.com/coreos/etcd) - A highly-available key value store for shared configuration and service discovery.
* [nsq](http://nsq.io/) - A realtime distributed messaging platform
* [yakvs](https://github.com/sci4me/yakvs) - A small, networked, in-memory key-value store.
## Template Engines
*Libraries and tools for templating and lexing.*
* [ace](https://github.com/yosssi/ace) - Ace is an HTML template engine for Go, inspired by Slim and Jade. Ace is a refinement of Gold.
* [amber](https://github.com/eknkc/amber) - Amber is an elegant templating engine for Go Programming Language It is inspired from HAML and Jade.
* [damsel](https://github.com/dskinner/damsel) - Markup language featuring html outlining via css-selectors, extensible via pkg html/template and others.
* [ego](https://github.com/benbjohnson/ego) - A lightweight templating language that lets you write templates in Go. Templates are translated into Go and compiled.
* [kasia.go](https://github.com/ziutek/kasia.go) - Templating system for HTML and other text documents - go implementation.
* [mustache](https://github.com/hoisie/mustache) - A Go implementation of the Mustache template language.
* [pongo2](https://github.com/flosch/pongo2) - A Django-like template-engine for Go.
* [raymond](https://github.com/aymerick/raymond) - A complete handlebars implementation in Go.
* [Razor](https://github.com/sipin/gorazor) - Razor view engine for Golang.
* [Soy](https://github.com/robfig/soy) - Closure templates (aka Soy templates) for Go, following the [official spec](https://developers.google.com/closure/templates/)
## Testing
*Libraries for testing codebases and generating test data.*
* Testing Frameworks
* [assert](https://github.com/bluesuncorp/assert) - Basic Assertion Library used along side native go testing, with building blocks for custom assertions
* [assert](https://github.com/bmizerany/assert) - Asserts to Go testing
* [bro](https://github.com/marioidival/bro) - Watch files in directory and run tests for them
* [ginkgo](http://onsi.github.io/ginkgo/) - BDD Testing Framework for Go
* [go-mutesting](https://github.com/zimmski/go-mutesting) - Mutation testing for Go source code
* [goblin](https://github.com/franela/goblin) - Mocha like testing framework fo Go
* [gocheck](http://labix.org/gocheck) - A more advanced testing framework alternative to gotest.
* [GoConvey](https://github.com/smartystreets/goconvey/) - BDD-style framework with web UI and live reload
* [godog](https://github.com/DATA-DOG/godog) - Cucumber or Behat like BDD framework for Go.
* [GoSpec](https://github.com/orfjackal/gospec) - BDD-style testing framework for the Go programming language.
* [gospecify](https://github.com/stesla/gospecify) - This provides a BDD syntax for testing your Go code. It should be familiar to anybody who has used libraries such as rspec.
* [Hamcrest](https://github.com/rdrdr/hamcrest) - fluent framework for declarative Matcher objects that, when applied to input values, produce self-describing results.
* [restit](https://github.com/yookoala/restit) - A Go micro framework to help writing RESTful API integration test.
* [Testify](https://github.com/stretchr/testify) - A sacred extension to the standard go testing package.
* Mock
* [counterfeiter](https://github.com/maxbrunsfeld/counterfeiter) - Tool for generating self-contained mock objects
* [go-sqlmock](https://github.com/DATA-DOG/go-sqlmock) - Mock SQL driver for testing database interactions
* [go-txdb](https://github.com/DATA-DOG/go-txdb) - Single transaction based database driver mainly for testing purposes.
* [gomock](https://github.com/golang/mock) - Mocking framework for the Go programming language.
* [mockhttp](https://github.com/tv42/mockhttp) - Mock object for Go http.ResponseWriter
* Fuzzing and delta-debugging/reducing/shrinking
* [go-fuzz](https://github.com/dvyukov/go-fuzz) - A randomized testing system
* [gofuzz](https://github.com/google/gofuzz) - A library for populating go objects with random values
* [gogenerate](https://github.com/arschles/gogenerate) - A Scalacheck-like library for Go
* [Tavor](https://github.com/zimmski/tavor) - A generic fuzzing and delta-debugging framework
## Text Processing
*Libraries for parsing and manipulating texts.*
* Specific Formats
* [blackfriday](https://github.com/russross/blackfriday) - Markdown processor in Go
* [github_flavored_markdown](https://godoc.org/github.com/shurcooL/github_flavored_markdown) - GitHub Flavored Markdown renderer with fenced code block highlighting, clickable header anchor links.
* [bluemonday](https://github.com/microcosm-cc/bluemonday) - HTML Sanitizer
* [enca](https://github.com/endeveit/enca) - Minimal cgo bindings for [libenca](http://cihar.com/software/enca/).
* [genex](https://github.com/alixaxel/genex) - Count and expand Regular Expressions into all matching Strings
* [go-humanize](https://github.com/dustin/go-humanize) - Formatters for time, numbers, and memory size to human readable format.
* [go-nmea](https://github.com/adrianmo/go-nmea) - NMEA parser library for the Go language.
* [go-pkg-rss](https://github.com/jteeuwen/go-pkg-rss) - This package reads RSS and Atom feeds and provides a caching mechanism that adheres to the feed specs.
* [go-pkg-xmlx](https://github.com/jteeuwen/go-pkg-xmlx) - Extension to the standard Go XML package. Maintains a node tree that allows forward/backwards browsing and exposes some simple single/multi-node search functions.
* [go-runewidth](https://github.com/mattn/go-runewidth) - Functions to get fixed width of the character or string.
* [gographviz](https://github.com/awalterschulze/gographviz) - Parses the Graphviz DOT language.
* [gommon/gytes](https://github.com/labstack/gommon/tree/master/gytes) - Format bytes to string.
* [gonameparts](https://github.com/polera/gonameparts) - Parses human names into individual name parts
* [GoQuery](https://github.com/PuerkitoBio/goquery) - GoQuery brings a syntax and a set of features similar to jQuery to the Go language.
* [goregen](https://github.com/zach-klippenstein/goregen) - A library for generating random strings from regular expressions.
* [guesslanguage](https://github.com/endeveit/guesslanguage) - Functions to determine the natural language of a unicode text.
* [mxj](https://github.com/clbanning/mxj) - Encode / decode XML as JSON or map[string]interface{}; extract values with dot-notation paths and wildcards. Replaces x2j and j2x packages.
* [slug](https://github.com/gosimple/slug) - URL-friendly slugify with multiple languages support.
* [Slugify](https://github.com/avelino/slugify) - A Go slugify application that handles string.
* [toml](https://github.com/BurntSushi/toml) - TOML configuration format (encoder/decoder with reflection).
* Utility
* [gotabulate](https://github.com/bndr/gotabulate) - Easily pretty-print your tabular data with Go.
* [xurls](https://github.com/mvdan/xurls) - Extract urls from text
## Third-party APIs
*Libraries for accessing third party APIs.*
* [anaconda](https://github.com/ChimeraCoder/anaconda) - A Go client library for the Twitter 1.1 API
* [aws-sdk-go](https://github.com/aws/aws-sdk-go) - The official AWS SDK for the Go programming language. Caution: The SDK is currently in the process of being developed, and not everything may be working fully yet.
* [brewerydb](https://github.com/naegelejd/brewerydb) - Go library for accessing the BreweryDB API.
* [facebook](https://github.com/huandu/facebook) - Go Library that supports the Facebook Graph API
* [gads](https://github.com/emiddleton/gads) - Google Adwords Unofficial API
* [gami](https://github.com/bit4bit/gami) - Go library for Asterisk Manager Interface.
* [geo-golang](https://github.com/codingsince1985/geo-golang) - Go Library to access [Google Maps](https://developers.google.com/maps/documentation/geocoding/), [MapQuest](http://open.mapquestapi.com/geocoding/), [Nominatim](http://open.mapquestapi.com/nominatim/), [OpenCage](http://geocoder.opencagedata.com/api.html), [HERE](https://developer.here.com/rest-apis/documentation/geocoder) and [Bing](https://msdn.microsoft.com/en-us/library/ff701715.aspx) geocoding / reverse geocoding APIs.
* [github](https://github.com/google/go-github) - Go library for accessing the GitHub API.
* [go-marathon](https://github.com/gambol99/go-marathon) - A Go library for interacting with Mesosphere's Marathon PAAS
* [goamz](https://github.com/mitchellh/goamz) - Popular fork of [goamz](https://launchpad.net/goamz) which adds some missing API calls to certain packages.
* [GoMusicBrainz](https://github.com/michiwend/gomusicbrainz) - a Go MusicBrainz WS2 client library
* [google](https://github.com/google/google-api-go-client) - Auto-generated Google APIs for Go
* [google-analytics](https://github.com/chonthu/go-google-analytics) - A simple wrapper for easy google analytics reporting
* [google-cloud](https://github.com/GoogleCloudPlatform/gcloud-golang) - Google Cloud APIs Go Client Library
* [gostorm](https://github.com/jsgilmore/gostorm) - GoStorm is a Go library that implements the communications protocol required to write Storm spouts and Bolts in Go that communicate with the Storm shells.
* [hipchat](https://github.com/andybons/hipchat) - This project implements a golang client library for the Hipchat API.
* [hipchat (xmpp)](https://github.com/daneharrigan/hipchat) - A golang package to communicate with HipChat over XMPP.
* [mixpanel](https://github.com/dukex/mixpanel) - Mixpanel is a library for tracking events and sending Mixpanel profile updates to Mixpanel from your go applications.
* [pushover](https://github.com/gregdel/pushover) - Go wrapper for the Pushover API.
* [rrdaclient](https://github.com/Omie/rrdaclient) - Go Library to access statdns.com API, which is in turn RRDA API. DNS Queries over HTTP.
* [shopify](https://github.com/rapito/go-shopify) - Go Library to make CRUD request to the Shopify API.
* [smite](https://github.com/sergiotapia/smitego) - Go package to wraps access to the Smite game API.
* [snapchat](https://github.com/jamieomatthews/gosnap) - Go wrapper for the snapchat API
* [spotify](https://github.com/rapito/go-spotify) - Go Library to access Spotify WEB API.
* [steam](https://github.com/sostronk/go-steam) - Go Library to interact with Steam game servers.
* [stripe](https://github.com/stripe/stripe-go) - Go client for the Stripe API
* [TheMovieDb](https://github.com/jbrodriguez/go-tmdb) - A simple golang package to communicate with [themoviedb.org](https://themoviedb.org)
* [translate](https://github.com/poorny/translate) - Go online translation package
* [tumblr](https://github.com/mattcunningham/gumblr) - Go wrapper for the Tumblr v2 API.
## Utilities
*General utilities and tools to make your life easier.*
* [coop](https://github.com/rakyll/coop) - Cheat sheet for some of the common concurrent flows in Go.
* [delve](https://github.com/derekparker/delve) - Go debugger.
* [fastlz](https://github.com/fromYukki/fastlz) - Wrap over [FastLz](http://fastlz.org/) (free, open-source, portable real-time compression library) for GoLang.
* [go-cron](https://github.com/rk/go-cron) - A simple Cron library for go that can execute closures or functions at varying intervals, from once a second to once a year on a specific date and time. Primarily for web applications and long running daemons.
* [go-debug](https://github.com/tj/go-debug) - Conditional debug logging for Golang libraries & applications
* [go-dry](https://github.com/ungerik/go-dry) - DRY (don't repeat yourself) package for Go.
* [go-underscore](https://github.com/tobyhede/go-underscore) - A useful collection of helpfully functional Go collection utilities.
* [goback](https://github.com/carlescere/goback) - Go simple exponential backoff package.
* [godaemon](https://github.com/VividCortex/godaemon) - Utility to write daemons
* [godotenv](https://github.com/joho/godotenv) - A Go port of Ruby's dotenv library (Loads environment variables from `.env`.)
* [godropbox](https://github.com/dropbox/godropbox) - Common libraries for writing Go services/applications from Dropbox.
* [gohper](https://github.com/cosiner/gohper) - Various tools/modules help for development.
* [gopencils](https://github.com/bndr/gopencils) - Small and simple package to easily consume REST APIs.
* [goplaceholder](https://github.com/michiwend/goplaceholder) - a small golang lib to generate placeholder images
* [goreq](https://github.com/franela/goreq) - Minimal and simple request library for Go language.
* [gorequest](https://github.com/parnurzeal/gorequest) - Simplified HTTP client with rich features for Go.
* [gotenv](https://github.com/subosito/gotenv) - Load environment variables from `.env` or any `io.Reader` in Go
* [hystrix-go](https://github.com/afex/hystrix-go) - Imprements Hystrix patterns of programmer-defined fallbacks aka circuit breaker.
* [jsonf](https://github.com/miolini/jsonf) - Console tool for highlighted formatting and struct query fetching JSON.
* [lrserver](https://github.com/jaschaephraim/lrserver) - LiveReload server for Go
* [mp](https://github.com/sanbornm/mp) - A simple cli email parser. It currently takes stdin and outputs JSON.
* [multitick](https://github.com/VividCortex/multitick) - Multiplexor for aligned tickers
* [netbug](https://github.com/e-dard/netbug) - Easy remote profiling of your services.
* [ngrok](https://github.com/inconshreveable/ngrok) - Introspected tunnels to localhost.
* [okrun](https://github.com/xta/okrun) - go run error steamroller
* [panicparse](https://github.com/maruel/panicparse) - Groups similar goroutines and colorizes stack dump.
* [peco](https://github.com/peco/peco) - Simplistic interactive filtering tool
* [pester](https://github.com/sethgrid/pester) - Go HTTP client calls with retries, backoff, and concurrency
* [pipeline](https://github.com/interactiv/pipeline) - Functional programming library inspired by lodash, underscore
* [pm](https://github.com/VividCortex/pm) - Process (i.e. goroutine) manager with an HTTP API
* [profile](https://github.com/davecheney/profile) - Simple profiling support package for Go
* [request](https://github.com/mozillazg/request) - Go HTTP Requests for Humans™.
* [robustly](https://github.com/VividCortex/robustly) - Runs functions resiliently, catching and restarting panics
* [scheduler](https://github.com/carlescere/scheduler) - Cronjobs scheduling made easy.
* [sling](https://github.com/dghubble/sling) - Go HTTP requests builder for API clients.
* [spinner](https://github.com/briandowns/spinner) - Go package to easily provide a terminal spinner with options.
* [sqlx](https://github.com/jmoiron/sqlx) - provides a set of extensions on top of the excellent built-in database/sql package
* [xlsx](https://github.com/tealeg/xlsx) - Library to simplify reading the XML format used by recent version of Microsoft Excel in Go programs.
## Validation
*Libraries for validation.*
* [govalidator](https://github.com/asaskevich/govalidator) - Validators and sanitizers for strings, numerics, slices and structs
* [validator](https://github.com/bluesuncorp/validator) - Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving
## Version Control
*Libraries for version control.*
* [gh](https://github.com/rjeczalik/gh) - Scriptable server and net/http middleware for GitHub Webhooks
* [git2go](https://github.com/libgit2/git2go) - Go bindings for libgit2.
* [go-vcs](https://github.com/sourcegraph/go-vcs) - manipulate and inspect VCS repositories in Go.
* [hgo](https://github.com/beyang/hgo) - Hgo is a collection of Go packages providing read-access to local Mercurial repositories.
## Video
*Libraries for manipulating video.*
* [aac/h264](https://github.com/nareix/codec) - Golang aac/h264 encoder and decoder.
* [gmf](https://github.com/3d0c/gmf) - Go bindings for FFmpeg av\* libraries.
* [goav](https://github.com/giorgisio/goav) - Comphrensive Go bindings for FFmpeg.
* [gst](https://github.com/ziutek/gst) - Go bindings for GStreamer.
## Web Frameworks
*Full stack web frameworks.*
* [Beego](https://github.com/astaxie/beego) - beego is an open-source, high-performance web framework for the Go programming language.
* [Bone](https://github.com/go-zoo/bone) - Lightning Fast HTTP Multiplexer.
* [Echo](https://github.com/labstack/echo) - A fast HTTP router (zero memory allocation) and micro web framework in Go.
* [Gin](https://github.com/gin-gonic/gin) - Gin is a web framework written in Go! It features a martini-like API with much better performance, up to 40 times faster. If you need performance and good productivity.
* [Glue](https://github.com/desertbit/glue) - Robust Go and Javascript Socket Library (Alternative to Socket.io)
* [go-json-rest](https://github.com/ant0ine/go-json-rest) - A quick and easy way to setup a RESTful JSON API
* [go-relax](https://github.com/codehack/go-relax) - A framework of pluggable components to build RESTful API's
* [go-rest](https://github.com/ungerik/go-rest) - A small and evil REST framework for Go
* [go-socket.io](https://github.com/googollee/go-socket.io) - socket.io library for golang, a realtime application framework.
* [Goat](https://github.com/bahlo/goat) - A minimalistic REST API server in Go
* [gocraft/web](https://github.com/gocraft/web) - A mux and middleware package in Go.
* [Goji](https://github.com/zenazn/goji) - Goji is a minimalistic web framework for Golang that's high in antioxidants.
* [Gondola](https://github.com/rainycape/gondola) - The web framework for writing faster sites, faster
* [goose](https://github.com/ian-kent/goose) - Server Sent Events in Go
* [Gorilla](https://github.com/gorilla/) - Gorilla is a web toolkit for the Go programming language.
* [httprouter](https://github.com/julienschmidt/httprouter) - A high performance router. Use this and the standard http handlers to form a very high performance web framework.
* [Macaron](https://github.com/Unknwon/macaron) - Macaron is a high productive and modular design web framework in Go.
* [mango](https://github.com/paulbellamy/mango) - Mango is a modular web-application framework for Go, inspired by Rack, and PEP333.
* [Martini](https://github.com/go-martini/martini) - Martini is a powerful package for quickly writing modular web applications/services in Golang.
* [medeina](https://github.com/imdario/medeina) - Medeina is a HTTP routing tree based on HttpRouter, inspired by Roda and Cuba.
* [neo](https://github.com/ivpusic/neo) - Neo is minimal and fast Go Web Framework with extremely simple API.
* [pat](https://github.com/bmizerany/pat) - Sinatra style pattern muxer for Go’s net/http library, by the author of Sinatra.
* [Resoursea](https://github.com/resoursea/api) - A REST framework for quickly writing resource based services.
* [Revel](https://github.com/revel/revel) - A high-productivity web framework for the Go language.
* [rex](https://github.com/goanywhere/rex) - Rex is a library for modular development built upon gorilla/mux, fully compatible with `net/http`.
* [sawsij](http://sawsij.com/) - lightweight, open-source web framework for building high-performance, data-driven web applications.
* [Siesta](https://github.com/VividCortex/siesta) - Composable framework to write middleware and handlers
* [tango](https://github.com/lunny/tango) - Micro & pluggable web framework for Go.
* [tigertonic](https://github.com/rcrowley/go-tigertonic) - A Go framework for building JSON web services inspired by Dropwizard
* [traffic](https://github.com/pilu/traffic) - Sinatra inspired regexp/pattern mux and web framework for Go.
* [web.go](https://github.com/hoisie/web) - A simple framework to write webapps in Go.
* [Zerver](https://github.com/cosiner/zerver) - Zerver is a expressive, modular, feature completed RESTful framework.
* [zeus](https://github.com/daryl/zeus) - A very simple and fast HTTP router for Go.
### Middlewares
#### Actual middlewares
* [CORS](https://github.com/rs/cors) - Easily add CORS capabilities to your API
* [formjson](https://github.com/rs/formjson) - Transparently handle JSON input as a standard form POST
* [Tollbooth](https://github.com/didip/tollbooth) - Rate limit HTTP request handler
* [XFF](https://github.com/sebest/xff) - Handle `X-Forwarded-For` header and friends
#### Libraries for creating HTTP middlewares
* [alice](https://github.com/justinas/alice) - Painless middleware chaining for Go.
* [go-wrap](https://github.com/go-on/wrap) - Small middlewares package for net/http.
* [interpose](https://github.com/carbocation/interpose) - Minimalist net/http middleware for golang
* [muxchain](https://github.com/stephens2424/muxchain) - Lightweight middleware for net/http.
* [negroni](https://github.com/codegangsta/negroni) - Idiomatic HTTP middleware for Golang.
* [render](https://github.com/unrolled/render) - Go package for easily rendering JSON, XML, and HTML template responses.
* [stats](https://github.com/thoas/stats) - A Go middleware that stores various information about your web application.
# Tools
Go software and plugins.
## Code Analysis
* [doc](http://godoc.org/robpike.io/cmd/doc) - Go documentation tool that produces an alternative doc format.
* [dupl](https://github.com/mibk/dupl) - A tool for code clone detection.
* [errcheck](https://github.com/kisielk/errcheck) - Errcheck is a program for checking for unchecked errors in Go programs.
* [gcvis](https://github.com/davecheney/gcvis) - Visualise Go program GC trace data in real time.
* [Go Metalinter](https://github.com/alecthomas/gometalinter) - Metalinter is a tool to automatically apply all static analysis tool and report their output in normalized form.
* [goast-viewer](https://github.com/yuroyoro/goast-viewer) - Web based Golang AST visualizer.
* [GoCover.io](http://gocover.io/) - GoCover.io offers the code coverage of any golang package as a service.
* [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports) - Tool to fix (add, remove) your Go imports automatically.
* [GoLint](https://github.com/golang/lint) - Golint is a linter for Go source code.
* [Golint online](http://go-lint.appspot.com/) - Lints online Go source files on GitHub, Bitbucket and Google Project Hosting using the golint package.
* [gostatus](https://github.com/shurcooL/gostatus) - A command line tool, shows the status of repositories that contain Go packages.
* [validate](https://github.com/mccoyst/validate) - Automatically validates struct fields with tags.
## Editor Plugins
* [go-lang-idea-plugin](https://github.com/go-lang-plugin-org/go-lang-idea-plugin) Go plugin for IntelliJ IDEA.
* [go-plus](https://github.com/joefitzgerald/go-plus) - Go (Golang) Package For Atom That Adds Autocomplete, Formatting, Syntax Checking, Linting and Vetting
* [gocode](https://github.com/nsf/gocode) - An autocompletion daemon for the Go programming language
* [GoSublime](https://github.com/DisposaBoy/GoSublime) - A Golang plugin collection for the text editor SublimeText 2 providing code completion and other IDE-like features.
* [velour](https://github.com/velour/velour) - An IRC client for the acme editor.
* [vim-compiler-go](https://github.com/rjohnsondev/vim-compiler-go) - A Vim plugin to highlight syntax errors on save.
* [vim-go](https://github.com/fatih/vim-go) - Go development plugin for Vim.
* [Watch](https://github.com/eaburns/Watch) - Runs a command in an acme win on file changes.
## Go Tools
* [colorgo](https://github.com/songgao/colorgo) - A wrapper around `go` command for colorized `go build` output.
## Software Packages
Software written in Go.
### DevOps Tools
* [aptly](https://github.com/smira/aptly) - aptly is a Debian repository management tool
* [awsenv](https://github.com/soniah/awsenv) - a small binary that loads Amazon (AWS) environment variables for a profile
* [Boom](https://github.com/rakyll/boom) - Boom is a tiny program that sends some load to a web application.
* [dogo](https://github.com/liudng/dogo) - Monitoring changes in the source file and automatically compile and run (restart).
* [EasySSH](https://github.com/hypersleep/easyssh) - Golang package for easy remote execution through SSH and SCP downloading.
* [gaudi](http://gaudi.io/) - Gaudi automates the setup of isolated and decoupled dev environments.
* [Go Metrics](https://github.com/rcrowley/go-metrics) - Go port of Coda Hale's Metrics library: https://github.com/codahale/metrics.
* [go-selfupdate](https://github.com/sanbornm/go-selfupdate) - Enable your Go applications to self update.
* [gobrew](https://github.com/cryptojuice/gobrew) - gobrew lets you easily switch between multiple versions of go.
* [godbg](https://github.com/sirnewton01/godbg) - Web-based gdb front-end application.
* [Gogs](http://gogs.io/) - A Self Hosted Git Service in the Go Programming Language.
* [gonative](https://github.com/inconshreveable/gonative) - Tool which creates a build of Go that can cross compile to all platforms while still using the Cgo-enabled versions of the stdlib packages.
* [gox](https://github.com/mitchellh/gox) - A dead simple, no frills Go cross compile tool.
* [goxc](https://github.com/laher/goxc) - build tool for Go, with a focus on cross-compiling and packaging.
* [GVM](https://github.com/moovweb/gvm) - GVM provides an interface to manage Go versions.
* [hk](https://github.com/heroku/hk) - Heroku command-line interface in Go.
* [Mora](https://github.com/emicklei/mora) - REST server for accessing MongoDB documents and meta data.
* [ostent](https://github.com/ostrost/ostent) - collects and displays system metrics and optionally relays to Graphite and/or InfluxDB
* [Packer](https://github.com/mitchellh/packer) - Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
* [Rodent](https://github.com/alouche/rodent) - Rodent helps you manage Go versions, projects and track dependencies.
* [webhook](https://github.com/adnanh/webhook) - Tool which allows user to create HTTP endpoints (hooks) that execute commands on the server
* [Wide](https://wide.b3log.org) - A Web-based IDE for Teams using Golang.
### Other Software
* [boxed](https://github.com/tejo/boxed) - Dropbox based blog engine
* [Circuit](https://github.com/gocircuit/circuit) - Circuit is a programmable platform-as-a-service (PaaS) and/or Infrastructure-as-a-Service (IaaS), for management, discovery, synchronization and orchestration of services and hosts comprising cloud applications.
* [Comcast](https://github.com/tylertreat/Comcast) - Simulate bad network connections
* [confd](https://github.com/kelseyhightower/confd) - Manage local application configuration files using templates and data from etcd or consul.
* [Docker](http://www.docker.com/) - An open platform for distributed applications for developers and sysadmins.
* [fleet](https://github.com/coreos/fleet) - A Distributed init System.
* [Go Package Store](https://github.com/shurcooL/Go-Package-Store#go-package-store-) - An app that displays updates for the Go packages in your GOPATH.
* [gocc](https://github.com/goccmack/gocc) - Gocc is a compiler kit for Go written in Go.
* [Gor](https://github.com/buger/gor) - Http traffic replication tool, for replaying traffic from production to stage/dev environments in real-time.
* [heka](https://github.com/mozilla-services/heka) - universal tool for data processing from Mozilla. Large collection of built-in plugins. Extendable via Go and Lua plugin API.
* [hugo](http://gohugo.io/) - A Fast and Modern Static Website Engine
* [Juju](https://juju.ubuntu.com/) - Cloud-agnostic service deployment and orchestration - supports EC2, Azure, Openstack, MAAS and more.
* [limetext](http://limetext.org/) Lime Text is a powerful and elegant text editor primarily developed in Go that aims to be a Free and open-source software successor to Sublime Text.
* [naclpipe](https://github.com/unix4fun/naclpipe) - A simple NaCL EC25519 based crypto pipe tool written in Go.
* [nes](https://github.com/fogleman/nes) - A Nintendo Entertainment System (NES) emulator written in Go.
* [orange-cat](https://github.com/noraesae/orange-cat) - A Markdown previewer written in Go.
* [peg](https://github.com/pointlander/peg) - Peg, Parsing Expression Grammar, is an implementation of a Packrat parser generator.
* [plubi](https://github.com/norwack/plubi) - A Golang Plugin Based IRC Bot.
* [Postman](https://github.com/zachlatta/postman) - Command-line utility for batch-sending email.
* [Seaweed File System](https://github.com/chrislusf/seaweedfs) - Fast, Simple and Scalable Distributed File System with O(1) disk seek.
* [shell2http](https://github.com/msoap/shell2http) - Executing shell commands via http server (for prototyping or remote control)
* [syncthing](http://www.syncthing.net/) - An open, decentralized file synchronization tool and protocol.
* [Tenyks](https://github.com/kyleterry/tenyks) - Service oriented IRC bot using Redis and JSON for messaging.
* [toxiproxy](https://github.com/shopify/toxiproxy) - Proxy to simulate network and system conditions for automated tests.
* [tsuru](http://www.tsuru.io/) - An extensible and open source Platform as a Service software.
* [websysd](https://github.com/ian-kent/websysd) - Web based process manager (like Marathon or Upstart)
# Resources
Where to discover new Go libraries.
## Benchmarks
* [autobench](https://github.com/davecheney/autobench) - Framework to compare the performance between different Go versions.
* [go-http-routing-benchmark](https://github.com/julienschmidt/go-http-routing-benchmark) - Go HTTP request router benchmark and comparison.
* [go-type-assertion-benchmark](https://github.com/hgfischer/go-type-assertion-benchmark) - Naive performance test of two ways to do type assertion in Go.
* [go_serialization_benchmarks](https://github.com/alecthomas/go_serialization_benchmarks) - Benchmarks of Go serialization methods.
* [gocostmodel](https://github.com/PuerkitoBio/gocostmodel) - Benchmarks of common basic operations for the Go language.
* [golang-micro-benchmarks](https://github.com/amscanne/golang-micro-benchmarks) - Tiny collection of Go micro benchmarks. The intent is to compare some language features to others.
* [golang-sql-benchmark](https://github.com/tyler-smith/golang-sql-benchmark) - A collection of benchmarks for popular Go database/SQL utilities.
* [kvbench](https://github.com/jimrobinson/kvbench) - Key/Value database benchmark.
* [speedtest-resize](https://github.com/fawick/speedtest-resize) - Compare various Image resize algorithms for the Go language.
## Conferences
* [dotGo](http://www.dotgo.io) - Paris, France
* [GoCon](http://gocon.connpass.com/) - Tokyo, Japan
* [GolangUK](http://www.golanguk.com/) - London, UK
* [GopherChina](http://gopherchina.org) - Shanghai, China
* [GopherCon](http://www.gophercon.com/) - Denver, USA
* [GopherCon India](http://www.gophercon.in/) - Bengaluru, India
* [GothamGo](http://gothamgo.com/) - New York City, USA
## E-Books
* [A Go Developer's Notebook](https://leanpub.com/GoNotebook/read)
* [An Introduction to Programming in Go](http://www.golang-book.com/)
* [Build Web Application with Golang](http://astaxie.gitbooks.io/build-web-application-with-golang/)
* [Building Web Apps With Go](http://codegangsta.gitbooks.io/building-web-apps-with-go/)
* [Go Bootcamp](http://golangbootcamp.com)
* [GoBooks](https://github.com/dariubs/GoBooks) - A curated list of Go books
* [Learning Go](http://www.miek.nl/downloads/Go/Learning-Go-latest.pdf)
* [Network Programming With Go](http://jan.newmarch.name/go/)
## Twitter
* [@golang](https://twitter.com/golang)
* [@golang_news](https://twitter.com/golang_news)
* [@golangweekly](https://twitter.com/golangweekly)
## Websites
* [Awesome Remote Job](https://github.com/lukasz-madon/awesome-remote-job) - A curated list of awesome remote jobs. A lot of them is looking for Go hackers.
* [awesome-awesomeness](https://github.com/bayandin/awesome-awesomeness) - List of other amazingly awesome lists.
* [Flipboard - Go Magazine](https://flipboard.com/section/the-golang-magazine-bVP7nS) - A collection of Go articles and tutorials.
* [Go Blog](http://blog.golang.org) - The official Go blog
* [Go Projects](https://github.com/golang/go/wiki/Projects) - List of projects on the Go community wiki
* [godoc.org](http://godoc.org/) - Documentation for open source Go packages.
* [golang-graphics](https://github.com/mholt/golang-graphics) - A collection of Go images, graphics, and art
* [golang-nuts](https://groups.google.com/forum/#!forum/golang-nuts) - Go mailing list
* [gowalker.org](https://gowalker.org) - Go Project API documentation.
* [r/Golang](http://www.reddit.com/r/golang) - News about Go.
* [Trending Go repositories on GitHub today](https://github.com/trending?l=go) - Good place to find new Go libraries.
### Tutorials
* [A Tour of Go](http://tour.golang.org/) - Interactive tour of Go
* [Go By Example](https://gobyexample.com/) - A hands-on introduction to Go using annotated example programs
* [Go database/sql tutorial](http://go-database-sql.org/) - Introduction to database/sql
* [Working with Go](https://github.com/mkaz/working-with-go) - An intro to go for experienced programmers
## Windows
* [go-ole](https://github.com/mattn/go-ole) - Win32 OLE implementation for golang
| {
"content_hash": "38774709b462c673bcdecde79e36c5b6",
"timestamp": "",
"source": "github",
"line_count": 1036,
"max_line_length": 491,
"avg_line_length": 72.31274131274131,
"alnum_prop": 0.7517352768433979,
"repo_name": "mpmedia/awesome-go",
"id": "5502cb96e32d22f0ad8d7687d5ca931d284a1661",
"size": "75215",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "1719"
}
],
"symlink_target": ""
} |
interface JQuery {
terminal(options?: any): any;
}
| {
"content_hash": "204d5b8ad27d7a7a0fecf1586c5095ad",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 31,
"avg_line_length": 17.666666666666668,
"alnum_prop": 0.6792452830188679,
"repo_name": "thingsboard/thingsboard",
"id": "0d89b0cfa75c6d1d84155b073e5e00f145412d92",
"size": "683",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ui-ngx/src/typings/jquery.typings.d.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5292"
},
{
"name": "CSS",
"bytes": "1419"
},
{
"name": "Dockerfile",
"bytes": "16044"
},
{
"name": "FreeMarker",
"bytes": "76776"
},
{
"name": "HTML",
"bytes": "1592357"
},
{
"name": "Java",
"bytes": "13339554"
},
{
"name": "JavaScript",
"bytes": "32179"
},
{
"name": "PLpgSQL",
"bytes": "175849"
},
{
"name": "Python",
"bytes": "7686"
},
{
"name": "SCSS",
"bytes": "401062"
},
{
"name": "Shell",
"bytes": "98582"
},
{
"name": "TypeScript",
"bytes": "5235207"
}
],
"symlink_target": ""
} |
#pragma once
#include <aws/docdb/DocDB_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/DateTime.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace DocDB
{
namespace Model
{
/**
* <p>Detailed information about a cluster snapshot. </p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/DBClusterSnapshot">AWS
* API Reference</a></p>
*/
class AWS_DOCDB_API DBClusterSnapshot
{
public:
DBClusterSnapshot();
DBClusterSnapshot(const Aws::Utils::Xml::XmlNode& xmlNode);
DBClusterSnapshot& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
void OutputToStream(Aws::OStream& oStream, const char* location) const;
/**
* <p>Provides the list of Amazon EC2 Availability Zones that instances in the
* cluster snapshot can be restored in.</p>
*/
inline const Aws::Vector<Aws::String>& GetAvailabilityZones() const{ return m_availabilityZones; }
/**
* <p>Provides the list of Amazon EC2 Availability Zones that instances in the
* cluster snapshot can be restored in.</p>
*/
inline bool AvailabilityZonesHasBeenSet() const { return m_availabilityZonesHasBeenSet; }
/**
* <p>Provides the list of Amazon EC2 Availability Zones that instances in the
* cluster snapshot can be restored in.</p>
*/
inline void SetAvailabilityZones(const Aws::Vector<Aws::String>& value) { m_availabilityZonesHasBeenSet = true; m_availabilityZones = value; }
/**
* <p>Provides the list of Amazon EC2 Availability Zones that instances in the
* cluster snapshot can be restored in.</p>
*/
inline void SetAvailabilityZones(Aws::Vector<Aws::String>&& value) { m_availabilityZonesHasBeenSet = true; m_availabilityZones = std::move(value); }
/**
* <p>Provides the list of Amazon EC2 Availability Zones that instances in the
* cluster snapshot can be restored in.</p>
*/
inline DBClusterSnapshot& WithAvailabilityZones(const Aws::Vector<Aws::String>& value) { SetAvailabilityZones(value); return *this;}
/**
* <p>Provides the list of Amazon EC2 Availability Zones that instances in the
* cluster snapshot can be restored in.</p>
*/
inline DBClusterSnapshot& WithAvailabilityZones(Aws::Vector<Aws::String>&& value) { SetAvailabilityZones(std::move(value)); return *this;}
/**
* <p>Provides the list of Amazon EC2 Availability Zones that instances in the
* cluster snapshot can be restored in.</p>
*/
inline DBClusterSnapshot& AddAvailabilityZones(const Aws::String& value) { m_availabilityZonesHasBeenSet = true; m_availabilityZones.push_back(value); return *this; }
/**
* <p>Provides the list of Amazon EC2 Availability Zones that instances in the
* cluster snapshot can be restored in.</p>
*/
inline DBClusterSnapshot& AddAvailabilityZones(Aws::String&& value) { m_availabilityZonesHasBeenSet = true; m_availabilityZones.push_back(std::move(value)); return *this; }
/**
* <p>Provides the list of Amazon EC2 Availability Zones that instances in the
* cluster snapshot can be restored in.</p>
*/
inline DBClusterSnapshot& AddAvailabilityZones(const char* value) { m_availabilityZonesHasBeenSet = true; m_availabilityZones.push_back(value); return *this; }
/**
* <p>Specifies the identifier for the cluster snapshot.</p>
*/
inline const Aws::String& GetDBClusterSnapshotIdentifier() const{ return m_dBClusterSnapshotIdentifier; }
/**
* <p>Specifies the identifier for the cluster snapshot.</p>
*/
inline bool DBClusterSnapshotIdentifierHasBeenSet() const { return m_dBClusterSnapshotIdentifierHasBeenSet; }
/**
* <p>Specifies the identifier for the cluster snapshot.</p>
*/
inline void SetDBClusterSnapshotIdentifier(const Aws::String& value) { m_dBClusterSnapshotIdentifierHasBeenSet = true; m_dBClusterSnapshotIdentifier = value; }
/**
* <p>Specifies the identifier for the cluster snapshot.</p>
*/
inline void SetDBClusterSnapshotIdentifier(Aws::String&& value) { m_dBClusterSnapshotIdentifierHasBeenSet = true; m_dBClusterSnapshotIdentifier = std::move(value); }
/**
* <p>Specifies the identifier for the cluster snapshot.</p>
*/
inline void SetDBClusterSnapshotIdentifier(const char* value) { m_dBClusterSnapshotIdentifierHasBeenSet = true; m_dBClusterSnapshotIdentifier.assign(value); }
/**
* <p>Specifies the identifier for the cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithDBClusterSnapshotIdentifier(const Aws::String& value) { SetDBClusterSnapshotIdentifier(value); return *this;}
/**
* <p>Specifies the identifier for the cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithDBClusterSnapshotIdentifier(Aws::String&& value) { SetDBClusterSnapshotIdentifier(std::move(value)); return *this;}
/**
* <p>Specifies the identifier for the cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithDBClusterSnapshotIdentifier(const char* value) { SetDBClusterSnapshotIdentifier(value); return *this;}
/**
* <p>Specifies the cluster identifier of the cluster that this cluster snapshot
* was created from.</p>
*/
inline const Aws::String& GetDBClusterIdentifier() const{ return m_dBClusterIdentifier; }
/**
* <p>Specifies the cluster identifier of the cluster that this cluster snapshot
* was created from.</p>
*/
inline bool DBClusterIdentifierHasBeenSet() const { return m_dBClusterIdentifierHasBeenSet; }
/**
* <p>Specifies the cluster identifier of the cluster that this cluster snapshot
* was created from.</p>
*/
inline void SetDBClusterIdentifier(const Aws::String& value) { m_dBClusterIdentifierHasBeenSet = true; m_dBClusterIdentifier = value; }
/**
* <p>Specifies the cluster identifier of the cluster that this cluster snapshot
* was created from.</p>
*/
inline void SetDBClusterIdentifier(Aws::String&& value) { m_dBClusterIdentifierHasBeenSet = true; m_dBClusterIdentifier = std::move(value); }
/**
* <p>Specifies the cluster identifier of the cluster that this cluster snapshot
* was created from.</p>
*/
inline void SetDBClusterIdentifier(const char* value) { m_dBClusterIdentifierHasBeenSet = true; m_dBClusterIdentifier.assign(value); }
/**
* <p>Specifies the cluster identifier of the cluster that this cluster snapshot
* was created from.</p>
*/
inline DBClusterSnapshot& WithDBClusterIdentifier(const Aws::String& value) { SetDBClusterIdentifier(value); return *this;}
/**
* <p>Specifies the cluster identifier of the cluster that this cluster snapshot
* was created from.</p>
*/
inline DBClusterSnapshot& WithDBClusterIdentifier(Aws::String&& value) { SetDBClusterIdentifier(std::move(value)); return *this;}
/**
* <p>Specifies the cluster identifier of the cluster that this cluster snapshot
* was created from.</p>
*/
inline DBClusterSnapshot& WithDBClusterIdentifier(const char* value) { SetDBClusterIdentifier(value); return *this;}
/**
* <p>Provides the time when the snapshot was taken, in UTC.</p>
*/
inline const Aws::Utils::DateTime& GetSnapshotCreateTime() const{ return m_snapshotCreateTime; }
/**
* <p>Provides the time when the snapshot was taken, in UTC.</p>
*/
inline bool SnapshotCreateTimeHasBeenSet() const { return m_snapshotCreateTimeHasBeenSet; }
/**
* <p>Provides the time when the snapshot was taken, in UTC.</p>
*/
inline void SetSnapshotCreateTime(const Aws::Utils::DateTime& value) { m_snapshotCreateTimeHasBeenSet = true; m_snapshotCreateTime = value; }
/**
* <p>Provides the time when the snapshot was taken, in UTC.</p>
*/
inline void SetSnapshotCreateTime(Aws::Utils::DateTime&& value) { m_snapshotCreateTimeHasBeenSet = true; m_snapshotCreateTime = std::move(value); }
/**
* <p>Provides the time when the snapshot was taken, in UTC.</p>
*/
inline DBClusterSnapshot& WithSnapshotCreateTime(const Aws::Utils::DateTime& value) { SetSnapshotCreateTime(value); return *this;}
/**
* <p>Provides the time when the snapshot was taken, in UTC.</p>
*/
inline DBClusterSnapshot& WithSnapshotCreateTime(Aws::Utils::DateTime&& value) { SetSnapshotCreateTime(std::move(value)); return *this;}
/**
* <p>Specifies the name of the database engine.</p>
*/
inline const Aws::String& GetEngine() const{ return m_engine; }
/**
* <p>Specifies the name of the database engine.</p>
*/
inline bool EngineHasBeenSet() const { return m_engineHasBeenSet; }
/**
* <p>Specifies the name of the database engine.</p>
*/
inline void SetEngine(const Aws::String& value) { m_engineHasBeenSet = true; m_engine = value; }
/**
* <p>Specifies the name of the database engine.</p>
*/
inline void SetEngine(Aws::String&& value) { m_engineHasBeenSet = true; m_engine = std::move(value); }
/**
* <p>Specifies the name of the database engine.</p>
*/
inline void SetEngine(const char* value) { m_engineHasBeenSet = true; m_engine.assign(value); }
/**
* <p>Specifies the name of the database engine.</p>
*/
inline DBClusterSnapshot& WithEngine(const Aws::String& value) { SetEngine(value); return *this;}
/**
* <p>Specifies the name of the database engine.</p>
*/
inline DBClusterSnapshot& WithEngine(Aws::String&& value) { SetEngine(std::move(value)); return *this;}
/**
* <p>Specifies the name of the database engine.</p>
*/
inline DBClusterSnapshot& WithEngine(const char* value) { SetEngine(value); return *this;}
/**
* <p>Specifies the status of this cluster snapshot.</p>
*/
inline const Aws::String& GetStatus() const{ return m_status; }
/**
* <p>Specifies the status of this cluster snapshot.</p>
*/
inline bool StatusHasBeenSet() const { return m_statusHasBeenSet; }
/**
* <p>Specifies the status of this cluster snapshot.</p>
*/
inline void SetStatus(const Aws::String& value) { m_statusHasBeenSet = true; m_status = value; }
/**
* <p>Specifies the status of this cluster snapshot.</p>
*/
inline void SetStatus(Aws::String&& value) { m_statusHasBeenSet = true; m_status = std::move(value); }
/**
* <p>Specifies the status of this cluster snapshot.</p>
*/
inline void SetStatus(const char* value) { m_statusHasBeenSet = true; m_status.assign(value); }
/**
* <p>Specifies the status of this cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithStatus(const Aws::String& value) { SetStatus(value); return *this;}
/**
* <p>Specifies the status of this cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithStatus(Aws::String&& value) { SetStatus(std::move(value)); return *this;}
/**
* <p>Specifies the status of this cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithStatus(const char* value) { SetStatus(value); return *this;}
/**
* <p>Specifies the port that the cluster was listening on at the time of the
* snapshot.</p>
*/
inline int GetPort() const{ return m_port; }
/**
* <p>Specifies the port that the cluster was listening on at the time of the
* snapshot.</p>
*/
inline bool PortHasBeenSet() const { return m_portHasBeenSet; }
/**
* <p>Specifies the port that the cluster was listening on at the time of the
* snapshot.</p>
*/
inline void SetPort(int value) { m_portHasBeenSet = true; m_port = value; }
/**
* <p>Specifies the port that the cluster was listening on at the time of the
* snapshot.</p>
*/
inline DBClusterSnapshot& WithPort(int value) { SetPort(value); return *this;}
/**
* <p>Provides the virtual private cloud (VPC) ID that is associated with the
* cluster snapshot.</p>
*/
inline const Aws::String& GetVpcId() const{ return m_vpcId; }
/**
* <p>Provides the virtual private cloud (VPC) ID that is associated with the
* cluster snapshot.</p>
*/
inline bool VpcIdHasBeenSet() const { return m_vpcIdHasBeenSet; }
/**
* <p>Provides the virtual private cloud (VPC) ID that is associated with the
* cluster snapshot.</p>
*/
inline void SetVpcId(const Aws::String& value) { m_vpcIdHasBeenSet = true; m_vpcId = value; }
/**
* <p>Provides the virtual private cloud (VPC) ID that is associated with the
* cluster snapshot.</p>
*/
inline void SetVpcId(Aws::String&& value) { m_vpcIdHasBeenSet = true; m_vpcId = std::move(value); }
/**
* <p>Provides the virtual private cloud (VPC) ID that is associated with the
* cluster snapshot.</p>
*/
inline void SetVpcId(const char* value) { m_vpcIdHasBeenSet = true; m_vpcId.assign(value); }
/**
* <p>Provides the virtual private cloud (VPC) ID that is associated with the
* cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithVpcId(const Aws::String& value) { SetVpcId(value); return *this;}
/**
* <p>Provides the virtual private cloud (VPC) ID that is associated with the
* cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithVpcId(Aws::String&& value) { SetVpcId(std::move(value)); return *this;}
/**
* <p>Provides the virtual private cloud (VPC) ID that is associated with the
* cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithVpcId(const char* value) { SetVpcId(value); return *this;}
/**
* <p>Specifies the time when the cluster was created, in Universal Coordinated
* Time (UTC).</p>
*/
inline const Aws::Utils::DateTime& GetClusterCreateTime() const{ return m_clusterCreateTime; }
/**
* <p>Specifies the time when the cluster was created, in Universal Coordinated
* Time (UTC).</p>
*/
inline bool ClusterCreateTimeHasBeenSet() const { return m_clusterCreateTimeHasBeenSet; }
/**
* <p>Specifies the time when the cluster was created, in Universal Coordinated
* Time (UTC).</p>
*/
inline void SetClusterCreateTime(const Aws::Utils::DateTime& value) { m_clusterCreateTimeHasBeenSet = true; m_clusterCreateTime = value; }
/**
* <p>Specifies the time when the cluster was created, in Universal Coordinated
* Time (UTC).</p>
*/
inline void SetClusterCreateTime(Aws::Utils::DateTime&& value) { m_clusterCreateTimeHasBeenSet = true; m_clusterCreateTime = std::move(value); }
/**
* <p>Specifies the time when the cluster was created, in Universal Coordinated
* Time (UTC).</p>
*/
inline DBClusterSnapshot& WithClusterCreateTime(const Aws::Utils::DateTime& value) { SetClusterCreateTime(value); return *this;}
/**
* <p>Specifies the time when the cluster was created, in Universal Coordinated
* Time (UTC).</p>
*/
inline DBClusterSnapshot& WithClusterCreateTime(Aws::Utils::DateTime&& value) { SetClusterCreateTime(std::move(value)); return *this;}
/**
* <p>Provides the master user name for the cluster snapshot.</p>
*/
inline const Aws::String& GetMasterUsername() const{ return m_masterUsername; }
/**
* <p>Provides the master user name for the cluster snapshot.</p>
*/
inline bool MasterUsernameHasBeenSet() const { return m_masterUsernameHasBeenSet; }
/**
* <p>Provides the master user name for the cluster snapshot.</p>
*/
inline void SetMasterUsername(const Aws::String& value) { m_masterUsernameHasBeenSet = true; m_masterUsername = value; }
/**
* <p>Provides the master user name for the cluster snapshot.</p>
*/
inline void SetMasterUsername(Aws::String&& value) { m_masterUsernameHasBeenSet = true; m_masterUsername = std::move(value); }
/**
* <p>Provides the master user name for the cluster snapshot.</p>
*/
inline void SetMasterUsername(const char* value) { m_masterUsernameHasBeenSet = true; m_masterUsername.assign(value); }
/**
* <p>Provides the master user name for the cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithMasterUsername(const Aws::String& value) { SetMasterUsername(value); return *this;}
/**
* <p>Provides the master user name for the cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithMasterUsername(Aws::String&& value) { SetMasterUsername(std::move(value)); return *this;}
/**
* <p>Provides the master user name for the cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithMasterUsername(const char* value) { SetMasterUsername(value); return *this;}
/**
* <p>Provides the version of the database engine for this cluster snapshot.</p>
*/
inline const Aws::String& GetEngineVersion() const{ return m_engineVersion; }
/**
* <p>Provides the version of the database engine for this cluster snapshot.</p>
*/
inline bool EngineVersionHasBeenSet() const { return m_engineVersionHasBeenSet; }
/**
* <p>Provides the version of the database engine for this cluster snapshot.</p>
*/
inline void SetEngineVersion(const Aws::String& value) { m_engineVersionHasBeenSet = true; m_engineVersion = value; }
/**
* <p>Provides the version of the database engine for this cluster snapshot.</p>
*/
inline void SetEngineVersion(Aws::String&& value) { m_engineVersionHasBeenSet = true; m_engineVersion = std::move(value); }
/**
* <p>Provides the version of the database engine for this cluster snapshot.</p>
*/
inline void SetEngineVersion(const char* value) { m_engineVersionHasBeenSet = true; m_engineVersion.assign(value); }
/**
* <p>Provides the version of the database engine for this cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithEngineVersion(const Aws::String& value) { SetEngineVersion(value); return *this;}
/**
* <p>Provides the version of the database engine for this cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithEngineVersion(Aws::String&& value) { SetEngineVersion(std::move(value)); return *this;}
/**
* <p>Provides the version of the database engine for this cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithEngineVersion(const char* value) { SetEngineVersion(value); return *this;}
/**
* <p>Provides the type of the cluster snapshot.</p>
*/
inline const Aws::String& GetSnapshotType() const{ return m_snapshotType; }
/**
* <p>Provides the type of the cluster snapshot.</p>
*/
inline bool SnapshotTypeHasBeenSet() const { return m_snapshotTypeHasBeenSet; }
/**
* <p>Provides the type of the cluster snapshot.</p>
*/
inline void SetSnapshotType(const Aws::String& value) { m_snapshotTypeHasBeenSet = true; m_snapshotType = value; }
/**
* <p>Provides the type of the cluster snapshot.</p>
*/
inline void SetSnapshotType(Aws::String&& value) { m_snapshotTypeHasBeenSet = true; m_snapshotType = std::move(value); }
/**
* <p>Provides the type of the cluster snapshot.</p>
*/
inline void SetSnapshotType(const char* value) { m_snapshotTypeHasBeenSet = true; m_snapshotType.assign(value); }
/**
* <p>Provides the type of the cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithSnapshotType(const Aws::String& value) { SetSnapshotType(value); return *this;}
/**
* <p>Provides the type of the cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithSnapshotType(Aws::String&& value) { SetSnapshotType(std::move(value)); return *this;}
/**
* <p>Provides the type of the cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithSnapshotType(const char* value) { SetSnapshotType(value); return *this;}
/**
* <p>Specifies the percentage of the estimated data that has been transferred.</p>
*/
inline int GetPercentProgress() const{ return m_percentProgress; }
/**
* <p>Specifies the percentage of the estimated data that has been transferred.</p>
*/
inline bool PercentProgressHasBeenSet() const { return m_percentProgressHasBeenSet; }
/**
* <p>Specifies the percentage of the estimated data that has been transferred.</p>
*/
inline void SetPercentProgress(int value) { m_percentProgressHasBeenSet = true; m_percentProgress = value; }
/**
* <p>Specifies the percentage of the estimated data that has been transferred.</p>
*/
inline DBClusterSnapshot& WithPercentProgress(int value) { SetPercentProgress(value); return *this;}
/**
* <p>Specifies whether the cluster snapshot is encrypted.</p>
*/
inline bool GetStorageEncrypted() const{ return m_storageEncrypted; }
/**
* <p>Specifies whether the cluster snapshot is encrypted.</p>
*/
inline bool StorageEncryptedHasBeenSet() const { return m_storageEncryptedHasBeenSet; }
/**
* <p>Specifies whether the cluster snapshot is encrypted.</p>
*/
inline void SetStorageEncrypted(bool value) { m_storageEncryptedHasBeenSet = true; m_storageEncrypted = value; }
/**
* <p>Specifies whether the cluster snapshot is encrypted.</p>
*/
inline DBClusterSnapshot& WithStorageEncrypted(bool value) { SetStorageEncrypted(value); return *this;}
/**
* <p>If <code>StorageEncrypted</code> is <code>true</code>, the KMS key identifier
* for the encrypted cluster snapshot.</p>
*/
inline const Aws::String& GetKmsKeyId() const{ return m_kmsKeyId; }
/**
* <p>If <code>StorageEncrypted</code> is <code>true</code>, the KMS key identifier
* for the encrypted cluster snapshot.</p>
*/
inline bool KmsKeyIdHasBeenSet() const { return m_kmsKeyIdHasBeenSet; }
/**
* <p>If <code>StorageEncrypted</code> is <code>true</code>, the KMS key identifier
* for the encrypted cluster snapshot.</p>
*/
inline void SetKmsKeyId(const Aws::String& value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId = value; }
/**
* <p>If <code>StorageEncrypted</code> is <code>true</code>, the KMS key identifier
* for the encrypted cluster snapshot.</p>
*/
inline void SetKmsKeyId(Aws::String&& value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId = std::move(value); }
/**
* <p>If <code>StorageEncrypted</code> is <code>true</code>, the KMS key identifier
* for the encrypted cluster snapshot.</p>
*/
inline void SetKmsKeyId(const char* value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId.assign(value); }
/**
* <p>If <code>StorageEncrypted</code> is <code>true</code>, the KMS key identifier
* for the encrypted cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithKmsKeyId(const Aws::String& value) { SetKmsKeyId(value); return *this;}
/**
* <p>If <code>StorageEncrypted</code> is <code>true</code>, the KMS key identifier
* for the encrypted cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithKmsKeyId(Aws::String&& value) { SetKmsKeyId(std::move(value)); return *this;}
/**
* <p>If <code>StorageEncrypted</code> is <code>true</code>, the KMS key identifier
* for the encrypted cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithKmsKeyId(const char* value) { SetKmsKeyId(value); return *this;}
/**
* <p>The Amazon Resource Name (ARN) for the cluster snapshot.</p>
*/
inline const Aws::String& GetDBClusterSnapshotArn() const{ return m_dBClusterSnapshotArn; }
/**
* <p>The Amazon Resource Name (ARN) for the cluster snapshot.</p>
*/
inline bool DBClusterSnapshotArnHasBeenSet() const { return m_dBClusterSnapshotArnHasBeenSet; }
/**
* <p>The Amazon Resource Name (ARN) for the cluster snapshot.</p>
*/
inline void SetDBClusterSnapshotArn(const Aws::String& value) { m_dBClusterSnapshotArnHasBeenSet = true; m_dBClusterSnapshotArn = value; }
/**
* <p>The Amazon Resource Name (ARN) for the cluster snapshot.</p>
*/
inline void SetDBClusterSnapshotArn(Aws::String&& value) { m_dBClusterSnapshotArnHasBeenSet = true; m_dBClusterSnapshotArn = std::move(value); }
/**
* <p>The Amazon Resource Name (ARN) for the cluster snapshot.</p>
*/
inline void SetDBClusterSnapshotArn(const char* value) { m_dBClusterSnapshotArnHasBeenSet = true; m_dBClusterSnapshotArn.assign(value); }
/**
* <p>The Amazon Resource Name (ARN) for the cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithDBClusterSnapshotArn(const Aws::String& value) { SetDBClusterSnapshotArn(value); return *this;}
/**
* <p>The Amazon Resource Name (ARN) for the cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithDBClusterSnapshotArn(Aws::String&& value) { SetDBClusterSnapshotArn(std::move(value)); return *this;}
/**
* <p>The Amazon Resource Name (ARN) for the cluster snapshot.</p>
*/
inline DBClusterSnapshot& WithDBClusterSnapshotArn(const char* value) { SetDBClusterSnapshotArn(value); return *this;}
/**
* <p>If the cluster snapshot was copied from a source cluster snapshot, the ARN
* for the source cluster snapshot; otherwise, a null value.</p>
*/
inline const Aws::String& GetSourceDBClusterSnapshotArn() const{ return m_sourceDBClusterSnapshotArn; }
/**
* <p>If the cluster snapshot was copied from a source cluster snapshot, the ARN
* for the source cluster snapshot; otherwise, a null value.</p>
*/
inline bool SourceDBClusterSnapshotArnHasBeenSet() const { return m_sourceDBClusterSnapshotArnHasBeenSet; }
/**
* <p>If the cluster snapshot was copied from a source cluster snapshot, the ARN
* for the source cluster snapshot; otherwise, a null value.</p>
*/
inline void SetSourceDBClusterSnapshotArn(const Aws::String& value) { m_sourceDBClusterSnapshotArnHasBeenSet = true; m_sourceDBClusterSnapshotArn = value; }
/**
* <p>If the cluster snapshot was copied from a source cluster snapshot, the ARN
* for the source cluster snapshot; otherwise, a null value.</p>
*/
inline void SetSourceDBClusterSnapshotArn(Aws::String&& value) { m_sourceDBClusterSnapshotArnHasBeenSet = true; m_sourceDBClusterSnapshotArn = std::move(value); }
/**
* <p>If the cluster snapshot was copied from a source cluster snapshot, the ARN
* for the source cluster snapshot; otherwise, a null value.</p>
*/
inline void SetSourceDBClusterSnapshotArn(const char* value) { m_sourceDBClusterSnapshotArnHasBeenSet = true; m_sourceDBClusterSnapshotArn.assign(value); }
/**
* <p>If the cluster snapshot was copied from a source cluster snapshot, the ARN
* for the source cluster snapshot; otherwise, a null value.</p>
*/
inline DBClusterSnapshot& WithSourceDBClusterSnapshotArn(const Aws::String& value) { SetSourceDBClusterSnapshotArn(value); return *this;}
/**
* <p>If the cluster snapshot was copied from a source cluster snapshot, the ARN
* for the source cluster snapshot; otherwise, a null value.</p>
*/
inline DBClusterSnapshot& WithSourceDBClusterSnapshotArn(Aws::String&& value) { SetSourceDBClusterSnapshotArn(std::move(value)); return *this;}
/**
* <p>If the cluster snapshot was copied from a source cluster snapshot, the ARN
* for the source cluster snapshot; otherwise, a null value.</p>
*/
inline DBClusterSnapshot& WithSourceDBClusterSnapshotArn(const char* value) { SetSourceDBClusterSnapshotArn(value); return *this;}
private:
Aws::Vector<Aws::String> m_availabilityZones;
bool m_availabilityZonesHasBeenSet;
Aws::String m_dBClusterSnapshotIdentifier;
bool m_dBClusterSnapshotIdentifierHasBeenSet;
Aws::String m_dBClusterIdentifier;
bool m_dBClusterIdentifierHasBeenSet;
Aws::Utils::DateTime m_snapshotCreateTime;
bool m_snapshotCreateTimeHasBeenSet;
Aws::String m_engine;
bool m_engineHasBeenSet;
Aws::String m_status;
bool m_statusHasBeenSet;
int m_port;
bool m_portHasBeenSet;
Aws::String m_vpcId;
bool m_vpcIdHasBeenSet;
Aws::Utils::DateTime m_clusterCreateTime;
bool m_clusterCreateTimeHasBeenSet;
Aws::String m_masterUsername;
bool m_masterUsernameHasBeenSet;
Aws::String m_engineVersion;
bool m_engineVersionHasBeenSet;
Aws::String m_snapshotType;
bool m_snapshotTypeHasBeenSet;
int m_percentProgress;
bool m_percentProgressHasBeenSet;
bool m_storageEncrypted;
bool m_storageEncryptedHasBeenSet;
Aws::String m_kmsKeyId;
bool m_kmsKeyIdHasBeenSet;
Aws::String m_dBClusterSnapshotArn;
bool m_dBClusterSnapshotArnHasBeenSet;
Aws::String m_sourceDBClusterSnapshotArn;
bool m_sourceDBClusterSnapshotArnHasBeenSet;
};
} // namespace Model
} // namespace DocDB
} // namespace Aws
| {
"content_hash": "f7a0b7c4b99890a5a137496d53e9324b",
"timestamp": "",
"source": "github",
"line_count": 769,
"max_line_length": 176,
"avg_line_length": 38.224967490247074,
"alnum_prop": 0.6799795883653683,
"repo_name": "cedral/aws-sdk-cpp",
"id": "1c78813700459469ed93da5e49ebf034b6fa5328",
"size": "29514",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-docdb/include/aws/docdb/model/DBClusterSnapshot.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "294220"
},
{
"name": "C++",
"bytes": "428637022"
},
{
"name": "CMake",
"bytes": "862025"
},
{
"name": "Dockerfile",
"bytes": "11688"
},
{
"name": "HTML",
"bytes": "7904"
},
{
"name": "Java",
"bytes": "352201"
},
{
"name": "Python",
"bytes": "106761"
},
{
"name": "Shell",
"bytes": "10891"
}
],
"symlink_target": ""
} |
jupyter notebook --allow-root "$@"
| {
"content_hash": "3d01e5532e5aacba8be3f46a7b3a975c",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 34,
"avg_line_length": 35,
"alnum_prop": 0.6857142857142857,
"repo_name": "esahin90/rpi-docker-ros-tensorflow",
"id": "99b969950df4d93da20a7d153a82f92579b69fe9",
"size": "746",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build-tensor-pi/run_jupyter.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Jupyter Notebook",
"bytes": "339602"
},
{
"name": "Python",
"bytes": "5777"
},
{
"name": "Shell",
"bytes": "1036"
}
],
"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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel</groupId>
<artifactId>components</artifactId>
<version>3.12.0-SNAPSHOT</version>
</parent>
<artifactId>camel-ognl</artifactId>
<packaging>jar</packaging>
<name>Camel :: OGNL</name>
<description>Camel OGNL support</description>
<properties>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-support</artifactId>
</dependency>
<dependency>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
</dependency>
<!-- testing -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| {
"content_hash": "ba40b45a3330998be3aa424b0a6d496c",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 201,
"avg_line_length": 35.723076923076924,
"alnum_prop": 0.6468561584840654,
"repo_name": "tdiesler/camel",
"id": "82e494334878d576d9360f5cd327c7ff8b4cae16",
"size": "2322",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "components/camel-ognl/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Apex",
"bytes": "6521"
},
{
"name": "Batchfile",
"bytes": "2353"
},
{
"name": "CSS",
"bytes": "5472"
},
{
"name": "Dockerfile",
"bytes": "5675"
},
{
"name": "Elm",
"bytes": "10852"
},
{
"name": "FreeMarker",
"bytes": "8015"
},
{
"name": "Groovy",
"bytes": "249715"
},
{
"name": "HTML",
"bytes": "203529"
},
{
"name": "Java",
"bytes": "105215396"
},
{
"name": "JavaScript",
"bytes": "103621"
},
{
"name": "Jsonnet",
"bytes": "1734"
},
{
"name": "Kotlin",
"bytes": "41816"
},
{
"name": "Mustache",
"bytes": "525"
},
{
"name": "RobotFramework",
"bytes": "8461"
},
{
"name": "Ruby",
"bytes": "88"
},
{
"name": "Shell",
"bytes": "15162"
},
{
"name": "Tcl",
"bytes": "4974"
},
{
"name": "Thrift",
"bytes": "6979"
},
{
"name": "XQuery",
"bytes": "546"
},
{
"name": "XSLT",
"bytes": "276597"
}
],
"symlink_target": ""
} |
<?php
/**
* printers
* @package mychaelstyle
* @subpackage fops
*/
namespace mychaelstyle\fops;
require_once dirname(__FILE__).'/Printer.php';
/**
* printers
* @package mychaelstyle
* @subpackage fops
*/
class Printers {
/**
* @var array of Printer
*/
private $printers = array();
/**
* constructor
*/
public function __construct(){
$this->printers = array();
}
/**
* add
*/
public function add(Printer $printer){
$this->printers[] = $printer;
}
/**
* remove
*/
public function remove($printer){
$renews = array();
foreach($this->printers as $pr){
if(is_string($printer)){
if($printer!=get_class($pr)){
$renews[] = $pr;
}
} else if(is_object($printer) && is_a($printer,'Printer')){
if(get_class($printer)!=get_class($pr)){
$renews[] = $pr;
}
}
}
$tihs->printers = $renews;
}
public function output($string,$tag=null){
foreach($this->printers as $pr){
$pr->output($tag,$string);
}
}
public function notify($message,$tag=null,$priority=60){
foreach($this->printers as $pr){
$pr->notify($message,$tag,$priority);
}
}
/**
* attr
*/
public function attr($key,$value=null){
foreach($this->printers as $pr){
$pr->attr($key,$value);
}
}
/**
* debug
* @param string $msg
*/
public function debug($msg,$tag='default'){
foreach($this->printers as $pr){
$pr->debug($msg,$tag);
}
}
/**
* info
* @param string $msg
*/
public function info($msg,$tag='default'){
foreach($this->printers as $pr){
$pr->info($msg,$tag);
}
}
/**
* error
* @param string $msg
*/
public function error($msg,$tag='default'){
foreach($this->printers as $pr){
$pr->error($msg,$tag);
}
}
}
| {
"content_hash": "39893d47ca79681791f03e19148f2387",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 65,
"avg_line_length": 19.239583333333332,
"alnum_prop": 0.5376285868976719,
"repo_name": "mychaelstyle/fops-php",
"id": "0f6ca7bd8e27eaaeeab6b3e4197100221f5dec47",
"size": "1847",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/mychaelstyle/fops/Printers.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "PHP",
"bytes": "11939"
},
{
"name": "Shell",
"bytes": "510"
}
],
"symlink_target": ""
} |
layout: post
title: "Split Apply Combine"
date: "October 30, 2015"
categories: Software
tags: Wrangling
---
* TOC
{:toc}
Obtaining summary statistics for a given group can be done using the general process:
1. Split: split by the variable
2. Apply: apply the function to each split
3. Combine: combine the results back into a single data structure
# In R
The package `dplyr` is a great option for this in R.
{% highlight r %}
data %>%
group_by(col1, col2) %>%
apply_f(newcol = f(x))
{% endhighlight %}
**Splitting**
The `dplyr::group_by()` function can be used to group by any column in the data frame.
* `tidyr::nest()` can be used to bin split groups into a column list
**Applying**
* `dplyr::slice()` obtains records by row index, useful with functions like `which.max()` or `which.min()`
* `dplyr::summarise()` summarises a vector into a single row
* `dplyr::mutate()` applies a function on a vector and appends results to data frame
* `dplyr::do()` or `purrrlyr::by_slice()` applies a function on a dataframe and returns a list of objects that are appended to the data frame
There are a few extensions on the `dplyr::summarise()` and `dplyr::mutate()` functions.
* to apply a function to all variables with `summarise_all()` and `mutate_all()`
* to apply a function to select variables with `summarise_at()` and `mutate_at()`
* to apply a function to variables that satisfy certain conditions functions `summarise_if()` and `mutate_if()`
* to apply multiple functions, wrap functions in `funs()`
* for functions with additional arguments, do `funs(my_func(., addnl_args))`
**Combining**
By default, `dplyr` will combine the separate groups back together.
* `tidyr::unnest()` can be used to expand upon a dataframe that has a column consisting of dataframe objects
# In SAS
Split-apply-combine in SAS is implemented using `proc sql` statements. These statements would group and apply the same way that it is done in SQL.
Alternatively, this can be done in SAS with the `proc` statements. There is `by` or `class` clause that allows users to specify what they would like the data to be split by.
Here are a few examples.
{% highlight r %}
proc sort; by GROUP.VAR;
proc rank ASCENDING/DESCENDING;
by GROUP.VAR;
var ORDER.VAR;
ranks NEW.RANK.COL;
run;
{% endhighlight %}
Proc means has a number of different options. See SAS documentation for more information.
{% highlight r %}
proc means OPTIONS;
class GROUP.VAR;
var MEANS.VAR;
output out = OUTNAME OPTIONS = VARNAME;
run;
{% endhighlight %}
{% highlight r %}
proc standard OPTIONS;
by GROUP.VAR;
var VARNAMES;
run;
{% endhighlight %}
To combine the grouped summaries back into the main data, run a merge/join.
# In SQL
SQL allows split apply combine using the following phrases
* `group by`
* `having`
Aggregate functions tend to be used along with the `group by` command. These functions include
* `count( * )`
* `count( distinct A )`
* `sum( distinct A )`
* `avg( distinct A )`
* `max( A )`
* `min( A )`
* `first( A )`
* `last( A )`
Below is an example of this type of SQL statement.
{% highlight sql %}
SELECT COUNT(DISTINCT COL1) as C
from TAB1
group by COLG
having COL1 > 5
order by C
;
{% endhighlight %}
To combine the grouped summaries back into the main data, run a merge/join.
| {
"content_hash": "b21a954a3f765fd13478907c774eaf0d",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 173,
"avg_line_length": 26.126984126984127,
"alnum_prop": 0.718408262454435,
"repo_name": "jennguyen1/nhuyhoa",
"id": "0a0f2149ea9b36a5ad81810b7292a4ebcd5220f5",
"size": "3296",
"binary": false,
"copies": "2",
"ref": "refs/heads/gh-pages",
"path": "_posts/2015-10-30-Split-Apply-Combine.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "10491"
},
{
"name": "HTML",
"bytes": "7827"
},
{
"name": "Python",
"bytes": "4011"
},
{
"name": "R",
"bytes": "35842"
}
],
"symlink_target": ""
} |
package org.apache.shardingsphere.example.core.jpa.repository;
import org.apache.shardingsphere.example.core.api.repository.OrderItemRepository;
import org.apache.shardingsphere.example.core.api.entity.OrderItem;
import org.springframework.stereotype.Repository;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.transaction.Transactional;
import java.util.List;
@Repository
@Transactional
public class OrderItemRepositoryImpl implements OrderItemRepository {
@PersistenceContext
private EntityManager entityManager;
@Override
public void createTableIfNotExists() {
throw new UnsupportedOperationException("createTableIfNotExists for JPA");
}
@Override
public void truncateTable() {
throw new UnsupportedOperationException("truncateTable for JPA");
}
@Override
public void dropTable() {
throw new UnsupportedOperationException("dropTable for JPA");
}
@Override
public Long insert(final OrderItem orderItem) {
entityManager.persist(orderItem);
return orderItem.getOrderItemId();
}
@Override
public void delete(final Long orderItemId) {
Query query = entityManager.createQuery("DELETE FROM OrderItemEntity i WHERE i.orderItemId = ?1 AND i.userId = 51");
query.setParameter(1, orderItemId);
query.executeUpdate();
}
@Override
@SuppressWarnings("unchecked")
public List<OrderItem> selectAll() {
return (List<OrderItem>) entityManager.createQuery("SELECT i FROM OrderEntity o, OrderItemEntity i WHERE o.orderId = i.orderId").getResultList();
}
}
| {
"content_hash": "719b1b264e22e4dbe44f34394d9fb0a2",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 153,
"avg_line_length": 31.21818181818182,
"alnum_prop": 0.7303436225975539,
"repo_name": "leeyazhou/sharding-jdbc",
"id": "861f7aadf2d31f8b88478d7203f0adaed4e73f6b",
"size": "2518",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "examples/example-core/example-spring-jpa/src/main/java/org/apache/shardingsphere/example/core/jpa/repository/OrderItemRepositoryImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "266999"
},
{
"name": "Batchfile",
"bytes": "3280"
},
{
"name": "CSS",
"bytes": "2842"
},
{
"name": "Dockerfile",
"bytes": "1485"
},
{
"name": "HTML",
"bytes": "2146"
},
{
"name": "Java",
"bytes": "7346718"
},
{
"name": "JavaScript",
"bytes": "92884"
},
{
"name": "Shell",
"bytes": "9837"
},
{
"name": "TSQL",
"bytes": "68705"
},
{
"name": "Vue",
"bytes": "82063"
}
],
"symlink_target": ""
} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>ssl::rfc2818_verification::result_type</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Boost.Asio">
<link rel="up" href="../ssl__rfc2818_verification.html" title="ssl::rfc2818_verification">
<link rel="prev" href="operator_lp__rp_.html" title="ssl::rfc2818_verification::operator()">
<link rel="next" href="rfc2818_verification.html" title="ssl::rfc2818_verification::rfc2818_verification">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="operator_lp__rp_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ssl__rfc2818_verification.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="rfc2818_verification.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_asio.reference.ssl__rfc2818_verification.result_type"></a><a class="link" href="result_type.html" title="ssl::rfc2818_verification::result_type">ssl::rfc2818_verification::result_type</a>
</h4></div></div></div>
<p>
<a class="indexterm" name="idm45464962486528"></a>
The type of the function object's result.
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="keyword">bool</span> <span class="identifier">result_type</span><span class="special">;</span>
</pre>
<h6>
<a name="boost_asio.reference.ssl__rfc2818_verification.result_type.h0"></a>
<span class="phrase"><a name="boost_asio.reference.ssl__rfc2818_verification.result_type.requirements"></a></span><a class="link" href="result_type.html#boost_asio.reference.ssl__rfc2818_verification.result_type.requirements">Requirements</a>
</h6>
<p>
<span class="emphasis"><em>Header: </em></span><code class="literal">boost/asio/ssl/rfc2818_verification.hpp</code>
</p>
<p>
<span class="emphasis"><em>Convenience header: </em></span><code class="literal">boost/asio/ssl.hpp</code>
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2003-2016 Christopher
M. Kohlhoff<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="operator_lp__rp_.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ssl__rfc2818_verification.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="rfc2818_verification.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {
"content_hash": "a1571c77ea5e96787151138c18bb90dd",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 478,
"avg_line_length": 68.1,
"alnum_prop": 0.6299559471365639,
"repo_name": "FFMG/myoddweb.piger",
"id": "4ad8cf9fb6e6296b802b0c09c8d65e4b41c67c6e",
"size": "4086",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "myodd/boost/libs/asio/doc/html/boost_asio/reference/ssl__rfc2818_verification/result_type.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ada",
"bytes": "89079"
},
{
"name": "Assembly",
"bytes": "399228"
},
{
"name": "Batchfile",
"bytes": "93889"
},
{
"name": "C",
"bytes": "32256857"
},
{
"name": "C#",
"bytes": "197461"
},
{
"name": "C++",
"bytes": "200544641"
},
{
"name": "CMake",
"bytes": "192771"
},
{
"name": "CSS",
"bytes": "441704"
},
{
"name": "CWeb",
"bytes": "174166"
},
{
"name": "Common Lisp",
"bytes": "24481"
},
{
"name": "Cuda",
"bytes": "52444"
},
{
"name": "DIGITAL Command Language",
"bytes": "33549"
},
{
"name": "DTrace",
"bytes": "2157"
},
{
"name": "Fortran",
"bytes": "1856"
},
{
"name": "HTML",
"bytes": "181677643"
},
{
"name": "IDL",
"bytes": "14"
},
{
"name": "Inno Setup",
"bytes": "9647"
},
{
"name": "JavaScript",
"bytes": "705756"
},
{
"name": "Lex",
"bytes": "1231"
},
{
"name": "Lua",
"bytes": "3332"
},
{
"name": "M4",
"bytes": "259214"
},
{
"name": "Makefile",
"bytes": "1262318"
},
{
"name": "Max",
"bytes": "36857"
},
{
"name": "Module Management System",
"bytes": "1545"
},
{
"name": "Objective-C",
"bytes": "2167778"
},
{
"name": "Objective-C++",
"bytes": "630"
},
{
"name": "PHP",
"bytes": "59030"
},
{
"name": "PLSQL",
"bytes": "22886"
},
{
"name": "Pascal",
"bytes": "75208"
},
{
"name": "Perl",
"bytes": "42080"
},
{
"name": "PostScript",
"bytes": "13803"
},
{
"name": "PowerShell",
"bytes": "11781"
},
{
"name": "Python",
"bytes": "30377308"
},
{
"name": "QML",
"bytes": "593"
},
{
"name": "QMake",
"bytes": "16692"
},
{
"name": "Rebol",
"bytes": "354"
},
{
"name": "Rich Text Format",
"bytes": "6743"
},
{
"name": "Roff",
"bytes": "55661"
},
{
"name": "Ruby",
"bytes": "5532"
},
{
"name": "SAS",
"bytes": "1847"
},
{
"name": "Shell",
"bytes": "783974"
},
{
"name": "TSQL",
"bytes": "1201"
},
{
"name": "Tcl",
"bytes": "1172"
},
{
"name": "TeX",
"bytes": "32117"
},
{
"name": "Visual Basic",
"bytes": "70"
},
{
"name": "XSLT",
"bytes": "552736"
},
{
"name": "Yacc",
"bytes": "19623"
}
],
"symlink_target": ""
} |
package org.assertj.core.api.map;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.util.Arrays.array;
import static org.mockito.Mockito.verify;
import java.util.Map;
import org.assertj.core.api.MapAssert;
import org.assertj.core.api.MapAssertBaseTest;
import org.junit.Test;
public class MapAssert_doesNotContain_with_Java_Util_MapEntry_Test extends MapAssertBaseTest {
@Override
protected MapAssert<Object, Object> invoke_api_method() {
return assertions.doesNotContain(javaMapEntry("key1", "value1"), javaMapEntry("key2", "value2"));
}
@Override
protected void verify_internal_effects() {
Map.Entry<String, String>[] entries = array(javaMapEntry("key1", "value1"), javaMapEntry("key2", "value2"));
verify(maps).assertDoesNotContain(getInfo(assertions), getActual(assertions), entries);
}
@Test
public void invoke_api_like_user() {
assertThat(map("key1", "value1")).doesNotContain(javaMapEntry("key2", "value2"), javaMapEntry("key3", "value3"));
}
}
| {
"content_hash": "072b5ed4ee2e4a21d71efd35a77a01e0",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 118,
"avg_line_length": 33.41935483870968,
"alnum_prop": 0.7442084942084942,
"repo_name": "ChrisCanCompute/assertj-core",
"id": "2201d3175cc52b4034752c4c2b2c82d8a68e4b90",
"size": "1643",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/test/java/org/assertj/core/api/map/MapAssert_doesNotContain_with_Java_Util_MapEntry_Test.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "4994"
},
{
"name": "Java",
"bytes": "10239517"
},
{
"name": "Shell",
"bytes": "47288"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.3) on Sun Mar 29 22:42:10 IST 2020 -->
<title>com.googlecode.cqengine.index.sqlite.support (CQEngine 3.5.0 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2020-03-29">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="com.googlecode.cqengine.index.sqlite.support (CQEngine 3.5.0 API)";
}
}
catch(err) {
}
//-->
var pathtoroot = "../../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses.html">All Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<main role="main">
<div class="header">
<h1 title="Package" class="title">Package com.googlecode.cqengine.index.sqlite.support</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="DBQueries.html" title="class in com.googlecode.cqengine.index.sqlite.support">DBQueries</a></th>
<td class="colLast">
<div class="block">Database (SQLite) query executor used by the <a href="../SQLiteIndex.html" title="class in com.googlecode.cqengine.index.sqlite"><code>SQLiteIndex</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="DBQueries.Row.html" title="class in com.googlecode.cqengine.index.sqlite.support">DBQueries.Row</a><K,​A></th>
<td class="colLast">
<div class="block">Represents a table row (objectId, value).</div>
</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="DBUtils.html" title="class in com.googlecode.cqengine.index.sqlite.support">DBUtils</a></th>
<td class="colLast">
<div class="block">A bunch of useful database utilities.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="SQLiteIndexFlags.html" title="class in com.googlecode.cqengine.index.sqlite.support">SQLiteIndexFlags</a></th>
<td class="colLast">
<div class="block">Flags which can be set in query options (via <a href="../../../query/QueryFactory.html" title="class in com.googlecode.cqengine.query"><code>QueryFactory</code></a>) which allow the
behaviour of <a href="../SQLiteIndex.html" title="class in com.googlecode.cqengine.index.sqlite"><code>SQLiteIndex</code></a> to be adjusted.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary">
<caption><span>Enum Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Enum</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="SQLiteIndexFlags.BulkImportExternallyManged.html" title="enum in com.googlecode.cqengine.index.sqlite.support">SQLiteIndexFlags.BulkImportExternallyManged</a></th>
<td class="colLast">
<div class="block"> A 2-values flag that enables externally managed bulk import and specifies it's status.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
</main>
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright © 2020. All rights reserved.</small></p>
</footer>
</body>
</html>
| {
"content_hash": "84dee1b33f44cf047fa5f4f597100655",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 205,
"avg_line_length": 36.37378640776699,
"alnum_prop": 0.63926331242493,
"repo_name": "npgall/cqengine",
"id": "89dfadd0bf809348a549eb99eea4c9957d8e8c3d",
"size": "7493",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "documentation/javadoc/apidocs/com/googlecode/cqengine/index/sqlite/support/package-summary.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "49662"
},
{
"name": "Java",
"bytes": "1997856"
}
],
"symlink_target": ""
} |
module org.lwjgl.lmdb {
requires transitive org.lwjgl;
exports org.lwjgl.util.lmdb;
} | {
"content_hash": "8e7c4f72fd3f4610de9b659a34837923",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 34,
"avg_line_length": 15.833333333333334,
"alnum_prop": 0.7052631578947368,
"repo_name": "LWJGL/lwjgl3",
"id": "fb6ef021daa5421bf40fbaab29307a6e5672bb4c",
"size": "190",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "modules/lwjgl/lmdb/src/main/resources/module-info.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "14340"
},
{
"name": "C",
"bytes": "12213911"
},
{
"name": "C++",
"bytes": "1982042"
},
{
"name": "GLSL",
"bytes": "1703"
},
{
"name": "Java",
"bytes": "76116697"
},
{
"name": "Kotlin",
"bytes": "19700291"
},
{
"name": "Objective-C",
"bytes": "14684"
},
{
"name": "Objective-C++",
"bytes": "2004"
}
],
"symlink_target": ""
} |
#!/bin/bash -xe
# Release dev packages to PyPI
Usage() {
echo Usage:
echo "$0 [ --production ]"
exit 1
}
if [ "`dirname $0`" != "tools" ] ; then
echo Please run this script from the repo root
exit 1
fi
CheckVersion() {
# Args: <description of version type> <version number>
if ! echo "$2" | grep -q -e '[0-9]\+.[0-9]\+.[0-9]\+' ; then
echo "$1 doesn't look like 1.2.3"
exit 1
fi
}
if [ "$1" = "--production" ] ; then
version="$2"
CheckVersion Version "$version"
echo Releasing production version "$version"...
nextversion="$3"
CheckVersion "Next version" "$nextversion"
RELEASE_BRANCH="candidate-$version"
else
version=`grep "__version__" certbot/__init__.py | cut -d\' -f2 | sed s/\.dev0//`
version="$version.dev$(date +%Y%m%d)1"
RELEASE_BRANCH="dev-release"
echo Releasing developer version "$version"...
fi
if [ "$RELEASE_OPENSSL_PUBKEY" = "" ] ; then
RELEASE_OPENSSL_PUBKEY="`realpath \`dirname $0\``/eff-pubkey.pem"
fi
RELEASE_GPG_KEY=${RELEASE_GPG_KEY:-A2CFB51FA275A7286234E7B24D17C995CD9775F2}
# Needed to fix problems with git signatures and pinentry
export GPG_TTY=$(tty)
# port for a local Python Package Index (used in testing)
PORT=${PORT:-1234}
# subpackages to be released
SUBPKGS=${SUBPKGS:-"acme certbot-apache certbot-nginx letshelp-certbot letsencrypt letsencrypt-apache letsencrypt-nginx letshelp-letsencrypt"}
subpkgs_modules="$(echo $SUBPKGS | sed s/-/_/g)"
# certbot_compatibility_test is not packaged because:
# - it is not meant to be used by anyone else than Certbot devs
# - it causes problems when running nosetests - the latter tries to
# run everything that matches test*, while there are no unittests
# there
tag="v$version"
mv "dist.$version" "dist.$version.$(date +%s).bak" || true
git tag --delete "$tag" || true
tmpvenv=$(mktemp -d)
virtualenv --no-site-packages -p python2 $tmpvenv
. $tmpvenv/bin/activate
# update setuptools/pip just like in other places in the repo
pip install -U setuptools
pip install -U pip # latest pip => no --pre for dev releases
pip install -U wheel # setup.py bdist_wheel
# newer versions of virtualenv inherit setuptools/pip/wheel versions
# from current env when creating a child env
pip install -U virtualenv
root_without_le="$version.$$"
root="./releases/le.$root_without_le"
echo "Cloning into fresh copy at $root" # clean repo = no artificats
git clone . $root
git rev-parse HEAD
cd $root
if [ "$RELEASE_BRANCH" != "candidate-$version" ] ; then
git branch -f "$RELEASE_BRANCH"
fi
git checkout "$RELEASE_BRANCH"
SetVersion() {
ver="$1"
for pkg_dir in $SUBPKGS certbot-compatibility-test
do
sed -i "s/^version.*/version = '$ver'/" $pkg_dir/setup.py
done
sed -i "s/^__version.*/__version__ = '$ver'/" certbot/__init__.py
# interactive user input
git add -p certbot $SUBPKGS certbot-compatibility-test
}
SetVersion "$version"
echo "Preparing sdists and wheels"
for pkg_dir in . $SUBPKGS
do
cd $pkg_dir
python setup.py clean
rm -rf build dist
python setup.py sdist
python setup.py bdist_wheel
echo "Signing ($pkg_dir)"
for x in dist/*.tar.gz dist/*.whl
do
gpg -u "$RELEASE_GPG_KEY" --detach-sign --armor --sign $x
done
cd -
done
mkdir "dist.$version"
mv dist "dist.$version/certbot"
for pkg_dir in $SUBPKGS
do
mv $pkg_dir/dist "dist.$version/$pkg_dir/"
done
echo "Testing packages"
cd "dist.$version"
# start local PyPI
python -m SimpleHTTPServer $PORT &
# cd .. is NOT done on purpose: we make sure that all subpackages are
# installed from local PyPI rather than current directory (repo root)
virtualenv --no-site-packages ../venv
. ../venv/bin/activate
pip install -U setuptools
pip install -U pip
# Now, use our local PyPI. Disable cache so we get the correct KGS even if we
# (or our dependencies) have conditional dependencies implemented with if
# statements in setup.py and we have cached wheels lying around that would
# cause those ifs to not be evaluated.
pip install \
--no-cache-dir \
--extra-index-url http://localhost:$PORT \
certbot $SUBPKGS
# stop local PyPI
kill $!
cd ~-
# freeze before installing anything else, so that we know end-user KGS
# make sure "twine upload" doesn't catch "kgs"
if [ -d ../kgs ] ; then
echo Deleting old kgs...
rm -rf ../kgs
fi
mkdir ../kgs
kgs="../kgs/$version"
pip freeze | tee $kgs
pip install nose
for module in certbot $subpkgs_modules ; do
echo testing $module
nosetests $module
done
deactivate
# pin pip hashes of the things we just built
for pkg in acme certbot certbot-apache letsencrypt letsencrypt-apache ; do
echo $pkg==$version \\
pip hash dist."$version/$pkg"/*.{whl,gz} | grep "^--hash" | python2 -c 'from sys import stdin; input = stdin.read(); print " ", input.replace("\n--hash", " \\\n --hash"),'
done > /tmp/hashes.$$
if ! wc -l /tmp/hashes.$$ | grep -qE "^\s*15 " ; then
echo Unexpected pip hash output
exit 1
fi
# perform hideous surgery on requirements.txt...
head -n -9 letsencrypt-auto-source/pieces/letsencrypt-auto-requirements.txt > /tmp/req.$$
cat /tmp/hashes.$$ >> /tmp/req.$$
cp /tmp/req.$$ letsencrypt-auto-source/pieces/letsencrypt-auto-requirements.txt
# ensure we have the latest built version of leauto
letsencrypt-auto-source/build.py
# and that it's signed correctly
while ! openssl dgst -sha256 -verify $RELEASE_OPENSSL_PUBKEY -signature \
letsencrypt-auto-source/letsencrypt-auto.sig \
letsencrypt-auto-source/letsencrypt-auto ; do
read -p "Please correctly sign letsencrypt-auto with offline-signrequest.sh"
done
# copy leauto to the root, overwriting the previous release version
cp -p letsencrypt-auto-source/letsencrypt-auto certbot-auto
cp -p letsencrypt-auto-source/letsencrypt-auto letsencrypt-auto
git add certbot-auto letsencrypt-auto letsencrypt-auto-source
git diff --cached
git commit --gpg-sign="$RELEASE_GPG_KEY" -m "Release $version"
git tag --local-user "$RELEASE_GPG_KEY" --sign --message "Release $version" "$tag"
cd ..
echo Now in $PWD
name=${root_without_le%.*}
ext="${root_without_le##*.}"
rev="$(git rev-parse --short HEAD)"
echo tar cJvf $name.$rev.tar.xz $name.$rev
echo gpg -U $RELEASE_GPG_KEY --detach-sign --armor $name.$rev.tar.xz
cd ~-
echo "New root: $root"
echo "KGS is at $root/kgs"
echo "Test commands (in the letstest repo):"
echo 'python multitester.py targets.yaml $AWS_KEY $USERNAME scripts/test_leauto_upgrades.sh --alt_pip $YOUR_PIP_REPO --branch public-beta'
echo 'python multitester.py targets.yaml $AWK_KEY $USERNAME scripts/test_letsencrypt_auto_certonly_standalone.sh --branch candidate-0.1.1'
echo 'python multitester.py --saveinstances targets.yaml $AWS_KEY $USERNAME scripts/test_apache2.sh'
echo "In order to upload packages run the following command:"
echo twine upload "$root/dist.$version/*/*"
if [ "$RELEASE_BRANCH" = candidate-"$version" ] ; then
SetVersion "$nextversion".dev0
letsencrypt-auto-source/build.py
git add letsencrypt-auto-source/letsencrypt-auto
git diff
git commit -m "Bump version to $nextversion"
fi
| {
"content_hash": "87a0803822ad7544ba1562c88a43d6d7",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 180,
"avg_line_length": 31.91479820627803,
"alnum_prop": 0.6984684558100324,
"repo_name": "dietsche/letsencrypt",
"id": "e6169c5c8d934ec46fbfc5664ef76fe0178e164c",
"size": "7117",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tools/release.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "48402"
},
{
"name": "Augeas",
"bytes": "5076"
},
{
"name": "Batchfile",
"bytes": "35005"
},
{
"name": "DIGITAL Command Language",
"bytes": "133"
},
{
"name": "Groff",
"bytes": "222"
},
{
"name": "Makefile",
"bytes": "37245"
},
{
"name": "Nginx",
"bytes": "4274"
},
{
"name": "Python",
"bytes": "1386757"
},
{
"name": "Shell",
"bytes": "123310"
}
],
"symlink_target": ""
} |
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><%= appname %></title>
<!-- bower:css -->
<!-- endbower -->
<link href="/styles/ssgCore.css" type="text/css" rel="stylesheet">
<!-- <link href="/styles/prism.css" type="text/css" rel="stylesheet"> -->
<link href="/styles/corev15.css" type="text/css" rel="stylesheet">
<link href="/styles/main.css" type="text/css" rel="stylesheet">
<!-- build:js scripts/vendor/modernizr.js -->
<!-- endbuild -->
<!-- inject:css -->
<!-- endinject -->
</head>
<body class='ssg-body' id="ssg-font">
<div id="ssg-toolbar">
<div id="ssg-toc" class="ssg-toc-list"></div>
<div id="ssg-filter" class="ssg-cmd-section"></div>
<div id="ssg-vp-resizer" class="ssg-cmd-section"></div>
<div id="ssg-add-tools" class="ssg-cmd-section"></div>
<div id="ssg-item-selector" class="ssg-cmd-section"></div>
</div>
<div id="ssg-wrapper">
<div id='ssg-patterns' class="ssg-patterns">
<div id="ssg-patterns-inner" class="ssg-patterns-inner"></div>
</div>
</div>
<!-- bower:js -->
<script src="/bower_components/handlebars/handlebars.js"></script>
<!-- endbower -->
<script src="/scripts/main.js"></script>
<!-- inject:js -->
<!-- <script src="/scripts/prism.js"></script> -->
<script src="/scripts/ssg.templates.js"></script>
<script src="/scripts/ssgCore.templates.js"></script>
<script src="/scripts/ssgCoreLib.js"></script>
<!-- endinject -->
</body>
</html> | {
"content_hash": "51ee7b2c42937fc64e38bbda1a781608",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 77,
"avg_line_length": 37.28888888888889,
"alnum_prop": 0.5810488676996425,
"repo_name": "StfBauer/generator-simplestyle",
"id": "b61ef6e66ad338cf6d6159cd072cdca9dbd5117c",
"size": "1678",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "generators/app/legacy.templates/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1550242"
},
{
"name": "HTML",
"bytes": "7043"
},
{
"name": "JavaScript",
"bytes": "110628"
}
],
"symlink_target": ""
} |
package cairo
//#cgo pkg-config: cairo
//#include <cairo/cairo.h>
import "C"
import (
"errors"
)
const (
errSuccess = C.CAIRO_STATUS_SUCCESS
errNoMem = C.CAIRO_STATUS_NO_MEMORY
errInvalidRestore = C.CAIRO_STATUS_INVALID_RESTORE
errInvalidPopGroup = C.CAIRO_STATUS_INVALID_POP_GROUP
errNoCurrentPoint = C.CAIRO_STATUS_NO_CURRENT_POINT
errInvalidMatrix = C.CAIRO_STATUS_INVALID_MATRIX
errInvalidStatus = C.CAIRO_STATUS_INVALID_STATUS //seriously?
errNullPointer = C.CAIRO_STATUS_NULL_POINTER
errInvalidString = C.CAIRO_STATUS_INVALID_STRING
errInvalidPathData = C.CAIRO_STATUS_INVALID_PATH_DATA
errReadError = C.CAIRO_STATUS_READ_ERROR
errWriteError = C.CAIRO_STATUS_WRITE_ERROR
errSurfaceFinished = C.CAIRO_STATUS_SURFACE_FINISHED
errSurfaceTypeMismatch = C.CAIRO_STATUS_SURFACE_TYPE_MISMATCH
errPatternTypeMismatch = C.CAIRO_STATUS_PATTERN_TYPE_MISMATCH
errInvalidContent = C.CAIRO_STATUS_INVALID_CONTENT
errInvalidFormat = C.CAIRO_STATUS_INVALID_FORMAT
errInvalidVisual = C.CAIRO_STATUS_INVALID_VISUAL
errFileNotFound = C.CAIRO_STATUS_FILE_NOT_FOUND
errInvalidDash = C.CAIRO_STATUS_INVALID_DASH
errInvalidDSCComment = C.CAIRO_STATUS_INVALID_DSC_COMMENT
errInvalidIndex = C.CAIRO_STATUS_INVALID_INDEX
errClipNotRepresentable = C.CAIRO_STATUS_CLIP_NOT_REPRESENTABLE
errTempFileError = C.CAIRO_STATUS_TEMP_FILE_ERROR
errInvalidStride = C.CAIRO_STATUS_INVALID_STRIDE
errFontTypeMismatch = C.CAIRO_STATUS_FONT_TYPE_MISMATCH
errUserFontImmutable = C.CAIRO_STATUS_USER_FONT_IMMUTABLE
errUserFontError = C.CAIRO_STATUS_USER_FONT_ERROR
errNegativeCount = C.CAIRO_STATUS_NEGATIVE_COUNT
errInvalidClusters = C.CAIRO_STATUS_INVALID_CLUSTERS
errInvalidSlant = C.CAIRO_STATUS_INVALID_SLANT
errInvalidWeight = C.CAIRO_STATUS_INVALID_WEIGHT
errInvalidSize = C.CAIRO_STATUS_INVALID_SIZE
errUserFontNotImplemented = C.CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED
errDeviceTypeMismatch = C.CAIRO_STATUS_DEVICE_TYPE_MISMATCH
errDeviceError = C.CAIRO_STATUS_DEVICE_ERROR
errInvalidMeshConstruction = C.CAIRO_STATUS_INVALID_MESH_CONSTRUCTION
errDeviceFinished = C.CAIRO_STATUS_DEVICE_FINISHED
errLastStatus = C.CAIRO_STATUS_LAST_STATUS
)
var (
//ErrInvalidLibcairoHandle is returned if a Go handle to a libcairo resource
//has no pointer to any libcairo resource.
ErrInvalidLibcairoHandle = errors.New("invalid handle to libcairo resource")
//ErrInvalidPathData is returned if a Path contains undefined data.
ErrInvalidPathData = mkerr(errInvalidPathData)
//ErrInvalidDash is returned by Context.SetDash if the dash format
//is ill-specified.
ErrInvalidDash = mkerr(errInvalidDash)
)
func st2str(st C.cairo_status_t) string {
return C.GoString(C.cairo_status_to_string(st))
}
func mkerr(st C.cairo_status_t) error {
return errors.New(st2str(st))
}
func toerr(st C.cairo_status_t) error {
return toerrIded(st, nil)
}
func toerrIded(st C.cairo_status_t, ider interface {
id() id
}) error {
switch int(st) {
case errSuccess:
return nil
case errInvalidRestore, errInvalidPopGroup, errNoCurrentPoint, errInvalidMatrix, errInvalidString, errSurfaceFinished:
panic(st2str(st))
case errInvalidPathData:
return ErrInvalidPathData
case errInvalidDash:
return ErrInvalidDash
case errWriteError:
mux.Lock()
defer mux.Unlock()
if w, ok := wmap[ider.id()]; ok {
return w.err
}
}
return errors.New(st2str(st))
}
| {
"content_hash": "69c3609e6880fd403f844dcde9e230a0",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 119,
"avg_line_length": 38.708333333333336,
"alnum_prop": 0.7134015069967707,
"repo_name": "jimmyfrasche/cairo",
"id": "9586d87b2b3d6866f4fc219e2a6b6d486b3a28c0",
"size": "3716",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "error.go",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Go",
"bytes": "227113"
}
],
"symlink_target": ""
} |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const path = require("path");
const NativeModule = require("module");
const crypto = require("crypto");
const SourceMapSource = require("webpack-sources").SourceMapSource;
const OriginalSource = require("webpack-sources").OriginalSource;
const RawSource = require("webpack-sources").RawSource;
const ReplaceSource = require("webpack-sources").ReplaceSource;
const CachedSource = require("webpack-sources").CachedSource;
const LineToLineMappedSource = require("webpack-sources").LineToLineMappedSource;
const WebpackError = require("./WebpackError");
const Module = require("./Module");
const ModuleParseError = require("./ModuleParseError");
const ModuleBuildError = require("./ModuleBuildError");
const ModuleError = require("./ModuleError");
const ModuleWarning = require("./ModuleWarning");
const runLoaders = require("loader-runner").runLoaders;
const getContext = require("loader-runner").getContext;
function asString(buf) {
if(Buffer.isBuffer(buf)) {
return buf.toString("utf-8");
}
return buf;
}
function contextify(context, request) {
return request.split("!").map(function(r) {
let rp = path.relative(context, r);
if(path.sep === "\\")
rp = rp.replace(/\\/g, "/");
if(rp.indexOf("../") !== 0)
rp = "./" + rp;
return rp;
}).join("!");
}
class NonErrorEmittedError extends WebpackError {
constructor(error) {
super();
this.name = "NonErrorEmittedError";
this.message = "(Emitted value instead of an instance of Error) " + error;
Error.captureStackTrace(this, this.constructor);
}
}
class NormalModule extends Module {
constructor(request, userRequest, rawRequest, loaders, resource, parser) {
super();
this.request = request;
this.userRequest = userRequest;
this.rawRequest = rawRequest;
this.parser = parser;
this.resource = resource;
this.context = getContext(resource);
this.loaders = loaders;
this.fileDependencies = [];
this.contextDependencies = [];
this.warnings = [];
this.errors = [];
this.error = null;
this._source = null;
this.assets = {};
this.built = false;
this._cachedSource = null;
this._dependencyTemplatesHashMap = new Map();
}
identifier() {
return this.request;
}
readableIdentifier(requestShortener) {
return requestShortener.shorten(this.userRequest);
}
libIdent(options) {
return contextify(options.context, this.userRequest);
}
nameForCondition() {
const idx = this.resource.indexOf("?");
if(idx >= 0) return this.resource.substr(0, idx);
return this.resource;
}
createSourceForAsset(name, content, sourceMap) {
if(!sourceMap) {
return new RawSource(content);
}
if(typeof sourceMap === "string") {
return new OriginalSource(content, sourceMap);
}
return new SourceMapSource(content, name, sourceMap);
}
createLoaderContext(resolver, options, compilation, fs) {
const loaderContext = {
version: 2,
emitWarning: (warning) => {
if(!(warning instanceof Error))
warning = new NonErrorEmittedError(warning);
this.warnings.push(new ModuleWarning(this, warning));
},
emitError: (error) => {
if(!(error instanceof Error))
error = new NonErrorEmittedError(error);
this.errors.push(new ModuleError(this, error));
},
exec: (code, filename) => {
const module = new NativeModule(filename, this);
module.paths = NativeModule._nodeModulePaths(this.context);
module.filename = filename;
module._compile(code, filename);
return module.exports;
},
resolve(context, request, callback) {
resolver.resolve({}, context, request, callback);
},
resolveSync(context, request) {
return resolver.resolveSync({}, context, request);
},
emitFile: (name, content, sourceMap) => {
this.assets[name] = this.createSourceForAsset(name, content, sourceMap);
},
options: options,
webpack: true,
sourceMap: !!this.useSourceMap,
_module: this,
_compilation: compilation,
_compiler: compilation.compiler,
fs: fs,
};
compilation.applyPlugins("normal-module-loader", loaderContext, this);
if(options.loader)
Object.assign(loaderContext, options.loader);
return loaderContext;
}
createSource(source, resourceBuffer, sourceMap) {
// if there is no identifier return raw source
if(!this.identifier) {
return new RawSource(source);
}
// from here on we assume we have an identifier
const identifier = this.identifier();
if(this.lineToLine && resourceBuffer) {
return new LineToLineMappedSource(
source, identifier, asString(resourceBuffer));
}
if(this.useSourceMap && sourceMap) {
return new SourceMapSource(source, identifier, sourceMap);
}
return new OriginalSource(source, identifier);
}
doBuild(options, compilation, resolver, fs, callback) {
this.cacheable = false;
const loaderContext = this.createLoaderContext(resolver, options, compilation, fs);
runLoaders({
resource: this.resource,
loaders: this.loaders,
context: loaderContext,
readResource: fs.readFile.bind(fs)
}, (err, result) => {
if(result) {
this.cacheable = result.cacheable;
this.fileDependencies = result.fileDependencies;
this.contextDependencies = result.contextDependencies;
}
if(err) {
const error = new ModuleBuildError(this, err);
return callback(error);
}
const resourceBuffer = result.resourceBuffer;
const source = result.result[0];
const sourceMap = result.result[1];
if(!Buffer.isBuffer(source) && typeof source !== "string") {
const error = new ModuleBuildError(this, new Error("Final loader didn't return a Buffer or String"));
return callback(error);
}
this._source = this.createSource(asString(source), resourceBuffer, sourceMap);
return callback();
});
}
disconnect() {
this.built = false;
super.disconnect();
}
markModuleAsErrored(error) {
this.meta = null;
this.error = error;
this.errors.push(this.error);
this._source = new RawSource("throw new Error(" + JSON.stringify(this.error.message) + ");");
}
applyNoParseRule(rule, content) {
// must start with "rule" if rule is a string
if(typeof rule === "string") {
return content.indexOf(rule) === 0;
}
if(typeof rule === "function") {
return rule(content);
}
// we assume rule is a regexp
return rule.test(content);
}
// check if module should not be parsed
// returns "true" if the module should !not! be parsed
// returns "false" if the module !must! be parsed
shouldPreventParsing(noParseRule, request) {
// if no noParseRule exists, return false
// the module !must! be parsed.
if(!noParseRule) {
return false;
}
// we only have one rule to check
if(!Array.isArray(noParseRule)) {
// returns "true" if the module is !not! to be parsed
return this.applyNoParseRule(noParseRule, request);
}
for(let i = 0; i < noParseRule.length; i++) {
const rule = noParseRule[i];
// early exit on first truthy match
// this module is !not! to be parsed
if(this.applyNoParseRule(rule, request)) {
return true;
}
}
// no match found, so this module !should! be parsed
return false;
}
build(options, compilation, resolver, fs, callback) {
this.buildTimestamp = Date.now();
this.built = true;
this._source = null;
this.error = null;
this.errors.length = 0;
this.warnings.length = 0;
this.meta = {};
return this.doBuild(options, compilation, resolver, fs, (err) => {
this.dependencies.length = 0;
this.variables.length = 0;
this.blocks.length = 0;
this._cachedSource = null;
// if we have an error mark module as failed and exit
if(err) {
this.markModuleAsErrored(err);
return callback();
}
// check if this module should !not! be parsed.
// if so, exit here;
const noParseRule = options.module && options.module.noParse;
if(this.shouldPreventParsing(noParseRule, this.request)) {
return callback();
}
try {
this.parser.parse(this._source.source(), {
current: this,
module: this,
compilation: compilation,
options: options
});
} catch(e) {
const source = this._source.source();
const error = new ModuleParseError(this, source, e);
this.markModuleAsErrored(error);
return callback();
}
return callback();
});
}
getHashDigest(dependencyTemplates) {
let dtId = this._dependencyTemplatesHashMap.get(dependencyTemplates);
if(dtId === undefined)
this._dependencyTemplatesHashMap.set(dependencyTemplates, dtId = this._dependencyTemplatesHashMap.size + 1);
const hash = crypto.createHash("md5");
this.updateHash(hash);
hash.update(`${dtId}`);
return hash.digest("hex");
}
sourceDependency(dependency, dependencyTemplates, source, outputOptions, requestShortener) {
const template = dependencyTemplates.get(dependency.constructor);
if(!template) throw new Error("No template for dependency: " + dependency.constructor.name);
template.apply(dependency, source, outputOptions, requestShortener, dependencyTemplates);
}
sourceVariables(variable, availableVars, dependencyTemplates, outputOptions, requestShortener) {
const name = variable.name;
const expr = variable.expressionSource(dependencyTemplates, outputOptions, requestShortener);
if(availableVars.some(v => v.name === name && v.expression.source() === expr.source())) {
return;
}
return {
name: name,
expression: expr
};
}
/*
* creates the start part of a IIFE around the module to inject a variable name
* (function(...){ <- this part
* }.call(...))
*/
variableInjectionFunctionWrapperStartCode(varNames) {
const args = varNames.join(", ");
return `/* WEBPACK VAR INJECTION */(function(${args}) {`;
}
contextArgument(block) {
if(this === block) {
return this.exportsArgument || "exports";
}
return "this";
}
/*
* creates the end part of a IIFE around the module to inject a variable name
* (function(...){
* }.call(...)) <- this part
*/
variableInjectionFunctionWrapperEndCode(varExpressions, block) {
const firstParam = this.contextArgument(block);
const furtherParams = varExpressions.map(e => e.source()).join(", ");
return `}.call(${firstParam}, ${furtherParams}))`;
}
splitVariablesInUniqueNamedChunks(vars) {
const startState = [
[]
];
return vars.reduce((chunks, variable) => {
const current = chunks[chunks.length - 1];
// check if variable with same name exists already
// if so create a new chunk of variables.
const variableNameAlreadyExists = current.some(v => v.name === variable.name);
if(variableNameAlreadyExists) {
// start new chunk with current variable
chunks.push([variable]);
} else {
// else add it to current chunk
current.push(variable);
}
return chunks;
}, startState);
}
sourceBlock(block, availableVars, dependencyTemplates, source, outputOptions, requestShortener) {
block.dependencies.forEach((dependency) => this.sourceDependency(
dependency, dependencyTemplates, source, outputOptions, requestShortener));
/**
* Get the variables of all blocks that we need to inject.
* These will contain the variable name and its expression.
* The name will be added as a paramter in a IIFE the expression as its value.
*/
const vars = block.variables.map((variable) => this.sourceVariables(
variable, availableVars, dependencyTemplates, outputOptions, requestShortener))
.filter(Boolean);
/**
* if we actually have variables
* this is important as how #splitVariablesInUniqueNamedChunks works
* it will always return an array in an array which would lead to a IIFE wrapper around
* a module if we do this with an empty vars array.
*/
if(vars.length > 0) {
/**
* Split all variables up into chunks of unique names.
* e.g. imagine you have the following variable names that need to be injected:
* [foo, bar, baz, foo, some, more]
* we can not inject "foo" twice, therefore we just make two IIFEs like so:
* (function(foo, bar, baz){
* (function(foo, some, more){
* ...
* }(...));
* }(...));
*
* "splitVariablesInUniqueNamedChunks" splits the variables shown above up to this:
* [[foo, bar, baz], [foo, some, more]]
*/
const injectionVariableChunks = this.splitVariablesInUniqueNamedChunks(vars);
// create all the beginnings of IIFEs
const functionWrapperStarts = injectionVariableChunks.map((variableChunk) => variableChunk.map(variable => variable.name))
.map(names => this.variableInjectionFunctionWrapperStartCode(names));
// and all the ends
const functionWrapperEnds = injectionVariableChunks.map((variableChunk) => variableChunk.map(variable => variable.expression))
.map(expressions => this.variableInjectionFunctionWrapperEndCode(expressions, block));
// join them to one big string
const varStartCode = functionWrapperStarts.join("");
// reverse the ends first before joining them, as the last added must be the inner most
const varEndCode = functionWrapperEnds.reverse().join("");
// if we have anything, add it to the source
if(varStartCode && varEndCode) {
const start = block.range ? block.range[0] : -10;
const end = block.range ? block.range[1] : (this._source.size() + 1);
source.insert(start + 0.5, varStartCode);
source.insert(end + 0.5, "\n/* WEBPACK VAR INJECTION */" + varEndCode);
}
}
block.blocks.forEach((block) => this.sourceBlock(
block, availableVars.concat(vars), dependencyTemplates, source, outputOptions, requestShortener));
}
source(dependencyTemplates, outputOptions, requestShortener) {
const hashDigest = this.getHashDigest(dependencyTemplates);
if(this._cachedSource && this._cachedSource.hash === hashDigest) {
return this._cachedSource.source;
}
if(!this._source) {
return new RawSource("throw new Error('No source available');");
}
const source = new ReplaceSource(this._source);
this._cachedSource = {
source: source,
hash: hashDigest
};
this.sourceBlock(this, [], dependencyTemplates, source, outputOptions, requestShortener);
return new CachedSource(source);
}
originalSource() {
return this._source;
}
getHighestTimestamp(keys, timestampsByKey) {
let highestTimestamp = 0;
for(let i = 0; i < keys.length; i++) {
const key = keys[i];
const timestamp = timestampsByKey[key];
// if there is no timestamp yet, early return with Infinity
if(!timestamp) return Infinity;
highestTimestamp = Math.max(highestTimestamp, timestamp);
}
return highestTimestamp;
}
needRebuild(fileTimestamps, contextTimestamps) {
const highestFileDepTimestamp = this.getHighestTimestamp(
this.fileDependencies, fileTimestamps);
// if the hightest is Infinity, we need a rebuild
// exit early here.
if(highestFileDepTimestamp === Infinity) {
return true;
}
const highestContextDepTimestamp = this.getHighestTimestamp(
this.contextDependencies, contextTimestamps);
// Again if the hightest is Infinity, we need a rebuild
// exit early here.
if(highestContextDepTimestamp === Infinity) {
return true;
}
// else take the highest of file and context timestamps and compare
// to last build timestamp
return Math.max(highestContextDepTimestamp, highestFileDepTimestamp) >= this.buildTimestamp;
}
size() {
return this._source ? this._source.size() : -1;
}
updateHashWithSource(hash) {
if(!this._source) {
hash.update("null");
return;
}
hash.update("source");
this._source.updateHash(hash);
}
updateHashWithMeta(hash) {
hash.update("meta");
hash.update(JSON.stringify(this.meta));
}
updateHash(hash) {
this.updateHashWithSource(hash);
this.updateHashWithMeta(hash);
super.updateHash(hash);
}
}
module.exports = NormalModule;
| {
"content_hash": "21b718dfa1b8e6ba4cc2d235fefd8de0",
"timestamp": "",
"source": "github",
"line_count": 533,
"max_line_length": 129,
"avg_line_length": 30.70919324577861,
"alnum_prop": 0.6728372434017595,
"repo_name": "Kirikou974/cobrab2c",
"id": "15c9f010cbb6f6ec6cb69364359f5753b3971829",
"size": "16368",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "node_modules/webpack/lib/NormalModule.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "85265"
},
{
"name": "HTML",
"bytes": "192"
},
{
"name": "JavaScript",
"bytes": "38848"
}
],
"symlink_target": ""
} |
package textutil
| {
"content_hash": "7c2adce78e34aac9e3f97d73dfdeee83",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 16,
"avg_line_length": 17,
"alnum_prop": 0.8823529411764706,
"repo_name": "HotelsDotCom/kube-aws",
"id": "f4a041a7317d666541e8627c9cbcf1d91fa3b1ed",
"size": "365",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "vendor/github.com/rogpeppe/go-internal/internal/textutil/doc.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "839"
},
{
"name": "Go",
"bytes": "779477"
},
{
"name": "Makefile",
"bytes": "4491"
},
{
"name": "Shell",
"bytes": "87421"
}
],
"symlink_target": ""
} |
package org.bremersee.comparator.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.StringTokenizer;
import java.util.stream.Collectors;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import lombok.EqualsAndHashCode;
/**
* The list of sort orders.
*
* @author Christian Bremer
*/
@SuppressWarnings("SameNameButDifferent")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "sortOrders")
@XmlType(name = "sortOrdersType")
@JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "A list of sort orders.")
@EqualsAndHashCode
@Valid
public class SortOrders {
@Schema(description = "The list of sort orders.")
@XmlElementRef
private final List<SortOrder> sortOrders = new ArrayList<>();
/**
* Instantiates an empty list of sort orders.
*/
protected SortOrders() {
}
/**
* Instantiates a new unmodifiable list of sort orders.
*
* @param sortOrders the sort orders
*/
@JsonCreator
public SortOrders(@JsonProperty("sortOrders") Collection<? extends SortOrder> sortOrders) {
if (sortOrders != null) {
this.sortOrders.addAll(sortOrders);
}
}
/**
* Gets the unmodifiable list of sort orders.
*
* @return the list of sort orders
*/
public List<SortOrder> getSortOrders() {
return Collections.unmodifiableList(sortOrders);
}
/**
* Checks whether the list of sort orders is empty or not.
*
* @return {@code true} if the list of sort orders is empty, otherwise {@code false}
*/
@XmlTransient
@JsonIgnore
public boolean isEmpty() {
return sortOrders.isEmpty();
}
/**
* Checks whether this sort orders contains any entries. If there are entries, this is sorted,
* otherwise it is unsorted.
*
* @return {@code true} if the list of sort orders is not empty (aka sorted), otherwise {@code
* false}
*/
@XmlTransient
@JsonIgnore
public boolean isSorted() {
return !isEmpty();
}
/**
* Checks whether this sort orders contains any entries. If there are no entries, this is
* unsorted, otherwise it is sorted.
*
* @return {@code true} if the list of sort orders is empty (aka unsorted), otherwise {@code
* false}
*/
@XmlTransient
@JsonIgnore
public boolean isUnsorted() {
return !isSorted();
}
/**
* Creates the sort orders text of this ordering descriptions.
*
* <p>The syntax of the ordering description is
* <pre>
* fieldNameOrPath0,asc,ignoreCase,nullIsFirst;fieldNameOrPath1,asc,ignoreCase,nullIsFirst
* </pre>
*
* <p>For example
* <pre>
* room.number,asc,true,false;person.lastName,asc,true,false;person.firstName,asc,true,false
* </pre>
*
* @return the sort orders text
*/
@NotEmpty
public String toSortOrdersText() {
return toSortOrdersText(null);
}
/**
* Creates the sort orders text of this ordering descriptions.
*
* <p>The syntax of the ordering description is
* <pre>
* fieldNameOrPath0,asc,ignoreCase,nullIsFirst;fieldNameOrPath1,asc,ignoreCase,nullIsFirst
* </pre>
*
* <p>The separators (',') and (';') and the values of {@code direction}, {@code case-handling}
* and {@code null-handling} depend on the given {@link SortOrdersTextProperties}.
*
* <p>For example with default properties:
* <pre>
* room.number,asc,true,false;person.lastName,asc,true,false;person.firstName,asc,true,false
* </pre>
*
* @param properties the properties
* @return the sort orders text
*/
@NotEmpty
public String toSortOrdersText(SortOrdersTextProperties properties) {
SortOrdersTextProperties props = Objects.requireNonNullElse(properties,
SortOrdersTextProperties.defaults());
return sortOrders.stream()
.map(sortOrder -> sortOrder.toSortOrderText(props))
.collect(Collectors.joining(props.getSortOrderSeparator()));
}
@Override
public String toString() {
return toSortOrdersText();
}
/**
* From sort orders text.
*
* @param source the sort orders text
* @return the sort orders
*/
public static SortOrders fromSortOrdersText(String source) {
return fromSortOrdersText(source, SortOrdersTextProperties.defaults());
}
/**
* From sort orders text.
*
* @param source the sort orders text
* @param properties the properties
* @return the sort orders
*/
public static SortOrders fromSortOrdersText(String source, SortOrdersTextProperties properties) {
return Optional.ofNullable(source)
.map(text -> {
SortOrdersTextProperties props = Objects
.requireNonNullElse(properties, SortOrdersTextProperties.defaults());
List<SortOrder> sortOrders = new ArrayList<>();
StringTokenizer tokenizer = new StringTokenizer(text, props.getSortOrderSeparator());
while (tokenizer.hasMoreTokens()) {
sortOrders.add(SortOrder.fromSortOrderText(tokenizer.nextToken(), props));
}
return new SortOrders(sortOrders);
})
.orElseGet(SortOrders::new);
}
/**
* Creates new sort orders with the given orders.
*
* @param sortOrders the sort orders
* @return the sort orders
*/
public static SortOrders by(SortOrder... sortOrders) {
return Optional.ofNullable(sortOrders)
.map(so -> new SortOrders(Arrays.asList(so)))
.orElseGet(SortOrders::new);
}
}
| {
"content_hash": "48b0a7eb41c46527d5cd5b463394ab02",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 99,
"avg_line_length": 29.239234449760765,
"alnum_prop": 0.7023400425462281,
"repo_name": "bremersee/comparator",
"id": "2dfb4c00948452ed62aa950c1e562ebb9458879f",
"size": "6731",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/bremersee/comparator/model/SortOrders.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "165824"
}
],
"symlink_target": ""
} |
#ifndef TENSORFLOW_TSL_PROFILER_LIB_PROFILER_FACTORY_H_
#define TENSORFLOW_TSL_PROFILER_LIB_PROFILER_FACTORY_H_
#include <functional>
#include <memory>
#include <vector>
#include "tensorflow/tsl/profiler/lib/profiler_interface.h"
#include "tensorflow/tsl/profiler/protobuf/profiler_options.pb.h"
namespace tsl {
namespace profiler {
// A ProfilerFactory returns an instance of ProfilerInterface if ProfileOptions
// require it. Otherwise, it might return nullptr.
using ProfilerFactory = std::function<std::unique_ptr<ProfilerInterface>(
const tensorflow::ProfileOptions&)>;
// Registers a profiler factory. Should be invoked at most once per factory.
void RegisterProfilerFactory(ProfilerFactory factory);
// Invokes all registered profiler factories with the given options, and
// returns the instantiated (non-null) profiler interfaces.
std::vector<std::unique_ptr<ProfilerInterface>> CreateProfilers(
const tensorflow::ProfileOptions& options);
// For testing only.
void ClearRegisteredProfilersForTest();
} // namespace profiler
} // namespace tsl
#endif // TENSORFLOW_TSL_PROFILER_LIB_PROFILER_FACTORY_H_
| {
"content_hash": "92ffebdd82b9adb4f3cfd36a63361ab8",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 79,
"avg_line_length": 33.294117647058826,
"alnum_prop": 0.7853356890459364,
"repo_name": "tensorflow/tensorflow",
"id": "1ecfb4344c5e2df3d8d16ae66c7a8b2f74de76c2",
"size": "1799",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "tensorflow/tsl/profiler/lib/profiler_factory.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "36962"
},
{
"name": "C",
"bytes": "1400913"
},
{
"name": "C#",
"bytes": "13584"
},
{
"name": "C++",
"bytes": "126099822"
},
{
"name": "CMake",
"bytes": "182430"
},
{
"name": "Cython",
"bytes": "5003"
},
{
"name": "Dockerfile",
"bytes": "416133"
},
{
"name": "Go",
"bytes": "2129888"
},
{
"name": "HTML",
"bytes": "4686483"
},
{
"name": "Java",
"bytes": "1074438"
},
{
"name": "Jupyter Notebook",
"bytes": "792906"
},
{
"name": "LLVM",
"bytes": "6536"
},
{
"name": "MLIR",
"bytes": "11447433"
},
{
"name": "Makefile",
"bytes": "2760"
},
{
"name": "Objective-C",
"bytes": "172666"
},
{
"name": "Objective-C++",
"bytes": "300213"
},
{
"name": "Pawn",
"bytes": "5552"
},
{
"name": "Perl",
"bytes": "7536"
},
{
"name": "Python",
"bytes": "42782002"
},
{
"name": "Roff",
"bytes": "5034"
},
{
"name": "Ruby",
"bytes": "9199"
},
{
"name": "Shell",
"bytes": "621854"
},
{
"name": "Smarty",
"bytes": "89538"
},
{
"name": "SourcePawn",
"bytes": "14625"
},
{
"name": "Starlark",
"bytes": "7738020"
},
{
"name": "Swift",
"bytes": "78435"
},
{
"name": "Vim Snippet",
"bytes": "58"
}
],
"symlink_target": ""
} |
import collections
import heapq
class Solution:
def maxProbability(self, n: int, edges: List[List[int]], succProb: List[float], start: int, end: int) -> float:
graph = collections.defaultdict(list)
for i, (a, b) in enumerate(edges):
graph[a].append((b, i))
graph[b].append((a, i))
prob = [0] * n
prob[start] = 1
pq = [(-1, start)]
while pq:
p, index = heapq.heappop(pq)
if index == end:
return -p
for node, i in graph[index]:
if -p * succProb[i] > prob[node]:
prob[node] = -p * succProb[i]
heapq.heappush(pq, (-prob[node], node))
return 0
| {
"content_hash": "16da4bbcf9423f8393848b2d301d6bfe",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 115,
"avg_line_length": 36.55,
"alnum_prop": 0.4911080711354309,
"repo_name": "jiadaizhao/LeetCode",
"id": "963f02bb1903c3900727752b049ce824ce287eb2",
"size": "731",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "1501-1600/1514-Path with Maximum Probability/1514-Path with Maximum Probability.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "1140864"
},
{
"name": "Java",
"bytes": "34062"
},
{
"name": "Python",
"bytes": "758800"
},
{
"name": "Shell",
"bytes": "698"
},
{
"name": "TSQL",
"bytes": "774"
}
],
"symlink_target": ""
} |
#ifndef __PTVCURSOR_H__
#define __PTVCURSOR_H__
#include <glib.h>
#include <epan/packet.h>
#include "ws_symbol_export.h"
#define SUBTREE_UNDEFINED_LENGTH -1
typedef struct ptvcursor ptvcursor_t;
/* Allocates an initializes a ptvcursor_t with 3 variables:
* proto_tree, tvbuff, and offset. */
WS_DLL_PUBLIC
ptvcursor_t*
ptvcursor_new(proto_tree* tree, tvbuff_t* tvb, gint offset);
/* Gets data from tvbuff, adds it to proto_tree, increments offset,
* and returns proto_item* */
WS_DLL_PUBLIC
proto_item*
ptvcursor_add(ptvcursor_t* ptvc, int hf, gint length, const guint encoding);
/* Gets data from tvbuff, adds it to proto_tree, *DOES NOT* increment
* offset, and returns proto_item* */
WS_DLL_PUBLIC
proto_item*
ptvcursor_add_no_advance(ptvcursor_t* ptvc, int hf, gint length, const guint encoding);
/* Advance the ptvcursor's offset within its tvbuff without
* adding anything to the proto_tree. */
WS_DLL_PUBLIC
void
ptvcursor_advance(ptvcursor_t* ptvc, gint length);
/* Frees memory for ptvcursor_t, but nothing deeper than that. */
WS_DLL_PUBLIC
void
ptvcursor_free(ptvcursor_t* ptvc);
/* Returns tvbuff. */
WS_DLL_PUBLIC
tvbuff_t*
ptvcursor_tvbuff(ptvcursor_t* ptvc);
/* Returns current offset. */
WS_DLL_PUBLIC
gint
ptvcursor_current_offset(ptvcursor_t* ptvc);
/* Returns the proto_tree* */
WS_DLL_PUBLIC
proto_tree*
ptvcursor_tree(ptvcursor_t* ptvc);
/* Sets a new proto_tree* for the ptvcursor_t */
WS_DLL_PUBLIC
void
ptvcursor_set_tree(ptvcursor_t* ptvc, proto_tree* tree);
/* push a subtree in the tree stack of the cursor */
WS_DLL_PUBLIC
proto_tree*
ptvcursor_push_subtree(ptvcursor_t* ptvc, proto_item* it, gint ett_subtree);
/* pop a subtree in the tree stack of the cursor */
WS_DLL_PUBLIC
void
ptvcursor_pop_subtree(ptvcursor_t* ptvc);
/* Add an item to the tree and create a subtree
* If the length is unknown, length may be defined as SUBTREE_UNDEFINED_LENGTH.
* In this case, when the subtree will be closed, the parent item length will
* be equal to the advancement of the cursor since the creation of the subtree.
*/
WS_DLL_PUBLIC
proto_tree*
ptvcursor_add_with_subtree(ptvcursor_t* ptvc, int hfindex, gint length,
const guint encoding, gint ett_subtree);
/* Add a text node to the tree and create a subtree
* If the length is unknown, length may be defined as SUBTREE_UNDEFINED_LENGTH.
* In this case, when the subtree will be closed, the item length will be equal
* to the advancement of the cursor since the creation of the subtree.
*/
WS_DLL_PUBLIC
proto_tree*
ptvcursor_add_text_with_subtree(ptvcursor_t* ptvc, gint length,
gint ett_subtree, const char* format, ...)
G_GNUC_PRINTF(4, 5);
/* Creates a subtree and adds it to the cursor as the working tree but does not
* save the old working tree */
WS_DLL_PUBLIC
proto_tree*
ptvcursor_set_subtree(ptvcursor_t* ptvc, proto_item* it, gint ett_subtree);
#endif /* __PTVCURSOR_H__ */
| {
"content_hash": "5a7287d513d05ee70e2ed6ed2caaf27a",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 87,
"avg_line_length": 28.742574257425744,
"alnum_prop": 0.7351016190148123,
"repo_name": "sunwxg/golibwireshark",
"id": "ad85c312a3509c8f7bead2b0636097e418bdb439",
"size": "3830",
"binary": false,
"copies": "42",
"ref": "refs/heads/master",
"path": "include/wireshark/epan/epan/ptvcursor.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "167788579"
}
],
"symlink_target": ""
} |
console.log('IT WORKS!');
| {
"content_hash": "41ef12e1b90af7693ee3bf9301b71573",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 25,
"avg_line_length": 26,
"alnum_prop": 0.6538461538461539,
"repo_name": "julianduque/citgm",
"id": "b96720aa2207eb7d8aaecaba16d6c4730861aedd",
"size": "26",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/test-dir/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "32569"
}
],
"symlink_target": ""
} |
package io.stalk.sample.server;
import io.stalk.amqp.rpc.RPCServer;
import io.stalk.sample.SampleParam;
import io.stalk.sample.SampleResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
public class SampleServer extends RPCServer<SampleParam, SampleResult> {
private static Logger logger = LoggerFactory.getLogger(SampleServer.class);
private static String QUEUE_NAME = "queue.sample";
public static void main(String[] args) {
SampleServer process = new SampleServer();
process.execute(QUEUE_NAME);
}
@Override
public SampleResult message(SampleParam input) {
MDC.put(LOG_FILE_NAME, "sample"); // log file name.
/** [START] Handling request parameters **/
logger.debug(input.toString());
/** [END] Handling request parameters **/
/** [START] Execute process **/
// Do Something.
/** [END] Execute process **/
/** [START] Create Response Object **/
SampleResult result = new SampleResult();
result.setMode("OK");
result.setErrorMessage("");
/** [END] Create Response Object **/
MDC.remove(LOG_FILE_NAME);
return result;
}
}
| {
"content_hash": "e8bfeada90e74a4c07f70414f21303a9",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 79,
"avg_line_length": 25.102040816326532,
"alnum_prop": 0.6447154471544716,
"repo_name": "JohnKim/template-amqp",
"id": "db9a79ef2b4d4dc81f609674d778d3ad8b5b4caa",
"size": "1230",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/io/stalk/sample/server/SampleServer.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "12326"
}
],
"symlink_target": ""
} |
/**
* Arrows module.
*
* @param {Object} Glide
* @param {Object} Core
* @return {Arrows}
*/
var Arrows = function(Glide, Core) {
/**
* Arrows constructor.
*/
function Arrows() {
this.build();
this.bind();
}
/**
* Build arrows. Gets DOM elements.
*
* @return {Void}
*/
Arrows.prototype.build = function() {
this.wrapper = Glide.slider.find('.' + Glide.options.classes.arrows);
this.items = this.wrapper.children();
};
/**
* Disable next/previous arrow and enable another.
*
* @param {String} type
* @return {Void}
*/
Arrows.prototype.disable = function(type) {
var classes = Glide.options.classes;
if (!type) {
return this.disableBoth();
}
this.items.filter('.' + classes['arrow' + Core.Helper.capitalise(type)])
.unbind('click.glide touchstart.glide')
.addClass(classes.disabled)
.siblings()
.bind('click.glide touchstart.glide', this.click)
.bind('mouseenter.glide', this.hover)
.bind('mouseleave.glide', this.hover)
.removeClass(classes.disabled);
};
/**
* Disable both arrows.
*
* @return {Void}
*/
Arrows.prototype.disableBoth = function() {
this.items
.unbind('click.glide touchstart.glide')
.addClass(Glide.options.classes.disabled);
};
/**
* Show both arrows.
*
* @return {Void}
*/
Arrows.prototype.enable = function() {
this.bind();
this.items.removeClass(Glide.options.classes.disabled);
};
/**
* Arrow click event.
*
* @param {Object} event
* @return {Void}
*/
Arrows.prototype.click = function(event) {
event.preventDefault();
if (!Core.Events.disabled) {
Core.Run.pause();
Core.Run.make($(this).data('glide-dir'));
Core.Animation.after(function() {
Core.Run.play();
});
}
};
/**
* Arrows hover event.
*
* @param {Object} event
* @return {Void}
*/
Arrows.prototype.hover = function(event) {
if (!Core.Events.disabled) {
switch (event.type) {
// Start autoplay on mouse leave.
case 'mouseleave':
Core.Run.play();
break;
// Pause autoplay on mouse enter.
case 'mouseenter':
Core.Run.pause();
break;
}
}
};
/**
* Bind arrows events.
*
* @return {Void}
*/
Arrows.prototype.bind = function() {
this.items
.on('click.glide touchstart.glide', this.click)
.on('mouseenter.glide', this.hover)
.on('mouseleave.glide', this.hover);
};
/**
* Unbind arrows events.
*
* @return {Void}
*/
Arrows.prototype.unbind = function() {
this.items
.off('click.glide touchstart.glide')
.off('mouseenter.glide')
.off('mouseleave.glide');
};
// Return class.
return new Arrows();
};
| {
"content_hash": "4658598c5d92b08a6d38446d8cf78bf6",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 80,
"avg_line_length": 22.210884353741495,
"alnum_prop": 0.49617151607963245,
"repo_name": "alanlinos/alanlinos.github.io",
"id": "f4b96fe61ef03dac215457ffdfba3dfb40903eb6",
"size": "3265",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "node_modules/glidejs/src/modules/Arrows.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "85593"
},
{
"name": "HTML",
"bytes": "1473"
},
{
"name": "JavaScript",
"bytes": "48330"
},
{
"name": "Vue",
"bytes": "27207"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<title>Tiendita</title>
<meta charset="utf-8" />
<!--Import Google Icon Font-->
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.min.css-->
<link type="text/css" rel="stylesheet" href="../css/materialize.min.css" media="screen,projection"/>
<!--Import CodePen-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link type="text/css" rel="stylesheet" href="../css/css.css" media="screen,projection"/>
</head>
<body>
<!-- -------------------------------PRELOADER
<div id="page-loader"><span class="preloader-interior"></span></div>-->
<!--------------------------------------------------------NAV BAR-->
<nav class="navbar-material">
<div class="nav-wrapper red">
<a href="../index.html" class="brand-logo">
<img src="../img/Acuario%20Familia%20Logo%20Blanco-01.png">
</a>
<ul id="nav-mobile" class="left hide-on-med-and-down">
<li><a> Family Aquarium</a></li>
</ul>
<a href="#" data-activates="mobile-demo" class="button-collapse"><i class="material-icons">menu</i></a>
<ul class="right hide-on-med-and-down">
<!------------------------------------------- MENU DESPLEGABLE Dropdown Trigger -->
<li><a class='dropdown-button btn-flat white-text' href='#' data-activates='dropdown1'>Tienda<i class="mdi-navigation-arrow-drop-down right"></i></a></li>
<!-------------------------------------- Dropdown Structure -->
<ul id='dropdown1' class='dropdown-content'>
<li><a href="../Perros.html">Perros</a></li>
<li><a href="../Gatos.html">Gatos</a></li>
<li><a href="../Aves.html">Aves</a></li>
<li><a href="../Peces.html">Peces</a></li>
<li><a href="../Roedores.html">Roedores</a></li>
<li><a href="../Reptiles.html">Reptiles</a></li>
<li><a href="../Plantas.html">Plantas</a></li>
<li class="divider"></li>
<li><a href="#!">TODOS</a></li>
</ul>
<li><a href="#modal0" class="modal-trigger">CONTACTO</a></li>
</ul>
<ul class="side-nav red white-text" id="mobile-demo">
<li><a href="#modal0" class="modal-trigger">Contacto</a></li>
<li><a class="dropdown-button" href="#!" data-activates="dropdown2">Tienda<i class="mdi-navigation-arrow-drop-down right"></i></a></li>
<!-------------------------------------- Dropdown Structure -->
<ul id='dropdown2' class='dropdown-content'>
<li><a href="../Perros.html">Perros</a></li>
<li><a href="../Gatos.html">Gatos</a></li>
<li><a href="../Aves.html">Aves</a></li>
<li><a href="../Peces.html">Peces</a></li>
<li><a href="../Roedores.html">Roedores</a></li>
<li><a href="../Reptiles.html">Reptiles</a></li>
<li><a href="../Plantas.html">Plantas</a></li>
<li class="divider"></li>
<li><a href="#!">TODOS</a></li>
</ul>
</ul>
</div>
</nav>
<!-- Modal Contacto -->
<div id="modal0" class="modal">
<div class="modal-content">
<h3 class="caption center-align" >Estamos a tus órdenes</h3>
<p style="text-align: justify;">En Acuario Familia sabemos que no sólo se trata de una mascota, sino de un integrante más de la familia. Por ello te ofrecemos artículos que cumplan con sus necesidades y que esten al alcance de todos los bolsillos.</p><p style="text-align: justify;">Si tienes dudas con algun producto, forma de pago o envío, contactanos</p>
</div>
<div class="row">
<div class="col s12 m6">
<p class="fa fa-envelope-o"> [email protected]</p>
</div>
<div class="col s12 m6">
<p class="right-align fa fa-whatsapp"> 55-6222-2947, 55-6876-2680</p>
</div>
</div>
<div class="modal-footer">
<a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Cerrar</a>
</div>
</div>
<!---------------------------------------------------BOTON PRINCIPAL-->
<div class="fixed-action-btn click-to-toggle" style="bottom: 45px; right: 24px;">
<a class="btn-floating btn-large red">
<i class="material-icons">menu</i>
</a>
<ul>
<li><a href="../Perros.html" class="btn-floating red"><i class="animal caption center-align">d</i></a></li>
<li><a href="../Gatos.html"class="btn-floating yellow darken-1"><i class="animal caption center-align">c</i></a></li>
<li><a href="../Aves.html"class="btn-floating green"><i class="animal">z</i></a></li>
<li><a href="../Peces.html" class="btn-floating blue"><i class="animal">s</i></a></li>
<li><a href="../Roedores.html"class="btn-floating pink accent-1"><i class="animal">b</i></a></li>
<li><a href="../Reptiles.html"class="btn-floating yellow darken-4"><i class="animal">f</i></a></li>
<li><a href="../Plantas.html" class="btn-floating green accent-3 "><i class="fa fa-pagelines black-text"></i></a></li>
</ul>
</div>
<!--Fonts para el boton principal-->
<style type="text/css">
@font-face {
font-family: "Garanimals";
src: url("../font/animals/GARANIMA.eot") /* EOT file for IE */
}
@font-face {
font-family: "Garanimals";
src: url("../font/animals/GARANIMA.TTF");
}
@font-face {
font-family: "Garanimals";
src: url("../font/animals/GARANIMA.otf");
}
</style>
<!-- -------------------------------TIENDA-->
<div style="text-align:center;">
<iframe align="middle" src="https://www.kichink.com/buy/587840/family-aquarium/mini-pellets-p-peces-tropicales-90-gr#.VnsupRXhB1s" width="100%" height="1020">
<p>Your browser does not support iframes.</p>
</iframe>
</div>
<!-- -------------------------------MAPA-->
<div class="cc-map-wrapper" style="text-align: center;">
<p style="text-align: center;"><h5>Pregunta por el costo y tiempo de entrega fuera de la zona</h5></p>
<iframe src="https://www.google.com/maps/d/embed?mid=zCE3Xk0xKmn0.kXm5wwpg28Dk" width="80%" height="480" frameborder="0" style="border:0" allowfullscreen></iframe></div>
</div>
<!--FOOTER-->
<footer class="page-footer">
<div class="container">
<div class="row">
<div class="col l6 s12">
<h4 class="white-text">Entrega a domicilio</h4>
<h5 href="#" class="white-text"><i class="fa fa-whatsapp"></i> 55-6222-2947, 55-6876-2680</h5>
<span href="#" class="white-text"><i class="fa fa-envelope-o"></i> [email protected]</span>
</div>
<div class="col l4 offset-l2 s12">
<h5 class="white-text">Mandanos un Whatsapp, llámanos o escríbenos</h5>
<!-- Modal Trigger -->
<a href="#" class="btn-floating waves-effect waves-light transparent"><i class="fa fa-facebook white-text"></i></a>
<a href="#" class="btn-floating waves-effect waves-light transparent white-text"><i class="fa fa-twitter white-text"></i></a>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
© 2016 Copyright
<!--<a class="grey-text text-lighten-4 right" href="#!">More Links</a>-->
</div>
</div>
</footer>
</body>
<!-- -------------------------------SCRIPTS-->
<script type="text/javascript" src="../js/jquery-2.1.4.min.js"></script>
<script src="../js/materialize.js"></script>
<script src="../js/materialize.min.js"></script>
<script src="../js/init.js"></script>
</html> | {
"content_hash": "1755adb77246aef3a3b53431db698e26",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 384,
"avg_line_length": 57.127272727272725,
"alnum_prop": 0.47188627201357947,
"repo_name": "angelopolus/angelopolus.github.io",
"id": "28936c0e8ced3ff8ceac9b2df4564b0fe0c7e1d5",
"size": "9434",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "produc/AlimentoPecesTropicalesWardley90Gr.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "199815"
},
{
"name": "HTML",
"bytes": "2560547"
},
{
"name": "JavaScript",
"bytes": "268998"
}
],
"symlink_target": ""
} |
<?php
namespace Coupon;
use Coupon\Model\Coupon;
use Coupon\Model\CouponTable;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
class Module implements AutoloaderProviderInterface, ConfigProviderInterface
{
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__ . '/autoload_classmap.php',
),
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
public function getServiceConfig()
{
return array(
'factories' => array(
'Coupon\Model\CouponTable' => function($sm) {
$tableGateway = $sm->get('CouponTableGateway');
$table = new CouponTable($tableGateway);
return $table;
},
'CouponTableGateway' => function ($sm) {
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new Coupon());
return new TableGateway('coupon', $dbAdapter, null, $resultSetPrototype);
},
),
);
}
}
?> | {
"content_hash": "f3120b645f137c768f525ba660dfb245",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 94,
"avg_line_length": 32.15384615384615,
"alnum_prop": 0.5340909090909091,
"repo_name": "zocuxtech/smsandemail",
"id": "9ba928e7f3626f168ba21cfb839196cb7e0aedb3",
"size": "1672",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "module/Coupon/Module.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "711"
},
{
"name": "CSS",
"bytes": "88858"
},
{
"name": "HTML",
"bytes": "229840"
},
{
"name": "JavaScript",
"bytes": "11996"
},
{
"name": "PHP",
"bytes": "92953"
}
],
"symlink_target": ""
} |
using namespace std;
#ifdef _WIN32
#include <windows.h>
#pragma comment (lib, "ws2_32.lib")
#else
#include <unistd.h>
#endif
int main(int argc, char *argv[])
{
TestLua testlua;
testlua.Run();
TestSock testsock;
testsock.Run();
TestObjectPool testobjectpool;
testobjectpool.Run();
TestTimer testtimer;
testtimer.Run();
{
AutoCpuCostTimer t;
TestBuff testbuff;
testbuff.Run();
}
#ifdef _WIN32
int temp;
std::cin >> temp;
#endif
return 0;
} | {
"content_hash": "3158dba0064d2f5854ed89e1bfa75f37",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 35,
"avg_line_length": 12.675675675675675,
"alnum_prop": 0.6823027718550106,
"repo_name": "kkbjbj/LiteServer",
"id": "b33acf986e5234fb0a932fcfbe7b702bd007eef3",
"size": "622",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/test.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "94"
},
{
"name": "C",
"bytes": "82998"
},
{
"name": "C++",
"bytes": "91825"
},
{
"name": "Lua",
"bytes": "21435"
},
{
"name": "Makefile",
"bytes": "1426"
},
{
"name": "Shell",
"bytes": "158"
}
],
"symlink_target": ""
} |
layout: default
title : NFS
header : Using OSiRIS NFS
group: documentation
subnavgroup: documentation
---
{% include JB/setup %}
OSiRIS can provide access to your CephFS space via our NFS servers if you are on campus at MSU, UM, or WSU. Please email <a href="mailto:[email protected]">[email protected]</a> if interested in using OSiRIS via NFS so we can setup the necessary 'user mapping' from your local user to your OSiRIS identity. Once configured, files owned by your OSiRIS identity will show as owned by your local (non-osiris) identity when listed in the NFS mount. Groups will still show as 'nobody' but actual group permissions will be respected as determined by your OSiRIS group memberships. We can also map selected OSiRIS groups to local groups if there is an appropriate correlation.
<h2>HPCC at MSU</h2>
HPCC users at MSU can access OSiRIS storage already mounted on globus-01.hpcc.msu.edu at /mnt/cephfs. After login you will need to run 'kinit' and enter your password to manually obtain Kerberos credentials.
<h2>Client Configuration</h2>
Mounting NFS requires Kerberos credentials. Your client will require a keytab and users of the space require credentials to verify their identity.
If interested in mounting NFS on your client OSiRIS admins can obtain a keytab for your client as well as assist with configuration. We also have to configure a 'user mapping' to map your local system user to your OSiRIS identity. It is not strictly required but if not setup then your files will all show as owned by the NFS 'nobody' user.
For reference, the NFS servers are: <br />
um-nfs01.osris.org <br />
msu-nfs01.osris.org <br />
Your client must have rpc.gssd and gssproxyd running. These should startup automatically if /etc/krb5.keytab exists. If you have just installed a keytab and need to start them on RHEL7 (or CentOS 7):
<pre>
systemctl start rpc-gssd.service
systemctl start gssproxy.service
</pre>
You should also set a default_realm in /etc/krb5.conf under libdefaults. For example:
<pre>
/etc/krb5.conf:
[libdefaults]
default_realm = UMICH.EDU
</pre>
On your client system the /etc/idmapd.conf file should have a domain that matches your institution. At UM that domain is 'umich.edu'. At MSU that domain is 'hpcc.msu.edu'. For example:
<pre>
/etc/idmapd.conf:
[General]
# The default is the host's DNS domain name.
Domain = umich.edu
</pre>
A typical mount command might look like this:
<pre>
mount -t nfs4 -o sec=krb5,nfsvers=4.1,noacl um-nfs01.osris.org:/cephfs /mnt/cephfs/
</pre>
Or in fstab:
<pre>
um-nfs01.osris.org:/cephfs /mnt/cephfs nfs sec=krb5,nfsvers=4.1,noacl,_netdev,rw 0 0
</pre>
| {
"content_hash": "971049529abf15ebe6491580eb321cc9",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 683,
"avg_line_length": 45.355932203389834,
"alnum_prop": 0.7608370702541106,
"repo_name": "MI-OSiRIS/mi-osiris.github.io",
"id": "6a8f9a4f54956e4ab29c1c42f259471c809aa770",
"size": "2680",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "documentation/nfs.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2487"
},
{
"name": "HTML",
"bytes": "12900"
},
{
"name": "Ruby",
"bytes": "49"
},
{
"name": "Shell",
"bytes": "1438"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Device.Location;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Devices.Geolocation;
namespace SeeClickFix.WP8.Services
{
public class GetGeoCoordinateResponse
{
public bool IsLocationServicesDisabled { get; private set; }
public GeoCoordinate Coordinate { get; private set; }
public Exception Error { get; private set; }
public GetGeoCoordinateResponse(GeoCoordinate coordinate, Exception error, bool isLocationServicesDisabled)
{
this.Coordinate = coordinate;
this.Error = error;
this.IsLocationServicesDisabled = isLocationServicesDisabled;
}
}
}
| {
"content_hash": "8bb8ef0527075532c936259a47a60719",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 115,
"avg_line_length": 29.84,
"alnum_prop": 0.7117962466487936,
"repo_name": "SeeClickFix/windows_mobile",
"id": "16471b75f8bdedb73ef398b249fd28ad7fae79fe",
"size": "748",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Services/GetGeoCoordinateResponse.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "404751"
}
],
"symlink_target": ""
} |
package com.intellij.lang.properties.editor;
import com.intellij.ide.presentation.Presentation;
import com.intellij.lang.properties.ResourceBundle;
import com.intellij.lang.properties.ResourceBundleImpl;
import com.intellij.lang.properties.psi.PropertiesFile;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileSystem;
import com.intellij.openapi.vfs.VirtualFileWithoutContent;
import com.intellij.openapi.vfs.newvfs.RefreshQueue;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
/**
* @author Alexey
*/
@Presentation(icon = "AllIcons.Nodes.ResourceBundle")
public class ResourceBundleAsVirtualFile extends VirtualFile implements VirtualFileWithoutContent {
private final ResourceBundle myResourceBundle;
public ResourceBundleAsVirtualFile(@NotNull final ResourceBundle resourceBundle) {
myResourceBundle = resourceBundle;
}
@NotNull
public ResourceBundle getResourceBundle() {
return myResourceBundle;
}
@Override
@NotNull
public VirtualFileSystem getFileSystem() {
return LocalFileSystem.getInstance();
}
@Override
@NotNull
public String getPath() {
return getName();
}
@Override
@NotNull
public String getName() {
return myResourceBundle.getBaseName();
}
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final ResourceBundleAsVirtualFile resourceBundleAsVirtualFile = (ResourceBundleAsVirtualFile)o;
if (!myResourceBundle.equals(resourceBundleAsVirtualFile.myResourceBundle)) return false;
return true;
}
public int hashCode() {
return myResourceBundle.hashCode();
}
@Override
public void rename(Object requestor, @NotNull String newName) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public boolean isWritable() {
return true;
}
@Override
public boolean isDirectory() {
return false;
}
@Override
public boolean isValid() {
if (myResourceBundle instanceof ResourceBundleImpl && !((ResourceBundleImpl)myResourceBundle).isValid()) {
return false;
}
for (PropertiesFile propertiesFile : myResourceBundle.getPropertiesFiles()) {
final VirtualFile virtualFile = propertiesFile.getVirtualFile();
if (virtualFile == null || !virtualFile.isValid()) {
return false;
}
}
return true;
}
@Override
public VirtualFile getParent() {
return myResourceBundle.getBaseDirectory();
}
@Override
public VirtualFile[] getChildren() {
return EMPTY_ARRAY;
}
@NotNull
@Override
public VirtualFile createChildDirectory(Object requestor, @NotNull String name) throws IOException {
throw new UnsupportedOperationException();
}
@NotNull
@Override
public VirtualFile createChildData(Object requestor, @NotNull String name) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public void delete(Object requestor) throws IOException {
//todo
}
@Override
public void move(Object requestor, @NotNull VirtualFile newParent) throws IOException {
//todo
}
@Override
public InputStream getInputStream() throws IOException {
throw new UnsupportedOperationException();
}
@Override
@NotNull
public OutputStream getOutputStream(Object requestor, long newModificationStamp, long newTimeStamp) throws IOException {
throw new UnsupportedOperationException();
}
@Override
@NotNull
public byte[] contentsToByteArray() throws IOException {
//TODO compare files action uses this method
return new byte[0];
}
@Override
public long getModificationStamp() {
return 0;
}
@Override
public long getTimeStamp() {
return 0;
}
@Override
public long getLength() {
return 0;
}
@Override
public void refresh(boolean asynchronous, boolean recursive, Runnable postRunnable) {
List<VirtualFile> files = ContainerUtil.mapNotNull(myResourceBundle.getPropertiesFiles(), file -> file.getVirtualFile());
if (!files.isEmpty()) {
RefreshQueue.getInstance().refresh(false, false, postRunnable, files);
}
}
}
| {
"content_hash": "ced2d9f888f6f7fdaa7fbd116af3206e",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 125,
"avg_line_length": 25.57894736842105,
"alnum_prop": 0.7402834933699132,
"repo_name": "fitermay/intellij-community",
"id": "26f83ecd2f769761bec0c0a602b4b53c996d3c4f",
"size": "4974",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundleAsVirtualFile.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AMPL",
"bytes": "20665"
},
{
"name": "AspectJ",
"bytes": "182"
},
{
"name": "Batchfile",
"bytes": "59458"
},
{
"name": "C",
"bytes": "215610"
},
{
"name": "C#",
"bytes": "1538"
},
{
"name": "C++",
"bytes": "196925"
},
{
"name": "CSS",
"bytes": "197224"
},
{
"name": "CoffeeScript",
"bytes": "1759"
},
{
"name": "Erlang",
"bytes": "10"
},
{
"name": "Gherkin",
"bytes": "14382"
},
{
"name": "Groff",
"bytes": "35232"
},
{
"name": "Groovy",
"bytes": "2959417"
},
{
"name": "HLSL",
"bytes": "57"
},
{
"name": "HTML",
"bytes": "1826250"
},
{
"name": "J",
"bytes": "5050"
},
{
"name": "Java",
"bytes": "157395762"
},
{
"name": "JavaScript",
"bytes": "563135"
},
{
"name": "Jupyter Notebook",
"bytes": "93222"
},
{
"name": "Kotlin",
"bytes": "2119317"
},
{
"name": "Lex",
"bytes": "178923"
},
{
"name": "Makefile",
"bytes": "2352"
},
{
"name": "NSIS",
"bytes": "49952"
},
{
"name": "Objective-C",
"bytes": "28750"
},
{
"name": "Perl",
"bytes": "903"
},
{
"name": "Perl 6",
"bytes": "26"
},
{
"name": "Protocol Buffer",
"bytes": "6607"
},
{
"name": "Python",
"bytes": "23898534"
},
{
"name": "Ruby",
"bytes": "1217"
},
{
"name": "Scala",
"bytes": "11698"
},
{
"name": "Shell",
"bytes": "62269"
},
{
"name": "Smalltalk",
"bytes": "64"
},
{
"name": "TeX",
"bytes": "25473"
},
{
"name": "Thrift",
"bytes": "1846"
},
{
"name": "TypeScript",
"bytes": "9469"
},
{
"name": "XSLT",
"bytes": "113040"
}
],
"symlink_target": ""
} |
.PHONY: all clean lib src test
all:
cd src; make all
clean:
cd lib/nanomsg; make clean
cd src; make clean
lib:
cd lib/nanomsg; ./autogen.sh; ./configure; make
src:
cd src; make
| {
"content_hash": "8592c3e17f585e437edadbfb7a846549",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 48,
"avg_line_length": 12.466666666666667,
"alnum_prop": 0.679144385026738,
"repo_name": "nico2600/SqliteServer_MQ",
"id": "f2509d90f8686a55d024eb6d90bfc0619bd36004",
"size": "187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Makefile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "994068"
},
{
"name": "C++",
"bytes": "4352"
},
{
"name": "CSS",
"bytes": "238"
},
{
"name": "PHP",
"bytes": "1649"
},
{
"name": "Python",
"bytes": "10280"
},
{
"name": "Shell",
"bytes": "4677"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MembersProject")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MembersProject")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("18b7cf41-08f3-4e68-9a8b-f7c90bfe2317")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "a2a03b409efb9ebba0403a0f061ba781",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 84,
"avg_line_length": 38.885714285714286,
"alnum_prop": 0.7494489346069066,
"repo_name": "pbres/24days.in.Umbraco.MembersProject",
"id": "bb37ce5ac0e154a4ed03b5bda1afa0f2511da793",
"size": "1364",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/MembersProject/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "238"
},
{
"name": "C#",
"bytes": "26471"
}
],
"symlink_target": ""
} |
package org.apache.spark.sql.sources.v2
import scala.collection.JavaConverters._
import org.apache.spark.SparkFunSuite
/**
* A simple test suite to verify `DataSourceV2Options`.
*/
class DataSourceV2OptionsSuite extends SparkFunSuite {
test("key is case-insensitive") {
val options = new DataSourceV2Options(Map("foo" -> "bar").asJava)
assert(options.get("foo").get() == "bar")
assert(options.get("FoO").get() == "bar")
assert(!options.get("abc").isPresent)
}
test("value is case-sensitive") {
val options = new DataSourceV2Options(Map("foo" -> "bAr").asJava)
assert(options.get("foo").get == "bAr")
}
test("getInt") {
val options = new DataSourceV2Options(Map("numFOo" -> "1", "foo" -> "bar").asJava)
assert(options.getInt("numFOO", 10) == 1)
assert(options.getInt("numFOO2", 10) == 10)
intercept[NumberFormatException]{
options.getInt("foo", 1)
}
}
test("getBoolean") {
val options = new DataSourceV2Options(
Map("isFoo" -> "true", "isFOO2" -> "false", "foo" -> "bar").asJava)
assert(options.getBoolean("isFoo", false))
assert(!options.getBoolean("isFoo2", true))
assert(options.getBoolean("isBar", true))
assert(!options.getBoolean("isBar", false))
assert(!options.getBoolean("FOO", true))
}
test("getLong") {
val options = new DataSourceV2Options(Map("numFoo" -> "9223372036854775807",
"foo" -> "bar").asJava)
assert(options.getLong("numFOO", 0L) == 9223372036854775807L)
assert(options.getLong("numFoo2", -1L) == -1L)
intercept[NumberFormatException]{
options.getLong("foo", 0L)
}
}
test("getDouble") {
val options = new DataSourceV2Options(Map("numFoo" -> "922337.1",
"foo" -> "bar").asJava)
assert(options.getDouble("numFOO", 0d) == 922337.1d)
assert(options.getDouble("numFoo2", -1.02d) == -1.02d)
intercept[NumberFormatException]{
options.getDouble("foo", 0.1d)
}
}
}
| {
"content_hash": "8657bc27b628e98aeb689feca6667e34",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 86,
"avg_line_length": 29.26865671641791,
"alnum_prop": 0.6425293217746048,
"repo_name": "ericvandenbergfb/spark",
"id": "90d92864b26fa5c74cfabecc6fff41f2bd588f39",
"size": "2761",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "sql/core/src/test/scala/org/apache/spark/sql/sources/v2/DataSourceV2OptionsSuite.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "33781"
},
{
"name": "Batchfile",
"bytes": "30285"
},
{
"name": "C",
"bytes": "1493"
},
{
"name": "CSS",
"bytes": "23957"
},
{
"name": "HTML",
"bytes": "10056"
},
{
"name": "Java",
"bytes": "3142003"
},
{
"name": "JavaScript",
"bytes": "141585"
},
{
"name": "Makefile",
"bytes": "7774"
},
{
"name": "PLpgSQL",
"bytes": "8788"
},
{
"name": "PowerShell",
"bytes": "3756"
},
{
"name": "Python",
"bytes": "2434056"
},
{
"name": "R",
"bytes": "1089584"
},
{
"name": "Roff",
"bytes": "14714"
},
{
"name": "SQLPL",
"bytes": "6233"
},
{
"name": "Scala",
"bytes": "24449859"
},
{
"name": "Shell",
"bytes": "158388"
},
{
"name": "Thrift",
"bytes": "33605"
}
],
"symlink_target": ""
} |
// CLASS HEADER
#include <dali/internal/canvas-renderer/tizen/drawable-group-impl-tizen.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#include <dali/public-api/object/type-registry.h>
// INTERNAL INCLUDES
#include <dali/internal/canvas-renderer/common/drawable-impl.h>
namespace Dali
{
namespace Internal
{
namespace Adaptor
{
namespace // unnamed namespace
{
// Type Registration
Dali::BaseHandle Create()
{
return Dali::BaseHandle();
}
Dali::TypeRegistration type(typeid(Dali::CanvasRenderer::DrawableGroup), typeid(Dali::BaseHandle), Create);
} // unnamed namespace
DrawableGroupTizen* DrawableGroupTizen::New()
{
return new DrawableGroupTizen();
}
DrawableGroupTizen::DrawableGroupTizen()
#ifdef THORVG_SUPPORT
: mTvgScene(nullptr)
#endif
{
Initialize();
}
DrawableGroupTizen::~DrawableGroupTizen()
{
}
void DrawableGroupTizen::Initialize()
{
#ifdef THORVG_SUPPORT
mTvgScene = tvg::Scene::gen().release();
if(!mTvgScene)
{
DALI_LOG_ERROR("DrawableGroup is null [%p]\n", this);
}
Drawable::Create();
Drawable::SetObject(static_cast<void*>(mTvgScene));
Drawable::SetType(Drawable::Types::DRAWABLE_GROUP);
#endif
}
bool DrawableGroupTizen::AddDrawable(Dali::CanvasRenderer::Drawable& drawable)
{
#ifdef THORVG_SUPPORT
if(!Drawable::GetObject() || !mTvgScene)
{
DALI_LOG_ERROR("DrawableGroup is null\n");
return false;
}
Internal::Adaptor::Drawable& drawableImpl = Dali::GetImplementation(drawable);
if(drawableImpl.IsAdded())
{
DALI_LOG_ERROR("Already added [%p][%p]\n", this, &drawable);
return false;
}
drawableImpl.SetAdded(true);
mDrawables.push_back(drawable);
Drawable::SetChanged(true);
return true;
#else
return false;
#endif
}
bool DrawableGroupTizen::RemoveDrawable(Dali::CanvasRenderer::Drawable drawable)
{
#ifdef THORVG_SUPPORT
DrawableGroup::DrawableVector::iterator it = std::find(mDrawables.begin(), mDrawables.end(), drawable);
if(it != mDrawables.end())
{
Internal::Adaptor::Drawable& drawableImpl = Dali::GetImplementation(*it);
drawableImpl.SetAdded(false);
mDrawables.erase(it);
Drawable::SetChanged(true);
return true;
}
#endif
return false;
}
bool DrawableGroupTizen::RemoveAllDrawables()
{
#ifdef THORVG_SUPPORT
if(!Drawable::GetObject() || !mTvgScene)
{
DALI_LOG_ERROR("DrawableGroup is null\n");
return false;
}
for(auto& it : mDrawables)
{
Internal::Adaptor::Drawable& drawableImpl = Dali::GetImplementation(it);
drawableImpl.SetAdded(false);
}
mDrawables.clear();
if(static_cast<tvg::Scene*>(mTvgScene)->clear() != tvg::Result::Success)
{
DALI_LOG_ERROR("RemoveAllDrawables() fail.\n");
return false;
}
Drawable::SetChanged(true);
return true;
#else
return false;
#endif
}
DrawableGroup::DrawableVector DrawableGroupTizen::GetDrawables() const
{
return mDrawables;
}
} // namespace Adaptor
} // namespace Internal
} // namespace Dali
| {
"content_hash": "0630eb2388473430ad968c956c326179",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 107,
"avg_line_length": 19.85234899328859,
"alnum_prop": 0.7139959432048681,
"repo_name": "dalihub/dali-adaptor",
"id": "44f8794a07736e08ba7a4270c754f1411017a758",
"size": "3573",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dali/internal/canvas-renderer/tizen/drawable-group-impl-tizen.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "19442"
},
{
"name": "C++",
"bytes": "6277553"
},
{
"name": "CMake",
"bytes": "98211"
},
{
"name": "Objective-C++",
"bytes": "36586"
},
{
"name": "Perl",
"bytes": "48524"
},
{
"name": "Ruby",
"bytes": "1190"
},
{
"name": "Shell",
"bytes": "45425"
}
],
"symlink_target": ""
} |
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
_LIBCPP_BEGIN_NAMESPACE_STD
// move
template <class _InputIterator, class _OutputIterator>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
_OutputIterator
__move_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
for (; __first != __last; ++__first, (void) ++__result)
*__result = _VSTD::move(*__first);
return __result;
}
template <class _InputIterator, class _OutputIterator>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
_OutputIterator
__move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
return _VSTD::__move_constexpr(__first, __last, __result);
}
template <class _Tp, class _Up>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
typename enable_if
<
is_same<typename remove_const<_Tp>::type, _Up>::value &&
is_trivially_move_assignable<_Up>::value,
_Up*
>::type
__move(_Tp* __first, _Tp* __last, _Up* __result)
{
const size_t __n = static_cast<size_t>(__last - __first);
if (__n > 0)
_VSTD::memmove(__result, __first, __n * sizeof(_Up));
return __result + __n;
}
template <class _InputIterator, class _OutputIterator>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
if (__libcpp_is_constant_evaluated()) {
return _VSTD::__move_constexpr(__first, __last, __result);
} else {
return _VSTD::__rewrap_iter(__result,
_VSTD::__move(_VSTD::__unwrap_iter(__first),
_VSTD::__unwrap_iter(__last),
_VSTD::__unwrap_iter(__result)));
}
}
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
#endif // _LIBCPP___ALGORITHM_MOVE_H
| {
"content_hash": "5ef7ac99099a883761e6fc571b43ff8b",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 89,
"avg_line_length": 30.0327868852459,
"alnum_prop": 0.6413755458515283,
"repo_name": "andrewrk/zig",
"id": "f5fc74854f05cddcd1913a622a95cc76470d29a3",
"size": "2504",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/libcxx/include/__algorithm/move.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "654659"
},
{
"name": "C++",
"bytes": "1974638"
},
{
"name": "CMake",
"bytes": "15525"
}
],
"symlink_target": ""
} |
/* global define */
/* ================================================
* Make use of Bootstrap's modal more monkey-friendly.
*
* For Bootstrap 3.
*
* [email protected]
*
* https://github.com/nakupanda/bootstrap3-dialog
*
* Licensed under The MIT License.
* ================================================ */
(function(root, factory) {
"use strict";
// CommonJS module is defined
if (typeof module !== 'undefined' && module.exports) {
module.exports = factory(require('jquery')(root));
}
// AMD module is defined
else if (typeof define === "function" && define.amd) {
define("bootstrap-dialog", ["jquery"], function($) {
return factory($);
});
} else {
// planted over the root!
root.BootstrapDialog = factory(root.jQuery);
}
}(this, function($) {
"use strict";
var BootstrapDialog = function(options) {
this.defaultOptions = $.extend(true, {
id: BootstrapDialog.newGuid(),
buttons: [],
data: {},
onshow: null,
onshown: null,
onhide: null,
onhidden: null
}, BootstrapDialog.defaultOptions);
this.indexedButtons = {};
this.registeredButtonHotkeys = {};
this.draggableData = {
isMouseDown: false,
mouseOffset: {}
};
this.realized = false;
this.opened = false;
this.initOptions(options);
this.holdThisInstance();
};
/**
* Some constants.
*/
BootstrapDialog.NAMESPACE = 'bootstrap-dialog';
BootstrapDialog.TYPE_DEFAULT = 'type-default';
BootstrapDialog.TYPE_INFO = 'type-info';
BootstrapDialog.TYPE_PRIMARY = 'type-primary';
BootstrapDialog.TYPE_SUCCESS = 'type-success';
BootstrapDialog.TYPE_WARNING = 'type-warning';
BootstrapDialog.TYPE_DANGER = 'type-danger';
BootstrapDialog.DEFAULT_TEXTS = {};
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DEFAULT] = 'Information';
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_INFO] = 'Information';
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_PRIMARY] = 'Information';
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_SUCCESS] = 'Success';
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_WARNING] = 'Warning';
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DANGER] = 'Danger';
BootstrapDialog.DEFAULT_TEXTS['OK'] = 'OK';
BootstrapDialog.DEFAULT_TEXTS['CANCEL'] = 'Cancel';
BootstrapDialog.SIZE_NORMAL = 'size-normal';
BootstrapDialog.SIZE_WIDE = 'size-wide'; // size-wide is equal to modal-lg
BootstrapDialog.SIZE_LARGE = 'size-large';
BootstrapDialog.BUTTON_SIZES = {};
BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_NORMAL] = '';
BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_WIDE] = '';
BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_LARGE] = 'btn-lg';
BootstrapDialog.ICON_SPINNER = 'glyphicon glyphicon-asterisk';
BootstrapDialog.ZINDEX_BACKDROP = 1040;
BootstrapDialog.ZINDEX_MODAL = 1050;
/**
* Default options.
*/
BootstrapDialog.defaultOptions = {
type: BootstrapDialog.TYPE_PRIMARY,
size: BootstrapDialog.SIZE_NORMAL,
cssClass: '',
title: null,
message: null,
nl2br: true,
closable: true,
closeByBackdrop: true,
closeByKeyboard: true,
spinicon: BootstrapDialog.ICON_SPINNER,
autodestroy: true,
draggable: false,
animate: true,
description: ''
};
/**
* Config default options.
*/
BootstrapDialog.configDefaultOptions = function(options) {
BootstrapDialog.defaultOptions = $.extend(true, BootstrapDialog.defaultOptions, options);
};
/**
* Open / Close all created dialogs all at once.
*/
BootstrapDialog.dialogs = {};
BootstrapDialog.openAll = function() {
$.each(BootstrapDialog.dialogs, function(id, dialogInstance) {
dialogInstance.open();
});
};
BootstrapDialog.closeAll = function() {
$.each(BootstrapDialog.dialogs, function(id, dialogInstance) {
dialogInstance.close();
});
};
/**
* Move focus to next visible dialog.
*/
BootstrapDialog.moveFocus = function() {
var lastDialogInstance = null;
$.each(BootstrapDialog.dialogs, function(id, dialogInstance) {
lastDialogInstance = dialogInstance;
});
if (lastDialogInstance !== null && lastDialogInstance.isRealized()) {
lastDialogInstance.getModal().focus();
}
};
/**
* Show scrollbar if the last visible dialog needs one.
*/
BootstrapDialog.showScrollbar = function() {
var lastDialogInstance = null;
$.each(BootstrapDialog.dialogs, function(id, dialogInstance) {
lastDialogInstance = dialogInstance;
});
if (lastDialogInstance !== null && lastDialogInstance.isRealized() && lastDialogInstance.isOpened()) {
var bsModal = lastDialogInstance.getModal().data('bs.modal');
bsModal.checkScrollbar();
$('body').addClass('modal-open');
bsModal.setScrollbar();
}
};
BootstrapDialog.prototype = {
constructor: BootstrapDialog,
initOptions: function(options) {
this.options = $.extend(true, this.defaultOptions, options);
return this;
},
holdThisInstance: function() {
BootstrapDialog.dialogs[this.getId()] = this;
return this;
},
initModalStuff: function() {
this.setModal(this.createModal())
.setModalDialog(this.createModalDialog())
.setModalContent(this.createModalContent())
.setModalHeader(this.createModalHeader())
.setModalBody(this.createModalBody())
.setModalFooter(this.createModalFooter());
this.getModal().append(this.getModalDialog());
this.getModalDialog().append(this.getModalContent());
this.getModalContent()
.append(this.getModalHeader())
.append(this.getModalBody())
.append(this.getModalFooter());
return this;
},
createModal: function() {
var $modal = $('<div class="modal" tabindex="-1" role="dialog" aria-hidden="true"></div>');
$modal.prop('id', this.getId()).attr('aria-labelledby', this.getId() + '_title');
return $modal;
},
getModal: function() {
return this.$modal;
},
setModal: function($modal) {
this.$modal = $modal;
return this;
},
createModalDialog: function() {
return $('<div class="modal-dialog"></div>');
},
getModalDialog: function() {
return this.$modalDialog;
},
setModalDialog: function($modalDialog) {
this.$modalDialog = $modalDialog;
return this;
},
createModalContent: function() {
return $('<div class="modal-content"></div>');
},
getModalContent: function() {
return this.$modalContent;
},
setModalContent: function($modalContent) {
this.$modalContent = $modalContent;
return this;
},
createModalHeader: function() {
return $('<div class="modal-header"></div>');
},
getModalHeader: function() {
return this.$modalHeader;
},
setModalHeader: function($modalHeader) {
this.$modalHeader = $modalHeader;
return this;
},
createModalBody: function() {
return $('<div class="modal-body"></div>');
},
getModalBody: function() {
return this.$modalBody;
},
setModalBody: function($modalBody) {
this.$modalBody = $modalBody;
return this;
},
createModalFooter: function() {
return $('<div class="modal-footer"></div>');
},
getModalFooter: function() {
return this.$modalFooter;
},
setModalFooter: function($modalFooter) {
this.$modalFooter = $modalFooter;
return this;
},
createDynamicContent: function(rawContent) {
var content = null;
if (typeof rawContent === 'function') {
content = rawContent.call(rawContent, this);
} else {
content = rawContent;
}
if (typeof content === 'string') {
content = this.formatStringContent(content);
}
return content;
},
formatStringContent: function(content) {
if (this.options.nl2br) {
return content.replace(/\r\n/g, '<br />').replace(/[\r\n]/g, '<br />');
}
return content;
},
setData: function(key, value) {
this.options.data[key] = value;
return this;
},
getData: function(key) {
return this.options.data[key];
},
setId: function(id) {
this.options.id = id;
return this;
},
getId: function() {
return this.options.id;
},
getType: function() {
return this.options.type;
},
setType: function(type) {
this.options.type = type;
this.updateType();
return this;
},
updateType: function() {
if (this.isRealized()) {
var types = [BootstrapDialog.TYPE_DEFAULT,
BootstrapDialog.TYPE_INFO,
BootstrapDialog.TYPE_PRIMARY,
BootstrapDialog.TYPE_SUCCESS,
BootstrapDialog.TYPE_WARNING,
BootstrapDialog.TYPE_DANGER];
this.getModal().removeClass(types.join(' ')).addClass(this.getType());
}
return this;
},
getSize: function() {
return this.options.size;
},
setSize: function(size) {
this.options.size = size;
this.updateSize();
return this;
},
updateSize: function() {
if (this.isRealized()) {
var dialog = this;
// Dialog size
this.getModal().removeClass(BootstrapDialog.SIZE_NORMAL)
.removeClass(BootstrapDialog.SIZE_WIDE)
.removeClass(BootstrapDialog.SIZE_LARGE);
this.getModal().addClass(this.getSize());
// Wider dialog.
this.getModalDialog().removeClass('modal-lg');
if (this.getSize() === BootstrapDialog.SIZE_WIDE) {
this.getModalDialog().addClass('modal-lg');
}
// Button size
$.each(this.options.buttons, function(index, button) {
var $button = dialog.getButton(button.id);
var buttonSizes = ['btn-lg', 'btn-sm', 'btn-xs'];
var sizeClassSpecified = false;
if (typeof button['cssClass'] === 'string') {
var btnClasses = button['cssClass'].split(' ');
$.each(btnClasses, function(index, btnClass) {
if ($.inArray(btnClass, buttonSizes) !== -1) {
sizeClassSpecified = true;
}
});
}
if (!sizeClassSpecified) {
$button.removeClass(buttonSizes.join(' '));
$button.addClass(dialog.getButtonSize());
}
});
}
return this;
},
getCssClass: function() {
return this.options.cssClass;
},
setCssClass: function(cssClass) {
this.options.cssClass = cssClass;
return this;
},
getTitle: function() {
return this.options.title;
},
setTitle: function(title) {
this.options.title = title;
this.updateTitle();
return this;
},
updateTitle: function() {
if (this.isRealized()) {
var title = this.getTitle() !== null ? this.createDynamicContent(this.getTitle()) : this.getDefaultText();
this.getModalHeader().find('.' + this.getNamespace('title')).html('').append(title).prop('id', this.getId() + '_title');
}
return this;
},
getMessage: function() {
return this.options.message;
},
setMessage: function(message) {
this.options.message = message;
this.updateMessage();
return this;
},
updateMessage: function() {
if (this.isRealized()) {
var message = this.createDynamicContent(this.getMessage());
this.getModalBody().find('.' + this.getNamespace('message')).html('').append(message);
}
return this;
},
isClosable: function() {
return this.options.closable;
},
setClosable: function(closable) {
this.options.closable = closable;
this.updateClosable();
return this;
},
setCloseByBackdrop: function(closeByBackdrop) {
this.options.closeByBackdrop = closeByBackdrop;
return this;
},
canCloseByBackdrop: function() {
return this.options.closeByBackdrop;
},
setCloseByKeyboard: function(closeByKeyboard) {
this.options.closeByKeyboard = closeByKeyboard;
return this;
},
canCloseByKeyboard: function() {
return this.options.closeByKeyboard;
},
isAnimate: function() {
return this.options.animate;
},
setAnimate: function(animate) {
this.options.animate = animate;
return this;
},
updateAnimate: function() {
if (this.isRealized()) {
this.getModal().toggleClass('fade', this.isAnimate());
}
return this;
},
getSpinicon: function() {
return this.options.spinicon;
},
setSpinicon: function(spinicon) {
this.options.spinicon = spinicon;
return this;
},
addButton: function(button) {
this.options.buttons.push(button);
return this;
},
addButtons: function(buttons) {
var that = this;
$.each(buttons, function(index, button) {
that.addButton(button);
});
return this;
},
getButtons: function() {
return this.options.buttons;
},
setButtons: function(buttons) {
this.options.buttons = buttons;
this.updateButtons();
return this;
},
/**
* If there is id provided for a button option, it will be in dialog.indexedButtons list.
*
* In that case you can use dialog.getButton(id) to find the button.
*
* @param {type} id
* @returns {undefined}
*/
getButton: function(id) {
if (typeof this.indexedButtons[id] !== 'undefined') {
return this.indexedButtons[id];
}
return null;
},
getButtonSize: function() {
if (typeof BootstrapDialog.BUTTON_SIZES[this.getSize()] !== 'undefined') {
return BootstrapDialog.BUTTON_SIZES[this.getSize()];
}
return '';
},
updateButtons: function() {
if (this.isRealized()) {
if (this.getButtons().length === 0) {
this.getModalFooter().hide();
} else {
this.getModalFooter().find('.' + this.getNamespace('footer')).html('').append(this.createFooterButtons());
}
}
return this;
},
isAutodestroy: function() {
return this.options.autodestroy;
},
setAutodestroy: function(autodestroy) {
this.options.autodestroy = autodestroy;
},
getDescription: function() {
return this.options.description;
},
setDescription: function(description) {
this.options.description = description;
return this;
},
getDefaultText: function() {
return BootstrapDialog.DEFAULT_TEXTS[this.getType()];
},
getNamespace: function(name) {
return BootstrapDialog.NAMESPACE + '-' + name;
},
createHeaderContent: function() {
var $container = $('<div></div>');
$container.addClass(this.getNamespace('header'));
// title
$container.append(this.createTitleContent());
// Close button
$container.prepend(this.createCloseButton());
return $container;
},
createTitleContent: function() {
var $title = $('<div></div>');
$title.addClass(this.getNamespace('title'));
return $title;
},
createCloseButton: function() {
var $container = $('<div></div>');
$container.addClass(this.getNamespace('close-button'));
var $icon = $('<button class="close">×</button>');
$container.append($icon);
$container.on('click', {dialog: this}, function(event) {
event.data.dialog.close();
});
return $container;
},
createBodyContent: function() {
var $container = $('<div></div>');
$container.addClass(this.getNamespace('body'));
// Message
$container.append(this.createMessageContent());
return $container;
},
createMessageContent: function() {
var $message = $('<div></div>');
$message.addClass(this.getNamespace('message'));
return $message;
},
createFooterContent: function() {
var $container = $('<div></div>');
$container.addClass(this.getNamespace('footer'));
return $container;
},
createFooterButtons: function() {
var that = this;
var $container = $('<div></div>');
$container.addClass(this.getNamespace('footer-buttons'));
this.indexedButtons = {};
$.each(this.options.buttons, function(index, button) {
if (!button.id) {
button.id = BootstrapDialog.newGuid();
}
var $button = that.createButton(button);
that.indexedButtons[button.id] = $button;
$container.append($button);
});
return $container;
},
createButton: function(button) {
var $button = $('<button class="btn"></button>');
$button.prop('id', button.id);
// Icon
if (typeof button.icon !== 'undefined' && $.trim(button.icon) !== '') {
$button.append(this.createButtonIcon(button.icon));
}
// Label
if (typeof button.label !== 'undefined') {
$button.append(button.label);
}
// Css class
if (typeof button.cssClass !== 'undefined' && $.trim(button.cssClass) !== '') {
$button.addClass(button.cssClass);
} else {
$button.addClass('btn-default');
}
// Hotkey
if (typeof button.hotkey !== 'undefined') {
this.registeredButtonHotkeys[button.hotkey] = $button;
}
// Button on click
$button.on('click', {dialog: this, $button: $button, button: button}, function(event) {
var dialog = event.data.dialog;
var $button = event.data.$button;
var button = event.data.button;
if (typeof button.action === 'function') {
button.action.call($button, dialog);
}
if (button.autospin) {
$button.toggleSpin(true);
}
});
// Dynamically add extra functions to $button
this.enhanceButton($button);
return $button;
},
/**
* Dynamically add extra functions to $button
*
* Using '$this' to reference 'this' is just for better readability.
*
* @param {type} $button
* @returns {_L13.BootstrapDialog.prototype}
*/
enhanceButton: function($button) {
$button.dialog = this;
// Enable / Disable
$button.toggleEnable = function(enable) {
var $this = this;
if (typeof enable !== 'undefined') {
$this.prop("disabled", !enable).toggleClass('disabled', !enable);
} else {
$this.prop("disabled", !$this.prop("disabled"));
}
return $this;
};
$button.enable = function() {
var $this = this;
$this.toggleEnable(true);
return $this;
};
$button.disable = function() {
var $this = this;
$this.toggleEnable(false);
return $this;
};
// Icon spinning, helpful for indicating ajax loading status.
$button.toggleSpin = function(spin) {
var $this = this;
var dialog = $this.dialog;
var $icon = $this.find('.' + dialog.getNamespace('button-icon'));
if (typeof spin === 'undefined') {
spin = !($button.find('.icon-spin').length > 0);
}
if (spin) {
$icon.hide();
$button.prepend(dialog.createButtonIcon(dialog.getSpinicon()).addClass('icon-spin'));
} else {
$icon.show();
$button.find('.icon-spin').remove();
}
return $this;
};
$button.spin = function() {
var $this = this;
$this.toggleSpin(true);
return $this;
};
$button.stopSpin = function() {
var $this = this;
$this.toggleSpin(false);
return $this;
};
return this;
},
createButtonIcon: function(icon) {
var $icon = $('<span></span>');
$icon.addClass(this.getNamespace('button-icon')).addClass(icon);
return $icon;
},
/**
* Invoke this only after the dialog is realized.
*
* @param {type} enable
* @returns {undefined}
*/
enableButtons: function(enable) {
$.each(this.indexedButtons, function(id, $button) {
$button.toggleEnable(enable);
});
return this;
},
/**
* Invoke this only after the dialog is realized.
*
* @returns {undefined}
*/
updateClosable: function() {
if (this.isRealized()) {
// Close button
this.getModalHeader().find('.' + this.getNamespace('close-button')).toggle(this.isClosable());
}
return this;
},
/**
* Set handler for modal event 'show.bs.modal'.
* This is a setter!
*/
onShow: function(onshow) {
this.options.onshow = onshow;
return this;
},
/**
* Set handler for modal event 'shown.bs.modal'.
* This is a setter!
*/
onShown: function(onshown) {
this.options.onshown = onshown;
return this;
},
/**
* Set handler for modal event 'hide.bs.modal'.
* This is a setter!
*/
onHide: function(onhide) {
this.options.onhide = onhide;
return this;
},
/**
* Set handler for modal event 'hidden.bs.modal'.
* This is a setter!
*/
onHidden: function(onhidden) {
this.options.onhidden = onhidden;
return this;
},
isRealized: function() {
return this.realized;
},
setRealized: function(realized) {
this.realized = realized;
return this;
},
isOpened: function() {
return this.opened;
},
setOpened: function(opened) {
this.opened = opened;
return this;
},
handleModalEvents: function() {
this.getModal().on('show.bs.modal', {dialog: this}, function(event) {
var dialog = event.data.dialog;
if (dialog.isModalEvent(event) && typeof dialog.options.onshow === 'function') {
return dialog.options.onshow(dialog);
}
});
this.getModal().on('shown.bs.modal', {dialog: this}, function(event) {
var dialog = event.data.dialog;
dialog.isModalEvent(event) && typeof dialog.options.onshown === 'function' && dialog.options.onshown(dialog);
});
this.getModal().on('hide.bs.modal', {dialog: this}, function(event) {
var dialog = event.data.dialog;
if (dialog.isModalEvent(event) && typeof dialog.options.onhide === 'function') {
return dialog.options.onhide(dialog);
}
});
this.getModal().on('hidden.bs.modal', {dialog: this}, function(event) {
var dialog = event.data.dialog;
dialog.isModalEvent(event) && typeof dialog.options.onhidden === 'function' && dialog.options.onhidden(dialog);
dialog.isAutodestroy() && $(this).remove();
BootstrapDialog.moveFocus();
});
// Backdrop, I did't find a way to change bs3 backdrop option after the dialog is popped up, so here's a new wheel.
this.getModal().on('click', {dialog: this}, function(event) {
event.target === this && event.data.dialog.isClosable() && event.data.dialog.canCloseByBackdrop() && event.data.dialog.close();
});
// ESC key support
this.getModal().on('keyup', {dialog: this}, function(event) {
event.which === 27 && event.data.dialog.isClosable() && event.data.dialog.canCloseByKeyboard() && event.data.dialog.close();
});
// Button hotkey
this.getModal().on('keyup', {dialog: this}, function(event) {
var dialog = event.data.dialog;
if (typeof dialog.registeredButtonHotkeys[event.which] !== 'undefined') {
var $button = $(dialog.registeredButtonHotkeys[event.which]);
!$button.prop('disabled') && $button.focus().trigger('click');
}
});
return this;
},
isModalEvent: function(event) {
return typeof event.namespace !== 'undefined' && event.namespace === 'bs.modal';
},
makeModalDraggable: function() {
if (this.options.draggable) {
this.getModalHeader().addClass(this.getNamespace('draggable')).on('mousedown', {dialog: this}, function(event) {
var dialog = event.data.dialog;
dialog.draggableData.isMouseDown = true;
var dialogOffset = dialog.getModalDialog().offset();
dialog.draggableData.mouseOffset = {
top: event.clientY - dialogOffset.top,
left: event.clientX - dialogOffset.left
};
});
this.getModal().on('mouseup mouseleave', {dialog: this}, function(event) {
event.data.dialog.draggableData.isMouseDown = false;
});
$('body').on('mousemove', {dialog: this}, function(event) {
var dialog = event.data.dialog;
if (!dialog.draggableData.isMouseDown) {
return;
}
dialog.getModalDialog().offset({
top: event.clientY - dialog.draggableData.mouseOffset.top,
left: event.clientX - dialog.draggableData.mouseOffset.left
});
});
}
return this;
},
/**
* To make multiple opened dialogs look better.
*/
updateZIndex: function() {
var dialogCount = 0;
$.each(BootstrapDialog.dialogs, function(dialogId, dialogInstance) {
dialogCount++;
});
var $modal = this.getModal();
var $backdrop = $modal.data('bs.modal').$backdrop;
$modal.css('z-index', BootstrapDialog.ZINDEX_MODAL + (dialogCount - 1) * 20);
$backdrop.css('z-index', BootstrapDialog.ZINDEX_BACKDROP + (dialogCount - 1) * 20);
return this;
},
realize: function() {
this.initModalStuff();
this.getModal().addClass(BootstrapDialog.NAMESPACE)
.addClass(this.getCssClass());
this.updateSize();
if (this.getDescription()) {
this.getModal().attr('aria-describedby', this.getDescription());
}
this.getModalFooter().append(this.createFooterContent());
this.getModalHeader().append(this.createHeaderContent());
this.getModalBody().append(this.createBodyContent());
this.getModal().modal({
backdrop: 'static',
keyboard: false,
show: false
});
this.makeModalDraggable();
this.handleModalEvents();
this.setRealized(true);
this.updateButtons();
this.updateType();
this.updateTitle();
this.updateMessage();
this.updateClosable();
this.updateAnimate();
this.updateSize();
return this;
},
open: function() {
!this.isRealized() && this.realize();
this.getModal().modal('show');
this.updateZIndex();
this.setOpened(true);
return this;
},
close: function() {
this.getModal().modal('hide');
if (this.isAutodestroy()) {
delete BootstrapDialog.dialogs[this.getId()];
}
this.setOpened(false);
// Show scrollbar if the last visible dialog needs one.
BootstrapDialog.showScrollbar();
return this;
}
};
/**
* RFC4122 version 4 compliant unique id creator.
*
* Added by https://github.com/tufanbarisyildirim/
*
* @returns {String}
*/
BootstrapDialog.newGuid = function() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
};
/* ================================================
* For lazy people
* ================================================ */
/**
* Shortcut function: show
*
* @param {type} options
* @returns the created dialog instance
*/
BootstrapDialog.show = function(options) {
return new BootstrapDialog(options).open();
};
/**
* Alert window
*
* @returns the created dialog instance
*/
BootstrapDialog.alert = function() {
var options = {};
var defaultOptions = {
type: BootstrapDialog.TYPE_PRIMARY,
title: null,
message: null,
closable: true,
buttonLabel: BootstrapDialog.DEFAULT_TEXTS.OK,
callback: null
};
if (typeof arguments[0] === 'object' && arguments[0].constructor === {}.constructor) {
options = $.extend(true, defaultOptions, arguments[0]);
} else {
options = $.extend(true, defaultOptions, {
message: arguments[0],
closable: false,
buttonLabel: BootstrapDialog.DEFAULT_TEXTS.OK,
callback: typeof arguments[1] !== 'undefined' ? arguments[1] : null
});
}
return new BootstrapDialog({
type: options.type,
title: options.title,
message: options.message,
closable: options.closable,
data: {
callback: options.callback
},
onhide: function(dialog) {
!dialog.getData('btnClicked') && dialog.isClosable() && typeof dialog.getData('callback') === 'function' && dialog.getData('callback')(false);
},
buttons: [{
label: options.buttonLabel,
action: function(dialog) {
dialog.setData('btnClicked', true);
typeof dialog.getData('callback') === 'function' && dialog.getData('callback')(true);
dialog.close();
}
}]
}).open();
};
/**
* Confirm window
*
* @param {type} message
* @param {type} callback
* @returns the created dialog instance
*/
BootstrapDialog.confirm = function(message, callback) {
return new BootstrapDialog({
title: 'Confirmation',
message: message,
closable: false,
data: {
'callback': callback
},
buttons: [{
label: BootstrapDialog.DEFAULT_TEXTS.CANCEL,
action: function(dialog) {
typeof dialog.getData('callback') === 'function' && dialog.getData('callback')(false);
dialog.close();
}
}, {
label: BootstrapDialog.DEFAULT_TEXTS.OK,
cssClass: 'btn-primary',
action: function(dialog) {
typeof dialog.getData('callback') === 'function' && dialog.getData('callback')(true);
dialog.close();
}
}]
}).open();
};
/**
* Warning window
*
* @param {type} message
* @returns the created dialog instance
*/
BootstrapDialog.warning = function(message, callback) {
return new BootstrapDialog({
type: BootstrapDialog.TYPE_WARNING,
message: message
}).open();
};
/**
* Danger window
*
* @param {type} message
* @returns the created dialog instance
*/
BootstrapDialog.danger = function(message, callback) {
return new BootstrapDialog({
type: BootstrapDialog.TYPE_DANGER,
message: message
}).open();
};
/**
* Success window
*
* @param {type} message
* @returns the created dialog instance
*/
BootstrapDialog.success = function(message, callback) {
return new BootstrapDialog({
type: BootstrapDialog.TYPE_SUCCESS,
message: message
}).open();
};
return BootstrapDialog;
}));
| {
"content_hash": "eccade682d07ce61f27b6daf4fc90790",
"timestamp": "",
"source": "github",
"line_count": 1089,
"max_line_length": 158,
"avg_line_length": 33.31129476584022,
"alnum_prop": 0.5066986437313926,
"repo_name": "chenvista/flask-demos",
"id": "2cbdcc4b7ec571019f9d9cb9842629acb2392c9f",
"size": "36276",
"binary": false,
"copies": "51",
"ref": "refs/heads/master",
"path": "application/static/js/bootstrap-dialog.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "110412"
},
{
"name": "Python",
"bytes": "1984435"
},
{
"name": "Shell",
"bytes": "1862"
}
],
"symlink_target": ""
} |
package com.zobot.client.packet.definitions.serverbound.play
import com.zobot.client.packet.Packet
case class HeldItemChange(slot: Any) extends Packet {
override lazy val packetId = 0x1A
override lazy val packetData: Array[Byte] =
fromAny(slot)
}
| {
"content_hash": "81a160a91b62371fb8fc6cfc6adeea8e",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 60,
"avg_line_length": 25.8,
"alnum_prop": 0.7751937984496124,
"repo_name": "BecauseNoReason/zobot",
"id": "ea3e9976d1f63042c7334f38b32a25e2d7846153",
"size": "258",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/scala/com/zobot/client/packet/definitions/serverbound/play/HeldItemChange.scala",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Scala",
"bytes": "66778"
}
],
"symlink_target": ""
} |
<?php
namespace Bolt\Session\Handler;
use Predis\ClientInterface as Predis;
use Redis;
/**
* Redis Session Handler.
*
* @author Carson Full <[email protected]>
*/
class RedisHandler implements \SessionHandlerInterface, LazyWriteHandlerInterface
{
/** @var Redis|Predis */
protected $redis;
/** @var int */
protected $ttl;
/**
* RedisHandler constructor.
*
* @param Redis|Predis $redis The Redis or Predis client
* @param int $maxlifetime Number of seconds before session expires
*/
public function __construct($redis, $maxlifetime)
{
if (!$redis instanceof Redis && !$redis instanceof Predis) {
throw new \InvalidArgumentException('Argument must be an instance of Redis or Predis\ClientInterface');
}
$this->redis = $redis;
$this->ttl = (int) $maxlifetime;
}
/**
* {@inheritdoc}
*/
public function open($savePath, $sessionName)
{
return true;
}
/**
* {@inheritdoc}
*/
public function read($sessionId)
{
if ($data = $this->redis->get($sessionId)) {
return $data;
}
return '';
}
/**
* {@inheritdoc}
*/
public function gc($maxlifetime)
{
return true;
}
/**
* {@inheritdoc}
*/
public function destroy($sessionId)
{
$this->redis->del($sessionId);
return true;
}
/**
* {@inheritdoc}
*/
public function write($sessionId, $data)
{
$this->redis->setex($sessionId, $this->ttl, $data);
return true;
}
/**
* {@inheritdoc}
*/
public function updateTimestamp($sessionId, $data)
{
$this->redis->expire($sessionId, $this->ttl);
}
/**
* {@inheritdoc}
*/
public function close()
{
return true;
}
}
| {
"content_hash": "de1a2b86d2e982012559a8bb8b7d40aa",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 115,
"avg_line_length": 19.377551020408163,
"alnum_prop": 0.5423907319641916,
"repo_name": "dsmink/ceasy.nl",
"id": "bb35887392f2dcba26fb269d1efec65e186069a6",
"size": "1899",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "src/Session/Handler/RedisHandler.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "4154"
},
{
"name": "CSS",
"bytes": "297020"
},
{
"name": "HTML",
"bytes": "450456"
},
{
"name": "JavaScript",
"bytes": "492249"
},
{
"name": "Nginx",
"bytes": "2075"
},
{
"name": "PHP",
"bytes": "2623734"
},
{
"name": "Shell",
"bytes": "4354"
}
],
"symlink_target": ""
} |
/**
* @file
* This file implements the OpenThread software random number generator API.
*/
#include <openthread/random_noncrypto.h>
#include "common/random.hpp"
using namespace ot;
uint32_t otRandomNonCryptoGetUint32(void)
{
return Random::NonCrypto::GetUint32();
}
uint8_t otRandomNonCryptoGetUint8(void)
{
return Random::NonCrypto::GetUint8();
}
uint16_t otRandomNonCryptoGetUint16(void)
{
return Random::NonCrypto::GetUint16();
}
uint8_t otRandomNonCryptoGetUint8InRange(uint8_t aMin, uint8_t aMax)
{
return Random::NonCrypto::GetUint8InRange(aMin, aMax);
}
uint16_t otRandomNonCryptoGetUint16InRange(uint16_t aMin, uint16_t aMax)
{
return Random::NonCrypto::GetUint16InRange(aMin, aMax);
}
uint32_t otRandomNonCryptoGetUint32InRange(uint32_t aMin, uint32_t aMax)
{
return Random::NonCrypto::GetUint32InRange(aMin, aMax);
}
void otRandomNonCryptoFillBuffer(uint8_t *aBuffer, uint16_t aSize)
{
Random::NonCrypto::FillBuffer(aBuffer, aSize);
}
uint32_t otRandomNonCryptoAddJitter(uint32_t aValue, uint16_t aJitter)
{
return Random::NonCrypto::AddJitter(aValue, aJitter);
}
| {
"content_hash": "a9fcae42b9bcc5946cde8e5d84b97507",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 78,
"avg_line_length": 21.615384615384617,
"alnum_prop": 0.7544483985765125,
"repo_name": "bukepo/openthread",
"id": "51fb14178bb799fbcc283c0c2c1a22d5212daebe",
"size": "2732",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "src/core/api/random_noncrypto_api.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "50"
},
{
"name": "C",
"bytes": "1080565"
},
{
"name": "C++",
"bytes": "5839893"
},
{
"name": "CMake",
"bytes": "95509"
},
{
"name": "Dockerfile",
"bytes": "6286"
},
{
"name": "M4",
"bytes": "36443"
},
{
"name": "Makefile",
"bytes": "161153"
},
{
"name": "Python",
"bytes": "3379923"
},
{
"name": "Shell",
"bytes": "134708"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="ko">
<head>
<!-- Generated by javadoc (version 1.7.0_21) on Wed Feb 26 23:03:20 KST 2014 -->
<title>Uses of Class etri.sdn.controller.module.statemanager.OFMatchSerializer</title>
<meta name="date" content="2014-02-26">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class etri.sdn.controller.module.statemanager.OFMatchSerializer";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../etri/sdn/controller/module/statemanager/OFMatchSerializer.html" title="class in etri.sdn.controller.module.statemanager">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?etri/sdn/controller/module/statemanager/class-use/OFMatchSerializer.html" target="_top">Frames</a></li>
<li><a href="OFMatchSerializer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class etri.sdn.controller.module.statemanager.OFMatchSerializer" class="title">Uses of Class<br>etri.sdn.controller.module.statemanager.OFMatchSerializer</h2>
</div>
<div class="classUseContainer">No usage of etri.sdn.controller.module.statemanager.OFMatchSerializer</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../etri/sdn/controller/module/statemanager/OFMatchSerializer.html" title="class in etri.sdn.controller.module.statemanager">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?etri/sdn/controller/module/statemanager/class-use/OFMatchSerializer.html" target="_top">Frames</a></li>
<li><a href="OFMatchSerializer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"content_hash": "addabafb2bd7c822d7d7c394c29fbdac",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 177,
"avg_line_length": 38.40869565217391,
"alnum_prop": 0.6232737151913064,
"repo_name": "openiris/IRIS",
"id": "1f889287bc755030e3e7d32ad9f5bbfdb27dc67d",
"size": "4417",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Torpedo/doc/etri/sdn/controller/module/statemanager/class-use/OFMatchSerializer.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "29731"
},
{
"name": "HTML",
"bytes": "8941198"
},
{
"name": "Java",
"bytes": "1025521"
},
{
"name": "JavaScript",
"bytes": "625513"
},
{
"name": "PHP",
"bytes": "25856"
}
],
"symlink_target": ""
} |
define("p3/widget/ProteinFeatureSummary", [
'dojo/_base/declare', 'dijit/_WidgetBase', 'dojo/on', 'dojo/promise/all', 'dojo/when',
'dojo/dom-class', './SummaryWidget',
'dojo/request', 'dojo/_base/lang', 'dojox/charting/Chart2D', './PATRICTheme', 'dojox/charting/action2d/MoveSlice',
'dojox/charting/action2d/Tooltip', 'dojo/dom-construct', '../util/PathJoin', 'dojo/fx/easing'
], function (
declare, WidgetBase, on, All, when,
domClass, SummaryWidget,
xhr, lang, Chart2D, Theme, MoveSlice,
ChartTooltip, domConstruct, PathJoin, easing
) {
var labels = ['Hypothetical proteins', 'Proteins with functional assignments', 'Proteins with EC number assignments', 'Proteins with GO assignments', 'Proteins with Pathway assignments', 'Proteins with Subsystem assignments', 'Proteins with PATRIC genus-specific family (PLfam) assignments', 'Proteins with PATRIC cross-genus family (PGfam) assignments', 'Proteins with FIGfam assignments'];
var shortLabels = ['Hypothetical', 'Functional', 'EC assigned', 'GO assigned', 'Pathway assigned', 'Subsystem assigned', 'PLfam assigned', 'PGfam assigned', 'FIGfam assigned'];
var filters = ['eq(product,hypothetical+protein),eq(feature_type,CDS)', 'ne(product,hypothetical+protein),eq(feature_type,CDS)', 'eq(property,EC*)', 'eq(go,*)', 'eq(property,Pathway)', 'eq(property,Subsystem)', 'eq(plfam_id,PLF*)', 'eq(pgfam_id,PGF*)', 'eq(figfam_id,*)'];
return declare([SummaryWidget], {
dataModel: 'genome_feature',
query: '',
view: 'table',
baseQuery: '&in(annotation,(PATRIC,RefSeq))&limit(1)&facet((field,annotation),(mincount,1))&json(nl,map)',
columns: [{
label: ' ',
field: 'label'
}, {
label: 'PATRIC',
field: 'PATRIC',
renderCell: function (obj, val, node) {
node.innerHTML = val ? ('<a href="#view_tab=features&filter=and(eq(annotation,PATRIC),' + obj.filter + ')" target="_blank">' + val + '</a>') : '0';
}
}, {
label: 'RefSeq',
field: 'RefSeq',
renderCell: function (obj, val, node) {
node.innerHTML = val ? ('<a href="#view_tab=features&filter=and(eq(annotation,RefSeq),' + obj.filter + ')" target="_blank">' + val + '</a>') : '0';
}
}],
onSetQuery: function (attr, oldVal, query) {
var url = PathJoin(this.apiServiceUrl, this.dataModel) + '/';
var defHypothetical = when(xhr.post(url, {
handleAs: 'json',
headers: this.headers,
data: this.query + '&and(eq(product,hypothetical+protein),eq(feature_type,CDS))' + this.baseQuery
}), function (response) {
return response.facet_counts.facet_fields.annotation;
});
var defFunctional = when(xhr.post(url, {
handleAs: 'json',
headers: this.headers,
data: this.query + '&and(ne(product,hypothetical+protein),eq(feature_type,CDS))' + this.baseQuery
}), function (response) {
return response.facet_counts.facet_fields.annotation;
});
var defECAssigned = when(xhr.post(url, {
handleAs: 'json',
headers: this.headers,
data: this.query + '&eq(property,EC*)' + this.baseQuery
}), function (response) {
return response.facet_counts.facet_fields.annotation;
});
var defGOAssigned = when(xhr.post(url, {
handleAs: 'json',
headers: this.headers,
data: this.query + '&eq(go,*)' + this.baseQuery
}), function (response) {
return response.facet_counts.facet_fields.annotation;
});
var defPathwayAssigned = when(xhr.post(url, {
handleAs: 'json',
headers: this.headers,
data: this.query + '&eq(property,Pathway)' + this.baseQuery
}), function (response) {
return response.facet_counts.facet_fields.annotation;
});
var defSubsystemAssigned = when(xhr.post(url, {
handleAs: 'json',
headers: this.headers,
data: this.query + '&eq(property,Subsystem)' + this.baseQuery
}), function (response) {
return response.facet_counts.facet_fields.annotation;
});
var defPLfamAssigned = when(xhr.post(url, {
handleAs: 'json',
headers: this.headers,
data: this.query + '&eq(plfam_id,PLF*)' + this.baseQuery
}), function (response) {
return response.facet_counts.facet_fields.annotation;
});
var defPGfamAssigned = when(xhr.post(url, {
handleAs: 'json',
headers: this.headers,
data: this.query + '&eq(pgfam_id,PGF*)' + this.baseQuery
}), function (response) {
return response.facet_counts.facet_fields.annotation;
});
var defFigfamAssigned = when(xhr.post(url, {
handleAs: 'json',
headers: this.headers,
data: this.query + '&eq(figfam_id,*)' + this.baseQuery
}), function (response) {
return response.facet_counts.facet_fields.annotation;
});
return when(All([defHypothetical, defFunctional, defECAssigned, defGOAssigned, defPathwayAssigned, defSubsystemAssigned, defPLfamAssigned, defPGfamAssigned, defFigfamAssigned]), lang.hitch(this, 'processData'));
},
processData: function (results) {
this._tableData = results.map(function (row, idx) {
row.label = labels[idx];
row.filter = filters[idx];
return row;
});
var data = { PATRIC: [], RefSeq: [] };
results.forEach(function (row, idx) {
data.PATRIC.push({ label: labels[idx], y: row.PATRIC || 0 });
data.RefSeq.push({ label: labels[idx], y: row.RefSeq || 0 });
});
this.set('data', data);
},
render_chart: function () {
if (!this.chart) {
var chart = this.chart = new Chart2D(this.chartNode)
.setTheme(Theme)
.addPlot('default', {
type: 'ClusteredBars',
markers: true,
gap: 2,
// labels: true,
minBarSize: 7,
labelStyle: 'outside',
labelOffset: 20,
// labelFunc: function(o){
// return o.annotation;
// },
animate: { duration: 1000, easing: easing.linear }
})
.addAxis('x', {
vertical: true,
majorLabels: true,
minorTicks: false,
minorLabels: false,
microTicks: false,
labels: shortLabels.map(function (val, idx) { return { text: val, value: idx + 1 }; })
})
.addAxis('y', {
minorTicks: false
});
new ChartTooltip(this.chart, 'default', {
text: function (o) {
var d = o.run.data[o.index];
return '[' + o.run.name + '] ' + d.label + 's (' + d.y + ')';
}
});
Object.keys(this.data).forEach(lang.hitch(this, function (key) {
chart.addSeries(key, this.data[key]);
}));
chart.render();
} else {
Object.keys(this.data).forEach(lang.hitch(this, function (key) {
this.chart.updateSeries(key, this.data[key]);
}));
this.chart.render();
}
},
render_table: function () {
this.inherited(arguments);
this.grid.refresh();
this.grid.renderArray(this._tableData);
}
});
});
| {
"content_hash": "2550175a5716765edec81acd85d75834",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 393,
"avg_line_length": 37.5699481865285,
"alnum_prop": 0.5884705557854089,
"repo_name": "dmachi/p3_web",
"id": "768135d77a44e7673407da350b3a3d1f7588c355",
"size": "7251",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "public/js/release/p3/widget/ProteinFeatureSummary.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "17567"
},
{
"name": "AngelScript",
"bytes": "4817"
},
{
"name": "Batchfile",
"bytes": "1371"
},
{
"name": "CSS",
"bytes": "6294380"
},
{
"name": "CoffeeScript",
"bytes": "30579"
},
{
"name": "HTML",
"bytes": "3237259"
},
{
"name": "JavaScript",
"bytes": "35486763"
},
{
"name": "Makefile",
"bytes": "848"
},
{
"name": "Mako",
"bytes": "405"
},
{
"name": "PHP",
"bytes": "38090"
},
{
"name": "Shell",
"bytes": "2996"
},
{
"name": "XSLT",
"bytes": "47383"
}
],
"symlink_target": ""
} |
package com.mcleodmoores.quandl.loader.config;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.opengamma.financial.currency.CurrencyPair;
import com.opengamma.financial.currency.CurrencyPairs;
/**
* Creates a {@link CurrencyPairs} configuration from currency-pairs.csv.
*/
public final class QuandlCurrencyPairsGenerator {
/** The logger */
private static final Logger LOGGER = LoggerFactory.getLogger(QuandlCurrencyPairsGenerator.class);
/**
* Restricted constructor.
*/
private QuandlCurrencyPairsGenerator() {
}
/**
* Creates a currency pairs configuration from a file.
*
* @return The configuration
*/
public static CurrencyPairs createConfiguration() {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(QuandlCurrencyPairsGenerator.class.getResourceAsStream("currency-pairs.csv")))) {
String pairStr;
final Set<CurrencyPair> pairs = new HashSet<>();
while ((pairStr = reader.readLine()) != null) {
try {
final CurrencyPair pair = CurrencyPair.parse(pairStr.trim());
pairs.add(pair);
} catch (final IllegalArgumentException e) {
LOGGER.warn("Unable to create currency pair from " + pairStr, e);
}
}
return CurrencyPairs.of(pairs);
} catch (final IOException e) {
LOGGER.warn(e.getMessage());
}
throw new IllegalStateException("Could not create CurrencyPairs");
}
}
| {
"content_hash": "dcc9e5ca3a102083c294e60ed19e0313",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 155,
"avg_line_length": 30.75,
"alnum_prop": 0.7110694183864915,
"repo_name": "McLeodMoores/starling",
"id": "f5a7abc0ca08bb958b93019b51d5e3bca1888f2f",
"size": "1692",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "projects/quandl/src/main/java/com/mcleodmoores/quandl/loader/config/QuandlCurrencyPairsGenerator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2505"
},
{
"name": "CSS",
"bytes": "213501"
},
{
"name": "FreeMarker",
"bytes": "310184"
},
{
"name": "GAP",
"bytes": "1490"
},
{
"name": "Groovy",
"bytes": "11518"
},
{
"name": "HTML",
"bytes": "318295"
},
{
"name": "Java",
"bytes": "79541905"
},
{
"name": "JavaScript",
"bytes": "1511230"
},
{
"name": "PLSQL",
"bytes": "398"
},
{
"name": "PLpgSQL",
"bytes": "26901"
},
{
"name": "Shell",
"bytes": "11481"
},
{
"name": "TSQL",
"bytes": "604117"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>bignums: 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.15.0 / bignums - 8.13.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
bignums
<small>
8.13.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-03-09 10:04:44 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-09 10:04:44 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.15.0 Formal proof management system
dune 3.0.3 Fast, portable, and opinionated build system
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq/bignums"
dev-repo: "git+https://github.com/coq/bignums.git"
bug-reports: "https://github.com/coq/bignums/issues"
license: "LGPL-2.1-only"
synopsis: "Bignums, the Coq library of arbitrary large numbers"
description: """
Provides BigN, BigZ, BigQ that used to be part of Coq standard library < 8.6
"""
build: [make "-j%{jobs}%" {ocaml:version >= "4.06"}]
run-test: [make "-C" "tests" "-j%{jobs}%"]
install: [make "install"]
depends: [
"ocaml"
"coq" {>= "8.13" & < "8.14~"}
]
tags: [
"category:Miscellaneous/Coq Extensions"
"category:Mathematics/Arithmetic and Number Theory/Number theory"
"category:Mathematics/Arithmetic and Number Theory/Rational numbers"
"keyword:integer numbers"
"keyword:rational numbers"
"keyword:arithmetic"
"keyword:arbitrary-precision"
"logpath:Bignums"
]
authors: [
"Laurent Théry"
"Benjamin Grégoire"
"Arnaud Spiwack"
"Evgeny Makarov"
"Pierre Letouzey"
]
url {
src: "https://github.com/coq/bignums/archive/V8.13.0.tar.gz"
checksum: "sha512=6ec5c830a6b515c490800609166282da33dd732dded1415f2dfe866feac25cccd86c1d73d4ba48bb61fa234931b4ad57bae40e1726b59bc5d00a860a311f80b7"
}
</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-bignums.8.13.0 coq.8.15.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.15.0).
The following dependencies couldn't be met:
- coq-bignums -> coq < 8.14~ -> ocaml < 4.06.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-bignums.8.13.0</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": "26f89474e6921373804393689420cea0",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 159,
"avg_line_length": 40.99444444444445,
"alnum_prop": 0.5568505217509148,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "8e4be68d371010613bd7050597a6eee3e1e51163",
"size": "7406",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.09.1-2.0.6/released/8.15.0/bignums/8.13.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
var sassToVars = require('./dist');
module.exports = sassToVars;
| {
"content_hash": "21312c3e6ea0f799745a50225b58d133",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 35,
"avg_line_length": 22,
"alnum_prop": 0.7121212121212122,
"repo_name": "XOP/sass-vars-to-js",
"id": "f0a78dba8e6f102b67ce2e0136478ba4db3b9eb5",
"size": "66",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1778"
},
{
"name": "JavaScript",
"bytes": "17374"
}
],
"symlink_target": ""
} |
import mock
import yaml
from nailgun import objects
from nailgun.openstack.common import jsonutils
from nailgun.plugins import attr_plugin
from nailgun.test import base
def get_config(config):
def _get_config(*args):
return mock.mock_open(read_data=yaml.dump(config))()
return _get_config
class BasePluginTest(base.BaseIntegrationTest):
TASKS_CONFIG = [
{'priority': 10,
'role': ['controller'],
'type': 'shell',
'parameters': {'cmd': './lbaas_enable.sh', 'timeout': 42},
'stage': 'post_deployment'},
{'priority': 10,
'role': '*',
'type': 'shell',
'parameters': {'cmd': 'echo all > /tmp/plugin.all', 'timeout': 42},
'stage': 'pre_deployment'}]
def setUp(self):
super(BasePluginTest, self).setUp()
self.sample_plugin = self.env.get_default_plugin_metadata()
self.plugin_env_config = self.env.get_default_plugin_env_config()
def create_plugin(self, sample=None, expect_errors=False):
sample = sample or self.sample_plugin
resp = self.app.post(
base.reverse('PluginCollectionHandler'),
jsonutils.dumps(sample),
headers=self.default_headers,
expect_errors=expect_errors
)
return resp
def delete_plugin(self, plugin_id):
resp = self.app.delete(
base.reverse('PluginHandler', {'obj_id': plugin_id}),
headers=self.default_headers
)
return resp
def create_cluster(self, nodes=None):
nodes = nodes if nodes else []
with mock.patch('nailgun.plugins.attr_plugin.os') as os:
with mock.patch('nailgun.plugins.attr_plugin.open',
create=True) as f_m:
os.access.return_value = True
os.path.exists.return_value = True
f_m.side_effect = get_config(self.plugin_env_config)
self.env.create(
release_kwargs={'version': '2014.2-6.0',
'operating_system': 'Ubuntu'},
nodes_kwargs=nodes)
return self.env.clusters[0]
def default_attributes(self, cluster):
resp = self.app.get(
base.reverse('ClusterAttributesDefaultsHandler',
{'cluster_id': cluster.id}),
headers=self.default_headers)
return resp
def modify_plugin(self, cluster, plugin_name, enabled):
editable_attrs = cluster.attributes.editable
editable_attrs[plugin_name]['metadata']['enabled'] = enabled
resp = self.app.put(
base.reverse('ClusterAttributesHandler',
{'cluster_id': cluster.id}),
jsonutils.dumps({'editable': editable_attrs}),
headers=self.default_headers)
return resp
def enable_plugin(self, cluster, plugin_name):
return self.modify_plugin(cluster, plugin_name, True)
def disable_plugin(self, cluster, plugin_name):
return self.modify_plugin(cluster, plugin_name, False)
def get_pre_hooks(self, cluster):
with mock.patch('nailgun.plugins.attr_plugin.glob') as glob:
glob.glob.return_value = ['/some/path']
with mock.patch('nailgun.plugins.attr_plugin.os') as os:
with mock.patch('nailgun.plugins.attr_plugin.open',
create=True) as f_m:
os.access.return_value = True
os.path.exists.return_value = True
f_m.side_effect = get_config(self.TASKS_CONFIG)
resp = self.app.get(
base.reverse('DefaultPrePluginsHooksInfo',
{'cluster_id': cluster.id}),
headers=self.default_headers)
return resp
def get_post_hooks(self, cluster):
with mock.patch('nailgun.plugins.attr_plugin.os') as os:
with mock.patch('nailgun.plugins.attr_plugin.open',
create=True) as f_m:
os.access.return_value = True
os.path.exists.return_value = True
f_m.side_effect = get_config(self.TASKS_CONFIG)
resp = self.app.get(
base.reverse('DefaultPostPluginsHooksInfo',
{'cluster_id': cluster.id}),
headers=self.default_headers)
return resp
class TestPluginsApi(BasePluginTest):
def test_plugin_created_on_post(self):
resp = self.create_plugin()
self.assertEqual(resp.status_code, 201)
def test_env_create_and_load_env_config(self):
self.create_plugin()
cluster = self.create_cluster()
self.assertIn(self.sample_plugin['name'], cluster.attributes.editable)
def test_enable_disable_plugin(self):
resp = self.create_plugin()
plugin = objects.Plugin.get_by_uid(resp.json['id'])
cluster = self.create_cluster()
self.assertEqual(plugin.clusters, [])
resp = self.enable_plugin(cluster, plugin.name)
self.assertEqual(resp.status_code, 200)
self.assertIn(cluster, plugin.clusters)
resp = self.disable_plugin(cluster, plugin.name)
self.assertEqual(resp.status_code, 200)
self.assertEqual(plugin.clusters, [])
def test_delete_plugin(self):
resp = self.create_plugin()
del_resp = self.delete_plugin(resp.json['id'])
self.assertEqual(del_resp.status_code, 204)
def test_update_plugin(self):
resp = self.create_plugin()
data = resp.json
data['package_version'] = '2.0.0'
plugin_id = data.pop('id')
resp = self.app.put(
base.reverse('PluginHandler', {'obj_id': plugin_id}),
jsonutils.dumps(data),
headers=self.default_headers
)
self.assertEqual(resp.status_code, 200)
updated_data = resp.json
updated_data.pop('id')
self.assertEqual(updated_data, data)
def test_default_attributes_after_plugin_is_created(self):
self.create_plugin()
cluster = self.create_cluster()
default_attributes = self.default_attributes(cluster)
self.assertIn(self.sample_plugin['name'], default_attributes)
def test_plugins_multiversioning(self):
def create_with_version(version):
self.create_plugin(sample=self.env.get_default_plugin_metadata(
name='multiversion_plugin', version=version))
for version in ['1.0.0', '2.0.0', '0.0.1']:
create_with_version(version)
cluster = self.create_cluster()
# Create new plugin after environment is created
create_with_version('5.0.0')
self.enable_plugin(cluster, 'multiversion_plugin')
self.assertEqual(len(cluster.plugins), 1)
enabled_plugin = cluster.plugins[0]
# Should be enabled the newest plugin,
# at the moment of environment creation
self.assertEqual(enabled_plugin.version, '2.0.0')
self.disable_plugin(cluster, 'multiversion_plugin')
self.assertEqual(len(cluster.plugins), 0)
class TestPrePostHooks(BasePluginTest):
def setUp(self):
super(TestPrePostHooks, self).setUp()
resp = self.create_plugin()
self.plugin = attr_plugin.ClusterAttributesPlugin(
objects.Plugin.get_by_uid(resp.json['id']))
self.cluster = self.create_cluster([
{'roles': ['controller'], 'pending_addition': True},
{'roles': ['compute'], 'pending_addition': True}])
self.enable_plugin(self.cluster, self.sample_plugin['name'])
def test_generate_pre_hooks(self):
tasks = self.get_pre_hooks(self.cluster).json
upload_file = [t for t in tasks if t['type'] == 'upload_file']
rsync = [t for t in tasks if t['type'] == 'sync']
cmd_tasks = [t for t in tasks if t['type'] == 'shell']
self.assertEqual(len(upload_file), 1)
self.assertEqual(len(rsync), 1)
self.assertEqual(len(cmd_tasks), 2)
for t in tasks:
#shoud uid be a string
self.assertEqual(
sorted(t['uids']), sorted([n.uid for n in self.cluster.nodes]))
self.assertTrue(t['fail_on_error'])
self.assertEqual(t['diagnostic_name'], self.plugin.full_name)
apt_update = [t for t in cmd_tasks
if u'apt-get update' in t['parameters']['cmd']]
self.assertEqual(len(apt_update), 1)
def test_generate_post_hooks(self):
tasks = self.get_post_hooks(self.cluster).json
self.assertEqual(len(tasks), 1)
task = tasks[0]
controller_id = [n.uid for n in self.cluster.nodes
if 'controller' in n.roles]
self.assertEqual(controller_id, task['uids'])
self.assertTrue(task['fail_on_error'])
self.assertEqual(task['diagnostic_name'], self.plugin.full_name)
class TestPluginValidation(BasePluginTest):
def test_releases_not_provided(self):
sample = {
'name': 'test_name',
'version': '0.1.1',
'fuel_version': ['6.0'],
'title': 'Test plugin',
'package_version': '1.0.0'
}
resp = self.create_plugin(sample=sample, expect_errors=True)
self.assertEqual(resp.status_code, 400)
def test_version_is_not_present_in_release_data(self):
sample = {
'name': 'test_name',
'version': '0.1.1',
'fuel_version': ['6.0'],
'title': 'Test plugin',
'package_version': '1.0.0',
'releases': [
{'os': 'Ubuntu', 'mode': ['ha', 'multinode']}
]
}
resp = self.create_plugin(sample=sample, expect_errors=True)
self.assertEqual(resp.status_code, 400)
def test_plugin_version_is_floating(self):
sample = {
'name': 'test_name',
'title': 'Test plugin',
'version': 1.1,
'fuel_version': ['6.0'],
'package_version': '1.0.0',
'releases': [
{'os': 'Ubuntu',
'mode': ['ha', 'multinode'],
'version': '2014.2.1-5.1'}
]
}
resp = self.create_plugin(sample=sample, expect_errors=True)
self.assertEqual(resp.status_code, 400)
def test_title_is_not_present(self):
sample = {
'name': 'test_name',
'version': '1.1',
'fuel_version': ['6.0'],
'package_version': '1.0.0',
'releases': [
{'os': 'Ubuntu',
'mode': ['multinode'],
'version': '2014.2.1-5.1'}
]
}
resp = self.create_plugin(sample=sample, expect_errors=True)
self.assertEqual(resp.status_code, 400)
| {
"content_hash": "5f274e3fae55bb12a1ec4e8a42b8aa8f",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 79,
"avg_line_length": 38.149825783972126,
"alnum_prop": 0.5656224312722623,
"repo_name": "andrei4ka/fuel-web-redhat",
"id": "70f30564084011a5e343320c1a8940eb348c0fdb",
"size": "11585",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "nailgun/nailgun/test/integration/test_plugins_api.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "100524"
},
{
"name": "JavaScript",
"bytes": "639783"
},
{
"name": "Makefile",
"bytes": "5891"
},
{
"name": "Puppet",
"bytes": "282"
},
{
"name": "Python",
"bytes": "3206343"
},
{
"name": "Ruby",
"bytes": "33423"
},
{
"name": "Shell",
"bytes": "31460"
}
],
"symlink_target": ""
} |
using System;
using System.Windows.Media.Imaging;
namespace ZXing.Presentation
{
/// <summary>
/// A smart class to decode the barcode inside a bitmap object which is derived from BitmapSource
/// </summary>
public class BarcodeReader : BarcodeReaderGeneric<BitmapSource>
{
private static readonly Func<BitmapSource, LuminanceSource> defaultCreateLuminanceSource =
(bitmap) => new BitmapSourceLuminanceSource(bitmap);
/// <summary>
/// Initializes a new instance of the <see cref="BarcodeReader"/> class.
/// </summary>
public BarcodeReader()
: this(new MultiFormatReader(), defaultCreateLuminanceSource, null)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="BarcodeReader"/> class.
/// </summary>
/// <param name="reader">Sets the reader which should be used to find and decode the barcode.
/// If null then MultiFormatReader is used</param>
/// <param name="createLuminanceSource">Sets the function to create a luminance source object for a bitmap.
/// If null, an exception is thrown when Decode is called</param>
/// <param name="createBinarizer">Sets the function to create a binarizer object for a luminance source.
/// If null then HybridBinarizer is used</param>
public BarcodeReader(Reader reader,
Func<BitmapSource, LuminanceSource> createLuminanceSource,
Func<LuminanceSource, Binarizer> createBinarizer
)
: base(reader, createLuminanceSource, createBinarizer)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="BarcodeReader"/> class.
/// </summary>
/// <param name="reader">Sets the reader which should be used to find and decode the barcode.
/// If null then MultiFormatReader is used</param>
/// <param name="createLuminanceSource">Sets the function to create a luminance source object for a bitmap.
/// If null, an exception is thrown when Decode is called</param>
/// <param name="createBinarizer">Sets the function to create a binarizer object for a luminance source.
/// If null then HybridBinarizer is used</param>
public BarcodeReader(Reader reader,
Func<BitmapSource, LuminanceSource> createLuminanceSource,
Func<LuminanceSource, Binarizer> createBinarizer,
Func<byte[], int, int, RGBLuminanceSource.BitmapFormat, LuminanceSource> createRGBLuminanceSource
)
: base(reader, createLuminanceSource, createBinarizer, createRGBLuminanceSource)
{
}
}
}
| {
"content_hash": "f4eb08973adfda0d05ca4665ea45fd91",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 113,
"avg_line_length": 44.30508474576271,
"alnum_prop": 0.6817138485080336,
"repo_name": "renyh1013/dp2",
"id": "47e637abc167bda4b9e8c014f6df1cbab127567f",
"size": "3203",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "zxing_lib/presentation/BarcodeReader.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "219049"
},
{
"name": "Batchfile",
"bytes": "4200"
},
{
"name": "C#",
"bytes": "44914579"
},
{
"name": "CSS",
"bytes": "806240"
},
{
"name": "HTML",
"bytes": "1339609"
},
{
"name": "JavaScript",
"bytes": "379570"
},
{
"name": "PHP",
"bytes": "36009"
},
{
"name": "PowerShell",
"bytes": "87046"
},
{
"name": "Roff",
"bytes": "3758"
},
{
"name": "Smalltalk",
"bytes": "39606"
},
{
"name": "XSLT",
"bytes": "64230"
}
],
"symlink_target": ""
} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>noncopyable</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Chapter 1. Boost.Core">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Core">
<link rel="prev" href="noinit_adaptor.html" title="noinit_adaptor">
<link rel="next" href="null_deleter.html" title="null_deleter">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="noinit_adaptor.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="null_deleter.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="core.noncopyable"></a><a class="link" href="noncopyable.html" title="noncopyable">noncopyable</a>
</h2></div></div></div>
<div class="toc"><dl class="toc"><dt><span class="section"><a href="noncopyable.html#core.noncopyable.header_boost_core_noncopyable_hp">Header
<boost/core/noncopyable.hpp></a></span></dt></dl></div>
<div class="simplesect">
<div class="titlepage"><div><div><h3 class="title">
<a name="idm8751"></a>Authors</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Dave Abrahams
</li></ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="core.noncopyable.header_boost_core_noncopyable_hp"></a><a class="link" href="noncopyable.html#core.noncopyable.header_boost_core_noncopyable_hp" title="Header <boost/core/noncopyable.hpp>">Header
<boost/core/noncopyable.hpp></a>
</h3></div></div></div>
<p>
The header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">noncopyable</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
defines the class <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">noncopyable</span></code>. It is intended to be used
as a private base class. <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">noncopyable</span></code>
has private (under C++03) or deleted (under C++11) copy constructor and a
copy assignment operator and can't be copied or assigned; a class that derives
from it inherits these properties.
</p>
<p>
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">noncopyable</span></code> was originally contributed
by Dave Abrahams.
</p>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="core.noncopyable.header_boost_core_noncopyable_hp.synopsis"></a><a class="link" href="noncopyable.html#core.noncopyable.header_boost_core_noncopyable_hp.synopsis" title="Synopsis">Synopsis</a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span>
<span class="special">{</span>
<span class="keyword">class</span> <span class="identifier">noncopyable</span><span class="special">;</span>
<span class="special">}</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="core.noncopyable.header_boost_core_noncopyable_hp.example"></a><a class="link" href="noncopyable.html#core.noncopyable.header_boost_core_noncopyable_hp.example" title="Example">Example</a>
</h4></div></div></div>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">noncopyable</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="keyword">class</span> <span class="identifier">X</span><span class="special">:</span> <span class="keyword">private</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">noncopyable</span>
<span class="special">{</span>
<span class="special">};</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="core.noncopyable.header_boost_core_noncopyable_hp.rationale"></a><a class="link" href="noncopyable.html#core.noncopyable.header_boost_core_noncopyable_hp.rationale" title="Rationale">Rationale</a>
</h4></div></div></div>
<p>
Class noncopyable has protected constructor and destructor members to emphasize
that it is to be used only as a base class. Dave Abrahams notes concern
about the effect on compiler optimization of adding (even trivial inline)
destructor declarations. He says:
</p>
<p>
<span class="quote">“<span class="quote">Probably this concern is misplaced, because <code class="computeroutput"><span class="identifier">noncopyable</span></code>
will be used mostly for classes which own resources and thus have non-trivial
destruction semantics.</span>”</span>
</p>
<p>
With C++2011, using an optimized and trivial constructor and similar destructor
can be enforced by declaring both and marking them <code class="computeroutput"><span class="keyword">default</span></code>.
This is done in the current implementation.
</p>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2014 Peter Dimov<br>Copyright © 2014 Glen Fernandes<br>Copyright © 2014 Andrey Semashev<p>
Distributed under the <a href="http://boost.org/LICENSE_1_0.txt" target="_top">Boost
Software License, Version 1.0</a>.
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="noinit_adaptor.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="null_deleter.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {
"content_hash": "413c678f25e99bf82bc9bdd81de37184",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 418,
"avg_line_length": 68.50892857142857,
"alnum_prop": 0.6693600938355272,
"repo_name": "wiltonlazary/arangodb",
"id": "f800c181f3d300aaddbe6c368960835d8e347ce9",
"size": "7684",
"binary": false,
"copies": "3",
"ref": "refs/heads/devel",
"path": "3rdParty/boost/1.78.0/libs/core/doc/html/core/noncopyable.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "61827"
},
{
"name": "C",
"bytes": "309788"
},
{
"name": "C++",
"bytes": "34723629"
},
{
"name": "CMake",
"bytes": "383904"
},
{
"name": "CSS",
"bytes": "210549"
},
{
"name": "EJS",
"bytes": "231166"
},
{
"name": "HTML",
"bytes": "23114"
},
{
"name": "JavaScript",
"bytes": "33741286"
},
{
"name": "LLVM",
"bytes": "14975"
},
{
"name": "NASL",
"bytes": "269512"
},
{
"name": "NSIS",
"bytes": "47138"
},
{
"name": "Pascal",
"bytes": "75391"
},
{
"name": "Perl",
"bytes": "9811"
},
{
"name": "PowerShell",
"bytes": "7869"
},
{
"name": "Python",
"bytes": "184352"
},
{
"name": "SCSS",
"bytes": "255542"
},
{
"name": "Shell",
"bytes": "134504"
},
{
"name": "TypeScript",
"bytes": "179074"
},
{
"name": "Yacc",
"bytes": "79620"
}
],
"symlink_target": ""
} |
#ifndef Sd2Card_h
#define Sd2Card_h
/**
* \file
* Sd2Card class
*/
#include "Sd2PinMap.h"
#include "SdInfo.h"
/** Set SCK to max rate of F_CPU/2. See Sd2Card::setSckRate(). */
uint8_t const SPI_FULL_SPEED = 0;
/** Set SCK rate to F_CPU/4. See Sd2Card::setSckRate(). */
uint8_t const SPI_HALF_SPEED = 1;
/** Set SCK rate to F_CPU/8. Sd2Card::setSckRate(). */
uint8_t const SPI_QUARTER_SPEED = 2;
/**
* USE_SPI_LIB: if set, use the SPI library bundled with Arduino IDE, otherwise
* run with a standalone driver for AVR.
*/
#define USE_SPI_LIB
/**
* Define MEGA_SOFT_SPI non-zero to use software SPI on Mega Arduinos.
* Pins used are SS 10, MOSI 11, MISO 12, and SCK 13.
*
* MEGA_SOFT_SPI allows an unmodified Adafruit GPS Shield to be used
* on Mega Arduinos. Software SPI works well with GPS Shield V1.1
* but many SD cards will fail with GPS Shield V1.0.
*/
#define MEGA_SOFT_SPI 0
//------------------------------------------------------------------------------
#if MEGA_SOFT_SPI && (defined(__AVR_ATmega1280__)||defined(__AVR_ATmega2560__))
#define SOFTWARE_SPI
#endif // MEGA_SOFT_SPI
//------------------------------------------------------------------------------
// SPI pin definitions
//
#ifndef SOFTWARE_SPI
// hardware pin defs
/**
* SD Chip Select pin
*
* Warning if this pin is redefined the hardware SS will pin will be enabled
* as an output by init(). An avr processor will not function as an SPI
* master unless SS is set to output mode.
*/
/** The default chip select pin for the SD card is SS. */
uint8_t const SD_CHIP_SELECT_PIN = SS_PIN;
// The following three pins must not be redefined for hardware SPI.
/** SPI Master Out Slave In pin */
uint8_t const SPI_MOSI_PIN = MOSI_PIN;
/** SPI Master In Slave Out pin */
uint8_t const SPI_MISO_PIN = MISO_PIN;
/** SPI Clock pin */
uint8_t const SPI_SCK_PIN = SCK_PIN;
/** optimize loops for hardware SPI */
#ifndef USE_SPI_LIB
#define OPTIMIZE_HARDWARE_SPI
#endif
#else // SOFTWARE_SPI
// define software SPI pins so Mega can use unmodified GPS Shield
/** SPI chip select pin */
uint8_t const SD_CHIP_SELECT_PIN = 10;
/** SPI Master Out Slave In pin */
uint8_t const SPI_MOSI_PIN = 11;
/** SPI Master In Slave Out pin */
uint8_t const SPI_MISO_PIN = 12;
/** SPI Clock pin */
uint8_t const SPI_SCK_PIN = 13;
#endif // SOFTWARE_SPI
//------------------------------------------------------------------------------
/** Protect block zero from write if nonzero */
#define SD_PROTECT_BLOCK_ZERO 1
/** init timeout ms */
uint16_t const SD_INIT_TIMEOUT = 2000;
/** erase timeout ms */
uint16_t const SD_ERASE_TIMEOUT = 10000;
/** read timeout ms */
uint16_t const SD_READ_TIMEOUT = 300;
/** write time out ms */
uint16_t const SD_WRITE_TIMEOUT = 600;
//------------------------------------------------------------------------------
// SD card errors
/** timeout error for command CMD0 */
uint8_t const SD_CARD_ERROR_CMD0 = 0X1;
/** CMD8 was not accepted - not a valid SD card*/
uint8_t const SD_CARD_ERROR_CMD8 = 0X2;
/** card returned an error response for CMD17 (read block) */
uint8_t const SD_CARD_ERROR_CMD17 = 0X3;
/** card returned an error response for CMD24 (write block) */
uint8_t const SD_CARD_ERROR_CMD24 = 0X4;
/** WRITE_MULTIPLE_BLOCKS command failed */
uint8_t const SD_CARD_ERROR_CMD25 = 0X05;
/** card returned an error response for CMD58 (read OCR) */
uint8_t const SD_CARD_ERROR_CMD58 = 0X06;
/** SET_WR_BLK_ERASE_COUNT failed */
uint8_t const SD_CARD_ERROR_ACMD23 = 0X07;
/** card's ACMD41 initialization process timeout */
uint8_t const SD_CARD_ERROR_ACMD41 = 0X08;
/** card returned a bad CSR version field */
uint8_t const SD_CARD_ERROR_BAD_CSD = 0X09;
/** erase block group command failed */
uint8_t const SD_CARD_ERROR_ERASE = 0X0A;
/** card not capable of single block erase */
uint8_t const SD_CARD_ERROR_ERASE_SINGLE_BLOCK = 0X0B;
/** Erase sequence timed out */
uint8_t const SD_CARD_ERROR_ERASE_TIMEOUT = 0X0C;
/** card returned an error token instead of read data */
uint8_t const SD_CARD_ERROR_READ = 0X0D;
/** read CID or CSD failed */
uint8_t const SD_CARD_ERROR_READ_REG = 0X0E;
/** timeout while waiting for start of read data */
uint8_t const SD_CARD_ERROR_READ_TIMEOUT = 0X0F;
/** card did not accept STOP_TRAN_TOKEN */
uint8_t const SD_CARD_ERROR_STOP_TRAN = 0X10;
/** card returned an error token as a response to a write operation */
uint8_t const SD_CARD_ERROR_WRITE = 0X11;
/** attempt to write protected block zero */
uint8_t const SD_CARD_ERROR_WRITE_BLOCK_ZERO = 0X12;
/** card did not go ready for a multiple block write */
uint8_t const SD_CARD_ERROR_WRITE_MULTIPLE = 0X13;
/** card returned an error to a CMD13 status check after a write */
uint8_t const SD_CARD_ERROR_WRITE_PROGRAMMING = 0X14;
/** timeout occurred during write programming */
uint8_t const SD_CARD_ERROR_WRITE_TIMEOUT = 0X15;
/** incorrect rate selected */
uint8_t const SD_CARD_ERROR_SCK_RATE = 0X16;
//------------------------------------------------------------------------------
// card types
/** Standard capacity V1 SD card */
uint8_t const SD_CARD_TYPE_SD1 = 1;
/** Standard capacity V2 SD card */
uint8_t const SD_CARD_TYPE_SD2 = 2;
/** High Capacity SD card */
uint8_t const SD_CARD_TYPE_SDHC = 3;
//------------------------------------------------------------------------------
/**
* \class Sd2Card
* \brief Raw access to SD and SDHC flash memory cards.
*/
class Sd2Card {
public:
/** Construct an instance of Sd2Card. */
Sd2Card(void) : errorCode_(0), inBlock_(0), partialBlockRead_(0), type_(0) {}
uint32_t cardSize(void);
uint8_t erase(uint32_t firstBlock, uint32_t lastBlock);
uint8_t eraseSingleBlockEnable(void);
/**
* \return error code for last error. See Sd2Card.h for a list of error codes.
*/
uint8_t errorCode(void) const {return errorCode_;}
/** \return error data for last error. */
uint8_t errorData(void) const {return status_;}
/**
* Initialize an SD flash memory card with default clock rate and chip
* select pin. See sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin).
*/
uint8_t init(void) {
return init(SPI_FULL_SPEED, SD_CHIP_SELECT_PIN);
}
/**
* Initialize an SD flash memory card with the selected SPI clock rate
* and the default SD chip select pin.
* See sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin).
*/
uint8_t init(uint8_t sckRateID) {
return init(sckRateID, SD_CHIP_SELECT_PIN);
}
uint8_t init(uint8_t sckRateID, uint8_t chipSelectPin, int8_t mosiPin = -1, int8_t misoPin = -1, int8_t clockPin = -1);
void partialBlockRead(uint8_t value);
/** Returns the current value, true or false, for partial block read. */
uint8_t partialBlockRead(void) const {return partialBlockRead_;}
uint8_t readBlock(uint32_t block, uint8_t* dst);
uint8_t readData(uint32_t block,
uint16_t offset, uint16_t count, uint8_t* dst);
/**
* Read a cards CID register. The CID contains card identification
* information such as Manufacturer ID, Product name, Product serial
* number and Manufacturing date. */
uint8_t readCID(cid_t* cid) {
return readRegister(CMD10, cid);
}
/**
* Read a cards CSD register. The CSD contains Card-Specific Data that
* provides information regarding access to the card's contents. */
uint8_t readCSD(csd_t* csd) {
return readRegister(CMD9, csd);
}
void readEnd(void);
uint8_t setSckRate(uint8_t sckRateID);
/** Return the card type: SD V1, SD V2 or SDHC */
uint8_t type(void) const {return type_;}
uint8_t writeBlock(uint32_t blockNumber, const uint8_t* src);
uint8_t writeData(const uint8_t* src);
uint8_t writeStart(uint32_t blockNumber, uint32_t eraseCount);
uint8_t writeStop(void);
void enableCRC(uint8_t mode);
private:
uint32_t block_;
uint8_t chipSelectPin_;
uint8_t errorCode_;
uint8_t inBlock_;
uint16_t offset_;
uint8_t partialBlockRead_;
uint8_t status_;
uint8_t type_;
uint8_t writeCRC_;
// private functions
uint8_t cardAcmd(uint8_t cmd, uint32_t arg) {
cardCommand(CMD55, 0);
return cardCommand(cmd, arg);
}
uint8_t cardCommand(uint8_t cmd, uint32_t arg);
void error(uint8_t code) {errorCode_ = code;}
uint8_t readRegister(uint8_t cmd, void* buf);
uint8_t sendWriteCommand(uint32_t blockNumber, uint32_t eraseCount);
void chipSelectHigh(void);
void chipSelectLow(void);
void type(uint8_t value) {type_ = value;}
uint8_t waitNotBusy(uint16_t timeoutMillis);
uint8_t writeData(uint8_t token, const uint8_t* src);
uint8_t waitStartBlock(void);
};
#endif // Sd2Card_h
| {
"content_hash": "794c5b684e34b626c13c6a5eb2d0a609",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 121,
"avg_line_length": 37.65638766519824,
"alnum_prop": 0.6592185306504446,
"repo_name": "MercerHighAltitudeBalloonProject/Balloon-Code",
"id": "0f76ad73082b2bfe1481e2ced7781d3e519c87db",
"size": "9341",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "Third Party Libraries/SD/utility/Sd2Card.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Arduino",
"bytes": "253347"
},
{
"name": "C",
"bytes": "1158327"
},
{
"name": "C++",
"bytes": "874606"
},
{
"name": "CSS",
"bytes": "33023"
},
{
"name": "HTML",
"bytes": "982724"
},
{
"name": "Java",
"bytes": "10072"
},
{
"name": "JavaScript",
"bytes": "110979"
},
{
"name": "Makefile",
"bytes": "813"
},
{
"name": "Objective-C",
"bytes": "489736"
},
{
"name": "OpenSCAD",
"bytes": "1037"
},
{
"name": "Perl",
"bytes": "2517"
},
{
"name": "Processing",
"bytes": "379860"
},
{
"name": "Shell",
"bytes": "696"
}
],
"symlink_target": ""
} |
<?php declare(strict_types = 1);
namespace DrdPlus\Tests\Tables\Environments;
use DrdPlus\Codes\Environment\ItemStealthinessCode;
use DrdPlus\Tables\Environments\StealthinessTable;
use DrdPlus\Tests\Tables\TableTest;
class StealthinessTableTest extends TableTest
{
/**
* @test
* @dataProvider provideSituationAndExpectedStealthiness
* @param string $itemStealthinessName
* @param int $expectedStealthiness
*/
public function I_can_get_stealthiness_according_to_situation($itemStealthinessName, $expectedStealthiness)
{
self::assertSame(
$expectedStealthiness,
(new StealthinessTable())->getStealthinessOnSituation(ItemStealthinessCode::getIt($itemStealthinessName))
);
}
public function provideSituationAndExpectedStealthiness()
{
$values = [];
$stealthiness = 0;
foreach (ItemStealthinessCode::getPossibleValues() as $itemStealthiness) {
$values[] = [$itemStealthiness, $stealthiness];
$stealthiness += 3;
}
return $values;
}
/**
* @test
*/
public function I_can_not_get_stealthiness_on_unknown_situation()
{
$this->expectException(\DrdPlus\Tables\Environments\Exceptions\UnknownStealthinessCode::class);
$this->expectExceptionMessageMatches('~in showcase~');
(new StealthinessTable())->getStealthinessOnSituation($this->createItemStealthinessCode('in showcase'));
}
/**
* @param string $value
* @return \Mockery\MockInterface|ItemStealthinessCode
*/
private function createItemStealthinessCode($value)
{
$itemStealthinessCode = $this->mockery(ItemStealthinessCode::class);
$itemStealthinessCode->shouldReceive('getValue')
->andReturn($value);
$itemStealthinessCode->shouldReceive('__toString')
->andReturn($value);
return $itemStealthinessCode;
}
} | {
"content_hash": "042dc9bb069feafe553fdff411a80aa8",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 117,
"avg_line_length": 32,
"alnum_prop": 0.6752049180327869,
"repo_name": "jaroslavtyc/drd-plus-tables",
"id": "39d77ef491a6070e31d201ab535861c7be0ee46c",
"size": "1952",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DrdPlus/Tests/Tables/Environments/StealthinessTableTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "1048351"
}
],
"symlink_target": ""
} |
import json
import os
import cloudpickle
import sys
if __name__ == '__main__':
temp_dir = sys.argv[1]
with open(os.path.join(temp_dir, "args.pkl"), 'rb') as f:
args = cloudpickle.load(f)
with open(os.path.join(temp_dir, "target.pkl"), 'rb') as f:
target = cloudpickle.load(f)
history = target(*args)
tf_config = json.loads(os.environ["TF_CONFIG"])
with open(os.path.join(temp_dir,
f"history_{tf_config['task']['index']}"), "wb") as f:
cloudpickle.dump(history, f)
| {
"content_hash": "9d44c4d7218a4f8e8853425ccff9b6d3",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 80,
"avg_line_length": 27.2,
"alnum_prop": 0.5808823529411765,
"repo_name": "yangw1234/BigDL",
"id": "82db9efaa10b216591e0961a4101745ab75870c3",
"size": "1131",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "python/nano/src/bigdl/nano/common/multiprocessing/subprocess_worker.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "5342"
},
{
"name": "Dockerfile",
"bytes": "138760"
},
{
"name": "Java",
"bytes": "1321348"
},
{
"name": "Jupyter Notebook",
"bytes": "54063856"
},
{
"name": "Lua",
"bytes": "1904"
},
{
"name": "Makefile",
"bytes": "19253"
},
{
"name": "PowerShell",
"bytes": "1137"
},
{
"name": "PureBasic",
"bytes": "593"
},
{
"name": "Python",
"bytes": "8762180"
},
{
"name": "RobotFramework",
"bytes": "16117"
},
{
"name": "Scala",
"bytes": "13216038"
},
{
"name": "Shell",
"bytes": "844916"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment></comment>
<entry key="version"></entry>
<entry key="name">Error.amount.format</entry>
<entry key="lastModified">1412842811111</entry>
<entry key="lcid">fr</entry>
<entry key="value">Valeur de quantité non valide</entry>
<entry key="externalKey">281cd041-e986-4394-9d59-e0cb88163310</entry>
</properties>
| {
"content_hash": "b0eb8fbdfc256753097241b850701d18",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 69,
"avg_line_length": 39.63636363636363,
"alnum_prop": 0.7362385321100917,
"repo_name": "webpagebytes/demo-cms-content",
"id": "6ecebc9b876060152bed3e1a9a33a2d3291157de",
"size": "437",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "content/messages/fr/281cd041-e986-4394-9d59-e0cb88163310/metadata.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_60-ea) on Mon Jun 27 14:13:43 EDT 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface org.wildfly.swarm.config.messaging.activemq.server.ClusterConnectionConsumer (WildFly Swarm: Public javadocs 1.0.0.Final API)</title>
<meta name="date" content="2016-06-27">
<link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Interface org.wildfly.swarm.config.messaging.activemq.server.ClusterConnectionConsumer (WildFly Swarm: Public javadocs 1.0.0.Final API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 1.0.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/messaging/activemq/server/class-use/ClusterConnectionConsumer.html" target="_top">Frames</a></li>
<li><a href="ClusterConnectionConsumer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Interface org.wildfly.swarm.config.messaging.activemq.server.ClusterConnectionConsumer" class="title">Uses of Interface<br>org.wildfly.swarm.config.messaging.activemq.server.ClusterConnectionConsumer</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">ClusterConnectionConsumer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.messaging.activemq">org.wildfly.swarm.config.messaging.activemq</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.messaging.activemq.server">org.wildfly.swarm.config.messaging.activemq.server</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.wildfly.swarm.config.messaging.activemq">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">ClusterConnectionConsumer</a> in <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/package-summary.html">org.wildfly.swarm.config.messaging.activemq</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/package-summary.html">org.wildfly.swarm.config.messaging.activemq</a> with parameters of type <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">ClusterConnectionConsumer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/Server.html" title="type parameter in Server">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">Server.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/Server.html#clusterConnection-java.lang.String-org.wildfly.swarm.config.messaging.activemq.server.ClusterConnectionConsumer-">clusterConnection</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> childKey,
<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">ClusterConnectionConsumer</a> consumer)</code>
<div class="block">Create and configure a ClusterConnection object to the list of
subresources</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.wildfly.swarm.config.messaging.activemq.server">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">ClusterConnectionConsumer</a> in <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/package-summary.html">org.wildfly.swarm.config.messaging.activemq.server</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/package-summary.html">org.wildfly.swarm.config.messaging.activemq.server</a> that return <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">ClusterConnectionConsumer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>default <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">ClusterConnectionConsumer</a><<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="type parameter in ClusterConnectionConsumer">T</a>></code></td>
<td class="colLast"><span class="typeNameLabel">ClusterConnectionConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html#andThen-org.wildfly.swarm.config.messaging.activemq.server.ClusterConnectionConsumer-">andThen</a></span>(<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">ClusterConnectionConsumer</a><<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="type parameter in ClusterConnectionConsumer">T</a>> after)</code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/package-summary.html">org.wildfly.swarm.config.messaging.activemq.server</a> with parameters of type <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">ClusterConnectionConsumer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>default <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">ClusterConnectionConsumer</a><<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="type parameter in ClusterConnectionConsumer">T</a>></code></td>
<td class="colLast"><span class="typeNameLabel">ClusterConnectionConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html#andThen-org.wildfly.swarm.config.messaging.activemq.server.ClusterConnectionConsumer-">andThen</a></span>(<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">ClusterConnectionConsumer</a><<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="type parameter in ClusterConnectionConsumer">T</a>> after)</code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/ClusterConnectionConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 1.0.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/messaging/activemq/server/class-use/ClusterConnectionConsumer.html" target="_top">Frames</a></li>
<li><a href="ClusterConnectionConsumer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2016 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "af01e1323b0bfc215a54cb58945bf159",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 765,
"avg_line_length": 63.734299516908216,
"alnum_prop": 0.6805123929356477,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "059bcb8048de9599cb5374d168e27d1764b8683d",
"size": "13193",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "1.0.0.Final/apidocs/org/wildfly/swarm/config/messaging/activemq/server/class-use/ClusterConnectionConsumer.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34011
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace RXL.WPFClient.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
| {
"content_hash": "7d44c0239fa1a1614d3fe921f44465ce",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 151,
"avg_line_length": 41.07692307692308,
"alnum_prop": 0.5814606741573034,
"repo_name": "Gohla/renegadex-launcher",
"id": "b9f3ad21fd078748cc125d32c59a4fb1f0847c74",
"size": "1070",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RXL.WPFClient/Properties/Settings.Designer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "59935"
},
{
"name": "PowerShell",
"bytes": "1108"
}
],
"symlink_target": ""
} |
<?php
return [
'@class' => 'Grav\\Common\\File\\CompiledYamlFile',
'filename' => '/home/ubuntu/workspace/user/plugins/admin/languages/da.yaml',
'modified' => 1508073454,
'data' => [
'PLUGIN_ADMIN' => [
'ADMIN_BETA_MSG' => 'Dette er en beta-udgivelse! Brug i produktionsmiljøer er på egen risiko...',
'ADMIN_REPORT_ISSUE' => 'Har du fundet et problem? Så bedes du rapportere det på GitHub.',
'EMAIL_FOOTER' => '<a href="http://getgrav.org">Drevet af Grav</a> - det moderne fladfil-CMS',
'LOGIN_BTN' => 'Login',
'LOGIN_BTN_FORGOT' => 'Glemt',
'LOGIN_BTN_RESET' => 'Nulstil adgangskode',
'LOGIN_BTN_SEND_INSTRUCTIONS' => 'Send nulstillingsinstruktioner',
'LOGIN_BTN_CLEAR' => 'Ryd formular',
'LOGIN_BTN_CREATE_USER' => 'Opret bruger',
'LOGIN_LOGGED_IN' => 'Du er nu logget ind',
'LOGIN_FAILED' => 'Login fejlede',
'LOGGED_OUT' => 'Du er nu logget ud',
'RESET_NEW_PASSWORD' => 'Skriv venligst en ny adgangskode',
'RESET_LINK_EXPIRED' => 'Nulstillingslinket er udløbet; prøv venligst igen',
'RESET_PASSWORD_RESET' => 'Adgangskoden er blevet nulstillet',
'RESET_INVALID_LINK' => 'Du har benyttet et ugyldigt nulstillingslink; prøv venligst igen',
'FORGOT_INSTRUCTIONS_SENT_VIA_EMAIL' => 'Vejledning i at nulstille din adgangskode er sendt via e-mail til %s',
'FORGOT_FAILED_TO_EMAIL' => 'Kunne ikke sende vejledning via e-mail; prøv venligst igen senere',
'FORGOT_CANNOT_RESET_EMAIL_NO_EMAIL' => 'Kan ikke nulstille adgangskode til %s; der er ikke angivet en e-mail-adresse',
'FORGOT_USERNAME_DOES_NOT_EXIST' => 'Der findes ikke en bruger med brugernavnet <b>%s</b>',
'FORGOT_EMAIL_NOT_CONFIGURED' => 'Kan ikke nulstille adgangskoden. Dette site er ikke konfigureret til at sende e-mails',
'FORGOT_EMAIL_SUBJECT' => '%s Anmodning om nulstilling af adgangskode',
'FORGOT_EMAIL_BODY' => '<h1>Nulstil adgangskode</h1><p>Kære %1$s</p><p><b>%4$s</b> har modtaget en anmodning om at nulstille din adgangskode.</p><p><br /><a href="%2$s" class="btn-primary">Klik her for at nulstille din adgangskode</a><br /><br /></p><p>Alternativt kan du kopiere følgende URL ind i din browsers adressebjælke:</p> <p>%2$s</p><p><br />Med venlig hilsen,<br /><br />%3$s</p>',
'MANAGE_PAGES' => 'Administrer sider',
'CONFIGURATION' => 'Konfiguration',
'PAGES' => 'Sider',
'PLUGINS' => 'Plugins',
'PLUGIN' => 'Plugin',
'THEMES' => 'Temaer',
'LOGOUT' => 'Logud',
'BACK' => 'Tilbage',
'ADD_PAGE' => 'Tilføj side',
'ADD_MODULAR' => 'Tilføj modulær side',
'MOVE' => 'Flyt',
'DELETE' => 'Slet',
'SAVE' => 'Gem',
'NORMAL' => 'Normal',
'EXPERT' => 'Ekspert',
'EXPAND_ALL' => 'Udvid alle',
'COLLAPSE_ALL' => 'Sammenfold alle',
'ERROR' => 'Fejl',
'CLOSE' => 'Luk',
'CANCEL' => 'Annuller',
'CONTINUE' => 'Fortsæt',
'MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_TITLE' => 'Bekræftelse kræves',
'MODAL_CHANGED_DETECTED_TITLE' => 'Ændringer registreret',
'MODAL_CHANGED_DETECTED_DESC' => 'Du har ugemte ændringer. Er du sikker på, at du vil fortsætte uden at gemme?',
'MODAL_DELETE_FILE_CONFIRMATION_REQUIRED_TITLE' => 'Bekræftelse kræves',
'MODAL_DELETE_FILE_CONFIRMATION_REQUIRED_DESC' => 'Er du sikker på, at du vil slette denne fil? Denne handling kan ikke fortrydes.',
'ADD_FILTERS' => 'Tilføj filtre',
'SEARCH_PAGES' => 'Søg efter sider',
'VERSION' => 'Version',
'WAS_MADE_WITH' => 'Blev lavet med',
'BY' => 'Af',
'UPDATE_THEME' => 'Opdater Tema',
'UPDATE_PLUGIN' => 'Opdater Plugin',
'OF_THIS_THEME_IS_NOW_AVAILABLE' => 'af dette tema er nu tilgængelig',
'OF_THIS_PLUGIN_IS_NOW_AVAILABLE' => 'af dette plugin er nu tilgængelig',
'AUTHOR' => 'Forfatter',
'HOMEPAGE' => 'Hjemmeside',
'DEMO' => 'Demo',
'BUG_TRACKER' => 'Sporing af fejl',
'KEYWORDS' => 'Nøgleord',
'LICENSE' => 'Licens',
'DESCRIPTION' => 'Beskrivelse',
'README' => 'Readme',
'REMOVE_THEME' => 'Fjern Tema',
'INSTALL_THEME' => 'Installer Tema',
'THEME' => 'Tema',
'BACK_TO_THEMES' => 'Tilbage til Temaer',
'BACK_TO_PLUGINS' => 'Tilbage til Plugins',
'CHECK_FOR_UPDATES' => 'Søg efter Opdateringer',
'ADD' => 'Tilføj',
'CLEAR_CACHE' => 'Ryd Cache',
'CLEAR_CACHE_ALL_CACHE' => 'Alle Caches',
'CLEAR_CACHE_ASSETS_ONLY' => 'Kun Aktiver',
'CLEAR_CACHE_IMAGES_ONLY' => 'Kun Billeder',
'CLEAR_CACHE_CACHE_ONLY' => 'Kun Cache',
'DASHBOARD' => 'Kontrolpanel',
'UPDATES_AVAILABLE' => 'Opdateringer tilgængelige',
'DAYS' => 'Dage',
'UPDATE' => 'Opdatér',
'BACKUP' => 'Backup',
'STATISTICS' => 'Statistikker',
'TODAY' => 'I dag',
'WEEK' => 'Uge',
'MONTH' => 'Måned',
'LATEST_PAGE_UPDATES' => 'Seneste Sideopdateringer',
'MAINTENANCE' => 'Vedligeholdelse',
'UPDATED' => 'Opdateret',
'MON' => 'Man',
'TUE' => 'Tirs',
'WED' => 'Ons',
'THU' => 'Tors',
'FRI' => 'Fre',
'SAT' => 'Lør',
'SUN' => 'Søn',
'COPY' => 'Kopier',
'EDIT' => 'Rediger',
'CREATE' => 'Opret',
'GRAV_ADMIN' => 'Grav Admin',
'GRAV_OFFICIAL_PLUGIN' => 'Grav Officielt Plugin',
'GRAV_OFFICIAL_THEME' => 'Grav Officielt Tema',
'PLUGIN_SYMBOLICALLY_LINKED' => 'Dette plugin er forbundet med symbolsk link. Ændringer bliver ikke opdaget.',
'THEME_SYMBOLICALLY_LINKED' => 'Dette tema er forbundet med symbolsk link. Ændringer bliver ikke opdaget',
'REMOVE_PLUGIN' => 'Fjern Plugin',
'INSTALL_PLUGIN' => 'Installer Plugin',
'AVAILABLE' => 'Tilgængelig',
'INSTALLED' => 'Installeret',
'INSTALL' => 'Installer',
'ACTIVE_THEME' => 'Aktivt Tema',
'SWITCHING_TO' => 'Skifte til',
'SWITCHING_TO_DESCRIPTION' => 'Der er ingen garanti for, at alle layout-sider understøttes ved skift til et andet tema. Dette kan forårsage fejl når du forsøger at indlæse omtalte sider.',
'SWITCHING_TO_CONFIRMATION' => 'Vil du forsætte og skifte til temaet',
'CREATE_NEW_USER' => 'Opret Ny Bruger',
'REMOVE_USER' => 'Fjern Bruger',
'ACCESS_DENIED' => 'Adgang nægtet',
'ACCOUNT_NOT_ADMIN' => 'din konto har ikke administrator-rettigheder',
'PHP_INFO' => 'PHP-info',
'INSTALLER' => 'Installation',
'AVAILABLE_THEMES' => 'Tilgængelige Temaer',
'AVAILABLE_PLUGINS' => 'Tilgængelige Plugins',
'INSTALLED_THEMES' => 'Installerede Temaer',
'INSTALLED_PLUGINS' => 'Installerede Plugins',
'BROWSE_ERROR_LOGS' => 'Gennemse Fejl-logs',
'SITE' => 'Site',
'INFO' => 'Info',
'SYSTEM' => 'System',
'USER' => 'Bruger',
'ADD_ACCOUNT' => 'Tilføj konto',
'SWITCH_LANGUAGE' => 'Skift Sprog',
'SUCCESSFULLY_ENABLED_PLUGIN' => 'Plugin blev aktiveret',
'SUCCESSFULLY_DISABLED_PLUGIN' => 'Plugin blev deaktiveret',
'SUCCESSFULLY_CHANGED_THEME' => 'Standardtema blev ændret',
'INSTALLATION_FAILED' => 'Installationen fejlede',
'INSTALLATION_SUCCESSFUL' => 'Installation lykkedes',
'UNINSTALL_FAILED' => 'Afinstallationen fejlede',
'UNINSTALL_SUCCESSFUL' => 'Afinstallationen lykkedes',
'SUCCESSFULLY_SAVED' => 'Gemt',
'SUCCESSFULLY_COPIED' => 'Kopieret',
'REORDERING_WAS_SUCCESSFUL' => 'Rækkefølgen blev ændret',
'SUCCESSFULLY_DELETED' => 'Sletningen lykkedes',
'SUCCESSFULLY_SWITCHED_LANGUAGE' => 'Sproget blev ændret',
'INSUFFICIENT_PERMISSIONS_FOR_TASK' => 'Du har ikke tilstrækkelige tilladelser til opgaven',
'CACHE_CLEARED' => 'Cache ryddet',
'METHOD' => 'Metode',
'ERROR_CLEARING_CACHE' => 'Fejl under sletning af cache',
'AN_ERROR_OCCURRED' => 'Der opstod en fejl',
'YOUR_BACKUP_IS_READY_FOR_DOWNLOAD' => 'Din backup er klar til download',
'DOWNLOAD_BACKUP' => 'Download backup',
'PAGES_FILTERED' => 'Filtrerede sider',
'NO_PAGE_FOUND' => 'Ingen side fundet',
'INVALID_PARAMETERS' => 'Ugyldige parametre',
'NO_FILES_SENT' => 'Ingen filer sendt',
'UNKNOWN_ERRORS' => 'Ukendt fejl',
'UNSUPPORTED_FILE_TYPE' => 'Ikke-understøttet filtype',
'FAILED_TO_MOVE_UPLOADED_FILE' => 'Kunne ikke flytte den uploadede fil.',
'FILE_UPLOADED_SUCCESSFULLY' => 'Fil-upload lykkedes',
'FILE_DELETED' => 'Filen blev slettet',
'FILE_COULD_NOT_BE_DELETED' => 'Filen kunne ikke slettes',
'FILE_NOT_FOUND' => 'Filen blev ikke fundet',
'NO_FILE_FOUND' => 'Ingen fil blev fundet',
'GRAV_WAS_SUCCESSFULLY_UPDATED_TO' => 'Grav blev opdateret til',
'GRAV_UPDATE_FAILED' => 'Opdatering af Grav mislykkedes',
'EVERYTHING_UPDATED' => 'Alt opdateret',
'UPDATES_FAILED' => 'Opdateringer mislykkedes',
'AVATAR_BY' => 'Avatar af',
'LAST_BACKUP' => 'Seneste backup',
'FULL_NAME' => 'Fulde navn',
'USERNAME' => 'Brugernavn',
'EMAIL' => 'E-mail',
'PASSWORD' => 'Adgangskode',
'PASSWORD_CONFIRM' => 'Bekræft Adgangskode',
'TITLE' => 'Titel',
'LANGUAGE' => 'Sprog',
'ACCOUNT' => 'Konto',
'EMAIL_VALIDATION_MESSAGE' => 'Skal være en gyldig e-mail-adresse',
'PASSWORD_VALIDATION_MESSAGE' => 'Adgangskoden skal indeholde mindst ét tal og ét stort eller lille bogstav og være mindst otte karakterer langt',
'LANGUAGE_HELP' => 'Angiv det foretrukne sprog',
'MEDIA' => 'Medier',
'DEFAULTS' => 'Standarder',
'SITE_TITLE' => 'Sitets Titel',
'SITE_TITLE_PLACEHOLDER' => 'Titel gældende overordnet for sitet',
'SITE_TITLE_HELP' => 'Sitets standard-titel. Bruges ofte i temaer',
'DEFAULT_AUTHOR' => 'Standard-forfatter',
'DEFAULT_AUTHOR_HELP' => 'Standard-forfatternavn. Bruges ofte i temaer og sideindhold',
'DEFAULT_EMAIL' => 'Standard-e-mail',
'DEFAULT_EMAIL_HELP' => 'En standard-e-mail, som der kan henvises til i temaer og på sider',
'TAXONOMY_TYPES' => 'Taksonomi-typer',
'TAXONOMY_TYPES_HELP' => 'Taksonomi-typer skal defineres her hvis du vil bruge dem på sider',
'PAGE_SUMMARY' => 'Side-resume',
'ENABLED' => 'Aktiveret',
'ENABLED_HELP' => 'Aktiver side-resume (resumeet returnerer det samme som sideindholdet)',
'YES' => 'Ja',
'NO' => 'Nej',
'SUMMARY_SIZE' => 'Resume-længde',
'SUMMARY_SIZE_HELP' => 'Det antal af en sides karakter, som skal bruges som resume',
'FORMAT' => 'Format',
'FORMAT_HELP' => 'kort = brug første forekomst af afgrænser eller størrelse; lang = afgrænser ignoreres',
'SHORT' => 'Kort',
'LONG' => 'Lang',
'DELIMITER' => 'Afgrænser',
'DELIMITER_HELP' => 'Resume-afgrænseren (standard: \'===\')',
'METADATA' => 'Metadata',
'METADATA_HELP' => 'Standard-metadataværdier, som vises på alle sider, medmindre de tilsidesættes af siden',
'NAME' => 'Navn',
'CONTENT' => 'Indhold',
'REDIRECTS_AND_ROUTES' => 'Omdirigeringer og ruter',
'CUSTOM_REDIRECTS' => 'Brugerdefinerede omdirigeringer',
'CUSTOM_REDIRECTS_HELP' => 'ruter til omdirigering til andre sider. Gængse regex-erstatninger kan benyttes',
'CUSTOM_REDIRECTS_PLACEHOLDER_KEY' => '/dit/alias',
'CUSTOM_REDIRECTS_PLACEHOLDER_VALUE' => '/din/omdirigering',
'CUSTOM_ROUTES' => 'Brugerdefinerede ruter',
'CUSTOM_ROUTES_HELP' => 'ruter til alias til andre sider. Gængse regex-erstatninger kan benyttes',
'CUSTOM_ROUTES_PLACEHOLDER_KEY' => '/dit/alias',
'CUSTOM_ROUTES_PLACEHOLDER_VALUE' => '/din/rute',
'FILE_STREAMS' => 'Filstrømme',
'DEFAULT' => 'Standard',
'PAGE_MEDIA' => 'Side-medier',
'OPTIONS' => 'Indstillinger',
'PUBLISHED' => 'Udgivet',
'PUBLISHED_HELP' => 'Som standard offentliggøres en side medmindre du udtrykkeligt sætter published: false eller via en fremtidig publish_date eller fortidig unpublish_date',
'DATE' => 'Dato',
'DATE_HELP' => 'Dato-variablen tillader dig at sætte en specifik dato associeret med denne side.',
'PUBLISHED_DATE' => 'Udgivelsesdato',
'PUBLISHED_DATE_HELP' => 'Kan give en dato for automatisk at udløse udgivelse.',
'UNPUBLISHED_DATE' => 'Afpubliceringsdato',
'UNPUBLISHED_DATE_HELP' => 'Opsætning en dato for automatisk at afpublisere.',
'ROBOTS' => 'Robotter',
'TAXONOMIES' => 'Taksonomier',
'TAXONOMY' => 'Taksonomi',
'ADVANCED' => 'Avanceret',
'SETTINGS' => 'Indstillinger',
'FOLDER_NUMERIC_PREFIX' => 'Numerisk Mappepræfiks',
'FOLDER_NUMERIC_PREFIX_HELP' => 'Numerisk præfiks, der muliggør manuel sortering og indebærer synlighed',
'FOLDER_NAME' => 'Mappenavn',
'FOLDER_NAME_HELP' => 'Mappenavnet, som skal gemmes i filsystemet, for denne side',
'PARENT' => 'Overordnet',
'DEFAULT_OPTION_ROOT' => '- Rod -',
'DEFAULT_OPTION_SELECT' => '- Vælg -',
'DISPLAY_TEMPLATE' => 'Visningsskabelon',
'DISPLAY_TEMPLATE_HELP' => 'Sidetypen, som oversættes til den twig-template, som viser siden',
'BODY_CLASSES' => 'Body-klasser',
'ORDERING' => 'Soreting',
'PAGE_ORDER' => 'Side-sortering',
'OVERRIDES' => 'Tilsidesættelser',
'MENU' => 'Menu',
'MENU_HELP' => 'Den streng, som skal anvendes i en menu. Hvis ingen angives, bruges Title.',
'SLUG' => 'Slug',
'SLUG_HELP' => 'Slug-variablen bruges til specifikt at angive sidens andel af URL\'en',
'SLUG_VALIDATE_MESSAGE' => 'En slug må kun indeholde små alfanumeriske karakterer og bindestreger',
'PROCESS' => 'Processer',
'PROCESS_HELP' => 'Kontroller hvordan sider processeres. Kan angives per side i stedet for globalt',
'DEFAULT_CHILD_TYPE' => 'Standardtitel for underordnede',
'USE_GLOBAL' => 'Anvend Global',
'ROUTABLE' => 'Kan routes',
'ROUTABLE_HELP' => 'Om denne side kan tilgås via en URL',
'CACHING' => 'Caching',
'VISIBLE' => 'Synlig',
'VISIBLE_HELP' => 'Afgør om en side er synlig i navigationen.',
'DISABLED' => 'Deaktiveret',
'ITEMS' => 'Elementer',
'ORDER_BY' => 'Sorter Efter',
'ORDER' => 'Sortering',
'FOLDER' => 'Mappe',
'ASCENDING' => 'Stigende',
'DESCENDING' => 'Faldende',
'ADD_MODULAR_CONTENT' => 'Tilføj Modulært Indhold',
'PAGE_TITLE' => 'Sidetitel',
'PAGE_TITLE_HELP' => 'Sidens titel',
'PAGE' => 'Side',
'MODULAR_TEMPLATE' => 'Modulær Skabelon',
'FRONTMATTER' => 'Forskræp',
'FILENAME' => 'Filnavn',
'PARENT_PAGE' => 'Overordnet Side',
'HOME_PAGE' => 'Hjem-side',
'HOME_PAGE_HELP' => 'Siden som Grav bruger som standard-destinationsside',
'DEFAULT_THEME' => 'Standardtema',
'DEFAULT_THEME_HELP' => 'Gravs standardtema (som udgangspunkt Antimatter)',
'TIMEZONE' => 'Tidszone',
'TIMEZONE_HELP' => 'Tilsidesæt serverens standardtidszone',
'SHORT_DATE_FORMAT' => 'Kort datoformat-visning',
'SHORT_DATE_FORMAT_HELP' => 'Angiv det korte datoformat, der kan bruges af temaer',
'LONG_DATE_FORMAT' => 'Lang datoformat-visning',
'LONG_DATE_FORMAT_HELP' => 'Angiv det lange datoformat, der kan bruges af temaer',
'DEFAULT_ORDERING' => 'Standardsortering',
'DEFAULT_ORDERING_HELP' => 'Sider i en liste bliver vist i denne rækkefølge, medmindre den tilsidesættes',
'DEFAULT_ORDERING_DEFAULT' => 'Standard - baseret på mappenavn',
'DEFAULT_ORDERING_FOLDER' => 'Mappe - baseret på mappenavn uden præfiks',
'DEFAULT_ORDERING_TITLE' => 'Titel - baseret på titel-felt i headeren',
'DEFAULT_ORDERING_DATE' => 'Dato - baseret på dato-felt i headeren',
'DEFAULT_ORDER_DIRECTION' => 'Standard-sorteringsretning',
'DEFAULT_ORDER_DIRECTION_HELP' => 'Den retning, som siderne i en liste skal sorteres i',
'DEFAULT_PAGE_COUNT' => 'Standard-sideantal',
'DEFAULT_PAGE_COUNT_HELP' => 'Standard for maksimalt antal sider i en liste',
'DATE_BASED_PUBLISHING' => 'Datobaseret publicering',
'DATE_BASED_PUBLISHING_HELP' => '(Af)publicer automatisk indhold baseret på dets dato',
'EVENTS' => 'Begivenheder',
'EVENTS_HELP' => 'Aktiver og deaktiver specifikke begivenheder. Deaktivering af disse kan ødelægge plugins',
'REDIRECT_DEFAULT_ROUTE' => 'Standardrute for omdirigeringer',
'REDIRECT_DEFAULT_ROUTE_HELP' => 'Omdiriger automatisk til en sides standardrute',
'LANGUAGES' => 'Sprog',
'SUPPORTED' => 'Understøttet',
'SUPPORTED_HELP' => 'Kommasepareret liste af sprogkoder på hver to bogstaver (f.eks. \'en,da,fr\')',
'TRANSLATIONS_ENABLED' => 'Oversættelser aktiveret',
'TRANSLATIONS_ENABLED_HELP' => 'Understøt oversættelser i Grav, plugins og udvidelser',
'TRANSLATIONS_FALLBACK' => 'Fallback til oversættelser',
'TRANSLATIONS_FALLBACK_HELP' => 'Fallback gennem understøttede oversættelser hvis det aktive sprog ikke findes',
'ACTIVE_LANGUAGE_IN_SESSION' => 'Aktivt sprog i session',
'ACTIVE_LANGUAGE_IN_SESSION_HELP' => 'Gem det aktive sprog i sessionen',
'HTTP_HEADERS' => 'HTTP-headere',
'EXPIRES' => 'Expires',
'EXPIRES_HELP' => 'Indstiller expires-headeren. Værdien angives i sekunder.',
'LAST_MODIFIED' => 'Last modified',
'LAST_MODIFIED_HELP' => 'Angiver "last modified"-headeren, der kan hjælpe med at optimere proxy og browsercachelagring',
'ETAG' => 'ETag',
'ETAG_HELP' => 'Indstiller etag-header til at hjælpe med at identificere, når en side er blevet ændret',
'VARY_ACCEPT_ENCODING' => 'Vary accept encoding',
'VARY_ACCEPT_ENCODING_HELP' => 'Angiver "Vary: Accept Encoding"-headeren, der hjælper med proxy og CDN-cachelagring',
'MARKDOWN_EXTRA_HELP' => 'Aktiver standardunderstøttelse for Markdown Extra - https://michelf.ca/projects/php-markdown/extra/',
'AUTO_LINE_BREAKS' => 'Automatiske linjeskift',
'AUTO_LINE_BREAKS_HELP' => 'Aktiver understøttelse af automatiske linjeskift i markdown',
'AUTO_URL_LINKS' => 'Automatiske URL-links',
'AUTO_URL_LINKS_HELP' => 'Aktiver automatisk konvertering af URL\'er til HTML-hyperlinks',
'ESCAPE_MARKUP' => 'Escape markup',
'ESCAPE_MARKUP_HELP' => 'Escape markup-tags til HMTL-entiteter',
'CACHING_HELP' => 'Global TÆND/SLUK-kontakt til aktivering/deaktivering af Grav-caching',
'CACHE_CHECK_METHOD' => 'Metode til cache-tjek',
'CACHE_CHECK_METHOD_HELP' => 'Angiv den metode, som Grav skal bruge til at tjekke om en side er blevet ændret.',
'CACHE_DRIVER' => 'Cache-driver',
'CACHE_DRIVER_HELP' => 'Angiv hvilken cache-driver, som Grav skal bruge. \'Auto-detekter\' forsøger at finde den bedste for dig',
'CACHE_PREFIX' => 'Cache-præfiks',
'CACHE_PREFIX_HELP' => 'Identifikator for en del af Grav-nøglen. Ændr kun hvis du ved, hvad du laver.',
'CACHE_PREFIX_PLACEHOLDER' => 'Afledt af base-URL\'en (tilsidesæt ved at indtaste en arbitrær streng)',
'LIFETIME' => 'Livstid',
'LIFETIME_HELP' => 'Angiver cache-livstiden i sekunder. 0 = uendelig',
'GZIP_COMPRESSION' => 'Gzip-kompression',
'GZIP_COMPRESSION_HELP' => 'Aktiver GZip-kompression af Grav-siden for øget ydeevne.',
'TWIG_TEMPLATING' => 'Twig-skabeloner',
'TWIG_CACHING' => 'Twig-cache',
'TWIG_CACHING_HELP' => 'Indstil Twigs cache-mekanisme. Lad feltet være aktiveret for at opnå den bedste ydeevne.',
'TWIG_DEBUG' => 'Twig-debug',
'TWIG_DEBUG_HELP' => 'Giver mulighed for ikke at indlæse Twigs debugger-udvidelse',
'DETECT_CHANGES' => 'Registrer ændringer',
'DETECT_CHANGES_HELP' => 'Twig genkompilerer automatisk sin cache hvis den registrerer ændringer i Twig-skabeloner',
'AUTOESCAPE_VARIABLES' => 'Escape automatisk variabler',
'AUTOESCAPE_VARIABLES_HELP' => 'Escaper automatisk alle variabler. Dette vil højst sandsynligt ødelægge dit site',
'ASSETS' => 'Aktiver',
'CSS_PIPELINE' => 'CSS-pipeline',
'CSS_PIPELINE_HELP' => 'CSS-pipelinen forener flere CSS-ressourcer i én fil',
'CSS_PIPELINE_INCLUDE_EXTERNALS' => 'Inkluder eksterne enheder i CSS pipelinen',
'CSS_PIPELINE_INCLUDE_EXTERNALS_HELP' => 'Eksterne URL\'er har, til tider, relative fil referencer, og bør ikke blive pipelinet',
'CSS_PIPELINE_BEFORE_EXCLUDES' => 'Pre-rendering af CSS pipelinen',
'CSS_PIPELINE_BEFORE_EXCLUDES_HELP' => 'Render CSS pipelinen før alle andre CSS referencer, der ikke er inkluderet',
'CSS_MINIFY' => 'CSS-minificering',
'CSS_MINIFY_HELP' => 'Minificer CSS ved brug af pipeline',
'CSS_MINIFY_WINDOWS_OVERRIDE' => 'Tilsidesæt Windows\' CSS-minificering',
'CSS_MINIFY_WINDOWS_OVERRIDE_HELP' => 'Tilsidesættelse af minificering på Windows-platforme. Standard = Fra pga. ThreadStackSize',
'CSS_REWRITE' => 'CSS-omskrivning',
'CSS_REWRITE_HELP' => 'Omskriv relative CSS-URL\'er under pipelining',
'JAVASCRIPT_PIPELINE' => 'Javascript-pipeline',
'JAVASCRIPT_PIPELINE_HELP' => 'JS-pipelinen samler flere JS-ressourcer i én fil',
'JAVASCRIPT_PIPELINE_INCLUDE_EXTERNALS' => 'Inkluder eksterne enheder i JS pipelinen',
'JAVASCRIPT_PIPELINE_INCLUDE_EXTERNALS_HELP' => 'Eksterne URL\'er har, til tider, relative fil referencer, og bør ikke blive pipelinet',
'JAVASCRIPT_PIPELINE_BEFORE_EXCLUDES' => 'Pre-rendering af JS pipelinen',
'JAVASCRIPT_PIPELINE_BEFORE_EXCLUDES_HELP' => 'Render JS pipelinen før alle andre JS referencer, der ikke er inkluderet',
'JAVASCRIPT_MINIFY' => 'Javascript-minificering',
'JAVASCRIPT_MINIFY_HELP' => 'Minificer JS ved brug af pipeline',
'ENABLED_TIMESTAMPS_ON_ASSETS' => 'Aktiver tidsstempler på aktiver',
'ENABLED_TIMESTAMPS_ON_ASSETS_HELP' => 'Aktiver tidsstempler på aktiver',
'COLLECTIONS' => 'Kollektioner',
'ERROR_HANDLER' => 'Fejlbehandler',
'DISPLAY_ERRORS' => 'Visningsfejl',
'DISPLAY_ERRORS_HELP' => 'Vis fuld backtrace på fejlside',
'LOG_ERRORS' => 'Log fejl',
'LOG_ERRORS_HELP' => 'Log fejl i mappen /logs',
'DEBUGGER' => 'Debugger',
'DEBUGGER_HELP' => 'Aktiver Grav-debugger og følgende indstillinger',
'DEBUG_TWIG' => 'Debug Twig',
'DEBUG_TWIG_HELP' => 'Aktiver debugging af Twig-skabeloner',
'SHUTDOWN_CLOSE_CONNECTION' => 'Luk forbindelse ved nedlukning',
'SHUTDOWN_CLOSE_CONNECTION_HELP' => 'Luk forbindelsen inden onShutdown()-kald. Slået fra ved debugging',
'DEFAULT_IMAGE_QUALITY' => 'Standard-billedkvalitet',
'DEFAULT_IMAGE_QUALITY_HELP' => 'Standardbilledkvalitet til brug ved cachelagring af billeder (85%)',
'CACHE_ALL' => 'Cache alle billeder',
'CACHE_ALL_HELP' => 'Kør alle billeder - også ikke-manipulerede - gennem Gravs cache-system',
'IMAGES_DEBUG' => 'Vandmærke ved debugging af billeder',
'IMAGES_DEBUG_HELP' => 'Vis overlejring på billeder. Overlejringen indikerer billedets pixel-dybde til brug ved f.eks. visning på retina-skærme',
'UPLOAD_LIMIT' => 'Upload-grænse',
'UPLOAD_LIMIT_HELP' => 'Angiv den maksimale størrelse af uploadede filer (0 = ubegrænset)',
'ENABLE_MEDIA_TIMESTAMP' => 'Aktiver tidsstempler på medier',
'ENABLE_MEDIA_TIMESTAMP_HELP' => 'Føjer et tidsstempel baseret på sidste ændringsdato til hvert medieemne',
'SESSION' => 'Session',
'SESSION_ENABLED_HELP' => 'Aktiver understøttelse af sessions',
'TIMEOUT' => 'Tidsbegrænsning',
'TIMEOUT_HELP' => 'Angiver sessionstimeout i sekunder',
'SESSION_NAME_HELP' => 'En identifikator, som bruges til at danne navnet på sessionens cookie',
'ABSOLUTE_URLS' => 'Absolutte URL\'er',
'ABSOLUTE_URLS_HELP' => 'Absolutte eller relative URL\'er til \'base_url\'',
'PARAMETER_SEPARATOR' => 'Parameter-separator',
'PARAMETER_SEPARATOR_HELP' => 'Separatoren for bestået parametre, der kan ændres til Apache på Windows',
'TASK_COMPLETED' => 'Opgave fuldført',
'EVERYTHING_UP_TO_DATE' => 'Alt er opdateret',
'UPDATES_ARE_AVAILABLE' => 'opdatering(er) er tilgængelige',
'IS_AVAILABLE_FOR_UPDATE' => 'er tilgængelig for opdatering',
'IS_NOW_AVAILABLE' => 'er nu tilgængelig',
'CURRENT' => 'Nuværende',
'UPDATE_GRAV_NOW' => 'Opdater Grav nu',
'GRAV_SYMBOLICALLY_LINKED' => 'Grav er forbundet med symbolsk link. Opgraderingen vil ikke være tilgængelig',
'UPDATING_PLEASE_WAIT' => 'Opdatering... Vent venligst; downloader',
'OF_THIS' => 'af dette',
'OF_YOUR' => 'af din',
'HAVE_AN_UPDATE_AVAILABLE' => 'har en tilgængelig opdatering',
'SAVE_AS' => 'Gem som',
'MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_DESC' => 'Er du sikker på, at du vil slette denne side og alle dens underordnede? Hvis siden er oversat til andre sprog vil disse oversættelser blive bevaret og skal slettes separat. Ellers bliver sidens mappe og dens undersider slettet. Denne handling kan ikke fortrydes.',
'AND' => 'og',
'UPDATE_AVAILABLE' => 'Opdatering tilgængelig',
'METADATA_KEY' => 'Nøgle (f.eks. \'Nøgleord\')',
'METADATA_VALUE' => 'Værdi (f.eks. \'Blog, Grav\')',
'USERNAME_HELP' => 'Brugernavnet skal være mellem 3 og 16 karakterer og kan indeholde små bogstaver, tal, understreger og bindestreger. Store bogstaver, mellemrum og specielle karakter er ikke tilladt',
'FULLY_UPDATED' => 'Fuldt opdateret',
'SAVE_LOCATION' => 'Gemmeplacering',
'PAGE_FILE' => 'Sideskabelon',
'PAGE_FILE_HELP' => 'Sideskabelon filnavn, og standard visnings-skabelonen for denne side',
'NO_USER_ACCOUNTS' => 'Der blev ikke fundet nogen brugerkonto; opret venligst en først...',
'REDIRECT_TRAILING_SLASH' => 'Omdiriger efterstillet skråstreg',
'REDIRECT_TRAILING_SLASH_HELP' => 'Udfør en 301-omdirigering i stedet for gennemsigtigt at håndtere URI\'er med efterstillet skråstreg.',
'DEFAULT_DATE_FORMAT' => 'Side-datoformat',
'DEFAULT_DATE_FORMAT_HELP' => 'Det side-datoformat, som Grav skal bruge. Som standard forsøger Grav at gætte dit datoformat, men du kan specificeret et format med PHP\'s dato-syntaks (f.eks. Y-m-d H:i)',
'DEFAULT_DATE_FORMAT_PLACEHOLDER' => 'Gæt automatisk',
'IGNORE_FILES' => 'Ignorer filer',
'IGNORE_FILES_HELP' => 'Specifikke filer, som skal ignoreres ved behandlingen af sider',
'IGNORE_FOLDERS' => 'Ignorer mapper',
'IGNORE_FOLDERS_HELP' => 'Specifikke mapper, som skal ignoreres ved behandlingen af sider',
'HTTP_ACCEPT_LANGUAGE' => 'Indstil sprog fra browser',
'HTTP_ACCEPT_LANGUAGE_HELP' => 'Du kan forsøge at indstille sproget på basis af browserens "http_accept_language"-headertag',
'OVERRIDE_LOCALE' => 'Tilsidesæt lokation',
'OVERRIDE_LOCALE_HELP' => 'Tilsidesæt PHP\'s "locale"-indstilling baseret på det nuværende sprog',
'REDIRECT' => 'Side-omdirigering',
'REDIRECT_HELP' => 'Angiv en side-rute eller ekstern URL, som denne side skal omdirigere til, f.eks. "/en/rute" eller "http://etsite.com"',
'PLUGIN_STATUS' => 'Plugin-status',
'INCLUDE_DEFAULT_LANG' => 'Inkluder standardsproget',
'INCLUDE_DEFAULT_LANG_HELP' => 'Dette foranstiller standardsproget i alle standardsprogets URL\'er, f.eks. "/da/blog/mit-indlæg"',
'ALLOW_URL_TAXONOMY_FILTERS' => 'URL-taksonomifiltre',
'ALLOW_URL_TAXONOMY_FILTERS_HELP' => 'Sidebaserede samlingergør det muligt at filtrere via "/taxonomy:værdi".',
'REDIRECT_DEFAULT_CODE' => 'Standardomdirigeringskode',
'REDIRECT_DEFAULT_CODE_HELP' => 'HTTP-statuskode til brug ved omdirigeringer',
'IGNORE_HIDDEN' => 'Ignorer skjulte',
'IGNORE_HIDDEN_HELP' => 'Ignorer alle filer og mapper, der begynder med punktum',
'WRAPPED_SITE' => 'Indpakket site',
'WRAPPED_SITE_HELP' => 'Bruges af temaer/plugins til at bestemme, om Grav er pakket ind i en anden platform',
'FALLBACK_TYPES' => 'Tilladte fallback-typer',
'FALLBACK_TYPES_HELP' => 'Tilladte filtyper, der kan tilgås med en side-rute. Som standard sat til alle understøttede medietyper.',
'INLINE_TYPES' => 'Indlejrede fallback-typer',
'INLINE_TYPES_HELP' => 'En liste over filtyper, der skal vises indlejret i stedet for hentes',
'APPEND_URL_EXT' => 'Tilføj URL-efternavn',
'APPEND_URL_EXT_HELP' => 'Tilføjer et brugerdefineret efternavn til sidens webadresse. Bemærk, at dette vil få Grav til at kigge efter "<skabelon>. <efternavn>. twig"-skabeloner',
'PAGE_MODES' => 'Side-tilstande',
'PAGE_TYPES' => 'Sidetyper',
'ACCESS_LEVELS' => 'Adgangsniveauer',
'GROUPS' => 'Grupper',
'GROUPS_HELP' => 'Liste af grupper, som brugeren er medlem af',
'ADMIN_ACCESS' => 'Administrator-adgang',
'SITE_ACCESS' => 'Site-adgang',
'INVALID_SECURITY_TOKEN' => 'Ugyldig sikkerheds-token',
'ACTIVATE' => 'Aktivér',
'TWIG_UMASK_FIX' => 'Umask-fiks',
'TWIG_UMASK_FIX_HELP' => 'Som standard opretter Twig cachelagrede filer som 0755. Dette fiks skifter det til 0775',
'CACHE_PERMS' => 'Cachelagrings-tilladelser',
'CACHE_PERMS_HELP' => 'Standard-tilladelser til cachelagrings-mappen. Som regel 0755 eller 0775, afhængigt af opsætningen',
'REMOVE_SUCCESSFUL' => 'Sletning lykkedes',
'REMOVE_FAILED' => 'Sletning mislykkedes',
'HIDE_HOME_IN_URLS' => 'Skjul hjem-rute i URL\'er',
'HIDE_HOME_IN_URLS_HELP' => 'Sikrer at standardruterne for enhver side under hjem-siden ikke henviser til hjem-sidens normale rute',
'TWIG_FIRST' => 'Processér Twig først',
'TWIG_FIRST_HELP' => 'Hvis du har aktiveret Twig-behandling af sider kan du konfigurere Twig til at gøre det før eller efter markdown',
'SESSION_SECURE' => 'Sikker',
'SESSION_SECURE_HELP' => 'Angiver, om kommunikation med denne cookie skal ske krypteret. ADVARSEL: Brug kun dette på sites, der kører udelukkende på HTTPS',
'SESSION_HTTPONLY' => 'Kun HTTP',
'SESSION_HTTPONLY_HELP' => 'Hvis denne indstilling er aktiveret bruges cookes kun over HTTP og Javascript-ændringer tillades ikke',
'REVERSE_PROXY' => 'Omvendt proxy',
'REVERSE_PROXY_HELP' => 'Aktiver denne hvis du er bag en omvendt proxy og har problemer med URL\'er, der indeholder ukorrekte porte',
'INVALID_FRONTMATTER_COULD_NOT_SAVE' => 'Ugyldigt forskræp; kunne ikke gemme',
'ADD_FOLDER' => 'Tilføj mappe',
'PROXY_URL' => 'Proxy-URL',
'PROXY_URL_HELP' => 'Indtast proxyens host eller IP og port',
'NOTHING_TO_SAVE' => 'Intet at gemme',
'FILE_ERROR_ADD' => 'Der opstod en fejl under forsøg på at tilføje filen',
'FILE_ERROR_UPLOAD' => 'Der opstod en fejl under forsøget på at uploade filer',
'FILE_UNSUPPORTED' => 'Ikke-understøttet filtype',
'ADD_ITEM' => 'Tilføj element',
'FILE_TOO_LARGE' => 'Filen er for stor til at blive uploadet, maksimal tilladt er %s ifølge <br>dine PHP-indstillinger. Øge din \'post_max_size\' PHP indstilling',
'INSTALLING' => 'Installerer',
'LOADING' => 'Indlæser..',
'DEPENDENCIES_NOT_MET_MESSAGE' => 'De følgende afhængigheder skal være opfyldt først:',
'ERROR_INSTALLING_PACKAGES' => 'Fejl under installering af af pakke(r)',
'INSTALLING_DEPENDENCIES' => 'Installerer afhængigheder...',
'INSTALLING_PACKAGES' => 'Installerer pakke(r)..',
'PACKAGES_SUCCESSFULLY_INSTALLED' => 'Pakke(r) installeret korrekt.',
'READY_TO_INSTALL_PACKAGES' => 'Klar til at installere pakke(r)',
'PACKAGES_NOT_INSTALLED' => 'Pakker ikke installeret',
'PACKAGES_NEED_UPDATE' => 'Pakker allerede installeret, men forældede',
'PACKAGES_SUGGESTED_UPDATE' => 'Pakker allerede installeret, og versionen er i orden, men vil blive opdateret for at holde dig up to date',
'REMOVE_THE' => 'Fjern %s',
'CONFIRM_REMOVAL' => 'Er du sikker på, at du ønsker at slette %s?',
'REMOVED_SUCCESSFULLY' => '%s fjernet korrekt',
'ERROR_REMOVING_THE' => 'Fejl i forsøget på at fjerne %s',
'ADDITIONAL_DEPENDENCIES_CAN_BE_REMOVED' => '%s krævede følgende afhængigheder, som ikke er påkrævet af andre pakker. Hvis du ikke bruger dem, kan du fjerne dem her.',
'READY_TO_UPDATE_PACKAGES' => 'Klar til at opdatere pakke(r)',
'ERROR_UPDATING_PACKAGES' => 'Fejl under opdatering af pakke(r)',
'UPDATING_PACKAGES' => 'Opdaterer pakke(r)..',
'PACKAGES_SUCCESSFULLY_UPDATED' => 'Pakke(r) opdateret korrekt.',
'UPDATING' => 'Updaterer',
'GPM_RELEASES' => 'GPM udgivelser',
'GPM_RELEASES_HELP' => 'Vælg \'Test\' for at installere beta eller testversioner',
'STABLE' => 'Stabil',
'TESTING' => 'Tester',
'FRONTMATTER_PROCESS_TWIG' => 'Processer frontmatter Twig',
'FRONTMATTER_PROCESS_TWIG_HELP' => 'Når aktiveret kan du bruge Twig\'s konfigurationsvariabler i sidens frontmatter',
'FRONTMATTER_IGNORE_FIELDS' => 'Ignorer frontmatter felter',
'FRONTMATTER_IGNORE_FIELDS_HELP' => 'Visse frontmatter felter kan indeholde Twig, men skal ikke behandles. Så som "formularer"',
'PACKAGE_X_INSTALLED_SUCCESSFULLY' => 'Pakke %s installeret',
'NEEDS_GRAV_1_1' => '<i class="fa fa-exclamation-triangle"></i> <strong>du kører Grav v%s</strong>. Du skal opdatere til den nyeste <strong>Grav v1.1.x</strong> version for at sikre kompatibilitet. Dette kan kræve at du skifter til <strong>eksperimentelle GPM udgivelser</strong> i systemkonfigurationen.',
'ORDERING_DISABLED_BECAUSE_PARENT_SETTING_ORDER' => 'Overordnet rækkefølge-indstilling, orden de-aktiveret',
'ORDERING_DISABLED_BECAUSE_PAGE_NOT_VISIBLE' => 'Siden er ikke synlig, orden de-aktiveret',
'ORDERING_DISABLED_BECAUSE_TOO_MANY_SIBLINGS' => 'Sortering af rækkefølge via administrationen er ikke tilgængelig, fordi der er mere end 200 under-elementer',
'CANNOT_ADD_MEDIA_FILES_PAGE_NOT_SAVED' => 'OBS: Du kan ikke tilføje medie-filer før du har gemt siden. Klik på "Gem" øverst',
'CANNOT_ADD_FILES_PAGE_NOT_SAVED' => 'OBS: Siden skal gemmes før du kan tilføje filer til den.',
'DROP_FILES_HERE_TO_UPLOAD' => 'Smid dine filer her eller, <strong>Klik i dette område</strong>',
'INSERT' => 'Indsæt',
'UNDO' => 'Fortryd',
'REDO' => 'Gendan',
'HEADERS' => 'Overskrifter',
'BOLD' => 'Fed',
'ITALIC' => 'Kursiv',
'STRIKETHROUGH' => 'Gennemstreget',
'LINK' => 'Link',
'IMAGE' => 'Billede',
'BLOCKQUOTE' => 'Citatblok',
'UNORDERED_LIST' => 'Usorteret liste',
'ORDERED_LIST' => 'Sorteret liste',
'EDITOR' => 'Editor',
'PREVIEW' => 'Eksempelvisning',
'FULLSCREEN' => 'Fuld skærm',
'MODULAR' => 'Modulær',
'NON_ROUTABLE' => 'Ikke tilgængelig',
'NON_MODULAR' => 'Ikke modulær'
]
]
];
| {
"content_hash": "2acf1279280698ce365adec38efafffd",
"timestamp": "",
"source": "github",
"line_count": 557,
"max_line_length": 403,
"avg_line_length": 68.38599640933573,
"alnum_prop": 0.5942611115486598,
"repo_name": "Nithmr/glugWebsite",
"id": "6301cb8774accefb18454bfa8dec3b5906b07542",
"size": "38365",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cache/compiled/files/d2bf6836fee88f32d545dac961d973a0.yaml.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "571511"
},
{
"name": "HTML",
"bytes": "337508"
},
{
"name": "JavaScript",
"bytes": "244120"
},
{
"name": "Logos",
"bytes": "831"
},
{
"name": "PHP",
"bytes": "1441306"
},
{
"name": "Ruby",
"bytes": "870"
},
{
"name": "Shell",
"bytes": "737"
},
{
"name": "XSLT",
"bytes": "827"
}
],
"symlink_target": ""
} |
History
=======
v0.4.11 (2020-03-31)
--------------------
- Added: Depth dependent velocity variation model
- Added: Output plotting functionality
- Added: Ability to exclude soil type variation from bedrock
v0.4.10 (2020-03-27)
--------------------
- Fixed: Error in SPID variation of G/Gmax
- Added: Scaling during read of SMC and AT2 input motions
v0.4.9 (2020-03-09)
-------------------
- Add InitialVelProfile and CompatVelProfile outputs
v0.4.8 (2019-12-11)
-------------------
- Remove Cython and cyko as dependencies
- Added a numba based Konno-Ohmachi smoothing
v0.4.6 (2019-11-12)
-------------------
- FIXED #11: Dependencies missing on install.
v0.4.5 (2019-10-24)
-------------------
- FIXED #9: Wrong stress for some Menq components.
v0.4.4 (2019-05-22)
-------------------
- Incremented version because of issue with automated builds.
v0.4.3 (2019-05-22)
-------------------
- FIXED: Bug in MANIFEST.in
v0.4.2 (2019-05-22)
-------------------
- Incremented version because of issue with automated builds.
v0.4.1 (2019-05-22)
-------------------
- Fixed strain profile to use ``max_strain``.
- Changed README and HISTORY to markdown.
v0.4.0 (2019-03-11)
-------------------
- Added smoothed FourierAmplitudeSpectrum output.
v0.3.2 (2018-12-02)
-------------------
- Fixed building of docs.
- Removed stickler.
- Version double increment due to pypi naming conflict.
v0.3.0 (2018-11-30)
-------------------
- Converted all damping to decimal.
- Added tests for KishidaSoilType.
- Added tests against Deepsoil.
v0.0.1 (2016-04-30)
-------------------
- First release on PyPI.
| {
"content_hash": "c806fc909721e747336086e2370dc70a",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 62,
"avg_line_length": 24.104477611940297,
"alnum_prop": 0.6024767801857586,
"repo_name": "arkottke/pysra",
"id": "431443a3b4f6f572069e0358d9370bd93446e329",
"size": "1615",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "HISTORY.rst",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Makefile",
"bytes": "2076"
},
{
"name": "Python",
"bytes": "172083"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "33ce768bcb3f8f77002bee1e6396697e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "cac98de07f16ba4c768e38fa68c74bf0768b2032",
"size": "194",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Bromeliaceae/Puya/Puya furfuracea/ Syn. Puya bonplandiana/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
require 'rdf'
class PULStore < RDF::StrictVocabulary('http://princeton.edu/pulstore/terms/')
term :barcode, label: 'Barcode'.freeze, type: 'rdf:Property'.freeze
term :physicalNumber, label: 'Physical Number'.freeze, type: 'rdf:Property'.freeze
term :sortOrder, label: 'Sort Order'.freeze, type: 'rdf:Property'.freeze
term :state, label: 'State'.freeze, type: 'rdf:Property'.freeze
term :suppressed, label: 'Suppressed'.freeze, type: 'rdf:Property'.freeze
end
| {
"content_hash": "98cb5da00876312f21d9f735ee1401f5",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 84,
"avg_line_length": 58.625,
"alnum_prop": 0.7334754797441365,
"repo_name": "pulibrary/plum",
"id": "13748dc32d1ca28e95f7853183668cf60b790e1b",
"size": "469",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "app/models/vocab/pul_store.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "20757"
},
{
"name": "CoffeeScript",
"bytes": "8590"
},
{
"name": "HTML",
"bytes": "174383"
},
{
"name": "JavaScript",
"bytes": "41136"
},
{
"name": "Ruby",
"bytes": "926973"
},
{
"name": "Shell",
"bytes": "719"
},
{
"name": "XSLT",
"bytes": "23018"
}
],
"symlink_target": ""
} |
package de.shadowhunt.subversion.internal.httpv1.v1_3;
import de.shadowhunt.subversion.internal.AbstractRepositoryDeleteIT;
public class RepositoryDeleteIT extends AbstractRepositoryDeleteIT {
private static final Helper HELPER = new Helper();
public RepositoryDeleteIT() {
super(HELPER.getRepositoryA(), HELPER.getTestId());
}
}
| {
"content_hash": "a17a9a3325b33239fc315253fb7409a5",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 68,
"avg_line_length": 27.307692307692307,
"alnum_prop": 0.7690140845070422,
"repo_name": "thrawn-sh/subversion",
"id": "40682c24a42007ccaff308471c0a440c182546de",
"size": "977",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/de/shadowhunt/subversion/internal/httpv1/v1_3/RepositoryDeleteIT.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "2220"
},
{
"name": "Java",
"bytes": "843878"
},
{
"name": "Shell",
"bytes": "41305"
}
],
"symlink_target": ""
} |
package repository;
/**
*
* @author Emil
*/
public class GlobalVariables {
public static final String baseUrl = "http://localhost:8080/";
}
| {
"content_hash": "03f15370d0ee5f0d55dac278c3be0dd1",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 66,
"avg_line_length": 16.444444444444443,
"alnum_prop": 0.6756756756756757,
"repo_name": "sfabriece/PhotoClient",
"id": "e79e77613590ff452cbefbaf44a46e8bd3c017c9",
"size": "148",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/repository/GlobalVariables.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3457"
},
{
"name": "Java",
"bytes": "124994"
}
],
"symlink_target": ""
} |
from unittest import TestCase
from testdoubles.utils import bind_function_to_object
from tests.common.compat import mock
class BindFunctionToObjectTestCase(TestCase):
def test_when_binding_a_function_to_an_object_it_is_available_for_the_object_instance(self):
def f(self):
pass
class Obj(object):
pass
bind_function_to_object(f, Obj)
sut = Obj()
self.assertTrue(hasattr(sut, 'f'), 'Obj has no attribute f')
def test_when_binding_a_function_to_an_object_it_is_callable_on_the_object_instance(self):
def f(self):
pass
class Obj(object):
pass
bind_function_to_object(f, Obj)
sut = Obj()
sut.f()
def test_when_binding_a_function_to_an_object_then_the_object_is_returned(self):
def f(self):
pass
class Obj(object):
pass
actual = bind_function_to_object(f, Obj)
self.assertEqual(actual, Obj)
def test_when_providing_a_non_callable_a_type_error_is_raised(self):
class Obj(object):
pass
with self.assertRaises(TypeError):
bind_function_to_object(mock.sentinel, Obj)
def test_when_providing_a_non_boundable_function_a_value_error_is_raised(self):
def f():
pass
class Obj(object):
pass
with self.assertRaises(ValueError):
bind_function_to_object(f, Obj)
def test_when_providing_a_non_boundable_function_then_the_value_error_message_is_correct(self):
def f():
pass
class Obj(object):
pass
with self.assertRaisesRegexp(ValueError, '%s does not have a self argument' % f):
bind_function_to_object(f, Obj) | {
"content_hash": "223e17061a8e084494e4cb75a87bd2f9",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 99,
"avg_line_length": 25.47142857142857,
"alnum_prop": 0.6029164329781268,
"repo_name": "testsuite/testdoubles",
"id": "11af6157f3a1ca8b933be7a6b8edd5727ccde831",
"size": "1821",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/unit/test_bind_function_to_object.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "17483"
},
{
"name": "Shell",
"bytes": "6466"
}
],
"symlink_target": ""
} |
<?php
namespace Hatchery\Builder\Exception;
use Exception;
/**
* Class InvalidUrlException
*
* @package IssetBV\Hatchery\UrlBundle\Exception
* @author Tim Fennis <[email protected]>
*/
class InvalidUrlException extends Exception
{
/**
* @param string $message
*/
public function __construct($message)
{
parent::__construct($message);
}
}
| {
"content_hash": "d516bbcf45da48906f8c874bd331ce22",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 48,
"avg_line_length": 17.045454545454547,
"alnum_prop": 0.6586666666666666,
"repo_name": "Isset/hatchery-api-client",
"id": "8a64af24aca603ecb3a717e8d410e1b688566656",
"size": "375",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Hatchery/Builder/Exception/InvalidUrlException.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "60696"
}
],
"symlink_target": ""
} |
"""
# UI/UX Authoring Tool
# @license http://www.apache.org/licenses/LICENSE-2.0
# Author @ Jamil Hussain
"""
from django.shortcuts import render
from .forms import AppCreationForm
from .models import (App,ActionLog,Log)
from accounts.models import MyUser
from django.http import HttpResponseRedirect, Http404
from django.db.models import Count, Min, Sum, Avg
from django.utils import timezone
def createApp(request, *args, **kwargs):
form = AppCreationForm(request.POST or None)
if form.is_valid():
form.save()
return HttpResponseRedirect("analytics/overview.html")
return render(request, "analytics/app.html", {"form": form})
def homeView(request):
application_list=App.objects.all()
context = {
"app_list": application_list
}
if not request.user.is_authenticated:
return HttpResponseRedirect("/accounts/login")
else:
return render(request, 'analytics/home.html',context)
def overviewView(request):
actions_logs=ActionLog.objects.all()
logs=Log.objects.filter(visit_time__gt=timezone.now()).exclude(event_category__isnull=True).exclude(event_category__exact='').values('visit_time','event_category','event_name','event_action')
#gd_total= Log.objects.annotate(total_country=Sum('Log__country'))
gb_list= Log.objects.values('country').annotate(Count('country'))
# visits=Log.objects.extra({'visit_time' : "date(visit_time)"}).values('visit_time').annotate(Count('visit_time'))
device_model=Log.objects.exclude(user_agent__isnull=True).exclude(user_agent__exact='').values('user_agent').distinct()
andorid=Log.objects.exclude(user_agent__isnull=True).exclude(user_agent__exact='').filter(user_agent__contains='Android').values('user_agent').count()
other = Log.objects.exclude(user_agent__isnull=True).exclude(user_agent__exact='').exclude(user_agent__contains='Android').values('user_agent').count()
total_visit= Log.objects.all().count()
visits= Log.objects.extra({'vists_date': "date(visit_time)"}).values('vists_date').annotate(count=Count('id'))
user=MyUser.objects.all()
male = MyUser.objects.filter(gender='male')
female = MyUser.objects.filter(gender='female')
context = {
'actionlog':actions_logs,
'log': logs,
'gb_total': gb_list,
'user': user,
'male': male,
'female': female,
'visits' : visits,
'total_visit': total_visit,
'device_model': device_model,
'andorid' : andorid,
'other' : other
}
return render(request, 'analytics/overview.html', context)
def screensView(request):
context = {}
return render(request, 'analytics/screens.html', context)
def eventsView(request):
context = {}
return render(request, 'analytics/events.html', context)
def locationsView(request):
context = {}
return render(request, 'analytics/locations.html', context)
def exceptionsView(request):
context = {}
return render(request, 'analytics/exceptions.html', context)
| {
"content_hash": "acae090d78b266f0b85b0fc9d93f33a9",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 195,
"avg_line_length": 37.49382716049383,
"alnum_prop": 0.6825814948962792,
"repo_name": "ubiquitous-computing-lab/Mining-Minds",
"id": "21dbc250e8ca67e431e51810e410da7251d886f9",
"size": "3037",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "supporting-layer/uiux-authoring-tool/analytics/views.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2388167"
},
{
"name": "CoffeeScript",
"bytes": "87725"
},
{
"name": "HTML",
"bytes": "6002417"
},
{
"name": "Java",
"bytes": "2523276"
},
{
"name": "JavaScript",
"bytes": "35544943"
},
{
"name": "Makefile",
"bytes": "1558"
},
{
"name": "PHP",
"bytes": "874945"
},
{
"name": "PowerShell",
"bytes": "468"
},
{
"name": "Python",
"bytes": "63930"
},
{
"name": "Shell",
"bytes": "3879"
}
],
"symlink_target": ""
} |
extern Stream *mavlink_comm_0_port;
/// MAVLink stream used for ground control communication
extern Stream *mavlink_comm_1_port;
/// MAVLink system definition
extern mavlink_system_t mavlink_system;
/// Send a byte to the nominated MAVLink channel
///
/// @param chan Channel to send to
/// @param ch Byte to send
///
static inline void comm_send_ch(mavlink_channel_t chan, uint8_t ch)
{
switch(chan) {
case MAVLINK_COMM_0:
mavlink_comm_0_port->write(ch);
break;
case MAVLINK_COMM_1:
mavlink_comm_1_port->write(ch);
break;
default:
break;
}
}
/// Read a byte from the nominated MAVLink channel
///
/// @param chan Channel to receive on
/// @returns Byte read
///
static inline uint8_t comm_receive_ch(mavlink_channel_t chan)
{
uint8_t data = 0;
switch(chan) {
case MAVLINK_COMM_0:
data = mavlink_comm_0_port->read();
break;
case MAVLINK_COMM_1:
data = mavlink_comm_1_port->read();
break;
default:
break;
}
return data;
}
/// Check for available data on the nominated MAVLink channel
///
/// @param chan Channel to check
/// @returns Number of bytes available
static inline uint16_t comm_get_available(mavlink_channel_t chan)
{
uint16_t bytes = 0;
switch(chan) {
case MAVLINK_COMM_0:
bytes = mavlink_comm_0_port->available();
break;
case MAVLINK_COMM_1:
bytes = mavlink_comm_1_port->available();
break;
default:
break;
}
return bytes;
}
#define MAVLINK_USE_CONVENIENCE_FUNCTIONS
#include "include/ardupilotmega/mavlink.h"
#endif // GCS_MAVLink_h
| {
"content_hash": "a7e6742fb85075364eda6cd7f5a7174c",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 67,
"avg_line_length": 20.945205479452056,
"alnum_prop": 0.6886854153041203,
"repo_name": "mujtabachang/mew",
"id": "3042553f98d22da2c0f7ea16a89d94c641ff7e45",
"size": "1836",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Arduino/libraries/GCS_MAVLink/GCS_MAVLink.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "17159"
},
{
"name": "C",
"bytes": "999810"
},
{
"name": "C++",
"bytes": "659395"
},
{
"name": "CSS",
"bytes": "893"
},
{
"name": "HTML",
"bytes": "4623"
},
{
"name": "Makefile",
"bytes": "18175"
},
{
"name": "Max",
"bytes": "20254"
},
{
"name": "PHP",
"bytes": "1797"
},
{
"name": "Processing",
"bytes": "186921"
},
{
"name": "Python",
"bytes": "7379"
},
{
"name": "Shell",
"bytes": "862"
},
{
"name": "Visual Basic",
"bytes": "134642"
},
{
"name": "XSLT",
"bytes": "2715"
}
],
"symlink_target": ""
} |
package com.intellij.psi.impl;
import com.intellij.diagnostic.ThreadDumper;
import com.intellij.lang.ASTNode;
import com.intellij.lang.FileASTNode;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.*;
import com.intellij.openapi.application.ex.ApplicationEx;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.diagnostic.Attachment;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.ex.DocumentEx;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.progress.util.StandardProgressIndicatorBase;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.pom.PomManager;
import com.intellij.pom.PomModel;
import com.intellij.pom.event.PomModelEvent;
import com.intellij.pom.impl.PomTransactionBase;
import com.intellij.pom.tree.TreeAspect;
import com.intellij.pom.tree.TreeAspectEvent;
import com.intellij.psi.FileViewProvider;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiLock;
import com.intellij.psi.codeStyle.CodeStyleManager;
import com.intellij.psi.impl.source.PsiFileImpl;
import com.intellij.psi.impl.source.text.DiffLog;
import com.intellij.psi.impl.source.tree.FileElement;
import com.intellij.psi.impl.source.tree.ForeignLeafPsiElement;
import com.intellij.psi.impl.source.tree.TreeUtil;
import com.intellij.psi.text.BlockSupport;
import com.intellij.util.ExceptionUtil;
import com.intellij.util.Function;
import com.intellij.util.Processor;
import com.intellij.util.SmartList;
import com.intellij.util.concurrency.BoundedTaskExecutor;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.HashSetQueue;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
import org.jetbrains.ide.PooledThreadExecutor;
import javax.swing.*;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class DocumentCommitThread implements Runnable, Disposable, DocumentCommitProcessor {
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.DocumentCommitThread");
private final ExecutorService executor = new BoundedTaskExecutor(PooledThreadExecutor.INSTANCE, 1, this);
private final Object lock = new Object();
private final HashSetQueue<CommitTask> documentsToCommit = new HashSetQueue<CommitTask>(); // guarded by lock
private final HashSetQueue<CommitTask> documentsToApplyInEDT = new HashSetQueue<CommitTask>(); // guarded by lock
private final ApplicationEx myApplication;
private volatile boolean isDisposed;
private CommitTask currentTask; // guarded by lock
private boolean myEnabled; // true if we can do commits. set to false temporarily during the write action. guarded by lock
private int runningWriteActions; // accessed in EDT only
public static DocumentCommitThread getInstance() {
return (DocumentCommitThread)ServiceManager.getService(DocumentCommitProcessor.class);
}
public DocumentCommitThread(final ApplicationEx application) {
myApplication = application;
// install listener in EDT to avoid missing events in case we are inside write action right now
application.invokeLater(new Runnable() {
@Override
public void run() {
assert runningWriteActions == 0;
if (application.isDisposed()) return;
assert !application.isWriteAccessAllowed() || application.isUnitTestMode(); // crazy stuff happens in tests, e.g. UIUtil.dispatchInvocationEvents() inside write action
application.addApplicationListener(new ApplicationAdapter() {
@Override
public void beforeWriteActionStart(@NotNull Object action) {
int writeActionsBefore = runningWriteActions++;
if (writeActionsBefore == 0) {
disable("Write action started: " + action);
}
}
@Override
public void writeActionFinished(@NotNull Object action) {
// crazy things happen when running tests, like starting write action in one thread but firing its end in the other
int writeActionsAfter = runningWriteActions = Math.max(0,runningWriteActions-1);
if (writeActionsAfter == 0) {
enable("Write action finished: " + action);
}
else {
if (writeActionsAfter < 0) {
System.err.println("mismatched listeners: " + writeActionsAfter + ";\n==== log==="+log+"\n====end log==="+
";\n=======threaddump====\n" +
ThreadDumper.dumpThreadsToString()+"\n=====END threaddump=======");
assert false;
}
}
}
}, DocumentCommitThread.this);
enable("Listener installed, started");
}
});
}
@Override
public void dispose() {
isDisposed = true;
synchronized (lock) {
documentsToCommit.clear();
}
cancel("Stop thread");
}
private void disable(@NonNls @NotNull Object reason) {
// write action has just started, all commits are useless
synchronized (lock) {
cancel(reason);
myEnabled = false;
}
log(null, "disabled", null, reason);
}
private void enable(@NonNls @NotNull Object reason) {
synchronized (lock) {
myEnabled = true;
wakeUpQueue();
}
log(null, "enabled", null, reason);
}
private void wakeUpQueue() {
if (!isDisposed) {
executor.execute(this);
}
}
private void cancel(@NonNls @NotNull Object reason) {
startNewTask(null, reason);
}
@Override
public void commitAsynchronously(@NotNull final Project project,
@NotNull final Document document,
@NonNls @NotNull Object reason,
@NotNull ModalityState currentModalityState) {
assert !isDisposed : "already disposed";
if (!project.isInitialized()) return;
PsiFile psiFile = PsiDocumentManager.getInstance(project).getCachedPsiFile(document);
if (psiFile == null) return;
doQueue(project, document, getAllFileNodes(psiFile), reason, currentModalityState);
}
@NotNull
private CommitTask doQueue(@NotNull Project project,
@NotNull Document document,
@NotNull List<Pair<PsiFileImpl, FileASTNode>> oldFileNodes,
@NotNull Object reason,
@NotNull ModalityState currentModalityState) {
synchronized (lock) {
CommitTask newTask = createNewTaskAndCancelSimilar(project, document, oldFileNodes, reason, currentModalityState);
documentsToCommit.offer(newTask);
log(project, "Queued", newTask, reason);
wakeUpQueue();
return newTask;
}
}
@NotNull
private CommitTask createNewTaskAndCancelSimilar(@NotNull Project project,
@NotNull Document document,
@NotNull List<Pair<PsiFileImpl, FileASTNode>> oldFileNodes,
@NotNull Object reason,
@NotNull ModalityState currentModalityState) {
synchronized (lock) {
for (Pair<PsiFileImpl, FileASTNode> pair : oldFileNodes) {
assert pair.first.getProject() == project;
}
CommitTask newTask = new CommitTask(project, document, oldFileNodes, createProgressIndicator(), reason, currentModalityState);
cancelAndRemoveFromDocsToCommit(newTask, reason);
cancelAndRemoveCurrentTask(newTask, reason);
cancelAndRemoveFromDocsToApplyInEDT(newTask, reason);
return newTask;
}
}
final StringBuilder log = new StringBuilder();
@SuppressWarnings({"NonConstantStringShouldBeStringBuffer", "StringConcatenationInLoop"})
public void log(Project project, @NonNls String msg, @Nullable CommitTask task, @NonNls Object... args) {
if (true) return;
String indent = new SimpleDateFormat("hh:mm:ss:SSSS").format(new Date()) +
(SwingUtilities.isEventDispatchThread() ? "-(EDT) " :
"-(" + Thread.currentThread()+ " ");
@NonNls
String s = indent + msg + (task == null ? " - " : "; task: " + task);
for (Object arg : args) {
if (!StringUtil.isEmpty(String.valueOf(arg))) {
s += "; "+arg;
if (arg instanceof Document) {
Document document = (Document)arg;
s+= " (\""+StringUtil.first(document.getImmutableCharSequence(), 40, true).toString().replaceAll("\n", " ")+"\")";
}
}
}
if (task != null) {
if (task.indicator.isCanceled()) {
s += "; indicator: " + task.indicator;
}
boolean stillUncommitted = !task.project.isDisposed() &&
((PsiDocumentManagerBase)PsiDocumentManager.getInstance(task.project)).isInUncommittedSet(task.document);
if (stillUncommitted) {
s += "; still uncommitted";
}
Set<Document> uncommitted = project == null || project.isDisposed() ? Collections.<Document>emptySet() :
((PsiDocumentManagerBase)PsiDocumentManager.getInstance(project)).myUncommittedDocuments;
if (!uncommitted.isEmpty()) {
s+= "; uncommitted: "+uncommitted;
}
}
synchronized (lock) {
int size = documentsToCommit.size();
if (size != 0) {
s += " (" + size + " documents still in queue: ";
int i = 0;
for (CommitTask commitTask : documentsToCommit) {
s += commitTask + "; ";
if (++i > 4) {
s += " ... ";
break;
}
}
s += ")";
}
}
System.out.println(s);
synchronized (log) {
log.append(s).append("\n");
if (log.length() > 100000) {
log.delete(0, log.length()-50000);
}
}
}
// cancels all pending commits
@TestOnly
private void cancelAll() {
synchronized (lock) {
String reason = "Cancel all in tests";
cancel(reason);
for (CommitTask commitTask : documentsToCommit) {
commitTask.cancel(reason, this);
log(commitTask.project, "Removed from background queue", commitTask);
}
documentsToCommit.clear();
for (CommitTask commitTask : documentsToApplyInEDT) {
commitTask.cancel(reason, this);
log(commitTask.project, "Removed from EDT apply queue (sync commit called)", commitTask);
}
documentsToApplyInEDT.clear();
CommitTask task = currentTask;
if (task != null) {
cancelAndRemoveFromDocsToCommit(task, reason);
}
cancel("Sync commit intervened");
((BoundedTaskExecutor)executor).clearAndCancelAll();
}
}
@TestOnly
public void clearQueue() {
cancelAll();
clearLog();
wakeUpQueue();
}
private void clearLog() {
synchronized (log) {
log.setLength(0);
}
}
private void cancelAndRemoveCurrentTask(@NotNull CommitTask newTask, @NotNull Object reason) {
CommitTask currentTask = this.currentTask;
if (currentTask != null && currentTask.equals(newTask)) {
cancelAndRemoveFromDocsToCommit(currentTask, reason);
cancel(reason);
}
}
private void cancelAndRemoveFromDocsToApplyInEDT(@NotNull CommitTask newTask, @NotNull Object reason) {
boolean removed = cancelAndRemoveFromQueue(newTask, documentsToApplyInEDT, reason);
if (removed) {
log(newTask.project, "Removed from EDT apply queue", newTask);
}
}
private void cancelAndRemoveFromDocsToCommit(@NotNull final CommitTask newTask, @NotNull Object reason) {
boolean removed = cancelAndRemoveFromQueue(newTask, documentsToCommit, reason);
if (removed) {
log(newTask.project, "Removed from background queue", newTask);
}
}
private static boolean cancelAndRemoveFromQueue(@NotNull CommitTask newTask, @NotNull HashSetQueue<CommitTask> queue, @NotNull Object reason) {
CommitTask queuedTask = queue.find(newTask);
if (queuedTask != null) {
assert queuedTask != newTask;
queuedTask.cancel(reason, getInstance());
}
return queue.remove(newTask);
}
@Override
public void run() {
while (!isDisposed) {
try {
boolean polled = pollQueue();
if (!polled) break;
}
catch(Throwable e) {
LOG.error(e);
}
}
}
// returns true if queue changed
private boolean pollQueue() {
assert !myApplication.isDispatchThread() : Thread.currentThread();
boolean success = false;
Document document = null;
Project project = null;
CommitTask task = null;
Object failureReason = null;
try {
ProgressIndicator indicator;
synchronized (lock) {
if (!myEnabled || (task = documentsToCommit.poll()) == null) {
return false;
}
document = task.document;
indicator = task.indicator;
project = task.project;
if (project.isDisposed() || !((PsiDocumentManagerBase)PsiDocumentManager.getInstance(project)).isInUncommittedSet(document)) {
log(project, "Abandon and proceed to next", task);
return true;
}
if (indicator.isCanceled()) {
return true; // document has been marked as removed, e.g. by synchronous commit
}
startNewTask(task, "Pulled new task");
// transfer to documentsToApplyInEDT
documentsToApplyInEDT.add(task);
}
Runnable finishRunnable = null;
if (indicator.isCanceled()) {
success = false;
}
else {
final CommitTask commitTask = task;
final Ref<Pair<Runnable, Object>> result = new Ref<Pair<Runnable, Object>>();
ProgressManager.getInstance().executeProcessUnderProgress(new Runnable() {
@Override
public void run() {
result.set(commitUnderProgress(commitTask, false));
}
}, commitTask.indicator);
finishRunnable = result.get().first;
success = finishRunnable != null;
failureReason = result.get().second;
}
if (success) {
assert !myApplication.isDispatchThread();
final Runnable finalFinishRunnable = finishRunnable;
final Project finalProject = project;
final TransactionGuardImpl guard = (TransactionGuardImpl)TransactionGuard.getInstance();
final TransactionId transaction = guard.getModalityTransaction(task.myCreationModalityState);
// invokeLater can be removed once transactions are enforced
myApplication.invokeLater(new Runnable() {
@Override
public void run() {
guard.submitTransaction(finalProject, transaction, finalFinishRunnable);
}
}, task.myCreationModalityState);
}
}
catch (ProcessCanceledException e) {
cancel(e + " (cancel reason: "+((UserDataHolder)task.indicator).getUserData(CommitTask.CANCEL_REASON)+")"); // leave queue unchanged
success = false;
failureReason = e;
}
catch (Throwable e) {
LOG.error(log.toString(), e);
cancel(e);
failureReason = ExceptionUtil.getThrowableText(e);
}
final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
if (!success && task != null && documentManager.isUncommited(task.document)) { // sync commit has not intervened
final Document finalDocument = document;
final Project finalProject = project;
List<Pair<PsiFileImpl, FileASTNode>> oldFileNodes =
ApplicationManager.getApplication().runReadAction(new Computable<List<Pair<PsiFileImpl, FileASTNode>>>() {
@Override
public List<Pair<PsiFileImpl, FileASTNode>> compute() {
PsiFile file = finalProject.isDisposed() ? null : documentManager.getPsiFile(finalDocument);
return file == null ? null : getAllFileNodes(file);
}
});
if (oldFileNodes != null) {
doQueue(project, document, oldFileNodes, "re-added on failure: "+failureReason, task.myCreationModalityState);
}
}
synchronized (lock) {
currentTask = null; // do not cancel, it's being invokeLatered
}
return true;
}
@Override
public void commitSynchronously(@NotNull Document document, @NotNull Project project, @NotNull PsiFile psiFile) {
assert !isDisposed;
if (!project.isInitialized() && !project.isDefault()) {
@NonNls String s = project + "; Disposed: "+project.isDisposed()+"; Open: "+project.isOpen();
try {
Disposer.dispose(project);
}
catch (Throwable ignored) {
// do not fill log with endless exceptions
}
throw new RuntimeException(s);
}
List<Pair<PsiFileImpl, FileASTNode>> allFileNodes = getAllFileNodes(psiFile);
Lock documentLock = getDocumentLock(document);
CommitTask task;
synchronized (lock) {
// synchronized to ensure no new similar tasks can start before we hold the document's lock
task = createNewTaskAndCancelSimilar(project, document, allFileNodes, "Sync commit", ModalityState.current());
documentLock.lock();
}
try {
assert !task.indicator.isCanceled();
Pair<Runnable, Object> result = commitUnderProgress(task, true);
Runnable finish = result.first;
log(project, "Committed sync", task, finish, task.indicator);
assert finish != null;
finish.run();
}
finally {
documentLock.unlock();
}
// will wake itself up on write action end
}
@NotNull
private static List<Pair<PsiFileImpl, FileASTNode>> getAllFileNodes(@NotNull PsiFile file) {
return ContainerUtil.map(file.getViewProvider().getAllFiles(), new Function<PsiFile, Pair<PsiFileImpl, FileASTNode>>() {
@Override
public Pair<PsiFileImpl, FileASTNode> fun(PsiFile root) {
return Pair.create((PsiFileImpl)root, root.getNode());
}
});
}
@NotNull
protected ProgressIndicator createProgressIndicator() {
return new StandardProgressIndicatorBase();
}
private void startNewTask(@Nullable CommitTask task, @NotNull Object reason) {
synchronized (lock) { // sync to prevent overwriting
CommitTask cur = currentTask;
if (cur != null) {
cur.cancel(reason, this);
}
currentTask = task;
}
}
// returns (finish commit Runnable (to be invoked later in EDT), null) on success or (null, failure reason) on failure
@NotNull
private Pair<Runnable, Object> commitUnderProgress(@NotNull final CommitTask task, final boolean synchronously) {
if (synchronously) {
assert !task.indicator.isCanceled();
}
final Project project = task.project;
final Document document = task.document;
final PsiDocumentManagerBase documentManager = (PsiDocumentManagerBase)PsiDocumentManager.getInstance(project);
final List<Processor<Document>> finishProcessors = new SmartList<Processor<Document>>();
Runnable runnable = new Runnable() {
@Override
public void run() {
myApplication.assertReadAccessAllowed();
if (project.isDisposed()) return;
Lock lock = getDocumentLock(document);
if (!lock.tryLock()) {
task.cancel("Can't obtain document lock", DocumentCommitThread.this);
return;
}
try {
if (documentManager.isCommitted(document)) return;
if (!task.isStillValid()) {
task.cancel("Task invalidated", DocumentCommitThread.this);
return;
}
FileViewProvider viewProvider = documentManager.getCachedViewProvider(document);
if (viewProvider == null) {
finishProcessors.add(handleCommitWithoutPsi(documentManager, task));
return;
}
for (Pair<PsiFileImpl, FileASTNode> pair : task.myOldFileNodes) {
PsiFileImpl file = pair.first;
if (file.isValid()) {
FileASTNode oldFileNode = pair.second;
Processor<Document> finishProcessor = doCommit(task, file, oldFileNode);
if (finishProcessor != null) {
finishProcessors.add(finishProcessor);
}
}
}
}
finally {
lock.unlock();
}
}
};
if (synchronously) {
runnable.run();
}
else if (!myApplication.tryRunReadAction(runnable)) {
log(project, "Could not start read action", task, myApplication.isReadAccessAllowed(), Thread.currentThread());
return new Pair<Runnable, Object>(null, "Could not start read action");
}
boolean canceled = task.indicator.isCanceled();
assert !synchronously || !canceled;
if (canceled) {
return new Pair<Runnable, Object>(null, "Indicator was canceled");
}
Runnable result = new Runnable() {
@Override
public void run() {
myApplication.assertIsDispatchThread();
boolean committed = project.isDisposed() || documentManager.isCommitted(document);
synchronized (lock) {
documentsToApplyInEDT.remove(task);
if (committed) {
log(project, "Marked as already committed in EDT apply queue, return", task);
return;
}
}
try {
boolean changeStillValid = task.isStillValid();
boolean success = changeStillValid && documentManager.finishCommit(document, finishProcessors, synchronously, task.reason);
if (synchronously) {
assert success;
}
if (!changeStillValid) {
log(project, "document changed; ignore", task);
return;
}
if (synchronously || success) {
assert !documentManager.isInUncommittedSet(document);
}
if (success) {
log(project, "Commit finished", task);
}
else {
// add document back to the queue
commitAsynchronously(project, document, "Re-added back", task.myCreationModalityState);
}
}
catch (Error e) {
System.err.println("Log:" + log);
throw e;
}
}
};
return Pair.create(result, null);
}
@NotNull
private Processor<Document> handleCommitWithoutPsi(@NotNull final PsiDocumentManagerBase documentManager,
@NotNull final CommitTask task) {
return new Processor<Document>() {
@Override
public boolean process(Document document) {
log(task.project, "Finishing without PSI", task);
if (!task.isStillValid() || documentManager.getCachedViewProvider(document) != null) {
return false;
}
documentManager.handleCommitWithoutPsi(document);
return true;
}
};
}
boolean isEnabled() {
synchronized (lock) {
return myEnabled;
}
}
@Override
public String toString() {
return "Document commit thread; application: "+myApplication+"; isDisposed: "+isDisposed+"; myEnabled: "+isEnabled()+"; runningWriteActions: "+runningWriteActions;
}
@TestOnly
public void waitForAllCommits() throws ExecutionException, InterruptedException, TimeoutException {
ApplicationManager.getApplication().assertIsDispatchThread();
assert !ApplicationManager.getApplication().isWriteAccessAllowed();
((BoundedTaskExecutor)executor).waitAllTasksExecuted(100, TimeUnit.SECONDS);
UIUtil.dispatchAllInvocationEvents();
}
private static class CommitTask {
static final Key<Object> CANCEL_REASON = Key.create("CANCEL_REASON");
@NotNull final Document document;
@NotNull final Project project;
private final int modificationSequence; // store initial document modification sequence here to check if it changed later before commit in EDT
// when queued it's not started
// when dequeued it's started
// when failed it's canceled
@NotNull final ProgressIndicator indicator; // progress to commit this doc under.
@NotNull final Object reason;
@NotNull final ModalityState myCreationModalityState;
private final CharSequence myLastCommittedText;
@NotNull final List<Pair<PsiFileImpl, FileASTNode>> myOldFileNodes;
protected CommitTask(@NotNull final Project project,
@NotNull final Document document,
@NotNull final List<Pair<PsiFileImpl, FileASTNode>> oldFileNodes,
@NotNull ProgressIndicator indicator,
@NotNull Object reason,
@NotNull ModalityState currentModalityState) {
this.document = document;
this.project = project;
this.indicator = indicator;
this.reason = reason;
myCreationModalityState = currentModalityState;
myLastCommittedText = PsiDocumentManager.getInstance(project).getLastCommittedText(document);
myOldFileNodes = oldFileNodes;
modificationSequence = ((DocumentEx)document).getModificationSequence();
}
@NonNls
@Override
public String toString() {
return "Doc: " + document + " (\"" + StringUtil.first(document.getImmutableCharSequence(), 40, true).toString().replaceAll("\n", " ") + "\")"
+ (indicator.isCanceled() ? " (Canceled: " + ((UserDataHolder)indicator).getUserData(CANCEL_REASON) + ")":"")
+" Reason: " + reason
+ (isStillValid() ? "" : "; changed: old seq="+modificationSequence+", new seq="+ ((DocumentEx)document).getModificationSequence())
;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof CommitTask)) return false;
CommitTask task = (CommitTask)o;
return document.equals(task.document) && project.equals(task.project);
}
@Override
public int hashCode() {
int result = document.hashCode();
result = 31 * result + project.hashCode();
return result;
}
public boolean isStillValid() {
return ((DocumentEx)document).getModificationSequence() == modificationSequence;
}
private void cancel(@NotNull Object reason, @NotNull DocumentCommitThread commitProcessor) {
if (!indicator.isCanceled()) {
commitProcessor.log(project, "indicator cancel", this);
indicator.cancel();
((UserDataHolder)indicator).putUserData(CANCEL_REASON, reason);
}
}
}
// public for Upsource
@Nullable("returns runnable to execute under write action in AWT to finish the commit")
public Processor<Document> doCommit(@NotNull final CommitTask task,
@NotNull final PsiFile file,
@NotNull final FileASTNode oldFileNode) {
Document document = task.document;
final CharSequence newDocumentText = document.getImmutableCharSequence();
final TextRange changedPsiRange = getChangedPsiRange(file, task.myLastCommittedText, newDocumentText);
if (changedPsiRange == null) {
return null;
}
final Boolean data = document.getUserData(BlockSupport.DO_NOT_REPARSE_INCREMENTALLY);
if (data != null) {
document.putUserData(BlockSupport.DO_NOT_REPARSE_INCREMENTALLY, null);
file.putUserData(BlockSupport.DO_NOT_REPARSE_INCREMENTALLY, data);
}
BlockSupport blockSupport = BlockSupport.getInstance(file.getProject());
final DiffLog diffLog = blockSupport.reparseRange(file, oldFileNode, changedPsiRange, newDocumentText, task.indicator, task.myLastCommittedText);
return new Processor<Document>() {
@Override
public boolean process(Document document) {
FileViewProvider viewProvider = file.getViewProvider();
if (!task.isStillValid() ||
((PsiDocumentManagerBase)PsiDocumentManager.getInstance(file.getProject())).getCachedViewProvider(document) != viewProvider) {
return false; // optimistic locking failed
}
if (file.isPhysical() && !ApplicationManager.getApplication().isWriteAccessAllowed()) {
VirtualFile vFile = viewProvider.getVirtualFile();
LOG.error("Write action expected" +
"; file=" + file + " of " + file.getClass() +
"; file.valid=" + file.isValid() +
"; file.eventSystemEnabled=" + viewProvider.isEventSystemEnabled() +
"; language=" + file.getLanguage() +
"; vFile=" + vFile + " of " + vFile.getClass() +
"; free-threaded=" + PsiDocumentManagerBase.isFreeThreaded(vFile));
}
doActualPsiChange(file, diffLog);
assertAfterCommit(document, file, (FileElement)oldFileNode);
return true;
}
};
}
private static int getLeafMatchingLength(CharSequence leafText, CharSequence pattern, int patternIndex, int finalPatternIndex, int direction) {
int leafIndex = direction == 1 ? 0 : leafText.length() - 1;
int finalLeafIndex = direction == 1 ? leafText.length() - 1 : 0;
int result = 0;
while (leafText.charAt(leafIndex) == pattern.charAt(patternIndex)) {
result++;
if (leafIndex == finalLeafIndex || patternIndex == finalPatternIndex) {
break;
}
leafIndex += direction;
patternIndex += direction;
}
return result;
}
private static int getMatchingLength(@NotNull FileElement treeElement, @NotNull CharSequence text, boolean fromStart) {
int patternIndex = fromStart ? 0 : text.length() - 1;
int finalPatternIndex = fromStart ? text.length() - 1 : 0;
int direction = fromStart ? 1 : -1;
ASTNode leaf = fromStart ? TreeUtil.findFirstLeaf(treeElement, false) : TreeUtil.findLastLeaf(treeElement, false);
int result = 0;
while (leaf != null && (fromStart ? patternIndex <= finalPatternIndex : patternIndex >= finalPatternIndex)) {
if (!(leaf instanceof ForeignLeafPsiElement)) {
CharSequence chars = leaf.getChars();
if (chars.length() > 0) {
int matchingLength = getLeafMatchingLength(chars, text, patternIndex, finalPatternIndex, direction);
result += matchingLength;
if (matchingLength != chars.length()) {
break;
}
patternIndex += fromStart ? matchingLength : -matchingLength;
}
}
leaf = fromStart ? TreeUtil.nextLeaf(leaf, false) : TreeUtil.prevLeaf(leaf, false);
}
return result;
}
@Nullable
public static TextRange getChangedPsiRange(@NotNull PsiFile file, @NotNull FileElement treeElement, @NotNull CharSequence newDocumentText) {
int psiLength = treeElement.getTextLength();
if (!file.getViewProvider().supportsIncrementalReparse(file.getLanguage())) {
return new TextRange(0, psiLength);
}
int commonPrefixLength = getMatchingLength(treeElement, newDocumentText, true);
if (commonPrefixLength == newDocumentText.length() && newDocumentText.length() == psiLength) {
return null;
}
int commonSuffixLength = Math.min(getMatchingLength(treeElement, newDocumentText, false), psiLength - commonPrefixLength);
return new TextRange(commonPrefixLength, psiLength - commonSuffixLength);
}
@Nullable
private static TextRange getChangedPsiRange(@NotNull PsiFile file,
@NotNull CharSequence oldDocumentText,
@NotNull CharSequence newDocumentText) {
int psiLength = oldDocumentText.length();
if (!file.getViewProvider().supportsIncrementalReparse(file.getLanguage())) {
return new TextRange(0, psiLength);
}
int commonPrefixLength = StringUtil.commonPrefixLength(oldDocumentText, newDocumentText);
if (commonPrefixLength == newDocumentText.length() && newDocumentText.length() == psiLength) {
return null;
}
int commonSuffixLength = Math.min(StringUtil.commonSuffixLength(oldDocumentText, newDocumentText), psiLength - commonPrefixLength);
return new TextRange(commonPrefixLength, psiLength - commonSuffixLength);
}
public static void doActualPsiChange(@NotNull final PsiFile file, @NotNull final DiffLog diffLog) {
CodeStyleManager.getInstance(file.getProject()).performActionWithFormatterDisabled(new Runnable() {
@Override
public void run() {
synchronized (PsiLock.LOCK) {
file.getViewProvider().beforeContentsSynchronized();
final Document document = file.getViewProvider().getDocument();
PsiDocumentManagerBase documentManager = (PsiDocumentManagerBase)PsiDocumentManager.getInstance(file.getProject());
PsiToDocumentSynchronizer.DocumentChangeTransaction transaction = documentManager.getSynchronizer().getTransaction(document);
final PsiFileImpl fileImpl = (PsiFileImpl)file;
if (transaction == null) {
final PomModel model = PomManager.getModel(fileImpl.getProject());
model.runTransaction(new PomTransactionBase(fileImpl, model.getModelAspect(TreeAspect.class)) {
@Override
public PomModelEvent runInner() {
return new TreeAspectEvent(model, diffLog.performActualPsiChange(file));
}
});
}
else {
diffLog.performActualPsiChange(file);
}
}
}
});
}
private void assertAfterCommit(@NotNull Document document, @NotNull final PsiFile file, @NotNull FileElement oldFileNode) {
if (oldFileNode.getTextLength() != document.getTextLength()) {
final String documentText = document.getText();
String fileText = file.getText();
boolean sameText = Comparing.equal(fileText, documentText);
LOG.error("commitDocument() left PSI inconsistent: " + DebugUtil.diagnosePsiDocumentInconsistency(file, document) +
"; node.length=" + oldFileNode.getTextLength() +
"; doc.text" + (sameText ? "==" : "!=") + "file.text",
new Attachment("file psi text", fileText),
new Attachment("old text", documentText));
file.putUserData(BlockSupport.DO_NOT_REPARSE_INCREMENTALLY, Boolean.TRUE);
try {
BlockSupport blockSupport = BlockSupport.getInstance(file.getProject());
final DiffLog diffLog = blockSupport.reparseRange(file, file.getNode(), new TextRange(0, documentText.length()), documentText, createProgressIndicator(),
oldFileNode.getText());
doActualPsiChange(file, diffLog);
if (oldFileNode.getTextLength() != document.getTextLength()) {
LOG.error("PSI is broken beyond repair in: " + file);
}
}
finally {
file.putUserData(BlockSupport.DO_NOT_REPARSE_INCREMENTALLY, null);
}
}
}
/**
* @return an internal lock object to prevent read & write phases of commit from running simultaneously for free-threaded PSI
*/
private static Lock getDocumentLock(Document document) {
Lock lock = document.getUserData(DOCUMENT_LOCK);
return lock != null ? lock : ((UserDataHolderEx)document).putUserDataIfAbsent(DOCUMENT_LOCK, new ReentrantLock());
}
private static final Key<Lock> DOCUMENT_LOCK = Key.create("DOCUMENT_LOCK");
}
| {
"content_hash": "fd1536b279af3a4f723b5ad166f3c37c",
"timestamp": "",
"source": "github",
"line_count": 933,
"max_line_length": 175,
"avg_line_length": 38.72990353697749,
"alnum_prop": 0.6564826345648264,
"repo_name": "salguarnieri/intellij-community",
"id": "bbff39c7d03eb80190f62f87947f7d2b396f2047",
"size": "36735",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "platform/core-impl/src/com/intellij/psi/impl/DocumentCommitThread.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AMPL",
"bytes": "20665"
},
{
"name": "AspectJ",
"bytes": "182"
},
{
"name": "Batchfile",
"bytes": "63554"
},
{
"name": "C",
"bytes": "214994"
},
{
"name": "C#",
"bytes": "1538"
},
{
"name": "C++",
"bytes": "190765"
},
{
"name": "CSS",
"bytes": "164277"
},
{
"name": "CoffeeScript",
"bytes": "1759"
},
{
"name": "Cucumber",
"bytes": "14382"
},
{
"name": "Erlang",
"bytes": "10"
},
{
"name": "FLUX",
"bytes": "57"
},
{
"name": "Groff",
"bytes": "35232"
},
{
"name": "Groovy",
"bytes": "2364806"
},
{
"name": "HTML",
"bytes": "1755457"
},
{
"name": "J",
"bytes": "5050"
},
{
"name": "Java",
"bytes": "153383814"
},
{
"name": "JavaScript",
"bytes": "141020"
},
{
"name": "Kotlin",
"bytes": "1297292"
},
{
"name": "Lex",
"bytes": "166321"
},
{
"name": "Makefile",
"bytes": "2352"
},
{
"name": "NSIS",
"bytes": "88100"
},
{
"name": "Objective-C",
"bytes": "28878"
},
{
"name": "Perl6",
"bytes": "26"
},
{
"name": "Protocol Buffer",
"bytes": "6570"
},
{
"name": "Python",
"bytes": "23157608"
},
{
"name": "Ruby",
"bytes": "1213"
},
{
"name": "Scala",
"bytes": "11698"
},
{
"name": "Shell",
"bytes": "64014"
},
{
"name": "Smalltalk",
"bytes": "64"
},
{
"name": "TeX",
"bytes": "62325"
},
{
"name": "TypeScript",
"bytes": "6152"
},
{
"name": "XSLT",
"bytes": "113040"
}
],
"symlink_target": ""
} |
module DryCrud
module Table
# Provides headers with sort links. Expects a method :sortable?(attr)
# in the template/controller to tell if an attribute is sortable or not.
# Extracted into an own module for convenience.
module Sorting
# Create a header with sort links and a mark for the current sort
# direction.
def sort_header(attr, label = nil)
label ||= attr_header(attr)
template.link_to(label, sort_params(attr)) + current_mark(attr)
end
# Same as :attrs, except that it renders a sort link in the header
# if an attr is sortable.
def sortable_attrs(*attrs)
attrs.each { |a| sortable_attr(a) }
end
# Renders a sort link header, otherwise similar to :attr.
def sortable_attr(a, header = nil, &block)
if template.sortable?(a)
attr(a, sort_header(a, header), &block)
else
attr(a, header, &block)
end
end
private
# Request params for the sort link.
def sort_params(attr)
result = params.respond_to?(:to_unsafe_h) ? params.to_unsafe_h : params
result.merge(sort: attr, sort_dir: sort_dir(attr), only_path: true)
end
# The sort mark, if any, for the given attribute.
def current_mark(attr)
if current_sort?(attr)
# rubocop:disable Rails/OutputSafety
(sort_dir(attr) == 'asc' ? ' ↑' : ' ↓').html_safe
# rubocop:enable Rails/OutputSafety
else
''
end
end
# Returns true if the given attribute is the current sort column.
def current_sort?(attr)
params[:sort] == attr.to_s
end
# The sort direction to use in the sort link for the given attribute.
def sort_dir(attr)
current_sort?(attr) && params[:sort_dir] == 'asc' ? 'desc' : 'asc'
end
# Delegate to template.
def params
template.params
end
end
end
end
| {
"content_hash": "044c338477564a511ec04467c92d4005",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 79,
"avg_line_length": 29.53731343283582,
"alnum_prop": 0.5962607377463366,
"repo_name": "amaierhofer/dry_crud",
"id": "2328601580e58c437a35ef3e0b3dbb974e370ad2",
"size": "1998",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/helpers/dry_crud/table/sorting.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5066"
},
{
"name": "HTML",
"bytes": "11869"
},
{
"name": "Ruby",
"bytes": "227317"
}
],
"symlink_target": ""
} |
package net.sf.mmm.util.component.api;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* {@link ComponentSpecification} is used to annotate the specification (should be an interface) of a
* component (or better a part of it). It acts only for the purpose of documentation and has no functional
* impact. However it will say that you can get one (or {@link #plugin() multiple}) instance(s) of this
* specification via {@link javax.inject.Inject injection}. <br>
* If you find this:
*
* <pre>
* @{@link ComponentSpecification}
* public interface MyComponent { ... }
* </pre>
*
* and
*
* <pre>
* @{@link ComponentSpecification}({@link #plugin() plugin}=true)
* public interface MyPlugin { ... }
* </pre>
*
* Then you can simply do this in your code:
*
* <pre>
* @{@link javax.inject.Named}
* public class MyClass {
* ...
* @{@link javax.inject.Inject}
* public void setMyComponent(MyComponent component) { ... }
* ...
* @{@link javax.inject.Inject}
* public void setMyPlugins({@link java.util.List}<MyPlugins> plugins) { ... }
*
* }
* </pre>
*
* For simplicity all implementations of such component in this project have to be
* {@link javax.inject.Singleton stateless} and thread-safe. Otherwise this has to be documented as an
* explicit WARNING.
*
* @see net.sf.mmm.util.component.api.Ioc
*
* @deprecated will be removed in some future release.
* @author Joerg Hohwiller (hohwille at users.sourceforge.net)
* @since 2.0.0 (moved in 3.1.0)
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface ComponentSpecification {
/**
* {@code true} if multiple implementations of this "component" are (potentially) expected at a time. In
* this case it is typically some sort of plugin that should be {@link javax.inject.Inject injected} to a
* list of the annotated type.
*/
boolean plugin() default false;
}
| {
"content_hash": "55ab0f50188174f7449795fc3e73ffd4",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 107,
"avg_line_length": 31.757575757575758,
"alnum_prop": 0.7013358778625954,
"repo_name": "m-m-m/util",
"id": "079c859703b6aa98c8ebb96338697c10d90ee157",
"size": "2224",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/src/main/java/net/sf/mmm/util/component/api/ComponentSpecification.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "116"
},
{
"name": "HTML",
"bytes": "57"
},
{
"name": "Java",
"bytes": "4988376"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/empty_users"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible"
tools:viewBindingIgnore="true">
<ImageView
android:id="@+id/placeholderIcon"
android:layout_width="@dimen/placeholders_image_width"
android:layout_height="wrap_content"
android:src="@drawable/ic_empty"
android:adjustViewBounds="true"
android:contentDescription="@string/empty_user_title"
app:layout_constraintBottom_toTopOf="@+id/placeholderMessage"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
<TextView
android:id="@+id/placeholderMessage"
style="@style/PlaceholderTextViewStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="@dimen/padding_placeholders"
android:text="@string/empty_user_title"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/placeholderIcon" />
</androidx.constraintlayout.widget.ConstraintLayout> | {
"content_hash": "aab1216e34913774f16f712238698e84",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 69,
"avg_line_length": 42.972972972972975,
"alnum_prop": 0.7025157232704402,
"repo_name": "StepicOrg/stepik-android",
"id": "525f294ed4bf621f27280288a6999f447e4dfe60",
"size": "1590",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/src/main/res/layout/error_user_not_found.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "5482"
},
{
"name": "Java",
"bytes": "1001894"
},
{
"name": "Kotlin",
"bytes": "4272355"
},
{
"name": "Prolog",
"bytes": "98"
},
{
"name": "Shell",
"bytes": "618"
}
],
"symlink_target": ""
} |
describe("Ext.button.Segmented", function() {
var button;
function makeButton(cfg) {
button = Ext.create(Ext.apply({
xtype: 'segmentedbutton',
renderTo: document.body
}, cfg));
}
function clickButton(index) {
jasmine.fireMouseEvent(button.items.getAt(index).el, 'click');
}
afterEach(function() {
button.destroy();
});
describe("value", function() {
describe("allowMultiple:false", function() {
function makeButton(cfg) {
button = Ext.create(Ext.apply({
xtype: 'segmentedbutton',
renderTo: document.body,
items: [
{ text: 'Foo', value: 'foo' },
{ text: 'Bar' }
]
}, cfg));
}
it("should initialize with a null value", function() {
makeButton();
expect(button.getValue()).toBeNull();
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(false);
});
it("should initialize with a value", function() {
makeButton({
value: 'foo'
});
expect(button.getValue()).toBe('foo');
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(false);
});
it("should initialize with an index value", function() {
makeButton({
value: 1
});
expect(button.getValue()).toBe(1);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(true);
});
it("should set a null value", function() {
makeButton({
value: 'foo'
});
button.setValue(null);
expect(button.getValue()).toBe(null);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(false);
});
it("should set a value", function() {
makeButton();
button.setValue('foo');
expect(button.getValue()).toBe('foo');
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(false);
});
it("should set an index value", function() {
makeButton();
button.setValue(1);
expect(button.getValue()).toBe(1);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(true);
});
it("should set the value if a button is initialized with pressed:true", function() {
makeButton({
items: [{
text: 'Foo',
value: 'foo',
pressed: true
}]
});
expect(button.getValue()).toBe('foo');
expect(button.items.getAt(0).pressed).toBe(true);
});
it("should set the index value if a button with no value is initialized with pressed:true", function() {
makeButton({
items: [{
text: 'Foo'
}, {
text: 'Bar',
pressed: true
}]
});
expect(button.getValue()).toBe(1);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(true);
});
it("should set the value when a button is pressed by the user", function() {
makeButton();
clickButton(0);
expect(button.getValue()).toBe('foo');
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(false);
clickButton(1);
expect(button.getValue()).toBe(1);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(true);
});
it("should transform an index into a value if button value is available", function() {
makeButton();
// button at index 0 has a value of 'foo' so 0 will be transformed to 'foo'
button.setValue(0);
expect(button.getValue()).toBe('foo');
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(false);
});
it("should throw an error if multiple values are set", function() {
makeButton();
expect(function () {
button.setValue(['foo', 1]);
}).toThrow("Cannot set multiple values when allowMultiple is false");
});
it("should throw an error if no button value is matched", function() {
makeButton({
id: 'my-button'
});
expect(function () {
button.setValue('blah');
}).toThrow("Invalid value 'blah' for segmented button: 'my-button'");
});
it("should thow an error if index value is out of bounds", function() {
makeButton({
id: 'my-button'
});
expect(function () {
button.setValue(2);
}).toThrow("Invalid value '2' for segmented button: 'my-button'");
});
it("should error if multiple items have the same value", function() {
makeButton({
id: 'my-button'
});
expect(function() {
button.add({
text: 'Foo2',
value: 'foo'
});
}).toThrow("Segmented button 'my-button' cannot contain multiple items with value: 'foo'");
Ext.resumeLayouts();
});
describe("allowDepress:true", function() {
it("should set the value to null when a button is depressed", function() {
makeButton({
allowDepress: true,
items: [{
text: 'Foo',
pressed: true
}]
});
clickButton(0);
expect(button.getValue()).toBe(null);
expect(button.items.getAt(0).pressed).toBe(false);
});
});
});
describe("allowMultiple:true", function() {
function makeButton(cfg) {
button = Ext.create(Ext.apply({
xtype: 'segmentedbutton',
allowMultiple: true,
renderTo: document.body,
items: [
{ text: 'Seg', value: 'seg' },
{ text: 'Men' },
{ text: 'Ted', value: 'ted' }
]
}, cfg));
}
it("should initialize with a null value", function() {
makeButton();
expect(button.getValue()).toEqual([]);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(false);
});
it("should initialize with an empty array", function() {
makeButton({
value: []
});
expect(button.getValue()).toEqual([]);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(false);
});
it("should initialize with a single value", function() {
makeButton({
value: ['seg']
});
expect(button.getValue()).toEqual(['seg']);
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(false);
});
it("should initialize with a single index value", function() {
makeButton({
value: [1]
});
expect(button.getValue()).toEqual([1]);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(true);
expect(button.items.getAt(2).pressed).toBe(false);
});
it("should initialize with multiple values", function() {
makeButton({
value: ['seg', 'ted']
});
expect(button.getValue()).toEqual(['seg', 'ted']);
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(true);
});
it("should initialize with multiple index values", function() {
makeButton({
value: [0, 1]
});
expect(button.getValue()).toEqual(['seg', 1]);
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(true);
expect(button.items.getAt(2).pressed).toBe(false);
});
it("should set a null value", function() {
makeButton({
value: ['seg', 'ted']
});
button.setValue(null);
expect(button.getValue()).toEqual([]);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(false);
});
it("should set the value to emtpy array", function() {
makeButton({
value: ['seg', 'ted']
});
button.setValue([]);
expect(button.getValue()).toEqual([]);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(false);
});
it("should set a single value", function() {
makeButton();
button.setValue(['ted']);
expect(button.getValue()).toEqual(['ted']);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(true);
});
it("should set a single index value", function() {
makeButton();
button.setValue([1]);
expect(button.getValue()).toEqual([1]);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(true);
expect(button.items.getAt(2).pressed).toBe(false);
});
it("should set multiple values", function() {
makeButton();
button.setValue(['seg', 'ted']);
expect(button.getValue()).toEqual(['seg', 'ted']);
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(true);
});
it("should set multiple index values", function() {
makeButton();
button.setValue([1, 2]);
expect(button.getValue()).toEqual([1, 'ted']);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(true);
expect(button.items.getAt(2).pressed).toBe(true);
});
it("should set values for buttons that are initialized with pressed:true", function() {
makeButton({
items: [{
text: 'Seg',
value: 'seg',
pressed: true
}, {
text: 'Men',
pressed: true
}, {
text: 'Ted',
value: 'ted'
}]
});
expect(button.getValue()).toEqual(['seg', 1]);
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(true);
expect(button.items.getAt(2).pressed).toBe(false);
});
it("should set the value when a button is pressed by the user", function() {
makeButton();
clickButton(0);
expect(button.getValue()).toEqual(['seg']);
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(false);
clickButton(1);
expect(button.getValue()).toEqual(['seg', 1]);
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(true);
expect(button.items.getAt(2).pressed).toBe(false);
clickButton(0);
expect(button.getValue()).toEqual([1]);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(true);
expect(button.items.getAt(2).pressed).toBe(false);
clickButton(1);
expect(button.getValue()).toEqual([]);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(false);
});
it("should accept a non-array value", function() {
makeButton({
value: 'seg'
});
expect(button.getValue()).toEqual(['seg']);
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(false);
});
it("should accept a non-array index value", function() {
makeButton({
value: 2
});
expect(button.getValue()).toEqual(['ted']);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(true);
});
it("should throw an error if no button value is matched", function() {
makeButton({
id: 'my-button'
});
expect(function () {
button.setValue(['seg', 'blah']);
}).toThrow("Invalid value 'blah' for segmented button: 'my-button'");
});
it("should thow an error if an index value is out of bounds", function() {
makeButton({
id: 'my-button'
});
expect(function () {
button.setValue(['seg', 3, 'ted']);
}).toThrow("Invalid value '3' for segmented button: 'my-button'");
});
it("should fire a change event", function() {
var newValues = [],
oldValues = [];
makeButton({
listeners: {
change: function(b, newValue, oldValue) {
// Do not use push because that pushes the value array *contents*, not the array itself.
newValues[newValues.length] = newValue;
oldValues[oldValues.length] = oldValue;
}
}
});
button.setValue([1, 2]);
expect(button.getValue()).toEqual([1, 'ted']);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(true);
expect(button.items.getAt(2).pressed).toBe(true);
clickButton(1);
expect(button.getValue()).toEqual(['ted']);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(true);
expect(newValues[0]).toEqual([1, 'ted']);
expect(oldValues[0]).toEqual([]);
expect(newValues[1]).toEqual(['ted']);
expect(oldValues[1]).toEqual([1, 'ted']);
});
describe('forceSelection', function() {
it("should initialize with the value of the first button if none configured pressed", function() {
makeButton({
forceSelection: true
});
expect(button.getValue()).toEqual(['seg']);
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(false);
// This gesture should be vetoed because of forceSelection: true
clickButton(0);
expect(button.getValue()).toEqual(['seg']);
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(false);
expect(button.items.getAt(2).pressed).toBe(false);
});
});
});
describe("with a viewmodel", function() {
function makeButton(cfg) {
button = Ext.create(Ext.apply({
xtype: 'segmentedbutton',
renderTo: document.body,
items: [{
text: 'Foo',
value: 'foo'
}, {
text: 'Bar',
value: 'bar'
}, {
text: 'Baz',
value: 'baz'
}]
}, cfg));
}
it("should have the defaultBindProperty be value", function() {
makeButton();
expect(button.defaultBindProperty).toBe('value');
});
it("should be able to set an initial value from the view model", function() {
var vm = new Ext.app.ViewModel({
data: {
value: 'baz'
}
});
makeButton({
viewModel: vm,
bind: '{value}'
});
vm.notify();
expect(button.getValue()).toBe('baz');
});
it("should react to view model changes", function() {
var vm = new Ext.app.ViewModel();
makeButton({
viewModel: vm,
bind: '{value}'
});
vm.set('value', 'foo');
vm.notify();
expect(button.getValue()).toBe('foo');
});
it("should update the value in the view model", function() {
var vm = new Ext.app.ViewModel();
makeButton({
viewModel: vm,
bind: '{value}'
});
button.setValue('bar');
expect(vm.get('value')).toBe('bar');
});
});
});
describe("the toggle event", function() {
var handler;
beforeEach(function() {
handler = jasmine.createSpy();
makeButton({
allowMultiple: true,
items: [
{ text: 'Seg' },
{ text: 'Men' },
{ text: 'Ted', pressed: true }
],
listeners: {
toggle: handler
}
});
});
it("should fire the toggle event when a child button is pressed", function() {
var item = button.items.getAt(1);
item.setPressed(true);
expect(handler.callCount).toBe(1);
expect(handler.mostRecentCall.args[0]).toBe(button);
expect(handler.mostRecentCall.args[1]).toBe(item);
expect(handler.mostRecentCall.args[2]).toBe(true);
});
it("should fire the toggle event when a child button is depressed", function() {
var item = button.items.getAt(2);
item.setPressed(false);
expect(handler.callCount).toBe(1);
expect(handler.mostRecentCall.args[0]).toBe(button);
expect(handler.mostRecentCall.args[1]).toBe(item);
expect(handler.mostRecentCall.args[2]).toBe(false);
});
});
describe("allowToggle", function() {
it("should allow buttons to be toggled when allowToggle is true", function() {
makeButton({
items: [
{ text: 'Seg' },
{ text: 'Men' },
{ text: 'Ted' }
]
});
expect(button.items.getAt(0).enableToggle).toBe(true);
expect(button.items.getAt(1).enableToggle).toBe(true);
expect(button.items.getAt(2).enableToggle).toBe(true);
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(true);
clickButton(1);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(true);
});
it("should not allow toggling when allowToggle is false", function() {
makeButton({
allowToggle: false,
items: [
{ text: 'Seg' },
{ text: 'Men' },
{ text: 'Ted' }
]
});
expect(button.items.getAt(0).enableToggle).toBe(false);
expect(button.items.getAt(1).enableToggle).toBe(false);
expect(button.items.getAt(2).enableToggle).toBe(false);
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(false);
});
});
describe("allowMultiple", function() {
describe("when false", function() {
it("should use a toggleGroup", function() {
makeButton({
items: [
{ text: 'Seg' },
{ text: 'Men' },
{ text: 'Ted' }
]
});
expect(button.items.getAt(0).toggleGroup).toBe(button.getId());
expect(button.items.getAt(1).toggleGroup).toBe(button.getId());
expect(button.items.getAt(2).toggleGroup).toBe(button.getId());
});
it("should not use a toggleGroup when allowToggle is false", function() {
makeButton({
allowToggle: false,
items: [
{ text: 'Seg' },
{ text: 'Men' },
{ text: 'Ted' }
]
});
expect(button.items.getAt(0).toggleGroup).toBeUndefined();
expect(button.items.getAt(1).toggleGroup).toBeUndefined();
expect(button.items.getAt(2).toggleGroup).toBeUndefined();
});
it("should only allow one button to be pressed at a time", function() {
makeButton({
items: [
{ text: 'Seg' },
{ text: 'Men' }
]
});
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(false);
clickButton(1);
expect(button.items.getAt(0).pressed).toBe(false);
expect(button.items.getAt(1).pressed).toBe(true);
});
it("should not allow buttons to be depressed", function() {
makeButton({
items: [
{ text: 'Seg' },
{ text: 'Men' }
]
});
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(true);
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(true);
});
});
describe("when true", function() {
beforeEach(function() {
makeButton({
allowMultiple: true,
items: [
{ text: 'Seg' },
{ text: 'Men' }
]
});
});
it("should not use a toggleGroup", function() {
expect(button.items.getAt(0).toggleGroup).toBeUndefined();
expect(button.items.getAt(1).toggleGroup).toBeUndefined();
});
it("should allow multiple buttons to be pressed", function() {
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(false);
clickButton(1);
expect(button.items.getAt(0).pressed).toBe(true);
expect(button.items.getAt(1).pressed).toBe(true);
});
it("should allow buttons to be depressed", function() {
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(true);
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(false);
});
});
});
describe("allowDepress", function() {
function makeButton(cfg) {
button = Ext.create(Ext.apply({
xtype: 'segmentedbutton',
renderTo: document.body,
items: [
{ text: 'Seg' },
{ text: 'Men' },
{ text: 'Ted' }
]
}, cfg));
}
describe("when true", function() {
it("should allow buttons to be depressed", function() {
makeButton({
allowDepress: true
});
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(true);
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(false);
});
});
describe("when false", function() {
it("should not allow buttons to be depressed", function() {
makeButton();
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(true);
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(true);
});
it("should have no effect when allowMultiple is true", function() {
makeButton({
allowMultiple: true,
allowDepress: false
});
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(true);
clickButton(0);
expect(button.items.getAt(0).pressed).toBe(false);
});
});
});
describe("disable/enable", function() {
it("should disable the child buttons when disable() is called", function() {
makeButton({
items: [
{ text: 'foo' },
{ text: 'bar' }
]
});
expect(button.items.getAt(0).disabled).toBe(false);
expect(button.items.getAt(1).disabled).toBe(false);
button.disable();
expect(button.items.getAt(0).disabled).toBe(true);
expect(button.items.getAt(1).disabled).toBe(true);
});
it("should enable the child buttons when enable() is called", function() {
makeButton({
disabled: true,
items: [
{ text: 'foo' },
{ text: 'bar' }
]
});
expect(button.items.getAt(0).disabled).toBe(true);
expect(button.items.getAt(1).disabled).toBe(true);
button.enable();
expect(button.items.getAt(0).disabled).toBe(false);
expect(button.items.getAt(1).disabled).toBe(false);
});
it("should not mask the element when disabled", function() {
makeButton();
expect(button.maskOnDisable).toBe(false);
});
});
describe("defaultUI", function() {
it("should default to 'default'", function() {
makeButton({
items: [{
text: 'Foo'
}]
});
expect(button.getDefaultUI()).toBe('default');
expect(button.items.getAt(0).ui).toBe('default-small');
});
it("should allow buttons to configure their own UI", function() {
makeButton({
items: [{
text: 'Foo',
ui: 'bar'
}]
});
expect(button.getDefaultUI()).toBe('default');
expect(button.items.getAt(0).ui).toBe('bar-small');
});
it("should use the defaultUI as the UI of the items", function() {
makeButton({
defaultUI: 'bob',
items: [{
text: 'Foo'
}]
});
expect(button.items.getAt(0).ui).toBe('bob-small');
});
it("should not use the defaultUI for items that have a ui on the item instance", function() {
makeButton({
defaultUI: 'bob',
items: [{
text: 'Foo',
ui: 'hooray'
}]
});
expect(button.items.getAt(0).ui).toBe('hooray-small');
});
it("should not use the defaultUI for items that have a ui on the item class", function() {
Ext.define('spec.Btn', {
extend: 'Ext.button.Button',
ui: 'baz'
});
makeButton({
defaultUI: 'bob',
items: [{
xclass: 'spec.Btn',
text: 'Foo'
}]
});
expect(button.items.getAt(0).ui).toBe('baz-small');
Ext.undefine('spec.Btn');
});
it("should not use the defaultUI for items that have a ui of 'default' on the item instance", function() {
makeButton({
defaultUI: 'bob',
items: [{
text: 'Foo',
ui: 'default'
}]
});
expect(button.items.getAt(0).ui).toBe('default-small');
});
});
describe("item classes", function() {
var firstCls = 'x-segmented-button-first',
middleCls = 'x-segmented-button-middle',
lastCls = 'x-segmented-button-last';
// expects all of the items to have correct classes
function expectClasses(items) {
var itemCount, el;
items = items || button.items.items;
itemCount = items.length;
if (itemCount === 1) {
el = items[0].getEl();
expect(el.hasCls(firstCls)).toBe(false);
expect(el.hasCls(middleCls)).toBe(false);
expect(el.hasCls(lastCls)).toBe(false);
} else {
Ext.each(items, function(item, index) {
el = item.getEl();
if (index === 0) {
expect(el.hasCls(firstCls)).toBe(true);
expect(el.hasCls(middleCls)).toBe(false);
expect(el.hasCls(lastCls)).toBe(false);
} else if (index === itemCount - 1) {
expect(el.hasCls(firstCls)).toBe(false);
expect(el.hasCls(middleCls)).toBe(false);
expect(el.hasCls(lastCls)).toBe(true);
} else {
expect(el.hasCls(firstCls)).toBe(false);
expect(el.hasCls(middleCls)).toBe(true);
expect(el.hasCls(lastCls)).toBe(false);
}
});
}
}
it("should have the correct classes when there is only one item", function() {
makeButton({
items: [
{ text: 'Seg' }
]
});
expectClasses();
});
it("should have the correct classes when there are two items", function() {
makeButton({
items: [
{ text: 'Seg' },
{ text: 'Men' }
]
});
expectClasses();
});
it("should have the correct classes when there are three items", function() {
makeButton({
items: [
{ text: 'Seg' },
{ text: 'Men' },
{ text: 'Ted' }
]
});
expectClasses();
});
it("should have the correct classes when there are four items", function() {
makeButton({
items: [
{ text: 'Seg' },
{ text: 'Men' },
{ text: 'Ted' },
{ text: 'Btn' }
]
});
expectClasses();
});
it("should have the correct classes when items are added or removed", function () {
makeButton({
items: [
{ text: 'Seg' }
]
});
// add button at the end
button.add({ text: 'Men' });
expectClasses();
// insert button before first
button.insert(0, { text: 'Ted' });
expectClasses();
// insert button in middle
button.insert(1, { text: 'Btn' });
expectClasses();
// remove button from middle
button.remove(2);
expectClasses();
// remove button from end
button.remove(2);
expectClasses();
// remove first button
button.remove(0);
expectClasses();
});
it("should have the correct classes when items are shown or hidden", function () {
makeButton({
items: [
{ text: 'Seg', hidden: true },
{ text: 'Men' },
{ text: 'Ted', hidden: true },
{ text: 'Btn', hidden: true }
]
});
var items = button.items;
items.getAt(3).show();
expectClasses([
items.getAt(1),
items.getAt(3)
]);
items.getAt(0).show();
expectClasses([
items.getAt(0),
items.getAt(1),
items.getAt(3)
]);
items.getAt(2).show();
expectClasses([
items.getAt(0),
items.getAt(1),
items.getAt(2),
items.getAt(3)
]);
items.getAt(1).hide();
expectClasses([
items.getAt(0),
items.getAt(2),
items.getAt(3)
]);
items.getAt(3).hide();
expectClasses([
items.getAt(0),
items.getAt(2)
]);
items.getAt(0).hide();
expectClasses([
items.getAt(2)
]);
});
});
describe("layout", function() {
var dimensions = {
1: 'width',
2: 'height',
3: 'width and height'
},
sizeStyle = {
0: '',
1: 'width:87px;',
2: 'height:94px;',
3: 'width:87px;height:94px;'
},
sizeStyleVert = {
0: '',
1: 'width:86px;',
2: 'height:95px;',
3: 'width:86px;height:95px;'
},
sizeStyleFirst = {
0: '',
1: 'width:86px;',
2: 'height:94px;',
3: 'width:86px;height:94px;'
},
sizeStyleFirstVert = {
0: '',
1: 'width:86px;',
2: 'height:94px;',
3: 'width:86px;height:94px;'
};
function makeLayoutSuite(shrinkWrap) {
function makeButton(cfg) {
var vertical = cfg.vertical,
itemText = '<div style="display:inline-block;background:red;' +
(vertical ? sizeStyleVert : sizeStyle)[shrinkWrap] + '"> </div>',
itemTextFirst = '<div style="display:inline-block;background:red;' +
(vertical ? sizeStyleFirstVert : sizeStyleFirst)[shrinkWrap] + '"> </div>';
button = Ext.create(Ext.apply({
xtype: 'segmentedbutton',
renderTo: document.body,
width: (shrinkWrap & 1) ? null : vertical ? 100 : 300,
height: (shrinkWrap & 2) ? null : vertical ? 300 : 100,
items: [
{ text: itemTextFirst },
{ text: itemText },
{ text: itemText }
]
}, cfg));
}
describe((shrinkWrap ? ("shrink wrap " + dimensions[shrinkWrap]) : "fixed width and height"), function() {
it("should layout horizontal", function() {
makeButton({});
expect(button).toHaveLayout({
el: {
w: 300,
h: 100
},
items: {
0: {
el: {
x: 0,
y: 0,
w: 100,
h: 100
}
},
1: {
el: {
x: 100,
y: 0,
w: 100,
h: 100
}
},
2: {
el: {
x: 200,
y: 0,
w: 100,
h: 100
}
}
}
});
});
it("should layout vertical", function() {
makeButton({
vertical: true
});
var shrinkHeight = (shrinkWrap & 2);
// This layout matcher contains ranges for heights and y positions because
// fixed height table is subject to rounding errors in non-webkit browsers
// when the cells have borders.
expect(button).toHaveLayout({
el: {
w: 100,
h: 300
},
items: {
0: {
el: {
x: 0,
y: 0,
w: 100,
h: shrinkHeight ? 100 : [100, 104]
}
},
1: {
el: {
x: 0,
y: shrinkHeight ? 100 : [100, 103],
w: 100,
h: shrinkHeight ? 100 : [98, 100]
}
},
2: {
el: {
x: 0,
y: shrinkHeight ? 200 : [200, 202],
w: 100,
h: shrinkHeight ? 100 : [98, 100]
}
}
}
});
});
});
}
makeLayoutSuite(0); // fixed width and height
makeLayoutSuite(1); // shrinkWrap width
makeLayoutSuite(2); // shrinkWrap height
makeLayoutSuite(3); // shrinkWrap both
describe("horizontal", function() {
it("should divide width evenly among non-widthed items", function() {
makeButton({
width: 300,
height: 100,
items: [
{ text: 'Seg', width: 50 },
{ text: 'Men' },
{ text: 'Ted' }
]
});
expect(button).toHaveLayout({
el: {
w: 300,
h: 100
},
items: {
0: {
el: {
x: 0,
y: 0,
w: 50,
h: 100
}
},
1: {
el: {
x: 50,
y: 0,
w: 125,
h: 100
}
},
2: {
el: {
x: 175,
y: 0,
w: 125,
h: 100
}
}
}
});
});
it("should stretch all items to the height of the largest item", function() {
makeButton({
width: 300,
items: [
{ text: 'Seg', height: 100 },
{ text: 'Men' },
{ text: 'Ted' }
]
});
expect(button).toHaveLayout({
el: {
w: 300,
h: 100
},
items: {
0: {
el: {
x: 0,
y: 0,
w: 100,
h: 100
}
},
1: {
el: {
x: 100,
y: 0,
w: 100,
h: 100
}
},
2: {
el: {
x: 200,
y: 0,
w: 100,
h: 100
}
}
}
});
});
if (!Ext.supports.CSS3BorderRadius) {
it("should stretch the frameBody when the width of the segmented button is stretched", function() {
makeButton({
width: 300,
items: [
{ text: 'Foo' },
{ text: 'Bar' }
]
});
var btn = button.items.getAt(1);
expect(btn.frameBody.getWidth()).toBe(150 - btn.getFrameInfo().right);
});
}
});
describe("vertical", function() {
it("should divide height evenly among non-heighted items", function() {
makeButton({
vertical: true,
width: 100,
height: 300,
items: [
{ text: 'Seg', height: 50 },
{ text: 'Men' },
{ text: 'Ted' }
]
});
expect(button).toHaveLayout({
el: {
w: 100,
h: 300
},
items: {
0: {
el: {
x: 0,
y: 0,
w: 100,
h: Ext.isIE8 ? 51 : 50
}
},
1: {
el: {
x: 0,
y: Ext.isIE8 ? 51 : 50,
w: 100,
h: 125
}
},
2: {
el: {
x: 0,
y: 175,
w: 100,
h: 125
}
}
}
});
});
it("should stretch all items to the width of the largest item", function() {
makeButton({
vertical: true,
items: [
{ text: 'Seg', width: 100 },
{ text: 'Men' },
{ text: 'Ted' }
]
});
expect(button).toHaveLayout({
el: {
w: 100
},
items: {
0: {
el: {
x: 0,
y: 0,
w: 100,
h: 22
}
},
1: {
el: {
x: 0,
y: 22,
w: 100,
h: 21
}
},
2: {
el: {
x: 0,
y: 43,
w: 100,
h: 21
}
}
}
});
});
});
});
}); | {
"content_hash": "430766501bc82e685ad21f05c5d96af4",
"timestamp": "",
"source": "github",
"line_count": 1426,
"max_line_length": 118,
"avg_line_length": 35.59326788218794,
"alnum_prop": 0.3765072109701316,
"repo_name": "Litres/FB3Editor",
"id": "c2b7e4f40f33ccac07a7873fe35349468d274c86",
"size": "50756",
"binary": false,
"copies": "15",
"ref": "refs/heads/master",
"path": "Frontend/ext/classic/classic/test/specs/button/Segmented.js",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "1726929"
},
{
"name": "HTML",
"bytes": "84407"
},
{
"name": "Java",
"bytes": "2770"
},
{
"name": "JavaScript",
"bytes": "75213255"
},
{
"name": "Perl",
"bytes": "13"
},
{
"name": "Ruby",
"bytes": "7620"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.