code stringlengths 3 1.05M | repo_name stringlengths 4 116 | path stringlengths 4 991 | language stringclasses 9
values | license stringclasses 15
values | size int32 3 1.05M |
|---|---|---|---|---|---|
import fs from 'fs';
import cheerio from 'cheerio';
import { Analyzer } from './crowller';
interface Course {
title: string;
count: number;
}
interface CourseResult {
time: number;
data: Course[];
}
interface Content {
[propName: number]: Course[];
}
export default class DellAnalyzer implements Analyzer {
private static instance: DellAnalyzer;
static getInstance() {
if (!DellAnalyzer.instance) {
DellAnalyzer.instance = new DellAnalyzer();
}
return DellAnalyzer.instance;
}
private getCourseInfo(html: string) {
const $ = cheerio.load(html);
const courseItems = $('.course-item');
const courseInfos: Course[] = [];
courseItems.map((index, element) => {
const descs = $(element).find('.course-desc');
const title = descs.eq(0).text();
const count = parseInt(
descs
.eq(1)
.text()
.split(':')[1],
10
);
courseInfos.push({ title, count });
});
return {
time: new Date().getTime(),
data: courseInfos
};
}
private generateJsonContent(courseInfo: CourseResult, filePath: string) {
let fileContent: Content = {};
if (fs.existsSync(filePath)) {
fileContent = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
}
fileContent[courseInfo.time] = courseInfo.data;
return fileContent;
}
public analyze(html: string, filePath: string) {
const courseInfo = this.getCourseInfo(html);
const fileContent = this.generateJsonContent(courseInfo, filePath);
return JSON.stringify(fileContent);
}
private constructor() { }
}
| lijiliang/record | typescript/express/src/utils/dellAnalyzer.ts | TypeScript | mit | 1,615 |
class RemoveDuplicationFromTopicModel < ActiveRecord::Migration
def self.up
remove_column :topics, :user_name
remove_column :topics, :last_post_user_name
rename_column :topics, :last_post_user_id, :last_post_by
end
def self.down
add_column :topics, :user_name, :text
add_column :topics, :last_post_user_name, :text
rename_column :topics, :last_post_by, :last_post_user_id
end
end
| nekote/eldorado2 | db/migrate/009_remove_duplication_from_topic_model.rb | Ruby | mit | 413 |
<?php
/**
* @file
* Generic transliteration data for the PHPTransliteration class.
*/
$base = array(
0x00 => 'ha', 'hu', 'hi', 'haa', 'hee', 'he', 'ho', null, 'la', 'lu', 'li', 'laa', 'lee', 'le', 'lo', 'lwa',
0x10 => 'hha', 'hhu', 'hhi', 'hhaa', 'hhee', 'hhe', 'hho', 'hhwa', 'ma', 'mu', 'mi', 'maa', 'mee', 'me', 'mo', 'mwa',
0x20 => 'sza', 'szu', 'szi', 'szaa', 'szee', 'sze', 'szo', 'szwa', 'ra', 'ru', 'ri', 'raa', 'ree', 're', 'ro', 'rwa',
0x30 => 'sa', 'su', 'si', 'saa', 'see', 'se', 'so', 'swa', 'sha', 'shu', 'shi', 'shaa', 'shee', 'she', 'sho', 'shwa',
0x40 => 'qa', 'qu', 'qi', 'qaa', 'qee', 'qe', 'qo', null, 'qwa', null, 'qwi', 'qwaa', 'qwee', 'qwe', null, null,
0x50 => 'qha', 'qhu', 'qhi', 'qhaa', 'qhee', 'qhe', 'qho', null, 'qhwa', null, 'qhwi', 'qhwaa', 'qhwee', 'qhwe', null, null,
0x60 => 'ba', 'bu', 'bi', 'baa', 'bee', 'be', 'bo', 'bwa', 'va', 'vu', 'vi', 'vaa', 'vee', 've', 'vo', 'vwa',
0x70 => 'ta', 'tu', 'ti', 'taa', 'tee', 'te', 'to', 'twa', 'ca', 'cu', 'ci', 'caa', 'cee', 'ce', 'co', 'cwa',
0x80 => 'xa', 'xu', 'xi', 'xaa', 'xee', 'xe', 'xo', null, 'xwa', null, 'xwi', 'xwaa', 'xwee', 'xwe', null, null,
0x90 => 'na', 'nu', 'ni', 'naa', 'nee', 'ne', 'no', 'nwa', 'nya', 'nyu', 'nyi', 'nyaa', 'nyee', 'nye', 'nyo', 'nywa',
0xA0 => '\'a', '\'u', null, '\'aa', '\'ee', '\'e', '\'o', '\'wa', 'ka', 'ku', 'ki', 'kaa', 'kee', 'ke', 'ko', null,
0xB0 => 'kwa', null, 'kwi', 'kwaa', 'kwee', 'kwe', null, null, 'kxa', 'kxu', 'kxi', 'kxaa', 'kxee', 'kxe', 'kxo', null,
0xC0 => 'kxwa', null, 'kxwi', 'kxwaa', 'kxwee', 'kxwe', null, null, 'wa', 'wu', 'wi', 'waa', 'wee', 'we', 'wo', null,
0xD0 => '`a', '`u', '`i', '`aa', '`ee', '`e', '`o', null, 'za', 'zu', 'zi', 'zaa', 'zee', 'ze', 'zo', 'zwa',
0xE0 => 'zha', 'zhu', 'zhi', 'zhaa', 'zhee', 'zhe', 'zho', 'zhwa', 'ya', 'yu', 'yi', 'yaa', 'yee', 'ye', 'yo', null,
0xF0 => 'da', 'du', 'di', 'daa', 'dee', 'de', 'do', 'dwa', 'dda', 'ddu', 'ddi', 'ddaa', 'ddee', 'dde', 'ddo', 'ddwa',
);
| HansonHuang/Pyramid | Component/Transliteration/data/x12.php | PHP | mit | 1,991 |
#region Copyright
//
// DotNetNuke® - http://www.dotnetnuke.com
// Copyright (c) 2002-2017
// by DotNetNuke Corporation
//
// 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.
#endregion
namespace DotNetNuke.Entities.Content.Workflow.Entities
{
/// <summary>
/// This enum represents the possible list of WorkflowLogType
/// </summary>
public enum WorkflowLogType
{
WorkflowStarted = 0,
StateCompleted = 1,
DraftCompleted = 2,
StateDiscarded = 3,
StateInitiated = 4,
WorkflowApproved = 5,
WorkflowDiscarded = 6,
CommentProvided = 10,
WorkflowError = 500
}
}
| SCullman/Dnn.Platform | DNN Platform/Library/Entities/Content/Workflow/Entities/WorkflowLogType.cs | C# | mit | 1,678 |
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Forum\Controller;
use Flarum\Core\PasswordToken;
use Flarum\Core\Validator\UserValidator;
use Flarum\Forum\UrlGenerator;
use Flarum\Http\Controller\ControllerInterface;
use Flarum\Http\SessionAuthenticator;
use Psr\Http\Message\ServerRequestInterface as Request;
use Zend\Diactoros\Response\RedirectResponse;
class SavePasswordController implements ControllerInterface
{
/**
* @var UrlGenerator
*/
protected $url;
/**
* @var UserValidator
*/
protected $validator;
/**
* @var SessionAuthenticator
*/
protected $authenticator;
/**
* @param UrlGenerator $url
* @param SessionAuthenticator $authenticator
*/
public function __construct(UrlGenerator $url, SessionAuthenticator $authenticator, UserValidator $validator)
{
$this->url = $url;
$this->authenticator = $authenticator;
$this->validator = $validator;
}
/**
* @param Request $request
* @return RedirectResponse
*/
public function handle(Request $request)
{
$input = $request->getParsedBody();
$token = PasswordToken::findOrFail(array_get($input, 'passwordToken'));
$password = array_get($input, 'password');
$confirmation = array_get($input, 'password_confirmation');
$this->validator->assertValid(compact('password'));
if (! $password || $password !== $confirmation) {
return new RedirectResponse($this->url->toRoute('resetPassword', ['token' => $token->id]));
}
$token->user->changePassword($password);
$token->user->save();
$token->delete();
$session = $request->getAttribute('session');
$this->authenticator->logIn($session, $token->user->id);
return new RedirectResponse($this->url->toBase());
}
}
| Jerrrrry/yuepao | vendor/flarum/core/src/Forum/Controller/SavePasswordController.php | PHP | mit | 2,065 |
# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
# NOTE: This class should not be instantiated and its
# ``traverse_and_document_shape`` method called directly. It should be
# inherited from a Documenter class with the appropriate methods
# and attributes.
from botocore.utils import is_json_value_header
class ShapeDocumenter(object):
EVENT_NAME = ''
def __init__(self, service_name, operation_name, event_emitter,
context=None):
self._service_name = service_name
self._operation_name = operation_name
self._event_emitter = event_emitter
self._context = context
if context is None:
self._context = {
'special_shape_types': {}
}
def traverse_and_document_shape(self, section, shape, history,
include=None, exclude=None, name=None,
is_required=False):
"""Traverses and documents a shape
Will take a self class and call its appropriate methods as a shape
is traversed.
:param section: The section to document.
:param history: A list of the names of the shapes that have been
traversed.
:type include: Dictionary where keys are parameter names and
values are the shapes of the parameter names.
:param include: The parameter shapes to include in the documentation.
:type exclude: List of the names of the parameters to exclude.
:param exclude: The names of the parameters to exclude from
documentation.
:param name: The name of the shape.
:param is_required: If the shape is a required member.
"""
param_type = shape.type_name
if shape.name in history:
self.document_recursive_shape(section, shape, name=name)
else:
history.append(shape.name)
is_top_level_param = (len(history) == 2)
getattr(self, 'document_shape_type_%s' % param_type,
self.document_shape_default)(
section, shape, history=history, name=name,
include=include, exclude=exclude,
is_top_level_param=is_top_level_param,
is_required=is_required)
if is_top_level_param:
self._event_emitter.emit(
'docs.%s.%s.%s.%s' % (self.EVENT_NAME,
self._service_name,
self._operation_name,
name),
section=section)
at_overlying_method_section = (len(history) == 1)
if at_overlying_method_section:
self._event_emitter.emit(
'docs.%s.%s.%s.complete-section' % (self.EVENT_NAME,
self._service_name,
self._operation_name),
section=section)
history.pop()
def _get_special_py_default(self, shape):
special_defaults = {
'jsonvalue_header': '{...}|[...]|123|123.4|\'string\'|True|None',
'streaming_input_shape': 'b\'bytes\'|file',
'streaming_output_shape': 'StreamingBody()'
}
return self._get_value_for_special_type(shape, special_defaults)
def _get_special_py_type_name(self, shape):
special_type_names = {
'jsonvalue_header': 'JSON serializable',
'streaming_input_shape': 'bytes or seekable file-like object',
'streaming_output_shape': ':class:`.StreamingBody`'
}
return self._get_value_for_special_type(shape, special_type_names)
def _get_value_for_special_type(self, shape, special_type_map):
if is_json_value_header(shape):
return special_type_map['jsonvalue_header']
for special_type, marked_shape in self._context[
'special_shape_types'].items():
if special_type in special_type_map:
if shape == marked_shape:
return special_type_map[special_type]
return None
| achang97/YouTunes | lib/python2.7/site-packages/botocore/docs/shape.py | Python | mit | 4,763 |
/* Copyright (c) 2015-2017 The Open Source Geospatial Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* A component that renders an `ol.Map` and that can be used in any ExtJS
* layout.
*
* An example: A map component rendered insiide of a panel:
*
* @example preview
* var mapComponent = Ext.create('GeoExt.component.Map', {
* map: new ol.Map({
* layers: [
* new ol.layer.Tile({
* source: new ol.source.OSM()
* })
* ],
* view: new ol.View({
* center: ol.proj.fromLonLat([-8.751278, 40.611368]),
* zoom: 12
* })
* })
* });
* var mapPanel = Ext.create('Ext.panel.Panel', {
* title: 'GeoExt.component.Map Example',
* height: 200,
* items: [mapComponent],
* renderTo: Ext.getBody()
* });
*
* @class GeoExt.component.Map
*/
Ext.define('GeoExt.component.Map', {
extend: 'Ext.Component',
alias: [
'widget.gx_map',
'widget.gx_component_map'
],
requires: [
'GeoExt.data.store.Layers',
'GeoExt.util.Version'
],
mixins: [
'GeoExt.mixin.SymbolCheck'
],
// <debug>
symbols: [
'ol.layer.Base',
'ol.Map',
'ol.Map#addLayer',
'ol.Map#getLayers',
'ol.Map#getSize',
'ol.Map#getView',
'ol.Map#removeLayer',
'ol.Map#setTarget',
'ol.Map#setView',
'ol.Map#updateSize',
'ol.View',
'ol.View#calculateExtent',
'ol.View#fit',
'ol.View#getCenter',
'ol.View#setCenter'
],
// </debug>
/**
* @event pointerrest
*
* Fires if the user has left the pointer for an amount
* of #pointerRestInterval milliseconds at the *same location*. Use the
* configuration #pointerRestPixelTolerance to configure how long a pixel is
* considered to be on the *same location*.
*
* Please note that this event will only fire if the map has #pointerRest
* configured with `true`.
*
* @param {ol.MapBrowserEvent} olEvt The original and most recent
* MapBrowserEvent event.
* @param {ol.Pixel} lastPixel The originally captured pixel, which defined
* the center of the tolerance bounds (itself configurable with the the
* configuration #pointerRestPixelTolerance). If this is null, a
* completely *new* pointerrest event just happened.
*/
/**
* @event pointerrestout
*
* Fires if the user first was resting his pointer on the map element, but
* then moved the pointer out of the map completely.
*
* Please note that this event will only fire if the map has #pointerRest
* configured with `true`.
*
* @param {ol.MapBrowserEvent} olEvt The MapBrowserEvent event.
*/
config: {
/**
* A configured map or a configuration object for the map constructor.
*
* @cfg {ol.Map} map
*/
map: null,
/**
* A boolean flag to control whether the map component will fire the
* events #pointerrest and #pointerrestout. If this is set to `false`
* (the default), no such events will be fired.
*
* @cfg {Boolean} pointerRest Whether the component shall provide the
* `pointerrest` and `pointerrestout` events.
*/
pointerRest: false,
/**
* The amount of milliseconds after which we will consider a rested
* pointer as `pointerrest`. Only relevant if #pointerRest is `true`.
*
* @cfg {Number} pointerRestInterval The interval in milliseconds.
*/
pointerRestInterval: 1000,
/**
* The amount of pixels that a pointer may move in both vertical and
* horizontal direction, and still be considered to be a #pointerrest.
* Only relevant if #pointerRest is `true`.
*
* @cfg {Number} pointerRestPixelTolerance The tolerance in pixels.
*/
pointerRestPixelTolerance: 3
},
/**
* Whether we already rendered an ol.Map in this component. Will be
* updated in #onResize, after the first rendering happened.
*
* @property {Boolean} mapRendered
* @private
*/
mapRendered: false,
/**
* @property {GeoExt.data.store.Layers} layerStore
* @private
*/
layerStore: null,
/**
* The location of the last mousemove which we track to be able to fire
* the #pointerrest event. Only usable if #pointerRest is `true`.
*
* @property {ol.Pixel} lastPointerPixel
* @private
*/
lastPointerPixel: null,
/**
* Whether the pointer is currently over the map component. Only usable if
* the configuration #pointerRest is `true`.
*
* @property {Boolean} isMouseOverMapEl
* @private
*/
isMouseOverMapEl: null,
/**
* @inheritdoc
*/
constructor: function(config) {
var me = this;
me.callParent([config]);
if (!(me.getMap() instanceof ol.Map)) {
var olMap = new ol.Map({
view: new ol.View({
center: [0, 0],
zoom: 2
})
});
me.setMap(olMap);
}
me.layerStore = Ext.create('GeoExt.data.store.Layers', {
storeId: me.getId() + '-store',
map: me.getMap()
});
me.on('resize', me.onResize, me);
},
/**
* (Re-)render the map when size changes.
*/
onResize: function() {
// Get the corresponding view of the controller (the mapComponent).
var me = this;
if (!me.mapRendered) {
var el = me.getTargetEl ? me.getTargetEl() : me.element;
me.getMap().setTarget(el.dom);
me.mapRendered = true;
} else {
me.getMap().updateSize();
}
},
/**
* Will contain a buffered version of #unbufferedPointerMove, but only if
* the configuration #pointerRest is true.
*
* @private
*/
bufferedPointerMove: Ext.emptyFn,
/**
* Bound as a eventlistener for pointermove on the OpenLayers map, but only
* if the configuration #pointerRest is true. Will eventually fire the
* special events #pointerrest or #pointerrestout.
*
* @param {ol.MapBrowserEvent} olEvt The MapBrowserEvent event.
* @private
*/
unbufferedPointerMove: function(olEvt) {
var me = this;
var tolerance = me.getPointerRestPixelTolerance();
var pixel = olEvt.pixel;
if (!me.isMouseOverMapEl) {
me.fireEvent('pointerrestout', olEvt);
return;
}
if (me.lastPointerPixel) {
var deltaX = Math.abs(me.lastPointerPixel[0] - pixel[0]);
var deltaY = Math.abs(me.lastPointerPixel[1] - pixel[1]);
if (deltaX > tolerance || deltaY > tolerance) {
me.lastPointerPixel = pixel;
} else {
// fire pointerrest, and include the original pointer pixel
me.fireEvent('pointerrest', olEvt, me.lastPointerPixel);
return;
}
} else {
me.lastPointerPixel = pixel;
}
// a new pointerrest event, the second argument (the 'original' pointer
// pixel) must be null, as we start from a totally new position
me.fireEvent('pointerrest', olEvt, null);
},
/**
* Creates #bufferedPointerMove from #unbufferedPointerMove and binds it
* to `pointermove` on the OpenLayers map.
*
* @private
*/
registerPointerRestEvents: function() {
var me = this;
var map = me.getMap();
if (me.bufferedPointerMove === Ext.emptyFn) {
me.bufferedPointerMove = Ext.Function.createBuffered(
me.unbufferedPointerMove,
me.getPointerRestInterval(),
me
);
}
// Check if we have to fire any pointer* events
map.on('pointermove', me.bufferedPointerMove);
if (!me.rendered) {
// make sure we do not fire any if the pointer left the component
me.on('afterrender', me.bindOverOutListeners, me);
} else {
me.bindOverOutListeners();
}
},
/**
* Registers listeners that'll take care of setting #isMouseOverMapEl to
* correct values.
*
* @private
*/
bindOverOutListeners: function() {
var me = this;
var mapEl = me.getTargetEl ? me.getTargetEl() : me.element;
if (mapEl) {
mapEl.on({
mouseover: me.onMouseOver,
mouseout: me.onMouseOut,
scope: me
});
}
},
/**
* Unregisters listeners that'll take care of setting #isMouseOverMapEl to
* correct values.
*
* @private
*/
unbindOverOutListeners: function() {
var me = this;
var mapEl = me.getTargetEl ? me.getTargetEl() : me.element;
if (mapEl) {
mapEl.un({
mouseover: me.onMouseOver,
mouseout: me.onMouseOut,
scope: me
});
}
},
/**
* Sets isMouseOverMapEl to true, see #pointerRest.
*
* @private
*/
onMouseOver: function() {
this.isMouseOverMapEl = true;
},
/**
* Sets isMouseOverMapEl to false, see #pointerRest.
*
* @private
*/
onMouseOut: function() {
this.isMouseOverMapEl = false;
},
/**
* Unregisters the #bufferedPointerMove event listener and unbinds the
* over- and out-listeners.
*/
unregisterPointerRestEvents: function() {
var me = this;
var map = me.getMap();
me.unbindOverOutListeners();
if (map) {
map.un('pointermove', me.bufferedPointerMove);
}
me.bufferedPointerMove = Ext.emptyFn;
},
/**
* Whenever the value of #pointerRest is changed, this method will take
* care of registering or unregistering internal event listeners.
*
* @param {Boolean} val The new value that someone set for `pointerRest`.
* @return {Boolean} The passed new value for `pointerRest` unchanged.
*/
applyPointerRest: function(val) {
if (val) {
this.registerPointerRestEvents();
} else {
this.unregisterPointerRestEvents();
}
return val;
},
/**
* Whenever the value of #pointerRestInterval is changed, this method will
* take to reinitialize the #bufferedPointerMove method and handlers to
* actually trigger the event.
*
* @param {Boolean} val The new value that someone set for
* `pointerRestInterval`.
* @return {Boolean} The passed new value for `pointerRestInterval`
* unchanged.
*/
applyPointerRestInterval: function(val) {
var me = this;
var isEnabled = me.getPointerRest();
if (isEnabled) {
// Toggle to rebuild the buffered pointer move.
me.setPointerRest(false);
me.setPointerRest(isEnabled);
}
return val;
},
/**
* Returns the center coordinate of the view.
*
* @return {ol.Coordinate} The center of the map view as `ol.Coordinate`.
*/
getCenter: function() {
return this.getMap().getView().getCenter();
},
/**
* Set the center of the view.
*
* @param {ol.Coordinate} center The new center as `ol.Coordinate`.
*/
setCenter: function(center) {
this.getMap().getView().setCenter(center);
},
/**
* Returns the extent of the current view.
*
* @return {ol.Extent} The extent of the map view as `ol.Extent`.
*/
getExtent: function() {
return this.getView().calculateExtent(this.getMap().getSize());
},
/**
* Set the extent of the view.
*
* @param {ol.Extent} extent The extent as `ol.Extent`.
*/
setExtent: function(extent) {
// Check for backwards compatibility
if (GeoExt.util.Version.isOl3()) {
this.getView().fit(extent, this.getMap().getSize());
} else {
this.getView().fit(extent);
}
},
/**
* Returns the layers of the map.
*
* @return {ol.Collection} The layer collection.
*/
getLayers: function() {
return this.getMap().getLayers();
},
/**
* Add a layer to the map.
*
* @param {ol.layer.Base} layer The layer to add.
*/
addLayer: function(layer) {
if (layer instanceof ol.layer.Base) {
this.getMap().addLayer(layer);
} else {
Ext.Error.raise('Can not add layer ' + layer + ' as it is not ' +
'an instance of ol.layer.Base');
}
},
/**
* Remove a layer from the map.
*
* @param {ol.layer.Base} layer The layer to remove.
*/
removeLayer: function(layer) {
if (layer instanceof ol.layer.Base) {
if (Ext.Array.contains(this.getLayers().getArray(), layer)) {
this.getMap().removeLayer(layer);
}
} else {
Ext.Error.raise('Can not remove layer ' + layer + ' as it is not ' +
'an instance of ol.layer.Base');
}
},
/**
* Returns the `GeoExt.data.store.Layers`.
*
* @return {GeoExt.data.store.Layers} The layer store.
*/
getStore: function() {
return this.layerStore;
},
/**
* Returns the view of the map.
*
* @return {ol.View} The `ol.View` of the map.
*/
getView: function() {
return this.getMap().getView();
},
/**
* Set the view of the map.
*
* @param {ol.View} view The `ol.View` to use for the map.
*/
setView: function(view) {
this.getMap().setView(view);
}
});
| carto-tragsatec/visorCatastroColombia | WebContent/visorcatastrocol/lib/geoext/v3.1.0/src/component/Map.js | JavaScript | mit | 14,751 |
/* @flow */
export default function extractSupportQuery(ruleSet: string): string {
return ruleSet
.split('{')[0]
.slice(9)
.trim()
}
| derek-duncan/fela | packages/fela-utils/src/extractSupportQuery.js | JavaScript | mit | 147 |
using System;
using System.IO;
using System.Threading;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Renci.SshNet.Sftp;
namespace Renci.SshNet.Tests.Classes.Sftp
{
[TestClass]
public class SftpFileStreamTest_Ctor_FileModeCreateNew_FileAccessWrite : SftpFileStreamTestBase
{
private Random _random;
private string _path;
private FileMode _fileMode;
private FileAccess _fileAccess;
private int _bufferSize;
private uint _readBufferSize;
private uint _writeBufferSize;
private byte[] _handle;
private SftpFileStream _target;
protected override void SetupData()
{
base.SetupData();
_random = new Random();
_path = _random.Next().ToString();
_fileMode = FileMode.CreateNew;
_fileAccess = FileAccess.Write;
_bufferSize = _random.Next(5, 1000);
_readBufferSize = (uint) _random.Next(5, 1000);
_writeBufferSize = (uint) _random.Next(5, 1000);
_handle = GenerateRandom(_random.Next(1, 10), _random);
}
protected override void SetupMocks()
{
SftpSessionMock.InSequence(MockSequence)
.Setup(p => p.RequestOpen(_path, Flags.Write | Flags.CreateNew, false))
.Returns(_handle);
SftpSessionMock.InSequence(MockSequence)
.Setup(p => p.CalculateOptimalReadLength((uint) _bufferSize))
.Returns(_readBufferSize);
SftpSessionMock.InSequence(MockSequence)
.Setup(p => p.CalculateOptimalWriteLength((uint) _bufferSize, _handle))
.Returns(_writeBufferSize);
}
protected override void Act()
{
_target = new SftpFileStream(SftpSessionMock.Object,
_path,
_fileMode,
_fileAccess,
_bufferSize);
}
[TestMethod]
public void CanReadShouldReturnFalse()
{
Assert.IsFalse(_target.CanRead);
}
[TestMethod]
public void CanSeekShouldReturnTrue()
{
Assert.IsTrue(_target.CanSeek);
}
[TestMethod]
public void CanWriteShouldReturnTrue()
{
Assert.IsTrue(_target.CanWrite);
}
[TestMethod]
public void CanTimeoutShouldReturnTrue()
{
Assert.IsTrue(_target.CanTimeout);
}
[TestMethod]
public void PositionShouldReturnZero()
{
SftpSessionMock.InSequence(MockSequence).Setup(p => p.IsOpen).Returns(true);
var actual = _target.Position;
Assert.AreEqual(0L, actual);
SftpSessionMock.Verify(p => p.IsOpen, Times.Exactly(1));
}
[TestMethod]
public void ReadShouldThrowNotSupportedException()
{
var buffer = new byte[_readBufferSize];
SftpSessionMock.InSequence(MockSequence).Setup(p => p.IsOpen).Returns(true);
try
{
_target.Read(buffer, 0, buffer.Length);
Assert.Fail();
}
catch (NotSupportedException ex)
{
Assert.IsNull(ex.InnerException);
Assert.AreEqual("Read not supported.", ex.Message);
}
SftpSessionMock.Verify(p => p.IsOpen, Times.Exactly(1));
}
[TestMethod]
public void ReadByteShouldThrowNotSupportedException()
{
SftpSessionMock.InSequence(MockSequence).Setup(p => p.IsOpen).Returns(true);
try
{
_target.ReadByte();
Assert.Fail();
}
catch (NotSupportedException ex)
{
Assert.IsNull(ex.InnerException);
Assert.AreEqual("Read not supported.", ex.Message);
}
SftpSessionMock.Verify(p => p.IsOpen, Times.Exactly(1));
}
[TestMethod]
public void WriteShouldStartWritingAtBeginningOfFile()
{
var buffer = new byte[_writeBufferSize];
SftpSessionMock.InSequence(MockSequence).Setup(p => p.IsOpen).Returns(true);
SftpSessionMock.InSequence(MockSequence).Setup(p => p.RequestWrite(_handle, 0UL, buffer, 0, buffer.Length, It.IsNotNull<AutoResetEvent>(), null));
_target.Write(buffer, 0, buffer.Length);
SftpSessionMock.Verify(p => p.IsOpen, Times.Exactly(1));
SftpSessionMock.Verify(p => p.RequestWrite(_handle, 0UL, buffer, 0, buffer.Length, It.IsNotNull<AutoResetEvent>(), null), Times.Once);
}
[TestMethod]
public void RequestOpenOnSftpSessionShouldBeInvokedOnce()
{
SftpSessionMock.Verify(p => p.RequestOpen(_path, Flags.Write | Flags.CreateNew, false), Times.Once);
}
}
}
| Bloomcredit/SSH.NET | src/Renci.SshNet.Tests/Classes/Sftp/SftpFileStreamTest_Ctor_FileModeCreateNew_FileAccessWrite.cs | C# | mit | 5,120 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using ZeroMQ;
namespace Examples
{
static partial class Program
{
public static void FLServer1(string[] args)
{
//
// Freelance server - Model 1
// Trivial echo service
//
// Author: metadings
//
if (args == null || args.Length < 1)
{
Console.WriteLine();
Console.WriteLine("Usage: ./{0} FLServer1 [Endpoint]", AppDomain.CurrentDomain.FriendlyName);
Console.WriteLine();
Console.WriteLine(" Endpoint Where FLServer1 should bind on.");
Console.WriteLine(" Default is tcp://127.0.0.1:7780");
Console.WriteLine();
args = new string[] { "tcp://127.0.0.1:7780" };
}
using (var context = new ZContext())
using (var server = new ZSocket(context, ZSocketType.REP))
{
server.Bind(args[0]);
Console.WriteLine("I: echo service is ready at {0}", args[0]);
ZMessage message;
ZError error;
while (true)
{
if (null != (message = server.ReceiveMessage(out error)))
{
using (message)
{
server.Send(message);
}
}
else
{
if (error == ZError.ETERM)
return; // Interrupted
throw new ZException(error);
}
}
}
}
}
} | soscpd/bee | root/tests/zguide/examples/C#/flserver1.cs | C# | mit | 1,307 |
// ## Globals
var argv = require('minimist')(process.argv.slice(2));
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
var changed = require('gulp-changed');
var concat = require('gulp-concat');
var flatten = require('gulp-flatten');
var gulp = require('gulp');
var gulpif = require('gulp-if');
var imagemin = require('gulp-imagemin');
var jshint = require('gulp-jshint');
var lazypipe = require('lazypipe');
var less = require('gulp-less');
var merge = require('merge-stream');
var minifyCss = require('gulp-minify-css');
var plumber = require('gulp-plumber');
var rev = require('gulp-rev');
var runSequence = require('run-sequence');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify');
// See https://github.com/austinpray/asset-builder
var manifest = require('asset-builder')('./assets/manifest.json');
// `path` - Paths to base asset directories. With trailing slashes.
// - `path.source` - Path to the source files. Default: `assets/`
// - `path.dist` - Path to the build directory. Default: `dist/`
var path = manifest.paths;
// `config` - Store arbitrary configuration values here.
var config = manifest.config || {};
// `globs` - These ultimately end up in their respective `gulp.src`.
// - `globs.js` - Array of asset-builder JS dependency objects. Example:
// ```
// {type: 'js', name: 'main.js', globs: []}
// ```
// - `globs.css` - Array of asset-builder CSS dependency objects. Example:
// ```
// {type: 'css', name: 'main.css', globs: []}
// ```
// - `globs.fonts` - Array of font path globs.
// - `globs.images` - Array of image path globs.
// - `globs.bower` - Array of all the main Bower files.
var globs = manifest.globs;
// `project` - paths to first-party assets.
// - `project.js` - Array of first-party JS assets.
// - `project.css` - Array of first-party CSS assets.
var project = manifest.getProjectGlobs();
// CLI options
var enabled = {
// Enable static asset revisioning when `--production`
rev: argv.production,
// Disable source maps when `--production`
maps: !argv.production,
// Fail styles task on error when `--production`
failStyleTask: argv.production,
// Fail due to JSHint warnings only when `--production`
failJSHint: argv.production,
// Strip debug statments from javascript when `--production`
stripJSDebug: argv.production
};
// Path to the compiled assets manifest in the dist directory
var revManifest = path.dist + 'assets.json';
// ## Reusable Pipelines
// See https://github.com/OverZealous/lazypipe
// ### CSS processing pipeline
// Example
// ```
// gulp.src(cssFiles)
// .pipe(cssTasks('main.css')
// .pipe(gulp.dest(path.dist + 'styles'))
// ```
var cssTasks = function(filename) {
return lazypipe()
.pipe(function() {
return gulpif(!enabled.failStyleTask, plumber());
})
.pipe(function() {
return gulpif(enabled.maps, sourcemaps.init());
})
.pipe(function() {
return gulpif('*.scss', sass({
outputStyle: 'nested', // libsass doesn't support expanded yet
precision: 10,
includePaths: ['.'],
errLogToConsole: !enabled.failStyleTask
}));
})
.pipe(concat, filename)
.pipe(autoprefixer, {
browsers: [
'last 2 versions',
'ie 8',
'ie 9',
'android 2.3',
'android 4',
'opera 12'
]
})
.pipe(minifyCss, {
advanced: false,
rebase: false
})
.pipe(function() {
return gulpif(enabled.rev, rev());
})
.pipe(function() {
return gulpif(enabled.maps, sourcemaps.write('.', {
sourceRoot: 'assets/styles/'
}));
})();
};
// ### JS processing pipeline
// Example
// ```
// gulp.src(jsFiles)
// .pipe(jsTasks('main.js')
// .pipe(gulp.dest(path.dist + 'scripts'))
// ```
var jsTasks = function(filename) {
return lazypipe()
.pipe(function() {
return gulpif(enabled.maps, sourcemaps.init());
})
.pipe(concat, filename)
.pipe(uglify, {
compress: {
'drop_debugger': enabled.stripJSDebug
}
})
.pipe(function() {
return gulpif(enabled.rev, rev());
})
.pipe(function() {
return gulpif(enabled.maps, sourcemaps.write('.', {
sourceRoot: 'assets/scripts/'
}));
})();
};
// ### Write to rev manifest
// If there are any revved files then write them to the rev manifest.
// See https://github.com/sindresorhus/gulp-rev
var writeToManifest = function(directory) {
return lazypipe()
.pipe(gulp.dest, path.dist + directory)
.pipe(browserSync.stream, {match: '**/*.{js,css}'})
.pipe(rev.manifest, revManifest, {
base: path.dist,
merge: true
})
.pipe(gulp.dest, path.dist)();
};
// ## Gulp tasks
// Run `gulp -T` for a task summary
// ### Styles
// `gulp styles` - Compiles, combines, and optimizes Bower CSS and project CSS.
// By default this task will only log a warning if a precompiler error is
// raised. If the `--production` flag is set: this task will fail outright.
gulp.task('styles', ['wiredep'], function() {
var merged = merge();
manifest.forEachDependency('css', function(dep) {
var cssTasksInstance = cssTasks(dep.name);
if (!enabled.failStyleTask) {
cssTasksInstance.on('error', function(err) {
console.error(err.message);
this.emit('end');
});
}
merged.add(gulp.src(dep.globs, {base: 'styles'})
.pipe(cssTasksInstance));
});
return merged
.pipe(writeToManifest('styles'));
});
// ### Scripts
// `gulp scripts` - Runs JSHint then compiles, combines, and optimizes Bower JS
// and project JS.
gulp.task('scripts', ['jshint'], function() {
var merged = merge();
manifest.forEachDependency('js', function(dep) {
merged.add(
gulp.src(dep.globs, {base: 'scripts'})
.pipe(jsTasks(dep.name))
);
});
return merged
.pipe(writeToManifest('scripts'));
});
// ### Fonts
// `gulp fonts` - Grabs all the fonts and outputs them in a flattened directory
// structure. See: https://github.com/armed/gulp-flatten
gulp.task('fonts', function() {
return gulp.src(globs.fonts)
.pipe(flatten())
.pipe(gulp.dest(path.dist + 'fonts'))
.pipe(browserSync.stream());
});
// ### Images
// `gulp images` - Run lossless compression on all the images.
gulp.task('images', function() {
return gulp.src(globs.images)
.pipe(imagemin({
progressive: true,
interlaced: true,
svgoPlugins: [{removeUnknownsAndDefaults: false}, {cleanupIDs: false}]
}))
.pipe(gulp.dest(path.dist + 'images'))
.pipe(browserSync.stream());
});
// ### JSHint
// `gulp jshint` - Lints configuration JSON and project JS.
gulp.task('jshint', function() {
return gulp.src([
'bower.json', 'gulpfile.js'
].concat(project.js))
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(gulpif(enabled.failJSHint, jshint.reporter('fail')));
});
// ### Clean
// `gulp clean` - Deletes the build folder entirely.
gulp.task('clean', require('del').bind(null, [path.dist]));
// ### Watch
// `gulp watch` - Use BrowserSync to proxy your dev server and synchronize code
// changes across devices. Specify the hostname of your dev server at
// `manifest.config.devUrl`. When a modification is made to an asset, run the
// build step for that asset and inject the changes into the page.
// See: http://www.browsersync.io
gulp.task('watch', function() {
browserSync.init({
files: ['{lib,templates}/**/*.php', '*.php'],
proxy: config.devUrl,
snippetOptions: {
whitelist: ['/wp-admin/admin-ajax.php'],
blacklist: ['/wp-admin/**']
}
});
gulp.watch([path.source + 'styles/**/*'], ['styles']);
gulp.watch([path.source + 'scripts/**/*'], ['jshint', 'scripts']);
gulp.watch([path.source + 'fonts/**/*'], ['fonts']);
gulp.watch([path.source + 'images/**/*'], ['images']);
gulp.watch(['bower.json', 'assets/manifest.json'], ['build']);
});
// ### Build
// `gulp build` - Run all the build tasks but don't clean up beforehand.
// Generally you should be running `gulp` instead of `gulp build`.
gulp.task('build', function(callback) {
runSequence('styles',
'scripts',
['fonts', 'images'],
callback);
});
// ### Wiredep
// `gulp wiredep` - Automatically inject Less and Sass Bower dependencies. See
// https://github.com/taptapship/wiredep
gulp.task('wiredep', function() {
var wiredep = require('wiredep').stream;
return gulp.src(project.css)
.pipe(wiredep())
.pipe(changed(path.source + 'styles', {
hasChanged: changed.compareSha1Digest
}))
.pipe(gulp.dest(path.source + 'styles'));
});
// ### Gulp
// `gulp` - Run a complete build. To compile for production run `gulp --production`.
gulp.task('default', ['clean'], function() {
gulp.start('build');
});
| MikeiLL/HealthyHappyHarmony | gulpfile.js | JavaScript | mit | 8,996 |
#include <string>
#include <bandit/bandit.h>
#include "db.test.h"
#include "record.h"
#include "sqlite/column.h"
using namespace bandit;
using namespace std;
using namespace coda::db;
using namespace snowhouse;
column get_user_column(const string &name)
{
select_query q(test::current_session);
q.from("users");
auto rs = q.execute();
if (!rs.is_valid()) {
throw database_exception("no rows in test");
}
auto row = rs.begin();
if (row == rs.end() || !row->is_valid()) {
throw database_exception("no rows in test");
}
return row->column(name);
}
specification(columns, []() {
describe("column", []() {
before_each([]() { test::setup_current_session(); });
after_each([]() { test::teardown_current_session(); });
before_each([]() {
test::user u;
u.set("first_name", "Bob");
u.set("last_name", "Jenkins");
u.set("dval", 123.321);
int *value = new int;
*value = 4;
sql_blob data(value, sizeof(int));
delete value;
u.set("data", data);
u.set("tval", sql_time());
u.save();
});
it("is copyable", []() {
auto col = get_user_column("first_name");
column other(col);
AssertThat(other.is_valid(), IsTrue());
AssertThat(other.value(), Equals(col.value()));
});
it("is movable", []() {
auto col = get_user_column("first_name");
auto val = col.value();
column &&other(std::move(col));
AssertThat(other.is_valid(), IsTrue());
AssertThat(other.value(), Equals(val));
column &&last = get_user_column("last_name");
last = std::move(other);
AssertThat(other.is_valid(), IsFalse());
AssertThat(last.is_valid(), IsTrue());
AssertThat(last.value(), Equals(val));
});
it("can be a blob", []() {
auto col = get_user_column("data");
AssertThat(col.value().is<sql_blob>(), IsTrue());
auto blob = col.value().as<sql_blob>();
AssertThat(blob.size(), Equals(sizeof(int)));
int* p = static_cast<int*>(blob.get());
AssertThat(*p, Equals(4));
});
it("can be a time", []() {
auto col = get_user_column("tval");
AssertThat(col.value().as<sql_time>().value() > 0, IsTrue());
});
it("can be a double", []() {
auto col = get_user_column("dval");
AssertThat(col.value().as<double>(), Equals(123.321));
double val = col;
AssertThat(val, Equals(123.321));
});
it("can be a float", []() {
auto col = get_user_column("dval");
AssertThat(col.value().as<float>(), Equals(123.321f));
float val = col;
AssertThat(val, Equals(123.321f));
});
it("can be an int64", []() {
auto col = get_user_column("id");
AssertThat(col.value().as<long long>() > 0, IsTrue());
long long val = col;
AssertThat(val > 0, IsTrue());
});
it("can be an unsigned int", []() {
auto col = get_user_column("id");
AssertThat(col.value().as<unsigned int>() > 0, IsTrue());
unsigned val = col;
AssertThat(val > 0, IsTrue());
unsigned long long val2 = col;
AssertThat(val2 > 0, IsTrue());
});
it("can be a string", []() {
auto col = get_user_column("first_name");
AssertThat(col.value(), Equals("Bob"));
std::string val = col;
AssertThat(val, Equals("Bob"));
});
});
});
| c0der78/arg3db | tests/column.test.cpp | C++ | mit | 3,854 |
/* Get Programming with JavaScript
* Listing 4.02
* Displaying information from similar objects
*/
var movie1;
var movie2;
var movie3;
movie1 = {
title: "Inside Out",
actors: "Amy Poehler, Bill Hader",
directors: "Pete Doctor, Ronaldo Del Carmen"
};
movie2 = {
title: "Spectre",
actors: "Daniel Craig, Christoph Waltz",
directors: "Sam Mendes"
};
movie3 = {
title: "Star Wars: Episode VII - The Force Awakens",
actors: "Harrison Ford, Mark Hamill, Carrie Fisher",
directors: "J.J.Abrams"
};
console.log("Movie information for " + movie1.title);
console.log("------------------------------");
console.log("Actors: " + movie1.actors);
console.log("Directors: " + movie1.directors);
console.log("------------------------------");
console.log("Movie information for " + movie2.title);
console.log("------------------------------");
console.log("Actors: " + movie2.actors);
console.log("Directors: " + movie2.directors);
console.log("------------------------------");
console.log("Movie information for " + movie3.title);
console.log("------------------------------");
console.log("Actors: " + movie3.actors);
console.log("Directors: " + movie3.directors);
console.log("------------------------------");
/* Further Adventures
*
* 1) Add a fourth movie and display its info
*
* 2) All the movie info is in one big block on the console.
* Change the code to space out the different movies.
*
* 3) Create objects to represent three calendar events
*
* 4) Display info from the three events on the console.
*
*/
| jrlarsen/AdventuresInJavaScript | Ch04_Functions/listing4.02.js | JavaScript | mit | 1,566 |
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _blacklist = require('blacklist');
var _blacklist2 = _interopRequireDefault(_blacklist);
var _classnames = require('classnames');
var _classnames2 = _interopRequireDefault(_classnames);
var _constants = require('../constants');
var _constants2 = _interopRequireDefault(_constants);
module.exports = _react2['default'].createClass({
displayName: 'Row',
propTypes: {
children: _react2['default'].PropTypes.node.isRequired,
className: _react2['default'].PropTypes.string,
gutter: _react2['default'].PropTypes.number,
style: _react2['default'].PropTypes.object
},
getDefaultProps: function getDefaultProps() {
return {
gutter: _constants2['default'].width.gutter
};
},
render: function render() {
var gutter = this.props.gutter;
var rowStyle = {
display: 'flex',
flexWrap: 'wrap',
msFlexWrap: 'wrap',
WebkitFlexWrap: 'wrap',
marginLeft: gutter / -2,
marginRight: gutter / -2
};
var className = (0, _classnames2['default'])('Row', this.props.className);
var props = (0, _blacklist2['default'])(this.props, 'className', 'gutter', 'style');
return _react2['default'].createElement('div', _extends({}, props, { style: _extends(rowStyle, this.props.style), className: className }));
}
}); | raskolnikova/infomaps | node_modules/elemental/lib/components/Row.js | JavaScript | mit | 1,695 |
using System;
using Android.Gms.Maps.Model;
namespace Xamarin.Forms.GoogleMaps.Android.Extensions
{
internal static class LatLngExtensions
{
public static Position ToPosition(this LatLng self)
{
return new Position(self.Latitude, self.Longitude);
}
}
}
| JKennedy24/Xamarin.Forms.GoogleMaps | Xamarin.Forms.GoogleMaps/Xamarin.Forms.GoogleMaps.Android/Extensions/LatLngExtensions.cs | C# | mit | 305 |
<?php exit; ?>
1490881548
6
a:0:{} | Blam44/fil-rouge | forum/phpBB3/cache/data_ext.php | PHP | mit | 34 |
<?php # -*- coding: utf-8 -*-
/**
* Interface Mlp_Table_Names_Interface
*
* @version 2014.08.19
* @author Inpsyde GmbH, toscho
* @license GPL
*/
interface Mlp_Table_Names_Interface {
/**
* Tables for the network only, not site specific, not custom.
*
* @return array
*/
public function get_core_network_tables();
/**
* Get all tables for a site, core and custom.
*
* @return array
*/
public function get_all_site_tables();
/**
* Get core table only.
*
* @return array
*/
public function get_core_site_tables();
/**
* Get custom tables for a site.
*
* @return array
*/
public function get_custom_site_tables();
}
| inpsyde/multilingual-press | src/inc/db/Mlp_Table_Names_Interface.php | PHP | mit | 663 |
motion_require 'object_row'
module Formotion
module RowType
class WebLinkRow < ObjectRow
def after_build(cell)
super
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator
self.row.text_field.hidden = true
end
def on_select(tableView, tableViewDelegate)
if is_url?
if row.warn.nil? || row.warn == false
App.open_url row.value
else
warn
end
else
raise StandardError, "Row value for WebLinkRow should be a URL string or instance of NSURL."
end
end
def is_url?
(row.value.is_a?(String) && row.value[0..3] == "http") || row.value.is_a?(NSURL)
end
def warn
row.warn = {} unless row.warn.is_a? Hash #Convert value from true to a hash
row.warn = {
title: "Leaving #{App.name}",
message: "This action will leave #{App.name} and open Safari.",
buttons: ["Cancel", "OK"]
}.merge(row.warn)
BW::UIAlertView.new({
title: row.warn[:title],
message: row.warn[:message],
buttons: row.warn[:buttons],
cancel_button_index: 0
}) do |alert|
App.open_url(row.value) unless alert.clicked_button.cancel?
end.show
end
end
end
end
| iwazer/formotion | lib/formotion/row_type/web_link_row.rb | Ruby | mit | 1,332 |
import logging
import codecs
from optparse import OptionParser
from pyjade.utils import process
import os
def convert_file():
support_compilers_list = ['django', 'jinja', 'underscore', 'mako', 'tornado']
available_compilers = {}
for i in support_compilers_list:
try:
compiler_class = __import__('pyjade.ext.%s' % i, fromlist=['pyjade']).Compiler
except ImportError, e:
logging.warning(e)
else:
available_compilers[i] = compiler_class
usage = "usage: %prog [options] file [output]"
parser = OptionParser(usage)
parser.add_option("-o", "--output", dest="output",
help="Write output to FILE", metavar="FILE")
parser.add_option("-c", "--compiler", dest="compiler",
choices=available_compilers.keys(),
default='django',
type="choice",
help="COMPILER must be one of %s, default is django" % ','.join(available_compilers.keys()))
parser.add_option("-e", "--ext", dest="extension",
help="Set import/extends default file extension", metavar="FILE")
options, args = parser.parse_args()
if len(args) < 1:
print "Specify the input file as the first argument."
exit()
file_output = options.output or (args[1] if len(args) > 1 else None)
compiler = options.compiler
if options.extension:
extension = '.%s'%options.extension
elif options.output:
extension = os.path.splitext(options.output)[1]
else:
extension = None
if compiler in available_compilers:
template = codecs.open(args[0], 'r', encoding='utf-8').read()
output = process(template, compiler=available_compilers[compiler], staticAttrs=True, extension=extension)
if file_output:
outfile = codecs.open(file_output, 'w', encoding='utf-8')
outfile.write(output)
else:
print output
else:
raise Exception('You must have %s installed!' % compiler)
if __name__ == '__main__':
convert_file()
| glennyonemitsu/MarkupHiveServer | src/pyjade/convert.py | Python | mit | 2,157 |
#include "benchmark/benchmark.h"
#include <cassert>
#include <set>
class MultipleRangesFixture : public ::benchmark::Fixture {
public:
MultipleRangesFixture()
: expectedValues({{1, 3, 5},
{1, 3, 8},
{1, 3, 15},
{2, 3, 5},
{2, 3, 8},
{2, 3, 15},
{1, 4, 5},
{1, 4, 8},
{1, 4, 15},
{2, 4, 5},
{2, 4, 8},
{2, 4, 15},
{1, 7, 5},
{1, 7, 8},
{1, 7, 15},
{2, 7, 5},
{2, 7, 8},
{2, 7, 15},
{7, 6, 3}}) {}
void SetUp(const ::benchmark::State& state) {
std::vector<int> ranges = {state.range(0), state.range(1), state.range(2)};
assert(expectedValues.find(ranges) != expectedValues.end());
actualValues.insert(ranges);
}
virtual ~MultipleRangesFixture() {
assert(actualValues.size() == expectedValues.size());
}
std::set<std::vector<int>> expectedValues;
std::set<std::vector<int>> actualValues;
};
BENCHMARK_DEFINE_F(MultipleRangesFixture, Empty)(benchmark::State& state) {
for (auto _ : state) {
int product = state.range(0) * state.range(1) * state.range(2);
for (int x = 0; x < product; x++) {
benchmark::DoNotOptimize(x);
}
}
}
BENCHMARK_REGISTER_F(MultipleRangesFixture, Empty)
->RangeMultiplier(2)
->Ranges({{1, 2}, {3, 7}, {5, 15}})
->Args({7, 6, 3});
void BM_CheckDefaultArgument(benchmark::State& state) {
// Test that the 'range()' without an argument is the same as 'range(0)'.
assert(state.range() == state.range(0));
assert(state.range() != state.range(1));
for (auto _ : state) {
}
}
BENCHMARK(BM_CheckDefaultArgument)->Ranges({{1, 5}, {6, 10}});
static void BM_MultipleRanges(benchmark::State& st) {
for (auto _ : st) {
}
}
BENCHMARK(BM_MultipleRanges)->Ranges({{5, 5}, {6, 6}});
BENCHMARK_MAIN()
| cginternals/glkernel | source/benchmarks/benchmark/test/multiple_ranges_test.cc | C++ | mit | 2,131 |
version https://git-lfs.github.com/spec/v1
oid sha256:ba35426ce7731b677aeb9fca46043dc31d9cd6a87abedb15382e4c3bc001b548
size 1760
| yogeshsaroya/new-cdnjs | ajax/libs/dojo/1.7.2/gears.js.uncompressed.js | JavaScript | mit | 129 |
package corerouting
import (
"errors"
context "context"
core "github.com/ipfs/go-ipfs/core"
repo "github.com/ipfs/go-ipfs/repo"
supernode "github.com/ipfs/go-ipfs/routing/supernode"
gcproxy "github.com/ipfs/go-ipfs/routing/supernode/proxy"
"gx/ipfs/QmPTGbC34bPKaUm9wTxBo7zSCac7pDuG42ZmnXC718CKZZ/go-libp2p-host"
ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore"
routing "gx/ipfs/QmbkGVaN9W6RYJK4Ws5FvMKXKDqdRQ5snhtaa92qP6L8eU/go-libp2p-routing"
pstore "gx/ipfs/QmeXj9VAjmYQZxpmVz7VzccbJrpmr8qkCDSjfVNsPTWTYU/go-libp2p-peerstore"
)
// NB: DHT option is included in the core to avoid 1) because it's a sane
// default and 2) to avoid a circular dependency (it needs to be referenced in
// the core if it's going to be the default)
var (
errHostMissing = errors.New("supernode routing client requires a Host component")
errIdentityMissing = errors.New("supernode routing server requires a peer ID identity")
errPeerstoreMissing = errors.New("supernode routing server requires a peerstore")
errServersMissing = errors.New("supernode routing client requires at least 1 server peer")
)
// SupernodeServer returns a configuration for a routing server that stores
// routing records to the provided datastore. Only routing records are store in
// the datastore.
func SupernodeServer(recordSource ds.Datastore) core.RoutingOption {
return func(ctx context.Context, ph host.Host, dstore repo.Datastore) (routing.IpfsRouting, error) {
server, err := supernode.NewServer(recordSource, ph.Peerstore(), ph.ID())
if err != nil {
return nil, err
}
proxy := &gcproxy.Loopback{
Handler: server,
Local: ph.ID(),
}
ph.SetStreamHandler(gcproxy.ProtocolSNR, proxy.HandleStream)
return supernode.NewClient(proxy, ph, ph.Peerstore(), ph.ID())
}
}
// TODO doc
func SupernodeClient(remotes ...pstore.PeerInfo) core.RoutingOption {
return func(ctx context.Context, ph host.Host, dstore repo.Datastore) (routing.IpfsRouting, error) {
if len(remotes) < 1 {
return nil, errServersMissing
}
proxy := gcproxy.Standard(ph, remotes)
ph.SetStreamHandler(gcproxy.ProtocolSNR, proxy.HandleStream)
return supernode.NewClient(proxy, ph, ph.Peerstore(), ph.ID())
}
}
| llawall/go-ipfs | core/corerouting/core.go | GO | mit | 2,221 |
<?php
App::uses('CroogoHelper', 'Croogo.View/Helper');
App::uses('SessionComponent', 'Controller/Component');
App::uses('AuthComponent', 'Controller/Component');
App::uses('CakeSession', 'Model/Datasource');
App::uses('Controller', 'Controller');
App::uses('CroogoTestCase', 'Croogo.TestSuite');
App::uses('AclHelper', 'Acl.View/Helper');
class TheCroogoTestController extends Controller {
public $uses = null;
public $components = array();
}
class CroogoHelperTest extends CroogoTestCase {
public $fixtures = array(
'plugin.users.aco',
'plugin.users.aro',
'plugin.users.aros_aco',
'plugin.settings.setting',
'plugin.users.role',
'plugin.taxonomy.type',
);
/**
* setUp
*/
public function setUp() {
parent::setUp();
$this->ComponentCollection = new ComponentCollection();
$request = new CakeRequest('nodes/index');
$request->params = array(
'controller' => 'nodes',
'action' => 'index',
'named' => array(),
);
$view = new View(new TheCroogoTestController($request, new CakeResponse()));
$this->Croogo = new CroogoHelper($view);
$aclHelper = Configure::read('Site.acl_plugin') . 'Helper';
$this->Croogo->Acl = $this->getMock(
$aclHelper,
array('linkIsAllowedByRoleId'),
array($view)
);
$this->Croogo->Acl
->expects($this->any())
->method('linkIsAllowedByRoleId')
->will($this->returnValue(true));
$this->menus = CroogoNav::items();
CroogoNav::clear();
}
/**
* tearDown
*/
public function tearDown() {
ClassRegistry::flush();
CroogoNav::items('sidebar', $this->menus);
unset($this->Croogo);
}
/**
* testAdminMenus
*/
public function testAdminMenus() {
CakeSession::write('Auth.User', array('id' => 1, 'role_id' => 1));
CroogoNav::add('contents', array(
'title' => 'Contents',
'url' => '#',
)
);
$items = CroogoNav::items();
$expected = '<ul class="nav nav-stacked"><li><a href="#" class="menu-contents sidebar-item"><i class="icon-white icon-large"></i> <span>Contents</span></a></li></ul>';
$result = $this->Croogo->adminMenus(CroogoNav::items());
$this->assertEquals($expected, $result);
}
/**
* testAdminRowActions
*/
public function testAdminRowActions() {
$this->Croogo->request->params = array(
'controller' => 'test',
'action' => 'action',
);
Configure::write('Admin.rowActions.Test/action', array(
'Title' => 'plugin:example/controller:example/action:index/:id',
));
$result = $this->Croogo->adminRowActions(1);
$expected = array(
'a' => array(
'href' => '/example/example/index/1',
'class',
),
'Title',
'/a',
);
$this->assertTags($result, $expected);
// test row actions with options
Configure::write('Admin.rowActions.Test/action', array(
'Title' => array(
'plugin:example/controller:example/action:index/:id' => array(
'options' => array(
'icon' => 'key',
'title' => false,
),
),
)
));
$result = $this->Croogo->adminRowActions(1);
$expected = array(
'a' => array(
'href' => '/example/example/index/1',
'class',
),
'i' => array(
'class',
),
'/i',
' Title',
'/a',
);
$this->assertTags($result, $expected);
// test row actions with no title + icon
Configure::write('Admin.rowActions.Test/action', array(
'Title' => array(
'plugin:example/controller:example/action:edit/:id' => array(
'title' => false,
'options' => array(
'icon' => 'edit',
'title' => false,
),
),
)
));
$result = $this->Croogo->adminRowActions(1);
$expected = array(
'a' => array(
'href' => '/example/example/edit/1',
'class' => 'edit',
),
'i' => array(
'class' => 'icon-edit icon-large',
),
'/i',
' ',
'/a',
);
$this->assertTags($result, $expected);
}
/**
* testAdminTabs
*/
public function testAdminTabs() {
$this->Croogo->request->params = array(
'controller' => 'test',
'action' => 'action',
);
Configure::write('Admin.tabs.Test/action', array(
'Title' => array(
'element' => 'blank',
'options' => array(),
),
));
$result = $this->Croogo->adminTabs();
$expected = '<li><a href="#test-title" data-toggle="tab">Title</a></li>';
$this->assertEquals($expected, $result);
$result = $this->Croogo->adminTabs(true);
$this->assertContains('test-title', $result);
}
/**
* testAdminTabsOptions
*/
public function testAdminTabsOptions() {
$this->Croogo->request->params = array(
'controller' => 'test',
'action' => 'action',
);
$testData = 'hellow world';
Configure::write('Admin.tabs.Test/action', array(
'Title' => array(
'element' => 'tab_options',
'options' => array(
'elementData' => array(
'dataFromHookAdminTab' => $testData,
),
'elementOptions' => array(
'ignoreMissing' => true,
),
),
),
));
$result = $this->Croogo->adminTabs();
$expected = '<li><a href="#test-title" data-toggle="tab">Title</a></li>';
$this->assertEquals($expected, $result);
$result = $this->Croogo->adminTabs(true);
$this->assertContains($testData, $result);
$this->assertContains('test-title', $result);
}
public function testAdminBoxes() {
$this->Croogo->request->params = array(
'controller' => 'test',
'action' => 'action',
);
Configure::write('Admin.boxes.Test/action', array(
'Title' => array(
'element' => 'blank',
'options' => array(),
),
));
$result = $this->Croogo->adminBoxes('Title');
$this->assertContains('class="box"', $result);
}
public function testAdminBoxesAlreadyPrinted() {
$this->Croogo->params = array(
'controller' => 'test',
'action' => 'action',
);
Configure::write('Admin.tabs.Test/action', array(
'Title' => array(
'element' => 'blank',
'options' => array(),
),
));
$this->Croogo->adminBoxes('Title');
$result = $this->Croogo->adminBoxes('Title');
$this->assertEquals('', $result);
}
public function testAdminBoxesAll() {
$this->Croogo->request->params = array(
'controller' => 'test',
'action' => 'action',
);
Configure::write('Admin.boxes.Test/action', array(
'Title' => array(
'element' => 'blank',
'options' => array(),
),
'Content' => array(
'element' => 'blank',
'options' => array(),
),
));
$result = $this->Croogo->adminBoxes();
$this->assertContains('Title', $result);
$this->assertContains('Content', $result);
}
public function testSettingsInputCheckbox() {
$setting['Setting']['input_type'] = 'checkbox';
$setting['Setting']['value'] = 0;
$setting['Setting']['description'] = 'A description';
$result = $this->Croogo->settingsInput($setting, 'MyLabel', 0);
$this->assertContains('type="checkbox"', $result);
}
public function testSettingsInputCheckboxChecked() {
$setting['Setting']['input_type'] = 'checkbox';
$setting['Setting']['value'] = 1;
$setting['Setting']['description'] = 'A description';
$result = $this->Croogo->settingsInput($setting, 'MyLabel', 0);
$this->assertContains('type="checkbox"', $result);
$this->assertContains('checked="checked"', $result);
}
public function testSettingsInputTextbox() {
$setting['Setting']['input_type'] = '';
$setting['Setting']['description'] = 'A description';
$setting['Setting']['value'] = 'Yes';
$result = $this->Croogo->settingsInput($setting, 'MyLabel', 0);
$this->assertContains('type="text"', $result);
}
public function testSettingsInputTextarea() {
$setting['Setting']['input_type'] = 'textarea';
$setting['Setting']['description'] = 'A description';
$setting['Setting']['value'] = 'Yes';
$result = $this->Croogo->settingsInput($setting, 'MyLabel', 0);
$this->assertContains('</textarea>', $result);
}
/**
* testAdminRowAction
*/
public function testAdminRowAction() {
$url = array('controller' => 'users', 'action' => 'edit', 1);
$expected = array(
'a' => array(
'href' => '/users/edit/1',
'class' => 'edit',
),
'Edit',
'/a',
);
$result = $this->Croogo->adminRowAction('Edit', $url);
$this->assertTags($result, $expected);
$options = array('class' => 'test-class');
$message = 'Are you sure?';
$onclick = "return confirm('" . $message . "');";
if (version_compare(Configure::version(), '2.4.0', '>=')) {
$onclick = sprintf(
"if (confirm("%s")) { return true; } return false;",
$message
);
}
$expected = array(
'a' => array(
'href' => '/users/edit/1',
'class' => 'test-class edit',
'onclick' => $onclick,
),
'Edit',
'/a',
);
$result = $this->Croogo->adminRowAction('Edit', $url, $options, $message);
$this->assertTags($result, $expected);
}
/**
* testAdminRowActionEscapedConfirmMessage
*/
public function testAdminRowActionEscapedConfirmMessage() {
$url = array('action' => 'delete', 1);
$options = array();
$sure = 'Are you sure?';
$expected = array(
'form' => array(
'action',
'name',
'id',
'style',
'method',
),
'input' => array(
'type',
'name',
'value',
),
'/form',
'a' => array(
'href' => '#',
'class' => 'delete',
'onclick',
),
'span' => array(),
'Del',
'/span',
'/a',
);
$result = $this->Croogo->adminRowAction('<span>Del</span>', $url, array(), $sure);
$this->assertTags($result, $expected);
$quot = '"';
$this->assertContains($quot . $sure . $quot, $result);
}
/**
* testAdminRowActionBulkDelete
*/
public function testAdminRowActionBulkDelete() {
$url = '#Node1Id';
$options = array(
'rowAction' => 'delete',
);
$message = 'Delete this?';
$expected = array(
'a' => array(
'href' => '#Node1Id',
'data-row-action' => 'delete',
'data-confirm-message',
),
'Delete',
'/a',
);
$result = $this->Croogo->adminRowAction('Delete', $url, $options, $message);
$this->assertTags($result, $expected);
}
}
| zhkuskov/croogo_cms_2.0 | Vendor/croogo/croogo/Croogo/Test/Case/View/Helper/CroogoHelperTest.php | PHP | mit | 9,850 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2007-2015 Broad Institute
*
* 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.
*/
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.broad.igv.ui.util;
import java.util.Timer;
import java.util.TimerTask;
/**
* @author jrobinso
*/
public class IndefiniteProgressMonitor extends ProgressMonitor {
int cycleTime;
Timer timer;
private static final int DEFAULT_CYCLE_TIME = 60;
public IndefiniteProgressMonitor(){
this(DEFAULT_CYCLE_TIME);
}
private IndefiniteProgressMonitor(int cycleTime) {
this.cycleTime = cycleTime;
timer = new Timer();
setReady(true);
}
public void start() {
timer.schedule(new CycleTask(), 0, 1000);
}
public void stop() {
timer.cancel();
UIUtilities.invokeOnEventThread(() ->fireProgressChange(100));
}
class CycleTask extends TimerTask {
boolean stop = false;
int progress = 0;
int progressIncrement = 0;
int direction = 1;
long lastTime = System.currentTimeMillis();
@Override
public void run() {
UIUtilities.invokeOnEventThread(() -> fireProgressChange(progressIncrement));
long t = System.currentTimeMillis();
progressIncrement = (int) (direction * (t - lastTime) / (10 * cycleTime));
progress += progressIncrement;
if (progress >= 90) {
progress = 99;
direction = -1;
} else if (progress <
0) {
progress = 1;
direction = 1;
}
lastTime = t;
}
}
}
| popitsch/varan-gie | src/org/broad/igv/ui/util/IndefiniteProgressMonitor.java | Java | mit | 2,776 |
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using System.Collections;
public static class EnumerableRandomizer
{
public static IEnumerable<T> AsRandom<T>(this IList<T> list)
{
int[] indexes = Enumerable.Range(0, list.Count).ToArray();
//Random generator = new Random();
for (int i = 0; i < list.Count; ++i)
{
//int position = generator.Next(i, list.Count);
int position = Random.Range(i, list.Count);
yield return list[indexes[position]];
indexes[position] = indexes[i];
}
}
}
| harjup/ChillTreasureTime | src/ChillTeasureTime/Assets/src/scripts/Helper/EnumerableRandomizer.cs | C# | mit | 611 |
// SocketStream 0.3
// ----------------
'use strict';
// console.log('CHECK');
// console.log(process.env);
// console.log('/CHECK');
require('colors');
var EventEmitter2 = require('eventemitter2').EventEmitter2;
// Get current version from package.json
var version = exports.version = require('./utils/file').loadPackageJSON().version;
// Set root path of your project
var root = exports.root = process.cwd().replace(/\\/g, '/'); // replace '\' with '/' to support Windows
// Warn if attempting to start without a cwd (e.g. through upstart script)
if (root === '/') {
throw new Error('You must change into the project directory before starting your SocketStream app');
}
// Set environment
// console.log("SS ENV IS ", process.env['SS_ENV']);
var env = exports.env = (process.env['NODE_ENV'] || process.env['SS_ENV'] || 'development').toLowerCase();
// Session & Session Store
var session = exports.session = require('./session');
// logging
var log = require('./utils/log');
// Create an internal API object which is passed to sub-modules and can be used within your app
var api = exports.api = {
version: version,
root: root,
env: env,
log: log,
session: session,
// Call ss.api.add('name_of_api', value_or_function) from your app to safely extend the 'ss' internal API object passed through to your /server code
add: function(name, fn) {
if (api[name]) {
throw new Error('Unable to register internal API extension \'' + name + '\' as this name has already been taken');
} else {
api[name] = fn;
return true;
}
}
};
// Create internal Events bus
// Note: only used by the ss-console module for now. This idea will be expended upon in SocketStream 0.4
var events = exports.events = new EventEmitter2();
// Publish Events
var publish = exports.publish = require('./publish/index')();
// HTTP
var http = exports.http = require('./http/index')(root);
// Client Asset Manager
var client = exports.client = require('./client/index')(api, http.router);
// Allow other libs to send assets to the client
api.client = {send: client.assets.send};
// Incoming Request Responders
var responders = exports.responders = require('./request/index')(api);
// Websocket Layer (transport, message responders, transmit incoming events)
var ws = exports.ws = require('./websocket/index')(api, responders);
// Only one instance of the server can be started at once
var serverInstance = null;
// Public API
var start = function(httpServer) {
var responder, fn, sessionID, id,
// Load SocketStream server instance
server = {
responders: responders.load(),
eventTransport: publish.transport.load(),
sessionStore: session.store.get()
};
// Extend the internal API with a publish object you can call from your own server-side code
api.publish = publish.api(server.eventTransport);
// Start web stack
if (httpServer) {
api.log.info('Starting SocketStream %s in %s mode...'.green, version, env);
// Bind responders to websocket
ws.load(httpServer, server.responders, server.eventTransport);
// Append SocketStream middleware to stack
http.load(client.options.dirs['static'], server.sessionStore, session.options);
// Load Client Asset Manager
client.load(api);
// Send server instance to any registered modules (e.g. console)
events.emit('server:start', server);
// If no HTTP server is passed return an API to allow for server-side testing
// Note this feature is currently considered 'experimental' and the implementation will
// be changed in SocketStream 0.4 to ensure any type of Request Responder can be tested
} else {
sessionID = session.create();
for (id in server.responders) {
if (server.responders.hasOwnProperty(id)) {
responder = server.responders[id];
if (responder.name && responder.interfaces.internal) {
fn = function(){
var args = Array.prototype.slice.call(arguments),
cb = args.pop();
return responder.interfaces.internal(args, {sessionId: sessionID, transport: 'test'}, function(err, params){ cb(params); });
};
api.add(responder.name, fn);
}
}
}
}
return api;
};
// Ensure server can only be started once
exports.start = function(httpServer) {
return serverInstance || (serverInstance = start(httpServer));
};
| rybon/Remocial | node_modules/socketstream/lib/socketstream.js | JavaScript | mit | 4,404 |
"use strict";
exports.__esModule = true;
exports["default"] = isDate;
function isDate(value) {
return value instanceof Date && !isNaN(+value);
}
//# sourceMappingURL=isDate.js.map
module.exports = exports["default"];
//# sourceMappingURL=isDate.js.map | binariedMe/blogging | node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/util/isDate.js | JavaScript | mit | 258 |
<TS language="vi_VN" version="2.0">
<context>
<name>AddressBookPage</name>
<message>
<source>Create a new address</source>
<translation>Tạo một địa chỉ mới</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
</context>
<context>
<name>AskPassphraseDialog</name>
</context>
<context>
<name>HivemindGUI</name>
</context>
<context>
<name>ClientModel</name>
</context>
<context>
<name>CoinControlDialog</name>
</context>
<context>
<name>EditAddressDialog</name>
</context>
<context>
<name>FreespaceChecker</name>
</context>
<context>
<name>HelpMessageDialog</name>
</context>
<context>
<name>Intro</name>
</context>
<context>
<name>OpenURIDialog</name>
</context>
<context>
<name>OptionsDialog</name>
</context>
<context>
<name>OverviewPage</name>
</context>
<context>
<name>PaymentServer</name>
</context>
<context>
<name>PeerTableModel</name>
</context>
<context>
<name>QObject</name>
</context>
<context>
<name>QRImageWidget</name>
</context>
<context>
<name>RPCConsole</name>
</context>
<context>
<name>ReceiveCoinsDialog</name>
</context>
<context>
<name>ReceiveRequestDialog</name>
</context>
<context>
<name>RecentRequestsTableModel</name>
</context>
<context>
<name>SendCoinsDialog</name>
</context>
<context>
<name>SendCoinsEntry</name>
</context>
<context>
<name>ShutdownWindow</name>
</context>
<context>
<name>SignVerifyMessageDialog</name>
</context>
<context>
<name>SplashScreen</name>
</context>
<context>
<name>TrafficGraphWidget</name>
</context>
<context>
<name>TransactionDesc</name>
</context>
<context>
<name>TransactionDescDialog</name>
</context>
<context>
<name>TransactionTableModel</name>
</context>
<context>
<name>TransactionView</name>
</context>
<context>
<name>UnitDisplayStatusBarControl</name>
</context>
<context>
<name>WalletFrame</name>
</context>
<context>
<name>WalletModel</name>
</context>
<context>
<name>WalletView</name>
</context>
<context>
<name>hivemind-core</name>
</context>
</TS> | bitcoin-hivemind/hivemind | src/qt/locale/hivemind_vi_VN.ts | TypeScript | mit | 2,272 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Fixtures.AcceptanceTestsBodyComplex
{
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Newtonsoft.Json;
using Models;
/// <summary>
/// Polymorphism operations.
/// </summary>
public partial class Polymorphism : IServiceOperations<AutoRestComplexTestService>, IPolymorphism
{
/// <summary>
/// Initializes a new instance of the Polymorphism class.
/// </summary>
/// <param name='client'>
/// Reference to the service client.
/// </param>
public Polymorphism(AutoRestComplexTestService client)
{
if (client == null)
{
throw new ArgumentNullException("client");
}
this.Client = client;
}
/// <summary>
/// Gets a reference to the AutoRestComplexTestService
/// </summary>
public AutoRestComplexTestService Client { get; private set; }
/// <summary>
/// Get complex types that are polymorphic
/// </summary>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public async Task<HttpOperationResponse<Fish>> GetValidWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
// Tracing
bool shouldTrace = ServiceClientTracing.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(invocationId, this, "GetValid", tracingParameters);
}
// Construct URL
var url = new Uri(this.Client.BaseUri, "/complex/polymorphism/valid").ToString();
// Create HTTP transport objects
HttpRequestMessage httpRequest = new HttpRequestMessage();
httpRequest.Method = new HttpMethod("GET");
httpRequest.RequestUri = new Uri(url);
// Set Headers
if (customHeaders != null)
{
foreach(var header in customHeaders)
{
if (httpRequest.Headers.Contains(header.Key))
{
httpRequest.Headers.Remove(header.Key);
}
httpRequest.Headers.TryAddWithoutValidation(header.Key, header.Value);
}
}
// Send Request
if (shouldTrace)
{
ServiceClientTracing.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
HttpResponseMessage httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
ServiceClientTracing.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
if (!(statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "OK")))
{
var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", statusCode));
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
Error errorBody = JsonConvert.DeserializeObject<Error>(responseContent, this.Client.DeserializationSettings);
if (errorBody != null)
{
ex.Body = errorBody;
}
ex.Request = httpRequest;
ex.Response = httpResponse;
if (shouldTrace)
{
ServiceClientTracing.Error(invocationId, ex);
}
throw ex;
}
// Create Result
var result = new HttpOperationResponse<Fish>();
result.Request = httpRequest;
result.Response = httpResponse;
// Deserialize Response
if (statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "OK"))
{
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
result.Body = JsonConvert.DeserializeObject<Fish>(responseContent, this.Client.DeserializationSettings);
}
if (shouldTrace)
{
ServiceClientTracing.Exit(invocationId, result);
}
return result;
}
/// <summary>
/// Put complex types that are polymorphic
/// </summary>
/// <param name='complexBody'>
/// Please put a salmon that looks like this:
/// {
/// 'dtype':'Salmon',
/// 'location':'alaska',
/// 'iswild':true,
/// 'species':'king',
/// 'length':1.0,
/// 'siblings':[
/// {
/// 'dtype':'Shark',
/// 'age':6,
/// 'birthday': '2012-01-05T01:00:00Z',
/// 'length':20.0,
/// 'species':'predator',
/// },
/// {
/// 'dtype':'Sawshark',
/// 'age':105,
/// 'birthday': '1900-01-05T01:00:00Z',
/// 'length':10.0,
/// 'picture': new Buffer([255, 255, 255, 255,
/// 254]).toString('base64'),
/// 'species':'dangerous',
/// }
/// ]
/// };
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public async Task<HttpOperationResponse> PutValidWithHttpMessagesAsync(Fish complexBody, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (complexBody == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "complexBody");
}
if (complexBody != null)
{
complexBody.Validate();
}
// Tracing
bool shouldTrace = ServiceClientTracing.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("complexBody", complexBody);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(invocationId, this, "PutValid", tracingParameters);
}
// Construct URL
var url = new Uri(this.Client.BaseUri, "/complex/polymorphism/valid").ToString();
// Create HTTP transport objects
HttpRequestMessage httpRequest = new HttpRequestMessage();
httpRequest.Method = new HttpMethod("PUT");
httpRequest.RequestUri = new Uri(url);
// Set Headers
if (customHeaders != null)
{
foreach(var header in customHeaders)
{
if (httpRequest.Headers.Contains(header.Key))
{
httpRequest.Headers.Remove(header.Key);
}
httpRequest.Headers.TryAddWithoutValidation(header.Key, header.Value);
}
}
// Serialize Request
string requestContent = JsonConvert.SerializeObject(complexBody, this.Client.SerializationSettings);
httpRequest.Content = new StringContent(requestContent, Encoding.UTF8);
httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
// Send Request
if (shouldTrace)
{
ServiceClientTracing.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
HttpResponseMessage httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
ServiceClientTracing.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
if (!(statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "OK")))
{
var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", statusCode));
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
Error errorBody = JsonConvert.DeserializeObject<Error>(responseContent, this.Client.DeserializationSettings);
if (errorBody != null)
{
ex.Body = errorBody;
}
ex.Request = httpRequest;
ex.Response = httpResponse;
if (shouldTrace)
{
ServiceClientTracing.Error(invocationId, ex);
}
throw ex;
}
// Create Result
var result = new HttpOperationResponse();
result.Request = httpRequest;
result.Response = httpResponse;
if (shouldTrace)
{
ServiceClientTracing.Exit(invocationId, result);
}
return result;
}
/// <summary>
/// Put complex types that are polymorphic, attempting to omit required
/// 'birthday' field - the request should not be allowed from the client
/// </summary>
/// <param name='complexBody'>
/// Please attempt put a sawshark that looks like this, the client should not
/// allow this data to be sent:
/// {
/// "dtype": "sawshark",
/// "species": "snaggle toothed",
/// "length": 18.5,
/// "age": 2,
/// "birthday": "2013-06-01T01:00:00Z",
/// "location": "alaska",
/// "picture": base64(FF FF FF FF FE),
/// "siblings": [
/// {
/// "dtype": "shark",
/// "species": "predator",
/// "birthday": "2012-01-05T01:00:00Z",
/// "length": 20,
/// "age": 6
/// },
/// {
/// "dtype": "sawshark",
/// "species": "dangerous",
/// "picture": base64(FF FF FF FF FE),
/// "length": 10,
/// "age": 105
/// }
/// ]
/// }
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public async Task<HttpOperationResponse> PutValidMissingRequiredWithHttpMessagesAsync(Fish complexBody, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (complexBody == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "complexBody");
}
if (complexBody != null)
{
complexBody.Validate();
}
// Tracing
bool shouldTrace = ServiceClientTracing.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("complexBody", complexBody);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(invocationId, this, "PutValidMissingRequired", tracingParameters);
}
// Construct URL
var url = new Uri(this.Client.BaseUri, "/complex/polymorphism/missingrequired/invalid").ToString();
// Create HTTP transport objects
HttpRequestMessage httpRequest = new HttpRequestMessage();
httpRequest.Method = new HttpMethod("PUT");
httpRequest.RequestUri = new Uri(url);
// Set Headers
if (customHeaders != null)
{
foreach(var header in customHeaders)
{
if (httpRequest.Headers.Contains(header.Key))
{
httpRequest.Headers.Remove(header.Key);
}
httpRequest.Headers.TryAddWithoutValidation(header.Key, header.Value);
}
}
// Serialize Request
string requestContent = JsonConvert.SerializeObject(complexBody, this.Client.SerializationSettings);
httpRequest.Content = new StringContent(requestContent, Encoding.UTF8);
httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
// Send Request
if (shouldTrace)
{
ServiceClientTracing.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
HttpResponseMessage httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
ServiceClientTracing.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
if (!(statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "OK")))
{
var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", statusCode));
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
Error errorBody = JsonConvert.DeserializeObject<Error>(responseContent, this.Client.DeserializationSettings);
if (errorBody != null)
{
ex.Body = errorBody;
}
ex.Request = httpRequest;
ex.Response = httpResponse;
if (shouldTrace)
{
ServiceClientTracing.Error(invocationId, ex);
}
throw ex;
}
// Create Result
var result = new HttpOperationResponse();
result.Request = httpRequest;
result.Response = httpResponse;
if (shouldTrace)
{
ServiceClientTracing.Exit(invocationId, result);
}
return result;
}
}
}
| colemickens/autorest | AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyComplex/Polymorphism.cs | C# | mit | 16,180 |
/**
* # wrap/modernizr
*
* Wrap global instance for use in RequireJS modules
*
* > http://draeton.github.io/stitches<br/>
* > Copyright 2013 Matthew Cobbs<br/>
* > Licensed under the MIT license.
*/
define(function () {
"use strict";
return Modernizr;
}); | SvDvorak/stitches | src/js/wrap/modernizr.js | JavaScript | mit | 266 |
require 'spec_helper'
describe Admin::OptionsDecorator do
let(:object) { create(:option) }
subject { described_class.new(object) }
describe 'state' do
it 'has state class' do
expect(subject.state).to include 'state'
end
it 'wrapped by span' do
expect(subject.state).to include 'span'
end
context 'active' do
before { object.activate! }
it '.state' do
expect(subject.state).to include 'active'
end
end
context 'disabled' do
it '.state' do
expect(subject.state).to include 'disabled'
end
end
end
end
| mehulsbhatt/smartvpn-billing | spec/decorators/admin/options_decorator_spec.rb | Ruby | mit | 602 |
/*!
* Reference link dialog plugin for Editor.md
*
* @file reference-link-dialog.js
* @author pandao
* @version 1.2.1
* @updateTime 2015-06-09
* {@link https://github.com/pandao/editor.md}
* @license MIT
*/
(function () {
var factory = function (exports) {
var pluginName = "reference-link-dialog";
var ReLinkId = 1;
exports.fn.referenceLinkDialog = function () {
var _this = this;
var cm = this.cm;
var lang = this.lang;
var editor = this.editor;
var settings = this.settings;
var cursor = cm.getCursor();
var selection = cm.getSelection();
var dialogLang = lang.dialog.referenceLink;
var classPrefix = this.classPrefix;
var dialogName = classPrefix + pluginName, dialog;
cm.focus();
if (editor.find("." + dialogName).length < 1) {
var dialogHTML = "<div class=\"" + classPrefix + "form\">" +
"<label>" + dialogLang.name + "</label>" +
"<input type=\"text\" value=\"[" + ReLinkId + "]\" data-name />" +
"<br/>" +
"<label>" + dialogLang.urlId + "</label>" +
"<input type=\"text\" data-url-id />" +
"<br/>" +
"<label>" + dialogLang.url + "</label>" +
"<input type=\"text\" value=\"http://\" data-url />" +
"<br/>" +
"<label>" + dialogLang.urlTitle + "</label>" +
"<input type=\"text\" value=\"" + selection + "\" data-title />" +
"<br/>" +
"</div>";
dialog = this.createDialog({
name: dialogName,
title: dialogLang.title,
width: 380,
height: 296,
content: dialogHTML,
mask: settings.dialogShowMask,
drag: settings.dialogDraggable,
lockScreen: settings.dialogLockScreen,
maskStyle: {
opacity: settings.dialogMaskOpacity,
backgroundColor: settings.dialogMaskBgColor
},
buttons: {
enter: [lang.buttons.enter, function () {
var name = this.find("[data-name]").val();
var url = this.find("[data-url]").val();
var rid = this.find("[data-url-id]").val();
var title = this.find("[data-title]").val();
if (name === "") {
alert(dialogLang.nameEmpty);
return false;
}
if (rid === "") {
alert(dialogLang.idEmpty);
return false;
}
if (url === "http://" || url === "") {
alert(dialogLang.urlEmpty);
return false;
}
//cm.replaceSelection("[" + title + "][" + name + "]\n[" + name + "]: " + url + "");
cm.replaceSelection("[" + name + "][" + rid + "]");
if (selection === "") {
cm.setCursor(cursor.line, cursor.ch + 1);
}
title = (title === "") ? "" : " \"" + title + "\"";
cm.setValue(cm.getValue() + "\n[" + rid + "]: " + url + title + "");
this.hide().lockScreen(false).hideMask();
return false;
}],
cancel: [lang.buttons.cancel, function () {
this.hide().lockScreen(false).hideMask();
return false;
}]
}
});
}
dialog = editor.find("." + dialogName);
dialog.find("[data-name]").val("[" + ReLinkId + "]");
dialog.find("[data-url-id]").val("");
dialog.find("[data-url]").val("http://");
dialog.find("[data-title]").val(selection);
this.dialogShowMask(dialog);
this.dialogLockScreen();
dialog.show();
ReLinkId++;
};
};
// CommonJS/Node.js
if (typeof require === "function" && typeof exports === "object" && typeof module === "object") {
module.exports = factory;
}
else if (typeof define === "function") // AMD/CMD/Sea.js
{
if (define.amd) { // for Require.js
define(["editormd"], function (editormd) {
factory(editormd);
});
} else { // for Sea.js
define(function (require) {
var editormd = require("./../../editormd");
factory(editormd);
});
}
}
else {
factory(window.editormd);
}
})();
| Nightsuki/AVDir | theme/admin/static/editor.md/plugins/reference-link-dialog/reference-link-dialog.js | JavaScript | mit | 5,283 |
require_relative "spec_helper"
describe "change header level" do
let(:filename) { "headers.md" }
it "should increase header of level 1 to level 2" do
given_content "# Header" do |source|
vim.command "call markdown#SwitchStatus()"
vim.write
expect(source).to have_content("## Header")
end
end
it "should increase header of level 3 to level 4" do
given_content "### Header" do |source|
vim.command "call markdown#SwitchStatus()"
vim.write
expect(source).to have_content("#### Header")
end
end
it "should go back to level 1 after level 6" do
given_content "###### Header" do |source|
vim.command "call markdown#SwitchStatus()"
vim.write
expect(source).to have_content("# Header")
end
end
end
| ibabushkin/vim-markdown | spec/change_header_level_spec.rb | Ruby | mit | 787 |
//***************************************************
//* This file was generated by tool
//* SharpKit
//* At: 29/08/2012 03:59:40 p.m.
//***************************************************
using SharpKit.JavaScript;
namespace Ext.dom
{
#region AbstractHelper
/// <inheritdocs />
/// <summary>
/// <p><strong>NOTE</strong> This is a private utility class for internal use by the framework. Don't rely on its existence.</p><p>Abstract base class for <see cref="Ext.dom.Helper">Ext.dom.Helper</see>.</p>
/// </summary>
[JsType(JsMode.Prototype, Export=false, OmitOptionalParameters=true)]
public partial class AbstractHelper : Ext.Base
{
/// <summary>
/// Creates new DOM element(s) and appends them to el.
/// </summary>
/// <param name="el"><p>The context element</p>
/// </param>
/// <param name="o"><p>The DOM object spec (and children) or raw HTML blob</p>
/// </param>
/// <param name="returnElement"><p>true to return a <see cref="Ext.dom.Element">Ext.Element</see></p>
/// </param>
/// <returns>
/// <span>HTMLElement/<see cref="Ext.dom.Element">Ext.Element</see></span><div><p>The new node</p>
/// </div>
/// </returns>
public object append(object el, object o, object returnElement=null){return null;}
/// <summary>
/// Applies a style specification to an element.
/// </summary>
/// <param name="el"><p>The element to apply styles to</p>
/// </param>
/// <param name="styles"><p>A style specification string e.g. 'width:100px', or object in the form {width:'100px'}, or
/// a function which returns such a specification.</p>
/// </param>
public void applyStyles(object el, object styles){}
/// <summary>
/// Converts the styles from the given object to text. The styles are CSS style names
/// with their associated value.
/// The basic form of this method returns a string:
/// <code> var s = <see cref="Ext.DomHelper.generateStyles">Ext.DomHelper.generateStyles</see>({
/// backgroundColor: 'red'
/// });
/// // s = 'background-color:red;'
/// </code>
/// Alternatively, this method can append to an output array.
/// <code> var buf = [];
/// ...
/// <see cref="Ext.DomHelper.generateStyles">Ext.DomHelper.generateStyles</see>({
/// backgroundColor: 'red'
/// }, buf);
/// </code>
/// In this case, the style text is pushed on to the array and the array is returned.
/// </summary>
/// <param name="styles"><p>The object describing the styles.</p>
/// </param>
/// <param name="buffer"><p>The output buffer.</p>
/// </param>
/// <returns>
/// <span><see cref="String">String</see>/<see cref="String">String</see>[]</span><div><p>If buffer is passed, it is returned. Otherwise the style
/// string is returned.</p>
/// </div>
/// </returns>
public object[] generateStyles(object styles, object buffer=null){return null;}
/// <summary>
/// Creates new DOM element(s) and inserts them after el.
/// </summary>
/// <param name="el"><p>The context element</p>
/// </param>
/// <param name="o"><p>The DOM object spec (and children)</p>
/// </param>
/// <param name="returnElement"><p>true to return a <see cref="Ext.dom.Element">Ext.Element</see></p>
/// </param>
/// <returns>
/// <span>HTMLElement/<see cref="Ext.dom.Element">Ext.Element</see></span><div><p>The new node</p>
/// </div>
/// </returns>
public object insertAfter(object el, object o, object returnElement=null){return null;}
/// <summary>
/// Creates new DOM element(s) and inserts them before el.
/// </summary>
/// <param name="el"><p>The context element</p>
/// </param>
/// <param name="o"><p>The DOM object spec (and children) or raw HTML blob</p>
/// </param>
/// <param name="returnElement"><p>true to return a <see cref="Ext.dom.Element">Ext.Element</see></p>
/// </param>
/// <returns>
/// <span>HTMLElement/<see cref="Ext.dom.Element">Ext.Element</see></span><div><p>The new node</p>
/// </div>
/// </returns>
public object insertBefore(object el, object o, object returnElement=null){return null;}
/// <summary>
/// Creates new DOM element(s) and inserts them as the first child of el.
/// </summary>
/// <param name="el"><p>The context element</p>
/// </param>
/// <param name="o"><p>The DOM object spec (and children) or raw HTML blob</p>
/// </param>
/// <param name="returnElement"><p>true to return a <see cref="Ext.dom.Element">Ext.Element</see></p>
/// </param>
/// <returns>
/// <span>HTMLElement/<see cref="Ext.dom.Element">Ext.Element</see></span><div><p>The new node</p>
/// </div>
/// </returns>
public object insertFirst(object el, object o, object returnElement=null){return null;}
/// <summary>
/// Inserts an HTML fragment into the DOM.
/// </summary>
/// <param name="where"><p>Where to insert the html in relation to el - beforeBegin, afterBegin, beforeEnd, afterEnd.</p>
/// <p>For example take the following HTML: <c><div>Contents</div></c></p>
/// <p>Using different <c>where</c> values inserts element to the following places:</p>
/// <ul>
/// <li>beforeBegin: <c><HERE><div>Contents</div></c></li>
/// <li>afterBegin: <c><div><HERE>Contents</div></c></li>
/// <li>beforeEnd: <c><div>Contents<HERE></div></c></li>
/// <li>afterEnd: <c><div>Contents</div><HERE></c></li>
/// </ul>
/// </param>
/// <param name="el"><p>The context element</p>
/// </param>
/// <param name="html"><p>The HTML fragment</p>
/// </param>
/// <returns>
/// <span>HTMLElement</span><div><p>The new node</p>
/// </div>
/// </returns>
public JsObject insertHtml(object where, object el, JsString html){return null;}
/// <summary>
/// Returns the markup for the passed Element(s) config.
/// </summary>
/// <param name="spec"><p>The DOM object spec (and children)</p>
/// </param>
/// <returns>
/// <span><see cref="String">String</see></span><div>
/// </div>
/// </returns>
public JsString markup(object spec){return null;}
/// <summary>
/// Creates new DOM element(s) and overwrites the contents of el with them.
/// </summary>
/// <param name="el"><p>The context element</p>
/// </param>
/// <param name="o"><p>The DOM object spec (and children) or raw HTML blob</p>
/// </param>
/// <param name="returnElement"><p>true to return a <see cref="Ext.dom.Element">Ext.Element</see></p>
/// </param>
/// <returns>
/// <span>HTMLElement/<see cref="Ext.dom.Element">Ext.Element</see></span><div><p>The new node</p>
/// </div>
/// </returns>
public object overwrite(object el, object o, object returnElement=null){return null;}
public AbstractHelper(AbstractHelperConfig config){}
public AbstractHelper(){}
public AbstractHelper(params object[] args){}
}
#endregion
#region AbstractHelperConfig
/// <inheritdocs />
[JsType(JsMode.Json, Export=false, OmitOptionalParameters=true)]
public partial class AbstractHelperConfig : Ext.BaseConfig
{
public AbstractHelperConfig(params object[] args){}
}
#endregion
#region AbstractHelperEvents
/// <inheritdocs />
[JsType(JsMode.Json, Export=false, OmitOptionalParameters=true)]
public partial class AbstractHelperEvents : Ext.BaseEvents
{
public AbstractHelperEvents(params object[] args){}
}
#endregion
}
| SharpKit/SharpKit-SDK | Defs/ExtJs/Ext.dom.AbstractHelper.cs | C# | mit | 8,251 |
'use strict';
exports.__esModule = true;
exports['default'] = publish;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _Subject = require('../Subject');
var _Subject2 = _interopRequireDefault(_Subject);
var _multicast = require('./multicast');
var _multicast2 = _interopRequireDefault(_multicast);
function subjectFactory() {
return new _Subject2['default']();
}
function publish() {
return _multicast2['default'].call(this, subjectFactory);
}
//# sourceMappingURL=publish.js.map
module.exports = exports['default'];
//# sourceMappingURL=publish.js.map | binariedMe/blogging | node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/operators/publish.js | JavaScript | mit | 623 |
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Client
* @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* Zend_XmlRpc_Client_Exception
*/
require_once 'Zend/XmlRpc/Client/Exception.php';
/**
* Thrown by Zend_XmlRpc_Client_Introspection when any error occurs.
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Client
* @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_XmlRpc_Client_IntrospectException extends Zend_XmlRpc_Client_Exception
{}
| KDVS/radio-library | library/Zend/XmlRpc/Client/IntrospectException.php | PHP | mit | 1,193 |
/*================================================================================
code generated by: java2cpp
author: Zoran Angelov, mailto://baldzar@gmail.com
class: org.json.JSONArray
================================================================================*/
#ifndef J2CPP_INCLUDE_IMPLEMENTATION
#ifndef J2CPP_ORG_JSON_JSONARRAY_HPP_DECL
#define J2CPP_ORG_JSON_JSONARRAY_HPP_DECL
namespace j2cpp { namespace java { namespace lang { class String; } } }
namespace j2cpp { namespace java { namespace lang { class Object; } } }
namespace j2cpp { namespace java { namespace util { class Collection; } } }
namespace j2cpp { namespace org { namespace json { class JSONObject; } } }
namespace j2cpp { namespace org { namespace json { class JSONTokener; } } }
#include <java/lang/Object.hpp>
#include <java/lang/String.hpp>
#include <java/util/Collection.hpp>
#include <org/json/JSONObject.hpp>
#include <org/json/JSONTokener.hpp>
namespace j2cpp {
namespace org { namespace json {
class JSONArray;
class JSONArray
: public object<JSONArray>
{
public:
J2CPP_DECLARE_CLASS
J2CPP_DECLARE_METHOD(0)
J2CPP_DECLARE_METHOD(1)
J2CPP_DECLARE_METHOD(2)
J2CPP_DECLARE_METHOD(3)
J2CPP_DECLARE_METHOD(4)
J2CPP_DECLARE_METHOD(5)
J2CPP_DECLARE_METHOD(6)
J2CPP_DECLARE_METHOD(7)
J2CPP_DECLARE_METHOD(8)
J2CPP_DECLARE_METHOD(9)
J2CPP_DECLARE_METHOD(10)
J2CPP_DECLARE_METHOD(11)
J2CPP_DECLARE_METHOD(12)
J2CPP_DECLARE_METHOD(13)
J2CPP_DECLARE_METHOD(14)
J2CPP_DECLARE_METHOD(15)
J2CPP_DECLARE_METHOD(16)
J2CPP_DECLARE_METHOD(17)
J2CPP_DECLARE_METHOD(18)
J2CPP_DECLARE_METHOD(19)
J2CPP_DECLARE_METHOD(20)
J2CPP_DECLARE_METHOD(21)
J2CPP_DECLARE_METHOD(22)
J2CPP_DECLARE_METHOD(23)
J2CPP_DECLARE_METHOD(24)
J2CPP_DECLARE_METHOD(25)
J2CPP_DECLARE_METHOD(26)
J2CPP_DECLARE_METHOD(27)
J2CPP_DECLARE_METHOD(28)
J2CPP_DECLARE_METHOD(29)
J2CPP_DECLARE_METHOD(30)
J2CPP_DECLARE_METHOD(31)
J2CPP_DECLARE_METHOD(32)
J2CPP_DECLARE_METHOD(33)
J2CPP_DECLARE_METHOD(34)
J2CPP_DECLARE_METHOD(35)
J2CPP_DECLARE_METHOD(36)
J2CPP_DECLARE_METHOD(37)
J2CPP_DECLARE_METHOD(38)
J2CPP_DECLARE_METHOD(39)
J2CPP_DECLARE_METHOD(40)
J2CPP_DECLARE_METHOD(41)
J2CPP_DECLARE_METHOD(42)
explicit JSONArray(jobject jobj)
: object<JSONArray>(jobj)
{
}
operator local_ref<java::lang::Object>() const;
JSONArray();
JSONArray(local_ref< java::util::Collection > const&);
JSONArray(local_ref< org::json::JSONTokener > const&);
JSONArray(local_ref< java::lang::String > const&);
jint length();
local_ref< org::json::JSONArray > put(jboolean);
local_ref< org::json::JSONArray > put(jdouble);
local_ref< org::json::JSONArray > put(jint);
local_ref< org::json::JSONArray > put(jlong);
local_ref< org::json::JSONArray > put(local_ref< java::lang::Object > const&);
local_ref< org::json::JSONArray > put(jint, jboolean);
local_ref< org::json::JSONArray > put(jint, jdouble);
local_ref< org::json::JSONArray > put(jint, jint);
local_ref< org::json::JSONArray > put(jint, jlong);
local_ref< org::json::JSONArray > put(jint, local_ref< java::lang::Object > const&);
jboolean isNull(jint);
local_ref< java::lang::Object > get(jint);
local_ref< java::lang::Object > opt(jint);
jboolean getBoolean(jint);
jboolean optBoolean(jint);
jboolean optBoolean(jint, jboolean);
jdouble getDouble(jint);
jdouble optDouble(jint);
jdouble optDouble(jint, jdouble);
jint getInt(jint);
jint optInt(jint);
jint optInt(jint, jint);
jlong getLong(jint);
jlong optLong(jint);
jlong optLong(jint, jlong);
local_ref< java::lang::String > getString(jint);
local_ref< java::lang::String > optString(jint);
local_ref< java::lang::String > optString(jint, local_ref< java::lang::String > const&);
local_ref< org::json::JSONArray > getJSONArray(jint);
local_ref< org::json::JSONArray > optJSONArray(jint);
local_ref< org::json::JSONObject > getJSONObject(jint);
local_ref< org::json::JSONObject > optJSONObject(jint);
local_ref< org::json::JSONObject > toJSONObject(local_ref< org::json::JSONArray > const&);
local_ref< java::lang::String > join(local_ref< java::lang::String > const&);
local_ref< java::lang::String > toString();
local_ref< java::lang::String > toString(jint);
jboolean equals(local_ref< java::lang::Object > const&);
jint hashCode();
}; //class JSONArray
} //namespace json
} //namespace org
} //namespace j2cpp
#endif //J2CPP_ORG_JSON_JSONARRAY_HPP_DECL
#else //J2CPP_INCLUDE_IMPLEMENTATION
#ifndef J2CPP_ORG_JSON_JSONARRAY_HPP_IMPL
#define J2CPP_ORG_JSON_JSONARRAY_HPP_IMPL
namespace j2cpp {
org::json::JSONArray::operator local_ref<java::lang::Object>() const
{
return local_ref<java::lang::Object>(get_jobject());
}
org::json::JSONArray::JSONArray()
: object<org::json::JSONArray>(
call_new_object<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(0),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(0)
>()
)
{
}
org::json::JSONArray::JSONArray(local_ref< java::util::Collection > const &a0)
: object<org::json::JSONArray>(
call_new_object<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(1),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(1)
>(a0)
)
{
}
org::json::JSONArray::JSONArray(local_ref< org::json::JSONTokener > const &a0)
: object<org::json::JSONArray>(
call_new_object<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(2),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(2)
>(a0)
)
{
}
org::json::JSONArray::JSONArray(local_ref< java::lang::String > const &a0)
: object<org::json::JSONArray>(
call_new_object<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(3),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(3)
>(a0)
)
{
}
jint org::json::JSONArray::length()
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(4),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(4),
jint
>(get_jobject());
}
local_ref< org::json::JSONArray > org::json::JSONArray::put(jboolean a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(5),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(5),
local_ref< org::json::JSONArray >
>(get_jobject(), a0);
}
local_ref< org::json::JSONArray > org::json::JSONArray::put(jdouble a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(6),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(6),
local_ref< org::json::JSONArray >
>(get_jobject(), a0);
}
local_ref< org::json::JSONArray > org::json::JSONArray::put(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(7),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(7),
local_ref< org::json::JSONArray >
>(get_jobject(), a0);
}
local_ref< org::json::JSONArray > org::json::JSONArray::put(jlong a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(8),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(8),
local_ref< org::json::JSONArray >
>(get_jobject(), a0);
}
local_ref< org::json::JSONArray > org::json::JSONArray::put(local_ref< java::lang::Object > const &a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(9),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(9),
local_ref< org::json::JSONArray >
>(get_jobject(), a0);
}
local_ref< org::json::JSONArray > org::json::JSONArray::put(jint a0, jboolean a1)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(10),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(10),
local_ref< org::json::JSONArray >
>(get_jobject(), a0, a1);
}
local_ref< org::json::JSONArray > org::json::JSONArray::put(jint a0, jdouble a1)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(11),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(11),
local_ref< org::json::JSONArray >
>(get_jobject(), a0, a1);
}
local_ref< org::json::JSONArray > org::json::JSONArray::put(jint a0, jint a1)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(12),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(12),
local_ref< org::json::JSONArray >
>(get_jobject(), a0, a1);
}
local_ref< org::json::JSONArray > org::json::JSONArray::put(jint a0, jlong a1)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(13),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(13),
local_ref< org::json::JSONArray >
>(get_jobject(), a0, a1);
}
local_ref< org::json::JSONArray > org::json::JSONArray::put(jint a0, local_ref< java::lang::Object > const &a1)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(14),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(14),
local_ref< org::json::JSONArray >
>(get_jobject(), a0, a1);
}
jboolean org::json::JSONArray::isNull(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(15),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(15),
jboolean
>(get_jobject(), a0);
}
local_ref< java::lang::Object > org::json::JSONArray::get(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(16),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(16),
local_ref< java::lang::Object >
>(get_jobject(), a0);
}
local_ref< java::lang::Object > org::json::JSONArray::opt(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(17),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(17),
local_ref< java::lang::Object >
>(get_jobject(), a0);
}
jboolean org::json::JSONArray::getBoolean(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(18),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(18),
jboolean
>(get_jobject(), a0);
}
jboolean org::json::JSONArray::optBoolean(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(19),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(19),
jboolean
>(get_jobject(), a0);
}
jboolean org::json::JSONArray::optBoolean(jint a0, jboolean a1)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(20),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(20),
jboolean
>(get_jobject(), a0, a1);
}
jdouble org::json::JSONArray::getDouble(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(21),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(21),
jdouble
>(get_jobject(), a0);
}
jdouble org::json::JSONArray::optDouble(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(22),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(22),
jdouble
>(get_jobject(), a0);
}
jdouble org::json::JSONArray::optDouble(jint a0, jdouble a1)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(23),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(23),
jdouble
>(get_jobject(), a0, a1);
}
jint org::json::JSONArray::getInt(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(24),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(24),
jint
>(get_jobject(), a0);
}
jint org::json::JSONArray::optInt(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(25),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(25),
jint
>(get_jobject(), a0);
}
jint org::json::JSONArray::optInt(jint a0, jint a1)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(26),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(26),
jint
>(get_jobject(), a0, a1);
}
jlong org::json::JSONArray::getLong(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(27),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(27),
jlong
>(get_jobject(), a0);
}
jlong org::json::JSONArray::optLong(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(28),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(28),
jlong
>(get_jobject(), a0);
}
jlong org::json::JSONArray::optLong(jint a0, jlong a1)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(29),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(29),
jlong
>(get_jobject(), a0, a1);
}
local_ref< java::lang::String > org::json::JSONArray::getString(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(30),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(30),
local_ref< java::lang::String >
>(get_jobject(), a0);
}
local_ref< java::lang::String > org::json::JSONArray::optString(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(31),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(31),
local_ref< java::lang::String >
>(get_jobject(), a0);
}
local_ref< java::lang::String > org::json::JSONArray::optString(jint a0, local_ref< java::lang::String > const &a1)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(32),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(32),
local_ref< java::lang::String >
>(get_jobject(), a0, a1);
}
local_ref< org::json::JSONArray > org::json::JSONArray::getJSONArray(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(33),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(33),
local_ref< org::json::JSONArray >
>(get_jobject(), a0);
}
local_ref< org::json::JSONArray > org::json::JSONArray::optJSONArray(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(34),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(34),
local_ref< org::json::JSONArray >
>(get_jobject(), a0);
}
local_ref< org::json::JSONObject > org::json::JSONArray::getJSONObject(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(35),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(35),
local_ref< org::json::JSONObject >
>(get_jobject(), a0);
}
local_ref< org::json::JSONObject > org::json::JSONArray::optJSONObject(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(36),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(36),
local_ref< org::json::JSONObject >
>(get_jobject(), a0);
}
local_ref< org::json::JSONObject > org::json::JSONArray::toJSONObject(local_ref< org::json::JSONArray > const &a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(37),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(37),
local_ref< org::json::JSONObject >
>(get_jobject(), a0);
}
local_ref< java::lang::String > org::json::JSONArray::join(local_ref< java::lang::String > const &a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(38),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(38),
local_ref< java::lang::String >
>(get_jobject(), a0);
}
local_ref< java::lang::String > org::json::JSONArray::toString()
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(39),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(39),
local_ref< java::lang::String >
>(get_jobject());
}
local_ref< java::lang::String > org::json::JSONArray::toString(jint a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(40),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(40),
local_ref< java::lang::String >
>(get_jobject(), a0);
}
jboolean org::json::JSONArray::equals(local_ref< java::lang::Object > const &a0)
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(41),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(41),
jboolean
>(get_jobject(), a0);
}
jint org::json::JSONArray::hashCode()
{
return call_method<
org::json::JSONArray::J2CPP_CLASS_NAME,
org::json::JSONArray::J2CPP_METHOD_NAME(42),
org::json::JSONArray::J2CPP_METHOD_SIGNATURE(42),
jint
>(get_jobject());
}
J2CPP_DEFINE_CLASS(org::json::JSONArray,"org/json/JSONArray")
J2CPP_DEFINE_METHOD(org::json::JSONArray,0,"<init>","()V")
J2CPP_DEFINE_METHOD(org::json::JSONArray,1,"<init>","(Ljava/util/Collection;)V")
J2CPP_DEFINE_METHOD(org::json::JSONArray,2,"<init>","(Lorg/json/JSONTokener;)V")
J2CPP_DEFINE_METHOD(org::json::JSONArray,3,"<init>","(Ljava/lang/String;)V")
J2CPP_DEFINE_METHOD(org::json::JSONArray,4,"length","()I")
J2CPP_DEFINE_METHOD(org::json::JSONArray,5,"put","(Z)Lorg/json/JSONArray;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,6,"put","(D)Lorg/json/JSONArray;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,7,"put","(I)Lorg/json/JSONArray;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,8,"put","(J)Lorg/json/JSONArray;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,9,"put","(Ljava/lang/Object;)Lorg/json/JSONArray;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,10,"put","(IZ)Lorg/json/JSONArray;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,11,"put","(ID)Lorg/json/JSONArray;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,12,"put","(II)Lorg/json/JSONArray;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,13,"put","(IJ)Lorg/json/JSONArray;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,14,"put","(ILjava/lang/Object;)Lorg/json/JSONArray;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,15,"isNull","(I)Z")
J2CPP_DEFINE_METHOD(org::json::JSONArray,16,"get","(I)Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,17,"opt","(I)Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,18,"getBoolean","(I)Z")
J2CPP_DEFINE_METHOD(org::json::JSONArray,19,"optBoolean","(I)Z")
J2CPP_DEFINE_METHOD(org::json::JSONArray,20,"optBoolean","(IZ)Z")
J2CPP_DEFINE_METHOD(org::json::JSONArray,21,"getDouble","(I)D")
J2CPP_DEFINE_METHOD(org::json::JSONArray,22,"optDouble","(I)D")
J2CPP_DEFINE_METHOD(org::json::JSONArray,23,"optDouble","(ID)D")
J2CPP_DEFINE_METHOD(org::json::JSONArray,24,"getInt","(I)I")
J2CPP_DEFINE_METHOD(org::json::JSONArray,25,"optInt","(I)I")
J2CPP_DEFINE_METHOD(org::json::JSONArray,26,"optInt","(II)I")
J2CPP_DEFINE_METHOD(org::json::JSONArray,27,"getLong","(I)J")
J2CPP_DEFINE_METHOD(org::json::JSONArray,28,"optLong","(I)J")
J2CPP_DEFINE_METHOD(org::json::JSONArray,29,"optLong","(IJ)J")
J2CPP_DEFINE_METHOD(org::json::JSONArray,30,"getString","(I)Ljava/lang/String;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,31,"optString","(I)Ljava/lang/String;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,32,"optString","(ILjava/lang/String;)Ljava/lang/String;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,33,"getJSONArray","(I)Lorg/json/JSONArray;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,34,"optJSONArray","(I)Lorg/json/JSONArray;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,35,"getJSONObject","(I)Lorg/json/JSONObject;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,36,"optJSONObject","(I)Lorg/json/JSONObject;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,37,"toJSONObject","(Lorg/json/JSONArray;)Lorg/json/JSONObject;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,38,"join","(Ljava/lang/String;)Ljava/lang/String;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,39,"toString","()Ljava/lang/String;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,40,"toString","(I)Ljava/lang/String;")
J2CPP_DEFINE_METHOD(org::json::JSONArray,41,"equals","(Ljava/lang/Object;)Z")
J2CPP_DEFINE_METHOD(org::json::JSONArray,42,"hashCode","()I")
} //namespace j2cpp
#endif //J2CPP_ORG_JSON_JSONARRAY_HPP_IMPL
#endif //J2CPP_INCLUDE_IMPLEMENTATION
| seem-sky/ph-open | proj.android/jni/puzzleHero/platforms/android-9/org/json/JSONArray.hpp | C++ | mit | 21,035 |
//===- RegionPass.cpp - Region Pass and Region Pass Manager ---------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements RegionPass and RGPassManager. All region optimization
// and transformation passes are derived from RegionPass. RGPassManager is
// responsible for managing RegionPasses.
// Most of this code has been COPIED from LoopPass.cpp
//
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/RegionPass.h"
#include "llvm/Analysis/RegionIterator.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
#define DEBUG_TYPE "regionpassmgr"
//===----------------------------------------------------------------------===//
// RGPassManager
//
char RGPassManager::ID = 0;
RGPassManager::RGPassManager()
: FunctionPass(ID), PMDataManager() {
skipThisRegion = false;
redoThisRegion = false;
RI = nullptr;
CurrentRegion = nullptr;
}
// Recurse through all subregions and all regions into RQ.
static void addRegionIntoQueue(Region &R, std::deque<Region *> &RQ) {
RQ.push_back(&R);
for (const auto &E : R)
addRegionIntoQueue(*E, RQ);
}
/// Pass Manager itself does not invalidate any analysis info.
void RGPassManager::getAnalysisUsage(AnalysisUsage &Info) const {
Info.addRequired<RegionInfoPass>();
Info.setPreservesAll();
}
/// run - Execute all of the passes scheduled for execution. Keep track of
/// whether any of the passes modifies the function, and if so, return true.
bool RGPassManager::runOnFunction(Function &F) {
RI = &getAnalysis<RegionInfoPass>().getRegionInfo();
bool Changed = false;
// Collect inherited analysis from Module level pass manager.
populateInheritedAnalysis(TPM->activeStack);
addRegionIntoQueue(*RI->getTopLevelRegion(), RQ);
if (RQ.empty()) // No regions, skip calling finalizers
return false;
// Initialization
for (Region *R : RQ) {
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
RegionPass *RP = (RegionPass *)getContainedPass(Index);
Changed |= RP->doInitialization(R, *this);
}
}
// Walk Regions
while (!RQ.empty()) {
CurrentRegion = RQ.back();
skipThisRegion = false;
redoThisRegion = false;
// Run all passes on the current Region.
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
RegionPass *P = (RegionPass*)getContainedPass(Index);
if (isPassDebuggingExecutionsOrMore()) {
dumpPassInfo(P, EXECUTION_MSG, ON_REGION_MSG,
CurrentRegion->getNameStr());
dumpRequiredSet(P);
}
initializeAnalysisImpl(P);
{
PassManagerPrettyStackEntry X(P, *CurrentRegion->getEntry());
TimeRegion PassTimer(getPassTimer(P));
Changed |= P->runOnRegion(CurrentRegion, *this);
}
if (isPassDebuggingExecutionsOrMore()) {
if (Changed)
dumpPassInfo(P, MODIFICATION_MSG, ON_REGION_MSG,
skipThisRegion ? "<deleted>" :
CurrentRegion->getNameStr());
dumpPreservedSet(P);
}
if (!skipThisRegion) {
// Manually check that this region is still healthy. This is done
// instead of relying on RegionInfo::verifyRegion since RegionInfo
// is a function pass and it's really expensive to verify every
// Region in the function every time. That level of checking can be
// enabled with the -verify-region-info option.
{
TimeRegion PassTimer(getPassTimer(P));
CurrentRegion->verifyRegion();
}
// Then call the regular verifyAnalysis functions.
verifyPreservedAnalysis(P);
}
removeNotPreservedAnalysis(P);
recordAvailableAnalysis(P);
removeDeadPasses(P,
(!isPassDebuggingExecutionsOrMore() || skipThisRegion) ?
"<deleted>" : CurrentRegion->getNameStr(),
ON_REGION_MSG);
if (skipThisRegion)
// Do not run other passes on this region.
break;
}
// If the region was deleted, release all the region passes. This frees up
// some memory, and avoids trouble with the pass manager trying to call
// verifyAnalysis on them.
if (skipThisRegion)
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
Pass *P = getContainedPass(Index);
freePass(P, "<deleted>", ON_REGION_MSG);
}
// Pop the region from queue after running all passes.
RQ.pop_back();
if (redoThisRegion)
RQ.push_back(CurrentRegion);
// Free all region nodes created in region passes.
RI->clearNodeCache();
}
// Finalization
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
RegionPass *P = (RegionPass*)getContainedPass(Index);
Changed |= P->doFinalization();
}
// Print the region tree after all pass.
DEBUG(
dbgs() << "\nRegion tree of function " << F.getName()
<< " after all region Pass:\n";
RI->dump();
dbgs() << "\n";
);
return Changed;
}
/// Print passes managed by this manager
void RGPassManager::dumpPassStructure(unsigned Offset) {
errs().indent(Offset*2) << "Region Pass Manager\n";
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
Pass *P = getContainedPass(Index);
P->dumpPassStructure(Offset + 1);
dumpLastUses(P, Offset+1);
}
}
namespace {
//===----------------------------------------------------------------------===//
// PrintRegionPass
class PrintRegionPass : public RegionPass {
private:
std::string Banner;
raw_ostream &Out; // raw_ostream to print on.
public:
static char ID;
PrintRegionPass(const std::string &B, raw_ostream &o)
: RegionPass(ID), Banner(B), Out(o) {}
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
bool runOnRegion(Region *R, RGPassManager &RGM) override {
Out << Banner;
for (const auto *BB : R->blocks()) {
if (BB)
BB->print(Out);
else
Out << "Printing <null> Block";
}
return false;
}
};
char PrintRegionPass::ID = 0;
} //end anonymous namespace
//===----------------------------------------------------------------------===//
// RegionPass
// Check if this pass is suitable for the current RGPassManager, if
// available. This pass P is not suitable for a RGPassManager if P
// is not preserving higher level analysis info used by other
// RGPassManager passes. In such case, pop RGPassManager from the
// stack. This will force assignPassManager() to create new
// LPPassManger as expected.
void RegionPass::preparePassManager(PMStack &PMS) {
// Find RGPassManager
while (!PMS.empty() &&
PMS.top()->getPassManagerType() > PMT_RegionPassManager)
PMS.pop();
// If this pass is destroying high level information that is used
// by other passes that are managed by LPM then do not insert
// this pass in current LPM. Use new RGPassManager.
if (PMS.top()->getPassManagerType() == PMT_RegionPassManager &&
!PMS.top()->preserveHigherLevelAnalysis(this))
PMS.pop();
}
/// Assign pass manager to manage this pass.
void RegionPass::assignPassManager(PMStack &PMS,
PassManagerType PreferredType) {
// Find RGPassManager
while (!PMS.empty() &&
PMS.top()->getPassManagerType() > PMT_RegionPassManager)
PMS.pop();
RGPassManager *RGPM;
// Create new Region Pass Manager if it does not exist.
if (PMS.top()->getPassManagerType() == PMT_RegionPassManager)
RGPM = (RGPassManager*)PMS.top();
else {
assert (!PMS.empty() && "Unable to create Region Pass Manager");
PMDataManager *PMD = PMS.top();
// [1] Create new Region Pass Manager
RGPM = new RGPassManager();
RGPM->populateInheritedAnalysis(PMS);
// [2] Set up new manager's top level manager
PMTopLevelManager *TPM = PMD->getTopLevelManager();
TPM->addIndirectPassManager(RGPM);
// [3] Assign manager to manage this new manager. This may create
// and push new managers into PMS
TPM->schedulePass(RGPM);
// [4] Push new manager into PMS
PMS.push(RGPM);
}
RGPM->add(this);
}
/// Get the printer pass
Pass *RegionPass::createPrinterPass(raw_ostream &O,
const std::string &Banner) const {
return new PrintRegionPass(Banner, O);
}
| ensemblr/llvm-project-boilerplate | include/llvm/lib/Analysis/RegionPass.cpp | C++ | mit | 8,720 |
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">Dependencies</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
</div>
<!-- /.box-header -->
<div class="box-body dependencies">
<div class="table-responsive">
<table class="table table-striped">
@foreach($dependencies as $dependency => $version)
<tr>
<td width="240px">{{ $dependency }}</td>
<td><span class="label label-primary">{{ $version }}</span></td>
</tr>
@endforeach
</table>
</div>
<!-- /.table-responsive -->
</div>
<!-- /.box-body -->
</div>
<script>
$('.dependencies').slimscroll({height:'510px',size:'3px'});
</script>
| z-song/laravel-admin | resources/views/dashboard/dependencies.blade.php | PHP | mit | 1,074 |
<?php
namespace Oro\Bundle\EntityExtendBundle\Entity\Repository;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Oro\Bundle\EntityExtendBundle\Entity\AbstractEnumValue;
use Oro\Bundle\EntityExtendBundle\Tools\ExtendHelper;
class EnumValueRepository extends EntityRepository
{
/**
* Creates an entity represents an enum value
*
* @param string $name The enum value name
* @param int $priority An number used to sort enum values on UI.
* Values with less priority is rendered at the top
* @param boolean $default Determines if this value is selected by default for new records
* @param string|null $id The enum value identifier. If not specified it is generated
* automatically based on the given name. Usually it is the same as name,
* but spaces are replaced with underscore and result is converted to lower case.
* As the id length is limited to 32 characters, in case if the name is longer then
* some hashing function is used to generate the id.
*
* @return AbstractEnumValue
*
* @throws \InvalidArgumentException
*/
public function createEnumValue($name, $priority, $default, $id = null)
{
if (strlen($name) === 0) {
throw new \InvalidArgumentException('$name must not be empty.');
}
if (!isset($id) || $id === '') {
$id = ExtendHelper::buildEnumValueId($name);
} elseif (strlen($id) > ExtendHelper::MAX_ENUM_VALUE_ID_LENGTH) {
throw new \InvalidArgumentException(
sprintf(
'$id length must be less or equal %d characters. id: %s.',
ExtendHelper::MAX_ENUM_VALUE_ID_LENGTH,
$id
)
);
}
$enumValueClassName = $this->getClassName();
return new $enumValueClassName($id, $name, $priority, $default);
}
/**
* @return QueryBuilder
*/
public function getValuesQueryBuilder()
{
$qb = $this->createQueryBuilder('e');
$qb->orderBy($qb->expr()->asc('e.priority'));
return $qb;
}
/**
* @return AbstractEnumValue[]
*/
public function getValues()
{
return $this->getValuesQueryBuilder()->getQuery()->getResult();
}
/**
* @return QueryBuilder
*/
public function getDefaultValuesQueryBuilder()
{
$qb = $this->getValuesQueryBuilder();
$qb->andWhere($qb->expr()->eq('e.default', ':default'))
->setParameter('default', true);
return $qb;
}
/**
* @return AbstractEnumValue[]
*/
public function getDefaultValues()
{
return $this->getDefaultValuesQueryBuilder()->getQuery()->getResult();
}
}
| Djamy/platform | src/Oro/Bundle/EntityExtendBundle/Entity/Repository/EnumValueRepository.php | PHP | mit | 2,951 |
using System.Linq;
using Shouldly;
using Xunit;
namespace Marten.Testing.Bugs
{
public class Bug_337_certain_boolean_searches_are_not_using_searchable_field : IntegratedFixture
{
[Fact]
public void use_searchable_fields_in_generated_sql()
{
StoreOptions(_ =>
{
_.Schema.For<Target>().Duplicate(x => x.Flag).GinIndexJsonData();
});
using (var session = theStore.OpenSession())
{
var cmd1 = session.Query<Target>().Where(x => x.Flag == false).ToCommand();
var cmd2 = session.Query<Target>().Where(x => !x.Flag).ToCommand();
cmd1.CommandText.ShouldBe("select d.data, d.id, d.mt_version from public.mt_doc_target as d where d.flag = :arg0");
cmd2.CommandText.ShouldBe("select d.data, d.id, d.mt_version from public.mt_doc_target as d where d.flag = False");
}
}
[Fact]
public void booleans_in_generated_sql_without_being_searchable()
{
StoreOptions(_ =>
{
_.Schema.For<Target>().GinIndexJsonData();
//_.Schema.For<Target>().Duplicate(x => x.Flag);
});
using (var session = theStore.OpenSession())
{
var cmd1 = session.Query<Target>().Where(x => x.Flag == false).ToCommand();
cmd1.CommandText.ShouldBe("select d.data, d.id, d.mt_version from public.mt_doc_target as d where d.data @> :arg0");
}
}
}
} | jmbledsoe/marten | src/Marten.Testing/Bugs/Bug_337_certain_boolean_searches_are_not_using_searchable_field.cs | C# | mit | 1,572 |
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magento.com for more information.
*
* @category Mage
* @package Mage_Customer
* @copyright Copyright (c) 2006-2017 X.commerce, Inc. and affiliates (http://www.magento.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Customer password attribute backend
*
* @category Mage
* @package Mage_Customer
* @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Customer_Model_Customer_Attribute_Backend_Password extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract
{
/**
* Special processing before attribute save:
* a) check some rules for password
* b) transform temporary attribute 'password' into real attribute 'password_hash'
*/
public function beforeSave($object)
{
$password = trim($object->getPassword());
$len = Mage::helper('core/string')->strlen($password);
if ($len) {
if ($len < 6) {
Mage::throwException(Mage::helper('customer')->__('The password must have at least 6 characters. Leading or trailing spaces will be ignored.'));
}
$object->setPasswordHash($object->hashPassword($password));
}
}
public function validate($object)
{
if ($password = $object->getPassword()) {
if ($password == $object->getPasswordConfirm()) {
return true;
}
}
return parent::validate($object);
}
}
| fabiensebban/magento | app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Password.php | PHP | mit | 2,169 |
/*
* Copyright (c) 2008-2014 Maxifier Ltd. All Rights Reserved.
*/
package com.maxifier.mxcache.caches;
/**
* THIS IS GENERATED CLASS! DON'T EDIT IT MANUALLY!
*
* GENERATED FROM P2PCache.template
*
* @author Andrey Yakoushin (andrey.yakoushin@maxifier.com)
* @author Alexander Kochurov (alexander.kochurov@maxifier.com)
*/
public interface DoubleCache extends Cache {
double getOrCreate();
} | akochurov/mxcache | mxcache-runtime/src/main/java/com/maxifier/mxcache/caches/DoubleCache.java | Java | mit | 420 |
// Generated by typings
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/f3171e4cc00e270852e60d257931c8ea37273f2d/angular-ui-bootstrap/angular-ui-bootstrap.d.ts
declare module 'angular-bootstrap' {
let _: string;
export = _;
}
declare module 'angular-ui-bootstrap' {
let _: string;
export = _;
}
declare namespace angular.ui.bootstrap {
interface IAccordionConfig {
/**
* Controls whether expanding an item will cause the other items to close.
*
* @default true
*/
closeOthers?: boolean;
}
interface IButtonConfig {
/**
* @default: 'active'
*/
activeClass?: string;
/**
* @default: 'Click'
*/
toggleEvent?: string;
}
interface IDatepickerConfig {
/**
* Format of day in month.
*
* @default 'dd'
*/
formatDay?: string;
/**
* Format of month in year.
*
* @default 'MMM'
*/
formatMonth?: string;
/**
* Format of year in year range.
*
* @default 'yyyy'
*/
formatYear?: string;
/**
* Format of day in week header.
*
* @default 'EEE'
*/
formatDayHeader?: string;
/**
* Format of title when selecting day.
*
* @default 'MMM yyyy'
*/
formatDayTitle?: string;
/**
* Format of title when selecting month.
*
* @default 'yyyy'
*/
formatMonthTitle?: string;
/**
* Current mode of the datepicker (day|month|year). Can be used to initialize datepicker to specific mode.
*
* @default 'day'
*/
datepickerMode?: string;
/**
* Set a lower limit for mode.
*
* @default 'day'
*/
minMode?: string;
/**
* Set an upper limit for mode.
*
* @default 'year'
*/
maxMode?: string;
/**
* Whether to display week numbers.
*
* @default true
*/
showWeeks?: boolean;
/**
* Starting day of the week from 0-6 where 0=Sunday and 6=Saturday.
*
* @default 0
*/
startingDay?: number;
/**
* Number of years displayed in year selection.
*
* @default 20
*/
yearRange?: number;
/**
* Defines the minimum available date.
*
* @default null
*/
minDate?: any;
/**
* Defines the maximum available date.
*
* @default null
*/
maxDate?: any;
/**
* An option to disable or enable shortcut's event propagation
*
* @default false
*/
shortcutPropagation?: boolean;
}
interface IDatepickerPopupConfig {
/**
* The format for displayed dates.
*
* @default 'yyyy-MM-dd'
*/
datepickerPopup?: string;
/**
* Allows overriding of default template of the popup.
*
* @default 'template/datepicker/popup.html'
*/
datepickerPopupTemplateUrl?: string;
/**
* Allows overriding of default template of the datepicker used in popup.
*
* @default 'template/datepicker/popup.html'
*/
datepickerTemplateUrl?: string;
/**
* Allows overriding of the default format for html5 date inputs.
*/
html5Types?: {
date?: string;
'datetime-local'?: string;
month?: string;
};
/**
* The text to display for the current day button.
*
* @default 'Today'
*/
currentText?: string;
/**
* The text to display for the clear button.
*
* @default 'Clear'
*/
clearText?: string;
/**
* The text to display for the close button.
*
* @default 'Done'
*/
closeText?: string;
/**
* Whether to close calendar when a date is chosen.
*
* @default true
*/
closeOnDateSelection?: boolean;
/**
* Append the datepicker popup element to `body`, rather than inserting after `datepicker-popup`.
*
* @default false
*/
appendToBody?: boolean;
/**
* Whether to display a button bar underneath the datepicker.
*
* @default true
*/
showButtonBar?: boolean;
/**
* Whether to focus the datepicker popup upon opening.
*
* @default true
*/
onOpenFocus?: boolean;
}
interface IModalProvider {
/**
* Default options all modals will use.
*/
options: IModalSettings;
}
interface IModalService {
/**
* @param {IModalSettings} options
* @returns {IModalServiceInstance}
*/
open(options: IModalSettings): IModalServiceInstance;
}
interface IModalServiceInstance {
/**
* A method that can be used to close a modal, passing a result. If `preventDefault` is called on the `modal.closing` event then the modal will remain open.
*/
close(result?: any): void;
/**
* A method that can be used to dismiss a modal, passing a reason. If `preventDefault` is called on the `modal.closing` event then the modal will remain open.
*/
dismiss(reason?: any): void;
/**
* A promise that is resolved when a modal is closed and rejected when a modal is dismissed.
*/
result: angular.IPromise<any>;
/**
* A promise that is resolved when a modal gets opened after downloading content's template and resolving all variables.
*/
opened: angular.IPromise<any>;
/**
* A promise that is resolved when a modal is rendered.
*/
rendered: angular.IPromise<any>;
/**
* A promise that is resolved when a modal is closed and the animation completes.
*/
closed: angular.IPromise<any>;
}
interface IModalScope extends angular.IScope {
/**
* Dismiss the dialog without assigning a value to the promise output. If `preventDefault` is called on the `modal.closing` event then the modal will remain open.
*
* @returns true if the modal was closed; otherwise false
*/
$dismiss(reason?: any): boolean;
/**
* Close the dialog resolving the promise to the given value. If `preventDefault` is called on the `modal.closing` event then the modal will remain open.
*
* @returns true if the modal was closed; otherwise false
*/
$close(result?: any): boolean;
}
interface IModalSettings {
/**
* a path to a template representing modal's content
*/
templateUrl?: string | (() => string);
/**
* inline template representing the modal's content
*/
template?: string;
/**
* a scope instance to be used for the modal's content (actually the $modal service is going to create a child scope of a provided scope).
* Defaults to `$rootScope`.
*/
scope?: angular.IScope|IModalScope;
/**
* a controller for a modal instance - it can initialize scope used by modal.
* A controller can be injected with `$modalInstance`
* If value is an array, it must be in Inline Array Annotation format for injection (strings followed by factory method)
*/
controller?: string | Function | Array<string | Function>;
/**
* an alternative to the controller-as syntax, matching the API of directive definitions.
* Requires the controller option to be provided as well
*/
controllerAs?: string;
/**
* When used with controllerAs and set to true, it will bind the controller properties onto the $scope directly.
*
* @default false
*/
bindToController?: boolean;
/**
* members that will be resolved and passed to the controller as locals; it is equivalent of the `resolve` property for AngularJS routes
* If property value is an array, it must be in Inline Array Annotation format for injection (strings followed by factory method)
*/
resolve?: { [ key: string ]: string | Function | Array<string | Function> | Object };
/**
* Set to false to disable animations on new modal/backdrop. Does not toggle animations for modals/backdrops that are already displayed.
*
* @default true
*/
animation?: boolean;
/**
* controls the presence of a backdrop
* Allowed values:
* - true (default)
* - false (no backdrop)
* - 'static' backdrop is present but modal window is not closed when clicking outside of the modal window
*
* @default true
*/
backdrop?: boolean | string;
/**
* indicates whether the dialog should be closable by hitting the ESC key
*
* @default true
*/
keyboard?: boolean;
/**
* additional CSS class(es) to be added to a modal backdrop template
*/
backdropClass?: string;
/**
* additional CSS class(es) to be added to a modal window template
*/
windowClass?: string;
/**
* Optional suffix of modal window class. The value used is appended to the `modal-` class, i.e. a value of `sm` gives `modal-sm`.
*/
size?: string;
/**
* a path to a template overriding modal's window template
*/
windowTemplateUrl?: string;
/**
* The class added to the body element when the modal is opened.
*
* @default 'model-open'
*/
openedClass?: string;
/**
* CSS class(es) to be added to the top modal window.
*/
windowTopClass?: string;
/**
* Appends the modal to a specific element.
*
* @default 'body'
*/
appendTo?: angular.IAugmentedJQuery;
}
interface IModalStackService {
/**
* Opens a new modal instance.
*/
open(modalInstance: IModalServiceInstance, modal: any): void;
/**
* Closes a modal instance with an optional result.
*/
close(modalInstance: IModalServiceInstance, result?: any): void;
/**
* Dismisses a modal instance with an optional reason.
*/
dismiss(modalInstance: IModalServiceInstance, reason?: any): void;
/**
* Dismiss all open modal instances with an optional reason that will be passed to each instance.
*/
dismissAll(reason?: any): void;
/**
* Gets the topmost modal instance that is open.
*/
getTop(): IModalStackedMapKeyValuePair;
}
interface IModalStackedMapKeyValuePair {
key: IModalServiceInstance;
value: any;
}
interface IPaginationConfig {
/**
* Total number of items in all pages.
*/
totalItems?: number;
/**
* Maximum number of items per page. A value less than one indicates all items on one page.
*
* @default 10
*/
itemsPerPage?: number;
/**
* Limit number for pagination size.
*
* @default: null
*/
maxSize?: number;
/**
* An optional expression assigned the total number of pages to display.
*
* @default angular.noop
*/
numPages?: number;
/**
* Whether to keep current page in the middle of the visible ones.
*
* @default true
*/
rotate?: boolean;
/**
* Whether to display Previous / Next buttons.
*
* @default true
*/
directionLinks?: boolean;
/**
* Text for Previous button.
*
* @default 'Previous'
*/
previousText?: string;
/**
* Text for Next button.
*
* @default 'Next'
*/
nextText?: string;
/**
* Whether to display First / Last buttons.
*
* @default false
*/
boundaryLinks?: boolean;
/**
* Text for First button.
*
* @default 'First'
*/
firstText?: string;
/**
* Text for Last button.
*
* @default 'Last'
*/
lastText?: string;
/**
* Override the template for the component with a custom provided template.
*
* @default 'template/pagination/pagination.html'
*/
templateUrl?: string;
}
interface IPagerConfig {
/**
* Whether to align each link to the sides.
*
* @default true
*/
align?: boolean;
/**
* Maximum number of items per page. A value less than one indicates all items on one page.
*
* @default 10
*/
itemsPerPage?: number;
/**
* Text for Previous button.
*
* @default '« Previous'
*/
previousText?: string;
/**
* Text for Next button.
*
* @default 'Next »'
*/
nextText?: string;
}
interface IPositionCoordinates {
width?: number;
height?: number;
top?: number;
left?: number;
}
interface IPositionService {
/**
* Provides a read-only equivalent of jQuery's position function.
*/
position(element: JQuery): IPositionCoordinates;
/**
* Provides a read-only equivalent of jQuery's offset function.
*/
offset(element: JQuery): IPositionCoordinates;
}
interface IProgressConfig {
/**
* Whether bars use transitions to achieve the width change.
*
* @default: true
*/
animate?: boolean;
/**
* A number that specifies the total value of bars that is required.
*
* @default: 100
*/
max?: number;
}
interface IRatingConfig {
/**
* Changes the number of icons.
*
* @default: 5
*/
max?: number;
/**
* A variable used in the template to specify the state for selected icons.
*
* @default: null
*/
stateOn?: string;
/**
* A variable used in the template to specify the state for unselected icons.
*
* @default: null
*/
stateOff?: string;
/**
* An array of strings defining titles for all icons.
*
* @default: ["one", "two", "three", "four", "five"]
*/
titles?: Array<string>;
}
interface ITimepickerConfig {
/**
* Number of hours to increase or decrease when using a button.
*
* @default 1
*/
hourStep?: number;
/**
* Number of minutes to increase or decrease when using a button.
*
* @default 1
*/
minuteStep?: number;
/**
* Whether to display 12H or 24H mode.
*
* @default true
*/
showMeridian?: boolean;
/**
* Meridian labels based on locale. To override you must supply an array like ['AM', 'PM'].
*
* @default null
*/
meridians?: Array<string>;
/**
* Whether the user can type inside the hours & minutes input.
*
* @default false
*/
readonlyInput?: boolean;
/**
* Whether the user can scroll inside the hours & minutes input to increase or decrease it's values.
*
* @default true
*/
mousewheel?: boolean;
/**
* Whether the user can use up/down arrowkeys inside the hours & minutes input to increase or decrease it's values.
*
* @default true
*/
arrowkeys?: boolean;
/**
* Shows spinner arrows above and below the inputs.
*
* @default true
*/
showSpinners?: boolean;
}
interface ITooltipOptions {
/**
* Where to place it? Defaults to 'top', but also accepts 'right', 'bottom', or 'left'.
*
* @default 'top'
*/
placement?: string;
/**
* Should the modal fade in and out?
*
* @default true
*/
animation?: boolean;
/**
* For how long should the user have to have the mouse over the element before the tooltip shows (in milliseconds)?
*
* @default 0
*/
popupDelay?: number;
/**
* Should the tooltip be appended to `$body` instead of the parent element?
*
* @default false
*/
appendToBody?: boolean;
/**
* What should trigger a show of the tooltip? Supports a space separated list of event names.
*
* @default 'mouseenter' for tooltip, 'click' for popover
*/
trigger?: string;
/**
* Should an expression on the scope be used to load the content?
*
* @default false
*/
useContentExp?: boolean;
}
interface ITooltipProvider {
/**
* Provide a set of defaults for certain tooltip and popover attributes.
*/
options(value: ITooltipOptions): void;
/**
* Extends the default trigger mappings with mappings of your own. E.g. `{ 'openTrigger': 'closeTrigger' }`.
*/
setTriggers(triggers: Object): void;
}
/**
* WARNING: $transition is now deprecated. Use $animate from ngAnimate instead.
*/
interface ITransitionService {
/**
* The browser specific animation event name.
*/
animationEndEventName: string;
/**
* The browser specific transition event name.
*/
transitionEndEventName: string;
/**
* Provides a consistent interface to trigger CSS 3 transitions and to be informed when they complete.
*
* @param element The DOMElement that will be animated
* @param trigger The thing that will cause the transition to start:
* - As a string, it represents the css class to be added to the element.
* - As an object, it represents a hash of style attributes to be applied to the element.
* - As a function, it represents a function to be called that will cause the transition to occur.
* @param options Optional settings for the transition.
*
* @return A promise that is resolved when the transition finishes.
*/
(element: angular.IAugmentedJQuery, trigger: any, options?: ITransitionServiceOptions): angular.IPromise<angular.IAugmentedJQuery>;
}
interface ITransitionServiceOptions {
animation?: boolean;
}
}
| DRIVER-EU/csCOP | website/typings/globals/angular-ui-bootstrap/index.d.ts | TypeScript | mit | 19,856 |
define(['underscore','backbone','aura'], function(_,Backbone,Aura) {
console.log('loading index.js')
var app=Aura({debug: { enable: true}});
app.components.addSource('aura', '../node_webkit/auraext');
app.components.addSource('kse', '../kse/aura_components');
app.use('../node_webkit/auraext/aura-backbone')
.use('../node_webkit/auraext/aura-yadb')
.use('../node_webkit/auraext/aura-yase')
.use('../node_webkit/auraext/aura-rangy')
.use('../node_webkit/auraext/aura-toc')
.start({ widgets: 'body' }).then(function() {
console.log('Aura Started');
})
}); | ksanaforge/swjzz | index.js | JavaScript | mit | 598 |
// The current version of this file can be retrieved by:
// GET /api/language/webast
module TDev.AST.Json
{
// This module describes an AST for TouchDevelop scripts. The documentation
// is severely lacking, so the best way to figure things out is to write a
// TouchDevelop script, and type (in the console):
//
// "TDev.AST.Json.dump(TDev.Script)"
//
// which will dump the currently-edited script in this representation. The
// converse operation is:
//
// "TDev.AST.Json.serialize(yourJsonAst)"
//
// Beware: the composition of these two operations is *not* the
// identity. In particular, [dump] will resolve implicit optional arguments,
// while [serialize] expects them to be left out.
// These two interfaces are never used. Actually, whenever a field has type
// [JNodeRef], this is a lie, and its type is [string].
export interface JNodeRef { dummyNodeRef: number; }
export interface JTypeRef { dummyTypeRef: number; }
// the JTypeRef may be either a simple string, or if it starts with '{',
// it is JSON-encoded and conforms to one of these interfaces or is just a string (API type)
export interface JGenericTypeInstance extends JTypeRef {
g: string;
a?: JTypeRef[];
}
export interface JUserType extends JTypeRef {
o: string;
}
export interface JLibraryType extends JUserType {
l: JNodeRef;
}
/*abstract*/ export interface JNode
{
nodeType:string; // name of interface without leading J and with lower-case first letter
id:string; // do not depend on the particular format of these strings
}
/*abstract*/ export interface JDecl extends JNode
{
name: string;
unused?: boolean;
}
/*abstract*/ export interface JToken extends JNode { }
/*abstract*/ export interface JExpr extends JToken { }
// This corresponds to the [operator] syntactic class defined in the
// OOPSLA'15 submission. When adopting the "hybrid AST" point of view,
// an expression is decomposed as a series of tokens. The [JOperator]
// interface covers operators (assignment, comparison, boolean and
// arithmetic operators), but also *digits*.
//
// For instance, "1 + 10 = 11" will generate:
// [JOperator 1; JOperator +; JOperator 0; JOperator =; JOperator 1; JOperator 1]
export interface JOperator extends JToken { op:string; }
// A reference to a "property", i.e. something defined for an object of that
// type. There is no good way of figuring out what should the [parent] be
// when generating such properties; probably the best way is to dump a
// TouchDevelop AST.
export interface JPropertyRef extends JToken
{
name:string;
parent: JTypeRef; // if used as token this is ignored when building
// if used as JCall it's needed for operators
declId?: JNodeRef; // filled when the property is user-defined
}
export interface JStringLiteral extends JExpr {
value:string;
enumValue?:string;
}
export interface JBooleanLiteral extends JExpr { value:boolean; }
// A number literal is only used when adopting the "tree" view for
// expressions (see comment on [JExprHolder]).
export interface JNumberLiteral extends JExpr {
value:number;
// If parsing 'stringForm' yields 'value', 'stringForm' is used
// Otherwise stringified form of 'value' is used
stringForm?:string;
}
// when building expressions of these three types you can provide localId/type or name;
// if you provide both, name is ignored
export interface JLocalRef extends JExpr
{
name:string;
localId:JNodeRef;
}
export interface JPlaceholder extends JExpr
{
name:string;
type:JTypeRef;
}
// A singleton (probably) references one of the top-level categories such as
// libraries or data. When trying to call "♻ l → foo(x1, x2)", one may
// understand that the following call takes place:
// ♻ -> l -> foo(x1, x2)
// and the following AST is generated:
// JCall { name: foo, parent: l, args: [
// JCall { name: l, parent: ♻, args: [ JSingletonRef ♻ ] },
// x1,
// x2
// ]}
// this is surprising, because when calling "1 + 2", we generate a call that
// has two arguments only.
export interface JSingletonRef extends JExpr
{
name:string;
// type is ignored when building
type:JTypeRef;
libraryName?:string; // if this is a reference to a namespace in a library, this gives the name of library
}
// It seems like TouchDevelop has an extra invariant that a [JCall] must
// *always* be wrapped in a [JExprHolder].
export interface JCall extends JPropertyRef, JExpr
{
args:JExpr[];
// If we are calling a *type* T on an expression (e.g. create ->
// Collection of -> T), then T will be in there.
typeArgs?: JTypeRef[];
// The field below, if present, determines without ambiguity the nature
// of the call.
// - extension (the new special syntax)
// - field (reading a record field)
// Other types of calls can be determined by careful inspection of the
// receiver. See the C++ code emitter.
callType?: string;
}
// Expressions can be represented in two different manners.
// - The first one is as a series of tokens. This would correspond to the
// "hybrid AST" described in the OOPSLA'15 submission. In that
// representation, the [tree] field is null and the [tokens] field
// contains the list of tokens.
// - The second one is as an actual AST, with a proper tree structure. In
// that case, the [tokens] field is null and [tree] must contain a proper
// tree.
//
// TouchDevelop conflates variable binding and expressions. This means that
// every expression is flagged with the variables that are introduced at
// this stage. For instance, "var x = 1" will be translated as a
// [JExprHolder] where [locals] contains a [JLocalDef x], and either:
// - [tokens] is [JLocalRef x; JOperator :=; JOperator 1], or
// - [tree] is [JCall { name: ":=", parent: "Unknown", args: [JLocalRef x, JNumberLiteral 1] }]
//
// This is not the traditional notion of binding! The variable's scope is
// not limited to the tokens, but rather extends until the end of the parent
// block.
export interface JExprHolder extends JNode
{
// if tokens is unset, will try to use tree
tokens:JToken[];
tree:JExpr;
locals:JLocalDef[]; // locals variables defined in this expression
}
/*abstract*/ export interface JStmt extends JNode
{
// this is available when using the short form
locals?: JLocalDef[];
}
export interface JComment extends JStmt { text: string; }
export interface JFor extends JStmt
{
index:JLocalDef;
bound:JExprHolder;
body:JStmt[];
}
export interface JForeach extends JStmt
{
iterator:JLocalDef;
collection:JExprHolder;
conditions:JCondition[];
body:JStmt[];
}
/*abstract*/ export interface JCondition extends JNode {
// this is available when using the short form
locals?: JLocalDef[];
}
export interface JWhere extends JCondition { condition: JExprHolder; }
export interface JWhile extends JStmt
{
condition:JExprHolder;
body:JStmt[];
}
export interface JContinue extends JStmt {}
export interface JBreak extends JStmt {}
export interface JReturn extends JExprStmt {}
export interface JShow extends JExprStmt {}
// Sequences of if / else if / else statements are not represented the usual
// way. That is, instead of having a structured AST:
//
// if
// |- condition1
// |- then-branch1 = ...
// |- else-branch = if
// |- condition2
// |- then-branch2
// |- else-branch2
//
// the TouchDevelop AST adopts the following (unusual) representation.
//
// if
// |- condition1
// |- then-branch1 = ...
// |- else-branch = null
// if
// |- condition2
// |- then-branch2
// |- else-branch2
// |- isElseIf = true
//
// This is NOT equivalent to the representation above (condition2 may
// subsume condition1), so the extra flag "isElseIf" is set and (I suppose)
// gets some special treatment when it comes to running / compiling the
// program.
export interface JIf extends JStmt
{
condition:JExprHolder;
thenBody:JStmt[];
elseBody:JStmt[];
isElseIf:boolean;
}
export interface JBoxed extends JStmt { body:JStmt[]; }
export interface JExprStmt extends JStmt { expr:JExprHolder; }
export interface JInlineActions extends JExprStmt { actions:JInlineAction[]; }
export interface JInlineAction extends JNode
{
reference:JLocalDef;
inParameters:JLocalDef[];
outParameters:JLocalDef[];
body:JStmt[];
locals?:JLocalDef[]; // this contains the reference in short mode; it never contains anything else
isImplicit:boolean;
isOptional:boolean;
}
export interface JOptionalParameter extends JNode
{
name:string;
declId:JNodeRef;
expr:JExprHolder;
}
/*abstract*/ export interface JActionBase extends JDecl
{
inParameters:JLocalDef[];
outParameters:JLocalDef[];
// note that events should be always treated as private, but for historical reasons this field can be true or false
isPrivate:boolean;
isOffline: boolean;
isQuery: boolean;
isTest: boolean;
isAsync:boolean;
description: string;
}
export interface JActionType extends JActionBase
{
}
export interface JAction extends JActionBase { body: JStmt[]; }
export interface JPage extends JActionBase
{
initBody:JStmt[];
displayBody:JStmt[];
initBodyId?:string;
displayBodyId?:string;
hasModelParameter?:boolean;
}
export interface JEvent extends JActionBase
{
// when building provide name or both eventName and eventVariableId (which take precedence over name)
eventName:string;
eventVariableId:JNodeRef;
body:JStmt[];
}
export interface JLibAction extends JActionBase
{
parentLibId:JNodeRef; // this can be empty - it means "current script"
}
export interface JLibAbstractType extends JDecl
{
}
export interface JLibActionType extends JActionBase
{
}
/*abstract*/ export interface JGlobalDef extends JDecl
{
comment:string;
type:JTypeRef;
isReadonly:boolean;
isTransient:boolean;
isCloudEnabled:boolean;
}
export interface JArt extends JGlobalDef {
url: string;
// If it's a string art, contains its value.
value: string;
}
export interface JData extends JGlobalDef { }
export interface JLibrary extends JDecl
{
libIdentifier: string;
libIsPublished: boolean;
scriptName: string; // name of the script to which the library resolves
exportedTypes: string; // space separated; obsolete, use exportedTypeDefs
exportedTypeDefs: JDecl[]; // JLibAbstractType or JLibActionType
exportedActions: JLibAction[];
resolveClauses: JResolveClause[];
}
/*abstract*/ export interface JBinding extends JNode
{
name:string; // name of the formal argument
isExplicit:boolean; // was it explicitly specified by the user
// implicit bindings are ignored when building expressions
}
export interface JTypeBinding extends JBinding { type:JTypeRef; }
export interface JActionBinding extends JBinding { actionId:JNodeRef; }
export interface JResolveClause extends JNode
{
name:string;
// points to a JLibrary (not publish-id);
// it may be null for binding to the current script
defaultLibId:JNodeRef;
withTypes: JTypeBinding[];
withActions: JActionBinding[];
}
export interface JRecord extends JDecl
{
comment: string;
category: string; // "object", "table", "index", or "decorator"
isCloudEnabled: boolean;
isCloudPartiallyEnabled: boolean;
isPersistent: boolean;
isExported: boolean;
keys: JRecordKey[];
fields: JRecordField[];
}
export interface JRecordField extends JNode
{
name:string;
type:JTypeRef;
}
export interface JRecordKey extends JRecordField {}
// local variable or a parameter
export interface JLocalDef extends JNode
{
name:string;
type:JTypeRef;
}
// Response to:
// GET /api/<script-id>/webast
export interface JApp extends JNode
{
// both versions are comma-separated list of tokens/features
textVersion: string;
jsonVersion: string;
name: string;
comment: string;
// The name and icon are only given here if they are explicitly specified by the user.
icon?: string; // name of the icon, e.g., "Bolt"
color?: string; // e.g., #ff00ff
// These two are always present. They are ignored when building new scripts.
autoIcon:string;
autoColor:string;
platform: string; // comma-separated
isLibrary: boolean;
allowExport: boolean;
showAd: boolean;
hasIds: boolean; // does it have stable, persistent ids for every stmt
rootId: string;
decls: JDecl[];
deletedDecls: JDecl[]; // these are present when a node was deleted but is still referenced from somewhere
libraryName?: string; // when used in reflection info
libraryId?: string; // when used in reflection info
}
//
// API description
//
export interface JPropertyParameter
{
name: string;
type: JTypeRef;
writesMutable?: boolean; // are fields of the object referenced by this paramter being written to
readsMutable?: boolean; // .... read from
defaultValue?: JToken[];
stringValues?: string[]; // these show up in intelli buttons; they are usually all allowed values for a parameter
}
export interface JProperty
{
name: string;
help: string;
usage_count: number; // this is used for syntax autocompletion priority
runOnInvalid?: boolean; // should the property by run even if one of the arguments is 'invalid'
isHidden?: boolean; // doesn't show in autocompletion
isAsync?: boolean;
isObsolete?: boolean; // generates a warning
isDbgOnly?: boolean; // an experimental feature; not visible in regular builds
isBetaOnly?: boolean; // a feature in testing; visible in /app/beta
jsName: string; // how is the property refered to from JavaScript
infixPriority?: number; // when present, this is an infix operator with given priority
// higher number is higher priority; even assosiates left, odd - right
pausesInterpreter?: boolean; // is this a potentially-async operation
usesStackFrame?: boolean; // is the implementation passed IStackFrame object
missingWeb?: boolean; // is the implementation missing from the general web version
missingWab?: boolean; // .... from web version running with WebAppBooster
capabilities?: string; // comma-separated list of required platform capabilities (if any)
result: JPropertyParameter;
parameters: JPropertyParameter[];
}
export interface JTypeDef
{
name: string;
help: string;
icon: string; // a name of the icon representing this type
isAction?: boolean; // is it a function type; look for 'run' property for the signature
isData: boolean; // false for singleton types
stemName: string; // used when auto-naming variables of this type
jsName: string; // how is the type refered to from JavaScript
isDbgOnly?: boolean; // an experimental feature; not visible in regular builds
isBetaOnly?: boolean; // a feature in testing; visible in /app/beta
isSerializable: boolean; // do we support automatic serialization of this type
isBuiltin?: boolean; // true for number, boolean, string; the JS calling convention is different for these
ctxLocal?: boolean; // can it be used as local variable
ctxGlobal?: boolean; // .... as global variable
ctxField?: boolean; // .... as field of a record
ctxLocalKey?: boolean; // .... as key in a local index
ctxGcKey?: boolean; // can it have decorators
ctxCloudKey?: boolean;
ctxRowKey?: boolean;
ctxCloudField?: boolean;
ctxWallTap?: boolean; // do global variables of this type get 'wall tap' events
ctxEnumerable?: boolean; // can it be used with foreach construct
ctxJson?: boolean; // can it be json exported/imported
properties: JProperty[];
}
// GET /api/language/apis
export interface JApis
{
textVersion:string;
jsonVersion: string;
types:JTypeDef[];
}
/*
The short format
~~~~~~~~~~~~~~~~
The main difference between the full JSON format and the short JSON format is
representation of `JExprHolder` nodes. Whenever the full JSON format says node
`JBar` has a field `foo` of type `JExprHolder`, then in the short format `JBar`
has a field `foo` of type `string` and a field `locals` of type `JLocalDef[]`.
Additionally, the fields `index` in `JFor` and `iterator` in `JForeach` are
absent, and the loop-bound variable is instead stored as the first element of
`locals`.
The string placed instead of the `JExprHolder` node can be turned into sequence
of tokens using the following function:
export function shortToTokens(shortForm:string)
{
function uq(s:string) {
var r = ""
for (var i = 0; i < s.length; ++i) {
var c = s.charAt(i);
if (c == "_") {
r += " ";
} else if (c == "/") {
r += String.fromCharCode(parseInt(s.slice(i + 1, i + 5), 16))
i += 4
} else {
r += c;
}
}
return r;
}
function oneToken(s:string) {
var v = s.slice(1)
switch (s[0]) {
case ",": return { nodeType: "operator", op: v }
case "#": return { nodeType: "propertyRef", declId: v }
case ".": return { nodeType: "propertyRef", name: uq(v) }
case "'": return { nodeType: "stringLiteral", value: uq(v) }
case "F":
case "T": return { nodeType: "booleanLiteral", value: (s[0] == "T") }
case "$": return { nodeType: "localRef", localId: v }
case ":": return { nodeType: "singletonRef", name: uq(v) }
case "?":
var cln = v.indexOf(':')
if (cln > 0)
return { nodeType: "placeholder", type: uq(v.slice(0, cln)), name: uq(v.slice(cln + 1)) }
else
return { nodeType: "placeholder", type: uq(v) }
default:
throw new Error("wrong short form: " + s)
}
}
if (!shortForm) return []; // handles "" and null; the code below is incorrect for ""
return shortForm.split(" ").map(oneToken)
}
In other words, it's space separated sequence of strings, where the first
character denotes the kind of token and remaining characters are the payload.
The string is quoted by replacing spaces with underscores and all other
non-alphanumeric characters with unicode sequences preceeded by a slash (not
backslash to avoid double quoting in JSON).
Short diff format
~~~~~~~~~~~~~~~~~
Every object node in the short JSON format has a field named `id`. This is used
when formulating diffs. The diff is set of updates to nodes of given ids. For
every id there is a set of `fieldName`, `value` pairs.
For example consider:
A = {
"id": "01",
"one": "one",
"two": 2,
"baz": [
{ "id": "02", "enabled": true },
{ "id": "03", "x": 0 }
]
}
B = {
"id": "01",
"one": "seven",
"two": 2,
"baz": [
{ "id": "02", "enabled": true },
{ "id": "05", "y": 7, "z": 13 }
]
}
diff(A, B) = {
// new node, assignment given for all fields
"05": { "y": 7, "z": 13 },
// updated node
"01": {
"one": "seven", // the field "one" is now "seven"
// the field "two" is not mentioned and thus unchanged
// the field "baz" now contains two nodes, ids of which are given
"baz": [ "02", "05" ]
},
// the node "03" is deleted
"03": null
}
The JSON diff relies on the following properties of the short JSON format:
Fields of JNodes always contain either:
1. a JSON primitive value (string, boolean, integer, null), or
2. a sequence of JNodes
Every JNode has a unique 'id' field.
This is why JFor.bound and JForeach.collection fields are missing. In the diff
format sequence of strings is always treated as a sequence of node ids.
The following function can be used to apply JSON diff:
function indexIds(obj:any)
{
var oldById:any = {}
function findIds(o:any) {
if (!o) return;
if (Array.isArray(o)) {
for (var i = 0; i < o.length; ++i)
findIds(o[i])
} else if (typeof o === "object") {
if (!o.id) Util.oops("no id for " + JSON.stringify(o))
if (oldById.hasOwnProperty(o.id)) Util.oops("duplicate id " + o.id)
oldById[o.id] = o
var k = Object.keys(o)
for (var i = 0; i < k.length; ++i)
findIds(o[k[i]])
}
}
findIds(obj)
return oldById
}
export function applyJsonDiff(base:any, diff:any)
{
var byId = indexIds(base)
var k = Object.keys(diff)
for (var i = 0; i < k.length; ++i) {
var id = k[i]
var upd = diff[id]
if (upd === undefined) continue;
var trg = byId[id]
if (upd === null) {
if (!trg) Util.oops("apply diff: no target id " + id)
trg.__deleted = true;
continue;
}
if (!trg) {
byId[id] = trg = { id: id }
}
var kk = Object.keys(upd)
for (var j = 0; j < kk.length; ++j) {
var f = kk[j]
var v = upd[f]
if (Array.isArray(v) && typeof v[0] === "string")
v = v.map(id => {
var r = byId[id]
if (!r) { r = byId[id] = { id: id } }
return r
})
Util.assert(f != "nodeType" || !trg[f])
trg[f] = v
}
}
var newIds = indexIds(base)
k = Object.keys(newIds)
for (var i = 0; i < k.length; ++i) {
var id = k[i]
if (newIds[k[i]].__deleted)
Util.oops("dangling id after diff " + id)
}
}
*/
}
| jmptrader/TouchDevelop | ast/jsonInterfaces.ts | TypeScript | mit | 24,059 |
import { GraphQLType, GraphQLSchema } from 'graphql';
export default function implementsAbstractType(schema: GraphQLSchema, typeA: GraphQLType, typeB: GraphQLType): boolean;
| AntonyThorpe/knockout-apollo | tests/node_modules/graphql-tools/dist/implementsAbstractType.d.ts | TypeScript | mit | 174 |
<?php
/**
* 2Moons
* by Jan-Otto Kröpke 2009-2016
*
* For the full copyright and license information, please view the LICENSE
*
* @package 2Moons
* @author Jan-Otto Kröpke <slaver7@gmail.com>
* @copyright 2009 Lucky
* @copyright 2016 Jan-Otto Kröpke <slaver7@gmail.com>
* @licence MIT
* @version 1.8.0
* @link https://github.com/jkroepke/2Moons
*/
$LNG['Messages'] = 'Nachrichten';
$LNG['write_message'] = 'Schreibe eine Nachricht';
$LNG['PM'] = '[PN]';
$LNG['ready'] = 'Fertig';
$LNG['loading'] = 'Lade ...';
$LNG['invalid_action'] = 'Ungültige Aktion!';
$LNG['type_mission_1'] = 'Angreifen';
$LNG['type_mission_2'] = 'Verbandsangriff';
$LNG['type_mission_3'] = 'Transport';
$LNG['type_mission_4'] = 'Stationieren';
$LNG['type_mission_5'] = 'Halten';
$LNG['type_mission_6'] = 'Spionieren';
$LNG['type_mission_7'] = 'Kolonisieren';
$LNG['type_mission_8'] = 'Abbauen';
$LNG['type_mission_9'] = 'Zerstören';
$LNG['type_mission_10'] = 'Raketenangriff';
$LNG['type_mission_11'] = 'DM Untersuchung';
$LNG['type_mission_15'] = 'Expedition';
$LNG['type_planet_1'] = 'Planet';
$LNG['type_planet_2'] = 'Trümmerfeld';
$LNG['type_planet_3'] = 'Mond';
$LNG['user_level_0'] = 'Spieler';
$LNG['user_level_1'] = 'Moderator';
$LNG['user_level_2'] = 'Operator';
$LNG['user_level_3'] = 'Administrator';
// GAME.PHP
$LNG['page_doesnt_exist'] = 'Die Aufgerufene Seite existiert nicht';
$LNG['bad_forum_url'] = 'Keine Foren-URL definiert!';
$LNG['admin_access_1'] = 'Sie haben temporären Zugriff auf administrative Funktionen.';
$LNG['admin_access_link'] = 'Deaktivieren Sie diesen Zugriff';
$LNG['admin_access_2'] = ', wenn Sie ihn nicht länger benötigen.';
//----------------------------------------------------------------------------//
//TOPNAV
$LNG['tn_vacation_mode'] = 'Sie sind im Urlaubsmodus ';
$LNG['tn_delete_mode'] = 'Ihr Account wird am %s automatisch gelöscht!';
//----------------------------------------------------------------------------//
//LEFT MENU
$LNG['lm_overview'] = 'Übersicht';
$LNG['lm_galaxy'] = 'Galaxie';
$LNG['lm_empire'] = 'Imperium';
$LNG['lm_fleet'] = 'Flotte';
$LNG['lm_buildings'] = 'Gebäude';
$LNG['lm_research'] = 'Forschung';
$LNG['lm_shipshard'] = 'Schiffswerft';
$LNG['lm_defenses'] = 'Verteidigung';
$LNG['lm_resources'] = 'Rohstoffe';
$LNG['lm_officiers'] = 'Offiziere';
$LNG['lm_trader'] = 'Händler';
$LNG['lm_fleettrader'] = 'Schrotthändler';
$LNG['lm_technology'] = 'Technologie';
$LNG['lm_messages'] = 'Nachrichten';
$LNG['lm_alliance'] = 'Allianz';
$LNG['lm_buddylist'] = 'Buddylist';
$LNG['lm_notes'] = 'Notizen';
$LNG['lm_statistics'] = 'Statistik';
$LNG['lm_search'] = 'Suche';
$LNG['lm_options'] = 'Einstellungen';
$LNG['lm_banned'] = 'Pranger';
$LNG['lm_forums'] = 'Forum';
$LNG['lm_logout'] = 'Logout';
$LNG['lm_administration'] = 'Administration';
$LNG['lm_queue'] = 'Queues';
$LNG['lm_topkb'] = 'Hall of Fame';
$LNG['lm_faq'] = 'FAQ';
$LNG['lm_records'] = 'Rekorde';
$LNG['lm_chat'] = 'Chat';
$LNG['lm_changelog'] = 'Changelog';
$LNG['lm_support'] = 'Support';
$LNG['lm_rules'] = 'Regeln';
$LNG['lm_battlesim'] = 'Kampfsimulator';
$LNG['lm_playercard'] = 'Spielerinformationen';
$LNG['lm_info'] = 'Informationen';
$LNG['lm_disclamer'] = 'Impressum';
//----------------------------------------------------------------------------//
//OVERVIEW
$LNG['ov_newname_specialchar'] = 'Im Planetennamen sind nur Zahlen, Buchstaben, Leerzeichen, _, -, . erlaubt!';
$LNG['ov_newname_done'] = 'Planet erfolgreich umbenannt!';
$LNG['ov_planet_abandoned'] = 'Planet erfolgreich aufgegeben!';
$LNG['ov_principal_planet_cant_abanone'] = 'Sie können nicht ihren Hauptplaneten löschen!';
$LNG['ov_abandon_planet_not_possible'] = 'Kolonie nicht löschbar, wenn Flottenaktivitäten zu oder von ihrer Kolonie stattfinden!';
$LNG['ov_wrong_pass'] = 'Falsches Passwort. Versuchen sie es noch einmal!';
$LNG['ov_have_new_message'] = 'Du hast eine neue Nachricht';
$LNG['ov_have_new_messages'] = 'Du hast %d neue Nachrichten';
$LNG['ov_planetmenu'] = 'Name ändern/Löschen';
$LNG['ov_free'] = 'Frei';
$LNG['ov_news'] = 'News';
$LNG['ov_place'] = 'Platz';
$LNG['ov_of'] = 'von';
$LNG['ov_planet'] = 'Planet';
$LNG['ov_server_time'] = 'Serverzeit ';
$LNG['ov_events'] = 'Ereignisse';
$LNG['ov_diameter'] = 'Durchmesser';
$LNG['ov_distance_unit'] = 'km';
$LNG['ov_temperature'] = 'Temperatur';
$LNG['ov_aprox'] = 'ca. von';
$LNG['ov_temp_unit'] = '°C';
$LNG['ov_to'] = 'bis';
$LNG['ov_position'] = 'Position';
$LNG['ov_points'] = 'Punkte';
$LNG['ov_security_request'] = 'Sicherheitsfrage';
$LNG['ov_security_confirm'] = 'Bitte bestätigen sie, dass sie den Planet %s aufgeben wollen.';
$LNG['ov_password'] = 'Passwort';
$LNG['ov_delete_planet'] = 'Aufgeben';
$LNG['ov_planet_rename'] = 'Umbenennen';
$LNG['ov_rename_label'] = 'Neuer Name';
$LNG['ov_fields'] = 'Felder';
$LNG['ov_developed_fields'] = 'bebaute Felder';
$LNG['ov_max_developed_fields'] = 'max. bebaubare Felder';
$LNG['ov_fleet'] = 'Flotten';
$LNG['ov_admins_online'] = 'Admins(Online):';
$LNG['ov_no_admins_online'] = 'Zurzeit kein Admin online!';
$LNG['ov_userbanner'] = 'Statistiken-Banner';
$LNG['ov_userrank_info'] = '%s (%s <a href="game.php?page=statistics&range=%d">%d</a> %s %s)';
$LNG['ov_teamspeak_not_online'] = 'TeamspeakServer zurzeit nicht erreichbar. Wir bitten um Verständnis.';
$LNG['ov_teamspeak'] = 'Teamspeak';
$LNG['ov_teamspeak_connect'] = 'Connect';
$LNG['ov_teamspeak_online'] = 'Online';
$LNG['ov_closed'] = 'Spiel ist zurzeit deaktiviert!';
$LNG['ov_reflink'] = 'Reflink';
$LNG['ov_noreflink'] = 'Du hast keine User angeworben.';
$LNG['ov_chat_online'] = 'User im Chat:';
//----------------------------------------------------------------------------//
//GALAXY
$LNG['gl_no_deuterium_to_view_galaxy'] = 'Sie haben nicht genügend Deuterium!';
$LNG['gl_legend'] = 'Legende';
$LNG['gl_strong_player'] = 'Starker Spieler';
$LNG['gl_week_player'] = 'Schwacher Spieler';
$LNG['gl_vacation'] = 'Urlaubsmodus';
$LNG['gl_banned'] = 'Gesperrt';
$LNG['gl_inactive_seven'] = '7 Tage inaktiv';
$LNG['gl_inactive_twentyeight'] = '28 Tage inaktiv';
$LNG['gl_short_strong'] = 's';
$LNG['gl_short_newbie'] = 'n';
$LNG['gl_short_vacation'] = 'u';
$LNG['gl_short_ban'] = 'g';
$LNG['gl_short_inactive'] = 'i';
$LNG['gl_short_long_inactive'] = 'I';
$LNG['gl_short_enemy'] = '';
$LNG['gl_short_friend'] = '';
$LNG['gl_short_member'] = '';
$LNG['gl_populed_planets'] = '%d Planeten besiedelt';
$LNG['gl_out_space'] = 'Die unendlichen Weiten des Universums';
$LNG['gl_avaible_missiles'] = 'Interplanetarraketen';
$LNG['gl_fleets'] = 'Flottenslots';
$LNG['gl_avaible_grecyclers'] = 'Gigarecycler';
$LNG['gl_avaible_recyclers'] = 'Recycler';
$LNG['gl_avaible_spyprobes'] = 'Spionagesonden';
$LNG['gl_missil_launch'] = 'Raketenangriff';
$LNG['gl_missil_to_launch'] = 'Anzahl an Raketen (<b>%d</b> übrig):';
$LNG['gl_all_defenses'] = 'Alle';
$LNG['gl_objective'] = 'Primäres Ziel';
$LNG['gl_missil_launch_action'] = 'Abschicken';
$LNG['gl_galaxy'] = 'Galaxy';
$LNG['gl_solar_system'] = 'System';
$LNG['gl_show'] = 'Display';
$LNG['gl_pos'] = 'Pos';
$LNG['gl_planet'] = 'Planet';
$LNG['gl_name_activity'] = 'Name (Aktivität)';
$LNG['gl_moon'] = 'Mond';
$LNG['gl_debris'] = 'TF';
$LNG['gl_player_estate'] = 'Spieler (Status)';
$LNG['gl_alliance'] = 'Allianz';
$LNG['gl_actions'] = 'Aktion';
$LNG['gl_spy'] = 'Spionieren';
$LNG['gl_buddy_request'] = 'Buddylistanfrage';
$LNG['gl_missile_attack'] = 'Raketenangriff';
$LNG['gl_with'] = ' mit ';
$LNG['gl_member'] = '%d Mitgliedern';
$LNG['gl_member_add'] = '%d Mitglied';
$LNG['gl_alliance_page'] = 'Allianzseite';
$LNG['gl_see_on_stats'] = 'Statistiken';
$LNG['gl_alliance_web_page'] = 'Allianz Homepage';
$LNG['gl_debris_field'] = 'Trümmerfeld';
$LNG['gl_collect'] = 'Abbauen';
$LNG['gl_resources'] = 'Rohstoffe';
$LNG['gl_features'] = 'Eigenschaften';
$LNG['gl_diameter'] = 'Durchmesser';
$LNG['gl_temperature'] = 'Temperatur';
$LNG['gl_phalanx'] = 'Phalanx';
$LNG['gl_planet_destroyed'] = 'Zerstörter Planet';
$LNG['gl_playercard'] = 'Playercard';
$LNG['gl_in_the_rank'] = 'Spieler %s auf Platz %d';
$LNG['gl_activity'] = '(*)';
$LNG['gl_activity_inactive'] = '(%d min)';
$LNG['gl_ajax_status_ok'] = 'Done';
$LNG['gl_ajax_status_fail'] = 'Error';
$LNG['gl_free_desc'] = 'Ein großer unbesiedelter Planet. Hier währe ein idealer Ort um eine neue Kolonie zu gründen.';
$LNG['gl_free'] = 'Frei';
$LNG['gl_yes'] = 'Ja';
$LNG['gl_no'] = 'Nein';
$LNG['gl_points'] = 'Punkte';
$LNG['gl_player'] = 'Spieler';
$LNG['gl_to'] = 'nach';
//----------------------------------------------------------------------------//
//PHALANX
$LNG['px_no_deuterium'] = 'Sie haben nicht genügend Deuterium!';
$LNG['px_scan_position'] = 'Scan Position';
$LNG['px_fleet_movement'] = 'Momentane Flottenbewegungen';
$LNG['px_no_fleet'] = 'Keine Flottenbewegungen vorhanden.';
$LNG['px_out_of_range'] = 'Out of Range';
//----------------------------------------------------------------------------//
//IMPERIUM
$LNG['lv_imperium_title'] = 'Imperiumsübersicht';
$LNG['lv_planet'] = 'Planet';
$LNG['lv_name'] = 'Name';
$LNG['lv_coords'] = 'Koordinaten';
$LNG['lv_fields'] = 'Felder';
$LNG['lv_resources'] = 'Rohstoffe';
$LNG['lv_buildings'] = 'Gebäude';
$LNG['lv_technology'] = 'Forschungen';
$LNG['lv_ships'] = 'Schiffe';
$LNG['lv_defenses'] = 'Verteidigung';
$LNG['lv_total'] = 'Total';
//----------------------------------------------------------------------------//
//FLEET - FLEET1 - FLEET2 - FLEET3 - FLEETACS - FLEETSHORTCUTS
$LNG['fl_returning'] = 'Flotte auf Planet';
$LNG['fl_onway'] = 'Flotte zu Planet';
$LNG['fl_r'] = '(R)';
$LNG['fl_a'] = '(A)';
$LNG['fl_send_back'] = 'Zurück';
$LNG['fl_acs'] = 'Verband';
$LNG['fl_no_more_slots'] = 'Keine weiteren Slots verfügbar';
$LNG['fl_speed_title'] = 'Geschwindigkeit: ';
$LNG['fl_continue'] = 'Weiter';
$LNG['fl_no_ships'] = 'Keine Schiffe vorhanden';
$LNG['fl_remove_all_ships'] = 'Keine Schiffe';
$LNG['fl_select_all_ships'] = 'Alle Schiffe';
$LNG['fl_fleets'] = 'Flotte';
$LNG['fl_expeditions'] = 'Expeditionen';
$LNG['fl_number'] = 'ID';
$LNG['fl_mission'] = 'Auftrag';
$LNG['fl_ammount'] = 'Anzahl';
$LNG['fl_beginning'] = 'Start';
$LNG['fl_departure'] = 'Ankunft(Ziel)';
$LNG['fl_destiny'] = 'Ziel';
$LNG['fl_objective'] = 'Zurück in';
$LNG['fl_arrival'] = 'Ankunft(Zurück)';
$LNG['fl_info_detail'] = 'Flotten-Details';
$LNG['fl_order'] = 'Befehl';
$LNG['fl_new_mission_title'] = 'Neuer Auftrag: Flotte wählen';
$LNG['fl_ship_type'] = 'Schiffstyp';
$LNG['fl_ship_available'] = 'Verfügbar';
$LNG['fl_planet_shortcut'] = '(P)';
$LNG['fl_debris_shortcut'] = '(T)';
$LNG['fl_moon_shortcut'] = '(M)';
$LNG['fl_no_shortcuts'] = 'Keine Shortcuts vorhanden';
$LNG['fl_register_shorcut'] = 'Erstellen';
$LNG['fl_shortcuts'] = 'Shortcuts';
$LNG['fl_dlte_shortcut'] = 'Löschen';
$LNG['fl_shortcut_add'] = 'Hinzufügen';
$LNG['fl_shortcut_edition'] = 'Shortcut editieren';
$LNG['fl_shortcut_save'] = 'Shortcut speichern';
$LNG['fl_shortcut_saved'] = 'Gespeichert!';
$LNG['fl_no_colony'] = 'Keine Kolonien vorhanden';
$LNG['fl_send_fleet'] = 'Flotte verschicken';
$LNG['fl_fleet_speed'] = 'Geschwindigkeit';
$LNG['fl_distance'] = 'Entfernung';
$LNG['fl_flying_time'] = 'Dauer (einer Strecke)';
$LNG['fl_flying_arrival'] = 'Ankunft';
$LNG['fl_flying_return'] = 'Rückkehr';
$LNG['fl_fuel_consumption'] = 'Treibstoffverbrauch';
$LNG['fl_max_speed'] = 'Maximale Geschwindigkeit';
$LNG['fl_cargo_capacity'] = 'Laderaumkapazität';
$LNG['fl_shortcut'] = 'Shortcut';
$LNG['fl_shortcut_name'] = 'Name';
$LNG['fl_my_planets'] = 'Meine Planeten';
$LNG['fl_acs_title'] = 'Verbandsangriffe';
$LNG['fl_hold_time'] = 'Haltezeit';
$LNG['fl_resources'] = 'Rohstoffe';
$LNG['fl_max'] = 'max';
$LNG['fl_hours'] = 'Stunde(n)';
$LNG['fl_resources_left'] = 'Verbleiben';
$LNG['fl_all_resources'] = 'Max Rohstoffe Laden';
$LNG['fl_empty_target'] = 'Keine Missionen vorhanden (Planet vorhanden?)';
$LNG['fl_expedition_alert_message'] = 'Achtung die Expedition bringt Gefahren mit sich, sie können bei der Expedition ihre gesamte Flotte verlieren!';
$LNG['fl_dm_alert_message'] = 'Achtung, wenn bei der %s %s gefunden wurde, wird die Flotten zerstört!';
$LNG['fl_vacation_mode_active'] = 'Sie befinden sich im Urlaubsmodus';
$LNG['fl_expedition_fleets_limit'] = 'Sie können nicht mehr Expeditionen starten!';
$LNG['fl_week_player'] = 'Spieler ist zu schwach für sie!';
$LNG['fl_strong_player'] = 'Spieler ist zu stark für sie!';
$LNG['fl_in_vacation_player'] = 'Spieler befindet sich im Urlaubsmodus';
$LNG['fl_multi_alarm'] = 'Multi-Alarm!';
$LNG['fl_no_slots'] = 'Keine Slots mehr verfügbar!';
$LNG['fl_planet_populed'] = 'Planet besiedelt!';
$LNG['fl_no_same_alliance'] = 'Der Spieler vom Zielplanet muss in deiner Allianz oder Buddyliste sein!';
$LNG['fl_not_ally_deposit'] = 'Am Ziel befindet sich kein Allianzdepo';
$LNG['fl_deploy_only_your_planets'] = 'Sie können nur Flotten auf Ihren eigenen Planeten stationieren!';
$LNG['fl_fleet_sended'] = 'Flotte verschickt';
$LNG['fl_from'] = 'Von';
$LNG['fl_arrival_time'] = 'Ankunftszeit';
$LNG['fl_return_time'] = 'Rückkehrzeit';
$LNG['fl_fleet'] = 'Flotte';
$LNG['fl_player'] = 'Der Spieler ';
$LNG['fl_add_to_attack'] = ' wurde eingeladen.';
$LNG['fl_already_invited'] = ' wurde bereits eingeladen.';
$LNG['fl_dont_exist'] = ' existiert nicht.';
$LNG['fl_acs_invitation_message'] = ' lädt Sie zu einem AKS ein.';
$LNG['fl_acs_invitation_title'] = 'AKS Einladung';
$LNG['fl_sac_of_fleet'] = 'Flotten-AKS';
$LNG['fl_modify_sac_name'] = 'AKS-Name';
$LNG['fl_members_invited'] = 'Eingeladen';
$LNG['fl_invite_members'] = 'Einladen';
$LNG['fl_simulate'] = 'Simulieren';
$LNG['fl_bonus'] = 'Bonus';
$LNG['fl_bonus_attack'] = 'Angriff';
$LNG['fl_bonus_defensive'] = 'Verteidigung';
$LNG['fl_bonus_shield'] = 'Panzerung';
$LNG['fl_no_empty_derbis'] = 'Trümmerfeld existiert nicht!';
$LNG['fl_acs_newname_alphanum'] = 'Der Name darf nur aus alphanumerische Zeichen bestehen.';
$LNG['fl_acs_change'] = 'Ändern';
$LNG['fl_acs_change_name'] = 'Geben sie einen neuen Namen ein';
$LNG['fl_error_not_avalible'] = 'Auf diesen Koordinaten befinden sich kein Planet!';
$LNG['fl_error_empty_derbis'] = 'Kein Trümmerfeld vorhanden!';
$LNG['fl_error_no_moon'] = 'Kein Mond vorhanden!';
$LNG['fl_error_same_planet'] = 'Start- und Zielplanet sind identisch!';
$LNG['fl_invalid_target'] = 'Kein gültiges Ziel';
$LNG['fl_no_noresource'] = 'Keine Rohstoffe geladen!';
$LNG['fl_no_target'] = 'Kein Zielplanet vorhanden';
$LNG['fl_not_all_ship_avalible'] = 'Nicht alle Schiffe vorhanden.';
$LNG['fl_no_expedition_slot'] = 'Sie können nicht mehr Expeditionen starten!';
$LNG['fl_invalid_mission'] = 'Ungültige Mission';
$LNG['fl_bash_protection'] = 'Bash-Schutz';
$LNG['fl_admin_attack'] = 'Du kannst keine Administratoren angreifen';
$LNG['fl_target_exists'] = 'Zielplanet existiert';
$LNG['fl_target_not_exists'] = 'Zielplanet existiert nicht!';
$LNG['fl_only_planets_colonizable'] = 'Nur Planeten können kolonisiert werden!';
$LNG['fl_player_is_noob'] = 'Spieler befindest sich im Noobschutz!';
$LNG['fl_player_is_strong'] = 'Spieler ist zu stark!';
$LNG['fl_no_hold_depot'] = 'Am Ziel befindet sich kein Allianzdepot.';
$LNG['fl_not_enough_deuterium'] = 'Nicht genügend Deuterium vorhanden.';
$LNG['fl_not_enough_space'] = 'Sie haben nicht genügend Laderaum vorhanden.';
$LNG['fl_hold_time_not_exists'] = 'Ungültige Haltezeit.';
//----------------------------------------------------------------------------//
//BUILDINGS - RESEARCH - SHIPYARD - DEFENSES
$LNG['bd_dismantle'] = 'Abreißen';
$LNG['bd_interrupt'] = 'Pause';
$LNG['bd_cancel'] = 'Abbrechen';
$LNG['bd_working'] = 'Beschäftigt';
$LNG['bd_build'] = 'Bauen';
$LNG['bd_build_next_level'] = 'Ausbauen auf Stufe ';
$LNG['bd_tech'] = 'Forschen';
$LNG['bd_tech_next_level'] = 'Forschen auf Stufe ';
$LNG['bd_add_to_list'] = 'Zur Bauliste hinzufügen';
$LNG['bd_no_more_fields'] = 'Planet ausgebaut!';
$LNG['bd_remaining'] = 'Fehlende Rohstoffe:';
$LNG['bd_lab_required'] = 'Du musst zuerst ein Forschungslabor auf diesem Planeten Bauen!';
$LNG['bd_building_lab'] = 'Das Forschungslabor wird zurzeit ausgebaut!';
$LNG['bd_max_lvl'] = 'Max. Level:';
$LNG['bd_lvl'] = 'Stufe';
$LNG['bd_research'] = 'Forschung';
$LNG['bd_shipyard_required'] = 'Du musst zuerst eine Schiffswerft auf diesem Planeten Bauen!';
$LNG['bd_building_shipyard'] = 'Die Nanitenfabrik oder Raumschiffwerft wird zurzeit ausgebaut!';
$LNG['bd_available'] = 'Vorhanden: ';
$LNG['bd_build_ships'] = 'Absenden';
$LNG['bd_protection_shield_only_one'] = 'Sie können nur eine Schildkuppel Bauen!';
$LNG['bd_build_defenses'] = 'Absenden';
$LNG['bd_actual_production'] = 'Aktuelle Produktion:';
$LNG['bd_completed'] = 'Fertig';
$LNG['bd_operating'] = 'in Arbeit';
$LNG['bd_continue'] = 'Weiter';
$LNG['bd_price_for_destroy'] = 'Kosten für Abriss:';
$LNG['bd_ready'] = 'Fertig';
$LNG['bd_finished'] = 'Fertig';
$LNG['bd_maxlevel'] = 'Maximale Stufe erreicht';
$LNG['bd_on'] = 'auf';
$LNG['bd_max_builds'] = 'Sie können max. %d Aufträge versenden!';
$LNG['bd_next_level'] = 'Next Level:';
$LNG['bd_need_engine'] = 'Verbraucht <span style="color:#FF0000">%s</span> %s mehr';
$LNG['bd_more_engine'] = 'Produziert <span style="color:#00FF00">%s</span> %s mehr';
$LNG['bd_jump_gate_action'] = 'Springen';
$LNG['bd_cancel_warning'] = 'Bei Abbruch werden nur 60% der Ressis wiederhergestellt!';
$LNG['bd_cancel_send'] = 'Markierte - Löschen';
$LNG['bd_destroy_time'] = 'Dauer';
$LNG['bd_max_ships'] = 'max';
$LNG['bd_max_ships_long'] = 'Maximal baubare Einheiten';
$LNG['sys_notenough_money'] = 'Sie verfügen auf Planet %s <a href="?page=buildings&cp=%d&re=0">[%d:%d:%d]</a> nicht über genügend Ressourcen, um mit dem Bau von %s zu beginnen. <br>Sie verfügen über %s %s , %s %s und %s %s. <br>Die Baukosten betragen %s %s , %s %s und %s %s.';
$LNG['sys_nomore_level'] = 'Sie versuchen, ein Gebäude zu zerstören, was sie nicht mehr besitzen( %s ).';
$LNG['sys_buildlist'] = 'Bauliste';
$LNG['sys_techlist'] = 'Forschungsliste';
$LNG['sys_buildlist_fail'] = 'Bau nicht möglich';
//----------------------------------------------------------------------------//
//RESOURCES
$LNG['rs_amount'] = 'Anzahl';
$LNG['rs_lvl'] = 'Stufe';
$LNG['rs_production_on_planet'] = 'Rohstoffproduktion auf Planet "%s"';
$LNG['rs_basic_income'] = 'Basiseinkommen';
$LNG['rs_storage_capacity'] = 'Lager';
$LNG['rs_calculate'] = 'Berechnen';
$LNG['rs_sum'] = 'Total';
$LNG['rs_daily'] = 'Pro Tag';
$LNG['rs_weekly'] = 'Pro Woche';
$LNG['rs_ress_bonus'] = 'Bonus(Offiziere/DM-Bonus):';
//----------------------------------------------------------------------------//
//OFFICIERS
$LNG['of_recruit'] = 'Erwerben';
$LNG['of_max_lvl'] = 'Max. Level';
$LNG['of_offi'] = 'Offiziere';
$LNG['of_lvl'] = 'Level';
$LNG['of_dm_trade'] = '%s - Bank';
$LNG['of_still'] = 'Noch';
$LNG['of_active'] = 'aktiv';
//----------------------------------------------------------------------------//
//TRADER
$LNG['tr_cost_dm_trader'] = 'Die Händlergebühren betragen %s %s!';
$LNG['tr_not_enought'] = 'Du hast nicht genug %s.';
$LNG['tr_exchange_done'] = 'Erfolgreich umgetauscht';
$LNG['tr_exchange_error'] = 'Zu wenig verfügbare Einheiten oder falscher Typ';
$LNG['tr_call_trader'] = 'Rufe einen Händler';
$LNG['tr_call_trader_who_buys'] = 'Rufe einen Händler, der folgendes kauft ';
$LNG['tr_call_trader_submit'] = 'Rufe Händler';
$LNG['tr_exchange_quota'] = 'Der Handelskurs ist';
$LNG['tr_sell'] = 'Tauschen gegen';
$LNG['tr_resource'] = 'Rohstoff';
$LNG['tr_amount'] = 'Menge';
$LNG['tr_quota_exchange'] = 'Handelskurs';
$LNG['tr_exchange'] = 'Tauschen';
//----------------------------------------------------------------------------//
//TECHTREE
$LNG['tt_requirements'] = 'Benötigt';
$LNG['tt_lvl'] = 'Stufe ';
//----------------------------------------------------------------------------//
//INFOS
$LNG['in_jump_gate_done'] = 'Flotten erfolgreich verschickt. Sie können dieses Sprungtor wieder in %s nutzen.';
$LNG['in_jump_gate_error_data'] = 'Fehler, Daten sind inkorrekt!';
$LNG['in_jump_gate_not_ready_target'] = 'Das Zielsprungtor ist noch nicht bereit: ';
$LNG['in_jump_gate_doesnt_have_one'] = 'Sie haben kein Sprungtor';
$LNG['in_jump_gate_already_used'] = 'Dieses Sprungtor ist noch nicht bereit: ';
$LNG['in_jump_gate_available'] = 'Anzahl';
$LNG['in_rf_again'] = 'Rapidfire gegen';
$LNG['in_rf_from'] = 'Rapidfire von';
$LNG['in_level'] = 'Stufe';
$LNG['in_storage'] = 'Speicher';
$LNG['in_prod_p_hour'] = 'Prod./Bedarf pro h';
$LNG['in_difference'] = 'Differenz';
$LNG['in_range'] = 'Reichweite der Sensoren';
$LNG['in_title_head'] = 'Information von';
$LNG['in_name'] = 'Name';
$LNG['in_struct_pt'] = 'Strukturpunkte';
$LNG['in_shield_pt'] = 'Schildstärke';
$LNG['in_attack_pt'] = 'Angriffswert';
$LNG['in_capacity'] = 'Ladekapazität';
$LNG['in_units'] = 'Einheiten';
$LNG['in_base_speed'] = 'Geschwindigkeit';
$LNG['in_consumption'] = 'Deuteriumverbrauch';
$LNG['in_jump_gate_start_moon'] = 'Ausgangspunkt Mond';
$LNG['in_jump_gate_finish_moon'] = 'Reiseziel Mond';
$LNG['in_jump_gate_select_ships'] = 'Verwenden des Sprungtores: Anzahl der Schiffe';
$LNG['in_jump_gate_wait_time'] = 'Nächst mögliche Nutzung:';
$LNG['in_jump_gate_jump'] = 'Aufladen';
$LNG['in_jump_gate_no_target'] = 'Kein Ziel Sprungtor vorhanden.';
$LNG['in_destroy'] = 'Abreißen';
$LNG['in_needed'] = 'Benötigt';
$LNG['in_dest_durati'] = 'Dauer';
$LNG['in_missilestype'] = 'Raketentyp';
$LNG['in_missilesamount'] = 'Vorhanden';
$LNG['in_engine'] = 'Antrieb';
$LNG['in_bonus'] = 'Bonus:';
//----------------------------------------------------------------------------//
//MESSAGES
$LNG['mg_type'][0] = 'Spionageberichte';
$LNG['mg_type'][1] = 'Spieler Nachrichten';
$LNG['mg_type'][2] = 'Allianz Nachrichten';
$LNG['mg_type'][3] = 'Kampfberichte';
$LNG['mg_type'][4] = 'System Nachrichten';
$LNG['mg_type'][5] = 'Transport';
$LNG['mg_type'][15] = 'Expeditionberichte';
$LNG['mg_type'][50] = 'Game Nachrichten';
$LNG['mg_type'][99] = 'Bauschleife';
$LNG['mg_type'][100] = 'Alle Nachrichten';
$LNG['mg_type'][999] = 'Postausgang';
$LNG['mg_no_subject'] = 'Kein Betreff';
$LNG['mg_no_text'] = 'Kein Text angegeben';
$LNG['mg_msg_sended'] = 'Nachricht gesendet!';
$LNG['mg_read_marked'] = 'Markierte Nachrichten als gelesen markieren';
$LNG['mg_delete_marked'] = 'Markierte Nachrichten löschen';
$LNG['mg_read_type_all'] = 'Alle Nachrichten dieses Typs als gelesen markieren';
$LNG['mg_delete_type_all'] = 'Alle Nachrichten dieses Typs löschen';
$LNG['mg_delete_unmarked'] = 'Nicht Markierte Nachrichten löschen';
$LNG['mg_read_all'] = 'Alle Nachrichten als gelesen markieren';
$LNG['mg_delete_all'] = 'Alle Nachrichten löschen';
$LNG['mg_show_only_header_spy_reports'] = 'Spionageberichte nur teilweise anzeigen';
$LNG['mg_action'] = 'Action';
$LNG['mg_date'] = 'Datum';
$LNG['mg_from'] = 'Von';
$LNG['mg_to'] = 'An';
$LNG['mg_subject'] = 'Betreff';
$LNG['mg_confirm'] = 'Ausführen';
$LNG['mg_message_title'] = 'Nachrichten';
$LNG['mg_message_type'] = 'Nachrichtentyp';
$LNG['mg_total'] = 'Insgesamt';
$LNG['mg_game_operators'] = 'Game Operatoren';
$LNG['mg_error'] = 'Empfänger nicht gefunden!';
$LNG['mg_overview'] = 'Nachrichtenverwaltung';
$LNG['mg_send_new'] = 'Eine Nachricht schreiben';
$LNG['mg_send_to'] = 'Empfänger';
$LNG['mg_message'] = 'Nachricht';
$LNG['mg_characters'] = 'Zeichen';
$LNG['mg_send'] = 'Absenden';
$LNG['mg_game_message'] = 'Game Message';
$LNG['mg_message_send'] = 'Nachricht gesendet!';
$LNG['mg_empty_text'] = 'Gebe ein Text ein!';
$LNG['mg_answer_to'] = 'Antwort an:';
$LNG['mg_write_mail_to_ops'] = 'Schreibe eine E-Mail an';
$LNG['mg_page'] = 'Seite';
$LNG['mg_receiver_block_pm'] = 'Der Empfänger blockiert Private Nachrichten.';
//----------------------------------------------------------------------------//
//ALLIANCE
$LNG['al_not_exists'] = 'Die Allianz existiert nicht.';
$LNG['al_newname_specialchar'] = 'Im Allianzname und -tag sind nur Zahlen, Buchstaben, Leerzeichen, _, -, . erlaubt!';
$LNG['al_description_message'] = 'Für die Allianz wurde keine Beschreibung hinterlegt.';
$LNG['al_web_text'] = 'Homepage';
$LNG['al_request'] = 'Bewerbung';
$LNG['al_click_to_send_request'] = 'Hier klicken, um sich bei der Allianz zu bewerben';
$LNG['al_tag_required'] = 'Du hast keinen Allianztag angegeben.';
$LNG['al_name_required'] = 'Du hast keinen Allianznamen angegeben.';
$LNG['al_already_exists'] = 'Allianz %s existiert bereits.';
$LNG['al_created'] = 'Die Allianz %s wurde gegründet!';
$LNG['al_continue'] = 'Weiter';
$LNG['al_alliance_closed'] = 'Diese Allianz nimmt keine neuen Mitglieder auf.';
$LNG['al_request_confirmation_message'] = 'Bewerbung abgeschickt, sie erhalten eine Nachricht. <br><a href="?page=alliance">Zurück</a>';
$LNG['al_default_request_text'] = 'Der Spieler hat keinen Text hinterlassen.';
$LNG['al_write_request'] = 'Bewerbung schreiben an die Allianz %s';
$LNG['al_request_deleted'] = 'Sie haben die Bewerbung gelöscht. <br>Sie können nun eine Eigene eröffnen oder einer Anderen beitreten.';
$LNG['al_request_wait_message'] = 'Sie haben sich bei der Allianz %s beworben. <br>Warten Sie auf eine Antwort, oder löschen Sie die Bewerbung.';
$LNG['al_delete_request'] = 'Bewerbung löschen';
$LNG['al_founder_cant_leave_alliance'] = 'Der Gründer darf die Allianz nicht einfach so im Stich lassen.';
$LNG['al_leave_sucess'] = 'Erfolgreich aus der Allianz %s ausgetreten.';
$LNG['al_do_you_really_want_to_go_out'] = 'Willst du wirklich aus %s austreten?';
$LNG['al_go_out_yes'] = 'Ja';
$LNG['al_go_out_no'] = 'Nein';
$LNG['al_close_ally'] = 'Möchten sie wirklich die Allianz aufgeben?';
$LNG['al_kick_player'] = 'Möchten sie wirklich den Spieler %s aus der Allianz entfernen?';
$LNG['al_circular_sended'] = "Nachricht gesendet.\nFolgenden Spielern wurde die Mail gesendet:";
$LNG['al_all_players'] = 'Alle Spieler';
$LNG['al_no_ranks_defined'] = 'Keine definierten Ränge.';
$LNG['al_request_text'] = 'Bewerbungstext';
$LNG['al_inside_text'] = 'Interner Text';
$LNG['al_outside_text'] = 'Externer Text';
$LNG['al_transfer_alliance'] = 'Allianz übertragen';
$LNG['al_disolve_alliance'] = 'Allianz auflösen';
$LNG['al_founder_rank_text'] = 'Gründer';
$LNG['al_new_member_rank_text'] = 'Neuling';
$LNG['al_acept_request'] = 'Annehmen';
$LNG['al_you_was_acceted'] = 'Sie wurden aufgenommen bei ';
$LNG['al_hi_the_alliance'] = 'Hallo!<br>Die Allianz <b>';
$LNG['al_has_accepted'] = '</b> hat Ihre Bewerbung akzeptiert.<br>Begründung: <br>';
$LNG['al_decline_request'] = 'Ablehnen';
$LNG['al_you_was_declined'] = 'Sie wurden abgelehnt bei ';
$LNG['al_has_declined'] = '</b> hat Ihre Bewerbung abgelehnt!<br>Begründung: <br>';
$LNG['al_no_requests'] = 'Keine Bewerbungen vorhanden.';
$LNG['al_request_from'] = 'Anfordern "%s"';
$LNG['al_no_request_pending'] = 'Insgesamt gibt es %d Bewerbung(en)';
$LNG['al_name'] = 'Allianzname';
$LNG['al_new_name'] = 'Neuer Allianz Name (3-30 Zeichen):';
$LNG['al_tag'] = 'Allianztag';
$LNG['al_new_tag'] = 'Neuer Allianz Tag (3-8 Zeichen):';
$LNG['al_user_list'] = 'Memberliste';
$LNG['al_users_list'] = 'Memberliste (Spieler: %d)';
$LNG['al_manage_alliance'] = 'Allianz verwalten';
$LNG['al_send_circular_message'] = 'Rundmail schreiben';
$LNG['al_circular_front_text'] = 'Der Spieler %s schreibt folgendes:';
$LNG['al_new_requests'] = '%d neue Bewerbung(en)';
$LNG['al_goto_chat'] = 'Zum Allianz-Chat';
$LNG['al_save'] = 'Speichern';
$LNG['al_dlte'] = 'Löschen';
$LNG['al_rank_name'] = 'Rangname';
$LNG['al_ok'] = 'OK';
$LNG['al_num'] = 'ID';
$LNG['al_member'] = 'Name';
$LNG['al_request_from_user'] = 'Bewerbung von Spieler';
$LNG['al_request_register_time'] = 'Registriert am';
$LNG['al_request_last_onlinetime'] = 'Letzte Aktivität';
$LNG['al_message'] = 'Nachricht';
$LNG['al_position'] = 'Rang';
$LNG['al_points'] = 'Punkte';
$LNG['al_coords'] = 'Koords';
$LNG['al_member_since'] = 'Beigetreten';
$LNG['al_estate'] = 'Online';
$LNG['al_back'] = 'Zurück';
$LNG['al_actions'] = 'Aktionen';
$LNG['al_change_title'] = 'ändern';
$LNG['al_the_alliance'] = 'Allianz';
$LNG['al_change_submit'] = 'Absenden';
$LNG['al_reply_to_request'] = 'Begründung';
$LNG['al_reason'] = '';
$LNG['al_characters'] = 'Zeichen';
$LNG['al_request_list'] = 'Bewerbungsliste';
$LNG['al_candidate'] = 'Name';
$LNG['al_request_date'] = 'Datum';
$LNG['al_transfer_alliance'] = 'Allianz übertragen';
$LNG['al_transfer_to'] = 'Übertragen an';
$LNG['al_transfer_submit'] = 'Absenden';
$LNG['al_ally_information'] = 'Information über die Allianz';
$LNG['al_ally_info_tag'] = 'Tag';
$LNG['al_ally_info_name'] = 'Name';
$LNG['al_ally_info_members'] = 'Mitglieder';
$LNG['al_your_request_title'] = 'Bewerbung';
$LNG['al_applyform_send'] = 'Senden';
$LNG['al_applyform_reload'] = 'Neuladen';
$LNG['al_apply_not_exists'] = 'Die Bewerbung existiert nicht.';
$LNG['al_circular_send_ciruclar'] = 'Rundmail schreiben';
$LNG['al_circular_alliance'] = 'Allianz ';
$LNG['al_receiver'] = 'An Spieler';
$LNG['al_circular_send_submit'] = 'Senden';
$LNG['al_circular_reset'] = 'Zurücksetzten';
$LNG['al_alliance'] = 'Allianzen';
$LNG['al_alliance_make'] = 'Eigene Allianz gründen';
$LNG['al_alliance_search'] = 'Suche Allianz';
$LNG['al_your_ally'] = 'Deine Allianz';
$LNG['al_rank'] = 'Rank';
$LNG['al_web_site'] = 'Homepage';
$LNG['al_inside_section'] = 'Interner Bereich';
$LNG['al_make_alliance'] = 'Eine Allianz gründen';
$LNG['al_make_ally_tag_required'] = 'Allianz Tag (3-8 Zeichen)';
$LNG['al_make_ally_name_required'] = 'Allianz Name (3-30 Zeichen)';
$LNG['al_make_ally_insufficient_points'] = 'Du hast nicht genug Punkte, um eine Allianz zu gründen.<br>Du benötigst mindestenst %s Punkte, dir fehlern %s Punkte.';
$LNG['al_make_submit'] = 'Gründen';
$LNG['al_find_alliances'] = 'Allianz suchen';
$LNG['al_find_text'] = 'Suche nach';
$LNG['al_find_no_alliances'] = 'Keine Allianz gefunden!';
$LNG['al_find_submit'] = 'Suche';
$LNG['al_manage_ranks'] = 'Ränge verwalten';
$LNG['al_manage_members'] = 'Mitglieder verwalten';
$LNG['al_manage_change_tag'] = 'Allianztag ändern';
$LNG['al_manage_change_name'] = 'Allianznamen ändern';
$LNG['al_texts'] = 'Text Management';
$LNG['al_manage_options'] = 'Optionen';
$LNG['al_manage_image'] = 'Allianz Logo';
$LNG['al_manage_requests'] = 'Bewerbungen';
$LNG['al_set_max_members'] = 'Maximale Mitgliederanzahl';
$LNG['al_manage_request_min_points'] = 'Mindestpunktzahl';
$LNG['al_manage_diplo'] = 'Allianz Diplomatie';
$LNG['al_requests_not_allowed'] = 'Bewerbungen nicht erlauben';
$LNG['al_requests_allowed'] = 'Bewerbungen erlauben';
$LNG['al_manage_founder_rank'] = 'Gründer Name';
$LNG['al_configura_ranks'] = 'Rechte einstellen';
$LNG['al_create_new_rank'] = 'neuen Rank erstellen';
$LNG['al_create'] = 'Erstellen';
$LNG['al_legend'] = 'Beschreibung';
$LNG['al_legend_disolve_alliance'] = 'Allianz auflösen';
$LNG['al_legend_kick_users'] = 'Mitglieder entfernen';
$LNG['al_legend_see_requests'] = 'Bewerbungen sehen';
$LNG['al_legend_see_users_list'] = 'Mitgliederliste sehen';
$LNG['al_legend_check_requests'] = 'Bewerbungen bearbeiten';
$LNG['al_legend_admin_alliance'] = 'Allianz verwalten';
$LNG['al_legend_see_connected_users'] = 'Online-Status sehen';
$LNG['al_legend_create_circular'] = 'Rundmails schreiben';
$LNG['al_legend_right_hand'] = 'Rechte Hand';
$LNG['al_requests'] = 'Bewerbungen';
$LNG['al_requests_min_points'] = 'ab %s Punkte';
$LNG['al_circular_message'] = 'Rundmail';
$LNG['al_leave_alliance'] = 'Diese Allianz verlassen';
$LNG['al_unitsshut'] = 'Geschossene Units';
$LNG['al_unitsloos'] = 'Verlorene Units';
$LNG['al_tfmetall'] = 'Gesamtes Trümmerfeld Metall';
$LNG['al_tfkristall'] = 'Gesamtes Trümmerfeld Kristall';
$LNG['al_view_stats'] = 'Kampfstatistik öffentlich?';
$LNG['al_view_diplo'] = 'Diplomatie öffentlich?';
$LNG['al_view_events'] = 'Ereignisse anzeigen';
$LNG['al_memberlist_min'] = 'min';
$LNG['al_memberlist_on'] = 'Online';
$LNG['al_memberlist_off'] = 'Offline';
$LNG['al_diplo'] = 'Diplomatie';
$LNG['al_no_diplo'] = '-';
$LNG['al_events'] = 'Ereignisse';
$LNG['al_no_events'] = 'Derzeit gibt es keine Ereignisse';
$LNG['al_diplo_level'][1] = 'Wing';
$LNG['al_diplo_level'][2] = 'Bündnis';
$LNG['al_diplo_level'][3] = 'Handelsbündnis';
$LNG['al_diplo_level'][4] = 'Nicht Angriffs Pakt';
$LNG['al_diplo_level'][5] = 'Krieg';
$LNG['al_diplo_level'][6] = 'Geheimbündnis';
$LNG['al_diplo_no_entry'] = '- Kein Pakt vorhanden -';
$LNG['al_diplo_no_accept'] = '- Keine Anfragen vorhanden -';
$LNG['al_diplo_accept'] = 'Eingehende Anfragen';
$LNG['al_diplo_accept_send'] = 'Ausgehende Anfragen';
$LNG['al_diplo_create'] = 'Einen neuen Pakt erstellen';
$LNG['al_diplo_create_done'] = 'Pakt-Anfrage erfolgreich erstellt.';
$LNG['al_diplo_ally'] = 'Allianzname';
$LNG['al_diplo_level_des'] = 'Art des Paktes';
$LNG['al_diplo_text'] = 'Anfragetext/Begründung';
$LNG['al_diplo_accept_yes'] = 'Pakt geschlossen';
$LNG['al_diplo_accept_yes_mes'] = 'Es wurde ein Pakt (%s) zwischen den Allianzen %s und %s geschlossen!';
$LNG['al_diplo_accept_yes_confirm'] = 'Möchten Sie wirklich den Pakt annehmen?';
$LNG['al_diplo_accept_no'] = 'Pakt abgelehnt';
$LNG['al_diplo_accept_no_mes'] = 'Die Paktanfrage (%s) zwischen den Allianzen %s und %s wurde abgelehnt!';
$LNG['al_diplo_accept_no_confirm'] = 'Möchten Sie wirklich den Pakt ablehnen?';
$LNG['al_diplo_delete'] = 'Pakt aufgehoben';
$LNG['al_diplo_delete_mes'] = 'Der Pakt (%s) zwischen den Allianzen %s und %s wurde aufgehoben!';
$LNG['al_diplo_confirm_delete'] = 'Möchtest Du wirklich den Pakt löschen?';
$LNG['al_diplo_ground'] = 'Begründung:';
$LNG['al_diplo_ask'] = 'Paktanfrage';
$LNG['al_diplo_ask_mes'] = 'Es besteht eine Paktanfrage (%s) der Allianz %s und %s.<br>Begründung: %s';
$LNG['al_diplo_war'] = 'Kriegserklärung';
$LNG['al_diplo_war_mes'] = 'Die Allianz %s hat der Allianz %s soeben den %s erklärt.<br>Begründung:<br>%s<br><br>Informationen: Der Krieg ist in 24 Stunden gültig. Erst nach den 24 Stunden entfällt die Bashregel. <br>Weitere Informationen findest Du in den <a href="index.php?page=rules" target="_blank">Regeln</a>.';
$LNG['al_diplo_head'] = 'Diplomatieverwaltung';
$LNG['al_diplo_same_alliance'] = 'Du kannst kein Pakt mit dir selbst schließen!';
$LNG['al_diplo_no_alliance'] = 'Es existiert keine Allianz mit der ID %s!';
$LNG['al_diplo_exists'] = 'Es existiert bereits eine gültige oder noch nicht akzeptierte diplomatische Beziehung mit der Allianz "%s"!';
$LNG['al_diplo_info'] = '<p>Auf dieser Seite können die Bündnisse der Allianz verwaltet werden.</p><p>Hier findest du die Erklärung der einzelnen Bündnissarten. [TODO: Link zu FAQ]</p>';
$LNG['al_leave_ally'] = 'Möchtest Du wirklich die Allianz verlassen?';
$LNG['al_default_leader_name'] = 'Leader';
$LNG['al_rank_name'] = 'Name';
$LNG['al_rank_desc']['MEMBERLIST'] = 'Mitgliederliste sehen';
$LNG['al_rank_desc']['ONLINESTATE'] = 'Online-Status sehen';
$LNG['al_rank_desc']['TRANSFER'] = 'Kann Leader werden';
$LNG['al_rank_desc']['SEEAPPLY'] = 'Bewerbungen sehen';
$LNG['al_rank_desc']['MANAGEAPPLY'] = 'Bewerbungen bearbeiten';
$LNG['al_rank_desc']['ROUNDMAIL'] = 'Rundnachricht versicken';
$LNG['al_rank_desc']['ADMIN'] = 'Kann Allianz editieren';
$LNG['al_rank_desc']['KICK'] = 'Kann Mitglieder entfernen';
$LNG['al_rank_desc']['DIPLOMATIC'] = 'Kann Diplomatie verwalten';
$LNG['al_rank_desc']['RANKS'] = 'Rangverwaltung';
$LNG['al_rank_desc']['MANAGEUSERS'] = 'Kann Mitglieder verwalten';
$LNG['al_rank_desc']['EVENTS'] = 'Kann Ereignisse im internen Bereich sehen';
$LNG['al_invalid_rank_name'] = 'Im Ranknamen sind nur Zahlen, Buchstaben, Leerzeichen, _, -, . erlaubt!';
//----------------------------------------------------------------------------//
//BUDDY
$LNG['bu_request_exists'] = 'Spieler bereits in der Buddyliste!';
$LNG['bu_cannot_request_yourself'] = 'Du kannst dich nicht selbst der Buddyliste hinzufügen!';
$LNG['bu_request_message'] = 'Anfragetext';
$LNG['bu_player'] = 'Spieler';
$LNG['bu_request_text'] = 'Begründung';
$LNG['bu_characters'] = 'Zeichen';
$LNG['bu_back'] = 'Zurück';
$LNG['bu_send'] = 'Senden';
$LNG['bu_cancel_request'] = 'Zurücknehmen';
$LNG['bu_accept'] = 'Annehmen';
$LNG['bu_decline'] = 'Ablehnen';
$LNG['bu_connected'] = 'Online';
$LNG['bu_minutes'] = ' min';
$LNG['bu_disconnected'] = 'Offline';
$LNG['bu_online'] = 'Online';
$LNG['bu_buddy_list'] = 'Buddyliste';
$LNG['bu_requests'] = 'Anfragen';
$LNG['bu_alliance'] = 'Allianz';
$LNG['bu_coords'] = 'Koordinaten';
$LNG['bu_text'] = 'Text';
$LNG['bu_action'] = 'Aktion';
$LNG['bu_my_requests'] = 'Meine Anfragen';
$LNG['bu_partners'] = 'Buddys';
$LNG['bu_delete'] = 'Löschen';
$LNG['bu_no_request'] = 'Keine Anfragen vorhanden!';
$LNG['bu_no_buddys'] = 'Keine Buddys vorhanden!';
$LNG['bu_request_send'] = 'Anfrage gesendet!';
$LNG['bu_new_request_title'] = 'Neue Buddylist-Anfrage!';
$LNG['bu_new_request_body'] = 'Hallo %s,<br>%s hat dir eine Buddylist-Anfrage gesendet!';
$LNG['bu_accepted_request_title'] = 'Buddylist-Anfrage akzeptiert!';
$LNG['bu_accepted_request_body'] = 'Hallo %s,<br>%s hat deine Buddylistanfrage angenommen!';
$LNG['bu_rejected_request_title'] = 'Buddylist-Anfrage abgelehnt!';
$LNG['bu_rejected_request_body'] = 'Hallo %s,<br>%s hat deine Buddylistanfrage abgelehnt!';
//----------------------------------------------------------------------------//
//NOTES
$LNG['nt_important'] = 'Wichtig';
$LNG['nt_normal'] = 'Normal';
$LNG['nt_unimportant'] = 'Unwichtig';
$LNG['nt_create_note'] = 'Erstellen';
$LNG['nt_you_dont_have_notes'] = 'Kein Notizen vorhanden';
$LNG['nt_notes'] = 'Notizen';
$LNG['nt_create_new_note'] = 'Erstelle eine neue Notiz';
$LNG['nt_edit_note'] = 'Editiere Notiz';
$LNG['nt_date_note'] = 'Datum';
$LNG['nt_subject_note'] = 'Betreff';
$LNG['nt_size_note'] = 'Größe';
$LNG['nt_dlte_note'] = 'Löschen';
$LNG['nt_priority'] = 'Priorität';
$LNG['nt_note'] = 'Notiz';
$LNG['nt_characters'] = 'Zeichen';
$LNG['nt_back'] = 'Zurück';
$LNG['nt_reset'] = 'Reset';
$LNG['nt_save'] = 'Speichern';
$LNG['nt_no_title'] = 'Kein Titel';
$LNG['nt_no_text'] = 'Kein Text';
//----------------------------------------------------------------------------//
//STATISTICS
$LNG['st_player'] = 'Spieler';
$LNG['st_alliance'] = 'Allianz';
$LNG['st_points'] = 'Punkte';
$LNG['st_fleets'] = 'Flotte';
$LNG['st_researh'] = 'Forschung';
$LNG['st_buildings'] = 'Gebäude';
$LNG['st_defenses'] = 'Verteidigung';
$LNG['st_position'] = 'Rank';
$LNG['st_members'] = 'Mitglieder';
$LNG['st_per_member'] = 'Pro Mitglied';
$LNG['st_statistics'] = 'Statistiken';
$LNG['st_updated'] = 'Aktualisiert am';
$LNG['st_show'] = 'Anzeigen';
$LNG['st_per'] = 'von';
$LNG['st_in_the_positions'] = 'auf den Positionen';
$LNG['st_write_message'] = 'Private Nachricht';
//----------------------------------------------------------------------------//
//SEARCH
$LNG['sh_tag'] = 'Tag';
$LNG['sh_name'] = 'Name';
$LNG['sh_members'] = 'Mitglieder';
$LNG['sh_points'] = 'Punkte';
$LNG['sh_search_in_the_universe'] = 'Suche im Universum';
$LNG['sh_player_name'] = 'Spieler';
$LNG['sh_planet_name'] = 'Planet';
$LNG['sh_alliance_tag'] = 'Allianz Tag';
$LNG['sh_alliance_name'] = 'Allianz Name';
$LNG['sh_search'] = 'Suche';
$LNG['sh_write_message'] = 'Private Nachricht';
$LNG['sh_buddy_request'] = 'Buddylist Anfrage';
$LNG['sh_alliance'] = 'Allianz';
$LNG['sh_planet'] = 'Planet';
$LNG['sh_coords'] = 'Koordinaten';
$LNG['sh_position'] = 'Rank';
$LNG['sh_loading'] = '(Lade ...)';
//----------------------------------------------------------------------------//
//OPTIONS
$LNG['op_error'] = 'Fehler';
$LNG['op_cant_activate_vacation_mode'] = 'Sie können im Urlaubsmodus keine Gebäude und Flotten Bauen.';
$LNG['op_password_changed'] = 'Passwort wurde geändert';
$LNG['op_username_changed'] = 'Username geändert';
$LNG['op_options_changed'] = 'Einstellungen gespeichert.';
$LNG['op_vacation_mode_active_message'] = 'Urlaubsmodus aktiviert. Urlaubsmodus mindestens bis: ';
$LNG['op_end_vacation_mode'] = 'Urlaubsmodus beenden';
$LNG['op_save_changes'] = 'Einstellungen speichern';
$LNG['op_admin_title_options'] = 'Administrator Optionen';
$LNG['op_admin_planets_protection'] = 'Adminschutz aktiveren';
$LNG['op_user_data'] = 'Benutzerdaten';
$LNG['op_username'] = 'Username';
$LNG['op_old_pass'] = 'Altes Passwort';
$LNG['op_new_pass'] = 'neues Passwort (min. 8 Zeichen)';
$LNG['op_repeat_new_pass'] = 'neues Passwort (wiederhohlen)';
$LNG['op_email_adress'] = 'E-Mail Adresse';
$LNG['op_permanent_email_adress'] = 'Permanente E-Mail Adresse';
$LNG['op_general_settings'] = 'Generelle Einstellungen';
$LNG['op_sort_planets_by'] = 'Planeten sortieren nach';
$LNG['op_sort_kind'] = 'Sortierungsreihenfolge';
$LNG['op_lang'] = 'Sprache';
$LNG['op_skin_example'] = 'Theme';
$LNG['op_show_skin'] = 'Skin anzeigen';
$LNG['op_deactivate_ipcheck'] = 'IP-Check deaktivieren';
$LNG['op_galaxy_settings'] = 'Galaxieansicht Einstellungen';
$LNG['op_spy_probes_number'] = 'Spionagesonden Anzahl';
$LNG['op_toolt_data'] = 'Zeige Tooltip für';
$LNG['op_seconds'] = 'Sekunden';
$LNG['op_max_fleets_messages'] = 'Maximale Flottennachrichten';
$LNG['op_show_planetmenu'] = 'Planetenmenü anzeigen';
$LNG['op_shortcut'] = 'Shortcut';
$LNG['op_show'] = 'Anzeigen';
$LNG['op_spy'] = 'Spionieren';
$LNG['op_write_message'] = 'Nachricht schreiben';
$LNG['op_add_to_buddy_list'] = 'Zur Buddyliste hinzufügen';
$LNG['op_missile_attack'] = 'Raketenangriff';
$LNG['op_send_report'] = 'Spionagereport';
$LNG['op_vacation_delete_mode'] = 'Urlaubsmodus / Account löschen';
$LNG['op_activate_vacation_mode'] = 'Urlaubsmodus aktiveren';
$LNG['op_dlte_account'] = 'Account löschen';
$LNG['op_email_adress_descrip'] = 'Diese Mailadresse kann jederzeit von Dir geändert werden. Nach 7 Tagen ohne Änderung wird diese als permanente Adresse eingetragen.';
$LNG['op_deactivate_ipcheck_descrip'] = 'IP-Check bedeutet, dass automatisch ein Sicherheitslogout erfolgt, wenn die IP gewechselt wird oder zwei Leute gleichzeitig unter verschiedenen IPs in einem Account eingeloggt sind. Den IP-Check zu deaktivieren kann ein Sicherheitsrisiko darstellen!';
$LNG['op_spy_probes_number_descrip'] = 'Anzahl der Spionagesonden, die bei jedem Scan aus dem Galaxiemenu direkt versendet werden.';
$LNG['op_activate_vacation_mode_descrip'] = 'Der Urlaubsmodus soll während längerer Abwesenheitszeiten schützen. Man kann ihn nur aktivieren, wenn nichts gebaut und geforscht wird und auch keine eigenen Flotten unterwegs sind. Ist er aktiviert, schützt er euch vor neuen Angriffen, bereits begonnene Angriffe werden jedoch fortgesetzt. Während des Urlaubsmodus wird die Produktion auf Null gesetzt und muss nach Beenden des Urlaubsmodus manuell wieder auf 100% gesetzt werden. Der Urlaubsmodus Dauert mindestens 2 Tage, erst danach könnt Ihr ihn wieder deaktivieren.';
$LNG['op_dlte_account_descrip'] = 'Wenn du hier ein Hacken setzt, wird dein Account nach 7 Tagen automatisch komplett gelöscht.';
$LNG['op_need_pass_mail'] = 'Um deine E-Mail-Adresse zu ändern, musst du dein Passwort eingeben!';
$LNG['op_not_vaild_mail'] = 'Du hast keine gültige E-Mail Adresse angegeben!';
$LNG['op_change_mail_exist'] = 'Die angegebene E-Mail-Adresse %s wird bereits verwendet!';
$LNG['op_sort_normal'] = 'Reihenfolge der Entstehung';
$LNG['op_sort_koords'] = 'Koordinaten';
$LNG['op_sort_abc'] = 'Alphabet';
$LNG['op_sort_up'] = 'aufsteigend';
$LNG['op_sort_down'] = 'absteigend';
$LNG['op_user_name_no_alphanumeric'] = 'Bitte beim Username nur alphanumerische Zeichen eingeben!';
$LNG['op_change_name_pro_week'] = 'Sie Können ihren Usernamen nur 1x pro Woche ändern';
$LNG['op_change_name_exist'] = 'Der Name %s existiert bereits';
$LNG['op_active_build_messages'] = 'Baulistennachrichten aktivieren';
$LNG['op_active_spy_messages_mode'] = 'Spioangeberichte zusammenfassen';
$LNG['op_dst_mode'] = 'Sommerzeit?';
$LNG['op_dst_mode_sel'][0] = 'Nein';
$LNG['op_dst_mode_sel'][1] = 'Ja';
$LNG['op_dst_mode_sel'][2] = 'Automatisch';
$LNG['op_timezone'] = 'Zeitzone';
$LNG['op_block_pm'] = 'Private Nachrichten blockieren';
//----------------------------------------------------------------------------//
//BANNED
$LNG['bn_no_players_banned'] = 'Zurzeit ist kein Spieler gesperrt';
$LNG['bn_exists'] = 'Es existieren ';
$LNG['bn_players_banned'] = ' gebannte Spieler';
$LNG['bn_players_banned_list'] = 'Pranger';
$LNG['bn_player'] = 'Spielername ';
$LNG['bn_reason'] = 'Grund';
$LNG['bn_from'] = 'Sperrdatum';
$LNG['bn_until'] = 'Gesperrt bis';
$LNG['bn_by'] = 'Adminname';
$LNG['bn_writemail'] = 'Mail an %s schreiben';
//----------------------------------------------------------------------------//
//class.CheckSession.php
$LNG['css_account_banned_message'] = 'Dein Account wurde gesperrt!';
$LNG['css_account_banned_expire'] = 'Du bist bis zum %s gesperrt!<br><a href="./index.php?page=pranger">Pranger</a>';
$LNG['css_goto_homeside'] = '<a href="./index.php">Zur Startseite</a>';
$LNG['css_server_maintrace'] = 'Server Maintenance<br><br>Spiel zurzeit geschlossen.<br><br>Grund: %s';
//----------------------------------------------------------------------------//
//class.FlyingFleetsTable.php
$LNG['cff_aproaching'] = 'Flotte besteht aus ';
$LNG['cff_ships'] = ' Einheiten.';
$LNG['cff_no_fleet_data'] = 'Keine Schiffsinformationen';
$LNG['cff_acs_fleet'] = 'Verbandsflotte';
$LNG['cff_fleet_own'] = 'Flotte';
$LNG['cff_fleet_target'] = 'Flotten';
$LNG['cff_mission_acs'] = 'Eine %s vom %s %s %s erreicht den %s %s %s. Mission: %s';
$LNG['cff_mission_own_0'] = 'Eine deiner %s vom %s %s %s erreicht den %s %s %s. Mission: %s';
$LNG['cff_mission_own_1'] = 'Eine deiner %s kehrt vom %s %s %s zurück zum %s %s %s. Mission: %s';
$LNG['cff_mission_own_2'] = 'Eine deiner %s vom %s %s %s sind im Orbit von dem %s %s %s. Mission: %s';
$LNG['cff_mission_own_mip'] = 'Raketenangriff (%d) vom %s %s %s auf den %s %s %s.';
$LNG['cff_mission_own_expo_0'] = 'Eine deiner %s vom %s %s %s erreicht die Position %s. Mission: %s';
$LNG['cff_mission_own_expo_1'] = 'Eine deiner %s kehrt von der Position %s zurück zum %s %s %s. Mission: %s';
$LNG['cff_mission_own_expo_2'] = 'Eine deiner %s vom %s %s %s ist auf einer Expedition bei Position %s. Mission: %s';
$LNG['cff_mission_own_recy_0'] = 'Eine deiner %s vom %s %s %s erreicht das Trümmerfeld %s. Mission: %s';
$LNG['cff_mission_own_recy_1'] = 'Eine deiner %s kehrt vom Trümmerfeld %s zurück zum Planeten %s %s %s. Mission: %s';
$LNG['cff_mission_target_bad'] = 'Eine feindliche %s vom Spieler %s vom %s %s %s erreicht den %s %s %s. Mission: %s';
$LNG['cff_mission_target_good'] = 'Eine friedliche %s vom Spieler %s vom %s %s %s erreicht den %s %s %s. Mission: %s';
$LNG['cff_mission_target_stay'] = 'Eine friedliche %s vom Spieler %s vom %s %s %s ist im Orbit von dem %s %s %s. Mission: %s';
$LNG['cff_mission_target_mip'] = 'Raketenangriff (%d) vom Spieler %s vom %s %s %s auf den %s %s %s.';
//----------------------------------------------------------------------------//
// EXTRA LANGUAGE FUNCTIONS
$LNG['fcm_universe'] = 'Universum';
$LNG['fcm_mainplanet'] = 'Hauptplanet';
$LNG['fcm_planet'] = 'Planet';
$LNG['fcm_moon'] = 'Mond';
$LNG['fcm_info'] = 'Information';
$LNG['fcp_colony'] = 'Kolonie';
$LNG['fgp_require'] = 'Benötigt';
$LNG['fgf_time'] = 'Bauzeit';
$LNG['sys_module_inactive'] = 'Modul inaktiv';
$LNG['sys_refferal_from'] = 'System';
$LNG['sys_refferal_title'] = 'Bonus für Spieler %s';
$LNG['sys_refferal_text'] = 'Der von dir geworbene Spieler %s hat nun %s Punkte erreicht.<br><br>Als Dankeschön, dass du einen aktiven Spieler geworben hast, erhältst du %s %s';
$LNG['sys_closed_game'] = 'Das Universum ist zur Zeit nicht verfügbar:';
$LNG['spec_mail_inactive_title'] = '%s - Erinnerung';
$LNG['sys_back'] = 'Zurück';
$LNG['sys_forward'] = 'Weiter';
//----------------------------------------------------------------------------//
// CombatReport.php
$LNG['cr_lost_contact'] = 'Der Kontakt ist mit den Flotten verloren gegangen.';
$LNG['cr_first_round'] = '(Die Flotte wurde in der 1. Runde zerstört)';
$LNG['cr_type'] = 'Typ';
$LNG['cr_total'] = 'Total';
$LNG['cr_weapons'] = 'Waffen';
$LNG['cr_shields'] = 'Schild';
$LNG['cr_armor'] = 'Panzerung';
$LNG['cr_destroyed'] = 'Zerstört!';
//----------------------------------------------------------------------------//
// FleetAjax.php
$LNG['fa_not_enough_probes'] = 'Fehler, keine Sonden vorhanden';
$LNG['fa_galaxy_not_exist'] = 'Fehler, Galaxie nicht vorhanden';
$LNG['fa_system_not_exist'] = 'Fehler, System nicht vorhanden';
$LNG['fa_planet_not_exist'] = 'Fehler, Planet nicht vorhanden';
$LNG['fa_not_enough_fuel'] = 'Fehler, nicht genügend Deuterium vorhanden';
$LNG['fa_no_more_slots'] = 'Fehler, keine Slots verfügbar';
$LNG['fa_no_recyclers'] = 'Fehler, keine Recycler vorhanden';
$LNG['fa_no_fleetroom'] = 'Fehler, Deuteriumverbrauch größer als Transportkapazität';
$LNG['fa_mission_not_available'] = 'Fehler, Mission nicht verfügbar';
$LNG['fa_no_spios'] = 'Fehler, keine Sonden vorhanden';
$LNG['fa_vacation_mode'] = 'Fehler, Spieler befindet sich im Urlaubsmodus';
$LNG['fa_week_player'] = 'Fehler, Spieler ist zu schwach';
$LNG['fa_strong_player'] = 'Fehler, Spieler ist zu stark';
$LNG['fa_not_spy_yourself'] = 'Fehler, Sie können sich nicht selber spionieren';
$LNG['fa_not_attack_yourself'] = 'Fehler, Sie können sich nicht selber angreifen';
$LNG['fa_action_not_allowed'] = 'Fehler, Systemfehler';
$LNG['fa_vacation_mode_current'] = 'Fehler, Sie befinden sich im Urlaubsmodus';
$LNG['fa_sending'] = 'Gesendet';
//----------------------------------------------------------------------------//
// MissilesAjax.php
$LNG['ma_silo_level'] = 'Du benötigst Raketensilo Stufe 4!';
$LNG['ma_impulse_drive_required'] = 'Du musst zuerst das Impulstriebwerk erforschen';
$LNG['ma_not_send_other_galaxy'] = 'Du kannst keine Raketen in eine andere Galaxie schicken.';
$LNG['ma_planet_doesnt_exists'] = 'Planet existiert nicht.';
$LNG['ma_wrong_target'] = 'Kein Ziel';
$LNG['ma_no_missiles'] = 'Du hast keine Interplanetarraketen';
$LNG['ma_add_missile_number'] = 'Sie müssen eine Zahl eingeben!';
$LNG['ma_misil_launcher'] = 'Raketenwerfer';
$LNG['ma_small_laser'] = 'Leichtes Lasergeschütz';
$LNG['ma_big_laser'] = 'Schweres Lasergeschütz';
$LNG['ma_gauss_canyon'] = 'Gaußkanone';
$LNG['ma_ionic_canyon'] = 'Ionenkanone';
$LNG['ma_buster_canyon'] = 'Plasmawerfer';
$LNG['ma_small_protection_shield'] = 'Kleine Schildkuppel';
$LNG['ma_big_protection_shield'] = 'Große Schildkuppel';
$LNG['ma_all'] = 'Alle';
$LNG['ma_missiles_sended'] = ' Interplanetarraketen gesendet. Zerstörte Objekte: ';
//----------------------------------------------------------------------------//
// topkb.php
$LNG['tkb_top'] = 'Hall of Fame';
$LNG['tkb_gratz'] = 'Das ganze Team gratuliert den Top 100';
$LNG['tkb_platz'] = 'Platz';
$LNG['tkb_owners'] = 'Beteiligte';
$LNG['tkb_datum'] = 'Datum';
$LNG['tkb_units'] = 'Units';
$LNG['tkb_legende'] = '<b>Legende: </b>';
$LNG['tkb_gewinner'] = '<b>-Gewinner-</b>';
$LNG['tkb_verlierer'] = '<b>-Verlierer-</b>';
$LNG['tkb_unentschieden'] = '<b>-Beide Weiss, unentschieden- </b>';
$LNG['tkb_missing'] = '<br>Missing in Action: Der Useraccount existiert nicht mehr.';
//----------------------------------------------------------------------------//
// playercard.php
$LNG['pl_overview'] = 'Playercard';
$LNG['pl_name'] = 'Username';
$LNG['pl_homeplanet'] = 'Heimatplanet';
$LNG['pl_ally'] = 'Allianz';
$LNG['pl_message'] = 'Private Nachricht';
$LNG['pl_buddy'] = 'Freundesanfrage stellen';
$LNG['pl_points'] = 'Punkte';
$LNG['pl_range'] = 'Rank';
$LNG['pl_builds'] = 'Gebäude';
$LNG['pl_tech'] = 'Forschung';
$LNG['pl_fleet'] = 'Flotte';
$LNG['pl_def'] = 'Defensive';
$LNG['pl_total'] = 'Gesamt';
$LNG['pl_fightstats'] = 'Kampfstatistik';
$LNG['pl_fights'] = 'Kämpfe';
$LNG['pl_fprocent'] = 'Kampfquote';
$LNG['pl_fightwon'] = 'Siege';
$LNG['pl_fightdraw'] = 'Unentschieden';
$LNG['pl_fightlose'] = 'Verloren';
$LNG['pl_totalfight'] = 'Gesamtkämpfe';
$LNG['pl_destroy'] = '%s war an folgenden Zerstörungen beteiligt';
$LNG['pl_unitsshot'] = 'Geschossene Units';
$LNG['pl_unitslose'] = 'Verlorene Units';
$LNG['pl_dermetal'] = 'Gesamt Trümmerfeld Metall';
$LNG['pl_dercrystal'] = 'Gesamt Trümmerfeld Kristall';
$LNG['pl_etc'] = 'Kontakt';
//----------------------------------------------------------------------------//
// Support
$LNG['ti_header'] = 'Support-System';
$LNG['ti_overview'] = 'Zurück zur Übersicht';
$LNG['ti_id'] = 'Ticket';
$LNG['ti_username'] = 'Spieler';
$LNG['ti_subject'] = 'Betreff';
$LNG['ti_status'] = 'Status';
$LNG['ti_date'] = 'Datum';
$LNG['ti_answers'] = 'Antworten';
$LNG['ti_close'] = 'Ticket schließen';
$LNG['ti_open'] = 'Ticket öffnen';
$LNG['ti_new'] = 'Neues Ticket erstellen';
$LNG['ti_status_open'] = 'Offen';
$LNG['ti_status_closed'] = 'Geschlossen';
$LNG['ti_status_answer'] = 'Beantwortet';
$LNG['ti_error_closed'] = 'Auf dieses Ticket kann keine Antwort erstellt werden, da es bereits geschlossen wurde!';
$LNG['ti_admin_open'] = 'Ticket wurde geöffnet!';
$LNG['ti_admin_close'] = 'Ticket wurde geschlossen!';
$LNG['ti_create_info'] = '<p>Bitte vergeben Sie beim Erstellen einer neuen Anfrage einen möglichst aussagekräftigen Betreff und schildern Sie Ihr Anliegen so detailliert wie möglich.</p>
<p>Eine genaue Beschreibung Ihrer Anfrage ermöglicht kurze Bearbeitungszeiten und vermeidet zeitaufwendige Rückfragen auf beiden Seiten.</p>
<p>Bei accountbezogenen Fragen erleichtert die Angabe des entsprechenden Kundenaccounts die Zuordnung und verkürzt ebenfalls die Bearbeitungsdauer.</p>';
$LNG['ti_create_head'] = 'Neues Ticket';
$LNG['ti_category'] = 'Kategorie';
$LNG['ti_subject'] = 'Betreff';
$LNG['ti_message'] = 'Nachricht';
$LNG['ti_submit'] = 'Absenden';
$LNG['ti_read'] = 'Ticket lesen';
$LNG['ti_answer'] = 'Antwort schreiben';
$LNG['ti_create'] = 'Ticket erstellt am';
$LNG['ti_msgtime'] = 'Nachricht geschrieben am';
$LNG['ti_responded'] = 'Ticket antworteten am ';
$LNG['ti_not_exist'] = 'Das Ticket #%d existiert nicht!';
$LNG['ti_from'] = 'von';
$LNG['ti_re'] = 'RE:';
$LNG['ti_error_no_subject'] = 'Du musst einen Betreff eingeben!';
//----------------------------------------------------------------------------//
// Rekorde
$LNG['rec_players'] = 'Spieler';
$LNG['rec_level'] = 'Level';
$LNG['rec_count'] = 'Anzahl';
$LNG['rec_last_update_on'] = 'Letztes Update um';
//----------------------------------------------------------------------------//
// BattleSimulator
$LNG['bs_derbis_raport'] = 'Es werden %s %s oder %s %s für das Trümmerfeld benötigt.';
$LNG['bs_steal_raport'] = 'Für die Beute werden %s %s oder %s %s oder %s %s benötigt.';
$LNG['bs_names'] = 'Schiffname';
$LNG['bs_atter'] = 'Angreifer';
$LNG['bs_deffer'] = 'Verteidiger';
$LNG['bs_steal'] = 'Rohstoffe (für Steal):';
$LNG['bs_techno'] = 'Techniken';
$LNG['bs_send'] = 'Absenden';
$LNG['bs_cancel'] = 'Zurücksetzen';
$LNG['bs_wait'] = 'Warte 10 Sekunden für nächste Simulation';
$LNG['bs_acs_slot'] = 'AKS-Slot';
$LNG['bs_add_acs_slot'] = 'Add AKS-Slot';
$LNG['bs_reset'] = 'Reset';
//----------------------------------------------------------------------------//
// Fleettrader
$LNG['ft_head'] = 'Schrotthandler';
$LNG['ft_count'] = 'Anzahl';
$LNG['ft_max'] = 'max';
$LNG['ft_total'] = 'TOTAL';
$LNG['ft_charge'] = 'Händlergebühr';
$LNG['ft_absenden'] = 'Absenden';
$LNG['ft_empty'] = 'Der Schrothändel kauft zur Zeit keine Schiffe!';
//----------------------------------------------------------------------------//
// Logout
$LNG['lo_title'] = 'Logout erfolgreich! Bis bald';
$LNG['lo_logout'] = 'Session wurde beendet';
$LNG['lo_redirect'] = 'Weiterleitung';
$LNG['lo_notify'] = 'Sie werden in <span id="seconds">5</span>s weitergeleitet';
$LNG['lo_continue'] = 'Klicken Sie hier, um nicht zu warten';
//----------------------------------------------------------------------------//
// Translated into German by Jan . All rights reversed (C) 2011
| mimikri/2Moons-1.8-mods | language/de/INGAME.php | PHP | mit | 61,296 |
;(function() {
var ValueDirective = function() {
};
_.extend(ValueDirective.prototype, {
matcher: function($el) {
return $el.data('value');
},
run: function($el) {
$el.html($el.data('value'));
}
});
window.app = new xin.App({
el: xin.$('body'),
directives: {
'[data-role=app]': xin.directive.AppDirective,
'[data-role]': xin.directive.RoleDirective,
'[data-uri]': xin.directive.URIDirective,
'[data-bind]': xin.directive.BindDirective,
'[data-value]': ValueDirective,
'[data-background]': xin.directive.BackgroundDirective
},
middlewares: {
'AuthMiddleware': AuthMiddleware
},
providers: {
}
});
_.extend(app, {
db: null,
user: {},
config: function(param) {
if(param) {
return window.config[param];
} else {
return window.config;
}
},
invoke: function(api, param, cb) {
api = api.split('.');
if(typeof(param) == "function") {
window.API[api[0]][api[1]](param);
} else {
delete arguments[0];
var opt = [],
j = 0;
for (var i in arguments) {
opt.push(arguments[i]);
}
window.API[api[0]][api[1]].apply(this, opt);
}
},
loading: {
show: function(options) {
ActivityIndicator.show(options);
},
hide: function() {
ActivityIndicator.hide();
}
},
storage: function(type, key, value, cb) {
if (!key && !value) return;
if(key && !value) {
var res = window[type].getItem(key);
try {
res = JSON.parse(res);
} catch(e) {}
if(cb) cb(res);
} else if(key && value) {
if(typeof value !== "string") value = JSON.stringify(value);
window[type].setItem(key, value);
}
},
sessionStorage: function(key, value) {
if(typeof value === 'function') {
this.storage('sessionStorage', key, undefined, value);
} else {
this.storage('sessionStorage', key, value);
}
},
localStorage: function(key, value) {
if(typeof value === 'function') {
this.storage('localStorage', key, undefined, value);
} else {
this.storage('localStorage', key, value);
}
},
clearStorage: function(type) { // type = localStorage || sessionStorage
if(!type) {
localStorage.clear();
sessionStorage.clear();
return;
}
if(type === 'localStorage' || type === 'sessionStorage') {
window[type].clear();
}
}
});
})();
| aliaraaab/xin-arch | js/app/app.js | JavaScript | mit | 3,178 |
module Gitlab
module Metrics
module Subscribers
# Class for tracking the total time spent in Rails cache calls
# http://guides.rubyonrails.org/active_support_instrumentation.html
class RailsCache < ActiveSupport::Subscriber
attach_to :active_support
def cache_read(event)
observe(:read, event.duration)
return unless current_transaction
return if event.payload[:super_operation] == :fetch
if event.payload[:hit]
current_transaction.increment(:cache_read_hit_count, 1, false)
else
metric_cache_misses_total.increment(current_transaction.labels)
current_transaction.increment(:cache_read_miss_count, 1, false)
end
end
def cache_write(event)
observe(:write, event.duration)
end
def cache_delete(event)
observe(:delete, event.duration)
end
def cache_exist?(event)
observe(:exists, event.duration)
end
def cache_fetch_hit(event)
return unless current_transaction
current_transaction.increment(:cache_read_hit_count, 1)
end
def cache_generate(event)
return unless current_transaction
metric_cache_misses_total.increment(current_transaction.labels)
current_transaction.increment(:cache_read_miss_count, 1)
end
def observe(key, duration)
return unless current_transaction
metric_cache_operation_duration_seconds.observe(current_transaction.labels.merge({ operation: key }), duration / 1000.0)
current_transaction.increment(:cache_duration, duration, false)
current_transaction.increment(:cache_count, 1, false)
current_transaction.increment("cache_#{key}_duration".to_sym, duration, false)
current_transaction.increment("cache_#{key}_count".to_sym, 1, false)
end
private
def current_transaction
Transaction.current
end
def metric_cache_operation_duration_seconds
@metric_cache_operation_duration_seconds ||= Gitlab::Metrics.histogram(
:gitlab_cache_operation_duration_seconds,
'Cache access time',
Transaction::BASE_LABELS.merge({ action: nil }),
[0.001, 0.01, 0.1, 1, 10]
)
end
def metric_cache_misses_total
@metric_cache_misses_total ||= Gitlab::Metrics.counter(
:gitlab_cache_misses_total,
'Cache read miss',
Transaction::BASE_LABELS
)
end
end
end
end
end
| jirutka/gitlabhq | lib/gitlab/metrics/subscribers/rails_cache.rb | Ruby | mit | 2,649 |
//
// FSpotContentDirectory.cs
//
// Author:
// Yavor Georgiev <fealebenpae@gmail.com>
//
// Copyright (c) 2010 Yavor Georgiev
//
// 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.
using System;
using System.Linq;
using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1;
using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV;
using System.Net;
using System.Collections.Generic;
using Mono.Upnp.Xml;
using FSpot;
using System.Net.Sockets;
using FSpot.Query;
using FSpotPhoto = FSpot.Photo;
using UpnpPhoto = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV.Photo;
using UpnpObject = Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.Object;
using System.Collections;
using Mono.Upnp.Dcp.MediaServer1.ConnectionManager1;
namespace Mono.Upnp.Dcp.MediaServer1.FSpot
{
public class FSpotContentDirectory : ObjectBasedContentDirectory
{
bool started;
HttpListener listener;
string prefix = GeneratePrefix ();
Db db = App.Instance.Database;
Dictionary<uint, UpnpPhoto> photos_cache;
Dictionary<uint, Container> tags_cache;
List<uint> shared_tags;
bool share_all_tags = GConfHelper.ShareAllCategories;
int id = 0;
public FSpotContentDirectory ()
{
photos_cache = new Dictionary<uint, UpnpPhoto> ();
tags_cache = new Dictionary<uint, Container> ();
shared_tags = new List<uint> (GConfHelper.SharedCategories);
PrepareRoot ();
listener = new HttpListener { IgnoreWriteExceptions = true };
listener.Prefixes.Add (prefix);
}
void PrepareRoot ()
{
var child_count = 0;
if (!share_all_tags) {
foreach (var tag in db.Tags.RootCategory.Children) {
if (shared_tags.Contains (tag.Id)) {
child_count++;
}
}
} else {
child_count = db.Tags.RootCategory.Children.Count;
}
var rootOptions = new StorageFolderOptions {
IsRestricted = true,
Title = "F-Spot RootCategory",
ChildCount = child_count
};
var root = new StorageFolder(id.ToString (), "-1", rootOptions);
tags_cache.Add (db.Tags.RootCategory.Id, root);
}
public override void Start ()
{
CheckDisposed();
if (started) {
return;
}
base.Start ();
started = true;
lock (listener) {
listener.Start ();
listener.BeginGetContext (OnGotContext, null);
}
}
public override void Stop ()
{
CheckDisposed ();
if (!started) {
return;
}
started = false;
base.Stop ();
lock (listener) {
listener.Stop ();
}
}
void OnGotContext (IAsyncResult result)
{
lock (listener) {
if (!listener.IsListening) {
return;
}
var context = listener.EndGetContext (result);
var query = context.Request.Url.Query;
if (query.StartsWith ("?id="))
{
ServePhoto (context.Response, query);
} else
{
context.Response.StatusCode = 404;
}
listener.BeginGetContext (OnGotContext, null);
}
}
void ServePhoto (HttpListenerResponse response, string query)
{
var id = query.Substring (4);
var photoId = photos_cache.Where ((kv) => kv.Value.Id == id).FirstOrDefault ().Key;
var photo = db.Photos.Get (photoId);
using (response) {
if (photo == null) {
response.StatusCode = 404;
return;
}
try {
using (var reader = System.IO.File.OpenRead (photo.DefaultVersion.Uri.AbsolutePath)) {
response.ContentType = MimeTypeHelper.GetMimeType (photo.DefaultVersion.Uri);
response.ContentLength64 = reader.Length;
using (var stream = response.OutputStream) {
using (var writer = new System.IO.BinaryWriter (stream)) {
var buffer = new byte[8192];
int read;
do {
read = reader.Read (buffer, 0, buffer.Length);
writer.Write (buffer, 0, read);
} while (started && read > 0);
}
}
}
} catch {
}
}
}
protected override void Dispose (bool disposing)
{
if (IsDisposed) {
return;
}
base.Dispose (disposing);
if (disposing) {
Stop ();
listener.Close ();
}
listener = null;
}
protected override string SearchCapabilities {
get {
return string.Empty;
}
}
protected override string SortCapabilities {
get {
return string.Empty;
}
}
protected override int VisitChildren (Action<UpnpObject> consumer, string objectId, int startIndex, int requestCount, string sortCriteria, out int totalMatches)
{
var tag_key_value = tags_cache.Where ((kv) => kv.Value.Id == objectId).FirstOrDefault ();
if (tag_key_value.Value != null) {
var tag = db.Tags.Get (tag_key_value.Key);
if (tag != null) {
var results = db.Photos.Query (new TagTerm (tag));
totalMatches = results.Count ();
var upnp_result = new List<UpnpObject> ();
var category = tag as Category;
if (category != null) {
foreach (var child_tag in category.Children) {
if (!share_all_tags && !shared_tags.Contains (child_tag.Id)) {
continue;
}
upnp_result.Add (GetContainer (child_tag, tag_key_value.Value));
totalMatches++;
}
}
var photos = results.Skip (startIndex).Take (requestCount - totalMatches);
foreach (var photo in photos) {
upnp_result.Add (GetPhoto (photo, tag_key_value.Value));
}
foreach (var result in upnp_result) {
consumer (result);
}
return upnp_result.Count;
}
}
totalMatches = 0;
return 0;
}
UpnpPhoto GetPhoto (FSpotPhoto photo, Container parent)
{
UpnpPhoto upnp_photo = null;
if (!photos_cache.ContainsKey (photo.Id)) {
var resource_options = new ResourceOptions {
ProtocolInfo = new ProtocolInfo (Protocols.HttpGet, MimeTypeHelper.GetMimeType(photo.DefaultVersion.Uri))
};
var resource_uri = new Uri (string.Format ("{0}object?id={1}", prefix, upnp_photo.Id));
var photo_options = new PhotoOptions {
Title = photo.Name,
Rating = photo.Rating.ToString(),
Description = photo.Description,
Resources = new [] { new Resource (resource_uri, resource_options) }
};
upnp_photo = new UpnpPhoto ((id++).ToString (), parent.Id, photo_options);
photos_cache.Add (photo.Id, upnp_photo);
} else {
upnp_photo = photos_cache [photo.Id];
}
return upnp_photo;
}
Container GetContainer (Tag tag, Container parent)
{
Container container = null;
if (!tags_cache.ContainsKey (tag.Id)) {
var album_options = new AlbumOptions { Title = tag.Name, Description = "Tag" };
var photo_album = new PhotoAlbum ((id++).ToString (), parent.Id, album_options);
tags_cache.Add (tag.Id, photo_album);
container = photo_album;
} else
{
container = tags_cache [tag.Id];
}
return container;
}
protected override UpnpObject GetObject (string objectId)
{
var tags = tags_cache.Values.Cast <UpnpObject> ();
var photos = photos_cache.Values.Cast <UpnpObject> ();
var objects = tags.Union (photos);
var obj = objects.Where (o => o.Id == objectId).FirstOrDefault ();
if (obj != null) {
return obj;
}
return null;
}
public bool IsDisposed {
get { return listener == null; }
}
void CheckDisposed ()
{
if (IsDisposed) {
throw new ObjectDisposedException (ToString ());
}
}
static string GeneratePrefix ()
{
foreach (var address in Dns.GetHostAddresses (Dns.GetHostName ())) {
if (address.AddressFamily == AddressFamily.InterNetwork) {
return string.Format (
"http://{0}:{1}/f-spot/photo-sharing/", address, (new Random ()).Next (1024, 5000));
}
}
return null;
}
}
}
| mono/mono-upnp | src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FSpot/Service/FSpotContentDirectory.cs | C# | mit | 11,139 |
import getDocument from './get-document';
export default function(node) {
const _document = getDocument(node);
return _document.defaultView || window;
}
| DNACodeStudios/ally.js | src/util/get-window.js | JavaScript | mit | 159 |
#region Disclaimer/Info
///////////////////////////////////////////////////////////////////////////////////////////////////
// Subtext WebLog
//
// Subtext is an open source weblog system that is a fork of the .TEXT
// weblog system.
//
// For updated news and information please visit http://subtextproject.com/
// Subtext is hosted at Google Code at http://code.google.com/p/subtext/
// The development mailing list is at subtext@googlegroups.com
//
// This project is licensed under the BSD license. See the License.txt file for more information.
///////////////////////////////////////////////////////////////////////////////////////////////////
#endregion
using System;
using System.Collections.Generic;
using Subtext.Framework;
using Subtext.Framework.Components;
namespace Subtext.Web.UI.Controls
{
/// <summary>
/// Summary description for ArticleCategories.
/// </summary>
public class ArticleCategories : BaseControl
{
protected CategoryList Categories;
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Categories.LinkCategories = GetArchiveCategories(SubtextContext.Blog);
}
protected ICollection<LinkCategory> GetArchiveCategories(Blog blog)
{
return new List<LinkCategory> { Repository.Links(CategoryType.StoryCollection, blog, Url) };
}
}
} | jeuvin/Subtext | src/Subtext.Web/UI/Controls/ArticleCategories.cs | C# | mit | 1,393 |
var expect = require('expect.js');
var helpers = require('../helpers');
var fakeRepositoryFactory = function () {
function FakeRepository() { }
FakeRepository.prototype.getRegistryClient = function () {
return {
unregister: function (name, cb) {
cb(null, { name: name });
}
};
};
return FakeRepository;
};
var unregister = helpers.command('unregister');
var unregisterFactory = function () {
return helpers.command('unregister', {
'../core/PackageRepository': fakeRepositoryFactory()
});
};
describe('bower unregister', function () {
it('correctly reads arguments', function () {
expect(unregister.readOptions(['jquery']))
.to.eql(['jquery']);
});
it('errors if name is not provided', function () {
return helpers.run(unregister).fail(function (reason) {
expect(reason.message).to.be('Usage: bower unregister <name> <url>');
expect(reason.code).to.be('EINVFORMAT');
});
});
it('should call registry client with name', function () {
var unregister = unregisterFactory();
return helpers.run(unregister, ['some-name'])
.spread(function (result) {
expect(result).to.eql({
// Result from register action on stub
name: 'some-name'
});
});
});
it('should confirm in interactive mode', function () {
var register = unregisterFactory();
var promise = helpers.run(register,
['some-name', {
interactive: true,
registry: { register: 'http://localhost' }
}]
);
return helpers.expectEvent(promise.logger, 'confirm')
.spread(function (e) {
expect(e.type).to.be('confirm');
expect(e.message).to.be('You are about to remove component "some-name" from the bower registry (http://localhost). It is generally considered bad behavior to remove versions of a library that others are depending on. Are you really sure?');
expect(e.default).to.be(false);
});
});
it('should skip confirming when forcing', function () {
var register = unregisterFactory();
return helpers.run(register,
['some-name',
{ interactive: true, force: true }
]
);
});
});
| rlugojr/bower | test/commands/unregister.js | JavaScript | mit | 2,413 |
<?php
require_once("./crud.php");
?>
<?php
// define variables and set to empty values
$nameErr = $emailErr = $genderErr = $websiteErr = "";
$name = $email = $gender = $comment = $website = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["name"])) {
$nameErr = "Name is required";
} else {
$name = test_input($_POST["name"]);
// check if name only contains letters and whitespace
if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
$nameErr = "Only letters and white space allowed";
}
}
if (empty($_POST["email"])) {
$emailErr = "Email is required";
} else {
$email = test_input($_POST["email"]);
// check if e-mail address is well-formed
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$emailErr = "Invalid email format";
}
}
if (empty($_POST["website"])) {
$website = "";
} else {
$website = test_input($_POST["website"]);
// check if URL address syntax is valid (this regular expression also allows dashes in the URL)
if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$website)) {
$websiteErr = "Invalid URL";
}
}
if (empty($_POST["comment"])) {
$comment = "";
} else {
$comment = test_input($_POST["comment"]);
}
if (empty($_POST["gender"])) {
$genderErr = "Gender is required";
} else {
$gender = test_input($_POST["gender"]);
}
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
| Vaibhav95g/Bitsmun-user-management-portal | account/insert.php | PHP | mit | 1,621 |
import operator
import os
import abc
import functools
import pyparsing as pp
from mitmproxy.utils import strutils
from mitmproxy.utils import human
import typing # noqa
from . import generators
from . import exceptions
class Settings:
def __init__(
self,
is_client=False,
staticdir=None,
unconstrained_file_access=False,
request_host=None,
websocket_key=None,
protocol=None,
):
self.is_client = is_client
self.staticdir = staticdir
self.unconstrained_file_access = unconstrained_file_access
self.request_host = request_host
self.websocket_key = websocket_key # TODO: refactor this into the protocol
self.protocol = protocol
Sep = pp.Optional(pp.Literal(":")).suppress()
v_integer = pp.Word(pp.nums)\
.setName("integer")\
.setParseAction(lambda toks: int(toks[0]))
v_literal = pp.MatchFirst(
[
pp.QuotedString(
"\"",
unquoteResults=True,
multiline=True
),
pp.QuotedString(
"'",
unquoteResults=True,
multiline=True
),
]
)
v_naked_literal = pp.MatchFirst(
[
v_literal,
pp.Word("".join(i for i in pp.printables if i not in ",:\n@\'\""))
]
)
class Token:
"""
A token in the specification language. Tokens are immutable. The token
classes have no meaning in and of themselves, and are combined into
Components and Actions to build the language.
"""
__metaclass__ = abc.ABCMeta
@classmethod
def expr(cls): # pragma: no cover
"""
A parse expression.
"""
return None
@abc.abstractmethod
def spec(self): # pragma: no cover
"""
A parseable specification for this token.
"""
return None
@property
def unique_name(self) -> typing.Optional[str]:
"""
Controls uniqueness constraints for tokens. No two tokens with the
same name will be allowed. If no uniquness should be applied, this
should be None.
"""
return self.__class__.__name__.lower()
def resolve(self, settings_, msg_):
"""
Resolves this token to ready it for transmission. This means that
the calculated offsets of actions are fixed.
settings: a language.Settings instance
msg: The containing message
"""
return self
def __repr__(self):
return self.spec()
class _TokValueLiteral(Token):
def __init__(self, val):
self.val = strutils.escaped_str_to_bytes(val)
def get_generator(self, settings_):
return self.val
def freeze(self, settings_):
return self
class TokValueLiteral(_TokValueLiteral):
"""
A literal with Python-style string escaping
"""
@classmethod
def expr(cls):
e = v_literal.copy()
return e.setParseAction(cls.parseAction)
@classmethod
def parseAction(cls, x):
v = cls(*x)
return v
def spec(self):
inner = strutils.bytes_to_escaped_str(self.val)
inner = inner.replace(r"'", r"\x27")
return "'" + inner + "'"
class TokValueNakedLiteral(_TokValueLiteral):
@classmethod
def expr(cls):
e = v_naked_literal.copy()
return e.setParseAction(lambda x: cls(*x))
def spec(self):
return strutils.bytes_to_escaped_str(self.val, escape_single_quotes=True)
class TokValueGenerate(Token):
def __init__(self, usize, unit, datatype):
if not unit:
unit = "b"
self.usize, self.unit, self.datatype = usize, unit, datatype
def bytes(self):
return self.usize * human.SIZE_UNITS[self.unit]
def get_generator(self, settings_):
return generators.RandomGenerator(self.datatype, self.bytes())
def freeze(self, settings):
g = self.get_generator(settings)
return TokValueLiteral(strutils.bytes_to_escaped_str(g[:], escape_single_quotes=True))
@classmethod
def expr(cls):
e = pp.Literal("@").suppress() + v_integer
u = functools.reduce(
operator.or_,
[pp.Literal(i) for i in human.SIZE_UNITS.keys()]
).leaveWhitespace()
e = e + pp.Optional(u, default=None)
s = pp.Literal(",").suppress()
s += functools.reduce(
operator.or_,
[pp.Literal(i) for i in generators.DATATYPES.keys()]
)
e += pp.Optional(s, default="bytes")
return e.setParseAction(lambda x: cls(*x))
def spec(self):
s = "@%s" % self.usize
if self.unit != "b":
s += self.unit
if self.datatype != "bytes":
s += ",%s" % self.datatype
return s
class TokValueFile(Token):
def __init__(self, path):
self.path = str(path)
@classmethod
def expr(cls):
e = pp.Literal("<").suppress()
e = e + v_naked_literal
return e.setParseAction(lambda x: cls(*x))
def freeze(self, settings_):
return self
def get_generator(self, settings):
if not settings.staticdir:
raise exceptions.FileAccessDenied("File access disabled.")
s = os.path.expanduser(self.path)
s = os.path.normpath(
os.path.abspath(os.path.join(settings.staticdir, s))
)
uf = settings.unconstrained_file_access
if not uf and not s.startswith(os.path.normpath(settings.staticdir)):
raise exceptions.FileAccessDenied(
"File access outside of configured directory"
)
if not os.path.isfile(s):
raise exceptions.FileAccessDenied("File not readable")
return generators.FileGenerator(s)
def spec(self):
return "<'%s'" % self.path
TokValue = pp.MatchFirst(
[
TokValueGenerate.expr(),
TokValueFile.expr(),
TokValueLiteral.expr()
]
)
TokNakedValue = pp.MatchFirst(
[
TokValueGenerate.expr(),
TokValueFile.expr(),
TokValueLiteral.expr(),
TokValueNakedLiteral.expr(),
]
)
TokOffset = pp.MatchFirst(
[
v_integer,
pp.Literal("r"),
pp.Literal("a")
]
)
class _Component(Token):
"""
A value component of the primary specification of an message.
Components produce byte values describing the bytes of the message.
"""
def values(self, settings): # pragma: no cover
"""
A sequence of values, which can either be strings or generators.
"""
pass
def string(self, settings=None):
"""
A bytestring representation of the object.
"""
return b"".join(i[:] for i in self.values(settings or {}))
class KeyValue(_Component):
"""
A key/value pair.
cls.preamble: leader
"""
def __init__(self, key, value):
self.key, self.value = key, value
@classmethod
def expr(cls):
e = pp.Literal(cls.preamble).suppress()
e += TokValue
e += pp.Literal("=").suppress()
e += TokValue
return e.setParseAction(lambda x: cls(*x))
def spec(self):
return "%s%s=%s" % (self.preamble, self.key.spec(), self.value.spec())
def freeze(self, settings):
return self.__class__(
self.key.freeze(settings), self.value.freeze(settings)
)
class CaselessLiteral(_Component):
"""
A caseless token that can take only one value.
"""
def __init__(self, value):
self.value = value
@classmethod
def expr(cls):
spec = pp.CaselessLiteral(cls.TOK)
spec = spec.setParseAction(lambda x: cls(*x))
return spec
def values(self, settings):
return self.TOK
def spec(self):
return self.TOK
def freeze(self, settings_):
return self
class OptionsOrValue(_Component):
"""
Can be any of a specified set of options, or a value specifier.
"""
preamble = ""
options = [] # type: typing.List[str]
def __init__(self, value):
# If it's a string, we were passed one of the options, so we lower-case
# it to be canonical. The user can specify a different case by using a
# string value literal.
self.option_used = False
if isinstance(value, str):
for i in self.options:
# Find the exact option value in a case-insensitive way
if i.lower() == value.lower():
self.option_used = True
value = TokValueLiteral(i)
break
self.value = value
@classmethod
def expr(cls):
parts = [pp.CaselessLiteral(i) for i in cls.options]
m = pp.MatchFirst(parts)
spec = m | TokValue.copy()
spec = spec.setParseAction(lambda x: cls(*x))
if cls.preamble:
spec = pp.Literal(cls.preamble).suppress() + spec
return spec
def values(self, settings):
return [
self.value.get_generator(settings)
]
def spec(self):
s = self.value.spec()
if s[1:-1].lower() in self.options:
s = s[1:-1].lower()
return "%s%s" % (self.preamble, s)
def freeze(self, settings):
return self.__class__(self.value.freeze(settings))
class Integer(_Component):
bounds = (None, None) # type: typing.Tuple[typing.Optional[int], typing.Optional[int]]
preamble = ""
def __init__(self, value):
v = int(value)
outofbounds = any([
self.bounds[0] is not None and v < self.bounds[0],
self.bounds[1] is not None and v > self.bounds[1]
])
if outofbounds:
raise exceptions.ParseException(
"Integer value must be between %s and %s." % self.bounds,
0, 0
)
self.value = str(value).encode()
@classmethod
def expr(cls):
e = v_integer.copy()
if cls.preamble:
e = pp.Literal(cls.preamble).suppress() + e
return e.setParseAction(lambda x: cls(*x))
def values(self, settings):
return [self.value]
def spec(self):
return "%s%s" % (self.preamble, self.value.decode())
def freeze(self, settings_):
return self
class Value(_Component):
"""
A value component lead by an optional preamble.
"""
preamble = ""
def __init__(self, value):
self.value = value
@classmethod
def expr(cls):
e = (TokValue | TokNakedValue)
if cls.preamble:
e = pp.Literal(cls.preamble).suppress() + e
return e.setParseAction(lambda x: cls(*x))
def values(self, settings):
return [self.value.get_generator(settings)]
def spec(self):
return "%s%s" % (self.preamble, self.value.spec())
def freeze(self, settings):
return self.__class__(self.value.freeze(settings))
class FixedLengthValue(Value):
"""
A value component lead by an optional preamble.
"""
preamble = ""
length = None # type: typing.Optional[int]
def __init__(self, value):
Value.__init__(self, value)
lenguess = None
try:
lenguess = len(value.get_generator(Settings()))
except exceptions.RenderError:
pass
# This check will fail if we know the length upfront
if lenguess is not None and lenguess != self.length:
raise exceptions.RenderError(
"Invalid value length: '%s' is %s bytes, should be %s." % (
self.spec(),
lenguess,
self.length
)
)
def values(self, settings):
ret = Value.values(self, settings)
l = sum(len(i) for i in ret)
# This check will fail if we don't know the length upfront - i.e. for
# file inputs
if l != self.length:
raise exceptions.RenderError(
"Invalid value length: '%s' is %s bytes, should be %s." % (
self.spec(),
l,
self.length
)
)
return ret
class Boolean(_Component):
"""
A boolean flag.
name = true
-name = false
"""
name = ""
def __init__(self, value):
self.value = value
@classmethod
def expr(cls):
e = pp.Optional(pp.Literal("-"), default=True)
e += pp.Literal(cls.name).suppress()
def parse(s_, loc_, toks):
val = True
if toks[0] == "-":
val = False
return cls(val)
return e.setParseAction(parse)
def spec(self):
return "%s%s" % ("-" if not self.value else "", self.name)
class IntField(_Component):
"""
An integer field, where values can optionally specified by name.
"""
names = {} # type: typing.Dict[str, int]
max = 16
preamble = ""
def __init__(self, value):
self.origvalue = value
self.value = self.names.get(value, value)
if self.value > self.max:
raise exceptions.ParseException(
"Value can't exceed %s" % self.max, 0, 0
)
@classmethod
def expr(cls):
parts = [pp.CaselessLiteral(i) for i in cls.names.keys()]
m = pp.MatchFirst(parts)
spec = m | v_integer.copy()
spec = spec.setParseAction(lambda x: cls(*x))
if cls.preamble:
spec = pp.Literal(cls.preamble).suppress() + spec
return spec
def values(self, settings):
return [str(self.value)]
def spec(self):
return "%s%s" % (self.preamble, self.origvalue)
| MatthewShao/mitmproxy | pathod/language/base.py | Python | mit | 13,851 |
<?php
switch () % 5) {
}
| etsy/phan | tests/misc/fallback_test/src/035_bad_switch_statement.php | PHP | mit | 26 |
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _utils = require("@material-ui/utils");
var _unstyled = require("@material-ui/unstyled");
var _experimentalStyled = _interopRequireDefault(require("../styles/experimentalStyled"));
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
var _Paper = _interopRequireDefault(require("../Paper"));
var _cardClasses = require("./cardClasses");
const overridesResolver = (props, styles) => styles.root || {};
const useUtilityClasses = styleProps => {
const {
classes
} = styleProps;
const slots = {
root: ['root']
};
return (0, _unstyled.unstable_composeClasses)(slots, _cardClasses.getCardUtilityClass, classes);
};
const CardRoot = (0, _experimentalStyled.default)(_Paper.default, {}, {
name: 'MuiCard',
slot: 'Root',
overridesResolver
})(() => {
/* Styles applied to the root element. */
return {
overflow: 'hidden'
};
});
const Card = /*#__PURE__*/React.forwardRef(function Card(inProps, ref) {
const props = (0, _useThemeProps.default)({
props: inProps,
name: 'MuiCard'
});
const {
className,
raised = false
} = props,
other = (0, _objectWithoutPropertiesLoose2.default)(props, ["className", "raised"]);
const styleProps = (0, _extends2.default)({}, props, {
raised
});
const classes = useUtilityClasses(styleProps);
return /*#__PURE__*/React.createElement(CardRoot, (0, _extends2.default)({
className: (0, _clsx.default)(classes.root, className),
elevation: raised ? 8 : undefined,
ref: ref,
styleProps: styleProps
}, other));
});
process.env.NODE_ENV !== "production" ? Card.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* The content of the component.
*/
children: _propTypes.default.node,
/**
* Override or extend the styles applied to the component.
*/
classes: _propTypes.default.object,
/**
* @ignore
*/
className: _propTypes.default.string,
/**
* If `true`, the card will use raised styling.
* @default false
*/
raised: (0, _utils.chainPropTypes)(_propTypes.default.bool, props => {
if (props.raised && props.variant === 'outlined') {
return new Error('Material-UI: Combining `raised={true}` with `variant="outlined"` has no effect.');
}
return null;
}),
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: _propTypes.default.object
} : void 0;
var _default = Card;
exports.default = _default; | cdnjs/cdnjs | ajax/libs/material-ui/5.0.0-alpha.27/node/Card/Card.js | JavaScript | mit | 3,406 |
<TS language="sk" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Kliknutím pravým tlačidlom upraviť adresu alebo popis</translation>
</message>
<message>
<source>Create a new address</source>
<translation>Vytvoriť novú adresu</translation>
</message>
<message>
<source>&New</source>
<translation>&Nový</translation>
</message>
<message>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Zkopírovať práve zvolenú adresu</translation>
</message>
<message>
<source>&Copy</source>
<translation>&Kopírovať</translation>
</message>
<message>
<source>C&lose</source>
<translation>Z&atvoriť</translation>
</message>
<message>
<source>Delete the currently selected address from the list</source>
<translation>Vymaž vybranú adresu zo zoznamu</translation>
</message>
<message>
<source>Enter address or label to search</source>
<translation>Zadajte adresu alebo popis pre hľadanie</translation>
</message>
<message>
<source>Export the data in the current tab to a file</source>
<translation>Exportovať tento náhľad do súboru</translation>
</message>
<message>
<source>&Export</source>
<translation>&Exportovať...</translation>
</message>
<message>
<source>&Delete</source>
<translation>&Zmazať</translation>
</message>
<message>
<source>Choose the address to send coins to</source>
<translation>Zvoľte adresu kam poslať mince</translation>
</message>
<message>
<source>Choose the address to receive coins with</source>
<translation>Zvoľte adresu na ktorú chcete prijať mince</translation>
</message>
<message>
<source>C&hoose</source>
<translation>Vy&brať</translation>
</message>
<message>
<source>Sending addresses</source>
<translation>Odosielajúce adresy</translation>
</message>
<message>
<source>Receiving addresses</source>
<translation>Prijímajúce adresy</translation>
</message>
<message>
<source>These are your Litecoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation>Toto sú Vaše Litecoin adresy pre posielanie platieb. Vždy skontrolujte sumu a prijímaciu adresu pred poslaním mincí.</translation>
</message>
<message>
<source>These are your Litecoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>
<translation>Toto sú vaše Litecoin adresy pre prijímanie platieb. Odporúča sa použiť vždy novú prijímaciu adresu pre každú transakciu.</translation>
</message>
<message>
<source>&Copy Address</source>
<translation>&Kopírovať adresu</translation>
</message>
<message>
<source>Copy &Label</source>
<translation>Kopírovať &popis</translation>
</message>
<message>
<source>&Edit</source>
<translation>&Upraviť</translation>
</message>
<message>
<source>Export Address List</source>
<translation>Exportovať zoznam adries</translation>
</message>
<message>
<source>Comma separated file (*.csv)</source>
<translation>Čiarkou oddelovaný súbor (*.csv)</translation>
</message>
<message>
<source>Exporting Failed</source>
<translation>Export zlyhal</translation>
</message>
<message>
<source>There was an error trying to save the address list to %1. Please try again.</source>
<translation>Nastala chyba pri pokuse uložiť zoznam adries do %1. Skúste znovu.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<source>Label</source>
<translation>Popis</translation>
</message>
<message>
<source>Address</source>
<translation>Adresa</translation>
</message>
<message>
<source>(no label)</source>
<translation>(bez popisu)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<source>Passphrase Dialog</source>
<translation>Dialóg hesla</translation>
</message>
<message>
<source>Enter passphrase</source>
<translation>Zadajte heslo</translation>
</message>
<message>
<source>New passphrase</source>
<translation>Nové heslo</translation>
</message>
<message>
<source>Repeat new passphrase</source>
<translation>Zopakujte nové heslo</translation>
</message>
<message>
<source>Show password</source>
<translation>Ukázať heslo</translation>
</message>
<message>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>ten or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Zadajte nové heslo k peňaženke.<br/>Prosím použite heslo s dĺžkou <b>desať alebo viac náhodných znakov</b>, prípadne <b>osem alebo viac slov</b>.</translation>
</message>
<message>
<source>Encrypt wallet</source>
<translation>Zašifrovať peňaženku</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Táto operácia potrebuje heslo k vašej peňaženke aby ju mohla odomknúť.</translation>
</message>
<message>
<source>Unlock wallet</source>
<translation>Odomknúť peňaženku</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Táto operácia potrebuje heslo k vašej peňaženke na dešifrovanie peňaženky.</translation>
</message>
<message>
<source>Decrypt wallet</source>
<translation>Dešifrovať peňaženku</translation>
</message>
<message>
<source>Change passphrase</source>
<translation>Zmena hesla</translation>
</message>
<message>
<source>Enter the old passphrase and new passphrase to the wallet.</source>
<translation>Zadajte staré heslo a nové heslo k peňaženke.</translation>
</message>
<message>
<source>Confirm wallet encryption</source>
<translation>Potvrďte zašifrovanie peňaženky</translation>
</message>
<message>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR LITECOINS</b>!</source>
<translation>Varovanie: Ak zašifrujete peňaženku a stratíte heslo, <b>STRATÍTE VŠETKY VAŠE LITECOINY</b>!</translation>
</message>
<message>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Ste si istí, že si želáte zašifrovať peňaženku?</translation>
</message>
<message>
<source>Wallet encrypted</source>
<translation>Peňaženka zašifrovaná</translation>
</message>
<message>
<source>Your wallet is now encrypted. Remember that encrypting your wallet cannot fully protect your litecoins from being stolen by malware infecting your computer.</source>
<translation>Vaša peňaženka je teraz zašifrovaná. Zašifrovanie peňaženky Vás plne nechráni pred krádežou litecoinov škodlivými programami, ktoré prenikli do vášho počítača.</translation>
</message>
<message>
<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>DÔLEŽITÉ: Všetky predchádzajúce zálohy vašej peňaženky, ktoré ste vykonali by mali byť nahradené novo vytvorenou, zašifrovanou peňaženkou. Z bezpečnostných dôvodov bude predchádzajúca záloha nezašifrovanej peňaženky k ničomu, akonáhle začnete používať novú, zašifrovanú peňaženku.</translation>
</message>
<message>
<source>Wallet encryption failed</source>
<translation>Šifrovanie peňaženky zlyhalo</translation>
</message>
<message>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Šifrovanie peňaženky zlyhalo kôli internej chybe. Vaša peňaženka nebola zašifrovaná.</translation>
</message>
<message>
<source>The supplied passphrases do not match.</source>
<translation>Zadané heslá nesúhlasia.</translation>
</message>
<message>
<source>Wallet unlock failed</source>
<translation>Odomykanie peňaženky zlyhalo</translation>
</message>
<message>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Zadané heslo pre dešifrovanie peňaženky bolo nesprávne.</translation>
</message>
<message>
<source>Wallet decryption failed</source>
<translation>Zlyhalo šifrovanie peňaženky.</translation>
</message>
<message>
<source>Wallet passphrase was successfully changed.</source>
<translation>Heslo k peňaženke bolo úspešne zmenené.</translation>
</message>
<message>
<source>Warning: The Caps Lock key is on!</source>
<translation>Upozornenie: Máte zapnutý Caps Lock!</translation>
</message>
</context>
<context>
<name>BanTableModel</name>
<message>
<source>IP/Netmask</source>
<translation>IP/Maska stiete</translation>
</message>
<message>
<source>Banned Until</source>
<translation>Blokovaný do</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<source>Sign &message...</source>
<translation>Podpísať &správu...</translation>
</message>
<message>
<source>Synchronizing with network...</source>
<translation>Synchronizácia so sieťou...</translation>
</message>
<message>
<source>&Overview</source>
<translation>&Prehľad</translation>
</message>
<message>
<source>Show general overview of wallet</source>
<translation>Zobraziť celkový prehľad o peňaženke</translation>
</message>
<message>
<source>&Transactions</source>
<translation>&Transakcie</translation>
</message>
<message>
<source>Browse transaction history</source>
<translation>Prechádzať históriu transakcií</translation>
</message>
<message>
<source>E&xit</source>
<translation>U&končiť</translation>
</message>
<message>
<source>Quit application</source>
<translation>Ukončiť program</translation>
</message>
<message>
<source>&About %1</source>
<translation>&O %1</translation>
</message>
<message>
<source>Show information about %1</source>
<translation>Ukázať informácie o %1</translation>
</message>
<message>
<source>About &Qt</source>
<translation>O &Qt</translation>
</message>
<message>
<source>Show information about Qt</source>
<translation>Zobrazit informácie o Qt</translation>
</message>
<message>
<source>&Options...</source>
<translation>&Možnosti...</translation>
</message>
<message>
<source>Modify configuration options for %1</source>
<translation>Upraviť nastavenia pre %1</translation>
</message>
<message>
<source>&Encrypt Wallet...</source>
<translation>&Zašifrovať Peňaženku...</translation>
</message>
<message>
<source>&Backup Wallet...</source>
<translation>&Zálohovať peňaženku...</translation>
</message>
<message>
<source>&Change Passphrase...</source>
<translation>&Zmena Hesla...</translation>
</message>
<message>
<source>Open &URI...</source>
<translation>Otvoriť &URI...</translation>
</message>
<message>
<source>Wallet:</source>
<translation>Peňaženka:</translation>
</message>
<message>
<source>Click to disable network activity.</source>
<translation>Kliknite pre zakázanie sieťovej aktivity.</translation>
</message>
<message>
<source>Network activity disabled.</source>
<translation>Sieťová aktivita zakázaná.</translation>
</message>
<message>
<source>Click to enable network activity again.</source>
<translation>Kliknite pre povolenie sieťovej aktivity.</translation>
</message>
<message>
<source>Syncing Headers (%1%)...</source>
<translation>Synchronizujú sa hlavičky (%1%)...</translation>
</message>
<message>
<source>Reindexing blocks on disk...</source>
<translation>Preindexúvam bloky na disku...</translation>
</message>
<message>
<source>Proxy is <b>enabled</b>: %1</source>
<translation>Proxy je <b>zapnuté</b>: %1</translation>
</message>
<message>
<source>Send coins to a Litecoin address</source>
<translation>Poslať litecoins na adresu</translation>
</message>
<message>
<source>Backup wallet to another location</source>
<translation>Zálohovať peňaženku na iné miesto</translation>
</message>
<message>
<source>Change the passphrase used for wallet encryption</source>
<translation>Zmeniť heslo použité na šifrovanie peňaženky</translation>
</message>
<message>
<source>&Debug window</source>
<translation>&Okno pre ladenie</translation>
</message>
<message>
<source>Open debugging and diagnostic console</source>
<translation>Otvor konzolu pre ladenie a diagnostiku</translation>
</message>
<message>
<source>&Verify message...</source>
<translation>O&veriť správu...</translation>
</message>
<message>
<source>Litecoin</source>
<translation>Litecoin</translation>
</message>
<message>
<source>&Send</source>
<translation>&Odoslať</translation>
</message>
<message>
<source>&Receive</source>
<translation>&Prijať</translation>
</message>
<message>
<source>&Show / Hide</source>
<translation>&Zobraziť / Skryť</translation>
</message>
<message>
<source>Show or hide the main Window</source>
<translation>Zobraziť alebo skryť hlavné okno</translation>
</message>
<message>
<source>Encrypt the private keys that belong to your wallet</source>
<translation>Zašifruj súkromné kľúče ktoré patria do vašej peňaženky</translation>
</message>
<message>
<source>Sign messages with your Litecoin addresses to prove you own them</source>
<translation>Podpísať správu s vašou adresou Litecoin aby ste preukázali že ju vlastníte</translation>
</message>
<message>
<source>Verify messages to ensure they were signed with specified Litecoin addresses</source>
<translation>Overiť či správa bola podpísaná uvedenou Litecoin adresou</translation>
</message>
<message>
<source>&File</source>
<translation>&Súbor</translation>
</message>
<message>
<source>&Settings</source>
<translation>&Nastavenia</translation>
</message>
<message>
<source>&Help</source>
<translation>&Pomoc</translation>
</message>
<message>
<source>Tabs toolbar</source>
<translation>Lišta záložiek</translation>
</message>
<message>
<source>Request payments (generates QR codes and litecoin: URIs)</source>
<translation>Vyžiadať platby (vygeneruje QR kódy a litecoin: URI)</translation>
</message>
<message>
<source>Show the list of used sending addresses and labels</source>
<translation>Zobraziť zoznam použitých adries odosielateľa a ich popisy</translation>
</message>
<message>
<source>Show the list of used receiving addresses and labels</source>
<translation>Zobraziť zoznam použitých prijímacích adries a ich popisov</translation>
</message>
<message>
<source>Open a litecoin: URI or payment request</source>
<translation>Otvoriť litecoin URI alebo výzvu k platbe</translation>
</message>
<message>
<source>&Command-line options</source>
<translation>&Možnosti príkazového riadku</translation>
</message>
<message numerus="yes">
<source>%n active connection(s) to Litecoin network</source>
<translation><numerusform>%n aktívne pripojenie do siete Litecoin</numerusform><numerusform>%n aktívne pripojenia do siete Litecoin</numerusform><numerusform>%n aktívnych pripojení do siete Litecoin</numerusform><numerusform>%n aktívnych pripojení do siete Litecoin</numerusform></translation>
</message>
<message>
<source>Indexing blocks on disk...</source>
<translation>Indexujem bloky na disku...</translation>
</message>
<message>
<source>Processing blocks on disk...</source>
<translation>Spracovávam bloky na disku...</translation>
</message>
<message numerus="yes">
<source>Processed %n block(s) of transaction history.</source>
<translation><numerusform>Spracovaných %n blok transakčnej histórie.</numerusform><numerusform>Spracovaných %n bloky transakčnej histórie.</numerusform><numerusform>Spracovaných %n blokov transakčnej histórie.</numerusform><numerusform>Spracovaných %n blokov transakčnej histórie.</numerusform></translation>
</message>
<message>
<source>%1 behind</source>
<translation>%1 pozadu</translation>
</message>
<message>
<source>Last received block was generated %1 ago.</source>
<translation>Posledný prijatý blok bol vygenerovaný pred: %1.</translation>
</message>
<message>
<source>Transactions after this will not yet be visible.</source>
<translation>Transakcie po tomto čase ešte nebudú viditeľné.</translation>
</message>
<message>
<source>Error</source>
<translation>Chyba</translation>
</message>
<message>
<source>Warning</source>
<translation>Upozornenie</translation>
</message>
<message>
<source>Information</source>
<translation>Informácia</translation>
</message>
<message>
<source>Up to date</source>
<translation>Aktualizovaný</translation>
</message>
<message>
<source>&Sending addresses</source>
<translation>&Odosielajúce adresy</translation>
</message>
<message>
<source>&Receiving addresses</source>
<translation>&Prijímajúce adresy</translation>
</message>
<message>
<source>Open Wallet</source>
<translation>Otvoriť peňaženku</translation>
</message>
<message>
<source>Open a wallet</source>
<translation>Otvoriť peňaženku</translation>
</message>
<message>
<source>Close Wallet...</source>
<translation>Zatvoriť peňaženku...</translation>
</message>
<message>
<source>Close wallet</source>
<translation>Zatvoriť peňaženku</translation>
</message>
<message>
<source>Show the %1 help message to get a list with possible Litecoin command-line options</source>
<translation>Ukáž %1 zoznam možných nastavení Litecoinu pomocou príkazového riadku</translation>
</message>
<message>
<source>default wallet</source>
<translation>predvolená peňaženka</translation>
</message>
<message>
<source>Opening Wallet <b>%1</b>...</source>
<translation>Otvára sa peňaženka <b>%1</b>...</translation>
</message>
<message>
<source>Open Wallet Failed</source>
<translation>Otvorenie peňaženky zlyhalo</translation>
</message>
<message>
<source>&Window</source>
<translation>&Okno</translation>
</message>
<message>
<source>Minimize</source>
<translation>Minimalizovať</translation>
</message>
<message>
<source>Zoom</source>
<translation>Priblížiť</translation>
</message>
<message>
<source>Restore</source>
<translation>Obnoviť</translation>
</message>
<message>
<source>Main Window</source>
<translation>Hlavné okno</translation>
</message>
<message>
<source>%1 client</source>
<translation>%1 klient</translation>
</message>
<message>
<source>Connecting to peers...</source>
<translation>Pripája sa k partnerom...</translation>
</message>
<message>
<source>Catching up...</source>
<translation>Sťahujem...</translation>
</message>
<message>
<source>Date: %1
</source>
<translation>Dátum: %1
</translation>
</message>
<message>
<source>Amount: %1
</source>
<translation>Suma: %1
</translation>
</message>
<message>
<source>Wallet: %1
</source>
<translation>Peňaženka: %1
</translation>
</message>
<message>
<source>Type: %1
</source>
<translation>Typ: %1
</translation>
</message>
<message>
<source>Label: %1
</source>
<translation>Popis: %1
</translation>
</message>
<message>
<source>Address: %1
</source>
<translation>Adresa: %1
</translation>
</message>
<message>
<source>Sent transaction</source>
<translation>Odoslané transakcie</translation>
</message>
<message>
<source>Incoming transaction</source>
<translation>Prijatá transakcia</translation>
</message>
<message>
<source>HD key generation is <b>enabled</b></source>
<translation>Generovanie HD kľúčov je <b>zapnuté</b></translation>
</message>
<message>
<source>HD key generation is <b>disabled</b></source>
<translation>Generovanie HD kľúčov je <b>vypnuté</b></translation>
</message>
<message>
<source>Private key <b>disabled</b></source>
<translation>Súkromný kľúč <b>vypnutý</b></translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Peňaženka je <b>zašifrovaná</b> a momentálne <b>odomknutá</b></translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Peňaženka je <b>zašifrovaná</b> a momentálne <b>zamknutá</b></translation>
</message>
<message>
<source>A fatal error occurred. Litecoin can no longer continue safely and will quit.</source>
<translation>Vyskytla sa kritická chyba. Litecoin nemôže ďalej bezpečne pokračovať a ukončí sa.</translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<source>Coin Selection</source>
<translation>Výber mince</translation>
</message>
<message>
<source>Quantity:</source>
<translation>Množstvo:</translation>
</message>
<message>
<source>Bytes:</source>
<translation>Bajtov:</translation>
</message>
<message>
<source>Amount:</source>
<translation>Suma:</translation>
</message>
<message>
<source>Fee:</source>
<translation>Poplatok:</translation>
</message>
<message>
<source>Dust:</source>
<translation>Prach:</translation>
</message>
<message>
<source>After Fee:</source>
<translation>Po poplatku:</translation>
</message>
<message>
<source>Change:</source>
<translation>Zmena:</translation>
</message>
<message>
<source>(un)select all</source>
<translation>(ne)vybrať všetko</translation>
</message>
<message>
<source>Tree mode</source>
<translation>Stromový režim</translation>
</message>
<message>
<source>List mode</source>
<translation>Zoznamový režim</translation>
</message>
<message>
<source>Amount</source>
<translation>Suma</translation>
</message>
<message>
<source>Received with label</source>
<translation>Prijaté s označením</translation>
</message>
<message>
<source>Received with address</source>
<translation>Prijaté s adresou</translation>
</message>
<message>
<source>Date</source>
<translation>Dátum</translation>
</message>
<message>
<source>Confirmations</source>
<translation>Potvrdenia</translation>
</message>
<message>
<source>Confirmed</source>
<translation>Potvrdené</translation>
</message>
<message>
<source>Copy address</source>
<translation>Kopírovať adresu</translation>
</message>
<message>
<source>Copy label</source>
<translation>Kopírovať popis</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Kopírovať sumu</translation>
</message>
<message>
<source>Copy transaction ID</source>
<translation>Kopírovať ID transakcie</translation>
</message>
<message>
<source>Lock unspent</source>
<translation>Uzamknúť neminuté</translation>
</message>
<message>
<source>Unlock unspent</source>
<translation>Odomknúť neminuté</translation>
</message>
<message>
<source>Copy quantity</source>
<translation>Kopírovať množstvo</translation>
</message>
<message>
<source>Copy fee</source>
<translation>Kopírovať poplatok</translation>
</message>
<message>
<source>Copy after fee</source>
<translation>Kopírovať po poplatkoch</translation>
</message>
<message>
<source>Copy bytes</source>
<translation>Kopírovať bajty</translation>
</message>
<message>
<source>Copy dust</source>
<translation>Kopírovať prach</translation>
</message>
<message>
<source>Copy change</source>
<translation>Kopírovať zmenu</translation>
</message>
<message>
<source>(%1 locked)</source>
<translation>(%1 zamknutých)</translation>
</message>
<message>
<source>yes</source>
<translation>áno</translation>
</message>
<message>
<source>no</source>
<translation>nie</translation>
</message>
<message>
<source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>
<translation>Tento popis sčervenie ak ktorýkoľvek príjemca dostane sumu menšiu ako súčasný limit pre "prach".</translation>
</message>
<message>
<source>Can vary +/- %1 satoshi(s) per input.</source>
<translation>Môže sa líšiť o +/- %1 satoshi pre každý vstup.</translation>
</message>
<message>
<source>(no label)</source>
<translation>(bez popisu)</translation>
</message>
<message>
<source>change from %1 (%2)</source>
<translation>zmena od %1 (%2)</translation>
</message>
<message>
<source>(change)</source>
<translation>(zmena)</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<source>Edit Address</source>
<translation>Upraviť adresu</translation>
</message>
<message>
<source>&Label</source>
<translation>&Popis</translation>
</message>
<message>
<source>The label associated with this address list entry</source>
<translation>Popis spojený s týmto záznamom v adresári</translation>
</message>
<message>
<source>The address associated with this address list entry. This can only be modified for sending addresses.</source>
<translation>Adresa spojená s týmto záznamom v adresári. Možno upravovať len pre odosielajúce adresy.</translation>
</message>
<message>
<source>&Address</source>
<translation>&Adresa</translation>
</message>
<message>
<source>New sending address</source>
<translation>Nová adresa pre odoslanie</translation>
</message>
<message>
<source>Edit receiving address</source>
<translation>Upraviť prijímajúcu adresu</translation>
</message>
<message>
<source>Edit sending address</source>
<translation>Upraviť odosielaciu adresu</translation>
</message>
<message>
<source>The entered address "%1" is not a valid Litecoin address.</source>
<translation>Vložená adresa "%1" nieje platnou adresou Litecoin.</translation>
</message>
<message>
<source>Address "%1" already exists as a receiving address with label "%2" and so cannot be added as a sending address.</source>
<translation>Adresa "%1" už existuje ako prijímacia adresa s označením "%2" .Nemôže tak byť pridaná ako odosielacia adresa.</translation>
</message>
<message>
<source>The entered address "%1" is already in the address book with label "%2".</source>
<translation>Zadaná adresa "%1" sa už nachádza v zozname adries s označením "%2".</translation>
</message>
<message>
<source>Could not unlock wallet.</source>
<translation>Nepodarilo sa odomknúť peňaženku.</translation>
</message>
<message>
<source>New key generation failed.</source>
<translation>Generovanie nového kľúča zlyhalo.</translation>
</message>
</context>
<context>
<name>FreespaceChecker</name>
<message>
<source>A new data directory will be created.</source>
<translation>Bude vytvorený nový dátový adresár.</translation>
</message>
<message>
<source>name</source>
<translation>názov</translation>
</message>
<message>
<source>Directory already exists. Add %1 if you intend to create a new directory here.</source>
<translation>Priečinok už existuje. Pridajte "%1", ak tu chcete vytvoriť nový priečinok.</translation>
</message>
<message>
<source>Path already exists, and is not a directory.</source>
<translation>Cesta už existuje a nie je to adresár.</translation>
</message>
<message>
<source>Cannot create data directory here.</source>
<translation>Tu nemôžem vytvoriť dátový adresár.</translation>
</message>
</context>
<context>
<name>HelpMessageDialog</name>
<message>
<source>version</source>
<translation>verzia</translation>
</message>
<message>
<source>(%1-bit)</source>
<translation>(%1-bit)</translation>
</message>
<message>
<source>About %1</source>
<translation>O %1</translation>
</message>
<message>
<source>Command-line options</source>
<translation>Voľby príkazového riadku</translation>
</message>
</context>
<context>
<name>Intro</name>
<message>
<source>Welcome</source>
<translation>Vitajte</translation>
</message>
<message>
<source>Welcome to %1.</source>
<translation>Vitajte v %1</translation>
</message>
<message>
<source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>
<translation>Keďže toto je prvé spustenie programu, môžete si vybrať, kam %1 bude ukladať vaše údaje.</translation>
</message>
<message>
<source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>
<translation>Hneď po stlačení OK, začne %1 stťahovať a spracovávať celý %4 reťazec blokov (%2 GB), začínajúc nejstaršími transakcemi z roku %3, kdey bol %4 spustený.</translation>
</message>
<message>
<source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>
<translation>Prvá synchronizácia je veľmi náročná a môžu sa tak vďaka nej začat na Vašom počítači projavovať doteraz skryté hárdwarové problémy. Vždy, keď spustíte %1, bude sťahovanie pokračovať tam, kde skončilo.</translation>
</message>
<message>
<source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>
<translation>Ak ste ombedzili úložný priestor pre reťazec blokov (tj. povolil prepezávanie), tak sa historické dáta sice stiahnu a zpracujú, ale následne sa zasa zzažú, aby nezaberala na disku miesto.</translation>
</message>
<message>
<source>Use the default data directory</source>
<translation>Použiť predvolený dátový adresár</translation>
</message>
<message>
<source>Use a custom data directory:</source>
<translation>Použiť vlastný dátový adresár:</translation>
</message>
<message>
<source>Litecoin</source>
<translation>Litecoin</translation>
</message>
<message>
<source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>
<translation>V tejto zložke bude uložených aspoň %1 GB dát a postupom času sa bude zväčšovať.</translation>
</message>
<message>
<source>Approximately %1 GB of data will be stored in this directory.</source>
<translation>Približne %1 GB dát bude uložených v tejto zložke.</translation>
</message>
<message>
<source>%1 will download and store a copy of the Litecoin block chain.</source>
<translation>%1 bude sťahovať kopiu reťazca blokov.</translation>
</message>
<message>
<source>The wallet will also be stored in this directory.</source>
<translation>Tvoja peňaženka bude uložena tiež v tomto adresári.</translation>
</message>
<message>
<source>Error: Specified data directory "%1" cannot be created.</source>
<translation>Chyba: Zadaný priečinok pre dáta "%1" nemôže byť vytvorený.</translation>
</message>
<message>
<source>Error</source>
<translation>Chyba</translation>
</message>
<message numerus="yes">
<source>%n GB of free space available</source>
<translation><numerusform>%n GB voľného miesta</numerusform><numerusform>%n GB voľného miesta</numerusform><numerusform>%n GB voľného miesta</numerusform><numerusform>%n GB voľného miesta</numerusform></translation>
</message>
<message numerus="yes">
<source>(of %n GB needed)</source>
<translation><numerusform>(z %n GB potrebného)</numerusform><numerusform>(z %n GB potrebných)</numerusform><numerusform>(z %n GB potrebných)</numerusform><numerusform>(z %n GB potrebných)</numerusform></translation>
</message>
</context>
<context>
<name>ModalOverlay</name>
<message>
<source>Form</source>
<translation>Formulár</translation>
</message>
<message>
<source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the litecoin network, as detailed below.</source>
<translation>Nedávne transakcie nemusia byť ešte viditeľné preto môže byť zostatok vo vašej peňaženke nesprávny. Táto informácia bude správna keď sa dokončí synchronizovanie peňaženky so sieťou litecoin, ako je rozpísané nižšie.</translation>
</message>
<message>
<source>Attempting to spend litecoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>
<translation>Pokus o minutie litecoinov, ktoré sú ovplyvnené ešte nezobrazenými transakciami, nebude sieťou akceptovaný.</translation>
</message>
<message>
<source>Number of blocks left</source>
<translation>Počet zostávajúcich blokov</translation>
</message>
<message>
<source>Unknown...</source>
<translation>Neznáme...</translation>
</message>
<message>
<source>Last block time</source>
<translation>Čas posledného bloku</translation>
</message>
<message>
<source>Progress</source>
<translation>Postup synchronizácie</translation>
</message>
<message>
<source>Progress increase per hour</source>
<translation>Prírastok postupu za hodinu</translation>
</message>
<message>
<source>calculating...</source>
<translation>počíta sa...</translation>
</message>
<message>
<source>Estimated time left until synced</source>
<translation>Odhadovaný čas do ukončenia synchronizácie</translation>
</message>
<message>
<source>Hide</source>
<translation>Skryť</translation>
</message>
<message>
<source>Unknown. Syncing Headers (%1, %2%)...</source>
<translation>Neznámy. Synchronizujú sa hlavičky (%1, %2%)...</translation>
</message>
</context>
<context>
<name>OpenURIDialog</name>
<message>
<source>Open URI</source>
<translation>Otvoriť URI</translation>
</message>
<message>
<source>Open payment request from URI or file</source>
<translation>Otvoriť požiadavku na zaplatenie z URI alebo súboru</translation>
</message>
<message>
<source>URI:</source>
<translation>URI:</translation>
</message>
<message>
<source>Select payment request file</source>
<translation>Vyberte súbor s výzvou k platbe</translation>
</message>
<message>
<source>Select payment request file to open</source>
<translation>Vyberte ktorý súbor s výzvou na platbu otvoriť</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<source>Options</source>
<translation>Možnosti</translation>
</message>
<message>
<source>&Main</source>
<translation>&Hlavné</translation>
</message>
<message>
<source>Automatically start %1 after logging in to the system.</source>
<translation>Automaticky spustiť %1 pri spustení systému.</translation>
</message>
<message>
<source>&Start %1 on system login</source>
<translation>&Spustiť %1 pri prihlásení</translation>
</message>
<message>
<source>Size of &database cache</source>
<translation>Veľkosť vyrovnávacej pamäti &databázy</translation>
</message>
<message>
<source>Number of script &verification threads</source>
<translation>Počet &vlákien overujúcich skript</translation>
</message>
<message>
<source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>
<translation>IP adresy proxy (napr. IPv4: 127.0.0.1 / IPv6: ::1)</translation>
</message>
<message>
<source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>
<translation>Ukazuje, či se zadaná východzia SOCKS5 proxy používá k pripojovaniu k peerom v rámci tohoto typu siete.</translation>
</message>
<message>
<source>Use separate SOCKS&5 proxy to reach peers via Tor hidden services:</source>
<translation>Použiť samostatný SOCKS&5 proxy server na dosiahnutie počítačov cez skryté služby Tor:</translation>
</message>
<message>
<source>Hide the icon from the system tray.</source>
<translation>Skryť ikonu zo systémovej lišty.</translation>
</message>
<message>
<source>&Hide tray icon</source>
<translation>&Skryť ikonu v oblasti oznámení</translation>
</message>
<message>
<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 Exit in the menu.</source>
<translation>Minimalizovať namiesto ukončenia aplikácie keď sa okno zavrie. Keď je zvolená táto možnosť, aplikácia sa zavrie len po zvolení Ukončiť v menu.</translation>
</message>
<message>
<source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>
<translation>URL tretích strán (napr. prehliadač blockchain) ktoré sa zobrazujú v záložke transakcií ako položky kontextového menu. %s v URL je nahradené hash-om transakcie. Viaceré URL sú oddelené zvislou čiarou |.</translation>
</message>
<message>
<source>Open the %1 configuration file from the working directory.</source>
<translation>Otvorte konfiguračný súbor %1 s pracovného adresára.</translation>
</message>
<message>
<source>Open Configuration File</source>
<translation>Otvoriť konfiguračný súbor </translation>
</message>
<message>
<source>Reset all client options to default.</source>
<translation>Vynulovať všetky voľby klienta na predvolené.</translation>
</message>
<message>
<source>&Reset Options</source>
<translation>&Vynulovať voľby</translation>
</message>
<message>
<source>&Network</source>
<translation>&Sieť</translation>
</message>
<message>
<source>Disables some advanced features but all blocks will still be fully validated. Reverting this setting requires re-downloading the entire blockchain. Actual disk usage may be somewhat higher.</source>
<translation>Zakáže niektoré pokročilé funkcie, ale všetky bloky budú stále plne overené. Obnovenie tohto nastavenia vyžaduje opätovné prevzatie celého blockchainu. Skutočné využitie disku môže byť o niečo vyššie.</translation>
</message>
<message>
<source>Prune &block storage to</source>
<translation>Redukovať priestor pre &bloky na</translation>
</message>
<message>
<source>GB</source>
<translation>GB</translation>
</message>
<message>
<source>Reverting this setting requires re-downloading the entire blockchain.</source>
<translation>Obnovenie tohto nastavenia vyžaduje opätovné prevzatie celého blockchainu.</translation>
</message>
<message>
<source>MiB</source>
<translation>MiB</translation>
</message>
<message>
<source>(0 = auto, <0 = leave that many cores free)</source>
<translation>(0 = auto, <0 = nechať toľko jadier voľných)</translation>
</message>
<message>
<source>W&allet</source>
<translation>&Peňaženka</translation>
</message>
<message>
<source>Expert</source>
<translation>Expert</translation>
</message>
<message>
<source>Enable coin &control features</source>
<translation>Povoliť možnosti &kontroly minci</translation>
</message>
<message>
<source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>
<translation>Ak vypnete míňanie nepotvrdeného výdavku, tak výdavok z transakcie bude možné použiť, až keď daná transakcia bude mať aspoň jedno potvrdenie. Toto má vplyv aj na výpočet vášho zostatku.</translation>
</message>
<message>
<source>&Spend unconfirmed change</source>
<translation>&Minúť nepotvrdený výdavok</translation>
</message>
<message>
<source>Automatically open the Litecoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Automaticky otvorit port pre Litecoin na routeri. Toto funguje len ak router podporuje UPnP a je táto podpora aktivovaná.</translation>
</message>
<message>
<source>Map port using &UPnP</source>
<translation>Mapovať port pomocou &UPnP</translation>
</message>
<message>
<source>Accept connections from outside.</source>
<translation>Prijať spojenia zvonku.</translation>
</message>
<message>
<source>Allow incomin&g connections</source>
<translation>Povoliť prichá&dzajúce spojenia</translation>
</message>
<message>
<source>Connect to the Litecoin network through a SOCKS5 proxy.</source>
<translation>Pripojiť do siete Litecoin cez proxy server SOCKS5.</translation>
</message>
<message>
<source>&Connect through SOCKS5 proxy (default proxy):</source>
<translation>&Pripojiť cez proxy server SOCKS5 (predvolený proxy).</translation>
</message>
<message>
<source>Proxy &IP:</source>
<translation>Proxy &IP:</translation>
</message>
<message>
<source>&Port:</source>
<translation>&Port:</translation>
</message>
<message>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Port proxy (napr. 9050)</translation>
</message>
<message>
<source>Used for reaching peers via:</source>
<translation>Použité pre získavanie peerov cez:</translation>
</message>
<message>
<source>IPv4</source>
<translation>IPv4</translation>
</message>
<message>
<source>IPv6</source>
<translation>IPv6</translation>
</message>
<message>
<source>Tor</source>
<translation>Tor</translation>
</message>
<message>
<source>Connect to the Litecoin network through a separate SOCKS5 proxy for Tor hidden services.</source>
<translation>Pripojiť k Litecoinovej sieti cez separované SOCKS5 proxy pre skrytú službu Tor.</translation>
</message>
<message>
<source>&Window</source>
<translation>&Okno</translation>
</message>
<message>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Zobraziť len ikonu na lište po minimalizovaní okna.</translation>
</message>
<message>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Zobraziť len ikonu na lište po minimalizovaní okna.</translation>
</message>
<message>
<source>M&inimize on close</source>
<translation>M&inimalizovať pri zavretí</translation>
</message>
<message>
<source>&Display</source>
<translation>&Zobrazenie</translation>
</message>
<message>
<source>User Interface &language:</source>
<translation>&Jazyk užívateľského rozhrania:</translation>
</message>
<message>
<source>The user interface language can be set here. This setting will take effect after restarting %1.</source>
<translation>Jazyk uživateľského rozhrania sa dá nastaviť tu. Toto nastavenie sa uplatní až po reštarte %1.</translation>
</message>
<message>
<source>&Unit to show amounts in:</source>
<translation>&Zobrazovať hodnoty v jednotkách:</translation>
</message>
<message>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Zvoľte ako deliť litecoin pri zobrazovaní pri platbách a užívateľskom rozhraní.</translation>
</message>
<message>
<source>Whether to show coin control features or not.</source>
<translation>Či zobrazovať možnosti kontroly minci alebo nie.</translation>
</message>
<message>
<source>&Third party transaction URLs</source>
<translation>URL transakcií tretích strán</translation>
</message>
<message>
<source>Options set in this dialog are overridden by the command line or in the configuration file:</source>
<translation>Voľby nastavené v tomto dialógovom okne sú prepísané príkazovým riadkom alebo v konfiguračným súborom:</translation>
</message>
<message>
<source>&OK</source>
<translation>&OK</translation>
</message>
<message>
<source>&Cancel</source>
<translation>&Zrušiť</translation>
</message>
<message>
<source>default</source>
<translation>predvolené</translation>
</message>
<message>
<source>none</source>
<translation>žiadne</translation>
</message>
<message>
<source>Confirm options reset</source>
<translation>Potvrdiť obnovenie možností</translation>
</message>
<message>
<source>Client restart required to activate changes.</source>
<translation>Reštart klienta potrebný pre aktivovanie zmien.</translation>
</message>
<message>
<source>Client will be shut down. Do you want to proceed?</source>
<translation>Klient bude vypnutý, chcete pokračovať?</translation>
</message>
<message>
<source>Configuration options</source>
<translation>Možnosti nastavenia</translation>
</message>
<message>
<source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>
<translation>Konfiguračný súbor slúží k nastavovaniu užívateľsky pokročilých možností, ktoré majú prednosť pred konfiguráciou z GUI. Parametre z príkazovej riadky však majú pred konfiguračným súborom prednosť.</translation>
</message>
<message>
<source>Error</source>
<translation>Chyba</translation>
</message>
<message>
<source>The configuration file could not be opened.</source>
<translation>Konfiguračný súbor nejde otvoriť.</translation>
</message>
<message>
<source>This change would require a client restart.</source>
<translation>Táto zmena by vyžadovala reštart klienta.</translation>
</message>
<message>
<source>The supplied proxy address is invalid.</source>
<translation>Zadaná proxy adresa je neplatná.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<source>Form</source>
<translation>Formulár</translation>
</message>
<message>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Litecoin network after a connection is established, but this process has not completed yet.</source>
<translation>Zobrazené informácie môžu byť neaktuálne. Vaša peňaženka sa automaticky synchronizuje so sieťou Litecoin po nadviazaní spojenia, ale tento proces ešte nie je ukončený.</translation>
</message>
<message>
<source>Watch-only:</source>
<translation>Iba sledované:</translation>
</message>
<message>
<source>Available:</source>
<translation>Disponibilné:</translation>
</message>
<message>
<source>Your current spendable balance</source>
<translation>Váš aktuálny disponibilný zostatok</translation>
</message>
<message>
<source>Pending:</source>
<translation>Čakajúce potvrdenie:</translation>
</message>
<message>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>
<translation>Suma transakcií ktoré ešte neboli potvrdené a ešte sa nepočítajú do disponibilného zostatku</translation>
</message>
<message>
<source>Immature:</source>
<translation>Nezrelé:</translation>
</message>
<message>
<source>Mined balance that has not yet matured</source>
<translation>Vytvorený zostatok ktorý ešte nedosiahol zrelosť</translation>
</message>
<message>
<source>Balances</source>
<translation>Stav účtu</translation>
</message>
<message>
<source>Total:</source>
<translation>Celkovo:</translation>
</message>
<message>
<source>Your current total balance</source>
<translation>Váš súčasný celkový zostatok</translation>
</message>
<message>
<source>Your current balance in watch-only addresses</source>
<translation>Váš celkový zostatok pre adresy ktoré sa iba sledujú</translation>
</message>
<message>
<source>Spendable:</source>
<translation>Použiteľné:</translation>
</message>
<message>
<source>Recent transactions</source>
<translation>Nedávne transakcie</translation>
</message>
<message>
<source>Unconfirmed transactions to watch-only addresses</source>
<translation>Nepotvrdené transakcie pre adresy ktoré sa iba sledujú</translation>
</message>
<message>
<source>Mined balance in watch-only addresses that has not yet matured</source>
<translation>Vyťažená suma pre adresy ktoré sa iba sledujú ale ešte nie je dozretá</translation>
</message>
<message>
<source>Current total balance in watch-only addresses</source>
<translation>Aktuálny celkový zostatok pre adries ktoré sa iba sledujú</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<source>Payment request error</source>
<translation>Chyba pri vyžiadaní platby</translation>
</message>
<message>
<source>Cannot start litecoin: click-to-pay handler</source>
<translation>Nemôžeme spustiť Litecoin: obsluha click-to-pay</translation>
</message>
<message>
<source>URI handling</source>
<translation>URI manipulácia</translation>
</message>
<message>
<source>'litecoin://' is not a valid URI. Use 'litecoin:' instead.</source>
<translation>'litecoin://' je neplatná URI. Použite 'litecoin:'</translation>
</message>
<message>
<source>You are using a BIP70 URL which will be unsupported in the future.</source>
<translation>Používate adresu URL typu BIP70, ktorá nebude v budúcnosti podporovaná.</translation>
</message>
<message>
<source>Payment request fetch URL is invalid: %1</source>
<translation>URL pre stiahnutie výzvy na zaplatenie je neplatné: %1</translation>
</message>
<message>
<source>Cannot process payment request because BIP70 support was not compiled in.</source>
<translation>Nemožno spracovať žiadosť o platbu, pretože podpora pre BIP70 nebola zahrnutá.</translation>
</message>
<message>
<source>Invalid payment address %1</source>
<translation>Neplatná adresa platby %1</translation>
</message>
<message>
<source>URI cannot be parsed! This can be caused by an invalid Litecoin address or malformed URI parameters.</source>
<translation>URI sa nedá analyzovať! To môže byť spôsobené neplatnou Litecoin adresou alebo zle nastavenými vlastnosťami URI.</translation>
</message>
<message>
<source>Payment request file handling</source>
<translation>Obsluha súboru s požiadavkou na platbu</translation>
</message>
<message>
<source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>
<translation>Súbor s výzvou na zaplatenie sa nedá čítať! To môže byť spôsobené aj neplatným súborom s výzvou.</translation>
</message>
<message>
<source>Payment request rejected</source>
<translation>Požiadavka na platbu zamietnutá</translation>
</message>
<message>
<source>Payment request network doesn't match client network.</source>
<translation>Sieť požiadavky na platbu nie je zhodná so sieťou klienta.</translation>
</message>
<message>
<source>Payment request expired.</source>
<translation>Vypršala platnosť požiadavky na platbu.</translation>
</message>
<message>
<source>Payment request is not initialized.</source>
<translation>Požiadavka na platbu nie je inicializovaná</translation>
</message>
<message>
<source>Unverified payment requests to custom payment scripts are unsupported.</source>
<translation>Program nepodporuje neoverené platobné požiadavky na vlastné skripty.</translation>
</message>
<message>
<source>Invalid payment request.</source>
<translation>Chybná požiadavka na platbu.</translation>
</message>
<message>
<source>Requested payment amount of %1 is too small (considered dust).</source>
<translation>Požadovaná suma platby %1 je príliš nízka (považovaná za prach).</translation>
</message>
<message>
<source>Refund from %1</source>
<translation>Vrátenie z %1</translation>
</message>
<message>
<source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>
<translation>Požiadavka na platbu %1 je príliš veľká (%2 bajtov, povolené je %3 bajtov).</translation>
</message>
<message>
<source>Error communicating with %1: %2</source>
<translation>Chyba komunikácie s %1: %2 </translation>
</message>
<message>
<source>Payment request cannot be parsed!</source>
<translation>Požiadavka na platbu nemôže byť analyzovaná!</translation>
</message>
<message>
<source>Bad response from server %1</source>
<translation>Zlá odpoveď zo servera %1</translation>
</message>
<message>
<source>Network request error</source>
<translation>Chyba požiadavky siete</translation>
</message>
<message>
<source>Payment acknowledged</source>
<translation>Platba potvrdená</translation>
</message>
</context>
<context>
<name>PeerTableModel</name>
<message>
<source>User Agent</source>
<translation>Aplikácia</translation>
</message>
<message>
<source>Node/Service</source>
<translation>Uzol/Služba</translation>
</message>
<message>
<source>NodeId</source>
<translation>ID uzlu</translation>
</message>
<message>
<source>Ping</source>
<translation>Odozva</translation>
</message>
<message>
<source>Sent</source>
<translation>Odoslané</translation>
</message>
<message>
<source>Received</source>
<translation>Prijaté</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>Amount</source>
<translation>Suma</translation>
</message>
<message>
<source>Enter a Litecoin address (e.g. %1)</source>
<translation>Zadajte litecoin adresu (napr. %1)</translation>
</message>
<message>
<source>%1 d</source>
<translation>%1 d</translation>
</message>
<message>
<source>%1 h</source>
<translation>%1 h</translation>
</message>
<message>
<source>%1 m</source>
<translation>%1 m</translation>
</message>
<message>
<source>%1 s</source>
<translation>%1 s</translation>
</message>
<message>
<source>None</source>
<translation>Žiadne</translation>
</message>
<message>
<source>N/A</source>
<translation>nie je k dispozícii</translation>
</message>
<message>
<source>%1 ms</source>
<translation>%1 ms</translation>
</message>
<message numerus="yes">
<source>%n second(s)</source>
<translation><numerusform>%n sekunda</numerusform><numerusform>%n sekundy</numerusform><numerusform>%n sekúnd</numerusform><numerusform>%n sekúnd</numerusform></translation>
</message>
<message numerus="yes">
<source>%n minute(s)</source>
<translation><numerusform>%n minúta</numerusform><numerusform>%n minúty</numerusform><numerusform>%n minút</numerusform><numerusform>%n minút</numerusform></translation>
</message>
<message numerus="yes">
<source>%n hour(s)</source>
<translation><numerusform>%n hodina</numerusform><numerusform>%n hodiny</numerusform><numerusform>%n hodín</numerusform><numerusform>%n hodín</numerusform></translation>
</message>
<message numerus="yes">
<source>%n day(s)</source>
<translation><numerusform>%n deň</numerusform><numerusform>%n dni</numerusform><numerusform>%n dní</numerusform><numerusform>%n dní</numerusform></translation>
</message>
<message numerus="yes">
<source>%n week(s)</source>
<translation><numerusform>%n týždeň</numerusform><numerusform>%n týždne</numerusform><numerusform>%n týždňov</numerusform><numerusform>%n týždňov</numerusform></translation>
</message>
<message>
<source>%1 and %2</source>
<translation> %1 a %2</translation>
</message>
<message numerus="yes">
<source>%n year(s)</source>
<translation><numerusform>%n rok</numerusform><numerusform>%n roky</numerusform><numerusform>%n rokov</numerusform><numerusform>%n rokov</numerusform></translation>
</message>
<message>
<source>%1 B</source>
<translation>%1 B</translation>
</message>
<message>
<source>%1 KB</source>
<translation>%1 KB</translation>
</message>
<message>
<source>%1 MB</source>
<translation>%1 MB</translation>
</message>
<message>
<source>%1 GB</source>
<translation>%1 GB</translation>
</message>
<message>
<source>%1 didn't yet exit safely...</source>
<translation>%1 ešte nebol bezpečne ukončený...</translation>
</message>
<message>
<source>unknown</source>
<translation>neznámy</translation>
</message>
</context>
<context>
<name>QObject::QObject</name>
<message>
<source>Error parsing command line arguments: %1.</source>
<translation>Chyba pri spracovaní argumentov príkazového riadku: %1.</translation>
</message>
<message>
<source>Error: Specified data directory "%1" does not exist.</source>
<translation>Chyba: Zadaný adresár pre dáta „%1“ neexistuje.</translation>
</message>
<message>
<source>Error: Cannot parse configuration file: %1.</source>
<translation>Chyba: Konfiguračný súbor sa nedá spracovať: %1.</translation>
</message>
<message>
<source>Error: %1</source>
<translation>Chyba: %1</translation>
</message>
</context>
<context>
<name>QRImageWidget</name>
<message>
<source>&Save Image...</source>
<translation>&Uložiť obrázok...</translation>
</message>
<message>
<source>&Copy Image</source>
<translation>&Kopírovať obrázok</translation>
</message>
<message>
<source>Save QR Code</source>
<translation>Uložiť QR Code</translation>
</message>
<message>
<source>PNG Image (*.png)</source>
<translation>PNG obrázok (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<source>N/A</source>
<translation>nie je k dispozícii</translation>
</message>
<message>
<source>Client version</source>
<translation>Verzia klienta</translation>
</message>
<message>
<source>&Information</source>
<translation>&Informácia</translation>
</message>
<message>
<source>Debug window</source>
<translation>Okno pre ladenie</translation>
</message>
<message>
<source>General</source>
<translation>Všeobecné</translation>
</message>
<message>
<source>Using BerkeleyDB version</source>
<translation>Používa verziu BerkeleyDB</translation>
</message>
<message>
<source>Datadir</source>
<translation>Priečinok s dátami</translation>
</message>
<message>
<source>To specify a non-default location of the data directory use the '%1' option.</source>
<translation>Ak chcete zadať miesto dátového adresára, ktoré nie je predvolené, použite voľbu '%1'.</translation>
</message>
<message>
<source>Blocksdir</source>
<translation>Blocksdir</translation>
</message>
<message>
<source>To specify a non-default location of the blocks directory use the '%1' option.</source>
<translation>Ak chcete zadať miesto adresára pre bloky, ktoré nie je predvolené, použite voľbu '%1'.</translation>
</message>
<message>
<source>Startup time</source>
<translation>Čas spustenia</translation>
</message>
<message>
<source>Network</source>
<translation>Sieť</translation>
</message>
<message>
<source>Name</source>
<translation>Názov</translation>
</message>
<message>
<source>Number of connections</source>
<translation>Počet pripojení</translation>
</message>
<message>
<source>Block chain</source>
<translation>Reťazec blokov</translation>
</message>
<message>
<source>Current number of blocks</source>
<translation>Aktuálny počet blokov</translation>
</message>
<message>
<source>Memory Pool</source>
<translation>Pamäť Poolu</translation>
</message>
<message>
<source>Current number of transactions</source>
<translation>Aktuálny počet transakcií</translation>
</message>
<message>
<source>Memory usage</source>
<translation>Využitie pamäte</translation>
</message>
<message>
<source>Wallet: </source>
<translation>Peňaženka:</translation>
</message>
<message>
<source>(none)</source>
<translation>(žiadna)</translation>
</message>
<message>
<source>&Reset</source>
<translation>&Vynulovať</translation>
</message>
<message>
<source>Received</source>
<translation>Prijaté</translation>
</message>
<message>
<source>Sent</source>
<translation>Odoslané</translation>
</message>
<message>
<source>&Peers</source>
<translation>&Partneri</translation>
</message>
<message>
<source>Banned peers</source>
<translation>Zablokované spojenia</translation>
</message>
<message>
<source>Select a peer to view detailed information.</source>
<translation>Vyberte počítač pre zobrazenie podrobností.</translation>
</message>
<message>
<source>Whitelisted</source>
<translation>Povolené</translation>
</message>
<message>
<source>Direction</source>
<translation>Smer</translation>
</message>
<message>
<source>Version</source>
<translation>Verzia</translation>
</message>
<message>
<source>Starting Block</source>
<translation>Počiatočný blok</translation>
</message>
<message>
<source>Synced Headers</source>
<translation>Synchronizované hlavičky
</translation>
</message>
<message>
<source>Synced Blocks</source>
<translation>Synchronizované bloky</translation>
</message>
<message>
<source>User Agent</source>
<translation>Aplikácia</translation>
</message>
<message>
<source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation>Otvoriť %1 ladiaci výpis z aktuálnej zložky. Pre veľké súbory to môže chvíľu trvať.</translation>
</message>
<message>
<source>Decrease font size</source>
<translation>Zmenšiť písmo</translation>
</message>
<message>
<source>Increase font size</source>
<translation>Zväčšiť písmo</translation>
</message>
<message>
<source>Services</source>
<translation>Služby</translation>
</message>
<message>
<source>Ban Score</source>
<translation>Skóre zákazu</translation>
</message>
<message>
<source>Connection Time</source>
<translation>Dĺžka spojenia</translation>
</message>
<message>
<source>Last Send</source>
<translation>Posledné odoslanie</translation>
</message>
<message>
<source>Last Receive</source>
<translation>Posledné prijatie</translation>
</message>
<message>
<source>Ping Time</source>
<translation>Čas odozvy</translation>
</message>
<message>
<source>The duration of a currently outstanding ping.</source>
<translation>Trvanie aktuálnej požiadavky na odozvu.</translation>
</message>
<message>
<source>Ping Wait</source>
<translation>Čakanie na odozvu</translation>
</message>
<message>
<source>Min Ping</source>
<translation>Minimálna odozva</translation>
</message>
<message>
<source>Time Offset</source>
<translation>Časový posun</translation>
</message>
<message>
<source>Last block time</source>
<translation>Čas posledného bloku</translation>
</message>
<message>
<source>&Open</source>
<translation>&Otvoriť</translation>
</message>
<message>
<source>&Console</source>
<translation>&Konzola</translation>
</message>
<message>
<source>&Network Traffic</source>
<translation>&Sieťová prevádzka</translation>
</message>
<message>
<source>Totals</source>
<translation>Celkovo:</translation>
</message>
<message>
<source>In:</source>
<translation>Dnu:</translation>
</message>
<message>
<source>Out:</source>
<translation>Von:</translation>
</message>
<message>
<source>Debug log file</source>
<translation>Súbor záznamu ladenia</translation>
</message>
<message>
<source>Clear console</source>
<translation>Vymazať konzolu</translation>
</message>
<message>
<source>1 &hour</source>
<translation>1 &hodinu</translation>
</message>
<message>
<source>1 &day</source>
<translation>1 &deň</translation>
</message>
<message>
<source>1 &week</source>
<translation>1 &týždeň</translation>
</message>
<message>
<source>1 &year</source>
<translation>1 &rok</translation>
</message>
<message>
<source>&Disconnect</source>
<translation>&Odpojiť</translation>
</message>
<message>
<source>Ban for</source>
<translation>Zákaz pre</translation>
</message>
<message>
<source>&Unban</source>
<translation>&Zrušiť zákaz</translation>
</message>
<message>
<source>Welcome to the %1 RPC console.</source>
<translation>Vitajte v %1 RPC konzole</translation>
</message>
<message>
<source>Use up and down arrows to navigate history, and %1 to clear screen.</source>
<translation>V histórii sa pohybujete šípkami hore a dole a pomocou %1 čistíte obrazovku.</translation>
</message>
<message>
<source>Type %1 for an overview of available commands.</source>
<translation>Napíš %1 pre prehľad dostupných príkazov.</translation>
</message>
<message>
<source>For more information on using this console type %1.</source>
<translation>Pre viac informácií ako používať túto konzolu napíšte %1.</translation>
</message>
<message>
<source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>
<translation>UPOZORNENIE: Podvodníci sú aktívni a hovoria používateľom, aby sem zadávali príkazy, ktorými im ale následne vykradnú ich peňaženky. Nepoužívajte túto konzolu, ak plne nepoynáte dôsledky jednotlivých príkazov.</translation>
</message>
<message>
<source>Network activity disabled</source>
<translation>Sieťová aktivita zakázaná</translation>
</message>
<message>
<source>Executing command without any wallet</source>
<translation>Príkaz sa vykonáva bez peňaženky</translation>
</message>
<message>
<source>Executing command using "%1" wallet</source>
<translation>Príkaz sa vykonáva s použitím peňaženky "%1"</translation>
</message>
<message>
<source>(node id: %1)</source>
<translation>(ID uzlu: %1)</translation>
</message>
<message>
<source>via %1</source>
<translation>cez %1</translation>
</message>
<message>
<source>never</source>
<translation>nikdy</translation>
</message>
<message>
<source>Inbound</source>
<translation>Prichádzajúce</translation>
</message>
<message>
<source>Outbound</source>
<translation>Odchádzajúce</translation>
</message>
<message>
<source>Yes</source>
<translation>Áno</translation>
</message>
<message>
<source>No</source>
<translation>Nie</translation>
</message>
<message>
<source>Unknown</source>
<translation>neznámy</translation>
</message>
</context>
<context>
<name>ReceiveCoinsDialog</name>
<message>
<source>&Amount:</source>
<translation>&Suma:</translation>
</message>
<message>
<source>&Label:</source>
<translation>&Popis:</translation>
</message>
<message>
<source>&Message:</source>
<translation>&Správa:</translation>
</message>
<message>
<source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Litecoin network.</source>
<translation>Pridať voliteľnú správu k výzve na zaplatenie, ktorá sa zobrazí keď bude výzva otvorená. Poznámka: Správa nebude poslaná s platbou cez sieť Litecoin.</translation>
</message>
<message>
<source>An optional label to associate with the new receiving address.</source>
<translation>Voliteľný popis ktorý sa pridá k tejto novej prijímajúcej adrese.</translation>
</message>
<message>
<source>Use this form to request payments. All fields are <b>optional</b>.</source>
<translation>Použite tento formulár pre vyžiadanie platby. Všetky polia sú <b>voliteľné</b>.</translation>
</message>
<message>
<source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>
<translation>Voliteľná požadovaná suma. Nechajte prázdne alebo nulu ak nepožadujete určitú sumu.</translation>
</message>
<message>
<source>Clear all fields of the form.</source>
<translation>Vyčistiť všetky polia formulára.</translation>
</message>
<message>
<source>Clear</source>
<translation>Vyčistiť</translation>
</message>
<message>
<source>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don't support them. When unchecked, an address compatible with older wallets will be created instead.</source>
<translation>Natívne segwit adresy (Bech32 or BIP-173) znižujú Vaše budúce transakčné poplatky and ponúkajú lepšiu ochranu pred preklepmi, avšak staré peňaženky ich nepodporujú. Ak je toto pole nezaškrtnuté, bude vytvorená adresa kompatibilná so staršími peňaženkami.</translation>
</message>
<message>
<source>Generate native segwit (Bech32) address</source>
<translation>Generovať natívnu segwit adresu (Bech32)</translation>
</message>
<message>
<source>Requested payments history</source>
<translation>História vyžiadaných platieb</translation>
</message>
<message>
<source>&Request payment</source>
<translation>&Vyžiadať platbu</translation>
</message>
<message>
<source>Show the selected request (does the same as double clicking an entry)</source>
<translation>Zobraz zvolenú požiadavku (urobí to isté ako dvoj-klik na záznam)</translation>
</message>
<message>
<source>Show</source>
<translation>Zobraziť</translation>
</message>
<message>
<source>Remove the selected entries from the list</source>
<translation>Odstrániť zvolené záznamy zo zoznamu</translation>
</message>
<message>
<source>Remove</source>
<translation>Odstrániť</translation>
</message>
<message>
<source>Copy URI</source>
<translation>Kopírovať URI</translation>
</message>
<message>
<source>Copy label</source>
<translation>Kopírovať popis</translation>
</message>
<message>
<source>Copy message</source>
<translation>Kopírovať správu</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Kopírovať sumu</translation>
</message>
</context>
<context>
<name>ReceiveRequestDialog</name>
<message>
<source>QR Code</source>
<translation>QR kód</translation>
</message>
<message>
<source>Copy &URI</source>
<translation>Kopírovať &URI</translation>
</message>
<message>
<source>Copy &Address</source>
<translation>Kopírovať &adresu</translation>
</message>
<message>
<source>&Save Image...</source>
<translation>&Uložiť obrázok...</translation>
</message>
<message>
<source>Request payment to %1</source>
<translation>Vyžiadať platbu pre %1</translation>
</message>
<message>
<source>Payment information</source>
<translation>Informácia o platbe</translation>
</message>
<message>
<source>URI</source>
<translation>URI</translation>
</message>
<message>
<source>Address</source>
<translation>Adresa</translation>
</message>
<message>
<source>Amount</source>
<translation>Suma</translation>
</message>
<message>
<source>Label</source>
<translation>Popis</translation>
</message>
<message>
<source>Message</source>
<translation>Správa</translation>
</message>
<message>
<source>Wallet</source>
<translation>Peňaženka</translation>
</message>
<message>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>Výsledné URI je príliš dlhé, skúste skrátiť text pre popis alebo správu.</translation>
</message>
<message>
<source>Error encoding URI into QR Code.</source>
<translation>Chyba kódovania URI do QR Code.</translation>
</message>
</context>
<context>
<name>RecentRequestsTableModel</name>
<message>
<source>Date</source>
<translation>Dátum</translation>
</message>
<message>
<source>Label</source>
<translation>Popis</translation>
</message>
<message>
<source>Message</source>
<translation>Správa</translation>
</message>
<message>
<source>(no label)</source>
<translation>(bez popisu)</translation>
</message>
<message>
<source>(no message)</source>
<translation>(žiadna správa)</translation>
</message>
<message>
<source>(no amount requested)</source>
<translation>(nepožadovaná žiadna suma)</translation>
</message>
<message>
<source>Requested</source>
<translation>Požadované</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<source>Send Coins</source>
<translation>Poslať Litecoins</translation>
</message>
<message>
<source>Coin Control Features</source>
<translation>Možnosti kontroly minci</translation>
</message>
<message>
<source>Inputs...</source>
<translation>Vstupy...</translation>
</message>
<message>
<source>automatically selected</source>
<translation>automaticky vybrané</translation>
</message>
<message>
<source>Insufficient funds!</source>
<translation>Nedostatok prostriedkov!</translation>
</message>
<message>
<source>Quantity:</source>
<translation>Množstvo:</translation>
</message>
<message>
<source>Bytes:</source>
<translation>Bajtov:</translation>
</message>
<message>
<source>Amount:</source>
<translation>Suma:</translation>
</message>
<message>
<source>Fee:</source>
<translation>Poplatok:</translation>
</message>
<message>
<source>After Fee:</source>
<translation>Po poplatku:</translation>
</message>
<message>
<source>Change:</source>
<translation>Zmena:</translation>
</message>
<message>
<source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>
<translation>Ak aktivované ale adresa pre výdavok je prázdna alebo neplatná, výdavok bude poslaný na novovytvorenú adresu.</translation>
</message>
<message>
<source>Custom change address</source>
<translation>Vlastná adresa zmeny</translation>
</message>
<message>
<source>Transaction Fee:</source>
<translation>Poplatok za transakciu:</translation>
</message>
<message>
<source>Choose...</source>
<translation>Zvoliť...</translation>
</message>
<message>
<source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>
<translation>Použitie núdzového poplatku („fallbackfee“) môže vyústiť v transakciu, ktoré bude trvat hodiny nebo dny (prípadne večnosť), kým bude potvrdená. Zvážte preto ručné nastaveníe poplatku, prípadne počkajte, až sa Vám kompletne zvaliduje reťazec blokov.</translation>
</message>
<message>
<source>Warning: Fee estimation is currently not possible.</source>
<translation>Upozornenie: teraz nie je možné poplatok odhadnúť.</translation>
</message>
<message>
<source>collapse fee-settings</source>
<translation>zbaliť nastavenia poplatkov</translation>
</message>
<message>
<source>Specify a custom fee per kB (1,000 bytes) of the transaction's virtual size.
Note: Since the fee is calculated on a per-byte basis, a fee of "100 satoshis per kB" for a transaction size of 500 bytes (half of 1 kB) would ultimately yield a fee of only 50 satoshis.</source>
<translation>Špecifikujte vlastný poplatok za kB (1000 bajtov) virtuálnej veľkosti transakcie.
Poznámka: Keďže poplatok je počítaný za bajt, poplatok o hodnote "100 satoshi za kB" a veľkosti transakcie 500 bajtov (polovica z 1 kB) by stál len 50 satoshi.</translation>
</message>
<message>
<source>per kilobyte</source>
<translation>za kilobajt</translation>
</message>
<message>
<source>Hide</source>
<translation>Skryť</translation>
</message>
<message>
<source>Recommended:</source>
<translation>Odporúčaný:</translation>
</message>
<message>
<source>Custom:</source>
<translation>Vlastný:</translation>
</message>
<message>
<source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>
<translation>(Automatický poplatok ešte nebol vypočítaný. Toto zvyčajne trvá niekoľko blokov...)</translation>
</message>
<message>
<source>Send to multiple recipients at once</source>
<translation>Poslať viacerým príjemcom naraz</translation>
</message>
<message>
<source>Add &Recipient</source>
<translation>&Pridať príjemcu</translation>
</message>
<message>
<source>Clear all fields of the form.</source>
<translation>Vyčistiť všetky polia formulára.</translation>
</message>
<message>
<source>Dust:</source>
<translation>Prach:</translation>
</message>
<message>
<source>When there is less transaction volume than space in the blocks, miners as well as relaying nodes may enforce a minimum fee. Paying only this minimum fee is just fine, but be aware that this can result in a never confirming transaction once there is more demand for litecoin transactions than the network can process.</source>
<translation>Ak je v blokoch menej objemu transakcií ako priestoru, ťažiari ako aj vysielacie uzly, môžu uplatniť minimálny poplatok. Platiť iba minimálny poplatok je v poriadku, ale uvedomte si, že to môže mať za následok transakciu, ktorá sa nikdy nepotvrdí, akonáhle je väčší dopyt po litecoinových transakciách, než dokáže sieť spracovať.</translation>
</message>
<message>
<source>A too low fee might result in a never confirming transaction (read the tooltip)</source>
<translation>Príliš nízky poplatok môže mať za následok nikdy nepotvrdenú transakciu (prečítajte si popis)</translation>
</message>
<message>
<source>Confirmation time target:</source>
<translation>Cieľový čas potvrdenia:</translation>
</message>
<message>
<source>Enable Replace-By-Fee</source>
<translation>Povoliť dodatočné navýšenie poplatku (tzv. „Replace-By-Fee“)</translation>
</message>
<message>
<source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>
<translation>S dodatočným navýšením poplatku (BIP-125, tzv. „Replace-By-Fee“), môžete zvýšiť poplatok aj po odoslaní. Bez toho, by mohol byť navrhnutý väčší transakčný poplatok, aby kompenzoval zvýšené riziko omeškania transakcie.</translation>
</message>
<message>
<source>Clear &All</source>
<translation>&Zmazať všetko</translation>
</message>
<message>
<source>Balance:</source>
<translation>Zostatok:</translation>
</message>
<message>
<source>Confirm the send action</source>
<translation>Potvrďte odoslanie</translation>
</message>
<message>
<source>S&end</source>
<translation>&Odoslať</translation>
</message>
<message>
<source>Copy quantity</source>
<translation>Kopírovať množstvo</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Kopírovať sumu</translation>
</message>
<message>
<source>Copy fee</source>
<translation>Kopírovať poplatok</translation>
</message>
<message>
<source>Copy after fee</source>
<translation>Kopírovať po poplatkoch</translation>
</message>
<message>
<source>Copy bytes</source>
<translation>Kopírovať bajty</translation>
</message>
<message>
<source>Copy dust</source>
<translation>Kopírovať prach</translation>
</message>
<message>
<source>Copy change</source>
<translation>Kopírovať zmenu</translation>
</message>
<message>
<source>%1 (%2 blocks)</source>
<translation>%1 (%2 blokov)</translation>
</message>
<message>
<source>%1 to %2</source>
<translation>%1 do %2</translation>
</message>
<message>
<source>Are you sure you want to send?</source>
<translation>Určite chcete odoslať transakciu?</translation>
</message>
<message>
<source>or</source>
<translation>alebo</translation>
</message>
<message>
<source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>
<translation>Poplatok môžete navýšiť neskôr (vysiela sa "Replace-By-Fee" - nahradenie poplatkom, BIP-125).</translation>
</message>
<message>
<source>from wallet %1</source>
<translation>z peňaženky %1</translation>
</message>
<message>
<source>Please, review your transaction.</source>
<translation>Prosím, skontrolujte Vašu transakciu.</translation>
</message>
<message>
<source>Transaction fee</source>
<translation>Transakčný poplatok</translation>
</message>
<message>
<source>Not signalling Replace-By-Fee, BIP-125.</source>
<translation>Nevysiela sa "Replace-By-Fee" - nahradenie poplatkom, BIP-125.</translation>
</message>
<message>
<source>Total Amount</source>
<translation>Celková suma</translation>
</message>
<message>
<source>Confirm send coins</source>
<translation>Potvrďte odoslanie mincí</translation>
</message>
<message>
<source>The recipient address is not valid. Please recheck.</source>
<translation>Adresa príjemcu je neplatná. Prosím, overte ju.</translation>
</message>
<message>
<source>The amount to pay must be larger than 0.</source>
<translation>Suma na úhradu musí byť väčšia ako 0.</translation>
</message>
<message>
<source>The amount exceeds your balance.</source>
<translation>Suma je vyššia ako Váš zostatok.</translation>
</message>
<message>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Celková suma prevyšuje Váš zostatok ak sú započítané aj transakčné poplatky %1.</translation>
</message>
<message>
<source>Duplicate address found: addresses should only be used once each.</source>
<translation>Našla sa duplicitná adresa: každá adresa by sa mala použiť len raz.</translation>
</message>
<message>
<source>Transaction creation failed!</source>
<translation>Vytvorenie transakcie zlyhalo!</translation>
</message>
<message>
<source>The transaction was rejected with the following reason: %1</source>
<translation>Transakcia bola odmietnutá z nasledujúceho dôvodu: %1</translation>
</message>
<message>
<source>A fee higher than %1 is considered an absurdly high fee.</source>
<translation>Poplatok vyšší ako %1 sa považuje za neprimerane vysoký.</translation>
</message>
<message>
<source>Payment request expired.</source>
<translation>Vypršala platnosť požiadavky na platbu.</translation>
</message>
<message numerus="yes">
<source>Estimated to begin confirmation within %n block(s).</source>
<translation><numerusform>Odhadovaný začiatok potvrdzovania po %n bloku.</numerusform><numerusform>Odhadovaný začiatok potvrdzovania po %n blokoch.</numerusform><numerusform>Odhadovaný začiatok potvrdzovania po %n blokoch.</numerusform><numerusform>Odhadovaný začiatok potvrdzovania po %n blokoch.</numerusform></translation>
</message>
<message>
<source>Warning: Invalid Litecoin address</source>
<translation>Varovanie: Neplatná Litecoin adresa</translation>
</message>
<message>
<source>Warning: Unknown change address</source>
<translation>UPOZORNENIE: Neznáma výdavková adresa</translation>
</message>
<message>
<source>Confirm custom change address</source>
<translation>Potvrďte vlastnú výdavkovú adresu</translation>
</message>
<message>
<source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>
<translation>Zadaná adresa pre výdavok nie je súčasťou tejto peňaženky. Časť alebo všetky peniaze z peňaženky môžu byť odoslané na túto adresu. Ste si istý?</translation>
</message>
<message>
<source>(no label)</source>
<translation>(bez popisu)</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<source>A&mount:</source>
<translation>Su&ma:</translation>
</message>
<message>
<source>Pay &To:</source>
<translation>Zapla&tiť:</translation>
</message>
<message>
<source>&Label:</source>
<translation>&Popis:</translation>
</message>
<message>
<source>Choose previously used address</source>
<translation>Vybrať predtým použitú adresu</translation>
</message>
<message>
<source>This is a normal payment.</source>
<translation>Toto je normálna platba.</translation>
</message>
<message>
<source>The Litecoin address to send the payment to</source>
<translation>Zvoľte adresu kam poslať platbu</translation>
</message>
<message>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<source>Paste address from clipboard</source>
<translation>Vložiť adresu zo schránky</translation>
</message>
<message>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<source>Remove this entry</source>
<translation>Odstrániť túto položku</translation>
</message>
<message>
<source>The fee will be deducted from the amount being sent. The recipient will receive less litecoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>
<translation>Poplatok sa odpočíta od čiastky, ktorú odosielate. Príjemca dostane menej litecoinov ako zadáte. Ak je vybraných viacero príjemcov, poplatok je rozdelený rovným dielom.</translation>
</message>
<message>
<source>S&ubtract fee from amount</source>
<translation>Odpočítať poplatok od s&umy</translation>
</message>
<message>
<source>Use available balance</source>
<translation>Použiť dostupné zdroje</translation>
</message>
<message>
<source>Message:</source>
<translation>Správa:</translation>
</message>
<message>
<source>This is an unauthenticated payment request.</source>
<translation>Toto je neoverená výzva k platbe.</translation>
</message>
<message>
<source>This is an authenticated payment request.</source>
<translation>Toto je overená výzva k platbe.</translation>
</message>
<message>
<source>Enter a label for this address to add it to the list of used addresses</source>
<translation>Vložte popis pre túto adresu aby sa uložila do zoznamu použitých adries</translation>
</message>
<message>
<source>A message that was attached to the litecoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Litecoin network.</source>
<translation>Správa ktorá bola pripojená k litecoin: URI a ktorá bude uložená s transakcou pre Vaše potreby. Poznámka: Táto správa nebude poslaná cez sieť Litecoin.</translation>
</message>
<message>
<source>Pay To:</source>
<translation>Platba pre:</translation>
</message>
<message>
<source>Memo:</source>
<translation>Poznámka:</translation>
</message>
<message>
<source>Enter a label for this address to add it to your address book</source>
<translation>Zadajte popis pre túto adresu pre pridanie do adresára</translation>
</message>
</context>
<context>
<name>SendConfirmationDialog</name>
<message>
<source>Yes</source>
<translation>áno</translation>
</message>
</context>
<context>
<name>ShutdownWindow</name>
<message>
<source>%1 is shutting down...</source>
<translation>%1 sa vypína...</translation>
</message>
<message>
<source>Do not shut down the computer until this window disappears.</source>
<translation>Nevypínajte počítač kým toto okno nezmizne.</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<source>Signatures - Sign / Verify a Message</source>
<translation>Podpisy - Podpísať / Overiť správu</translation>
</message>
<message>
<source>&Sign Message</source>
<translation>&Podpísať Správu</translation>
</message>
<message>
<source>You can sign messages/agreements with your addresses to prove you can receive litecoins sent to them. Be careful not to sign anything vague or random, 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>Môžete podpísať správy svojou adresou a dokázať, že viete prijímať mince zaslané na túto adresu. Buďte však opatrní a podpíšte len podrobné prehlásenia, s ktorými plne súhlasíte, nakoľko útoky typu "phishing" Vás môžu lákať k podpísaniu nejasných alebo príliš všeobecných tvrdení čím prevezmú vašu identitu.</translation>
</message>
<message>
<source>The Litecoin address to sign the message with</source>
<translation>Litecoin adresa pre podpísanie správy s</translation>
</message>
<message>
<source>Choose previously used address</source>
<translation>Vybrať predtým použitú adresu</translation>
</message>
<message>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<source>Paste address from clipboard</source>
<translation>Vložiť adresu zo schránky</translation>
</message>
<message>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<source>Enter the message you want to sign here</source>
<translation>Sem vložte správu ktorú chcete podpísať</translation>
</message>
<message>
<source>Signature</source>
<translation>Podpis</translation>
</message>
<message>
<source>Copy the current signature to the system clipboard</source>
<translation>Kopírovať tento podpis do systémovej schránky</translation>
</message>
<message>
<source>Sign the message to prove you own this Litecoin address</source>
<translation>Podpíšte správu aby ste dokázali že vlastníte túto adresu</translation>
</message>
<message>
<source>Sign &Message</source>
<translation>Podpísať &správu</translation>
</message>
<message>
<source>Reset all sign message fields</source>
<translation>Vynulovať všetky polia podpisu správy</translation>
</message>
<message>
<source>Clear &All</source>
<translation>&Zmazať všetko</translation>
</message>
<message>
<source>&Verify Message</source>
<translation>O&veriť správu...</translation>
</message>
<message>
<source>Enter the receiver's 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. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>
<translation>Vložte adresu príjemcu, správu (uistite sa, že presne kopírujete ukončenia riadkov, medzery, odrážky, atď.) a podpis pre potvrdenie správy. Buďte opatrní a nedomýšľajte si viac než je uvedené v samotnej podpísanej správe a môžete sa tak vyhnúť podvodu MITM útokom. Toto len potvrdzuje, že podpisujúca strana môže prijímať na tejto adrese, nepotvrdzuje to vlastníctvo žiadnej transakcie!</translation>
</message>
<message>
<source>The Litecoin address the message was signed with</source>
<translation>Adresa Litecoin, ktorou bola podpísaná správa</translation>
</message>
<message>
<source>Verify the message to ensure it was signed with the specified Litecoin address</source>
<translation>Overím správy sa uistiť že bola podpísaná označenou Litecoin adresou</translation>
</message>
<message>
<source>Verify &Message</source>
<translation>&Overiť správu</translation>
</message>
<message>
<source>Reset all verify message fields</source>
<translation>Obnoviť všetky polia v overiť správu</translation>
</message>
<message>
<source>Click "Sign Message" to generate signature</source>
<translation>Kliknite "Podpísať správu" pre vytvorenie podpisu</translation>
</message>
<message>
<source>The entered address is invalid.</source>
<translation>Zadaná adresa je neplatná.</translation>
</message>
<message>
<source>Please check the address and try again.</source>
<translation>Prosím skontrolujte adresu a skúste znova.</translation>
</message>
<message>
<source>The entered address does not refer to a key.</source>
<translation>Vložená adresa nezodpovedá žiadnemu kľúču.</translation>
</message>
<message>
<source>Wallet unlock was cancelled.</source>
<translation>Odomknutie peňaženky bolo zrušené.</translation>
</message>
<message>
<source>Private key for the entered address is not available.</source>
<translation>Súkromný kľúč pre zadanú adresu nieje k dispozícii.</translation>
</message>
<message>
<source>Message signing failed.</source>
<translation>Podpísanie správy zlyhalo.</translation>
</message>
<message>
<source>Message signed.</source>
<translation>Správa podpísaná.</translation>
</message>
<message>
<source>The signature could not be decoded.</source>
<translation>Podpis nie je možné dekódovať.</translation>
</message>
<message>
<source>Please check the signature and try again.</source>
<translation>Prosím skontrolujte podpis a skúste znova.</translation>
</message>
<message>
<source>The signature did not match the message digest.</source>
<translation>Podpis sa nezhoduje so zhrnutím správy.</translation>
</message>
<message>
<source>Message verification failed.</source>
<translation>Overenie správy zlyhalo.</translation>
</message>
<message>
<source>Message verified.</source>
<translation>Správa overená.</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<source>[testnet]</source>
<translation>[testovacia sieť]</translation>
</message>
</context>
<context>
<name>TrafficGraphWidget</name>
<message>
<source>KB/s</source>
<translation>KB/s</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message numerus="yes">
<source>Open for %n more block(s)</source>
<translation><numerusform>Otvoriť pre %n ďalší blok</numerusform><numerusform>Otvoriť pre %n ďalšie bloky</numerusform><numerusform>Otvoriť pre %n ďalších blokov</numerusform><numerusform>Otvoriť pre %n ďalších blokov</numerusform></translation>
</message>
<message>
<source>Open until %1</source>
<translation>Otvorené do %1</translation>
</message>
<message>
<source>conflicted with a transaction with %1 confirmations</source>
<translation>koliduje s transakciou s %1 potvrdeniami</translation>
</message>
<message>
<source>0/unconfirmed, %1</source>
<translation>0/nepotvrdené, %1</translation>
</message>
<message>
<source>in memory pool</source>
<translation>v transakčnom zásobníku</translation>
</message>
<message>
<source>not in memory pool</source>
<translation>nie je v transakčnom zásobníku</translation>
</message>
<message>
<source>abandoned</source>
<translation>zanechaná</translation>
</message>
<message>
<source>%1/unconfirmed</source>
<translation>%1/nepotvrdené</translation>
</message>
<message>
<source>%1 confirmations</source>
<translation>%1 potvrdení</translation>
</message>
<message>
<source>Status</source>
<translation>Stav</translation>
</message>
<message>
<source>Date</source>
<translation>Dátum</translation>
</message>
<message>
<source>Source</source>
<translation>Zdroj</translation>
</message>
<message>
<source>Generated</source>
<translation>Vygenerované</translation>
</message>
<message>
<source>From</source>
<translation>Od</translation>
</message>
<message>
<source>unknown</source>
<translation>neznámy</translation>
</message>
<message>
<source>To</source>
<translation>do</translation>
</message>
<message>
<source>own address</source>
<translation>vlastná adresa</translation>
</message>
<message>
<source>watch-only</source>
<translation>Iba sledovanie</translation>
</message>
<message>
<source>label</source>
<translation>popis</translation>
</message>
<message>
<source>Credit</source>
<translation>Kredit</translation>
</message>
<message numerus="yes">
<source>matures in %n more block(s)</source>
<translation><numerusform>dozreje za %n ďalší blok</numerusform><numerusform>dozreje za %n ďalšie bloky</numerusform><numerusform>dozreje za %n ďalších blokov</numerusform><numerusform>dozreje za %n ďalších blokov</numerusform></translation>
</message>
<message>
<source>not accepted</source>
<translation>neprijaté</translation>
</message>
<message>
<source>Debit</source>
<translation>Debet</translation>
</message>
<message>
<source>Total debit</source>
<translation>Celkový debet</translation>
</message>
<message>
<source>Total credit</source>
<translation>Celkový kredit</translation>
</message>
<message>
<source>Transaction fee</source>
<translation>Transakčný poplatok</translation>
</message>
<message>
<source>Net amount</source>
<translation>Suma netto</translation>
</message>
<message>
<source>Message</source>
<translation>Správa</translation>
</message>
<message>
<source>Comment</source>
<translation>Komentár</translation>
</message>
<message>
<source>Transaction ID</source>
<translation>ID transakcie</translation>
</message>
<message>
<source>Transaction total size</source>
<translation>Celková veľkosť transakcie</translation>
</message>
<message>
<source>Transaction virtual size</source>
<translation>Virtuálna veľkosť transakcie</translation>
</message>
<message>
<source>Output index</source>
<translation>Index výstupu</translation>
</message>
<message>
<source>Merchant</source>
<translation>Kupec</translation>
</message>
<message>
<source>Generated coins must mature %1 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>Vytvorené coins musia dospieť %1 blokov kým môžu byť minuté. Keď vytvoríte tento blok, bude rozoslaný do siete aby bol akceptovaný do reťaze blokov. Ak sa nedostane reťaze, jeho stav sa zmení na "zamietnutý" a nebude sa dať minúť. Toto sa môže občas stať ak iná nóda vytvorí blok približne v tom istom čase.</translation>
</message>
<message>
<source>Debug information</source>
<translation>Ladiace informácie</translation>
</message>
<message>
<source>Transaction</source>
<translation>Transakcie</translation>
</message>
<message>
<source>Inputs</source>
<translation>Vstupy</translation>
</message>
<message>
<source>Amount</source>
<translation>Suma</translation>
</message>
<message>
<source>true</source>
<translation>pravda</translation>
</message>
<message>
<source>false</source>
<translation>nepravda</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<source>This pane shows a detailed description of the transaction</source>
<translation>Táto časť obrazovky zobrazuje detailný popis transakcie</translation>
</message>
<message>
<source>Details for %1</source>
<translation>Podrobnosti pre %1</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<source>Date</source>
<translation>Dátum</translation>
</message>
<message>
<source>Type</source>
<translation>Typ</translation>
</message>
<message>
<source>Label</source>
<translation>Popis</translation>
</message>
<message numerus="yes">
<source>Open for %n more block(s)</source>
<translation><numerusform>Otvoriť pre %n ďalší blok</numerusform><numerusform>Otvoriť pre %n ďalšie bloky</numerusform><numerusform>Otvoriť pre %n ďalších blokov</numerusform><numerusform>Otvoriť pre %n ďalších blokov</numerusform></translation>
</message>
<message>
<source>Open until %1</source>
<translation>Otvorené do %1</translation>
</message>
<message>
<source>Unconfirmed</source>
<translation>Nepotvrdené</translation>
</message>
<message>
<source>Abandoned</source>
<translation>Zanechaná</translation>
</message>
<message>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation>Potvrdzujem (%1 z %2 odporúčaných potvrdení)</translation>
</message>
<message>
<source>Confirmed (%1 confirmations)</source>
<translation>Potvrdené (%1 potvrdení)</translation>
</message>
<message>
<source>Conflicted</source>
<translation>V rozpore</translation>
</message>
<message>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation>Nezrelé (%1 potvrdení, bude dostupné po %2)</translation>
</message>
<message>
<source>Generated but not accepted</source>
<translation>Vypočítané ale neakceptované</translation>
</message>
<message>
<source>Received with</source>
<translation>Prijaté s</translation>
</message>
<message>
<source>Received from</source>
<translation>Prijaté od</translation>
</message>
<message>
<source>Sent to</source>
<translation>Odoslané na</translation>
</message>
<message>
<source>Payment to yourself</source>
<translation>Platba sebe samému</translation>
</message>
<message>
<source>Mined</source>
<translation>Vyťažené</translation>
</message>
<message>
<source>watch-only</source>
<translation>Iba sledovanie</translation>
</message>
<message>
<source>(n/a)</source>
<translation>(n/a)</translation>
</message>
<message>
<source>(no label)</source>
<translation>(bez popisu)</translation>
</message>
<message>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Stav transakcie. Prejdite ponad toto pole pre zobrazenie počtu potvrdení.</translation>
</message>
<message>
<source>Date and time that the transaction was received.</source>
<translation>Dátum a čas prijatia transakcie.</translation>
</message>
<message>
<source>Type of transaction.</source>
<translation>Typ transakcie.</translation>
</message>
<message>
<source>Whether or not a watch-only address is involved in this transaction.</source>
<translation>Či je v tejto transakcii adresy iba na sledovanie.</translation>
</message>
<message>
<source>User-defined intent/purpose of the transaction.</source>
<translation>Užívateľsky určený účel transakcie.</translation>
</message>
<message>
<source>Amount removed from or added to balance.</source>
<translation>Suma pridaná alebo odobraná k zostatku.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<source>All</source>
<translation>Všetky</translation>
</message>
<message>
<source>Today</source>
<translation>Dnes</translation>
</message>
<message>
<source>This week</source>
<translation>Tento týždeň</translation>
</message>
<message>
<source>This month</source>
<translation>Tento mesiac</translation>
</message>
<message>
<source>Last month</source>
<translation>Minulý mesiac</translation>
</message>
<message>
<source>This year</source>
<translation>Tento rok</translation>
</message>
<message>
<source>Range...</source>
<translation>Rozsah...</translation>
</message>
<message>
<source>Received with</source>
<translation>Prijaté s</translation>
</message>
<message>
<source>Sent to</source>
<translation>Odoslané na</translation>
</message>
<message>
<source>To yourself</source>
<translation>Ku mne</translation>
</message>
<message>
<source>Mined</source>
<translation>Vyťažené</translation>
</message>
<message>
<source>Other</source>
<translation>Iné</translation>
</message>
<message>
<source>Enter address, transaction id, or label to search</source>
<translation>Pre vyhľadávanie vložte adresu, id transakcie, alebo popis.</translation>
</message>
<message>
<source>Min amount</source>
<translation>Minimálna suma</translation>
</message>
<message>
<source>Abandon transaction</source>
<translation>Zabudnúť transakciu</translation>
</message>
<message>
<source>Increase transaction fee</source>
<translation>Navíš transakčný poplatok</translation>
</message>
<message>
<source>Copy address</source>
<translation>Kopírovať adresu</translation>
</message>
<message>
<source>Copy label</source>
<translation>Kopírovať popis</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Kopírovať sumu</translation>
</message>
<message>
<source>Copy transaction ID</source>
<translation>Kopírovať ID transakcie</translation>
</message>
<message>
<source>Copy raw transaction</source>
<translation>Skopírovať neupravenú transakciu</translation>
</message>
<message>
<source>Copy full transaction details</source>
<translation>Kopírovať všetky podrobnosti o transakcii</translation>
</message>
<message>
<source>Edit label</source>
<translation>Upraviť popis</translation>
</message>
<message>
<source>Show transaction details</source>
<translation>Zobraziť podrobnosti transakcie</translation>
</message>
<message>
<source>Export Transaction History</source>
<translation>Exportovať históriu transakcií</translation>
</message>
<message>
<source>Comma separated file (*.csv)</source>
<translation>Čiarkou oddelovaný súbor (*.csv)</translation>
</message>
<message>
<source>Confirmed</source>
<translation>Potvrdené</translation>
</message>
<message>
<source>Watch-only</source>
<translation>Iba sledovanie</translation>
</message>
<message>
<source>Date</source>
<translation>Dátum</translation>
</message>
<message>
<source>Type</source>
<translation>Typ</translation>
</message>
<message>
<source>Label</source>
<translation>Popis</translation>
</message>
<message>
<source>Address</source>
<translation>Adresa</translation>
</message>
<message>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<source>Exporting Failed</source>
<translation>Export zlyhal</translation>
</message>
<message>
<source>There was an error trying to save the transaction history to %1.</source>
<translation>Vyskytla sa chyba pri pokuse o uloženie histórie transakcií do %1.</translation>
</message>
<message>
<source>Exporting Successful</source>
<translation>Export úspešný</translation>
</message>
<message>
<source>The transaction history was successfully saved to %1.</source>
<translation>História transakciá bola úspešne uložená do %1.</translation>
</message>
<message>
<source>Range:</source>
<translation>Rozsah:</translation>
</message>
<message>
<source>to</source>
<translation>do</translation>
</message>
</context>
<context>
<name>UnitDisplayStatusBarControl</name>
<message>
<source>Unit to show amounts in. Click to select another unit.</source>
<translation>Jednotka pre zobrazovanie súm. Kliknite pre zvolenie inej jednotky.</translation>
</message>
</context>
<context>
<name>WalletController</name>
<message>
<source>Close wallet</source>
<translation>Zatvoriť peňaženku</translation>
</message>
<message>
<source>Are you sure you wish to close wallet <i>%1</i>?</source>
<translation>Ste si istí, že si želáte zatvoriť peňaženku <i>%1</i>?</translation>
</message>
<message>
<source>Closing the wallet for too long can result in having to resync the entire chain if pruning is enabled.</source>
<translation>Zatvorenie peňaženky na príliš dlhú dobu môže mať za následok potrebu znova synchronizovať celý blockchain v prípade, že je aktivované redukovanie blockchainu. </translation>
</message>
</context>
<context>
<name>WalletFrame</name>
<message>
<source>No wallet has been loaded.</source>
<translation>Nie je načítaná peňaženka.</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<source>Send Coins</source>
<translation>Poslať mince</translation>
</message>
<message>
<source>Fee bump error</source>
<translation>Chyba pri navyšovaní poplatku</translation>
</message>
<message>
<source>Increasing transaction fee failed</source>
<translation>Nepodarilo sa navýšiť poplatok</translation>
</message>
<message>
<source>Do you want to increase the fee?</source>
<translation>Chceš poplatok navýšiť?</translation>
</message>
<message>
<source>Current fee:</source>
<translation>Momentálny poplatok:</translation>
</message>
<message>
<source>Increase:</source>
<translation>Navýšenie:</translation>
</message>
<message>
<source>New fee:</source>
<translation>Nový poplatok:</translation>
</message>
<message>
<source>Confirm fee bump</source>
<translation>Potvrď navýšenie poplatku</translation>
</message>
<message>
<source>Can't sign transaction.</source>
<translation>Nemôzeme podpíaať transakciu.</translation>
</message>
<message>
<source>Could not commit transaction</source>
<translation>Nemôzeme uložiť transakciu do peňaženky</translation>
</message>
<message>
<source>default wallet</source>
<translation>predvolená peňaženka</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<source>&Export</source>
<translation>&Exportovať...</translation>
</message>
<message>
<source>Export the data in the current tab to a file</source>
<translation>Exportovať dáta v aktuálnej karte do súboru</translation>
</message>
<message>
<source>Backup Wallet</source>
<translation>Zálohovanie peňaženky</translation>
</message>
<message>
<source>Wallet Data (*.dat)</source>
<translation>Dáta peňaženky (*.dat)</translation>
</message>
<message>
<source>Backup Failed</source>
<translation>Zálohovanie zlyhalo</translation>
</message>
<message>
<source>There was an error trying to save the wallet data to %1.</source>
<translation>Vyskytla sa chyba pri pokuse o uloženie dát peňaženky do %1.</translation>
</message>
<message>
<source>Backup Successful</source>
<translation>Záloha úspešná</translation>
</message>
<message>
<source>The wallet data was successfully saved to %1.</source>
<translation>Dáta peňaženky boli úspešne uložené do %1.</translation>
</message>
<message>
<source>Cancel</source>
<translation>Zrušiť</translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<source>Distributed under the MIT software license, see the accompanying file %s or %s</source>
<translation>Distribuované pod softvérovou licenciou MIT, viď sprievodný súbor %s alebo %s</translation>
</message>
<message>
<source>Prune configured below the minimum of %d MiB. Please use a higher number.</source>
<translation>Redukcia nastavená pod minimálnu hodnotu %d MiB. Prosím použite vyššiu hodnotu.</translation>
</message>
<message>
<source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>
<translation>Prerezávanie: posledná synchronizácia peňaženky prebehla pred už prerezanými dátami. Je treba previesť -reindex (v prípade prerezávacieho režimu stiahne znovu celý reťazec blokov)</translation>
</message>
<message>
<source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>
<translation>V prerezávaciom režime nie je možné reťazec blokov preskenovať. Musíte vykonať -reindex, čo znova stiahne celý reťaec blokov.</translation>
</message>
<message>
<source>Error: A fatal internal error occurred, see debug.log for details</source>
<translation>Chyba: Vyskytla sa interná chyba, pre viac informácií zobrazte debug.log</translation>
</message>
<message>
<source>Pruning blockstore...</source>
<translation>Redukovanie blockstore...</translation>
</message>
<message>
<source>Unable to start HTTP server. See debug log for details.</source>
<translation>Nepodarilo sa spustiť HTTP server. Pre viac detailov zobrazte debug log.</translation>
</message>
<message>
<source>Litecoin Core</source>
<translation>Litecoin Core</translation>
</message>
<message>
<source>The %s developers</source>
<translation>Vývojári %s</translation>
</message>
<message>
<source>Can't generate a change-address key. No keys in the internal keypool and can't generate any keys.</source>
<translation>Nie je možné vygenerovať kľúč na zmenu adresy. Nie sú dostupné žiadne kľúče a nie je možné ich ani generovať.</translation>
</message>
<message>
<source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>
<translation>Nemožné uzamknúť zložku %s. %s pravdepodobne už beží.</translation>
</message>
<message>
<source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>
<translation>Nemôžete zadať konkrétne spojenia a zároveň mať nastavený addrman pre hľadanie odchádzajúcich spojení.</translation>
</message>
<message>
<source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation>Nastala chyba pri čítaní súboru %s! Všetkz kľúče sa prečítali správne, ale dáta o transakcíách alebo záznamy v adresári môžu chýbať alebo byť nesprávne.</translation>
</message>
<message>
<source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>
<translation>Prosím skontrolujte systémový čas a dátum. Keď je váš čas nesprávny, %s nebude fungovať správne.</translation>
</message>
<message>
<source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>
<translation>Keď si myslíte, že %s je užitočný, podporte nás. Pre viac informácií o software navštívte %s.</translation>
</message>
<message>
<source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>
<translation>Databáza blokov obsahuje blok, ktorý vyzerá byť z budúcnosti. Toto môže byť spôsobené nesprávnym systémovým časom vášho počítača. Obnovujte databázu blokov len keď ste si istý, že systémový čas je nastavený správne.</translation>
</message>
<message>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation>Toto je predbežná testovacia zostava - používate na vlastné riziko - nepoužívajte na ťaženie alebo obchodné aplikácie</translation>
</message>
<message>
<source>This is the transaction fee you may discard if change is smaller than dust at this level</source>
<translation>Toto je transakčný poplatok, ktorý môžete škrtnúť, ak je zmena na tejto úrovni menšia ako prach</translation>
</message>
<message>
<source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>
<translation>Nedarí sa znovu aplikovať bloky. Budete musieť prestavať databázu použitím -reindex-chainstate.</translation>
</message>
<message>
<source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>
<translation>Nedará sa vrátiť databázu do stavu pred rozdelením. Budete musieť znovu stiahnuť celý reťaztec blokov</translation>
</message>
<message>
<source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>
<translation>Varovanie: Javí sa že sieť sieť úplne nesúhlasí! Niektorí mineri zjavne majú ťažkosti.</translation>
</message>
<message>
<source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation>Varovanie: Zjavne sa úplne nezhodujeme s našimi peer-mi! Možno potrebujete prejsť na novšiu verziu alebo ostatné uzly potrebujú vyššiu verziu.</translation>
</message>
<message>
<source>%d of last 100 blocks have unexpected version</source>
<translation>%d z poslednźých 100 blokov má neočakávanú verziu</translation>
</message>
<message>
<source>%s corrupt, salvage failed</source>
<translation>%s je poškodený, záchrana zlyhala</translation>
</message>
<message>
<source>-maxmempool must be at least %d MB</source>
<translation>-maxmempool musí byť najmenej %d MB</translation>
</message>
<message>
<source>Cannot resolve -%s address: '%s'</source>
<translation>Nedá preložiť -%s adresu: '%s'</translation>
</message>
<message>
<source>Change index out of range</source>
<translation>Menný index mimo rozsah</translation>
</message>
<message>
<source>Config setting for %s only applied on %s network when in [%s] section.</source>
<translation>Nastavenie konfigurácie pre %s platí iba v sieti %s a v sekcii [%s].</translation>
</message>
<message>
<source>Copyright (C) %i-%i</source>
<translation>Copyright (C) %i-%i</translation>
</message>
<message>
<source>Corrupted block database detected</source>
<translation>Zistená poškodená databáza blokov</translation>
</message>
<message>
<source>Do you want to rebuild the block database now?</source>
<translation>Chcete znovu zostaviť databázu blokov?</translation>
</message>
<message>
<source>Error initializing block database</source>
<translation>Chyba inicializácie databázy blokov</translation>
</message>
<message>
<source>Error initializing wallet database environment %s!</source>
<translation>Chyba spustenia databázového prostredia peňaženky %s!</translation>
</message>
<message>
<source>Error loading %s</source>
<translation>Chyba načítania %s</translation>
</message>
<message>
<source>Error loading %s: Private keys can only be disabled during creation</source>
<translation>Chyba pri načítaní %s: Súkromné kľúče môžu byť zakázané len počas vytvárania</translation>
</message>
<message>
<source>Error loading %s: Wallet corrupted</source>
<translation>Chyba načítania %s: Peňaženka je poškodená</translation>
</message>
<message>
<source>Error loading %s: Wallet requires newer version of %s</source>
<translation>Chyba načítania %s: Peňaženka vyžaduje novšiu verziu %s</translation>
</message>
<message>
<source>Error loading block database</source>
<translation>Chyba načítania databázy blokov</translation>
</message>
<message>
<source>Error opening block database</source>
<translation>Chyba otvárania databázy blokov</translation>
</message>
<message>
<source>Error: Disk space is low!</source>
<translation>Chyba: Málo miesta na disku!</translation>
</message>
<message>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>Chyba počúvania na ktoromkoľvek porte. Použi -listen=0 ak toto chcete.</translation>
</message>
<message>
<source>Failed to rescan the wallet during initialization</source>
<translation>Počas inicializácie sa nepodarila pre-skenovať peňaženka</translation>
</message>
<message>
<source>Importing...</source>
<translation>Prebieha import ...</translation>
</message>
<message>
<source>Incorrect or no genesis block found. Wrong datadir for network?</source>
<translation>Nesprávny alebo žiadny genesis blok nájdený. Nesprávny dátový priečinok alebo sieť?</translation>
</message>
<message>
<source>Initialization sanity check failed. %s is shutting down.</source>
<translation>Kontrola čistoty pri inicializácií zlyhala. %s sa vypína.</translation>
</message>
<message>
<source>Invalid amount for -%s=<amount>: '%s'</source>
<translation>Neplatná suma pre -%s=<amount>: '%s'</translation>
</message>
<message>
<source>Invalid amount for -discardfee=<amount>: '%s'</source>
<translation>Neplatná čiastka pre -discardfee=<čiastka>: '%s'</translation>
</message>
<message>
<source>Invalid amount for -fallbackfee=<amount>: '%s'</source>
<translation>Neplatná suma pre -fallbackfee=<amount>: '%s'</translation>
</message>
<message>
<source>Specified blocks directory "%s" does not exist.</source>
<translation>Zadaný adresár blokov "%s" neexistuje.</translation>
</message>
<message>
<source>Unable to create the PID file '%s': %s</source>
<translation>Nepodarilo sa vytvoriť súbor PID '%s': %s</translation>
</message>
<message>
<source>Upgrading txindex database</source>
<translation>Inovuje sa txindex databáza</translation>
</message>
<message>
<source>Loading P2P addresses...</source>
<translation>Načítavam P2P adresy…</translation>
</message>
<message>
<source>Loading banlist...</source>
<translation>Načítavam banlist...</translation>
</message>
<message>
<source>Not enough file descriptors available.</source>
<translation>Nedostatok kľúčových slov súboru.</translation>
</message>
<message>
<source>Prune cannot be configured with a negative value.</source>
<translation>Redukovanie nemôže byť nastavené na zápornú hodnotu.</translation>
</message>
<message>
<source>Prune mode is incompatible with -txindex.</source>
<translation>Redukovanie je nekompatibilné s -txindex.</translation>
</message>
<message>
<source>Replaying blocks...</source>
<translation>Znovu sa aplikujú bloky…</translation>
</message>
<message>
<source>Rewinding blocks...</source>
<translation>Vracajú sa bloky dozadu…</translation>
</message>
<message>
<source>The source code is available from %s.</source>
<translation>Zdrojový kód je dostupný z %s</translation>
</message>
<message>
<source>Transaction fee and change calculation failed</source>
<translation>Zlyhal výpočet transakčného poplatku a výdavku</translation>
</message>
<message>
<source>Unable to bind to %s on this computer. %s is probably already running.</source>
<translation>Nemožné pripojiť k %s na tomto počíťači. %s už pravdepodobne beží.</translation>
</message>
<message>
<source>Unable to generate keys</source>
<translation>Nepodarilo sa vygenerovať kľúče</translation>
</message>
<message>
<source>Unsupported logging category %s=%s.</source>
<translation>Nepodporovaná logovacia kategória %s=%s.</translation>
</message>
<message>
<source>Upgrading UTXO database</source>
<translation>Vylepšuje sa databáza neminutých výstupov (UTXO)</translation>
</message>
<message>
<source>User Agent comment (%s) contains unsafe characters.</source>
<translation>Komentár u typu klienta (%s) obsahuje riskantné znaky.</translation>
</message>
<message>
<source>Verifying blocks...</source>
<translation>Overujem bloky...</translation>
</message>
<message>
<source>Wallet needed to be rewritten: restart %s to complete</source>
<translation>Peňaženka musí byť prepísaná: pre dokončenie reštartujte %s</translation>
</message>
<message>
<source>Error: Listening for incoming connections failed (listen returned error %s)</source>
<translation>Chyba: Počúvanie prichádzajúcich spojení zlyhalo (vrátená chyba je %s)</translation>
</message>
<message>
<source>Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>
<translation>Neplatná suma pre -maxtxfee=<amount>: '%s' (aby sa transakcia nezasekla, minimálny prenosový poplatok musí byť aspoň %s)</translation>
</message>
<message>
<source>The transaction amount is too small to send after the fee has been deducted</source>
<translation>Suma je príliš malá pre odoslanie transakcie</translation>
</message>
<message>
<source>You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain</source>
<translation>K návratu k neprerezávaciemu režimu je treba prestavať databázu použitím -reindex. Tiež sa znova stiahne celý reťazec blokov</translation>
</message>
<message>
<source>Error reading from database, shutting down.</source>
<translation>Chyba pri načítaní z databázy, ukončuje sa.</translation>
</message>
<message>
<source>Error upgrading chainstate database</source>
<translation>Chyba pri vylepšení databáze reťzcov blokov</translation>
</message>
<message>
<source>Error: Disk space is low for %s</source>
<translation>Chyba: Málo miesta na disku pre %s</translation>
</message>
<message>
<source>Information</source>
<translation>Informácia</translation>
</message>
<message>
<source>Invalid -onion address or hostname: '%s'</source>
<translation>Neplatná -onion adresa alebo hostiteľ: '%s'</translation>
</message>
<message>
<source>Invalid -proxy address or hostname: '%s'</source>
<translation>Neplatná -proxy adresa alebo hostiteľ: '%s'</translation>
</message>
<message>
<source>Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s)</source>
<translation>Neplatná suma pre -paytxfee=<amount>: '%s' (musí byť aspoň %s)</translation>
</message>
<message>
<source>Invalid netmask specified in -whitelist: '%s'</source>
<translation>Nadaná neplatná netmask vo -whitelist: '%s'</translation>
</message>
<message>
<source>Need to specify a port with -whitebind: '%s'</source>
<translation>Je potrebné zadať port s -whitebind: '%s'</translation>
</message>
<message>
<source>Reducing -maxconnections from %d to %d, because of system limitations.</source>
<translation>Obmedzuje sa -maxconnections z %d na %d kvôli systémovým obmedzeniam.</translation>
</message>
<message>
<source>Section [%s] is not recognized.</source>
<translation>Sekcia [%s] nie je rozpoznaná.</translation>
</message>
<message>
<source>Signing transaction failed</source>
<translation>Podpísanie správy zlyhalo</translation>
</message>
<message>
<source>Specified -walletdir "%s" does not exist</source>
<translation>Uvedená -walletdir "%s" neexistuje</translation>
</message>
<message>
<source>Specified -walletdir "%s" is a relative path</source>
<translation>Uvedená -walletdir "%s" je relatívna cesta</translation>
</message>
<message>
<source>Specified -walletdir "%s" is not a directory</source>
<translation>Uvedený -walletdir "%s" nie je priečinok</translation>
</message>
<message>
<source>The specified config file %s does not exist
</source>
<translation>Zadaný konfiguračný súbor %s neexistuje
</translation>
</message>
<message>
<source>The transaction amount is too small to pay the fee</source>
<translation>Suma transakcie je príliš malá na zaplatenie poplatku</translation>
</message>
<message>
<source>This is experimental software.</source>
<translation>Toto je experimentálny softvér.</translation>
</message>
<message>
<source>Transaction amount too small</source>
<translation>Suma transakcie príliš malá</translation>
</message>
<message>
<source>Transaction too large for fee policy</source>
<translation>Transakcia je príliš veľká pre aktuálne podmienky poplatkov</translation>
</message>
<message>
<source>Transaction too large</source>
<translation>Transakcia príliš veľká</translation>
</message>
<message>
<source>Unable to bind to %s on this computer (bind returned error %s)</source>
<translation>Na tomto počítači sa nedá vytvoriť väzba %s (vytvorenie väzby vrátilo chybu %s)</translation>
</message>
<message>
<source>Unable to generate initial keys</source>
<translation>Nepodarilo sa vygenerovať úvodné kľúče</translation>
</message>
<message>
<source>Verifying wallet(s)...</source>
<translation>Kontrolujem peňaženku(y)…</translation>
</message>
<message>
<source>Wallet %s resides outside wallet directory %s</source>
<translation>Peňaženka %s sa nachádza mimo priečinku pre peňaženky %s </translation>
</message>
<message>
<source>Warning</source>
<translation>Upozornenie</translation>
</message>
<message>
<source>Warning: unknown new rules activated (versionbit %i)</source>
<translation>Upozornenie: aktivovaná neznáme nové pravidlá (verzový bit %i)</translation>
</message>
<message>
<source>Zapping all transactions from wallet...</source>
<translation>Zmazať všetky transakcie z peňaženky...</translation>
</message>
<message>
<source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>
<translation>-maxtxfee je nastavené veľmi vysoko! Takto vysoký poplatok môže byť zaplatebý v jednej transakcii.</translation>
</message>
<message>
<source>This is the transaction fee you may pay when fee estimates are not available.</source>
<translation>Toto je poplatok za transakciu keď odhad poplatkov ešte nie je k dispozícii.</translation>
</message>
<message>
<source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>
<translation>Tento produkt zahrňuje programy vyvinuté projektom OpenSSL pre použití v OpenSSL Toolkite %s a kryptografický program od Erika Younga a program UPnP od Thomasa Bernarda.</translation>
</message>
<message>
<source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>
<translation>Celková dĺžka verzie sieťového reťazca (%i) prekračuje maximálnu dĺžku (%i). Znížte počet a veľkosť komentárov.</translation>
</message>
<message>
<source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation>Varovanie: Peňaženka poškodená, dáta boli zachránené! Originálna %s ako %s v %s; ak váš zostatok alebo transakcie sú nesprávne, mali by ste obnoviť zálohu.</translation>
</message>
<message>
<source>%s is set very high!</source>
<translation>Hodnota %s je nastavená veľmi vysoko!</translation>
</message>
<message>
<source>Error loading wallet %s. Duplicate -wallet filename specified.</source>
<translation>Chyba pri načítaní peňaženky %s. Zadaný duplicitný názov súboru -wallet.</translation>
</message>
<message>
<source>Keypool ran out, please call keypoolrefill first</source>
<translation>Vyčerpal sa zásobník kľúčov, zavolať najskôr keypoolrefill</translation>
</message>
<message>
<source>Starting network threads...</source>
<translation>Spúšťajú sa sieťové vlákna...</translation>
</message>
<message>
<source>The wallet will avoid paying less than the minimum relay fee.</source>
<translation>Peňaženka zabráni zaplateniu menšej sumy ako je minimálny poplatok.</translation>
</message>
<message>
<source>This is the minimum transaction fee you pay on every transaction.</source>
<translation>Toto je minimálny poplatok za transakciu pri každej transakcii.</translation>
</message>
<message>
<source>This is the transaction fee you will pay if you send a transaction.</source>
<translation>Toto je poplatok za transakciu pri odoslaní transakcie.</translation>
</message>
<message>
<source>Transaction amounts must not be negative</source>
<translation>Sumy transakcií nesmú byť záporné</translation>
</message>
<message>
<source>Transaction has too long of a mempool chain</source>
<translation>Transakcia má v transakčnom zásobníku príliš dlhý reťazec</translation>
</message>
<message>
<source>Transaction must have at least one recipient</source>
<translation>Transakcia musí mať aspoň jedného príjemcu</translation>
</message>
<message>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Neznáma sieť upresnená v -onlynet: '%s'</translation>
</message>
<message>
<source>Insufficient funds</source>
<translation>Nedostatok prostriedkov</translation>
</message>
<message>
<source>Cannot upgrade a non HD split wallet without upgrading to support pre split keypool. Please use -upgradewallet=169900 or -upgradewallet with no version specified.</source>
<translation>Nie je možné vylepšiť peňaženku bez HD bez aktualizácie, ktorá podporuje delenie keypoolu. Použite prosím -upgradewallet=169900 alebo -upgradewallet bez špecifikovania verzie.</translation>
</message>
<message>
<source>Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee.</source>
<translation>Odhad poplatku sa nepodaril. Fallbackfee je zakázaný. Počkajte niekoľko blokov alebo povoľte -fallbackfee.</translation>
</message>
<message>
<source>Warning: Private keys detected in wallet {%s} with disabled private keys</source>
<translation>Upozornenie: Boli zistené súkromné kľúče v peňaženke {%s} so zakázanými súkromnými kľúčmi.</translation>
</message>
<message>
<source>Loading block index...</source>
<translation>Načítavanie zoznamu blokov...</translation>
</message>
<message>
<source>Loading wallet...</source>
<translation>Načítavam peňaženku...</translation>
</message>
<message>
<source>Cannot downgrade wallet</source>
<translation>Nie je možné prejsť na nižšiu verziu peňaženky</translation>
</message>
<message>
<source>Rescanning...</source>
<translation>Nové prehľadávanie...</translation>
</message>
<message>
<source>Done loading</source>
<translation>Dokončené načítavanie</translation>
</message>
<message>
<source>Error</source>
<translation>Chyba</translation>
</message>
</context>
</TS> | litecoin-project/litecoin | src/qt/locale/bitcoin_sk.ts | TypeScript | mit | 152,064 |
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: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AspectCore.Core")]
[assembly: AssemblyTrademark("")]
// 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("54ffb88e-6e90-4e57-886d-a8430039da23")] | AspectCore/Abstractions | src/AspectCore.Core/Properties/AssemblyInfo.cs | C# | mit | 826 |
package com.examples.meanFlight;
import java.io.IOException;
import com.main.Context;
/**
* Example Implementation of slim Map Reduce
* Generate Mean Average Ticket Price by Carrier
* @author Deepen Mehta
*
*/
public class MeanFlight {
public static void main(String[] args) throws NumberFormatException, IOException {
Context context = new Context();
context.setMapperClass(M.class);
context.setReducerClass(R.class);
context.setInputPath(args[0]);
context.setOutputPath(args[1]);
context.jobWaitCompletionTrue();
}
}
| map-reduce-ka-tadka/slim-map-reduce | src/main/java/com/examples/meanFlight/MeanFlight.java | Java | mit | 539 |
module.exports = function (app) {
app.get('/', function (req, res) {
if (req.logout) {
req.logout();
}
res.redirect('/');
});
}; | jgable/node-site | server/routes/logout.js | JavaScript | mit | 174 |
define([
"require", // require.toUrl
"./main", // to export dijit.BackgroundIframe
"dojo/_base/config",
"dojo/dom-construct", // domConstruct.create
"dojo/dom-style", // domStyle.set
"dojo/_base/lang", // lang.extend lang.hitch
"dojo/on",
"dojo/sniff" // has("ie"), has("trident"), has("quirks")
], function(require, dijit, config, domConstruct, domStyle, lang, on, has){
// module:
// dijit/BackgroundIFrame
// Flag for whether to create background iframe behind popups like Menus and Dialog.
// A background iframe is useful to prevent problems with popups appearing behind applets/pdf files,
// and is also useful on older versions of IE (IE6 and IE7) to prevent the "bleed through select" problem.
// By default, it's enabled for IE6-11, excluding Windows Phone 8.
// TODO: For 2.0, make this false by default. Also, possibly move definition to has.js so that this module can be
// conditionally required via dojo/has!bgIfame?dijit/BackgroundIframe
has.add("config-bgIframe",
(has("ie") || has("trident")) && !/IEMobile\/10\.0/.test(navigator.userAgent)); // No iframe on WP8, to match 1.9 behavior
var _frames = new function(){
// summary:
// cache of iframes
var queue = [];
this.pop = function(){
var iframe;
if(queue.length){
iframe = queue.pop();
iframe.style.display="";
}else{
// transparency needed for DialogUnderlay and for tooltips on IE (to see screen near connector)
if(has("ie") < 9){
var burl = config["dojoBlankHtmlUrl"] || require.toUrl("dojo/resources/blank.html") || "javascript:\"\"";
var html="<iframe src='" + burl + "' role='presentation'"
+ " style='position: absolute; left: 0px; top: 0px;"
+ "z-index: -1; filter:Alpha(Opacity=\"0\");'>";
iframe = document.createElement(html);
}else{
iframe = domConstruct.create("iframe");
iframe.src = 'javascript:""';
iframe.className = "dijitBackgroundIframe";
iframe.setAttribute("role", "presentation");
domStyle.set(iframe, "opacity", 0.1);
}
iframe.tabIndex = -1; // Magic to prevent iframe from getting focus on tab keypress - as style didn't work.
}
return iframe;
};
this.push = function(iframe){
iframe.style.display="none";
queue.push(iframe);
}
}();
dijit.BackgroundIframe = function(/*DomNode*/ node){
// summary:
// For IE/FF z-index shenanigans. id attribute is required.
//
// description:
// new dijit.BackgroundIframe(node).
//
// Makes a background iframe as a child of node, that fills
// area (and position) of node
if(!node.id){ throw new Error("no id"); }
if(has("config-bgIframe")){
var iframe = (this.iframe = _frames.pop());
node.appendChild(iframe);
if(has("ie")<7 || has("quirks")){
this.resize(node);
this._conn = on(node, 'resize', lang.hitch(this, "resize", node));
}else{
domStyle.set(iframe, {
width: '100%',
height: '100%'
});
}
}
};
lang.extend(dijit.BackgroundIframe, {
resize: function(node){
// summary:
// Resize the iframe so it's the same size as node.
// Needed on IE6 and IE/quirks because height:100% doesn't work right.
if(this.iframe){
domStyle.set(this.iframe, {
width: node.offsetWidth + 'px',
height: node.offsetHeight + 'px'
});
}
},
destroy: function(){
// summary:
// destroy the iframe
if(this._conn){
this._conn.remove();
this._conn = null;
}
if(this.iframe){
this.iframe.parentNode.removeChild(this.iframe);
_frames.push(this.iframe);
delete this.iframe;
}
}
});
return dijit.BackgroundIframe;
});
| sjcobb/nfl-data-muncher | nfl-data-muncher/lib/dijit/BackgroundIframe.js | JavaScript | mit | 3,629 |
module ActionPack #:nodoc:
module VERSION #:nodoc:
MAJOR = 1
MINOR = 12
TINY = 5
STRING = [MAJOR, MINOR, TINY].join('.')
end
end
| madridonrails/GastosMOR | vendor/rails/actionpack/lib/action_pack/version.rb | Ruby | mit | 155 |
const getWebpackConfig = require('./get-webpack-config');
module.exports = {
globals: {
__DEV__: false,
__PROD__: false,
__DEVSERVER__: false,
__CLIENT__: false,
__SERVER__: false,
'process.env.NODE_ENV': false
},
settings: {
'import/resolver': {
webpack: {
config: getWebpackConfig()
}
}
}
};
| unimonkiez/react-cordova-boilerplate | bin/webpack-eslint.js | JavaScript | mit | 355 |
/* Genuine Channels product.
*
* Copyright (c) 2002-2007 Dmitry Belikov. All rights reserved.
*
* This source code comes under and must be used and distributed according to the Genuine Channels license agreement.
*/
using System;
namespace Belikov.GenuineChannels.GenuineHttp
{
/// <summary>
/// Enumerates types of HTTP packet.
/// </summary>
internal enum HttpPacketType
{
/// <summary>
/// CLIENT. The usual (PIO/sender) message.
/// </summary>
Usual,
/// <summary>
/// CLIENT. The listening request (P/listener).
/// </summary>
Listening,
/// <summary>
/// CLIENT/SERVER. The request to establish a new connection and release all data previously acquired by this host.
/// </summary>
Establishing_ResetConnection,
/// <summary>
/// CLIENT/SERVER. The request to establish a connection.
/// </summary>
Establishing,
/// <summary>
/// SERVER. Server received two listener requests and this one is ignored.
/// </summary>
DoubleRequests,
/// <summary>
/// SERVER. Server repeated the response.
/// </summary>
RequestRepeated,
/// <summary>
/// SERVER. Too small or too large sequence number.
/// </summary>
Desynchronization,
/// <summary>
/// SERVER. The response to the sender's request.
/// </summary>
SenderResponse,
/// <summary>
/// SERVER. The listener request is expired.
/// </summary>
ListenerTimedOut,
/// <summary>
/// SERVER. The listener connection is manually closed.
/// </summary>
ClosedManually,
/// <summary>
/// SERVER. Error during parsing the client's request.
/// </summary>
SenderError,
/// <summary>
/// CLIENT/SERVER. Specifies undetermined state of the connection.
/// </summary>
Unkown,
}
}
| dbelikov/GenuineChannels | Genuine Channels/Sources/GenuineHttp/HttpPacketType.cs | C# | mit | 1,821 |
import { MountedToolInfo } from "../farm_designer/interfaces";
import { ToolPulloutDirection } from "farmbot/dist/resources/api_resources";
import { ToolTransformProps } from "../tools/interfaces";
export const fakeMountedToolInfo = (): MountedToolInfo => ({
name: "fake mounted tool",
pulloutDirection: ToolPulloutDirection.POSITIVE_X,
noUTM: false,
flipped: false,
});
export const fakeToolTransformProps = (): ToolTransformProps => ({
xySwap: false,
quadrant: 2,
});
| FarmBot/farmbot-web-app | frontend/__test_support__/fake_tool_info.ts | TypeScript | mit | 484 |
var urlRegexp = /^(http|udp|ftp|dht)s?:\/\//;
/**
* Returns true if str is a URL.
*
* @param {String} str
* @return {Boolean}
*/
exports.isURL = function(str) {
return urlRegexp.test(str);
};
/**
* Returns true if n is an integer.
*
* @param {Number} n
* @return {Boolean}
*/
exports.isInteger = function(n) {
return !isNaN(parseInt(n, 10));
};
/**
* Splits a path into an array, platform safe.
*
* @param {String} path
* @return {Array.<String>}
*/
exports.splitPath = function(path) {
return path.split(path.sep);
};
/**
* Returns true if part of buffer `b` beginning at `start` matches buffer `a`.
*
* @param {Buffer} a
* @param {Buffer} b
* @param {Number} start
*/
exports.buffersMatch = function(a, b, start) {
for (var i = 0, l = b.length; i < l; i++) {
if (a[start + i] !== b[i]) {
return false;
}
}
return true;
};
| studio666/node-torrent | lib/util.js | JavaScript | mit | 879 |
// Copyright 2019 The Gitea Authors.
// All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package pull
import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/structs"
"github.com/pkg/errors"
)
// MergeRequiredContextsCommitStatus returns a commit status state for given required contexts
func MergeRequiredContextsCommitStatus(commitStatuses []*models.CommitStatus, requiredContexts []string) structs.CommitStatusState {
if len(requiredContexts) == 0 {
status := models.CalcCommitStatus(commitStatuses)
if status != nil {
return status.State
}
return structs.CommitStatusSuccess
}
var returnedStatus = structs.CommitStatusSuccess
for _, ctx := range requiredContexts {
var targetStatus structs.CommitStatusState
for _, commitStatus := range commitStatuses {
if commitStatus.Context == ctx {
targetStatus = commitStatus.State
break
}
}
if targetStatus == "" {
targetStatus = structs.CommitStatusPending
commitStatuses = append(commitStatuses, &models.CommitStatus{
State: targetStatus,
Context: ctx,
Description: "Pending",
})
}
if targetStatus.NoBetterThan(returnedStatus) {
returnedStatus = targetStatus
}
}
return returnedStatus
}
// IsCommitStatusContextSuccess returns true if all required status check contexts succeed.
func IsCommitStatusContextSuccess(commitStatuses []*models.CommitStatus, requiredContexts []string) bool {
// If no specific context is required, require that last commit status is a success
if len(requiredContexts) == 0 {
status := models.CalcCommitStatus(commitStatuses)
if status == nil || status.State != structs.CommitStatusSuccess {
return false
}
return true
}
for _, ctx := range requiredContexts {
var found bool
for _, commitStatus := range commitStatuses {
if commitStatus.Context == ctx {
if commitStatus.State != structs.CommitStatusSuccess {
return false
}
found = true
break
}
}
if !found {
return false
}
}
return true
}
// IsPullCommitStatusPass returns if all required status checks PASS
func IsPullCommitStatusPass(pr *models.PullRequest) (bool, error) {
if err := pr.LoadProtectedBranch(); err != nil {
return false, errors.Wrap(err, "GetLatestCommitStatus")
}
if pr.ProtectedBranch == nil || !pr.ProtectedBranch.EnableStatusCheck {
return true, nil
}
state, err := GetPullRequestCommitStatusState(pr)
if err != nil {
return false, err
}
return state.IsSuccess(), nil
}
// GetPullRequestCommitStatusState returns pull request merged commit status state
func GetPullRequestCommitStatusState(pr *models.PullRequest) (structs.CommitStatusState, error) {
// Ensure HeadRepo is loaded
if err := pr.LoadHeadRepo(); err != nil {
return "", errors.Wrap(err, "LoadHeadRepo")
}
// check if all required status checks are successful
headGitRepo, err := git.OpenRepository(pr.HeadRepo.RepoPath())
if err != nil {
return "", errors.Wrap(err, "OpenRepository")
}
defer headGitRepo.Close()
if !headGitRepo.IsBranchExist(pr.HeadBranch) {
return "", errors.New("Head branch does not exist, can not merge")
}
sha, err := headGitRepo.GetBranchCommitID(pr.HeadBranch)
if err != nil {
return "", errors.Wrap(err, "GetBranchCommitID")
}
if err := pr.LoadBaseRepo(); err != nil {
return "", errors.Wrap(err, "LoadBaseRepo")
}
commitStatuses, err := models.GetLatestCommitStatus(pr.BaseRepo, sha, 0)
if err != nil {
return "", errors.Wrap(err, "GetLatestCommitStatus")
}
return MergeRequiredContextsCommitStatus(commitStatuses, pr.ProtectedBranch.StatusCheckContexts), nil
}
| vCaesar/gitea | services/pull/commit_status.go | GO | mit | 3,720 |
// Type definitions for parse 1.9
// Project: https://parse.com/
// Definitions by: Ullisen Media Group <http://ullisenmedia.com>, David Poetzsch-Heffter <https://github.com/dpoetzsch>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="node" />
/// <reference types="jquery" />
/// <reference types="underscore" />
declare namespace Parse {
var applicationId: string;
var javaScriptKey: string | undefined;
var masterKey: string | undefined;
var serverURL: string;
var VERSION: string;
interface SuccessOption {
success?: Function;
}
interface ErrorOption {
error?: Function;
}
interface SuccessFailureOptions extends SuccessOption, ErrorOption {
}
interface SessionTokenOption {
sessionToken?: string;
}
interface WaitOption {
/**
* Set to true to wait for the server to confirm success
* before triggering an event.
*/
wait?: boolean;
}
interface UseMasterKeyOption {
/**
* In Cloud Code and Node only, causes the Master Key to be used for this request.
*/
useMasterKey?: boolean;
}
interface ScopeOptions extends SessionTokenOption, UseMasterKeyOption {
}
interface SilentOption {
/**
* Set to true to avoid firing the event.
*/
silent?: boolean;
}
/**
* A Promise is returned by async methods as a hook to provide callbacks to be
* called when the async task is fulfilled.
*
* <p>Typical usage would be like:<pre>
* query.find().then(function(results) {
* results[0].set("foo", "bar");
* return results[0].saveAsync();
* }).then(function(result) {
* console.log("Updated " + result.id);
* });
* </pre></p>
*
* @see Parse.Promise.prototype.then
* @class
*/
interface IPromise<T> {
then<U>(resolvedCallback: (...values: T[]) => IPromise<U>, rejectedCallback?: (reason: any) => IPromise<U>): IPromise<U>;
then<U>(resolvedCallback: (...values: T[]) => U, rejectedCallback?: (reason: any) => IPromise<U>): IPromise<U>;
then<U>(resolvedCallback: (...values: T[]) => U, rejectedCallback?: (reason: any) => U): IPromise<U>;
}
class Promise<T> implements IPromise<T> {
static as<U>(resolvedValue: U): Promise<U>;
static error(error: any): Promise<any>;
static is(possiblePromise: any): Boolean;
static when(promises: IPromise<any>[]): Promise<any>;
static when(...promises: IPromise<any>[]): Promise<any>;
always(callback: Function): Promise<T>;
done(callback: Function): Promise<T>;
fail(callback: Function): Promise<T>;
reject(error: any): void;
resolve(result: any): void;
then<U>(resolvedCallback: (...values: T[]) => IPromise<U>,
rejectedCallback?: (reason: any) => IPromise<U>): IPromise<U>;
then<U>(resolvedCallback: (...values: T[]) => U,
rejectedCallback?: (reason: any) => IPromise<U>): IPromise<U>;
then<U>(resolvedCallback: (...values: T[]) => U,
rejectedCallback?: (reason: any) => U): IPromise<U>;
}
interface IBaseObject {
toJSON(): any;
}
class BaseObject implements IBaseObject {
toJSON(): any;
}
/**
* Creates a new ACL.
* If no argument is given, the ACL has no permissions for anyone.
* If the argument is a Parse.User, the ACL will have read and write
* permission for only that user.
* If the argument is any other JSON object, that object will be interpretted
* as a serialized ACL created with toJSON().
* @see Parse.Object#setACL
* @class
*
* <p>An ACL, or Access Control List can be added to any
* <code>Parse.Object</code> to restrict access to only a subset of users
* of your application.</p>
*/
class ACL extends BaseObject {
permissionsById: any;
constructor(arg1?: any);
setPublicReadAccess(allowed: boolean): void;
getPublicReadAccess(): boolean;
setPublicWriteAccess(allowed: boolean): void;
getPublicWriteAccess(): boolean;
setReadAccess(userId: User, allowed: boolean): void;
getReadAccess(userId: User): boolean;
setReadAccess(userId: string, allowed: boolean): void;
getReadAccess(userId: string): boolean;
setRoleReadAccess(role: Role, allowed: boolean): void;
setRoleReadAccess(role: string, allowed: boolean): void;
getRoleReadAccess(role: Role): boolean;
getRoleReadAccess(role: string): boolean;
setRoleWriteAccess(role: Role, allowed: boolean): void;
setRoleWriteAccess(role: string, allowed: boolean): void;
getRoleWriteAccess(role: Role): boolean;
getRoleWriteAccess(role: string): boolean;
setWriteAccess(userId: User, allowed: boolean): void;
setWriteAccess(userId: string, allowed: boolean): void;
getWriteAccess(userId: User): boolean;
getWriteAccess(userId: string): boolean;
}
/**
* A Parse.File is a local representation of a file that is saved to the Parse
* cloud.
* @class
* @param name {String} The file's name. This will be prefixed by a unique
* value once the file has finished saving. The file name must begin with
* an alphanumeric character, and consist of alphanumeric characters,
* periods, spaces, underscores, or dashes.
* @param data {Array} The data for the file, as either:
* 1. an Array of byte value Numbers, or
* 2. an Object like { base64: "..." } with a base64-encoded String.
* 3. a File object selected with a file upload control. (3) only works
* in Firefox 3.6+, Safari 6.0.2+, Chrome 7+, and IE 10+.
* For example:<pre>
* var fileUploadControl = $("#profilePhotoFileUpload")[0];
* if (fileUploadControl.files.length > 0) {
* var file = fileUploadControl.files[0];
* var name = "photo.jpg";
* var parseFile = new Parse.File(name, file);
* parseFile.save().then(function() {
* // The file has been saved to Parse.
* }, function(error) {
* // The file either could not be read, or could not be saved to Parse.
* });
* }</pre>
* @param type {String} Optional Content-Type header to use for the file. If
* this is omitted, the content type will be inferred from the name's
* extension.
*/
class File {
constructor(name: string, data: any, type?: string);
name(): string;
url(): string;
save(options?: SuccessFailureOptions): Promise<File>;
}
/**
* Creates a new GeoPoint with any of the following forms:<br>
* <pre>
* new GeoPoint(otherGeoPoint)
* new GeoPoint(30, 30)
* new GeoPoint([30, 30])
* new GeoPoint({latitude: 30, longitude: 30})
* new GeoPoint() // defaults to (0, 0)
* </pre>
* @class
*
* <p>Represents a latitude / longitude point that may be associated
* with a key in a ParseObject or used as a reference point for geo queries.
* This allows proximity-based queries on the key.</p>
*
* <p>Only one key in a class may contain a GeoPoint.</p>
*
* <p>Example:<pre>
* var point = new Parse.GeoPoint(30.0, -20.0);
* var object = new Parse.Object("PlaceObject");
* object.set("location", point);
* object.save();</pre></p>
*/
class GeoPoint extends BaseObject {
latitude: number;
longitude: number;
constructor(arg1?: any, arg2?: any);
current(options?: SuccessFailureOptions): GeoPoint;
radiansTo(point: GeoPoint): number;
kilometersTo(point: GeoPoint): number;
milesTo(point: GeoPoint): number;
}
/**
* History serves as a global router (per frame) to handle hashchange
* events or pushState, match the appropriate route, and trigger
* callbacks. You shouldn't ever have to create one of these yourself
* — you should use the reference to <code>Parse.history</code>
* that will be created for you automatically if you make use of
* Routers with routes.
* @class
*
* <p>A fork of Backbone.History, provided for your convenience. If you
* use this class, you must also include jQuery, or another library
* that provides a jQuery-compatible $ function. For more information,
* see the <a href="http://documentcloud.github.com/backbone/#History">
* Backbone documentation</a>.</p>
* <p><strong><em>Available in the client SDK only.</em></strong></p>
*/
class History {
handlers: any[];
interval: number;
fragment: string;
checkUrl(e?: any): void;
getFragment(fragment?: string, forcePushState?: boolean): string;
getHash(windowOverride: Window): string;
loadUrl(fragmentOverride: any): boolean;
navigate(fragment: string, options?: any): any;
route(route: any, callback: Function): void;
start(options: any): boolean;
stop(): void;
}
/**
* A class that is used to access all of the children of a many-to-many relationship.
* Each instance of Parse.Relation is associated with a particular parent object and key.
*/
class Relation<S extends Object = Object, T extends Object = Object> extends BaseObject {
parent: S;
key: string;
targetClassName: string;
constructor(parent?: S, key?: string);
//Adds a Parse.Object or an array of Parse.Objects to the relation.
add(object: T): void;
// Returns a Parse.Query that is limited to objects in this relation.
query(): Query<T>;
// Removes a Parse.Object or an array of Parse.Objects from this relation.
remove(object: T): void;
}
/**
* Creates a new model with defined attributes. A client id (cid) is
* automatically generated and assigned for you.
*
* <p>You won't normally call this method directly. It is recommended that
* you use a subclass of <code>Parse.Object</code> instead, created by calling
* <code>extend</code>.</p>
*
* <p>However, if you don't want to use a subclass, or aren't sure which
* subclass is appropriate, you can use this form:<pre>
* var object = new Parse.Object("ClassName");
* </pre>
* That is basically equivalent to:<pre>
* var MyClass = Parse.Object.extend("ClassName");
* var object = new MyClass();
* </pre></p>
*
* @param {Object} attributes The initial set of data to store in the object.
* @param {Object} options A set of Backbone-like options for creating the
* object. The only option currently supported is "collection".
* @see Parse.Object.extend
*
* @class
*
* <p>The fundamental unit of Parse data, which implements the Backbone Model
* interface.</p>
*/
class Object extends BaseObject {
id: string;
createdAt: Date;
updatedAt: Date;
attributes: any;
cid: string;
changed: boolean;
className: string;
constructor(className?: string, options?: any);
constructor(attributes?: string[], options?: any);
static extend(className: string, protoProps?: any, classProps?: any): any;
static fromJSON(json: any, override: boolean): any;
static fetchAll<T extends Object>(list: T[], options: SuccessFailureOptions): Promise<T[]>;
static fetchAllIfNeeded<T extends Object>(list: T[], options: SuccessFailureOptions): Promise<T[]>;
static destroyAll<T>(list: T[], options?: Object.DestroyAllOptions): Promise<T[]>;
static saveAll<T extends Object>(list: T[], options?: Object.SaveAllOptions): Promise<T[]>;
static registerSubclass<T extends Object>(className: string, clazz: new (options?: any) => T): void;
initialize(): void;
add(attr: string, item: any): this;
addUnique(attr: string, item: any): any;
change(options: any): this;
changedAttributes(diff: any): boolean;
clear(options: any): any;
clone(): this;
destroy(options?: Object.DestroyOptions): Promise<this>;
dirty(attr?: string): boolean;
dirtyKeys(): string[];
escape(attr: string): string;
existed(): boolean;
fetch(options?: Object.FetchOptions): Promise<this>;
get(attr: string): any | undefined;
getACL(): ACL | undefined;
has(attr: string): boolean;
hasChanged(attr: string): boolean;
increment(attr: string, amount?: number): any;
isValid(): boolean;
op(attr: string): any;
previous(attr: string): any;
previousAttributes(): any;
relation(attr: string): Relation<this, Object>;
remove(attr: string, item: any): any;
save(attrs?: { [key: string]: any } | null, options?: Object.SaveOptions): Promise<this>;
save(key: string, value: any, options?: Object.SaveOptions): Promise<this>;
set(key: string, value: any, options?: Object.SetOptions): boolean;
setACL(acl: ACL, options?: SuccessFailureOptions): boolean;
unset(attr: string, options?: any): any;
validate(attrs: any, options?: SuccessFailureOptions): boolean;
}
namespace Object {
interface DestroyOptions extends SuccessFailureOptions, WaitOption, ScopeOptions { }
interface DestroyAllOptions extends SuccessFailureOptions, ScopeOptions { }
interface FetchOptions extends SuccessFailureOptions, ScopeOptions { }
interface SaveOptions extends SuccessFailureOptions, SilentOption, ScopeOptions, WaitOption { }
interface SaveAllOptions extends SuccessFailureOptions, ScopeOptions { }
interface SetOptions extends ErrorOption, SilentOption {
promise?: any;
}
}
/**
* Every Parse application installed on a device registered for
* push notifications has an associated Installation object.
*/
class Installation extends Object {
badge: any;
channels: string[];
timeZone: any;
deviceType: string;
pushType: string;
installationId: string;
deviceToken: string;
channelUris: string;
appName: string;
appVersion: string;
parseVersion: string;
appIdentifier: string;
}
/**
* Creates a new instance with the given models and options. Typically, you
* will not call this method directly, but will instead make a subclass using
* <code>Parse.Collection.extend</code>.
*
* @param {Array} models An array of instances of <code>Parse.Object</code>.
*
* @param {Object} options An optional object with Backbone-style options.
* Valid options are:<ul>
* <li>model: The Parse.Object subclass that this collection contains.
* <li>query: An instance of Parse.Query to use when fetching items.
* <li>comparator: A string property name or function to sort by.
* </ul>
*
* @see Parse.Collection.extend
*
* @class
*
* <p>Provides a standard collection class for our sets of models, ordered
* or unordered. For more information, see the
* <a href="http://documentcloud.github.com/backbone/#Collection">Backbone
* documentation</a>.</p>
*/
class Collection<T> extends Events implements IBaseObject {
model: Object;
models: Object[];
query: Query<Object>;
comparator: (object: Object) => any;
constructor(models?: Object[], options?: Collection.Options);
static extend(instanceProps: any, classProps: any): any;
initialize(): void;
add(models: any[], options?: Collection.AddOptions): Collection<T>;
at(index: number): Object;
chain(): _._Chain<Collection<T>>;
fetch(options?: Collection.FetchOptions): Promise<T>;
create(model: Object, options?: Collection.CreateOptions): Object;
get(id: string): Object;
getByCid(cid: any): any;
pluck(attr: string): any[];
remove(model: any, options?: Collection.RemoveOptions): Collection<T>;
remove(models: any[], options?: Collection.RemoveOptions): Collection<T>;
reset(models: any[], options?: Collection.ResetOptions): Collection<T>;
sort(options?: Collection.SortOptions): Collection<T>;
toJSON(): any;
}
namespace Collection {
interface Options {
model?: Object;
query?: Query<Object>;
comparator?: string;
}
interface AddOptions extends SilentOption {
/**
* The index at which to add the models.
*/
at?: number;
}
interface CreateOptions extends SuccessFailureOptions, WaitOption, SilentOption, ScopeOptions {
}
interface FetchOptions extends SuccessFailureOptions, SilentOption, ScopeOptions { }
interface RemoveOptions extends SilentOption { }
interface ResetOptions extends SilentOption { }
interface SortOptions extends SilentOption { }
}
/**
* @class
*
* <p>Parse.Events is a fork of Backbone's Events module, provided for your
* convenience.</p>
*
* <p>A module that can be mixed in to any object in order to provide
* it with custom events. You may bind callback functions to an event
* with `on`, or remove these functions with `off`.
* Triggering an event fires all callbacks in the order that `on` was
* called.
*
* <pre>
* var object = {};
* _.extend(object, Parse.Events);
* object.on('expand', function(){ alert('expanded'); });
* object.trigger('expand');</pre></p>
*
* <p>For more information, see the
* <a href="http://documentcloud.github.com/backbone/#Events">Backbone
* documentation</a>.</p>
*/
class Events {
static off(events: string[], callback?: Function, context?: any): Events;
static on(events: string[], callback?: Function, context?: any): Events;
static trigger(events: string[]): Events;
static bind(): Events;
static unbind(): Events;
on(eventName: string, callback?: Function, context?: any): Events;
off(eventName?: string | null, callback?: Function | null, context?: any): Events;
trigger(eventName: string, ...args: any[]): Events;
bind(eventName: string, callback: Function, context?: any): Events;
unbind(eventName?: string, callback?: Function, context?: any): Events;
}
/**
* Creates a new parse Parse.Query for the given Parse.Object subclass.
* @param objectClass -
* An instance of a subclass of Parse.Object, or a Parse className string.
* @class
*
* <p>Parse.Query defines a query that is used to fetch Parse.Objects. The
* most common use case is finding all objects that match a query through the
* <code>find</code> method. For example, this sample code fetches all objects
* of class <code>MyClass</code>. It calls a different function depending on
* whether the fetch succeeded or not.
*
* <pre>
* var query = new Parse.Query(MyClass);
* query.find({
* success: function(results) {
* // results is an array of Parse.Object.
* },
*
* error: function(error) {
* // error is an instance of Parse.Error.
* }
* });</pre></p>
*
* <p>A Parse.Query can also be used to retrieve a single object whose id is
* known, through the get method. For example, this sample code fetches an
* object of class <code>MyClass</code> and id <code>myId</code>. It calls a
* different function depending on whether the fetch succeeded or not.
*
* <pre>
* var query = new Parse.Query(MyClass);
* query.get(myId, {
* success: function(object) {
* // object is an instance of Parse.Object.
* },
*
* error: function(object, error) {
* // error is an instance of Parse.Error.
* }
* });</pre></p>
*
* <p>A Parse.Query can also be used to count the number of objects that match
* the query without retrieving all of those objects. For example, this
* sample code counts the number of objects of the class <code>MyClass</code>
* <pre>
* var query = new Parse.Query(MyClass);
* query.count({
* success: function(number) {
* // There are number instances of MyClass.
* },
*
* error: function(error) {
* // error is an instance of Parse.Error.
* }
* });</pre></p>
*/
class Query<T extends Object = Object> extends BaseObject {
objectClass: any;
className: string;
constructor(objectClass: string);
constructor(objectClass: new(...args: any[]) => T);
static or<U extends Object>(...var_args: Query<U>[]): Query<U>;
addAscending(key: string): Query<T>;
addAscending(key: string[]): Query<T>;
addDescending(key: string): Query<T>;
addDescending(key: string[]): Query<T>;
ascending(key: string): Query<T>;
ascending(key: string[]): Query<T>;
collection(items?: Object[], options?: Collection.Options): Collection<Object>;
containedIn(key: string, values: any[]): Query<T>;
contains(key: string, substring: string): Query<T>;
containsAll(key: string, values: any[]): Query<T>;
count(options?: Query.CountOptions): Promise<number>;
descending(key: string): Query<T>;
descending(key: string[]): Query<T>;
doesNotExist(key: string): Query<T>;
doesNotMatchKeyInQuery<U extends Object>(key: string, queryKey: string, query: Query<U>): Query<T>;
doesNotMatchQuery<U extends Object>(key: string, query: Query<U>): Query<T>;
each(callback: Function, options?: Query.EachOptions): Promise<void>;
endsWith(key: string, suffix: string): Query<T>;
equalTo(key: string, value: any): Query<T>;
exists(key: string): Query<T>;
find(options?: Query.FindOptions): Promise<T[]>;
first(options?: Query.FirstOptions): Promise<T | undefined>;
get(objectId: string, options?: Query.GetOptions): Promise<T>;
greaterThan(key: string, value: any): Query<T>;
greaterThanOrEqualTo(key: string, value: any): Query<T>;
include(key: string): Query<T>;
include(keys: string[]): Query<T>;
lessThan(key: string, value: any): Query<T>;
lessThanOrEqualTo(key: string, value: any): Query<T>;
limit(n: number): Query<T>;
matches(key: string, regex: RegExp, modifiers: any): Query<T>;
matchesKeyInQuery<U extends Object>(key: string, queryKey: string, query: Query<U>): Query<T>;
matchesQuery<U extends Object>(key: string, query: Query<U>): Query<T>;
near(key: string, point: GeoPoint): Query<T>;
notContainedIn(key: string, values: any[]): Query<T>;
notEqualTo(key: string, value: any): Query<T>;
select(...keys: string[]): Query<T>;
skip(n: number): Query<T>;
startsWith(key: string, prefix: string): Query<T>;
withinGeoBox(key: string, southwest: GeoPoint, northeast: GeoPoint): Query<T>;
withinKilometers(key: string, point: GeoPoint, maxDistance: number): Query<T>;
withinMiles(key: string, point: GeoPoint, maxDistance: number): Query<T>;
withinRadians(key: string, point: GeoPoint, maxDistance: number): Query<T>;
}
namespace Query {
interface EachOptions extends SuccessFailureOptions, ScopeOptions { }
interface CountOptions extends SuccessFailureOptions, ScopeOptions { }
interface FindOptions extends SuccessFailureOptions, ScopeOptions { }
interface FirstOptions extends SuccessFailureOptions, ScopeOptions { }
interface GetOptions extends SuccessFailureOptions, ScopeOptions { }
}
/**
* Represents a Role on the Parse server. Roles represent groupings of
* Users for the purposes of granting permissions (e.g. specifying an ACL
* for an Object). Roles are specified by their sets of child users and
* child roles, all of which are granted any permissions that the parent
* role has.
*
* <p>Roles must have a name (which cannot be changed after creation of the
* role), and must specify an ACL.</p>
* @class
* A Parse.Role is a local representation of a role persisted to the Parse
* cloud.
*/
class Role extends Object {
constructor(name: string, acl: ACL);
getRoles(): Relation<Role, Role>;
getUsers(): Relation<Role, User>;
getName(): string;
setName(name: string, options?: SuccessFailureOptions): any;
}
class Config extends Object {
static get(options?: SuccessFailureOptions): Promise<Config>;
static current(): Config;
get(attr: string): any;
escape(attr: string): any;
}
class Session extends Object {
static current(): Promise<Session>;
getSessionToken(): string;
isCurrentSessionRevocable(): boolean;
}
/**
* Routers map faux-URLs to actions, and fire events when routes are
* matched. Creating a new one sets its `routes` hash, if not set statically.
* @class
*
* <p>A fork of Backbone.Router, provided for your convenience.
* For more information, see the
* <a href="http://documentcloud.github.com/backbone/#Router">Backbone
* documentation</a>.</p>
* <p><strong><em>Available in the client SDK only.</em></strong></p>
*/
class Router extends Events {
routes: Router.RouteMap;
constructor(options?: Router.Options);
static extend(instanceProps: any, classProps: any): any;
initialize(): void;
navigate(fragment: string, options?: Router.NavigateOptions): Router;
navigate(fragment: string, trigger?: boolean): Router;
route(route: string, name: string, callback: Function): Router;
}
namespace Router {
interface Options {
routes: RouteMap;
}
interface RouteMap {
[url: string]: string;
}
interface NavigateOptions {
trigger?: boolean;
}
}
/**
* @class
*
* <p>A Parse.User object is a local representation of a user persisted to the
* Parse cloud. This class is a subclass of a Parse.Object, and retains the
* same functionality of a Parse.Object, but also extends it with various
* user specific methods, like authentication, signing up, and validation of
* uniqueness.</p>
*/
class User extends Object {
static current(): User | undefined;
static signUp(username: string, password: string, attrs: any, options?: SuccessFailureOptions): Promise<User>;
static logIn(username: string, password: string, options?: SuccessFailureOptions): Promise<User>;
static logOut(): Promise<User>;
static allowCustomUserClass(isAllowed: boolean): void;
static become(sessionToken: string, options?: SuccessFailureOptions): Promise<User>;
static requestPasswordReset(email: string, options?: SuccessFailureOptions): Promise<User>;
static extend(protoProps?: any, classProps?: any): any;
signUp(attrs: any, options?: SuccessFailureOptions): Promise<this>;
logIn(options?: SuccessFailureOptions): Promise<this>;
authenticated(): boolean;
isCurrent(): boolean;
getEmail(): string | undefined;
setEmail(email: string, options?: SuccessFailureOptions): boolean;
getUsername(): string | undefined;
setUsername(username: string, options?: SuccessFailureOptions): boolean;
setPassword(password: string, options?: SuccessFailureOptions): boolean;
getSessionToken(): string;
}
/**
* Creating a Parse.View creates its initial element outside of the DOM,
* if an existing element is not provided...
* @class
*
* <p>A fork of Backbone.View, provided for your convenience. If you use this
* class, you must also include jQuery, or another library that provides a
* jQuery-compatible $ function. For more information, see the
* <a href="http://documentcloud.github.com/backbone/#View">Backbone
* documentation</a>.</p>
* <p><strong><em>Available in the client SDK only.</em></strong></p>
*/
class View<T> extends Events {
model: any;
collection: any;
id: string;
cid: string;
className: string;
tagName: string;
el: any;
$el: JQuery;
attributes: any;
constructor(options?: View.Options);
static extend(properties: any, classProperties?: any): any;
$(selector?: string): JQuery;
setElement(element: HTMLElement, delegate?: boolean): View<T>;
setElement(element: JQuery, delegate?: boolean): View<T>;
render(): View<T>;
remove(): View<T>;
make(tagName: any, attributes?: View.Attribute[], content?: any): any;
delegateEvents(events?: any): any;
undelegateEvents(): any;
}
namespace View {
interface Options {
model?: any;
collection?: any;
el?: any;
id?: string;
className?: string;
tagName?: string;
attributes?: Attribute[];
}
interface Attribute {
[attributeName: string]: string | number | boolean;
}
}
namespace Analytics {
function track(name: string, dimensions: any): Promise<any>;
}
/**
* Provides a set of utilities for using Parse with Facebook.
* @namespace
* Provides a set of utilities for using Parse with Facebook.
*/
namespace FacebookUtils {
function init(options?: any): void;
function isLinked(user: User): boolean;
function link(user: User, permissions: any, options?: SuccessFailureOptions): void;
function logIn(permissions: any, options?: SuccessFailureOptions): void;
function unlink(user: User, options?: SuccessFailureOptions): void;
}
/**
* @namespace Contains functions for calling and declaring
* <a href="/docs/cloud_code_guide#functions">cloud functions</a>.
* <p><strong><em>
* Some functions are only available from Cloud Code.
* </em></strong></p>
*/
namespace Cloud {
interface CookieOptions {
domain?: string;
expires?: Date;
httpOnly?: boolean;
maxAge?: number;
path?: string;
secure?: boolean;
}
interface HttpResponse {
buffer?: Buffer;
cookies?: any;
data?: any;
headers?: any;
status?: number;
text?: string;
}
interface JobRequest {
params: any;
}
interface JobStatus {
error?: (response: any) => void;
message?: (response: any) => void;
success?: (response: any) => void;
}
interface FunctionRequest {
installationId?: String;
master?: boolean;
params?: any;
user?: User;
}
interface FunctionResponse {
success: (response: any) => void;
error: (response: any) => void;
}
interface Cookie {
name?: string;
options?: CookieOptions;
value?: string;
}
interface TriggerRequest {
installationId?: String;
master?: boolean;
user?: User;
object: Object;
}
interface AfterSaveRequest extends TriggerRequest {}
interface AfterDeleteRequest extends TriggerRequest {}
interface BeforeDeleteRequest extends TriggerRequest {}
interface BeforeDeleteResponse extends FunctionResponse {}
interface BeforeSaveRequest extends TriggerRequest {}
interface BeforeSaveResponse extends FunctionResponse {
success: () => void;
}
function afterDelete(arg1: any, func?: (request: AfterDeleteRequest) => void): void;
function afterSave(arg1: any, func?: (request: AfterSaveRequest) => void): void;
function beforeDelete(arg1: any, func?: (request: BeforeDeleteRequest, response: BeforeDeleteResponse) => void): void;
function beforeSave(arg1: any, func?: (request: BeforeSaveRequest, response: BeforeSaveResponse) => void): void;
function define(name: string, func?: (request: FunctionRequest, response: FunctionResponse) => void): void;
function httpRequest(options: HTTPOptions): Promise<HttpResponse>;
function job(name: string, func?: (request: JobRequest, status: JobStatus) => void): HttpResponse;
function run(name: string, data?: any, options?: RunOptions): Promise<any>;
function useMasterKey(): void;
interface RunOptions extends SuccessFailureOptions, ScopeOptions { }
/**
* To use this Cloud Module in Cloud Code, you must require 'buffer' in your JavaScript file.
*
* import Buffer = require("buffer").Buffer;
*/
var HTTPOptions: new () => HTTPOptions;
interface HTTPOptions {
/**
* The body of the request.
* If it is a JSON object, then the Content-Type set in the headers must be application/x-www-form-urlencoded or application/json.
* You can also set this to a Buffer object to send raw bytes.
* If you use a Buffer, you should also set the Content-Type header explicitly to describe what these bytes represent.
*/
body?: string | Buffer | Object;
/**
* Defaults to 'false'.
*/
followRedirects?: boolean;
/**
* The headers for the request.
*/
headers?: {
[headerName: string]: string | number | boolean;
};
/**
*The method of the request (i.e GET, POST, etc).
*/
method?: string;
/**
* The query portion of the url.
*/
params?: any;
/**
* The url to send the request to.
*/
url: string;
success?: (response: any) => void;
error?: (response: any) => void;
}
}
class Error {
code: ErrorCode;
message: string;
constructor(code: ErrorCode, message: string);
}
/*
* We need to inline the codes in order to make compilation work without this type definition as dependency.
*/
const enum ErrorCode {
OTHER_CAUSE = -1,
INTERNAL_SERVER_ERROR = 1,
CONNECTION_FAILED = 100,
OBJECT_NOT_FOUND = 101,
INVALID_QUERY = 102,
INVALID_CLASS_NAME = 103,
MISSING_OBJECT_ID = 104,
INVALID_KEY_NAME = 105,
INVALID_POINTER = 106,
INVALID_JSON = 107,
COMMAND_UNAVAILABLE = 108,
NOT_INITIALIZED = 109,
INCORRECT_TYPE = 111,
INVALID_CHANNEL_NAME = 112,
PUSH_MISCONFIGURED = 115,
OBJECT_TOO_LARGE = 116,
OPERATION_FORBIDDEN = 119,
CACHE_MISS = 120,
INVALID_NESTED_KEY = 121,
INVALID_FILE_NAME = 122,
INVALID_ACL = 123,
TIMEOUT = 124,
INVALID_EMAIL_ADDRESS = 125,
MISSING_CONTENT_TYPE = 126,
MISSING_CONTENT_LENGTH = 127,
INVALID_CONTENT_LENGTH = 128,
FILE_TOO_LARGE = 129,
FILE_SAVE_ERROR = 130,
DUPLICATE_VALUE = 137,
INVALID_ROLE_NAME = 139,
EXCEEDED_QUOTA = 140,
SCRIPT_FAILED = 141,
VALIDATION_ERROR = 142,
INVALID_IMAGE_DATA = 150,
UNSAVED_FILE_ERROR = 151,
INVALID_PUSH_TIME_ERROR = 152,
FILE_DELETE_ERROR = 153,
REQUEST_LIMIT_EXCEEDED = 155,
INVALID_EVENT_NAME = 160,
USERNAME_MISSING = 200,
PASSWORD_MISSING = 201,
USERNAME_TAKEN = 202,
EMAIL_TAKEN = 203,
EMAIL_MISSING = 204,
EMAIL_NOT_FOUND = 205,
SESSION_MISSING = 206,
MUST_CREATE_USER_THROUGH_SIGNUP = 207,
ACCOUNT_ALREADY_LINKED = 208,
INVALID_SESSION_TOKEN = 209,
LINKED_ID_MISSING = 250,
INVALID_LINKED_SESSION = 251,
UNSUPPORTED_SERVICE = 252,
AGGREGATE_ERROR = 600,
FILE_READ_ERROR = 601,
X_DOMAIN_REQUEST = 602
}
/**
* @class
* A Parse.Op is an atomic operation that can be applied to a field in a
* Parse.Object. For example, calling <code>object.set("foo", "bar")</code>
* is an example of a Parse.Op.Set. Calling <code>object.unset("foo")</code>
* is a Parse.Op.Unset. These operations are stored in a Parse.Object and
* sent to the server as part of <code>object.save()</code> operations.
* Instances of Parse.Op should be immutable.
*
* You should not create subclasses of Parse.Op or instantiate Parse.Op
* directly.
*/
namespace Op {
interface BaseOperation extends IBaseObject {
objects(): any[];
}
interface Add extends BaseOperation {
}
interface AddUnique extends BaseOperation {
}
interface Increment extends IBaseObject {
amount: number;
}
interface Relation extends IBaseObject {
added(): Object[];
removed: Object[];
}
interface Set extends IBaseObject {
value(): any;
}
interface Unset extends IBaseObject {
}
}
/**
* Contains functions to deal with Push in Parse
* @name Parse.Push
* @namespace
*/
namespace Push {
function send<T>(data: PushData, options?: SendOptions): Promise<T>;
interface PushData {
channels?: string[];
push_time?: Date;
expiration_time?: Date;
expiration_interval?: number;
where?: Query<Installation>;
data?: any;
alert?: string;
badge?: string;
sound?: string;
title?: string;
}
interface SendOptions extends UseMasterKeyOption {
success?: () => void;
error?: (error: Error) => void;
}
}
/**
* Call this method first to set up your authentication tokens for Parse.
* You can get your keys from the Data Browser on parse.com.
* @param {String} applicationId Your Parse Application ID.
* @param {String} javaScriptKey (optional) Your Parse JavaScript Key (Not needed for parse-server)
* @param {String} masterKey (optional) Your Parse Master Key. (Node.js only!)
*/
function initialize(applicationId: string, javaScriptKey?: string, masterKey?: string): void;
}
declare module "parse/node" {
export = Parse;
}
declare module "parse" {
import * as parse from "parse/node";
export = parse
}
| isman-usoh/DefinitelyTyped | types/parse/index.d.ts | TypeScript | mit | 39,801 |
# encoding: utf-8
# frozen_string_literal: true
module RuboCop
module Cop
module Style
# This cop checks that comment annotation keywords are written according
# to guidelines.
class CommentAnnotation < Cop
include AnnotationComment
MSG = 'Annotation keywords like `%s` should be all upper case, ' \
'followed by a colon, and a space, ' \
'then a note describing the problem.'.freeze
MISSING_NOTE = 'Annotation comment, with keyword `%s`, ' \
'is missing a note.'.freeze
def investigate(processed_source)
processed_source.comments.each_with_index do |comment, ix|
next unless first_comment_line?(processed_source.comments, ix)
margin, first_word, colon, space, note = split_comment(comment)
next unless annotation?(comment) &&
!correct_annotation?(first_word, colon, space, note)
length = concat_length(first_word, colon, space)
add_offense(comment, annotation_range(comment, margin, length),
format(note ? MSG : MISSING_NOTE, first_word))
end
end
private
def first_comment_line?(comments, ix)
ix.zero? || comments[ix - 1].loc.line < comments[ix].loc.line - 1
end
def autocorrect(comment)
margin, first_word, colon, space, note = split_comment(comment)
return if note.nil?
length = concat_length(first_word, colon, space)
range = annotation_range(comment, margin, length)
->(corrector) { corrector.replace(range, "#{first_word.upcase}: ") }
end
def annotation_range(comment, margin, length)
start = comment.loc.expression.begin_pos + margin.length
range_between(start, start + length)
end
def concat_length(*args)
args.reduce(0) { |a, e| a + e.to_s.length }
end
def correct_annotation?(first_word, colon, space, note)
keyword?(first_word) && (colon && space && note || !colon && !note)
end
end
end
end
end
| legendetm/rubocop | lib/rubocop/cop/style/comment_annotation.rb | Ruby | mit | 2,162 |
export const API_FAIL = 'API_FAIL';
export const SAVE_TIMELINE_FAIL = 'SAVE_TIMELINE_FAIL';
| WikiEducationFoundation/WikiEduDashboard | app/assets/javascripts/constants/api.js | JavaScript | mit | 92 |
# -*- coding: utf-8 -*-
"""
pygments.styles.borland
~~~~~~~~~~~~~~~~~~~~~~~
Style similar to the style used in the Borland IDEs.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace
class BorlandStyle(Style):
"""
Style similar to the style used in the borland IDEs.
"""
default_style = ''
styles = {
Whitespace: '#bbbbbb',
Comment: 'italic #008800',
Comment.Preproc: 'noitalic #008080',
Comment.Special: 'noitalic bold',
String: '#0000FF',
String.Char: '#800080',
Number: '#0000FF',
Keyword: 'bold #000080',
Operator.Word: 'bold',
Name.Tag: 'bold #000080',
Name.Attribute: '#FF0000',
Generic.Heading: '#999999',
Generic.Subheading: '#aaaaaa',
Generic.Deleted: 'bg:#ffdddd #000000',
Generic.Inserted: 'bg:#ddffdd #000000',
Generic.Error: '#aa0000',
Generic.Emph: 'italic',
Generic.Strong: 'bold',
Generic.Prompt: '#555555',
Generic.Output: '#888888',
Generic.Traceback: '#aa0000',
Error: 'bg:#e3d2d2 #a61717'
}
| ktan2020/legacy-automation | win/Lib/site-packages/wx-3.0-msw/wx/tools/Editra/src/extern/pygments/styles/borland.py | Python | mit | 1,613 |
<?php
namespace Ratchet\Wamp;
use Ratchet\ComponentInterface;
use Ratchet\ConnectionInterface;
/**
* An extension of Ratchet\ComponentInterface to server a WAMP application
* onMessage is replaced by various types of messages for this protocol (pub/sub or rpc).
*/
interface WampServerInterface extends ComponentInterface
{
/**
* An RPC call has been received.
*
* @param \Ratchet\ConnectionInterface $conn
* @param string $id The unique ID of the RPC, required to respond to
* @param string|Topic $topic The topic to execute the call against
* @param array $params Call parameters received from the client
*/
public function onCall(ConnectionInterface $conn, $id, $topic, array $params);
/**
* A request to subscribe to a topic has been made.
*
* @param \Ratchet\ConnectionInterface $conn
* @param string|Topic $topic The topic to subscribe to
*/
public function onSubscribe(ConnectionInterface $conn, $topic);
/**
* A request to unsubscribe from a topic has been made.
*
* @param \Ratchet\ConnectionInterface $conn
* @param string|Topic $topic The topic to unsubscribe from
*/
public function onUnSubscribe(ConnectionInterface $conn, $topic);
/**
* A client is attempting to publish content to a subscribed connections on a URI.
*
* @param \Ratchet\ConnectionInterface $conn
* @param string|Topic $topic The topic the user has attempted to publish to
* @param string $event Payload of the publish
* @param array $exclude A list of session IDs the message should be excluded from (blacklist)
* @param array $eligible A list of session Ids the message should be send to (whitelist)
*/
public function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible);
}
| cnits/CnitSymfony | vendor/gos/ratchet/src/Ratchet/Wamp/WampServerInterface.php | PHP | mit | 2,045 |
<?php
/**
* @package hubzero-cms
* @copyright Copyright 2005-2019 HUBzero Foundation, LLC.
* @license http://opensource.org/licenses/MIT MIT
*/
// No direct access
defined('_HZEXEC_') or die();
$item = $this->entry->item();
if (!$this->entry->exists())
{
$this->entry->set('original', 1);
}
//tag editor
$tf = Event::trigger('hubzero.onGetMultiEntry', array(array('tags', 'tags', 'actags', '', $item->tags('string'))));
$type = 'file'; //strtolower(Request::getWord('type', $item->get('type')));
if (!$type)
{
$type = 'file';
}
if ($type && !in_array($type, array('file', 'image', 'text', 'link')))
{
$type = 'link';
}
$base = $this->member->link() . '&active=' . $this->name;
$dir = $item->get('id');
if (!$dir)
{
$dir = 'tmp' . time(); // . rand(0, 100);
}
$jbase = rtrim(Request::base(true), '/');
$this->css()
->js('jquery.fileuploader.js', 'system')
->js('fileupload.js')
->js();
?>
<?php if ($this->getError()) { ?>
<p class="error"><?php echo $this->getError(); ?></p>
<?php } ?>
<form action="<?php echo Route::url($base . '&task=post/save' . ($this->no_html ? '&no_html=' . $this->no_html : '')); ?>" method="post" id="hubForm" class="full" enctype="multipart/form-data">
<fieldset>
<legend><?php echo $item->get('id') ? ($this->entry->get('original') ? Lang::txt('PLG_MEMBERS_COLLECTIONS_EDIT_POST') : Lang::txt('PLG_MEMBERS_COLLECTIONS_EDIT_REPOST')) : Lang::txt('PLG_MEMBERS_COLLECTIONS_NEW_POST'); ?></legend>
<?php if ($this->entry->get('original')) { ?>
<div class="field-wrap">
<div class="asset-uploader">
<div class="grid">
<div class="col span-half">
<div id="ajax-uploader" data-txt-instructions="<?php echo Lang::txt('PLG_MEMBERS_COLLECTIONS_CLICK_OR_DROP_FILE'); ?>" data-action="<?php echo $jbase; ?>/index.php?option=com_collections&no_html=1&controller=media&task=upload<?php //echo &dir=$dir; ?>" data-list="<?php echo $jbase; ?>/index.php?option=com_collections&no_html=1&controller=media&task=list&dir=<?php //echo $dir; ?>">
<noscript>
<div class="form-group">
<label for="upload">
<?php echo Lang::txt('PLG_MEMBERS_COLLECTIONS_ADD_FILE'); ?>
<input type="file" name="upload" id="upload" class="form-control-file" />
</label>
</div>
</noscript>
</div>
</div><!-- / .col span-half -->
<div class="col span-half omega">
<div id="link-adder" data-base="<?php echo rtrim(Request::base(true), '/'); ?>" data-txt-delete="<?php echo Lang::txt('JACTION_DELETE'); ?>" data-txt-instructions="<?php echo Lang::txt('PLG_MEMBERS_COLLECTIONS_CLICK_TO_ADD_LINK'); ?>" data-action="<?php echo $jbase; ?>/index.php?option=com_collections&no_html=1&controller=media&task=create&dir=<?php //echo $dir; ?>" data-list="<?php echo $jbase; ?>/index.php?option=com_collections&no_html=1&controller=media&task=list&dir=<?php //echo $dir; ?>">
<noscript>
<div class="form-group">
<label for="add-link">
<?php echo Lang::txt('PLG_MEMBERS_COLLECTIONS_ADD_LINK'); ?>
<input type="text" name="assets[-1][filename]" id="add-link" class="form-control" value="http://" />
<input type="hidden" name="assets[-1][id]" value="0" />
<input type="hidden" name="assets[-1][type]" value="link" />
</label>
</div>
</noscript>
</div>
</div><!-- / .col span-half -->
</div>
</div><!-- / .asset-uploader -->
</div><!-- / .field-wrap -->
<?php } ?>
<div id="post-type-form">
<div id="post-file" class="fieldset">
<?php if ($this->entry->get('original')) { ?>
<div class="field-wrap" id="ajax-uploader-list">
<?php
$assets = $item->assets();
if ($assets->total() > 0)
{
$i = 0;
foreach ($assets as $asset)
{
?>
<p class="item-asset">
<span class="asset-handle">
</span>
<span class="asset-file">
<?php if ($asset->get('type') == 'link') { ?>
<input type="text" name="assets[<?php echo $i; ?>][filename]" size="35" value="<?php echo $this->escape(stripslashes($asset->get('filename'))); ?>" placeholder="http://" />
<?php } else { ?>
<?php echo $this->escape(stripslashes($asset->get('filename'))); ?>
<input type="hidden" name="assets[<?php echo $i; ?>][filename]" value="<?php echo $this->escape(stripslashes($asset->get('filename'))); ?>" />
<?php } ?>
</span>
<span class="asset-description">
<input type="hidden" name="assets[<?php echo $i; ?>][type]" value="<?php echo $this->escape(stripslashes($asset->get('type'))); ?>" />
<input type="hidden" name="assets[<?php echo $i; ?>][id]" value="<?php echo $this->escape($asset->get('id')); ?>" />
<a class="delete" data-id="<?php echo $this->escape($asset->get('id')); ?>" href="<?php echo Route::url($base . '&task=post/' . $this->entry->get('id') . '/edit&remove=' . $asset->get('id')); ?>" title="<?php echo Lang::txt('PLG_MEMBERS_COLLECTIONS_DELETE'); ?>">
<?php echo Lang::txt('PLG_MEMBERS_COLLECTIONS_DELETE'); ?>
</a>
<!-- <input type="text" name="assets[<?php echo $i; ?>][description]" size="35" value="<?php echo $this->escape(stripslashes($asset->get('description'))); ?>" placeholder="Brief description" /> -->
</span>
</p>
<?php
$i++;
}
}
?>
</div><!-- / .field-wrap -->
<div class="form-group">
<label for="field-title">
<?php echo Lang::txt('PLG_MEMBERS_COLLECTIONS_FIELD_TITLE'); ?>
<input type="text" name="fields[title]" id="field-title" class="form-control" value="<?php echo $this->escape(stripslashes($item->get('title'))); ?>" />
</label>
</div>
<input type="hidden" name="fields[type]" value="file" />
<?php } else { ?>
<div class="form-group">
<label for="field-title">
<?php echo Lang::txt('PLG_MEMBERS_COLLECTIONS_FIELD_TITLE'); ?>
<input type="text" name="fieldstitle" id="field-title" class="form-control disabled" disabled="disabled" value="<?php echo $this->escape(stripslashes($item->get('title'))); ?>" />
</label>
</div>
<?php } ?>
<div class="form-group">
<label for="field_description">
<?php echo Lang::txt('PLG_MEMBERS_COLLECTIONS_FIELD_DESCRIPTION'); ?>
<?php if ($this->entry->get('original')) { ?>
<?php echo $this->editor('fields[description]', $this->escape(stripslashes($item->description('raw'))), 35, 5, 'field_description', array('class' => 'form-control minimal no-footer')); ?>
<?php } else { ?>
<?php echo $this->editor('post[description]', $this->escape(stripslashes($this->entry->description('raw'))), 35, 5, 'field_description', array('class' => 'form-control minimal no-footer')); ?>
<?php } ?>
</label>
</div>
<?php if ($this->task == 'save' && !$item->get('description')) { ?>
<p class="error"><?php echo Lang::txt('PLG_MEMBERS_' . strtoupper($this->name) . '_ERROR_PROVIDE_CONTENT'); ?></p>
<?php } ?>
</div><!-- / #post-file -->
</div><!-- / #post-type-form -->
<?php if ($this->entry->get('original')) { ?>
<div class="grid">
<div class="col span6">
<?php } ?>
<?php if ($this->collections->total() > 0) { ?>
<div class="form-group">
<label for="post-collection_id">
<?php echo Lang::txt('PLG_MEMBERS_COLLECTIONS_FIELD_SELECT_COLLECTION'); ?>
<select name="post[collection_id]" id="post-collection_id" class="form-control">
<?php foreach ($this->collections as $collection) { ?>
<option value="<?php echo $this->escape($collection->get('id')); ?>"<?php if ($this->collection->get('id') == $collection->get('id')) { echo ' selected="selected"'; } ?>><?php echo $this->escape(stripslashes($collection->get('title'))); ?></option>
<?php } ?>
</select>
<span class="hint"><?php echo Lang::txt('PLG_MEMBERS_COLLECTIONS_FIELD_SELECT_COLLECTION_HINT'); ?></span>
</label>
</div>
<?php } else { ?>
<div class="form-group">
<label for="post-collection_title">
<?php echo Lang::txt('PLG_MEMBERS_COLLECTIONS_FIELD_CREATE_COLLECTION'); ?>
<input type="text" name="collection_title" id="post-collection_title" class="form-control" value="" />
<span class="hint"><?php echo Lang::txt('PLG_MEMBERS_COLLECTIONS_FIELD_CREATE_COLLECTION_HINT'); ?></span>
</label>
</div>
<?php } ?>
<?php if ($this->entry->get('original')) { ?>
</div>
<div class="col span6 omega">
<div class="form-group">
<label for="actags">
<?php echo Lang::txt('PLG_MEMBERS_' . strtoupper($this->name) . '_FIELD_TAGS'); ?>
<?php
if (count($tf) > 0) {
echo $tf[0];
} else { ?>
<input type="text" name="tags" id="actags" class="form-control" value="<?php echo $this->escape($item->tags('string')); ?>" />
<?php } ?>
<span class="hint"><?php echo Lang::txt('PLG_MEMBERS_' . strtoupper($this->name) . '_FIELD_TAGS_HINT'); ?></span>
</label>
</div>
</div>
</div>
<?php } else { ?>
<input type="hidden" name="tags" value="<?php echo $this->escape($item->tags('string')); ?>" />
<?php } ?>
</fieldset>
<input type="hidden" name="fields[id]" id="field-id" value="<?php echo $this->escape($item->get('id')); ?>" />
<input type="hidden" name="fields[created]" value="<?php echo $this->escape($item->get('created')); ?>" />
<input type="hidden" name="fields[created_by]" value="<?php echo $this->escape($item->get('created_by')); ?>" />
<input type="hidden" name="fields[dir]" id="field-dir" value="<?php echo $this->escape($dir); ?>" />
<input type="hidden" name="fields[access]" id="field-access" value="<?php echo $this->escape($item->get('access', 0)); ?>" />
<input type="hidden" name="post[id]" value="<?php echo $this->escape($this->entry->get('id')); ?>" />
<input type="hidden" name="post[item_id]" id="post-item_id" value="<?php echo $this->escape($this->entry->get('item_id')); ?>" />
<input type="hidden" name="id" value="<?php echo $this->member->get('id'); ?>" />
<input type="hidden" name="option" value="<?php echo $this->option; ?>" />
<input type="hidden" name="active" value="<?php echo $this->name; ?>" />
<input type="hidden" name="no_html" value="<?php echo $this->no_html; ?>" />
<input type="hidden" name="action" value="save" />
<?php echo Html::input('token'); ?>
<p class="submit">
<input class="btn btn-success" type="submit" value="<?php echo Lang::txt('PLG_MEMBERS_' . strtoupper($this->name) . '_SAVE'); ?>" />
<?php if ($item->get('id')) { ?>
<a class="btn btn-secondary" href="<?php echo Route::url($base . ($item->get('id') ? '&task=' . $this->collection->get('alias') : '')); ?>">
<?php echo Lang::txt('JCANCEL'); ?>
</a>
<?php } ?>
</p>
</form>
| anthonyfuentes/hubzero-cms | core/plugins/members/collections/views/post/tmpl/edit.php | PHP | mit | 10,893 |
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: table_home_blog.php 32130 2012-11-14 09:20:40Z zhengqingpeng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class table_home_blog extends discuz_table
{
public function __construct() {
$this->_table = 'home_blog';
$this->_pk = 'blogid';
parent::__construct();
}
public function fetch_by_id_idtype($id) {
if(!$id) {
return null;
}
return DB::fetch_first('SELECT * FROM %t WHERE %i', array($this->_table, DB::field('blogid', $id)));
}
public function update_dateline_by_id_idtype_uid($id, $idtype, $dateline, $uid) {
return DB::update($this->_table, array('dateline' => $dateline), DB::field($idtype, $id).' AND '.DB::field('uid', $uid));
}
public function range($start = 0, $limit = 0, $ordersc = 'DESC', $orderby = 'dateline', $friend = null, $status = null, $uid = null, $dateline = null) {
$wheresql = '1';
$wheresql .= $friend ? ' AND '.DB::field('friend', $friend) : '';
$wheresql .= $uid ? ' AND '.DB::field('uid', $uid) : '';
$wheresql .= $status ? ' AND '.DB::field('status', $status) : '';
$wheresql .= $dateline ? ' AND '.DB::field('dateline', $dateline, '>=') : '';
if(in_array($orderby, array('hot', 'dateline'))) {
$wheresql .= ' ORDER BY '.DB::order($orderby, $ordersc);
}
$wheresql .= ' '.DB::limit($start, $limit);
return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, $wheresql), $this->_pk);
}
public function fetch_all($blogid, $orderby = '', $ordersc = '', $start = 0, $limit = 0) {
if(!$blogid) {
return null;
}
$wheresql = DB::field('blogid', $blogid);
if($orderby = DB::order($orderby, $ordersc)) {
$wheresql .= ' ORDER BY '.$orderby;
}
if($limit = DB::limit($start, $limit)) {
$wheresql .= ' '.$limit;
}
return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, $wheresql), $this->_pk);
}
public function increase($blogid, $uid, $setarr) {
$sql = array();
$allowkey = array('hot', 'viewnum', 'replynum', 'favtimes', 'sharetimes');
foreach($setarr as $key => $value) {
if(($value = intval($value)) && in_array($key, $allowkey)) {
$sql[] = "`$key`=`$key`+'$value'";
}
}
$wheresql = DB::field('blogid', $blogid);
if($uid) {
$wheresql .= ' AND '.DB::field('uid', $uid);
}
if(!empty($sql)){
return DB::query('UPDATE %t SET %i WHERE %i', array($this->_table, implode(',', $sql), $wheresql));
}
}
public function update_click($blogid, $clickid, $incclick) {
$clickid = intval($clickid);
if($clickid < 1 || $clickid > 8) {
return null;
}
return DB::query('UPDATE %t SET click'.$clickid.' = click'.$clickid.'+\'%d\' WHERE blogid = %d', array($this->_table, $incclick, $blogid));
}
public function update_classid_by_classid($classid, $newclassid) {
return DB::query('UPDATE %t SET classid = %d WHERE classid = %d', array($this->_table, $newclassid, $classid));
}
public function fetch_blogid_by_subject($keyword, $limit) {
$field = "subject LIKE '%{text}%'";
if(preg_match("(AND|\+|&|\s)", $keyword) && !preg_match("(OR|\|)", $keyword)) {
$andor = ' AND ';
$keywordsrch = '1';
$keyword = preg_replace("/( AND |&| )/is", "+", $keyword);
} else {
$andor = ' OR ';
$keywordsrch = '0';
$keyword = preg_replace("/( OR |\|)/is", "+", $keyword);
}
$keyword = str_replace('*', '%', addcslashes(daddslashes($keyword), '%_'));
foreach(explode('+', $keyword) as $text) {
$text = trim($text);
if($text) {
$keywordsrch .= $andor;
$keywordsrch .= str_replace('{text}', $text, $field);
}
}
$wheresql = " ($keywordsrch)";
if($limit) {
$wheresql .= ' ORDER BY blogid DESC '.DB::limit(0, $limit);
}
return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, $wheresql), $this->_pk);
}
public function fetch_blogid_by_uid($uid, $start = 0, $limit = 0) {
if(!$uid) {
return null;
}
return DB::fetch_all('SELECT blogid FROM %t WHERE uid IN (%n) %i', array($this->_table, $uid, DB::limit($start, $limit)), $this->_pk);
}
public function fetch_all_by_uid($uid, $orderby = 'dateline', $start = 0, $limit = 0) {
if(!$uid) {
return null;
}
if($orderby = DB::order($orderby, 'DESC')) {
$order = 'ORDER BY '.$orderby;
}
return DB::fetch_all('SELECT * FROM %t WHERE uid IN (%n) %i', array($this->_table, $uid, $order.' '.DB::limit($start, $limit)), $this->_pk);
}
public function fetch_all_by_hot($hot, $orderby = 'dateline', $start = 0, $limit = 0) {
if(!$uid) {
return null;
}
if($orderby = DB::order($orderby, 'DESC')) {
$order = 'ORDER BY '.$orderby;
}
return DB::fetch_all('SELECT * FROM %t WHERE hot>=%d %i', array($this->_table, $hot, $order.' '.DB::limit($start, $limit)), $this->_pk);
}
public function count_by_catid($catid) {
return DB::result_first('SELECT COUNT(*) FROM %t WHERE catid = %d', array($this->_table, $catid));
}
public function count_by_uid($uid) {
return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid = %d', array($this->_table, $uid));
}
public function delete_by_catid($catid) {
if(!$catid) {
return null;
}
return DB::delete($this->_table, DB::field('catid', $catid));
}
public function delete_by_uid($uids) {
if(!$uids) {
return null;
}
return DB::delete($this->_table, DB::field('uid', $uids));
}
public function update_by_catid($catid, $data) {
if(empty($data) || !is_array($data) || !$catid) {
return null;
}
return DB::update($this->_table, $data, DB::field('catid', $catid));
}
public function count_uid_by_blogid($blogid) {
if(!is_array($blogid) || !$blogid) {
return null;
}
return DB::fetch_all('SELECT uid, COUNT(blogid) AS count FROM %t WHERE blogid IN (%n) GROUP BY uid', array($this->_table, $blogid));
}
public function count_all_by_search($blogid = null, $uids = null, $starttime = null, $endtime = null, $hot1 = null, $hot2 = null, $viewnum1 = null, $viewnum2 = null, $replynum1 = null, $replynum2 = null, $friend = null, $ip = null, $keywords = null, $lengthlimit = null, $classid = null, $catid = null, $subject = null, $countwithoutjoin = false, $status = null) {
return $this->fetch_all_by_search(3, $blogid, $uids, $starttime, $endtime, $hot1, $hot2, $viewnum1, $viewnum2, $replynum1, $replynum2, $friend, $ip, $keywords, $lengthlimit, null, null, 0, 0, $classid, $catid, $subject, null, $countwithoutjoin, $status);
}
public function fetch_all_by_search($fetchtype = 1, $blogid = null, $uids = null, $starttime = null, $endtime = null, $hot1 = null, $hot2 = null, $viewnum1 = null, $viewnum2 = null, $replynum1 = null, $replynum2 = null, $friend = null, $ip = null, $keywords = null, $lengthlimit = null, $orderby = null, $ordersc = null, $start = 0, $limit = 0, $classid = null, $catid = null, $subject = null, $findex = null, $countwithoutjoin = false, $status = null) {
$sql = '';
$sql .= $blogid ? ' AND b.'.DB::field('blogid', $blogid) : '';
$sql .= is_array($uids) && count($uids) > 0 ? ' AND b.'.DB::field('uid', $uids) : '';
$sql .= $starttime ? ' AND b.'.DB::field('dateline', $starttime, '>') : '';
$sql .= $endtime ? ' AND b.'.DB::field('dateline', $endtime, '<') : '';
$sql .= $hot1 ? ' AND b.'.DB::field('hot', $hot1, '>=') : '';
$sql .= $hot2 ? ' AND b.'.DB::field('hot', $hot2, '<=') : '';
$sql .= $viewnum1 ? ' AND b.'.DB::field('viewnum', $viewnum1, '>=') : '';
$sql .= $viewnum2 ? ' AND b.'.DB::field('viewnum', $viewnum1, '<=') : '';
$sql .= $replynum1 ? ' AND b.'.DB::field('replynum', $replynum1, '>=') : '';
$sql .= $replynum2 ? ' AND b.'.DB::field('replynum', $replynum2, '<=') : '';
$sql .= $classid ? ' AND b.'.DB::field('classid', $classid) : '';
$sql .= $friend ? ' AND b.'.DB::field('friend', $friend) : '';
$sql .= !is_null($status) ? ' AND b.'.DB::field('status', $status) : '';
$ip = str_replace('*', '', $ip);
if($fetchtype == 1) {
$sql .= $ip ? ' AND bf.'.DB::field('postip', "%$ip%", 'like') : '';
}
$orderby = $orderby ? $orderby : 'dateline';
$ordersc = $ordersc ? $ordersc : 'DESC';
if($fetchtype == 1 && $keywords != '' && !is_array($keywords)) {
$sqlkeywords = '';
$or = '';
$keywords = explode(',', str_replace(' ', '', $keywords));
for($i = 0; $i < count($keywords); $i++) {
$keywords[$i] = daddslashes($keywords[$i]);
if(preg_match("/\{(\d+)\}/", $keywords[$i])) {
$keywords[$i] = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($keywords[$i], '/'));
$sqlkeywords .= " $or b.subject REGEXP '".$keywords[$i]."' OR bf.message REGEXP '".$keywords[$i]."'";
} else {
$sqlkeywords .= " $or b.subject LIKE '%".$keywords[$i]."%' OR bf.message LIKE '%".$keywords[$i]."%'";
}
$or = 'OR';
}
if($sqlkeywords) {
$sql .= " AND ($sqlkeywords)";
}
}
$sql .= $subject ? ' AND b.'.DB::field('subject', "%$subject%", 'like') : '';
$sql .= $catid ? ' AND b.'.DB::field('catid', $catid) : '';
if($fetchtype == 1) {
$sql .= $lengthlimit ? ' AND LENGTH(bf.message) > '.intval($lengthlimit) : '';
}
if($fetchtype == 3) {
$selectfield = 'count(*)';
} elseif ($fetchtype == 2) {
$selectfield = 'b.blogid';
} else {
$selectfield = 'bf.*,b.*';
}
if($findex) {
$findex = 'USE INDEX(dateline)';
} else {
$findex = '';
}
if($fetchtype == 3) {
return DB::result_first("SELECT $selectfield FROM %t b ".(($countwithoutjoin === false) ? 'LEFT JOIN %t bf USING(blogid) ' : '').
"WHERE 1 %i", ($countwithoutjoin === false) ? array($this->_table, 'home_blogfield', $sql) : array($this->_table, $sql));
} else {
if($order = DB::order($orderby, $ordersc)) {
$order = 'ORDER BY b.'.$order;
} else {
$order = '';
}
return DB::fetch_all("SELECT $selectfield FROM %t b {$findex} LEFT JOIN %t bf USING(blogid) " .
"WHERE 1 %i", array($this->_table, 'home_blogfield', $sql.' '.$order.' '.DB::limit($start, $limit)));
}
}
public function fetch_all_by_block($blogids = null, $bannedids = null, $uids = null, $catid = null, $hours = null, $getpic = null, $getsummary = null, $picrequired = null, $orderby = 'dateline', $start = 0, $limit = 0) {
$wheres = array();
if($blogids) {
$wheres[] = 'b.'.DB::field('blogid', $blogids);
}
if($bannedids) {
$val = implode(',', DB::quote($bannedids));
$wheres[] = 'b.blogid NOT IN ('.$val.')';
}
if($uids) {
$wheres[] = 'b.'.DB::field('uid', $uids);
}
if($catid && !in_array('0', $catid)) {
$wheres[] = 'b.'.DB::field('catid', $catid);
}
if($hours) {
$timestamp = TIMESTAMP - 3600 * $hours;
$wheres[] = 'b.'.DB::field('dateline', $timestamp, '>=') ;
}
$tablesql = $fieldsql = '';
if($getpic || $getsummary || $picrequired) {
if($picrequired) {
$wheres[] = "bf.pic != ''";
}
$tablesql = ' LEFT JOIN '.DB::table('home_blogfield')." bf ON b.blogid = bf.blogid";
$fieldsql = ', bf.pic, b.picflag, bf.message';
}
$wheres[] = "b.friend = '0'";
$wheres[] = "b.status='0'";
$wheresql = $wheres ? implode(' AND ', $wheres) : '1';
return DB::fetch_all('SELECT b.* %i FROM %t b %i WHERE %i', array($fieldsql, $this->_table, $tablesql, $wheresql.' ORDER BY b.'.DB::order($orderby, 'DESC').' '.DB::limit($start, $limit)));
}
}
?> | zekewang918/QuitSmoking | bbs/source/class/table/table_home_blog.php | PHP | mit | 11,583 |
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: block_member.php 32370 2013-01-07 03:00:27Z zhangguosheng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class block_member extends discuz_block {
var $setting = array();
function block_member() {
$this->setting = array(
'uids' => array(
'title' => 'memberlist_uids',
'type' => 'text'
),
'groupid' => array(
'title' => 'memberlist_groupid',
'type' => 'mselect',
'value' => array()
),
'special' => array(
'title' => 'memberlist_special',
'type' => 'mradio',
'value' => array(
array('', 'memberlist_special_nolimit'),
array('0', 'memberlist_special_hot'),
array('1', 'memberlist_special_default'),
),
'default' => ''
),
'gender' => array(
'title' => 'memberlist_gender',
'type' => 'mradio',
'value' => array(
array('1', 'memberlist_gender_male'),
array('2', 'memberlist_gender_female'),
array('', 'memberlist_gender_nolimit'),
),
'default' => ''
),
'birthcity' => array(
'title' => 'memberlist_birthcity',
'type' => 'district',
'value' => array('xbirthprovince', 'xbirthcity', 'xbirthdist', 'xbirthcommunity'),
),
'residecity' => array(
'title' => 'memberlist_residecity',
'type' => 'district',
'value' => array('xresideprovince', 'xresidecity', 'xresidedist', 'xresidecommunity')
),
'avatarstatus' => array(
'title' => 'memberlist_avatarstatus',
'type' => 'radio',
'default' => ''
),
'emailstatus' => array(
'title' => 'memberlist_emailstatus',
'type' => 'mcheckbox',
'value' => array(
array(1, 'memberlist_yes'),
),
'default' => ''
),
'verifystatus' => array(
'title' => 'memberlist_verifystatus',
'type' => 'mcheckbox',
'value' => array(),
'default' => '',
),
'orderby' => array(
'title' => 'memberlist_orderby',
'type' => 'mradio',
'value' => array(
array('credits', 'memberlist_orderby_credits'),
array('extcredits', 'memberlist_orderby_extcredits'),
array('threads', 'memberlist_orderby_threads'),
array('posts', 'memberlist_orderby_posts'),
array('blogs', 'memberlist_orderby_blogs'),
array('doings', 'memberlist_orderby_doings'),
array('albums', 'memberlist_orderby_albums'),
array('sharings', 'memberlist_orderby_sharings'),
array('digestposts', 'memberlist_orderby_digestposts'),
array('regdate', 'memberlist_orderby_regdate'),
array('show', 'memberlist_orderby_show'),
array('special', 'memberlist_orderby_special'),
array('todayposts', 'memberlist_orderby_todayposts'),
),
'default' => 'credits'
),
'extcredit' => array(
'title' => 'memberlist_orderby_extcreditselect',
'type' => 'select',
'value' => array()
),
'lastpost' => array(
'title' => 'memberlist_lastpost',
'type' => 'mradio',
'value' => array(
array('', 'memberlist_lastpost_nolimit'),
array('3600', 'memberlist_lastpost_hour'),
array('86400', 'memberlist_lastpost_day'),
array('604800', 'memberlist_lastpost_week'),
array('2592000', 'memberlist_lastpost_month'),
),
'default' => ''
),
'startrow' => array(
'title' => 'memberlist_startrow',
'type' => 'text',
'default' => 0
),
);
$verifys = getglobal('setting/verify');
if(!empty($verifys)) {
foreach($verifys as $key => $value) {
if($value['title']) {
$this->setting['verifystatus']['value'][] = array($key, $value['title']);
}
}
}
if(empty($this->setting['verifystatus']['value'])) {
unset($this->setting['verifystatus']);
}
}
function name() {
return lang('blockclass', 'blockclass_member_script_member');
}
function blockclass() {
return array('member', lang('blockclass', 'blockclass_member_member'));
}
function fields() {
global $_G;
$fields = array(
'id' => array('name' => lang('blockclass', 'blockclass_field_id'), 'formtype' => 'text', 'datatype' => 'int'),
'url' => array('name' => lang('blockclass', 'blockclass_member_field_url'), 'formtype' => 'text', 'datatype' => 'string'),
'title' => array('name' => lang('blockclass', 'blockclass_member_field_title'), 'formtype' => 'title', 'datatype' => 'title'),
'avatar' => array('name' => lang('blockclass', 'blockclass_member_field_avatar'), 'formtype' => 'text', 'datatype' => 'string'),
'avatar_middle' => array('name' => lang('blockclass', 'blockclass_member_field_avatar_middle'), 'formtype' => 'text', 'datatype' => 'string'),
'avatar_big' => array('name' => lang('blockclass', 'blockclass_member_field_avatar_big'), 'formtype' => 'text', 'datatype' => 'string'),
'regdate' => array('name' => lang('blockclass', 'blockclass_member_field_regdate'), 'formtype' => 'date', 'datatype' => 'date'),
'posts' => array('name' => lang('blockclass', 'blockclass_member_field_posts'), 'formtype' => 'text', 'datatype' => 'int'),
'threads' => array('name' => lang('blockclass', 'blockclass_member_field_threads'), 'formtype' => 'text', 'datatype' => 'int'),
'digestposts' => array('name' => lang('blockclass', 'blockclass_member_field_digestposts'), 'formtype' => 'text', 'datatype' => 'int'),
'credits' => array('name' => lang('blockclass', 'blockclass_member_field_credits'), 'formtype' => 'text', 'datatype' => 'int'),
'reason' => array('name' => lang('blockclass', 'blockclass_member_field_reason'), 'formtype' => 'text', 'datatype' => 'string'),
'unitprice' => array('name' => lang('blockclass', 'blockclass_member_field_unitprice'), 'formtype' => 'text', 'datatype' => 'int'),
'showcredit' => array('name' => lang('blockclass', 'blockclass_member_field_showcredit'), 'formtype' => 'text', 'datatype' => 'int'),
'shownote' => array('name' => lang('blockclass', 'blockclass_member_field_shownote'), 'formtype' => 'text', 'datatype' => 'string'),
);
foreach($_G['setting']['extcredits'] as $key=>$value) {
$fields['extcredits'.$key] = array('name'=>$value['title'], 'formtype'=>'text', 'datatype'=>'int');
}
loadcache('profilesetting');
foreach($_G['cache']['profilesetting'] as $key=>$value) {
if($value['available']) {
$fields[$key] = array('name'=>$value['title'], 'formtype'=>'text', 'datatype'=>'string');
}
}
return $fields;
}
function getsetting() {
global $_G;
$settings = $this->setting;
if($settings['extcredit']) {
foreach($_G['setting']['extcredits'] as $id => $credit) {
$settings['extcredit']['value'][] = array($id, $credit['title']);
}
}
if($settings['groupid']) {
$settings['groupid']['value'][] = array(0, lang('portalcp', 'block_all_group'));
foreach(C::t('common_usergroup')->fetch_all_by_type(array('member', 'special')) as $value) {
$settings['groupid']['value'][] = array($value['groupid'], $value['grouptitle']);
}
}
return $settings;
}
function getdata($style, $parameter) {
global $_G;
$parameter = $this->cookparameter($parameter);
$uids = !empty($parameter['uids']) ? explode(',',$parameter['uids']) : array();
$groupid = !empty($parameter['groupid']) && !in_array(0, $parameter['groupid']) ? $parameter['groupid'] : array();
$startrow = !empty($parameter['startrow']) ? intval($parameter['startrow']) : 0;
$items = !empty($parameter['items']) ? intval($parameter['items']) : 10;
$orderby = isset($parameter['orderby']) && in_array($parameter['orderby'],array('credits', 'extcredits', 'threads', 'posts', 'digestposts', 'regdate', 'show', 'blogs', 'albums', 'doings', 'sharings', 'special', 'todayposts')) ? $parameter['orderby'] : '';
$special = isset($parameter['special']) && strlen($parameter['special']) ? intval($parameter['special']) : null;
$lastpost = !empty($parameter['lastpost']) ? intval($parameter['lastpost']) : '';
$avatarstatus = !empty($parameter['avatarstatus']) ? 1 : 0;
$emailstatus = !empty($parameter['emailstatus']) ? 1 : 0;
$verifystatus = !empty($parameter['verifystatus']) ? $parameter['verifystatus'] : array();
$profiles = array();
$profiles['gender'] = !empty($parameter['gender']) ? intval($parameter['gender']) : 0;
$profiles['resideprovince'] = !empty($parameter['xresideprovince']) ? $parameter['xresideprovince'] : '';
$profiles['residecity'] = !empty($parameter['xresidecity']) ? $parameter['xresidecity'] : '';
$profiles['residedist'] = !empty($parameter['xresidedist']) ? $parameter['xresidedist'] : '';
$profiles['residecommunity'] = !empty($parameter['xresidecommunity']) ? $parameter['xresidecommunity'] : '';
$profiles['birthprovince'] = !empty($parameter['xbirthprovince']) ? $parameter['xbirthprovince'] : '';
$profiles['birthcity'] = !empty($parameter['xbirthcity']) ? $parameter['xbirthcity'] : '';
$bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array();
$list = $todayuids = $todayposts = array();
$tables = $wheres = array();
$sqlorderby = '';
$olditems = $items;
$tables[] = DB::table('common_member').' m';
if($groupid) {
$wheres[] = 'm.groupid IN ('.dimplode($groupid).')';
}
if($bannedids) {
$wheres[] = 'm.uid NOT IN ('.dimplode($bannedids).')';
}
if($avatarstatus) {
$wheres[] = "m.avatarstatus='1'";
}
if($emailstatus) {
$wheres[] = "m.emailstatus='1'";
}
if(!empty($verifystatus)) {
$flag = false;
foreach($verifystatus as $value) {
if(isset($_G['setting']['verify'][$value])) {
$flag = true;
$wheres[] = "cmv.verify$value='1'";
}
}
if($flag) {
$tables[] = DB::table('common_member_verify').' cmv';
$wheres[] = 'cmv.uid=m.uid';
}
}
$tables[] = DB::table('common_member_count').' mc';
$wheres[] = 'mc.uid=m.uid';
foreach($profiles as $key=>$value) {
if($value) {
$tables[] = DB::table('common_member_profile').' mp';
$wheres[] = 'mp.uid=m.uid';
$wheres[] = "mp.$key='$value'";
}
}
$reason = $show = '';
if($special !== null) {
$special = in_array($special, array(-1, 0, 1)) ? $special : -1;
$tables[] = DB::table('home_specialuser').' su';
if($special != -1) {
$wheres[] = "su.status='$special'";
}
$wheres[] = 'su.uid=m.uid';
$reason = ', su.reason';
}
if($lastpost && $orderby != 'todayposts') {
$time = TIMESTAMP - $lastpost;
$tables[] = DB::table('common_member_status')." ms";
$wheres[] = "ms.uid=m.uid";
$wheres[] = "ms.lastpost>'$time'";
}
switch($orderby) {
case 'credits':
case 'regdate':
$sqlorderby = " ORDER BY m.$orderby DESC";
break;
case 'extcredits':
$extcredits = 'extcredits'.(in_array($parameter['extcredit'], range(1, 8)) ? $parameter['extcredit'] : '1');
$sqlorderby = " ORDER BY mc.$extcredits DESC";
break;
case 'threads':
case 'posts':
case 'blogs':
case 'albums':
case 'doings':
case 'sharings':
case 'digestposts':
$sqlorderby = " ORDER BY mc.$orderby DESC";
break;
case 'show':
$show = ', s.unitprice, s.credit as showcredit, s.note as shownote';
$tables[] = DB::table('home_show')." s";
$wheres[] = 's.uid=m.uid';
$sqlorderby = ' ORDER BY s.unitprice DESC, s.credit DESC';
break;
case 'special':
$sqlorderby = $special !== null ? ' ORDER BY su.displayorder, dateline DESC' : '';
break;
case 'todayposts':
$todaytime = strtotime(dgmdate(TIMESTAMP, 'Ymd'));
$inuids = $uids ? ' AND uid IN ('.dimplode($uids).')' : '';
$items = $items * 5;
$query = DB::query('SELECT uid, count(*) as sum FROM '.DB::table('common_member_action_log')."
WHERE dateline>=$todaytime AND action='".getuseraction('pid')."'$inuids GROUP BY uid ORDER BY sum DESC LIMIT $items");
while($value = DB::fetch($query)) {
$todayposts[$value['uid']] = $value['sum'];
$todayuids[] = $value['uid'];
}
if(empty($todayuids)) {
$todayuids = array(0);
}
$uids = $todayuids;
break;
}
if($uids) {
$wheres[] = 'm.uid IN ('.dimplode($uids).')';
}
$wheres[] = '(m.groupid < 4 OR m.groupid > 8)';
$tables = array_unique($tables);
$wheres = array_unique($wheres);
$tablesql = implode(',',$tables);
$wheresql = implode(' AND ',$wheres);
$query = DB::query("SELECT m.*, mc.*$reason$show FROM $tablesql WHERE $wheresql $sqlorderby LIMIT $startrow,$items");
$resultuids = array();
while($data = DB::fetch($query)){
$resultuids[] = intval($data['uid']);
$list[] = array(
'id' => $data['uid'],
'idtype' => 'uid',
'title' => $data['username'],
'url' => 'home.php?mod=space&uid='.$data['uid'],
'pic' => '',
'picflag' => 0,
'summary' => '',
'fields' => array(
'avatar' => avatar($data['uid'], 'small', true, false, false, $_G['setting']['ucenterurl']),
'avatar_middle' => avatar($data['uid'], 'middle', true, false, false, $_G['setting']['ucenterurl']),
'avatar_big' => avatar($data['uid'], 'big', true, false, false, $_G['setting']['ucenterurl']),
'credits' => $data['credits'],
'extcredits1' => $data['extcredits1'],
'extcredits2' => $data['extcredits2'],
'extcredits3' => $data['extcredits3'],
'extcredits4' => $data['extcredits4'],
'extcredits5' => $data['extcredits5'],
'extcredits6' => $data['extcredits6'],
'extcredits7' => $data['extcredits7'],
'extcredits8' => $data['extcredits8'],
'regdate' => $data['regdate'],
'posts' => empty($todayposts[$data['uid']]) ? $data['posts'] : $todayposts[$data['uid']],
'threads' => $data['threads'],
'digestposts' => $data['digestposts'],
'reason' => isset($data['reason']) ? $data['reason'] : '',
'unitprice' => isset($data['unitprice']) ? $data['unitprice'] : '',
'showcredit' => isset($data['showcredit']) ? $data['showcredit'] : '',
'shownote' => isset($data['shownote']) ? $data['shownote'] : '',
)
);
}
if($resultuids) {
include_once libfile('function/profile');
$profiles = array();
$query = DB::query('SELECT * FROM '.DB::table('common_member_profile')." WHERE uid IN (".dimplode($resultuids).")");
while($data = DB::fetch($query)) {
$profile = array();
foreach($data as $fieldid=>$fieldvalue) {
$fieldvalue = profile_show($fieldid, $data, true);
if(false !== $fieldvalue) {
$profile[$fieldid] = $fieldvalue;
}
}
$profiles[$data['uid']] = $profile;
}
for($i=0,$L=count($list); $i<$L; $i++) {
$uid = $list[$i]['id'];
if($profiles[$uid]) {
$list[$i]['fields'] = array_merge($list[$i]['fields'], $profiles[$uid]);
}
}
if(!empty($todayuids)) {
$datalist = array();
foreach($todayuids as $uid) {
foreach($list as $user) {
if($user['id'] == $uid) {
$datalist[] = $user;
break;
}
}
if(count($datalist) >= $olditems) {
break;
}
}
$list = $datalist;
}
}
return array('html' => '', 'data' => $list);
}
}
?> | zekewang918/QuitSmoking | bbs/source/class/block/member/block_member.php | PHP | mit | 15,347 |
import { Component } from '@angular/core';
import { ComponentFixture, fakeAsync, inject, TestBed, tick } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { SearchBoxComponent } from './search-box.component';
import { LocationService } from 'app/shared/location.service';
import { MockLocationService } from 'testing/location.service';
@Component({
template: '<aio-search-box (onSearch)="searchHandler($event)" (onFocus)="focusHandler($event)"></aio-search-box>'
})
class HostComponent {
searchHandler = jasmine.createSpy('searchHandler');
focusHandler = jasmine.createSpy('focusHandler');
}
describe('SearchBoxComponent', () => {
let component: SearchBoxComponent;
let host: HostComponent;
let fixture: ComponentFixture<HostComponent>;
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [ SearchBoxComponent, HostComponent ],
providers: [
{ provide: LocationService, useFactory: () => new MockLocationService('') }
]
});
});
beforeEach(() => {
fixture = TestBed.createComponent(HostComponent);
host = fixture.componentInstance;
component = fixture.debugElement.query(By.directive(SearchBoxComponent)).componentInstance;
fixture.detectChanges();
});
describe('initialisation', () => {
it('should get the current search query from the location service',
inject([LocationService], (location: MockLocationService) => fakeAsync(() => {
location.search.and.returnValue({ search: 'initial search' });
component.ngOnInit();
expect(location.search).toHaveBeenCalled();
tick(300);
expect(host.searchHandler).toHaveBeenCalledWith('initial search');
expect(component.searchBox.nativeElement.value).toEqual('initial search');
})));
});
describe('onSearch', () => {
it('should debounce by 300ms', fakeAsync(() => {
component.doSearch();
expect(host.searchHandler).not.toHaveBeenCalled();
tick(300);
expect(host.searchHandler).toHaveBeenCalled();
}));
it('should pass through the value of the input box', fakeAsync(() => {
const input = fixture.debugElement.query(By.css('input'));
input.nativeElement.value = 'some query (input)';
component.doSearch();
tick(300);
expect(host.searchHandler).toHaveBeenCalledWith('some query (input)');
}));
it('should only send events if the search value has changed', fakeAsync(() => {
const input = fixture.debugElement.query(By.css('input'));
input.nativeElement.value = 'some query';
component.doSearch();
tick(300);
expect(host.searchHandler).toHaveBeenCalledTimes(1);
component.doSearch();
tick(300);
expect(host.searchHandler).toHaveBeenCalledTimes(1);
input.nativeElement.value = 'some other query';
component.doSearch();
tick(300);
expect(host.searchHandler).toHaveBeenCalledTimes(2);
}));
});
describe('on input', () => {
it('should trigger a search', () => {
const input = fixture.debugElement.query(By.css('input'));
spyOn(component, 'doSearch');
input.triggerEventHandler('input', { });
expect(component.doSearch).toHaveBeenCalled();
});
});
describe('on keyup', () => {
it('should trigger a search', () => {
const input = fixture.debugElement.query(By.css('input'));
spyOn(component, 'doSearch');
input.triggerEventHandler('keyup', { });
expect(component.doSearch).toHaveBeenCalled();
});
});
describe('on focus', () => {
it('should trigger the onFocus event', () => {
const input = fixture.debugElement.query(By.css('input'));
input.nativeElement.value = 'some query (focus)';
input.triggerEventHandler('focus', { });
expect(host.focusHandler).toHaveBeenCalledWith('some query (focus)');
});
});
describe('on click', () => {
it('should trigger a search', () => {
const input = fixture.debugElement.query(By.css('input'));
spyOn(component, 'doSearch');
input.triggerEventHandler('click', { });
expect(component.doSearch).toHaveBeenCalled();
});
});
describe('focus', () => {
it('should set the focus to the input box', () => {
const input = fixture.debugElement.query(By.css('input'));
component.focus();
expect(document.activeElement).toBe(input.nativeElement);
});
});
});
| gjungb/angular | aio/src/app/search/search-box/search-box.component.spec.ts | TypeScript | mit | 4,431 |
/*global GLOBE, Em */
GLOBE.Top10Controller = Em.ArrayController.extend({
needs: ['application'],
relays: [],
actions: {
showRelayDetail: function(fingerprint) {
this.transitionToRoute('relayDetail', fingerprint);
}
}
}); | isislovecruft/globe | src/js/controllers/Top10Controller.js | JavaScript | mit | 266 |
require_relative '../../spec_helper'
ruby_version_is ""..."3.1" do
require_relative 'shared/determinant'
require 'matrix'
describe "Matrix#determinant" do
it_behaves_like :determinant, :determinant
end
end
| ruby/spec | library/matrix/determinant_spec.rb | Ruby | mit | 220 |
import {default as getTeam} from './getTeam'
import {default as createTeam} from './createTeam'
import {default as addUserToTeam} from './addUserToTeam'
import {default as addCollaboratorToRepo} from './addCollaboratorToRepo'
import {default as getCollaboratorsForRepo} from './getCollaboratorsForRepo'
import {default as removeUserFromOrganizations} from './removeUserFromOrganizations'
import {default as removeUserFromOrganization} from './removeUserFromOrganization'
/**
* NOTE: this service's functions are exported the way they are to enable
* certain stubbing functionality functionality for testing that relies on the
* way the module is cached and later required by dependent modules.
*/
export default {
getTeam,
createTeam,
addUserToTeam,
addCollaboratorToRepo,
getCollaboratorsForRepo,
removeUserFromOrganization,
removeUserFromOrganizations,
}
| LearnersGuild/echo | src/server/services/gitHubService/index.js | JavaScript | mit | 873 |
//
// SyncMetadataJob.cs
//
// Author:
// Ruben Vermeersch <ruben@savanne.be>
// Stephane Delcroix <sdelcroix@src.gnome.org>
//
// Copyright (C) 2007-2010 Novell, Inc.
// Copyright (C) 2010 Ruben Vermeersch
// Copyright (C) 2007-2008 Stephane Delcroix
//
// 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.
//
using System;
using Banshee.Kernel;
using Hyena;
using FSpot.Core;
using FSpot.Utils;
namespace FSpot.Jobs {
public class SyncMetadataJob : Job
{
public SyncMetadataJob (uint id, string job_options, int run_at, JobPriority job_priority, bool persistent) : this (id, job_options, DateTimeUtil.ToDateTime (run_at), job_priority, persistent)
{
}
public SyncMetadataJob (uint id, string job_options, DateTime run_at, JobPriority job_priority, bool persistent) : base (id, job_options, job_priority, run_at, persistent)
{
}
//Use THIS static method to create a job...
public static SyncMetadataJob Create (JobStore job_store, Photo photo)
{
return (SyncMetadataJob) job_store.CreatePersistent (typeof (FSpot.Jobs.SyncMetadataJob), photo.Id.ToString ());
}
protected override bool Execute ()
{
//this will add some more reactivity to the system
System.Threading.Thread.Sleep (500);
try {
Photo photo = FSpot.App.Instance.Database.Photos.Get (Convert.ToUInt32 (JobOptions));
if (photo == null)
return false;
Log.DebugFormat ("Syncing metadata to file ({0})...", photo.DefaultVersion.Uri);
WriteMetadataToImage (photo);
return true;
} catch (System.Exception e) {
Log.ErrorFormat ("Error syncing metadata to file\n{0}", e);
}
return false;
}
void WriteMetadataToImage (Photo photo)
{
Tag [] tags = photo.Tags;
string [] names = new string [tags.Length];
for (int i = 0; i < tags.Length; i++)
names [i] = tags [i].Name;
using (var metadata = Metadata.Parse (photo.DefaultVersion.Uri)) {
metadata.EnsureAvailableTags ();
var tag = metadata.ImageTag;
tag.DateTime = photo.Time;
tag.Comment = photo.Description ?? String.Empty;
tag.Keywords = names;
tag.Rating = photo.Rating;
tag.Software = Defines.PACKAGE + " version " + Defines.VERSION;
var always_sidecar = Preferences.Get<bool> (Preferences.METADATA_ALWAYS_USE_SIDECAR);
metadata.SaveSafely (photo.DefaultVersion.Uri, always_sidecar);
}
}
}
}
| Yetangitu/f-spot | src/Clients/MainApp/FSpot.Jobs/SyncMetadataJob.cs | C# | mit | 3,798 |
package com.enderio.core.common.tweaks;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class InfiniBow extends Tweak {
public InfiniBow() {
super("infinibow", "Makes bows with Infinity enchant able to be fired with no arrows in the inventory.");
}
@Override
public void load() {
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onArrowNock(ArrowNockEvent event) {
EntityPlayer player = event.entityPlayer;
ItemStack stack = player.getHeldItem();
if (player.capabilities.isCreativeMode || player.inventory.hasItem(Items.arrow)
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0) {
player.setItemInUse(stack, stack.getItem().getMaxItemUseDuration(stack));
}
event.result = stack;
event.setCanceled(true);
}
}
| HenryLoenwind/EnderCore | src/main/java/com/enderio/core/common/tweaks/InfiniBow.java | Java | cc0-1.0 | 1,261 |
/**
* Copyright (c) 2014-2016 by the respective copyright holders.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.smarthome.core.extension.sample.internal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.StringUtils;
import org.eclipse.smarthome.core.extension.Extension;
import org.eclipse.smarthome.core.extension.ExtensionService;
import org.eclipse.smarthome.core.extension.ExtensionType;
/**
* This is an implementation of an {@link ExtensionService} that can be used as a dummy service for testing the
* functionality.
* It is not meant to be used anywhere productively.
*
* @author Kai Kreuzer - Initial contribution and API
*
*/
public class SampleExtensionService implements ExtensionService {
List<ExtensionType> types = new ArrayList<>(3);
Map<String, Extension> extensions = new HashMap<>(30);
protected void activate() {
types.add(new ExtensionType("binding", "Bindings"));
types.add(new ExtensionType("ui", "User Interfaces"));
types.add(new ExtensionType("persistence", "Persistence Services"));
for (ExtensionType type : types) {
for (int i = 0; i < 10; i++) {
String id = type.getId() + Integer.toString(i);
boolean installed = Math.random() > 0.5;
String label = RandomStringUtils.randomAlphabetic(5) + " " + StringUtils.capitalize(type.getId());
String typeId = type.getId();
String version = "1.0";
Extension extension = new Extension(id, typeId, label, version, installed);
extensions.put(extension.getId(), extension);
}
}
}
protected void deactivate() {
types.clear();
extensions.clear();
}
@Override
public void install(String id) {
try {
Thread.sleep((long) (Math.random() * 10000));
Extension extension = getExtension(id, null);
extension.setInstalled(true);
} catch (InterruptedException e) {
}
}
@Override
public void uninstall(String id) {
try {
Thread.sleep((long) (Math.random() * 5000));
Extension extension = getExtension(id, null);
extension.setInstalled(false);
} catch (InterruptedException e) {
}
}
@Override
public List<Extension> getExtensions(Locale locale) {
return new ArrayList<>(extensions.values());
}
@Override
public Extension getExtension(String id, Locale locale) {
return extensions.get(id);
}
@Override
public List<ExtensionType> getTypes(Locale locale) {
return types;
}
}
| phxql/smarthome | bundles/core/org.eclipse.smarthome.core.extension.sample/src/main/java/org/eclipse/smarthome/core/extension/sample/internal/SampleExtensionService.java | Java | epl-1.0 | 3,046 |
/*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.plugin.maven.server.core.project;
import org.eclipse.che.commons.lang.Pair;
import org.eclipse.che.plugin.maven.server.MavenServerManager;
import org.eclipse.che.plugin.maven.server.MavenServerWrapper;
import org.eclipse.che.ide.maven.tools.Build;
import org.eclipse.che.ide.maven.tools.Model;
import org.eclipse.che.ide.maven.tools.Parent;
import org.eclipse.che.ide.maven.tools.Resource;
import org.eclipse.che.maven.data.MavenKey;
import org.eclipse.che.maven.data.MavenModel;
import org.eclipse.che.maven.data.MavenParent;
import org.eclipse.che.maven.data.MavenProblemType;
import org.eclipse.che.maven.data.MavenProjectProblem;
import org.eclipse.che.maven.data.MavenResource;
import org.eclipse.che.maven.server.MavenProjectInfo;
import org.eclipse.che.maven.server.MavenServerResult;
import org.eclipse.che.plugin.maven.shared.MavenAttributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.stream.Collectors;
import static org.eclipse.che.plugin.maven.shared.MavenAttributes.DEFAULT_RESOURCES_FOLDER;
import static org.eclipse.che.plugin.maven.shared.MavenAttributes.DEFAULT_SOURCE_FOLDER;
import static org.eclipse.che.plugin.maven.shared.MavenAttributes.DEFAULT_TEST_RESOURCES_FOLDER;
import static org.eclipse.che.plugin.maven.shared.MavenAttributes.DEFAULT_TEST_SOURCE_FOLDER;
/**
* @author Evgen Vidolob
*/
public class MavenModelReader {
private static final Logger LOG = LoggerFactory.getLogger(MavenModelReader.class);
public MavenModelReaderResult resolveMavenProject(File pom, MavenServerWrapper mavenServer, List<String> activeProfiles,
List<String> inactiveProfiles, MavenServerManager serverManager) {
try {
MavenServerResult resolveProject = mavenServer.resolveProject(pom, activeProfiles, inactiveProfiles);
MavenProjectInfo projectInfo = resolveProject.getProjectInfo();
if (projectInfo != null) {
return new MavenModelReaderResult(projectInfo.getMavenModel(),
projectInfo.getActiveProfiles(),
Collections.emptyList(),
resolveProject.getProblems(),
resolveProject.getUnresolvedArtifacts());
} else {
MavenModelReaderResult readMavenProject = readMavenProject(pom, serverManager);
readMavenProject.getProblems().addAll(resolveProject.getProblems());
readMavenProject.getUnresolvedArtifacts().addAll(resolveProject.getUnresolvedArtifacts());
return readMavenProject;
}
} catch (Throwable t) {
String message = t.getMessage();
LOG.info(message, t);
MavenModelReaderResult readMavenProject = readMavenProject(pom, serverManager);
if (message != null) {
readMavenProject.getProblems().add(MavenProjectProblem.newStructureProblem(pom.getPath(), message));
} else {
readMavenProject.getProblems().add(MavenProjectProblem.newSyntaxProblem(pom.getPath(), MavenProblemType.SYNTAX));
}
return readMavenProject;
}
}
public MavenModelReaderResult readMavenProject(File pom, MavenServerManager serverManager) {
Pair<ModelReadingResult, Pair<List<String>, List<String>>> readResult = readModel(pom);
MavenModel model = readResult.first.model;
model = serverManager.interpolateModel(model, pom.getParentFile());
Pair<List<String>, List<String>> profilesPair = readResult.second;
return new MavenModelReaderResult(model,
profilesPair.first,
profilesPair.first,
readResult.first.problems,
Collections.emptySet());
}
private Pair<ModelReadingResult, Pair<List<String>, List<String>>> readModel(File pom) {
ModelReadingResult readingResult = doRead(pom);
//TODO resolve parent pom and profiles
return Pair.of(readingResult, Pair.of(Collections.emptyList(), Collections.emptyList()));
}
private ModelReadingResult doRead(File pom) {
List<MavenProjectProblem> problems = new ArrayList<>();
Set<String> enabledProfiles = new HashSet<>();
MavenModel result = new MavenModel();
Model model = null;
try {
model = Model.readFrom(pom);
} catch (IOException e) {
problems.add(MavenProjectProblem.newProblem(pom.getPath(), e.getMessage(), MavenProblemType.SYNTAX));
}
if (model == null) {
result.setMavenKey(new MavenKey("unknown", "unknown", "unknown"));
result.setPackaging("jar");
return new ModelReadingResult(result, problems, enabledProfiles);
}
MavenKey parentKey;
if (model.getParent() == null) {
parentKey = new MavenKey("unknown", "unknown", "unknown");
result.setParent(new MavenParent(parentKey, "../pom.xml"));
} else {
Parent modelParent = model.getParent();
parentKey = new MavenKey(modelParent.getGroupId(), modelParent.getArtifactId(), modelParent.getVersion());
MavenParent parent =
new MavenParent(parentKey, modelParent.getRelativePath());
result.setParent(parent);
}
MavenKey mavenKey =
new MavenKey(getNotNull(model.getGroupId(), parentKey.getGroupId()), model.getArtifactId(),
getNotNull(model.getVersion(), parentKey.getVersion()));
result.setMavenKey(mavenKey);
result.setPackaging(model.getPackaging() == null ? "jar" : model.getPackaging());
result.setName(model.getName());
result.setModules(model.getModules() == null ? Collections.emptyList() : new ArrayList<>(model.getModules()));
Map<String, String> properties = model.getProperties();
Properties prop = new Properties();
if (properties != null) {
prop.putAll(properties);
}
result.setProperties(prop);
Build build = model.getBuild();
if (build == null) {
result.getBuild().setSources(Collections.singletonList(DEFAULT_SOURCE_FOLDER));
result.getBuild().setTestSources(Collections.singletonList(DEFAULT_TEST_SOURCE_FOLDER));
result.getBuild().setResources(Collections.singletonList(
new MavenResource(DEFAULT_RESOURCES_FOLDER, false, null, Collections.emptyList(), Collections.emptyList())));
result.getBuild().setTestResources(Collections.singletonList(
new MavenResource(DEFAULT_TEST_RESOURCES_FOLDER, false, null, Collections.emptyList(), Collections.emptyList())));
} else {
String sourceDirectory = build.getSourceDirectory();
if (sourceDirectory == null) {
sourceDirectory = DEFAULT_SOURCE_FOLDER;
}
String testSourceDirectory = build.getTestSourceDirectory();
if (testSourceDirectory == null) {
testSourceDirectory = DEFAULT_TEST_SOURCE_FOLDER;
}
result.getBuild().setSources(Collections.singletonList(sourceDirectory));
result.getBuild().setTestSources(Collections.singletonList(testSourceDirectory));
result.getBuild().setResources(convertResources(build.getResources()));
}
//TODO add profiles
return new ModelReadingResult(result, problems, enabledProfiles);
}
private String getNotNull(String value, String defaultValue) {
return value == null ? defaultValue : value;
}
private List<MavenResource> convertResources(List<Resource> resources) {
return resources.stream()
.map(resource -> new MavenResource(resource.getDirectory(),
resource.isFiltering(),
resource.getTargetPath(),
resource.getIncludes(),
resource.getExcludes()))
.collect(Collectors.toList());
}
private static class ModelReadingResult {
MavenModel model;
List<MavenProjectProblem> problems;
Set<String> enabledProfiles;
public ModelReadingResult(MavenModel model, List<MavenProjectProblem> problems, Set<String> enabledProfiles) {
this.model = model;
this.problems = problems;
this.enabledProfiles = enabledProfiles;
}
}
}
| kaloyan-raev/che | plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/core/project/MavenModelReader.java | Java | epl-1.0 | 9,706 |
package lambdaExpression18_in;
import java.io.IOException;
@FunctionalInterface
interface FI {
int foo(int i) throws IOException;
default FI method(FI i1) throws InterruptedException {
/*[*/if (i1 == null)
throw new InterruptedException();
return x -> {
throw new IOException();
};/*]*/
}
} | maxeler/eclipse | eclipse.jdt.ui/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/lambdaExpression18_in/A_test326.java | Java | epl-1.0 | 308 |
/**
*/
package com.ge.research.sadl.sadl.impl;
import com.ge.research.sadl.sadl.LiteralList;
import com.ge.research.sadl.sadl.LiteralValue;
import com.ge.research.sadl.sadl.SadlPackage;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Literal List</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link com.ge.research.sadl.sadl.impl.LiteralListImpl#getLiterals <em>Literals</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class LiteralListImpl extends MinimalEObjectImpl.Container implements LiteralList
{
/**
* The cached value of the '{@link #getLiterals() <em>Literals</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLiterals()
* @generated
* @ordered
*/
protected EList<LiteralValue> literals;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LiteralListImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return SadlPackage.Literals.LITERAL_LIST;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<LiteralValue> getLiterals()
{
if (literals == null)
{
literals = new EObjectContainmentEList<LiteralValue>(LiteralValue.class, this, SadlPackage.LITERAL_LIST__LITERALS);
}
return literals;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case SadlPackage.LITERAL_LIST__LITERALS:
return ((InternalEList<?>)getLiterals()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case SadlPackage.LITERAL_LIST__LITERALS:
return getLiterals();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case SadlPackage.LITERAL_LIST__LITERALS:
getLiterals().clear();
getLiterals().addAll((Collection<? extends LiteralValue>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case SadlPackage.LITERAL_LIST__LITERALS:
getLiterals().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SadlPackage.LITERAL_LIST__LITERALS:
return literals != null && !literals.isEmpty();
}
return super.eIsSet(featureID);
}
} //LiteralListImpl
| crapo/sadlos2 | com.ge.research.sadl/src-gen/com/ge/research/sadl/sadl/impl/LiteralListImpl.java | Java | epl-1.0 | 3,727 |
/*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.core.websocket;
/**
* The implementation of this interface receives WEB SOCKET messages corresponding
* to the registered protocol according to the defined mapping. The protocol must
* be mapped via MapBinder in an ordinary Guice module, for example:
*
* <pre>
* <code>
* MapBinder<String, WebSocketMessageReceiver> receivers =
* MapBinder.newMapBinder(binder(), String.class, WebSocketMessageReceiver.class);
* receivers.addBinding("protocol-name").to(CustomWebSocketMessageReceiver.class);
* </code>
* </pre>
*
* All WEB SOCKET transmissions with the protocol field equal to "protocol-name" will
* be processed with the <code>CustomWebSocketMessageReceiver</code> instance.
*
* @author Dmitry Kuleshov
*/
public interface WebSocketMessageReceiver {
void receive(String message, Integer endpointId);
}
| slemeur/che | core/che-core-api-core/src/main/java/org/eclipse/che/api/core/websocket/WebSocketMessageReceiver.java | Java | epl-1.0 | 1,407 |
/*******************************************************************************
* Copyright (c) 2010 Oak Ridge National Laboratory.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
package org.csstudio.alarm.beast.ui.globaltable;
import java.util.List;
import org.csstudio.alarm.beast.client.AlarmTreeItem;
import org.csstudio.alarm.beast.ui.ContextMenuHelper;
import org.csstudio.alarm.beast.ui.actions.AlarmPerspectiveAction;
import org.csstudio.alarm.beast.ui.globalclientmodel.GlobalAlarmModel;
import org.csstudio.alarm.beast.ui.globalclientmodel.GlobalAlarmModelListener;
import org.csstudio.ui.util.MinSizeTableColumnLayout;
import org.csstudio.utility.singlesource.SingleSourcePlugin;
import org.csstudio.utility.singlesource.UIHelper.UI;
import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.part.ViewPart;
/** Eclipse 'View' for global alarms
* @author Kay Kasemir
*/
public class GlobalAlarmTableView extends ViewPart
{
/** View ID defined in plugin.xml */
final public static String ID = "org.csstudio.alarm.beast.ui.globaltable.view"; //$NON-NLS-1$
/** Table viewer for GlobalAlarm rows */
private TableViewer table_viewer;
// ViewPart
@Override
public void createPartControl(final Composite parent)
{
table_viewer = createTable(parent);
// createTable already handles the layout of the parent and the only widget in the view
// GridLayoutFactory.swtDefaults().numColumns(2).generateLayout(parent);
// Connect to model
final GlobalAlarmModel model = GlobalAlarmModel.reference();
table_viewer.setInput(model);
final GlobalAlarmModelListener listener = new GlobalAlarmModelListener()
{
@Override
public void globalAlarmsChanged(final GlobalAlarmModel model)
{
final Table table = table_viewer.getTable();
if (table.isDisposed())
return;
table.getDisplay().asyncExec(new Runnable()
{
@Override
public void run()
{
if (! table.isDisposed())
table_viewer.refresh();
}
});
}
};
model.addListener(listener);
// Arrange to be disconnected from model
parent.addDisposeListener(new DisposeListener()
{
@Override
public void widgetDisposed(DisposeEvent e)
{
model.removeListener(listener);
model.release();
}
});
addContextMenu(table_viewer, getSite());
}
/** Add context menu
* @param table_viewer
* @param site Workbench site or <code>null</code>
*/
private void addContextMenu(final TableViewer table_viewer,
final IWorkbenchPartSite site)
{
final Table table = table_viewer.getTable();
final boolean isRcp = UI.RCP.equals(SingleSourcePlugin.getUIHelper()
.getUI());
final MenuManager manager = new MenuManager();
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(new IMenuListener()
{
@SuppressWarnings("unchecked")
@Override
public void menuAboutToShow(final IMenuManager manager)
{
// TODO 'Select configuration' action
final List<AlarmTreeItem> items =
((IStructuredSelection)table_viewer.getSelection()).toList();
new ContextMenuHelper(null, manager, table.getShell(), items, false);
manager.add(new Separator());
if(isRcp) {
manager.add(new AlarmPerspectiveAction());
manager.add(new Separator());
}
manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
});
table.setMenu(manager.createContextMenu(table));
// Allow extensions to add to the context menu
if (site != null)
site.registerContextMenu(manager, table_viewer);
}
// ViewPart
@Override
public void setFocus()
{
table_viewer.getTable().setFocus();
}
/** @param parent Parent widget
* @return Table viewer for GlobalAlarmModel
*/
private TableViewer createTable(final Composite parent)
{
// TableColumnLayout requires the TableViewer to be in its
// own Composite! For now, the 'parent' is used because there is
// no other widget in the view.
parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
final TableColumnLayout table_layout = new MinSizeTableColumnLayout(10);
parent.setLayout(table_layout);
final TableViewer table_viewer = new TableViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
final Table table = table_viewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);
createColumns(table_viewer, table_layout);
table_viewer.setContentProvider(new GlobalAlarmContentProvider());
ColumnViewerToolTipSupport.enableFor(table_viewer);
return table_viewer;
}
/** @param table_viewer {@link TableViewer} to which to add columns for GlobalAlarm display
* @param table_layout {@link TableColumnLayout} to use for column auto-sizing
*/
private void createColumns(final TableViewer table_viewer, final TableColumnLayout table_layout)
{
for (GlobalAlarmColumnInfo info : GlobalAlarmColumnInfo.values())
{
final TableViewerColumn view_col = new TableViewerColumn(table_viewer, 0);
final TableColumn col = view_col.getColumn();
col.setText(info.getTitle());
table_layout.setColumnData(col, info.getLayoutData());
col.setMoveable(true);
view_col.setLabelProvider(info.getLabelProvider());
col.addSelectionListener(new GobalAlarmColumnSortingSelector(table_viewer, col, info));
}
}
}
| ControlSystemStudio/cs-studio | applications/alarm/alarm-plugins/org.csstudio.alarm.beast.ui.globaltable/src/org/csstudio/alarm/beast/ui/globaltable/GlobalAlarmTableView.java | Java | epl-1.0 | 7,281 |
/**
* Copyright (c) 2013 itemis AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Mark Broerkens - initial API and implementation
*
*/
package org.eclipse.rmf.reqif10.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.rmf.reqif10.AttributeDefinitionDate;
import org.eclipse.rmf.reqif10.AttributeValueDate;
import org.eclipse.rmf.reqif10.DatatypeDefinitionDate;
import org.eclipse.rmf.reqif10.ReqIF10Package;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Attribute Definition Date</b></em>'. <!--
* end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.rmf.reqif10.impl.AttributeDefinitionDateImpl#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.rmf.reqif10.impl.AttributeDefinitionDateImpl#getDefaultValue <em>Default Value</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class AttributeDefinitionDateImpl extends AttributeDefinitionSimpleImpl implements AttributeDefinitionDate {
/**
* The cached value of the '{@link #getType() <em>Type</em>}' reference. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
* @see #getType()
* @generated
* @ordered
*/
protected DatatypeDefinitionDate type;
/**
* This is true if the Type reference has been set. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
protected boolean typeESet;
/**
* The cached value of the '{@link #getDefaultValue() <em>Default Value</em>}' containment reference. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #getDefaultValue()
* @generated
* @ordered
*/
protected AttributeValueDate defaultValue;
/**
* This is true if the Default Value containment reference has been set. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
* @generated
* @ordered
*/
protected boolean defaultValueESet;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected AttributeDefinitionDateImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ReqIF10Package.Literals.ATTRIBUTE_DEFINITION_DATE;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public DatatypeDefinitionDate getType() {
if (type != null && type.eIsProxy()) {
InternalEObject oldType = (InternalEObject) type;
type = (DatatypeDefinitionDate) eResolveProxy(oldType);
if (type != oldType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__TYPE, oldType, type));
}
}
return type;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public DatatypeDefinitionDate basicGetType() {
return type;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setType(DatatypeDefinitionDate newType) {
DatatypeDefinitionDate oldType = type;
type = newType;
boolean oldTypeESet = typeESet;
typeESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__TYPE, oldType, type, !oldTypeESet));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void unsetType() {
DatatypeDefinitionDate oldType = type;
boolean oldTypeESet = typeESet;
type = null;
typeESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__TYPE, oldType, null, oldTypeESet));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public boolean isSetType() {
return typeESet;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public AttributeValueDate getDefaultValue() {
return defaultValue;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public NotificationChain basicSetDefaultValue(AttributeValueDate newDefaultValue, NotificationChain msgs) {
AttributeValueDate oldDefaultValue = defaultValue;
defaultValue = newDefaultValue;
boolean oldDefaultValueESet = defaultValueESet;
defaultValueESet = true;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__DEFAULT_VALUE,
oldDefaultValue, newDefaultValue, !oldDefaultValueESet);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setDefaultValue(AttributeValueDate newDefaultValue) {
if (newDefaultValue != defaultValue) {
NotificationChain msgs = null;
if (defaultValue != null)
msgs = ((InternalEObject) defaultValue).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__DEFAULT_VALUE, null, msgs);
if (newDefaultValue != null)
msgs = ((InternalEObject) newDefaultValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__DEFAULT_VALUE, null, msgs);
msgs = basicSetDefaultValue(newDefaultValue, msgs);
if (msgs != null)
msgs.dispatch();
} else {
boolean oldDefaultValueESet = defaultValueESet;
defaultValueESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__DEFAULT_VALUE, newDefaultValue,
newDefaultValue, !oldDefaultValueESet));
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public NotificationChain basicUnsetDefaultValue(NotificationChain msgs) {
AttributeValueDate oldDefaultValue = defaultValue;
defaultValue = null;
boolean oldDefaultValueESet = defaultValueESet;
defaultValueESet = false;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.UNSET, ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__DEFAULT_VALUE,
oldDefaultValue, null, oldDefaultValueESet);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void unsetDefaultValue() {
if (defaultValue != null) {
NotificationChain msgs = null;
msgs = ((InternalEObject) defaultValue).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__DEFAULT_VALUE, null, msgs);
msgs = basicUnsetDefaultValue(msgs);
if (msgs != null)
msgs.dispatch();
} else {
boolean oldDefaultValueESet = defaultValueESet;
defaultValueESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__DEFAULT_VALUE, null, null,
oldDefaultValueESet));
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public boolean isSetDefaultValue() {
return defaultValueESet;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__DEFAULT_VALUE:
return basicUnsetDefaultValue(msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__TYPE:
if (resolve)
return getType();
return basicGetType();
case ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__DEFAULT_VALUE:
return getDefaultValue();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__TYPE:
setType((DatatypeDefinitionDate) newValue);
return;
case ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__DEFAULT_VALUE:
setDefaultValue((AttributeValueDate) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__TYPE:
unsetType();
return;
case ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__DEFAULT_VALUE:
unsetDefaultValue();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__TYPE:
return isSetType();
case ReqIF10Package.ATTRIBUTE_DEFINITION_DATE__DEFAULT_VALUE:
return isSetDefaultValue();
}
return super.eIsSet(featureID);
}
} // AttributeDefinitionDateImpl
| ModelWriter/Demonstrations | org.eclipse.rmf.reqif10/src/org/eclipse/rmf/reqif10/impl/AttributeDefinitionDateImpl.java | Java | epl-1.0 | 9,651 |
/******************************************************************************
* Copyright (C) 2006-2011 IFS Institute for Software and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Original authors:
* Dennis Hunziker
* Ueli Kistler
* Reto Schuettel
* Robin Stocker
* Contributors:
* Fabio Zadrozny <fabiofz@gmail.com> - initial implementation
******************************************************************************/
/*
* Copyright (C) 2006, 2007 Dennis Hunziker, Ueli Kistler
* Copyright (C) 2007 Reto Schuettel, Robin Stocker
*
* IFS Institute for Software, HSR Rapperswil, Switzerland
*
*/
package org.python.pydev.refactoring.ast.adapters;
import org.python.pydev.parser.jython.SimpleNode;
public interface IASTNodeAdapter<T extends SimpleNode> extends INodeAdapter {
T getASTNode();
SimpleNode getASTParent();
String getNodeBodyIndent();
int getNodeFirstLine(boolean considerDecorators);
int getNodeIndent();
int getNodeLastLine();
AbstractNodeAdapter<? extends SimpleNode> getParent();
SimpleNode getParentNode();
boolean isModule();
ModuleAdapter getModule();
}
| fabioz/Pydev | plugins/org.python.pydev.refactoring/src/org/python/pydev/refactoring/ast/adapters/IASTNodeAdapter.java | Java | epl-1.0 | 1,369 |
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.wst.jsdt.internal.ui.text.template.contentassist;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.text.IInformationControl;
import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.jface.text.IInformationControlCreatorExtension;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.wst.jsdt.internal.ui.text.java.hover.SourceViewerInformationControl;
final public class TemplateInformationControlCreator implements IInformationControlCreator, IInformationControlCreatorExtension {
private SourceViewerInformationControl fControl;
/**
* The orientation to be used by this hover.
* Allowed values are: SWT#RIGHT_TO_LEFT or SWT#LEFT_TO_RIGHT
*
*/
private int fOrientation;
/**
* @param orientation the orientation, allowed values are: SWT#RIGHT_TO_LEFT or SWT#LEFT_TO_RIGHT
*/
public TemplateInformationControlCreator(int orientation) {
Assert.isLegal(orientation == SWT.RIGHT_TO_LEFT || orientation == SWT.LEFT_TO_RIGHT);
fOrientation= orientation;
}
/*
* @see org.eclipse.jface.text.IInformationControlCreator#createInformationControl(org.eclipse.swt.widgets.Shell)
*/
public IInformationControl createInformationControl(Shell parent) {
fControl= new SourceViewerInformationControl(parent, SWT.TOOL | fOrientation, SWT.NONE);
fControl.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
fControl= null;
}
});
return fControl;
}
/*
* @see org.eclipse.jface.text.IInformationControlCreatorExtension#canReuse(org.eclipse.jface.text.IInformationControl)
*/
public boolean canReuse(IInformationControl control) {
return fControl == control && fControl != null;
}
/*
* @see org.eclipse.jface.text.IInformationControlCreatorExtension#canReplace(org.eclipse.jface.text.IInformationControlCreator)
*/
public boolean canReplace(IInformationControlCreator creator) {
return (creator != null && getClass() == creator.getClass());
}
}
| boniatillo-com/PhaserEditor | source/thirdparty/jsdt/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/template/contentassist/TemplateInformationControlCreator.java | Java | epl-1.0 | 2,654 |
/*******************************************************************************
* Copyright (c) 2008 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Actuate Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.birt.report.engine.emitter.config.postscript;
import org.eclipse.birt.report.engine.api.IPDFRenderOption;
import org.eclipse.birt.report.engine.api.IPostscriptRenderOption;
import org.eclipse.birt.report.engine.api.IRenderOption;
import org.eclipse.birt.report.engine.api.RenderOption;
import org.eclipse.birt.report.engine.emitter.config.AbstractConfigurableOptionObserver;
import org.eclipse.birt.report.engine.emitter.config.AbstractEmitterDescriptor;
import org.eclipse.birt.report.engine.emitter.config.ConfigurableOption;
import org.eclipse.birt.report.engine.emitter.config.IConfigurableOption;
import org.eclipse.birt.report.engine.emitter.config.IConfigurableOptionObserver;
import org.eclipse.birt.report.engine.emitter.config.IOptionValue;
import org.eclipse.birt.report.engine.emitter.config.OptionValue;
import org.eclipse.birt.report.engine.emitter.config.postscript.i18n.Messages;
import org.eclipse.birt.report.engine.emitter.postscript.PostscriptRenderOption;
/**
* This class is a descriptor of postscript emitter.
*/
public class PostscriptEmitterDescriptor extends AbstractEmitterDescriptor
{
private static final String FONT_SUBSTITUTION = "FontSubstitution";
private static final String BIDI_PROCESSING = "BIDIProcessing";
private static final String TEXT_WRAPPING = "TextWrapping";
private static final String CHART_DPI = "ChartDpi";
protected void initOptions( )
{
loadDefaultValues( "org.eclipse.birt.report.engine.emitter.config.postscript" );
// Initializes the option for BIDIProcessing.
ConfigurableOption bidiProcessing = new ConfigurableOption(
BIDI_PROCESSING );
bidiProcessing
.setDisplayName( getMessage( "OptionDisplayValue.BidiProcessing" ) ); //$NON-NLS-1$
bidiProcessing.setDataType( IConfigurableOption.DataType.BOOLEAN );
bidiProcessing.setDisplayType( IConfigurableOption.DisplayType.CHECKBOX );
bidiProcessing.setDefaultValue( Boolean.TRUE );
bidiProcessing.setToolTip( null );
bidiProcessing
.setDescription( getMessage( "OptionDescription.BidiProcessing" ) ); //$NON-NLS-1$
// Initializes the option for TextWrapping.
ConfigurableOption textWrapping = new ConfigurableOption( TEXT_WRAPPING );
textWrapping
.setDisplayName( getMessage( "OptionDisplayValue.TextWrapping" ) ); //$NON-NLS-1$
textWrapping.setDataType( IConfigurableOption.DataType.BOOLEAN );
textWrapping.setDisplayType( IConfigurableOption.DisplayType.CHECKBOX );
textWrapping.setDefaultValue( Boolean.TRUE );
textWrapping.setToolTip( null );
textWrapping
.setDescription( getMessage( "OptionDescription.TextWrapping" ) ); //$NON-NLS-1$
// Initializes the option for fontSubstitution.
ConfigurableOption fontSubstitution = new ConfigurableOption(
FONT_SUBSTITUTION );
fontSubstitution
.setDisplayName( getMessage( "OptionDisplayValue.FontSubstitution" ) );
fontSubstitution.setDataType( IConfigurableOption.DataType.BOOLEAN );
fontSubstitution
.setDisplayType( IConfigurableOption.DisplayType.CHECKBOX );
fontSubstitution.setDefaultValue( Boolean.TRUE );
fontSubstitution.setToolTip( null );
fontSubstitution
.setDescription( getMessage( "OptionDescription.FontSubstitution" ) ); //$NON-NLS-1$
// Initializes the option for PageOverFlow.
ConfigurableOption pageOverFlow = new ConfigurableOption(
IPDFRenderOption.PAGE_OVERFLOW );
pageOverFlow
.setDisplayName( getMessage( "OptionDisplayValue.PageOverFlow" ) ); //$NON-NLS-1$
pageOverFlow.setDataType( IConfigurableOption.DataType.INTEGER );
pageOverFlow.setDisplayType( IConfigurableOption.DisplayType.COMBO );
pageOverFlow
.setChoices( new OptionValue[]{
new OptionValue(
IPDFRenderOption.CLIP_CONTENT,
getMessage( "OptionDisplayValue.CLIP_CONTENT" ) ), //$NON-NLS-1$
new OptionValue(
IPDFRenderOption.FIT_TO_PAGE_SIZE,
getMessage( "OptionDisplayValue.FIT_TO_PAGE_SIZE" ) ), //$NON-NLS-1$
new OptionValue(
IPDFRenderOption.OUTPUT_TO_MULTIPLE_PAGES,
getMessage( "OptionDisplayValue.OUTPUT_TO_MULTIPLE_PAGES" ) ), //$NON-NLS-1$
new OptionValue(
IPDFRenderOption.ENLARGE_PAGE_SIZE,
getMessage( "OptionDisplayValue.ENLARGE_PAGE_SIZE" ) ) //$NON-NLS-1$
} );
pageOverFlow.setDefaultValue( IPDFRenderOption.CLIP_CONTENT );
pageOverFlow.setToolTip( null );
pageOverFlow
.setDescription( getMessage( "OptionDescription.PageOverFlow" ) ); //$NON-NLS-1$
// Initializes the option for copies.
ConfigurableOption copies = new ConfigurableOption(
PostscriptRenderOption.OPTION_COPIES );
copies.setDisplayName( getMessage( "OptionDisplayValue.Copies" ) ); //$NON-NLS-1$
copies.setDataType( IConfigurableOption.DataType.INTEGER );
copies.setDisplayType( IConfigurableOption.DisplayType.TEXT );
copies.setDefaultValue( 1 );
copies.setToolTip( null );
copies.setDescription( getMessage( "OptionDescription.Copies" ) ); //$NON-NLS-1$
// Initializes the option for collate.
ConfigurableOption collate = new ConfigurableOption(
PostscriptRenderOption.OPTION_COLLATE );
collate.setDisplayName( getMessage( "OptionDisplayValue.Collate" ) ); //$NON-NLS-1$
collate.setDataType( IConfigurableOption.DataType.BOOLEAN );
collate.setDisplayType( IConfigurableOption.DisplayType.CHECKBOX );
collate.setDefaultValue( Boolean.FALSE );
collate.setToolTip( null );
collate.setDescription( getMessage( "OptionDescription.Collate" ) ); //$NON-NLS-1$
// Initializes the option for duplex.
ConfigurableOption duplex = new ConfigurableOption(
PostscriptRenderOption.OPTION_DUPLEX );
duplex.setDisplayName( getMessage( "OptionDisplayValue.Duplex" ) ); //$NON-NLS-1$
duplex.setDataType( IConfigurableOption.DataType.STRING );
duplex.setDisplayType( IConfigurableOption.DisplayType.TEXT );
duplex.setChoices( new OptionValue[]{
new OptionValue( IPostscriptRenderOption.DUPLEX_SIMPLEX,
getMessage( "OptionDisplayValue.DUPLEX_SIMPLEX" ) ), //$NON-NLS-1$
new OptionValue(
IPostscriptRenderOption.DUPLEX_FLIP_ON_SHORT_EDGE,
getMessage( "OptionDisplayValue.DUPLEX_FLIP_ON_SHORT_EDGE" ) ), //$NON-NLS-1$
new OptionValue(
IPostscriptRenderOption.DUPLEX_FLIP_ON_LONG_EDGE,
getMessage( "OptionDisplayValue.DUPLEX_FLIP_ON_LONG_EDGE" ) ) //$NON-NLS-1$
} );
duplex.setDefaultValue( IPostscriptRenderOption.DUPLEX_SIMPLEX );
duplex.setToolTip( null );
duplex.setDescription( getMessage( "OptionDescription.Duplex" ) ); //$NON-NLS-1$
// Initializes the option for paperSize.
ConfigurableOption paperSize = new ConfigurableOption(
PostscriptRenderOption.OPTION_PAPER_SIZE );
paperSize.setDisplayName( getMessage( "OptionDisplayValue.PaperSize" ) ); //$NON-NLS-1$
paperSize.setDataType( IConfigurableOption.DataType.STRING );
paperSize.setDisplayType( IConfigurableOption.DisplayType.TEXT );
paperSize.setDefaultValue( null );
paperSize.setToolTip( null );
paperSize.setDescription( getMessage( "OptionDescription.PaperSize" ) ); //$NON-NLS-1$
// Initializes the option for paperTray.
ConfigurableOption paperTray = new ConfigurableOption(
PostscriptRenderOption.OPTION_PAPER_TRAY );
paperTray.setDisplayName( getMessage( "OptionDisplayValue.PaperTray" ) ); //$NON-NLS-1$
paperTray.setDataType( IConfigurableOption.DataType.STRING );
paperTray.setDisplayType( IConfigurableOption.DisplayType.TEXT );
paperTray.setDefaultValue( null );
paperTray.setToolTip( null );
paperTray.setDescription( getMessage( "OptionDescription.PaperTray" ) ); //$NON-NLS-1$
ConfigurableOption scale = new ConfigurableOption(
PostscriptRenderOption.OPTION_SCALE );
scale.setDisplayName( getMessage( "OptionDisplayValue.Scale" ) ); //$NON-NLS-1$
scale.setDataType( IConfigurableOption.DataType.INTEGER );
scale.setDisplayType( IConfigurableOption.DisplayType.TEXT );
scale.setDefaultValue( 100 );
scale.setToolTip( null );
scale.setDescription( getMessage( "OptionDescription.Scale" ) ); //$NON-NLS-1$
ConfigurableOption resolution = new ConfigurableOption(
PostscriptRenderOption.OPTION_RESOLUTION );
resolution
.setDisplayName( getMessage( "OptionDisplayValue.Resolution" ) ); //$NON-NLS-1$
resolution.setDataType( IConfigurableOption.DataType.STRING );
resolution.setDisplayType( IConfigurableOption.DisplayType.TEXT );
resolution.setDefaultValue( null );
resolution.setToolTip( null );
resolution
.setDescription( getMessage( "OptionDescription.Resolution" ) ); //$NON-NLS-1$
ConfigurableOption color = new ConfigurableOption(
PostscriptRenderOption.OPTION_COLOR );
color.setDisplayName( getMessage( "OptionDisplayValue.Color" ) ); //$NON-NLS-1$
color.setDataType( IConfigurableOption.DataType.BOOLEAN );
color.setDisplayType( IConfigurableOption.DisplayType.CHECKBOX );
color.setDefaultValue( Boolean.TRUE );
color.setToolTip( null );
color.setDescription( getMessage( "OptionDescription.Color" ) ); //$NON-NLS-1$
// Initializes the option for chart DPI.
ConfigurableOption chartDpi = new ConfigurableOption( CHART_DPI );
chartDpi.setDisplayName( getMessage( "OptionDisplayValue.ChartDpi" ) ); //$NON-NLS-1$
chartDpi.setDataType( IConfigurableOption.DataType.INTEGER );
chartDpi
.setDisplayType( IConfigurableOption.DisplayType.TEXT );
chartDpi.setDefaultValue( new Integer( 192 ) );
chartDpi.setToolTip( getMessage( "Tooltip.ChartDpi" ) );
chartDpi.setDescription( getMessage( "OptionDescription.ChartDpi" ) ); //$NON-NLS-1$
// Initializes the option for auto page size selection.
ConfigurableOption autoPaperSizeSelection = new ConfigurableOption(
PostscriptRenderOption.OPTION_AUTO_PAPER_SIZE_SELECTION );
autoPaperSizeSelection
.setDisplayName( getMessage( "OptionDisplayValue.AutoPaperSizeSelection" ) ); //$NON-NLS-1$
autoPaperSizeSelection.setDataType( IConfigurableOption.DataType.BOOLEAN );
autoPaperSizeSelection.setDisplayType( IConfigurableOption.DisplayType.CHECKBOX );
autoPaperSizeSelection.setDefaultValue( true );
autoPaperSizeSelection.setToolTip( null );
autoPaperSizeSelection
.setDescription( getMessage( "OptionDescription.AutoPaperSizeSelection" ) ); //$NON-NLS-1$
// Initializes the option for collate.
ConfigurableOption fitToPaper = new ConfigurableOption(
PostscriptRenderOption.OPTION_FIT_TO_PAPER );
fitToPaper
.setDisplayName( getMessage( "OptionDisplayValue.FitToPaper" ) ); //$NON-NLS-1$
fitToPaper.setDataType( IConfigurableOption.DataType.BOOLEAN );
fitToPaper.setDisplayType( IConfigurableOption.DisplayType.CHECKBOX );
fitToPaper.setDefaultValue( Boolean.FALSE );
fitToPaper.setToolTip( null );
fitToPaper
.setDescription( getMessage( "OptionDescription.FitToPaper" ) ); //$NON-NLS-1$
options = new IConfigurableOption[]{bidiProcessing, textWrapping,
fontSubstitution, pageOverFlow, copies, collate, duplex,
paperSize, paperTray, scale, resolution, color, chartDpi,
autoPaperSizeSelection, fitToPaper};
applyDefaultValues( );
}
private String getMessage( String key )
{
return Messages.getString( key, locale );
}
@Override
public IConfigurableOptionObserver createOptionObserver( )
{
return new PostscriptOptionObserver( );
}
/*
* (non-Javadoc)
*
* @seeorg.eclipse.birt.report.engine.emitter.config.IEmitterDescriptor#
* getDescription()
*/
public String getDescription( )
{
return getMessage( "PostscriptEmitter.Description" ); //$NON-NLS-1$
}
/*
* (non-Javadoc)
*
* @seeorg.eclipse.birt.report.engine.emitter.config.IEmitterDescriptor#
* getDisplayName()
*/
public String getDisplayName( )
{
return getMessage( "PostscriptEmitter.DisplayName" ); //$NON-NLS-1$
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.birt.report.engine.emitter.config.IEmitterDescriptor#getID()
*/
public String getID( )
{
return "org.eclipse.birt.report.engine.emitter.postscript"; //$NON-NLS-1$
}
public String getRenderOptionName( String name )
{
assert name != null;
if ( TEXT_WRAPPING.equals( name ) )
{
return IPDFRenderOption.PDF_TEXT_WRAPPING;
}
if ( BIDI_PROCESSING.equals( name ) )
{
return IPDFRenderOption.PDF_BIDI_PROCESSING;
}
if ( FONT_SUBSTITUTION.equals( name ) )
{
return IPDFRenderOption.PDF_FONT_SUBSTITUTION;
}
if ( CHART_DPI.equals( name ) )
{
return IRenderOption.CHART_DPI;
}
return name;
}
class PostscriptOptionObserver extends AbstractConfigurableOptionObserver
{
@Override
public IConfigurableOption[] getOptions( )
{
return options;
}
@Override
public IRenderOption getPreferredRenderOption( )
{
RenderOption renderOption = new RenderOption( );
renderOption.setEmitterID( getID( ) );
renderOption.setOutputFormat( "postscript" ); //$NON-NLS-1$
if ( values != null && values.length > 0 )
{
for ( IOptionValue optionValue : values )
{
if ( optionValue != null )
{
renderOption.setOption(
getRenderOptionName( optionValue.getName( ) ),
optionValue.getValue( ) );
}
}
}
return renderOption;
}
}
}
| sguan-actuate/birt | engine/org.eclipse.birt.report.engine.emitter.config.postscript/src/org/eclipse/birt/report/engine/emitter/config/postscript/PostscriptEmitterDescriptor.java | Java | epl-1.0 | 13,748 |
/*******************************************************************************
* Copyright (c) 2004 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Actuate Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.birt.report.debug.internal.ui.script.util;
import java.io.File;
import org.eclipse.birt.report.debug.internal.ui.script.editor.DebugJsEditor;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.variables.IStringVariableManager;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.jdt.core.IJavaModel;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
import org.eclipse.pde.core.plugin.IPluginLibrary;
import org.eclipse.pde.core.plugin.IPluginModelBase;
import org.eclipse.pde.core.plugin.PluginRegistry;
import org.eclipse.pde.core.plugin.TargetPlatform;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
/**
* ScriptDebugUtil
*/
public class ScriptDebugUtil
{
private static final char fgSeparator = File.separatorChar;
private static final String[] fgCandidateJavaFiles = {
"javaw", "javaw.exe", "java", "java.exe", "j9w", "j9w.exe", "j9", "j9.exe"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
private static final String[] fgCandidateJavaLocations = {
"bin" + fgSeparator, "jre" + fgSeparator + "bin" + fgSeparator}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
/**Gets the default work space.
* @return
*/
public static IResource getDefaultResource( )
{
return ResourcesPlugin.getWorkspace( ).getRoot( );
}
/**
* Find java exe file.
* @param vmInstallLocation
* @return
*/
public static File findJavaExecutable( File vmInstallLocation )
{
for ( int i = 0; i < fgCandidateJavaFiles.length; i++ )
{
for ( int j = 0; j < fgCandidateJavaLocations.length; j++ )
{
File javaFile = new File( vmInstallLocation,
fgCandidateJavaLocations[j] + fgCandidateJavaFiles[i] );
if ( javaFile.isFile( ) )
{
return javaFile;
}
}
}
return null;
}
/**
* Get the java project through the name.
* @param projectName
* @return
* @throws CoreException
*/
public static IJavaProject getJavaProject( String projectName )
throws CoreException
{
if ( ( projectName == null ) || ( projectName.trim( ).length( ) < 1 ) )
{
return null;
}
IJavaProject javaProject = getJavaModel( ).getJavaProject( projectName );
return javaProject;
}
/**
* Convenience method to get the java model.
*/
private static IJavaModel getJavaModel( )
{
return JavaCore.create( ResourcesPlugin.getWorkspace( ).getRoot( ) );
}
/**
*
* @param source
* @return
*/
public static String expandLibraryName( String source )
{
if ( source == null || source.length( ) == 0 )
return ""; //$NON-NLS-1$
if ( source.indexOf( "$ws$" ) != -1 ) //$NON-NLS-1$
source = source.replaceAll( "\\$ws\\$", //$NON-NLS-1$
"ws" + IPath.SEPARATOR + TargetPlatform.getWS( ) ); //$NON-NLS-1$
if ( source.indexOf( "$os$" ) != -1 ) //$NON-NLS-1$
source = source.replaceAll( "\\$os\\$", //$NON-NLS-1$
"os" + IPath.SEPARATOR + TargetPlatform.getOS( ) ); //$NON-NLS-1$
if ( source.indexOf( "$nl$" ) != -1 ) //$NON-NLS-1$
source = source.replaceAll( "\\$nl\\$", //$NON-NLS-1$
"nl" + IPath.SEPARATOR + TargetPlatform.getNL( ) ); //$NON-NLS-1$
if ( source.indexOf( "$arch$" ) != -1 ) //$NON-NLS-1$
source = source.replaceAll( "\\$arch\\$", //$NON-NLS-1$
"arch" + IPath.SEPARATOR + TargetPlatform.getOSArch( ) ); //$NON-NLS-1$
return source;
}
/**
* @param model
* @param libraryName
* @return
*/
public static IPath getPath( IPluginModelBase model, String libraryName )
{
IResource resource = model.getUnderlyingResource( );
if ( resource != null )
{
IResource jarFile = resource.getProject( ).findMember( libraryName );
return ( jarFile != null ) ? jarFile.getFullPath( ) : null;
}
File file = new File( model.getInstallLocation( ), libraryName );
return file.exists( ) ? new Path( file.getAbsolutePath( ) ) : null;
}
/**
* @param id
* @return
*/
public static String getPlugInFile( String id )
{
IPluginModelBase model = PluginRegistry.findModel( id );
if ( model == null )
{
return null;
}
File file = new File( model.getInstallLocation( ) );
if ( file.isFile( ) )
{
return file.getAbsolutePath( );
}
else
{
IPluginLibrary[] libraries = model.getPluginBase( ).getLibraries( );
for ( int i = 0; i < libraries.length; i++ )
{
if ( IPluginLibrary.RESOURCE.equals( libraries[i].getType( ) ) )
continue;
model = (IPluginModelBase) libraries[i].getModel( );
String name = libraries[i].getName( );
String expandedName = expandLibraryName( name );
IPath path = getPath( model, expandedName );
if ( path != null && !path.toFile( ).isDirectory( ) )
{
return path.toFile( ).getAbsolutePath( );
}
}
}
return null;
}
/**
* @param project
* @return
*/
public static String getOutputFolder( IJavaProject project )
{
if ( project == null )
{
return null;
}
IPath path = project.readOutputLocation( );
String curPath = path.toOSString( );
String directPath = project.getProject( ).getLocation( ).toOSString( );
int index = directPath.lastIndexOf( File.separator );
String absPath = directPath.substring( 0, index ) + curPath;
return absPath;
}
/**
* @return
*/
public static DebugJsEditor getActiveJsEditor( )
{
IWorkbenchWindow window = PlatformUI.getWorkbench( )
.getActiveWorkbenchWindow( );
if ( window != null )
{
IWorkbenchPage pg = window.getActivePage( );
if ( pg != null )
{
IEditorPart editor = pg.getActiveEditor( );
if ( editor != null )
{
if ( editor instanceof DebugJsEditor )
{
return (DebugJsEditor) editor;
}
}
}
}
return null;
}
/**
* @param text
* @return
* @throws CoreException
*/
public static String getSubstitutedString(String text) throws CoreException {
if (text == null)
return ""; //$NON-NLS-1$
IStringVariableManager mgr = VariablesPlugin.getDefault().getStringVariableManager();
return mgr.performStringSubstitution(text);
}
/**
* Returns the IRegion containing the java identifier ("word") enclosing the specified offset or
* <code>null</code> if the document or offset is invalid. Checks characters before and after the
* offset to see if they are allowed java identifier characters until a separator character (period,
* space, etc) is found.
*
* @param document The document to search
* @param offset The offset to start looking for the word
* @return IRegion containing the word or <code>null</code>
*/
public static IRegion findWord(IDocument document, int offset) {
if (document == null){
return null;
}
int start= -2;
int end= -1;
try {
int pos= offset;
char c;
while (pos >= 0) {
c= document.getChar(pos);
if (!Character.isJavaIdentifierPart(c))
break;
--pos;
}
start= pos;
pos= offset;
int length= document.getLength();
while (pos < length) {
c= document.getChar(pos);
if (!Character.isJavaIdentifierPart(c))
break;
++pos;
}
end= pos;
} catch (BadLocationException x) {
}
if (start >= -1 && end > -1) {
if (start == offset && end == offset)
return new Region(offset, 0);
else if (start == offset)
return new Region(start, end - start);
else
return new Region(start + 1, end - start - 1);
}
return null;
}
}
| sguan-actuate/birt | UI/org.eclipse.birt.report.debug.ui/src/org/eclipse/birt/report/debug/internal/ui/script/util/ScriptDebugUtil.java | Java | epl-1.0 | 8,403 |
<?php
class Ecommercial_item_model extends Post_model{
public function __construct(){
parent::__construct();
$this->post_type = "wpsc-product";
return $this;
}
public function item($id=-1,$format=array()){
mysql_query("SET SESSION group_concat_max_len = 1000000;");
$a = $this->db->get_results("
SELECT term_r.term_taxonomy_id,p.* ,group_concat(meta) as meta FROM (
SELECT
CASE
WHEN meta_value IS NULL THEN CONCAT(meta_key, '=', \"null\")
ELSE CONCAT(meta_key, \"=\", meta_value)
END AS meta,post_id
FROM ".$this->tableName('postmeta')."
) as mp ,".$this->tableName('posts')." p, ".$this->tableName('term_relationships')." term_r
where mp.post_id= p.ID and term_r.object_id=p.ID and p.post_status='publish' and p.ID={$id} and p.post_type='{$this->post_type}'");
//alway
if(is_array($a) && count($a)>0){
$obj = $a[0];
if(isset($obj->meta)){
$meta = explode(",",$obj->meta);
foreach($meta as $v){
$k=explode("=",ltrim($v,"_"));
$obj->{$k[0]} = StringUtil::is_serialized($k[1]) ? unserialize($k[1]) : $k[1];
}
unset($obj->meta);
unset($meta);
if(isset($obj->thumbnail_id)){
$query = "SELECT post.guid from ".Ahlu::DB()->posts." as post where post.ID={$obj->thumbnail_id}";
//echo $query;
$a = Ahlu::DB()->get_results($query);
//print_r($a);
if(count($a)>0){
unset($obj->thumbnail_id);
$obj->thumbnail =$a[0]->guid;
}
}
}
$a = $obj;
}
return $a;
}
//search by name in same category
public function search($limit = 6,$isRandom = false){
mysql_query("SET SESSION group_concat_max_len = 1000000;");
$query = "Select post.*,metap.meta from ( SELECT group_concat(meta) as meta,mp.ID from (SELECT
CASE meta_value
WHEN NULL THEN CONCAT(meta_key, '=', \"null\")
ELSE CONCAT(meta_key, '=', meta_value)
END AS meta,post_id as ID
FROM {$this->db->postmeta}
) as mp GROUP BY ID ) as metap, {$this->db->term_taxonomy} term_tax,{$this->db->term_relationships} term_tax_re,{$this->db->posts} post where metap.ID= post.ID and post.post_status='publish' and post.post_type='{$this->post_type}' and post.ID=term_tax_re.object_id and term_tax.term_taxonomy_id=term_tax_re.term_taxonomy_id and term_tax.term_taxonomy_id = term_tax_re.term_taxonomy_id and post.ID<>{$this->post->ID} and MATCH(post.post_title) AGAINST ('".trim($this->post->post_title)."') limit 0,{$limit}";
//echo $query;
$data = $this->db->get_results($query);
//alway
if(is_array($data) && count($data)>0){
foreach($data as $obj){
if(isset($obj->meta)){
$meta = explode(",",$obj->meta);
foreach($meta as $v){
$k=explode("=",ltrim($v,"_"));
$obj->{$k[0]} = StringUtil::is_serialized($k[1]) ? unserialize($k[1]) : $k[1];
}
unset($obj->meta);
unset($meta);
if(isset($obj->thumbnail_id)){
$query = "SELECT post.guid from ".Ahlu::DB()->posts." as post where post.ID={$obj->thumbnail_id}";
//echo $query;
$a = Ahlu::DB()->get_results($query);
//print_r($a);
if(count($a)>0){
unset($obj->thumbnail_id);
$obj->thumbnail =$a[0]->guid;
}
}
}
}
if($isRandom && count($data)>$limit){
$b = array();
$queue = array();
for($i=0; $i<$limit ; $i++){
$num = rand(0,$limit);
//if(!in_array($num,$queue)){
//$queue[] = $num;
$b[] = $data[$num];
//}
}
$data = $b;
}
return $data;
}
return null;
}
//search by name in same category
public function querySearch($name,$limit = 9){
if($name==null) return null;
$this->pagation = Ahlu::Library("Ahlu_WP_Pagation",$this->db);
//$this->pagation->setPage($page);
$this->pagation->setLimit($limit);
mysql_query("SET SESSION group_concat_max_len = 1000000;");
$query = "Select post.*,metap.meta from ( SELECT group_concat(meta) as meta,mp.ID from (SELECT
CASE meta_value
WHEN NULL THEN CONCAT(meta_key, '=', \"null\")
ELSE CONCAT(meta_key, '=', meta_value)
END AS meta,post_id as ID
FROM {$this->db->postmeta}
) as mp GROUP BY ID ) as metap, {$this->db->term_taxonomy} term_tax,{$this->db->term_relationships} term_tax_re,{$this->db->posts} post where metap.ID= post.ID and post.post_status='publish' and post.post_type='{$this->post_type}' and post.ID=term_tax_re.object_id and term_tax.term_taxonomy_id=term_tax_re.term_taxonomy_id and term_tax.term_taxonomy_id = term_tax_re.term_taxonomy_id and MATCH(post.post_title) AGAINST ('".trim($name)."') limit 0,{$limit}";
$this->pagation->excute($query);
$data = $this->pagation->PageData();
if(is_array($data) && count($data)>0){
foreach($data as $obj){
if(isset($obj->meta)){
$meta = explode(",",$obj->meta);
foreach($meta as $v){
$k=explode("=",ltrim($v,"_"));
$obj->{$k[0]} = StringUtil::is_serialized($k[1]) ? unserialize($k[1]) : $k[1];
}
unset($obj->meta);
unset($meta);
if(isset($obj->thumbnail_id)){
$query = "SELECT post.guid from ".Ahlu::DB()->posts." as post where post.ID={$obj->thumbnail_id}";
//echo $query;
$a = Ahlu::DB()->get_results($query);
//print_r($a);
if(count($a)>0){
unset($obj->thumbnail_id);
$obj->thumbnail =$a[0]->guid;
}
}
}
}
$a = new stdClass();
$a->data = $data;
$a->link = $this->pagation->PageLinks(true);
return ;
}
return null;
}
//search by name in same category
public function relatedSearch($limit = 3,$isRandom = false){
mysql_query("SET SESSION group_concat_max_len = 1000000;");
$query = "Select post.*,metap.meta from ( SELECT group_concat(meta) as meta,mp.ID from (SELECT
CASE meta_value
WHEN NULL THEN CONCAT(meta_key, '=', \"null\")
ELSE CONCAT(meta_key, '=', meta_value)
END AS meta,post_id as ID
FROM {$this->db->postmeta}
) as mp GROUP BY ID ) as metap, {$this->db->term_taxonomy} term_tax,{$this->db->term_relationships} term_tax_re,{$this->db->posts} post where metap.ID= post.ID and post.post_status='publish' and post.post_type='{$this->post_type}' and post.ID=term_tax_re.object_id and post.ID<>{$this->post->ID} and MATCH(post.post_title) AGAINST ('".trim($this->post->post_title)."')";
//echo $query;
$data = $this->db->get_results($query);
//alway
if(is_array($data) && count($data)>0){
foreach($data as $obj){
if(isset($obj->meta)){
$meta = explode(",",$obj->meta);
foreach($meta as $v){
$k=explode("=",ltrim($v,"_"));
$obj->{$k[0]} = StringUtil::is_serialized($k[1]) ? unserialize($k[1]) : $k[1];
}
unset($obj->meta);
unset($meta);
if(isset($obj->thumbnail_id)){
$query = "SELECT post.guid from ".Ahlu::DB()->posts." as post where post.ID={$obj->thumbnail_id}";
//echo $query;
$a = Ahlu::DB()->get_results($query);
//print_r($a);
if(count($a)>0){
unset($obj->thumbnail_id);
$obj->thumbnail =$a[0]->guid;
}
}
}
}
if($isRandom && count($data)>$limit){
$b = array();
$queue = array();
for($i=0; $i<$limit ; $i++){
$num = rand(0,$limit);
//if(!in_array($num,$queue)){
//$queue[] = $num;
$b[] = $data[$num];
//}
}
$data = $b;
}
return $data;
}
return null;
}
//override
/*
* get category
*/
public function parent($array = NULL){
$db = $this->db;
$query = "SELECT s1.*,t.* from {$db->prefix}term_taxonomy s1, {$db->prefix}terms t where t.term_id=s1.term_id and s1.term_taxonomy_id={$this->post->term_taxonomy_id}";
//echo $query;
$a = $db->get_results($query);
return count(a)>0 ? $a[0] :null;
}
public function hasParent(){
return $this->post->taxonomy==$this->post_type;
}
}
?> | trungjc/ease | wp-content/upgrade/themes/main/includes/mvc/model/plugin/ecommercial/Ecommercial_item_model.php | PHP | gpl-2.0 | 8,172 |
<?php
/**
* Featured Products Widget
*
* Gets and displays featured products in an unordered list
*
* @author WooThemes
* @category Widgets
* @package WooCommerce/Widgets
* @version 1.6.4
* @extends WP_Widget
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class WC_Widget_Featured_Products extends WP_Widget {
/** Variables to setup the widget. */
var $woo_widget_cssclass;
var $woo_widget_description;
var $woo_widget_idbase;
var $woo_widget_name;
/**
* constructor
*
* @access public
* @return void
*/
function WC_Widget_Featured_Products() {
/* Widget variable settings. */
$this->woo_widget_cssclass = 'woocommerce widget_featured_products';
$this->woo_widget_description = __( 'Display a list of featured products on your site.', 'woocommerce' );
$this->woo_widget_idbase = 'woocommerce_featured_products';
$this->woo_widget_name = __( 'WooCommerce Featured Products', 'woocommerce' );
/* Widget settings. */
$widget_ops = array( 'classname' => $this->woo_widget_cssclass, 'description' => $this->woo_widget_description );
/* Create the widget. */
$this->WP_Widget('featured-products', $this->woo_widget_name, $widget_ops);
add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
}
/**
* widget function.
*
* @see WP_Widget
* @access public
* @param array $args
* @param array $instance
* @return void
*/
function widget($args, $instance) {
global $woocommerce;
$cache = wp_cache_get('widget_featured_products', 'widget');
if ( !is_array($cache) ) $cache = array();
if ( isset($cache[$args['widget_id']]) ) {
echo $cache[$args['widget_id']];
return;
}
ob_start();
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? __('Featured Products', 'woocommerce' ) : $instance['title'], $instance, $this->id_base);
if ( !$number = (int) $instance['number'] )
$number = 10;
else if ( $number < 1 )
$number = 1;
else if ( $number > 15 )
$number = 15;
?>
<?php $query_args = array('posts_per_page' => $number, 'no_found_rows' => 1, 'post_status' => 'publish', 'post_type' => 'product' );
$query_args['meta_query'] = $woocommerce->query->get_meta_query();
$query_args['meta_query'][] = array(
'key' => '_featured',
'value' => 'yes'
);
$r = new WP_Query($query_args);
if ($r->have_posts()) : ?>
<?php echo $before_widget; ?>
<?php if ( $title ) echo $before_title . $title . $after_title; ?>
<ul class="product_list_widget">
<?php while ($r->have_posts()) : $r->the_post(); global $product; ?>
<li><a href="<?php echo esc_url( get_permalink( $r->post->ID ) ); ?>" title="<?php echo esc_attr($r->post->post_title ? $r->post->post_title : $r->post->ID); ?>">
<?php echo $product->get_image(); ?>
<?php if ( $r->post->post_title ) echo get_the_title( $r->post->ID ); else echo $r->post->ID; ?>
</a> <?php echo $product->get_price_html(); ?></li>
<?php endwhile; ?>
</ul>
<?php echo $after_widget; ?>
<?php endif;
$content = ob_get_clean();
if ( isset( $args['widget_id'] ) ) $cache[$args['widget_id']] = $content;
echo $content;
wp_cache_set('widget_featured_products', $cache, 'widget');
wp_reset_postdata();
}
/**
* update function.
*
* @see WP_Widget->update
* @access public
* @param array $new_instance
* @param array $old_instance
* @return array
*/
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['number'] = (int) $new_instance['number'];
$this->flush_widget_cache();
$alloptions = wp_cache_get( 'alloptions', 'options' );
if ( isset($alloptions['widget_featured_products']) ) delete_option('widget_featured_products');
return $instance;
}
/**
* flush_widget_cache function.
*
* @access public
* @return void
*/
function flush_widget_cache() {
wp_cache_delete('widget_featured_products', 'widget');
}
/**
* form function.
*
* @see WP_Widget->form
* @access public
* @param array $instance
* @return void
*/
function form( $instance ) {
$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
if ( !isset($instance['number']) || !$number = (int) $instance['number'] )
$number = 2;
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'woocommerce' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id('title') ); ?>" name="<?php echo esc_attr( $this->get_field_name('title') ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
<p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e( 'Number of products to show:', 'woocommerce' ); ?></label>
<input id="<?php echo esc_attr( $this->get_field_id('number') ); ?>" name="<?php echo esc_attr( $this->get_field_name('number') ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3" /></p>
<?php
}
} | rongandat/sallumeh | wp-content/plugins/woocommerce/classes/widgets/class-wc-widget-featured-products.php | PHP | gpl-2.0 | 5,320 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
#
# Copyright (c) 2008 University of Dundee.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Author: Aleksandra Tarkowska <A(dot)Tarkowska(at)dundee(dot)ac(dot)uk>, 2008.
#
# Version: 1.0
#
from django.conf.urls import *
from omeroweb.webstart import views
urlpatterns = patterns('django.views.generic.simple',
url( r'^$', views.index, name="webstart_index" ),
url( r'^jars/insight\.jnlp$', views.insight, name='webstart_insight'),
)
| jballanc/openmicroscopy | components/tools/OmeroWeb/omeroweb/webstart/urls.py | Python | gpl-2.0 | 1,117 |
<?php
require_once "JSON.php";
/*
* JSON Encoder encodes/decodes the object into/from JSON string
* Methods Encode and Decode
*/
class JSONEncoder
{
private static $FAULT = 'FaultMessage';
/*
* Encodes the request object into JSON String
*/
public static function Encode($requestObject)
{
$JSON = "";
try
{
$toEncode = array(
get_class($requestObject) => $requestObject);
$encoder = new Services_JSON();
$JSON = $encoder->encode($toEncode);
$JSON = str_replace('"":', '', $JSON);
}
catch(Exception $ex)
{
throw new Exception("Error occurred while JSON encoding");
}
return $JSON;
}
/*
* Decodes back to object from given JSON String response
*/
public static function Decode($JSONResponse, &$isFault, $objectName = '')
{
$responseJSONObject = null;
try
{
if(empty($JSONResponse))
throw new Exception("Given Response is not a valid JSON response.");
if(strlen($JSONResponse) != strlen(str_replace('"error":','',$JSONResponse))) {
$isFault = true;
$objectName = self::$FAULT;
}else {
$isFault = false;
}
$encoder = new Services_JSON();
$responseJSONObject = $encoder->decode($JSONResponse,$objectName);
}
catch(Exception $ex)
{
throw new Exception("Error occurred while JSON decoding. " . $ex->getMessage());
}
return $responseJSONObject;
}
}
?> | Titrisation/www | wp-content/plugins/ignitiondeck-crowdfunding/paypal/lib/JSONEncoder/JSONEncoder.php | PHP | gpl-2.0 | 1,394 |
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary Ensures that the serialization implementation can *always* access
* the record constructor
* @compile --enable-preview -source ${jdk.version} ConstructorAccessTest.java
* @run testng/othervm --enable-preview ConstructorAccessTest
* @run testng/othervm/java.security.policy=empty_security.policy --enable-preview ConstructorAccessTest
*/
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.io.Externalizable;
import java.io.Serializable;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import static java.lang.System.out;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
/*implicit*/ record Aux1 (int x) implements Serializable { }
/*implicit*/ record Aux2 (int x) implements Serializable { }
public class ConstructorAccessTest {
public record A (int x) implements Serializable { }
protected static record B (long l) implements Serializable { }
/*implicit*/ static record C (float f) implements Serializable { }
private record D (double d) implements Serializable { }
interface ThrowingExternalizable extends Externalizable {
default void writeExternal(ObjectOutput out) {
fail("should not reach here");
}
default void readExternal(ObjectInput in) {
fail("should not reach here");
}
}
public record E (short s) implements ThrowingExternalizable { }
protected static record F (long l) implements ThrowingExternalizable { }
/*implicit*/ static record G (double d) implements ThrowingExternalizable { }
private record H (double d) implements ThrowingExternalizable { }
@DataProvider(name = "recordInstances")
public Object[][] recordInstances() {
return new Object[][] {
new Object[] { new A(34) },
new Object[] { new B(44L) },
new Object[] { new C(4.5f) },
new Object[] { new D(440d) },
new Object[] { new E((short)12) },
new Object[] { new F(45L) },
new Object[] { new G(0.4d) },
new Object[] { new H(440d) },
new Object[] { new Aux1(63) },
new Object[] { new Aux2(64) },
};
}
@Test(dataProvider = "recordInstances")
public void roundTrip(Object objToSerialize) throws Exception {
out.println("\n---");
out.println("serializing : " + objToSerialize);
var objDeserialized = serializeDeserialize(objToSerialize);
out.println("deserialized: " + objDeserialized);
assertEquals(objToSerialize, objDeserialized);
assertEquals(objDeserialized, objToSerialize);
}
// ---
static <T> byte[] serialize(T obj) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(obj);
oos.close();
return baos.toByteArray();
}
@SuppressWarnings("unchecked")
static <T> T deserialize(byte[] streamBytes)
throws IOException, ClassNotFoundException
{
ByteArrayInputStream bais = new ByteArrayInputStream(streamBytes);
ObjectInputStream ois = new ObjectInputStream(bais);
return (T) ois.readObject();
}
static <T> T serializeDeserialize(T obj)
throws IOException, ClassNotFoundException
{
return deserialize(serialize(obj));
}
}
| md-5/jdk10 | test/jdk/java/io/Serializable/records/ConstructorAccessTest.java | Java | gpl-2.0 | 4,737 |
/*
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javafx.scene.text;
import com.sun.javafx.geom.RectBounds;
public interface TextLine {
/**
* Returns the list of GlyphList in the line. The list is visually orderded.
*/
public GlyphList[] getRuns();
/**
* Returns metrics information about the line as follow:
*
* bounds().getWidth() - the width of the line.
* The width for the line is sum of all run's width in the line, it is not
* affect by any wrapping width but it will include any changes caused by
* justification.
*
* bounds().getHeight() - the height of the line.
* The height of the line is sum of the max ascent, max descent, and
* max line gap of all the fonts in the line.
*
* bounds.().getMinY() - the ascent of the line (negative).
* The ascent of the line is the max ascent of all fonts in the line.
*
* bounds().getMinX() - the x origin of the line (relative to the layout).
* The x origin is defined by TextAlignment of the text layout, always zero
* for left-aligned text.
*/
public RectBounds getBounds();
/**
* Returns the left side bearing of the line (negative).
*/
public float getLeftSideBearing();
/**
* Returns the right side bearing of the line (positive).
*/
public float getRightSideBearing();
/**
* Returns the line start offset.
*/
public int getStart();
/**
* Returns the line length in character.
*/
public int getLength();
}
| loveyoupeng/rt | modules/graphics/src/main/java/com/sun/javafx/scene/text/TextLine.java | Java | gpl-2.0 | 2,742 |