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 |
|---|---|---|---|---|---|
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace NAudioUniversalDemo
{
internal class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
}
}
} | skor98/DtWPF | speechKit/NAudio-master/NAudioUniversalDemo/ViewModelBase.cs | C# | mit | 517 |
$(function(){
$("#addCompanyForm").validate({
rules: {
name : {
required : true
},
email: {
required: true,
email: true
},
url : {
required : true,
url : true
}
},
messages: {
name : {
required : "Please enter your company name"
},
url : {
required : "Please enter your company website",
url : "Please enter a valid url"
},
email: {
required: "Enter your Company email address",
email: "Please enter a valid email address",
}
}
});
$('#addCompanyDialog').on('hide.bs.modal', function (e) {
refresh();
});
$('#addCompanyDialog').on('shown.bs.modal', function (e) {
$('#name').focus();
$('#id').val('');
var id = $(e.relatedTarget).attr('id');
var isEdit = $(e.relatedTarget).hasClass('fa-edit');
console.log(isEdit);
if(isEdit){
$('#id').val(id);
$.getJSON('/account/companies/' + id, function(data){
if(data.result){
$('#name').val(data.result.name);
$('#email').val(data.result.email);
$('#url').val(data.result.url);
}
});
}
var validator = $( "#addCompanyForm" ).validate();
validator.resetForm();
});
$('#confirm-delete').on('show.bs.modal', function(e) {
var id = $(e.relatedTarget).attr('id');
$(this).find('.btn-ok').on('click', function(){
$.ajax({
url: '/account/companies/' + id,
type: 'delete',
dataType: 'json',
success: function(data) {
$('#message ').html('<div class="error" style="text-align:center;padding:5px;">' + data.message + '</div>')
$('#confirm-delete').modal('hide');
if(data.result)
getCompanies();
}
});
});
});
$("#addCompanyForm").submit(function(e) {
e.preventDefault();
if($( "#addCompanyForm" ).valid()){
var actionurl = '/account/companies';
var type = 'post';
console.log($('#id').val() != '');
if($('#id').val() != ''){
type = 'put';
actionurl = '/account/companies/' + $('#id').val();
}
//var actionurl = e.currentTarget.action;
$.ajax({
url: actionurl,
type: type,
dataType: 'json',
data: $("#addCompanyForm").serialize(),
success: function(data) {
$('#message ').html('<div class="error" style="text-align:center;padding:5px;">' + data.message + '</div>')
$('#addCompanyDialog').modal('hide');
if(data.result)
getCompanies();
}
});
}
});
var getCompanies= function(){
$('#companylist').html('<div class="loader"><i class="fa fa-spinner fa-pulse"></i></div>');
$.get('/account/companies/list', function(data){
$('#companylist').html(data);
$('#message ').html('');
});
};
$('#refresh').on('click', function () {
$('#message ').html('');
getCompanies();
});
var refresh = function () {
$('#id').val('');
$('#name').val('');
$('#url').val('');
$('#email').val('');
};
getCompanies();
}); | CREA-KO/NPoint.Api | public/js/companies.js | JavaScript | mit | 3,124 |
<?php
namespace Kendo\Dataviz\UI;
class DiagramShapeConnectorDefaultsStroke extends \Kendo\SerializableObject {
//>> Properties
/**
* Defines the stroke color.
* @param string $value
* @return \Kendo\Dataviz\UI\DiagramShapeConnectorDefaultsStroke
*/
public function color($value) {
return $this->setProperty('color', $value);
}
/**
* The dash type of the stroke.
* @param string $value
* @return \Kendo\Dataviz\UI\DiagramShapeConnectorDefaultsStroke
*/
public function dashType($value) {
return $this->setProperty('dashType', $value);
}
/**
* Defines the thickness or width of the shape connectors stroke.
* @param float $value
* @return \Kendo\Dataviz\UI\DiagramShapeConnectorDefaultsStroke
*/
public function width($value) {
return $this->setProperty('width', $value);
}
//<< Properties
}
?>
| deviffy/laravel-kendo-ui | wrappers/php/lib/Kendo/Dataviz/UI/DiagramShapeConnectorDefaultsStroke.php | PHP | mit | 909 |
# reads uniprot core file and generates core features
from features_helpers import score_differences
def build_uniprot_to_index_to_core(sable_db_obj):
uniprot_to_index_to_core = {}
for line in sable_db_obj:
tokens = line.split()
try:
# PARSING ID
prot = tokens[0]
index = int(tokens[1])
core = tokens[2]
# PARSING ID
if uniprot_to_index_to_core.has_key(prot):
uniprot_to_index_to_core[prot][index] = core
else:
uniprot_to_index_to_core[prot] = {index: core}
except ValueError:
print "Cannot parse: " + line[0:len(line) - 1]
return uniprot_to_index_to_core
def get_sable_scores(map_file, f_sable_db_location, uniprot_core_output_location):
map_file_obj = open(map_file, 'r')
sable_db_obj = open(f_sable_db_location, 'r')
write_to = open(uniprot_core_output_location, 'w')
uniprot_to_index_to_core = build_uniprot_to_index_to_core(sable_db_obj)
for line in map_file_obj:
tokens = line.split()
asid = tokens[0].split("_")[0]
prot = tokens[1]
sstart = int(tokens[2])
start = int(tokens[3])
end = int(tokens[4])
eend = int(tokens[5])
rough_a_length = int(int(tokens[0].split("_")[-1].split("=")[1]) / 3)
if asid[0] == "I":
rough_a_length = 0
c1_count = 0
a_count = 0
c2_count = 0
canonical_absolute = 0
if prot in uniprot_to_index_to_core:
c1_count = score_differences(uniprot_to_index_to_core, prot, sstart, start)
a_count = score_differences(uniprot_to_index_to_core, prot, start, end)
c2_count = score_differences(uniprot_to_index_to_core, prot, end, eend)
prot_len = int(line.split("\t")[7].strip())
canonical_absolute = score_differences(uniprot_to_index_to_core, prot, 1, prot_len)
print >> write_to, tokens[0] + "\t" + prot + "\t" + repr(c1_count) + "\t" + repr(a_count) + "\t" + repr(
c2_count) + "\t" + repr(canonical_absolute)
write_to.close() | wonjunetai/pulse | features/uniprot_core.py | Python | mit | 2,151 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Project.Models
{
public enum WordRel
{
None,
Synonym,
Similar,
Related,
Antonym
}
} | Midnightgarden101/WCSU-2017-CS350-Final_Project | Project/Models/WordRel.cs | C# | mit | 234 |
module.exports = {
entry: {
'public/js/bundle.js': ['./index.js'],
},
output: {
filename: '[name]',
},
devtool: 'eval',
module: {
loaders: [
{
test: /.js$/,
exclude: /node_modules/,
loaders: ['babel'],
}
]
}
}
| LegitTalon/js-dedupe | webpack.config.js | JavaScript | mit | 276 |
// Copyright (c) 2014-2015 The AsturCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "asturcoinamountfield.h"
#include "asturcoinunits.h"
#include "guiconstants.h"
#include "qvaluecombobox.h"
#include <QApplication>
#include <QDoubleSpinBox>
#include <QHBoxLayout>
#include <QKeyEvent>
#include <qmath.h> // for qPow()
AsturCoinAmountField::AsturCoinAmountField(QWidget *parent) :
QWidget(parent),
amount(0),
currentUnit(-1)
{
nSingleStep = 100000; // satoshis
amount = new QDoubleSpinBox(this);
amount->setLocale(QLocale::c());
amount->installEventFilter(this);
amount->setMaximumWidth(170);
QHBoxLayout *layout = new QHBoxLayout(this);
layout->addWidget(amount);
unit = new QValueComboBox(this);
unit->setModel(new AsturCoinUnits(this));
layout->addWidget(unit);
layout->addStretch(1);
layout->setContentsMargins(0,0,0,0);
setLayout(layout);
setFocusPolicy(Qt::TabFocus);
setFocusProxy(amount);
// If one if the widgets changes, the combined content changes as well
connect(amount, SIGNAL(valueChanged(QString)), this, SIGNAL(textChanged()));
connect(unit, SIGNAL(currentIndexChanged(int)), this, SLOT(unitChanged(int)));
// Set default based on configuration
unitChanged(unit->currentIndex());
}
void AsturCoinAmountField::setText(const QString &text)
{
if (text.isEmpty())
amount->clear();
else
amount->setValue(text.toDouble());
}
void AsturCoinAmountField::clear()
{
amount->clear();
unit->setCurrentIndex(0);
}
bool AsturCoinAmountField::validate()
{
bool valid = true;
if (amount->value() == 0.0)
valid = false;
else if (!AsturCoinUnits::parse(currentUnit, text(), 0))
valid = false;
else if (amount->value() > AsturCoinUnits::maxAmount(currentUnit))
valid = false;
setValid(valid);
return valid;
}
void AsturCoinAmountField::setValid(bool valid)
{
if (valid)
amount->setStyleSheet("");
else
amount->setStyleSheet(STYLE_INVALID);
}
QString AsturCoinAmountField::text() const
{
if (amount->text().isEmpty())
return QString();
else
return amount->text();
}
bool AsturCoinAmountField::eventFilter(QObject *object, QEvent *event)
{
if (event->type() == QEvent::FocusIn)
{
// Clear invalid flag on focus
setValid(true);
}
else if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease)
{
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
if (keyEvent->key() == Qt::Key_Comma)
{
// Translate a comma into a period
QKeyEvent periodKeyEvent(event->type(), Qt::Key_Period, keyEvent->modifiers(), ".", keyEvent->isAutoRepeat(), keyEvent->count());
QApplication::sendEvent(object, &periodKeyEvent);
return true;
}
}
return QWidget::eventFilter(object, event);
}
QWidget *AsturCoinAmountField::setupTabChain(QWidget *prev)
{
QWidget::setTabOrder(prev, amount);
QWidget::setTabOrder(amount, unit);
return unit;
}
qint64 AsturCoinAmountField::value(bool *valid_out) const
{
qint64 val_out = 0;
bool valid = AsturCoinUnits::parse(currentUnit, text(), &val_out);
if (valid_out)
{
*valid_out = valid;
}
return val_out;
}
void AsturCoinAmountField::setValue(qint64 value)
{
setText(AsturCoinUnits::format(currentUnit, value));
}
void AsturCoinAmountField::setReadOnly(bool fReadOnly)
{
amount->setReadOnly(fReadOnly);
unit->setEnabled(!fReadOnly);
}
void AsturCoinAmountField::unitChanged(int idx)
{
// Use description tooltip for current unit for the combobox
unit->setToolTip(unit->itemData(idx, Qt::ToolTipRole).toString());
// Determine new unit ID
int newUnit = unit->itemData(idx, AsturCoinUnits::UnitRole).toInt();
// Parse current value and convert to new unit
bool valid = false;
qint64 currentValue = value(&valid);
currentUnit = newUnit;
// Set max length after retrieving the value, to prevent truncation
amount->setDecimals(AsturCoinUnits::decimals(currentUnit));
amount->setMaximum(qPow(10, AsturCoinUnits::amountDigits(currentUnit)) - qPow(10, -amount->decimals()));
amount->setSingleStep((double)nSingleStep / (double)AsturCoinUnits::factor(currentUnit));
if (valid)
{
// If value was valid, re-place it in the widget with the new unit
setValue(currentValue);
}
else
{
// If current value is invalid, just clear field
setText("");
}
setValid(true);
}
void AsturCoinAmountField::setDisplayUnit(int newUnit)
{
unit->setValue(newUnit);
}
void AsturCoinAmountField::setSingleStep(qint64 step)
{
nSingleStep = step;
unitChanged(unit->currentIndex());
}
| KaTXi/ASTC | src/qt/asturcoinamountfield.cpp | C++ | mit | 4,947 |
using System.Collections.Generic;
using System.Linq;
namespace ComputerAlgebra
{
public static class Combinatorics
{
/// <summary>
/// Enumerate the permutations of x.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="n"></param>
/// <returns></returns>
public static IEnumerable<IList<T>> Permutations<T>(this IEnumerable<T> n)
{
List<T> l = n.ToList();
return Permutations(l, l.Count);
}
private static IEnumerable<IList<T>> Permutations<T>(IList<T> n, int r)
{
if (r == 1)
{
yield return n;
}
else
{
for (int i = 0; i < r; i++)
{
foreach (var j in Permutations(n, r - 1))
yield return j;
T t = n[r - 1];
n.RemoveAt(r - 1);
n.Insert(0, t);
}
}
}
/// <summary>
/// Enumerate the combinations of n of length r.
/// From: http://www.extensionmethod.net/csharp/ienumerable-t/combinations
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="n"></param>
/// <param name="r"></param>
/// <returns></returns>
public static IEnumerable<IEnumerable<T>> Combinations<T>(this IEnumerable<T> n, int r)
{
if (r == 0)
return new[] { new T[0] };
else
return n.SelectMany((e, i) => n.Skip(i + 1).Combinations(r - 1).Select(c => new[] { e }.Concat(c)));
}
}
}
| dsharlet/ComputerAlgebra | ComputerAlgebra/Utils/Combinatorics.cs | C# | mit | 1,703 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SimpleStatePattern
{
public class StateB : StateBase
{
char currentLetter = 'B';
public void Change(Context context)
{
Console.Write(System.Environment.NewLine + "The current letter is: " + currentLetter + System.Environment.NewLine);
Console.WriteLine("Inc:1;Dec:2;Rst;3: ");
ConsoleKeyInfo name = Console.ReadKey();
switch (name.KeyChar)
{
case '1':
context.State = new StateC();
break;
case '2':
context.State = new StateA();
break;
case '3':
context.State = new StateA();
break;
default:
context.State = new StateB();
break;
}
}
}
}
| cbycraft/CarlRepo | learning/CS/SimpleStatePattern/SimpleStatePattern/SimpleStatePattern/StateB.cs | C# | mit | 1,007 |
package main
import (
"bytes"
"os"
"os/exec"
)
func panicOn(err error) {
if err != nil {
panic(err)
}
}
func FileExists(name string) bool {
fi, err := os.Stat(name)
if err != nil {
return false
}
if fi.IsDir() {
return false
}
return true
}
func DirExists(name string) bool {
fi, err := os.Stat(name)
if err != nil {
return false
}
if fi.IsDir() {
return true
}
return false
}
func Run(dir string, exe string, arg ...string) (stdout *bytes.Buffer, stderr *bytes.Buffer, err error) {
cmd := exec.Command(exe, arg...)
var errbuf bytes.Buffer
var outbuf bytes.Buffer
cmd.Dir = dir
cmd.Stderr = &errbuf
cmd.Stdout = &outbuf
err = cmd.Run()
return &outbuf, &errbuf, err
}
| glycerine/geist | util.go | GO | mit | 707 |
import { expect } from 'chai'
import {List, Map} from 'immutable'
import categories from '../src/reducer.js'
describe("Category Test", () => {
it("should add a category", () => {
let initialState = Map({
user: 'Skye'
})
let expectedState = Map({
user: 'Skye',
categories: Map({
'Love': 0
})
})
let result = categories(initialState, {type:'ADD_CATEGORY', value:'Love'})
expect(result).to.eql(expectedState)
})
it("adding a category does not modify previous state", () => {
let initialState = Map({
user: 'Skye',
categories: Map({
'Love': 90
})
})
let expectedState = Map({
user: 'Skye',
categories: Map({
'Love': 90,
'Communication': 0
})
})
let result = categories(initialState, {type:'ADD_CATEGORY', value:'Communication'})
expect(result).to.eql(expectedState)
expect(initialState).to.eql(Map({
user: 'Skye',
categories: Map({
'Love': 90
})
}))
})
it("should rate a category", () => {
let initialState = Map({
user: 'Skye',
categories: Map({
'Love': 0
})
})
let expectedState = Map({
user: 'Skye',
categories: Map({
'Love': 90
})
})
let result = categories(initialState, { type:'RATE_CATEGORY', name:'Love', value:90 })
expect(result).to.eql(Map({
user: 'Skye',
categories: Map({
'Love': 90
})
}))
})
it("should stop adding categories", () => {
let initialState = Map({
user: 'Skye',
categories: Map({
'Love': 90,
'Communication': 80,
'Fun' : 100
})
})
let expectedState = Map({
user: 'Skye',
categories: Map({
'Love': 90,
'Communication': 80,
'Fun' : 100
}),
categories_finished: true
})
let result = categories(initialState, {type:'FINISH_CATEGORIES', value: true})
expect(result).to.eql(expectedState)
})
})
| sheepfunk/poly-polygons | test/category_test.js | JavaScript | mit | 1,827 |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ky" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About SweetStake</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+39"/>
<source><b>SweetStake</b> version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2015 The SweetStake developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Жаң даректи жасоо</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-46"/>
<source>These are your SweetStake addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<source>&Copy Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a SweetStake address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Verify a message to ensure it was signed with a specified SweetStake address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>Ө&чүрүү</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Дарек</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(аты жок)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+35"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-58"/>
<source>SweetStake will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+282"/>
<source>Sign &message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+251"/>
<source>Synchronizing with network...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-319"/>
<source>&Overview</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation>&Транзакциялар</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-13"/>
<source>&Receive coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-7"/>
<source>&Send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>E&xit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Show information about SweetStake</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>&Encrypt Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+259"/>
<source>~%n block(s) remaining</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-256"/>
<source>&Export...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-64"/>
<source>Send coins to a SweetStake address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>Modify configuration options for SweetStake</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Encrypt or decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup wallet to another location</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation>Билдирүүнү &текшерүү...</translation>
</message>
<message>
<location line="-202"/>
<source>SweetStake</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation>Капчык</translation>
</message>
<message>
<location line="+180"/>
<source>&About SweetStake</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>&File</source>
<translation>&Файл</translation>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation>&Жардам</translation>
</message>
<message>
<location line="+12"/>
<source>Tabs toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Actions toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+9"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+60"/>
<source>SweetStake client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+75"/>
<source>%n active connection(s) to SweetStake network</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+40"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+413"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-403"/>
<source>%n second(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="-312"/>
<source>About SweetStake card</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show information about SweetStake card</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>&Unlock Wallet...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+297"/>
<source>%n minute(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation>Жаңыланган</translation>
</message>
<message>
<location line="+7"/>
<source>Catching up...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Last received block was generated %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid SweetStake address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+76"/>
<source>%n second(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+18"/>
<source>Not staking</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="+109"/>
<source>A fatal error occurred. SweetStake can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+90"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+551"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation>Дарек</translation>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-515"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+155"/>
<source>DUST</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+66"/>
<source>(no label)</source>
<translation>(аты жок)</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Дарек</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<source>New receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid SweetStake address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+420"/>
<location line="+12"/>
<source>sweetstake-qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start SweetStake after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start SweetStake on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Detach databases at shutdown</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation>&Тармак</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the SweetStake client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Connect to the SweetStake network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Порт:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Терезе</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting SweetStake.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Whether to show SweetStake addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Whether to show coin control features or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>&Жарайт</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Жокко чыгаруу</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+55"/>
<source>default</source>
<translation>жарыяланбаган</translation>
</message>
<message>
<location line="+149"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting SweetStake.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+33"/>
<location line="+231"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the SweetStake network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-160"/>
<source>Stake:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-107"/>
<source>Wallet</source>
<translation>Капчык</translation>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Total:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-108"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+113"/>
<location line="+1"/>
<source>out of sync</source>
<translation>синхрондоштурулган эмес</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+348"/>
<source>N/A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>&Ачуу</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the sweetstake-qt help message to get a list with possible SweetStake command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&Консоль</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-104"/>
<source>SweetStake - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>SweetStake Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Open the SweetStake debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Консолду тазалоо</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-33"/>
<source>Welcome to the SweetStake RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+182"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Coin Control Features</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 hack</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>&Бардыгын тазалоо</translation>
</message>
<message>
<location line="+28"/>
<source>Balance:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>123.456 hack</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&Жөнөтүү</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-173"/>
<source>Enter a SweetStake address (e.g. ShuwefdniqmkeigyesHfegoeEgwqgNzknW)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+86"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+251"/>
<source>WARNING: Invalid SweetStake address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>(аты жок)</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<location filename="../sendcoinsentry.cpp" line="+25"/>
<source>Enter a label for this address to add it to your address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to send the payment to (e.g. ShuwefdniqmkeigyesHfegoeEgwqgNzknW)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Даректи алмашуу буферинен коюу</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a SweetStake address (e.g. ShuwefdniqmkeigyesHfegoeEgwqgNzknW)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-118"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. ShuwefdniqmkeigyesHfegoeEgwqgNzknW)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+203"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<location line="+203"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<source>Paste address from clipboard</source>
<translation>Даректи алмашуу буферинен коюу</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this SweetStake address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>&Бардыгын тазалоо</translation>
</message>
<message>
<location line="-87"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-64"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. ShuwefdniqmkeigyesHfegoeEgwqgNzknW)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified SweetStake address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a SweetStake address (e.g. ShuwefdniqmkeigyesHfegoeEgwqgNzknW)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Enter SweetStake signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+19"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-2"/>
<source>Open for %n block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation>%1/тармакта эмес</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Билдирүү</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 510 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 type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-211"/>
<source>, has not been successfully broadcast yet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>unknown</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+226"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Дарек</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+190"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+55"/>
<location line="+16"/>
<source>All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Дарек</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+206"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+33"/>
<source>SweetStake version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or sweetstaked</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: SweetStake.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: sweetstaked.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 15714 or testnet: 25714)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Stake your coins to support network and gain reward (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>Listen for JSON-RPC connections on <port> (default: 15715 or testnet: 25715)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-11"/>
<source>Accept command line and JSON-RPC commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+101"/>
<source>Error: Transaction creation failed </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-8"/>
<source>Importing blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-88"/>
<source>Run in the background as a daemon and accept commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-38"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+117"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+61"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong SweetStake will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-18"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-30"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Connect only to the specified node(s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+94"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-90"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+83"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-82"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-16"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-74"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-42"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Username for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>Verifying database integrity...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+57"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-48"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-84"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=SweetStakerpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "SweetStake Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Upgrade wallet to latest format</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+53"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-158"/>
<source>This help message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot obtain a lock on data directory %s. SweetStake is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-98"/>
<source>SweetStake</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+140"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+122"/>
<source>Loading addresses...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<source>Error loading blkindex.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of SweetStake</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart SweetStake to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-24"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<source>Error: could not start node</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-34"/>
<source>Loading block index...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-103"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+122"/>
<source>Unable to bind to %s on this computer. SweetStake is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-97"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Loading wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Done loading</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-167"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Error</source>
<translation>Ката</translation>
</message>
<message>
<location line="+6"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"/>
</message>
</context>
</TS> | SweetStake/SweetStake | src/qt/locale/bitcoin_ky.ts | TypeScript | mit | 107,903 |
/*
* Copyright (c) 2016 Oiri Project
*
* This software is distributed under an MIT-style license.
* See LICENSE file for more information.
*/
package com.github.kimikage.oiri.svg;
import org.w3c.dom.svg.SVGMatrix;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Transform {
private static final String sNumber = "([-+]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][-+]?[0-9]+)?)";
private static final Pattern sPatternTranslate = Pattern.compile(
"^\\s*translate\\s*\\(\\s*" + sNumber + "(?:\\s*[, ]\\s*" + sNumber + ")?\\s*\\)");
private static final Pattern sPatternScale = Pattern.compile(
"^\\s*scale\\s*\\(\\s*" + sNumber + "(?:\\s*[, ]\\s*" + sNumber + ")?\\s*\\)");
private Matrix mMatrix;
private android.graphics.Matrix mAndroidMatrix;
public Transform(String list) {
mMatrix = new Matrix();
String l = list;
for (; ; ) {
Matcher m = sPatternTranslate.matcher(l);
if (m.find()) {
float tx = Float.parseFloat(m.group(1));
String g2 = m.group(2);
float ty = g2 != null ? Float.parseFloat(g2) : 0.0f;
mMatrix = (Matrix) mMatrix.translate(tx, ty);
l = l.substring(m.end());
continue;
}
m = sPatternScale.matcher(l);
if (m.find()) {
float sx = Float.parseFloat(m.group(1));
String g2 = m.group(2);
float sy = g2 != null ? Float.parseFloat(g2) : sx;
mMatrix = (Matrix) mMatrix.scaleNonUniform(sx, sy);
l = l.substring(m.end());
continue;
}
break;
}
}
public SVGMatrix getMatrix() {
return mMatrix;
}
public android.graphics.Matrix getAndroidMatrix() {
if (mAndroidMatrix == null) {
mAndroidMatrix = new android.graphics.Matrix();
mAndroidMatrix.setValues(mMatrix.getValues());
}
return mAndroidMatrix;
}
public void getMatrixValues(float[] dest) {
mMatrix.getValues(dest);
}
}
| kimikage/oiri | app/src/main/java/com/github/kimikage/oiri/svg/Transform.java | Java | mit | 2,233 |
/**
* DevExtreme (core/component_registrator.js)
* Version: 16.2.5
* Build date: Mon Feb 27 2017
*
* Copyright (c) 2012 - 2017 Developer Express Inc. ALL RIGHTS RESERVED
* EULA: https://www.devexpress.com/Support/EULAs/DevExtreme.xml
*/
"use strict";
var $ = require("jquery"),
errors = require("./errors"),
MemorizedCallbacks = require("./memorized_callbacks"),
publicComponentUtils = require("./utils/public_component");
var callbacks = new MemorizedCallbacks;
var registerComponent = function(name, namespace, componentClass) {
if (!componentClass) {
componentClass = namespace
} else {
namespace[name] = componentClass
}
publicComponentUtils.name(componentClass, name);
callbacks.fire(name, componentClass)
};
registerComponent.callbacks = callbacks;
var registerJQueryComponent = function(name, componentClass) {
$.fn[name] = function(options) {
var result, isMemberInvoke = "string" === typeof options;
if (isMemberInvoke) {
var memberName = options,
memberArgs = $.makeArray(arguments).slice(1);
this.each(function() {
var instance = componentClass.getInstance(this);
if (!instance) {
throw errors.Error("E0009", name)
}
var member = instance[memberName],
memberValue = member.apply(instance, memberArgs);
if (void 0 === result) {
result = memberValue
}
})
} else {
this.each(function() {
var instance = componentClass.getInstance(this);
if (instance) {
instance.option(options)
} else {
new componentClass(this, options)
}
});
result = this
}
return result
}
};
callbacks.add(registerJQueryComponent);
module.exports = registerComponent;
| imironica/Fraud-Detection-System | FraudDetection.Web/wwwroot/node_modules/devextreme/core/component_registrator.js | JavaScript | mit | 1,997 |
class MemeSlug < ActiveRecord::Base
belongs_to :meme
end
| b1nary/MayMay | app/models/meme_slug.rb | Ruby | mit | 59 |
using System;
using System.Text;
using System.Web;
using System.Web.Http.Description;
namespace WebApiAuthSample.Areas.HelpPage
{
public static class ApiDescriptionExtensions
{
/// <summary>
/// Generates an URI-friendly ID for the <see cref="ApiDescription"/>. E.g. "Get-Values-id_name" instead of "GetValues/{id}?name={name}"
/// </summary>
/// <param name="description">The <see cref="ApiDescription"/>.</param>
/// <returns>The ID as a string.</returns>
public static string GetFriendlyId(this ApiDescription description)
{
string path = description.RelativePath;
string[] urlParts = path.Split('?');
string localPath = urlParts[0];
string queryKeyString = null;
if (urlParts.Length > 1)
{
string query = urlParts[1];
string[] queryKeys = HttpUtility.ParseQueryString(query).AllKeys;
queryKeyString = String.Join("_", queryKeys);
}
StringBuilder friendlyPath = new StringBuilder();
friendlyPath.AppendFormat("{0}-{1}",
description.HttpMethod.Method,
localPath.Replace("/", "-").Replace("{", String.Empty).Replace("}", String.Empty));
if (queryKeyString != null)
{
friendlyPath.AppendFormat("_{0}", queryKeyString.Replace('.', '-'));
}
return friendlyPath.ToString();
}
}
} | asezer/WebApiAuthSample | WebApiAuthSample/Areas/HelpPage/ApiDescriptionExtensions.cs | C# | mit | 1,506 |
package main
import (
"context"
"fmt"
"log"
"net/http"
"strconv"
"strings"
"time"
"github.com/PuerkitoBio/goquery"
)
const (
userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"
timeLayout = "02/01/2006"
storagePath = ".local/share"
baseURL = "https://www.tefas.gov.tr/FonAnaliz.aspx?FonKod=%v"
)
var (
ErrDisabled = fmt.Errorf("disabled on weekends")
)
func GetFunds(ctx context.Context, codes ...string) ([]Fund, error) {
c := &http.Client{Timeout: time.Minute}
today := time.Now()
switch today.Weekday() {
case 6, 0: // saturday and sunday
return nil, ErrDisabled
}
var funds []Fund
for _, code := range codes {
code = strings.ToUpper(code)
u := fmt.Sprintf(baseURL, code)
req, _ := http.NewRequest("GET", u, nil)
req = req.WithContext(ctx)
req.Header.Set("User-Agent", userAgent)
req.Header.Set("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
resp, err := c.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
log.Printf("unexpected status code: %v", resp.StatusCode)
continue
}
doc, err := goquery.NewDocumentFromReader(resp.Body)
if err != nil {
return nil, err
}
fundName := strings.TrimSpace(doc.Find(".main-indicators h2").Text())
fund := Fund{
Code: code,
Name: fundName,
}
fund.Price = atof(doc.Find(".top-list > li:nth-child(1) span").Text())
fund.Daily = atof(doc.Find(".top-list > li:nth-child(2) span").Text())
doc.Find(".price-indicators li span").Each(func(i int, sel *goquery.Selection) {
changePercent := atof(sel.Text())
switch i {
case 0:
fund.Monthly = changePercent
case 1:
fund.Quarterly = changePercent
case 2:
fund.Biannual = changePercent
case 3:
fund.Annual = changePercent
}
})
funds = append(funds, fund)
}
return funds, nil
}
type Fund struct {
Type FundType
Code string
Name string
Price float64
Daily float64
Monthly float64
Quarterly float64
Biannual float64
Annual float64
}
type FundType uint8
const (
CommodityFunds FundType = 3
FixedIncomeFunds FundType = 6
ForeignEquityFunds FundType = 111
)
func atof(s string) float64 {
s = strings.TrimPrefix(s, "%")
s = strings.ReplaceAll(s, ",", ".")
f, _ := strconv.ParseFloat(s, 64)
return f
}
| igungor/cmd | notion-yt/fund.go | GO | mit | 2,429 |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="eo" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About BitSeeds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+39"/>
<source><b>BitSeeds</b> version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The BitSeeds developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation>
Tio ĉi estas eksperimenta programo.
Eldonita laŭ la permesilo MIT/X11. Vidu la kunan dosieron COPYING aŭ http://www.opensource.org/licenses/mit-license.php.
Tiu ĉi produkto enhavas erojn kreitajn de la "OpenSSL Project" por uzo en la "OpenSSL Toolkit" (http://www.openssl.org/) kaj ĉifrajn erojn kreitajn de Eric Young (eay@cryptsoft.com) kaj UPnP-erojn kreitajn de Thomas Bernard.</translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation>Duoble-klaku por redakti adreson aŭ etikedon</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Krei novan adreson</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopii elektitan adreson al la tondejo</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-46"/>
<source>These are your BitSeeds addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<source>&Copy Address</source>
<translation>&Kopii Adreson</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a BitSeeds address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation>Forigi la elektitan adreson el la listo</translation>
</message>
<message>
<location line="-14"/>
<source>Verify a message to ensure it was signed with a specified BitSeeds address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Forigi</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation>Kopii &Etikedon</translation>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation>&Redakti</translation>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Perkome disigita dosiero (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Etikedo</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adreso</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(neniu etikedo)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Dialogo pri pasfrazo</translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Enigu pasfrazon</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Nova pasfrazo</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Ripetu la novan pasfrazon</translation>
</message>
<message>
<location line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+35"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Enigu novan pasfrazon por la monujo.<br/>Bonvolu uzi pasfrazon kun <b>almenaŭ 10 hazardaj signoj</b>, aŭ <b>almenaŭ ok vortoj</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Ĉifri la monujon</translation>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Ĉi tiu operacio bezonas vian monujan pasfrazon, por malŝlosi la monujon.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Malŝlosi la monujon</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Ĉi tiu operacio bezonas vian monujan pasfrazon, por malĉifri la monujon.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Malĉifri la monujon</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Ŝanĝi la pasfrazon</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Tajpu la malnovan kaj novan monujajn pasfrazojn.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Konfirmo de ĉifrado de la monujo</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Ĉu vi certas, ke vi volas ĉifri la monujon?</translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation>GRAVE: antaŭaj sekur-kopioj de via monujo-dosiero estas forigindaj kiam vi havas nove kreitan ĉifritan monujo-dosieron. Pro sekureco, antaŭaj kopioj de la neĉifrita dosiero ne plu funkcios tuj kiam vi ekuzos la novan ĉifritan dosieron.</translation>
</message>
<message>
<location line="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Atentu: la majuskla baskulo estas ŝaltita!</translation>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation>La monujo estas ĉifrita</translation>
</message>
<message>
<location line="-58"/>
<source>BitSeeds will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Ĉifrado de la monujo fiaskis</translation>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Ĉifrado de monujo fiaskis pro interna eraro. Via monujo ne estas ĉifrita.</translation>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation>La pasfrazoj entajpitaj ne samas.</translation>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation>Malŝloso de la monujo fiaskis</translation>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>La pasfrazo enigita por ĉifrado de monujo ne ĝustas.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Malĉifrado de la monujo fiaskis</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Vi sukcese ŝanĝis la pasfrazon de la monujo.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+280"/>
<source>Sign &message...</source>
<translation>Subskribi &mesaĝon...</translation>
</message>
<message>
<location line="+242"/>
<source>Synchronizing with network...</source>
<translation>Sinkronigante kun reto...</translation>
</message>
<message>
<location line="-308"/>
<source>&Overview</source>
<translation>&Superrigardo</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Vidigi ĝeneralan superrigardon de la monujo</translation>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation>&Transakcioj</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Esplori historion de transakcioj</translation>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-13"/>
<source>&Receive coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-7"/>
<source>&Send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>E&xit</source>
<translation>&Eliri</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Eliri la aplikaĵon</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about BitSeeds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Pri &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Vidigi informojn pri Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Agordoj...</translation>
</message>
<message>
<location line="+4"/>
<source>&Encrypt Wallet...</source>
<translation>Ĉifri &Monujon...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Krei sekurkopion de la monujo...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>Ŝanĝi &Pasfrazon...</translation>
</message>
<message numerus="yes">
<location line="+250"/>
<source>~%n block(s) remaining</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-247"/>
<source>&Export...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Send coins to a BitSeeds address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Modify configuration options for BitSeeds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Encrypt or decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup wallet to another location</source>
<translation>Krei alilokan sekurkopion de monujo</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Ŝanĝi la pasfrazon por ĉifri la monujon</translation>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation>Sen&cimiga fenestro</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Malfermi konzolon de sencimigo kaj diagnozo</translation>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation>&Kontroli mesaĝon...</translation>
</message>
<message>
<location line="-200"/>
<source>BitSeeds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation>Monujo</translation>
</message>
<message>
<location line="+178"/>
<source>&About BitSeeds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>&Montri / Kaŝi</translation>
</message>
<message>
<location line="+9"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>&File</source>
<translation>&Dosiero</translation>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation>&Agordoj</translation>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation>&Helpo</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Langeto-breto</translation>
</message>
<message>
<location line="+8"/>
<source>Actions toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+9"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location line="+0"/>
<location line="+60"/>
<source>BitSeeds client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+70"/>
<source>%n active connection(s) to BitSeeds network</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+40"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+413"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-403"/>
<source>%n second(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="-284"/>
<source>&Unlock Wallet...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+288"/>
<source>%n minute(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation>Ĝisdata</translation>
</message>
<message>
<location line="+7"/>
<source>Catching up...</source>
<translation>Ĝisdatigante...</translation>
</message>
<message>
<location line="+10"/>
<source>Last received block was generated %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation>Sendita transakcio</translation>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation>Envenanta transakcio</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Dato: %1
Sumo: %2
Tipo: %3
Adreso: %4
</translation>
</message>
<message>
<location line="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid BitSeeds address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Monujo estas <b>ĉifrita</b> kaj aktuale <b>malŝlosita</b></translation>
</message>
<message>
<location line="+10"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Monujo estas <b>ĉifrita</b> kaj aktuale <b>ŝlosita</b></translation>
</message>
<message>
<location line="+25"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+76"/>
<source>%n second(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s)</source>
<translation><numerusform>%n horo</numerusform><numerusform>%n horoj</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation><numerusform>%n tago</numerusform><numerusform>%n tagoj</numerusform></translation>
</message>
<message>
<location line="+18"/>
<source>Not staking</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="+109"/>
<source>A fatal error occurred. BitSeeds can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+90"/>
<source>Network Alert</source>
<translation>Reta Averto</translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation>Kvanto:</translation>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation>Bajtoj:</translation>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation>Sumo:</translation>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation>Prioritato:</translation>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation>Krompago:</translation>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation>Malalta Eligo:</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+551"/>
<source>no</source>
<translation>ne</translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation>Post krompago:</translation>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation>Restmono:</translation>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation>(mal)elekti ĉion</translation>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation>Arboreĝimo</translation>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation>Listreĝimo</translation>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation>Sumo</translation>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation>Adreso</translation>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation>Konfirmoj</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation>Konfirmita</translation>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation>Prioritato</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-515"/>
<source>Copy address</source>
<translation>Kopii adreson</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopii etikedon</translation>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation>Kopii sumon</translation>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation>Kopii transakcian ID-on</translation>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation>Kopii kvanton</translation>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation>Kopii krompagon</translation>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation>Kopii post krompago</translation>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation>Kopii bajtojn</translation>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation>Kopii prioritaton</translation>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation>Kopii malaltan eligon</translation>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation>Kopii restmonon</translation>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation>plej alta</translation>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation>alta</translation>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation>mezalta</translation>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation>meza</translation>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation>mezmalalta</translation>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation>malalta</translation>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation>plej malalta</translation>
</message>
<message>
<location line="+155"/>
<source>DUST</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation>jes</translation>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+66"/>
<source>(no label)</source>
<translation>(neniu etikedo)</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation>restmono de %1 (%2)</translation>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation>(restmono)</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Redakti Adreson</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Etikedo</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Adreso</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<source>New receiving address</source>
<translation>Nova adreso por ricevi</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Nova adreso por sendi</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Redakti adreson por ricevi</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Redakti adreson por sendi</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>La adreso enigita "%1" jam ekzistas en la adresaro.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid BitSeeds address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Ne eblis malŝlosi monujon.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Fiaskis kreo de nova ŝlosilo.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+420"/>
<location line="+12"/>
<source>BitSeeds-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Agordaĵoj</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>Ĉ&efa</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>Krompago</translation>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start BitSeeds after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start BitSeeds on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Detach databases at shutdown</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation>&Reto</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the BitSeeds client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Mapigi pordon per &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the BitSeeds network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>Prokurila &IP:</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Pordo:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>la pordo de la prokurilo (ekz. 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>Versio de SOCKS:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>la versio de SOCKS ĉe la prokurilo (ekz. 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Fenestro</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Montri nur sistempletan piktogramon post minimumigo de la fenestro.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Minimumigi al la sistempleto anstataŭ al la taskopleto</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Minimumigi la aplikaĵon anstataŭ eliri kaj ĉesi kiam la fenestro estas fermita. Se tiu ĉi estas agordita, la aplikaĵo ĉesas nur kiam oni elektas "Eliri" el la menuo.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>M&inimumigi je fermo</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Aspekto</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>&Lingvo de la fasado:</translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting BitSeeds.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&Unuo por vidigi sumojn:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Elekti la defaŭltan manieron por montri bitmonajn sumojn en la interfaco, kaj kiam vi sendos bitmonon.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show BitSeeds addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>&Montri adresojn en la listo de transakcioj</translation>
</message>
<message>
<location line="+7"/>
<source>Whether to show coin control features or not.</source>
<translation>Ĉu montri detalan adres-regilon, aŭ ne.</translation>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>&Bone</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Nuligi</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+55"/>
<source>default</source>
<translation>defaŭlta</translation>
</message>
<message>
<location line="+149"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting BitSeeds.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>La prokurila adreso estas malvalida.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Formularo</translation>
</message>
<message>
<location line="+33"/>
<location line="+231"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the BitSeeds network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-160"/>
<source>Stake:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-107"/>
<source>Wallet</source>
<translation>Monujo</translation>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation>via aktuala elspezebla saldo</translation>
</message>
<message>
<location line="+71"/>
<source>Immature:</source>
<translation>Nematura:</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation>Minita saldo, kiu ankoraŭ ne maturiĝis</translation>
</message>
<message>
<location line="+20"/>
<source>Total:</source>
<translation>Totalo:</translation>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation>via aktuala totala saldo</translation>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Lastaj transakcioj</b></translation>
</message>
<message>
<location line="-108"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+113"/>
<location line="+1"/>
<source>out of sync</source>
<translation>nesinkronigita</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Nomo de kliento</translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+348"/>
<source>N/A</source>
<translation>neaplikebla</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Versio de kliento</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>&Informoj</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>uzas OpenSSL-version</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>Horo de lanĉo</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Reto</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Nombro de konektoj</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>Blokĉeno</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Aktuala nombro de blokoj</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation>Supozita totalo da blokoj</translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>Horo de la lasta bloko</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>&Malfermi</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the BitSeeds-Qt help message to get a list with possible BitSeeds command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&Konzolo</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>Dato de kompilado</translation>
</message>
<message>
<location line="-104"/>
<source>BitSeeds - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>BitSeeds Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>Sencimiga protokoldosiero</translation>
</message>
<message>
<location line="+7"/>
<source>Open the BitSeeds debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Malplenigi konzolon</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-33"/>
<source>Welcome to the BitSeeds RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Uzu la sagojn supran kaj malsupran por esplori la historion, kaj <b>stir-L</b> por malplenigi la ekranon.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Tajpu <b>help</b> por superrigardo de la disponeblaj komandoj.</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+182"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Sendi Monon</translation>
</message>
<message>
<location line="+76"/>
<source>Coin Control Features</source>
<translation>Monregaj Opcioj</translation>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation>Enigoj...</translation>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation>Nesufiĉa mono!</translation>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation>Kvanto:</translation>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation>Bajtoj:</translation>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation>Sumo:</translation>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 BITS</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation>Prioritato:</translation>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation>Krompago:</translation>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation>Malalta Eligo:</translation>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation>Post krompago:</translation>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation>Sendi samtempe al pluraj ricevantoj</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>Aldoni &Ricevonton</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>&Forigi ĉion</translation>
</message>
<message>
<location line="+28"/>
<source>Balance:</source>
<translation>Saldo:</translation>
</message>
<message>
<location line="+16"/>
<source>123.456 BITS</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Konfirmi la sendon</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>Ŝendi</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-173"/>
<source>Enter a BitSeeds address (e.g. A8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation>Kopii kvanton</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopii sumon</translation>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation>Kopii krompagon</translation>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation>Kopii post krompago</translation>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation>Kopii bajtojn</translation>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation>Kopii prioritaton</translation>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation>Kopii malaltan eligon</translation>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation>Kopii restmonon</translation>
</message>
<message>
<location line="+86"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Konfirmi sendon de bitmono</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>La adreso de la ricevonto ne validas. Bonvolu kontroli.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>La pagenda sumo devas esti pli ol 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>La sumo estas pli granda ol via saldo.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>La sumo kun la %1 krompago estas pli granda ol via saldo.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Iu adreso estas ripetita. Vi povas sendi al ĉiu adreso po unufoje en iu send-operacio.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+251"/>
<source>WARNING: Invalid BitSeeds address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>(neniu etikedo)</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>&Sumo:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>&Ricevonto:</translation>
</message>
<message>
<location line="+24"/>
<location filename="../sendcoinsentry.cpp" line="+25"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Tajpu etikedon por tiu ĉi adreso kaj aldonu ĝin al via adresaro</translation>
</message>
<message>
<location line="+9"/>
<source>&Label:</source>
<translation>&Etikedo:</translation>
</message>
<message>
<location line="+18"/>
<source>The address to send the payment to (e.g. A8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Alglui adreson el tondejo</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a BitSeeds address (e.g. A8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>Subskriboj - Subskribi / Kontroli mesaĝon</translation>
</message>
<message>
<location line="+13"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation>&Subskribi Mesaĝon</translation>
</message>
<message>
<location line="-118"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation>Vi povas subskribi mesaĝon per viaj adresoj, por pravigi ke vi estas la posedanto de tiuj adresoj. Atentu, ke vi ne subskriu ion neprecizan, ĉar trompisto povus ruzi kontraŭ vi kaj ŝteli vian identecon. Subskribu nur plene detaligitaj deklaroj pri kiuj vi konsentas.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. A8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+203"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<location line="+203"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-193"/>
<source>Paste address from clipboard</source>
<translation>Alglui adreson de tondejo</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>Tajpu la mesaĝon, kiun vi volas sendi, cîi tie</translation>
</message>
<message>
<location line="+24"/>
<source>Copy the current signature to the system clipboard</source>
<translation>Kopii la aktualan subskribon al la tondejo</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this BitSeeds address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all sign message fields</source>
<translation>Reagordigi ĉiujn prisubskribajn kampojn</translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>&Forigi Ĉion</translation>
</message>
<message>
<location line="-87"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation>&Kontroli Mesaĝon</translation>
</message>
<message>
<location line="-64"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation>Enmeti la subskriban adreson, la mesaĝon (kune kun ĉiu linisalto, spaceto, taboj, ktp. precize) kaj la subskribon ĉi sube por kontroli la mesaĝon. Atentu, ke vi ne komprenu per la subskribo pli ol la enhavo de la mesaĝo mem, por eviti homo-en-la-mezo-atakon.</translation>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. A8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified BitSeeds address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation>Reagordigi ĉiujn prikontrolajn kampojn</translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a BitSeeds address (e.g. A8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Klaku "Subskribi Mesaĝon" por krei subskribon</translation>
</message>
<message>
<location line="+3"/>
<source>Enter BitSeeds signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>La adreso, kiun vi enmetis, estas nevalida.</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>Bonvolu kontroli la adreson kaj reprovi.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation>La adreso, kiun vi enmetis, referencas neniun ŝlosilon.</translation>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>Malŝloso de monujo estas nuligita.</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>La privata ŝlosilo por la enigita adreso ne disponeblas.</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Subskribo de mesaĝo fiaskis.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Mesaĝo estas subskribita.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Ne eblis malĉifri la subskribon.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Bonvolu kontroli la subskribon kaj reprovu.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>La subskribo ne kongruis kun la mesaĝ-kompilaĵo.</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Kontrolo de mesaĝo malsukcesis.</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Mesaĝo sukcese kontrolita.</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+19"/>
<source>Open until %1</source>
<translation>Malferma ĝis %1</translation>
</message>
<message numerus="yes">
<location line="-2"/>
<source>Open for %n block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation>%1/senkonekte</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/nekonfirmite</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 konfirmoj</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Stato</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation><numerusform>, elsendita(j) tra %n nodo</numerusform><numerusform>, elsendita(j) tra %n nodoj</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>Fonto</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Kreita</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>De</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>Al</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation>propra adreso</translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>etikedo</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Kredito</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation><numerusform>maturiĝos post %n bloko</numerusform><numerusform>maturiĝos post %n blokoj</numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>ne akceptita</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Debeto</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Krompago</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Neta sumo</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Mesaĝo</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Komento</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>Transakcia ID</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>Sencimigaj informoj</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Transakcio</translation>
</message>
<message>
<location line="+5"/>
<source>Inputs</source>
<translation>Enigoj</translation>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Sumo</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>vera</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>malvera</translation>
</message>
<message>
<location line="-211"/>
<source>, has not been successfully broadcast yet</source>
<translation>, ankoraŭ ne elsendita sukcese</translation>
</message>
<message>
<location line="+35"/>
<source>unknown</source>
<translation>nekonata</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Transakciaj detaloj</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Tiu ĉi panelo montras detalan priskribon de la transakcio</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+226"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Tipo</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adreso</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Sumo</translation>
</message>
<message>
<location line="+60"/>
<source>Open until %1</source>
<translation>Malferma ĝis %1</translation>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Konfirmita (%1 konfirmoj)</translation>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation><numerusform>Malferma dum ankoraŭ %n bloko</numerusform><numerusform>Malferma dum ankoraŭ %n blokoj</numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation>Senkonekte</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation>Nekonfirmita</translation>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Tiun ĉi blokon ne ricevis ajna alia nodo, kaj ĝi verŝajne ne akceptiĝos!</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Kreita sed ne akceptita</translation>
</message>
<message>
<location line="+42"/>
<source>Received with</source>
<translation>Ricevita kun</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Ricevita de</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Sendita al</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Pago al vi mem</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Minita</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>neaplikebla</translation>
</message>
<message>
<location line="+190"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Transakcia stato. Ŝvebi super tiu ĉi kampo por montri la nombron de konfirmoj.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Dato kaj horo kiam la transakcio alvenis.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Tipo de transakcio.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Celadreso de la transakcio.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Sumo elprenita de aŭ aldonita al la saldo.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+55"/>
<location line="+16"/>
<source>All</source>
<translation>Ĉiuj</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Hodiaŭ</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Ĉi-semajne</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Ĉi-monate</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Pasintmonate</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Ĉi-jare</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Intervalo...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Ricevita kun</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Sendita al</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Al vi mem</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Minita</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Aliaj</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Tajpu adreson aŭ etikedon por serĉi</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Minimuma sumo</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Kopii adreson</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopii etikedon</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopii sumon</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation>Kopii transakcian ID-on</translation>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Redakti etikedon</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Montri detalojn de transakcio</translation>
</message>
<message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Perkome disigita dosiero (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Konfirmita</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Tipo</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Etikedo</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adreso</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Sumo</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Intervalo:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>al</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+206"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+33"/>
<source>BitSeeds version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation>Uzado:</translation>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or bitseedsd</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation>Listigi komandojn</translation>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation>Vidigi helpon pri iu komando</translation>
</message>
<message>
<location line="+2"/>
<source>Options:</source>
<translation>Agordoj:</translation>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: bitseeds.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: bitseedsd.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation>Specifi monujan dosieron (ene de dosierujo por datumoj)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Specifi dosieron por datumoj</translation>
</message>
<message>
<location line="+2"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Specifi grandon de datumbazo je megabajtoj (defaŭlte: 25)</translation>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 15714 or testnet: 25714)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Subteni maksimume <n> konektojn al samtavolanoj (defaŭlte: 125)</translation>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Konekti al nodo por ricevi adresojn de samtavolanoj, kaj malkonekti</translation>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation>Specifi vian propran publikan adreson</translation>
</message>
<message>
<location line="+5"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Stake your coins to support network and gain reward (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Sojlo por malkonekti misagantajn samtavolanojn (defaŭlte: 100)</translation>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Nombro da sekundoj por rifuzi rekonekton de misagantaj samtavolanoj (defaŭlte: 86400)</translation>
</message>
<message>
<location line="-44"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation>Eraro okazis dum estigo de RPC-pordo %u por aŭskulti per IPv4: %s</translation>
</message>
<message>
<location line="+51"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>Listen for JSON-RPC connections on <port> (default: 15715 or testnet: 25715)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-11"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Akcepti komandojn JSON-RPC kaj el komandlinio</translation>
</message>
<message>
<location line="+101"/>
<source>Error: Transaction creation failed </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-8"/>
<source>Importing blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-88"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Ruli fone kiel demono kaj akcepti komandojn</translation>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation>Uzi la test-reton</translation>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Akcepti konektojn el ekstere (defaŭlte: 1 se ne estas -proxy nek -connect)</translation>
</message>
<message>
<location line="-38"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation>Eraro okazis dum estigo de RPC-pordo %u por aŭskulti per IPv6; retrodefaŭltas al IPv4: %s</translation>
</message>
<message>
<location line="+117"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Averto: -paytxfee estas agordita per tre alta valoro! Tio estas la krompago, kion vi pagos se vi sendas la transakcion.</translation>
</message>
<message>
<location line="+61"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong BitSeeds will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation>Averto: okazis eraro dum lego de wallet.dat! Ĉiuj ŝlosiloj sukcese legiĝis, sed la transakciaj datumoj aŭ la adresaro eble mankas aŭ malĝustas.</translation>
</message>
<message>
<location line="-18"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation>Averto: via wallet.dat estas difektita, sed la datumoj sukcese saviĝis! La originala wallet.dat estas nun konservita kiel wallet.{timestamp}.bak en %s; se via saldo aŭ transakcioj estas malĝustaj vi devus restaŭri per alia sekurkopio.</translation>
</message>
<message>
<location line="-30"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation>Provo ripari privatajn ŝlosilojn el difektita wallet.dat</translation>
</message>
<message>
<location line="+4"/>
<source>Block creation options:</source>
<translation>Blok-kreaj agordaĵoj:</translation>
</message>
<message>
<location line="-62"/>
<source>Connect only to the specified node(s)</source>
<translation>Konekti nur al specifita(j) nodo(j)</translation>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>Malkovri la propran IP-adreson (defaŭlte: 1 dum aŭskultado sen -externalip)</translation>
</message>
<message>
<location line="+94"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>Ne sukcesis aŭskulti ajnan pordon. Uzu -listen=0 se tion vi volas.</translation>
</message>
<message>
<location line="-90"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+83"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-82"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>Maksimuma po riceva bufro por konektoj, <n>*1000 bajtoj (defaŭlte: 5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>Maksimuma po senda bufro por konektoj, <n>*1000 bajtoj (defaŭlte: 1000)</translation>
</message>
<message>
<location line="-16"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation>Konekti nur la nodoj en la reto <net> (IPv4, IPv6 aŭ Tor)</translation>
</message>
<message>
<location line="+28"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation>SSL-agordaĵoj: (vidu la vikio de Bitmono por instrukcioj pri agordado de SSL)</translation>
</message>
<message>
<location line="-74"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Sendi spurajn/sencimigajn informojn al la konzolo anstataŭ al dosiero debug.log</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>Agordi minimuman grandon de blokoj je bajtoj (defaŭlte: 0)</translation>
</message>
<message>
<location line="-29"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>Malpligrandigi la sencimigan protokol-dosieron kiam kliento lanĉiĝas (defaŭlte: 1 kiam mankas -debug)</translation>
</message>
<message>
<location line="-42"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Specifi konektan tempolimon je milisekundoj (defaŭlte: 5000)</translation>
</message>
<message>
<location line="+109"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Uzi UPnP por mapi la aŭskultan pordon (defaŭlte: 0)</translation>
</message>
<message>
<location line="-1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Uzi UPnP por mapi la aŭskultan pordon (defaŭlte: 1 dum aŭskultado)</translation>
</message>
<message>
<location line="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Username for JSON-RPC connections</source>
<translation>Salutnomo por konektoj JSON-RPC</translation>
</message>
<message>
<location line="+47"/>
<source>Verifying database integrity...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+57"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>Averto: tiu ĉi versio estas eksdata. Vi bezonas ĝisdatigon!</translation>
</message>
<message>
<location line="-48"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation>wallet.dat estas difektita, riparo malsukcesis</translation>
</message>
<message>
<location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation>Pasvorto por konektoj JSON-RPC</translation>
</message>
<message>
<location line="-84"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=bitseedsrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "BitSeeds Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Permesi konektojn JSON-RPC de specifa IP-adreso</translation>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Sendi komandon al nodo ĉe <ip> (defaŭlte: 127.0.0.1)</translation>
</message>
<message>
<location line="+1"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Plenumi komandon kiam plej bona bloko ŝanĝiĝas (%s en cmd anstataŭiĝas per bloka haketaĵo)</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>Plenumi komandon kiam monuja transakcio ŝanĝiĝas (%s en cmd anstataŭiĝas per TxID)</translation>
</message>
<message>
<location line="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Upgrade wallet to latest format</source>
<translation>Ĝisdatigi monujon al plej lasta formato</translation>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Agordi la grandon de la ŝlosilo-vico al <n> (defaŭlte: 100)</translation>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Reskani la blokĉenon por mankantaj monujaj transakcioj</translation>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Uzi OpenSSL (https) por konektoj JSON-RPC</translation>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Dosiero de servila atestilo (defaŭlte: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Dosiero de servila privata ŝlosilo (defaŭlte: server.pem)</translation>
</message>
<message>
<location line="+1"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+53"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-158"/>
<source>This help message</source>
<translation>Tiu ĉi helpmesaĝo</translation>
</message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot obtain a lock on data directory %s. BitSeeds is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-98"/>
<source>BitSeeds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+140"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Ne eblis bindi al %s en tiu ĉi komputilo (bind resendis eraron %d, %s)</translation>
</message>
<message>
<location line="-130"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Permesi DNS-elserĉojn por -addnote, -seednote kaj -connect</translation>
</message>
<message>
<location line="+122"/>
<source>Loading addresses...</source>
<translation>Ŝarĝante adresojn...</translation>
</message>
<message>
<location line="-15"/>
<source>Error loading blkindex.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Eraro dum ŝargado de wallet.dat: monujo difektita</translation>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of BitSeeds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart BitSeeds to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation>Eraro dum ŝargado de wallet.dat</translation>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Nevalid adreso -proxy: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Nekonata reto specifita en -onlynet: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>Nekonata versio de -socks petita: %i</translation>
</message>
<message>
<location line="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>Ne eblas trovi la adreson -bind: '%s'</translation>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>Ne eblas trovi la adreson -externalip: '%s'</translation>
</message>
<message>
<location line="-24"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Nevalida sumo por -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+44"/>
<source>Error: could not start node</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation>Nevalida sumo</translation>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation>Nesufiĉa mono</translation>
</message>
<message>
<location line="-34"/>
<source>Loading block index...</source>
<translation>Ŝarĝante blok-indekson...</translation>
</message>
<message>
<location line="-103"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Aldoni nodon por alkonekti kaj provi daŭrigi la malferman konekton</translation>
</message>
<message>
<location line="+122"/>
<source>Unable to bind to %s on this computer. BitSeeds is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-97"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Loading wallet...</source>
<translation>Ŝargado de monujo...</translation>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation>Ne eblas malpromocii monujon</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation>Ne eblas skribi defaŭltan adreson</translation>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation>Reskanado...</translation>
</message>
<message>
<location line="+5"/>
<source>Done loading</source>
<translation>Ŝargado finiĝis</translation>
</message>
<message>
<location line="-167"/>
<source>To use the %s option</source>
<translation>Por uzi la agordon %s</translation>
</message>
<message>
<location line="+14"/>
<source>Error</source>
<translation>Eraro</translation>
</message>
<message>
<location line="+6"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>Vi devas agordi rpcpassword=<password> en la konfigura dosiero:
%s
Se la dosiero ne ekzistas, kreu ĝin kun permeso "nur posedanto rajtas legi".</translation>
</message>
</context>
</TS> | BitSeedsFoundation/BitSeeds | src/qt/locale/bitcoin_eo.ts | TypeScript | mit | 117,796 |
<?
// DATABASE
define("DB_SERVER", "localhost"); //the mysql server address - often, localhost
define("DB_USERNAME", "root"); //the mysql username
define("DB_PASSWORD", "11913431"); //the mysql password
define("DB_NAME", "draygon"); //the name of the mysql database
// CLIENT
define("CLIENT_NAME", "me"); //the name of the client company
define("CLIENT_EMAIL", "deankinns@gmail.com"); //the email address that the contact form will go to
// WEBSITE
define("WEBSITE_URL", $_SERVER['HTTP_HOST']); //the website URL, without the http://
// WEBSITE FRONT END CONFIGURATION
define("TITLE_APPEND", " - " . CLIENT_NAME); //the value entered here will be appended to all page titles (can be blank)
// - will be overwritten by SEO title
define("DEFAULT_TITLE", "Security Fencing Contractor Services - Taunton, Somerset, Devon, Dorset, Cornwall"); //the default page title, used if no title set by CMS and for the Home Page
define("META_KEYWORDS", "taunton fencing contractor, south west fencing contractor, taunton fencing services, high security fencing contractors, security gate installation somerset, , close board fencing installation, wooden fencing taunton, automatic driveway gates, security barrier installation somerset, building site security fencing somerset and devon, site hording installation somerset, electrical fence installation somerset, , residential railings contractor taunton, commercial fencing fitter devon and cornwall, jackson expert installer"); //comma separated list of keywords - used when no keywords set in the CMS
define("META_DESCRIPTION", ""); //default META Description - used when no description set in the CMS
| snider/draygonknights | server/app/classes/config.php | PHP | mit | 1,743 |
#!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test block processing."""
import copy
import struct
import time
from test_framework.blocktools import create_block, create_coinbase, create_tx_with_script, get_legacy_sigopcount_block
from test_framework.key import CECKey
from test_framework.messages import (
CBlock,
COIN,
COutPoint,
CTransaction,
CTxIn,
CTxOut,
MAX_BLOCK_BASE_SIZE,
uint256_from_compact,
uint256_from_str,
)
from test_framework.mininode import P2PDataStore
from test_framework.script import (
CScript,
MAX_SCRIPT_ELEMENT_SIZE,
OP_2DUP,
OP_CHECKMULTISIG,
OP_CHECKMULTISIGVERIFY,
OP_CHECKSIG,
OP_CHECKSIGVERIFY,
OP_ELSE,
OP_ENDIF,
OP_EQUAL,
OP_DROP,
OP_FALSE,
OP_HASH160,
OP_IF,
OP_INVALIDOPCODE,
OP_RETURN,
OP_TRUE,
SIGHASH_ALL,
SignatureHash,
hash160,
)
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
MAX_BLOCK_SIGOPS = 20000
# Use this class for tests that require behavior other than normal "mininode" behavior.
# For now, it is used to serialize a bloated varint (b64).
class CBrokenBlock(CBlock):
def initialize(self, base_block):
self.vtx = copy.deepcopy(base_block.vtx)
self.hashMerkleRoot = self.calc_merkle_root()
def serialize(self, with_witness=False):
r = b""
r += super(CBlock, self).serialize()
r += struct.pack("<BQ", 255, len(self.vtx))
for tx in self.vtx:
if with_witness:
r += tx.serialize_with_witness()
else:
r += tx.serialize_without_witness()
return r
def normal_serialize(self):
return super().serialize()
class FullBlockTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
self.extra_args = [[]]
def run_test(self):
node = self.nodes[0] # convenience reference to the node
self.bootstrap_p2p() # Add one p2p connection to the node
self.block_heights = {}
self.coinbase_key = CECKey()
self.coinbase_key.set_secretbytes(b"horsebattery")
self.coinbase_pubkey = self.coinbase_key.get_pubkey()
self.tip = None
self.blocks = {}
self.genesis_hash = int(self.nodes[0].getbestblockhash(), 16)
self.block_heights[self.genesis_hash] = 0
self.spendable_outputs = []
# Create a new block
b0 = self.next_block(0)
self.save_spendable_output()
self.sync_blocks([b0])
# Allow the block to mature
blocks = []
for i in range(99):
blocks.append(self.next_block(5000 + i))
self.save_spendable_output()
self.sync_blocks(blocks)
# collect spendable outputs now to avoid cluttering the code later on
out = []
for i in range(33):
out.append(self.get_spendable_output())
# Start by building a couple of blocks on top (which output is spent is
# in parentheses):
# genesis -> b1 (0) -> b2 (1)
b1 = self.next_block(1, spend=out[0])
self.save_spendable_output()
b2 = self.next_block(2, spend=out[1])
self.save_spendable_output()
self.sync_blocks([b1, b2])
# Fork like this:
#
# genesis -> b1 (0) -> b2 (1)
# \-> b3 (1)
#
# Nothing should happen at this point. We saw b2 first so it takes priority.
self.log.info("Don't reorg to a chain of the same length")
self.move_tip(1)
b3 = self.next_block(3, spend=out[1])
txout_b3 = b3.vtx[1]
self.sync_blocks([b3], False)
# Now we add another block to make the alternative chain longer.
#
# genesis -> b1 (0) -> b2 (1)
# \-> b3 (1) -> b4 (2)
self.log.info("Reorg to a longer chain")
b4 = self.next_block(4, spend=out[2])
self.sync_blocks([b4])
# ... and back to the first chain.
# genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)
# \-> b3 (1) -> b4 (2)
self.move_tip(2)
b5 = self.next_block(5, spend=out[2])
self.save_spendable_output()
self.sync_blocks([b5], False)
self.log.info("Reorg back to the original chain")
b6 = self.next_block(6, spend=out[3])
self.sync_blocks([b6], True)
# Try to create a fork that double-spends
# genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)
# \-> b7 (2) -> b8 (4)
# \-> b3 (1) -> b4 (2)
self.log.info("Reject a chain with a double spend, even if it is longer")
self.move_tip(5)
b7 = self.next_block(7, spend=out[2])
self.sync_blocks([b7], False)
b8 = self.next_block(8, spend=out[4])
self.sync_blocks([b8], False, reconnect=True)
# Try to create a block that has too much fee
# genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)
# \-> b9 (4)
# \-> b3 (1) -> b4 (2)
self.log.info("Reject a block where the miner creates too much coinbase reward")
self.move_tip(6)
b9 = self.next_block(9, spend=out[4], additional_coinbase_value=1)
self.sync_blocks([b9], False, 16, b'bad-cb-amount', reconnect=True)
# Create a fork that ends in a block with too much fee (the one that causes the reorg)
# genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)
# \-> b10 (3) -> b11 (4)
# \-> b3 (1) -> b4 (2)
self.log.info("Reject a chain where the miner creates too much coinbase reward, even if the chain is longer")
self.move_tip(5)
b10 = self.next_block(10, spend=out[3])
self.sync_blocks([b10], False)
b11 = self.next_block(11, spend=out[4], additional_coinbase_value=1)
self.sync_blocks([b11], False, 16, b'bad-cb-amount', reconnect=True)
# Try again, but with a valid fork first
# genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)
# \-> b12 (3) -> b13 (4) -> b14 (5)
# \-> b3 (1) -> b4 (2)
self.log.info("Reject a chain where the miner creates too much coinbase reward, even if the chain is longer (on a forked chain)")
self.move_tip(5)
b12 = self.next_block(12, spend=out[3])
self.save_spendable_output()
b13 = self.next_block(13, spend=out[4])
self.save_spendable_output()
b14 = self.next_block(14, spend=out[5], additional_coinbase_value=1)
self.sync_blocks([b12, b13, b14], False, 16, b'bad-cb-amount', reconnect=True)
# New tip should be b13.
assert_equal(node.getbestblockhash(), b13.hash)
# Add a block with MAX_BLOCK_SIGOPS and one with one more sigop
# genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)
# \-> b12 (3) -> b13 (4) -> b15 (5) -> b16 (6)
# \-> b3 (1) -> b4 (2)
self.log.info("Accept a block with lots of checksigs")
lots_of_checksigs = CScript([OP_CHECKSIG] * (MAX_BLOCK_SIGOPS - 1))
self.move_tip(13)
b15 = self.next_block(15, spend=out[5], script=lots_of_checksigs)
self.save_spendable_output()
self.sync_blocks([b15], True)
self.log.info("Reject a block with too many checksigs")
too_many_checksigs = CScript([OP_CHECKSIG] * (MAX_BLOCK_SIGOPS))
b16 = self.next_block(16, spend=out[6], script=too_many_checksigs)
self.sync_blocks([b16], False, 16, b'bad-blk-sigops', reconnect=True)
# Attempt to spend a transaction created on a different fork
# genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)
# \-> b12 (3) -> b13 (4) -> b15 (5) -> b17 (b3.vtx[1])
# \-> b3 (1) -> b4 (2)
self.log.info("Reject a block with a spend from a re-org'ed out tx")
self.move_tip(15)
b17 = self.next_block(17, spend=txout_b3)
self.sync_blocks([b17], False, 16, b'bad-txns-inputs-missingorspent', reconnect=True)
# Attempt to spend a transaction created on a different fork (on a fork this time)
# genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)
# \-> b12 (3) -> b13 (4) -> b15 (5)
# \-> b18 (b3.vtx[1]) -> b19 (6)
# \-> b3 (1) -> b4 (2)
self.log.info("Reject a block with a spend from a re-org'ed out tx (on a forked chain)")
self.move_tip(13)
b18 = self.next_block(18, spend=txout_b3)
self.sync_blocks([b18], False)
b19 = self.next_block(19, spend=out[6])
self.sync_blocks([b19], False, 16, b'bad-txns-inputs-missingorspent', reconnect=True)
# Attempt to spend a coinbase at depth too low
# genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)
# \-> b12 (3) -> b13 (4) -> b15 (5) -> b20 (7)
# \-> b3 (1) -> b4 (2)
self.log.info("Reject a block spending an immature coinbase.")
self.move_tip(15)
b20 = self.next_block(20, spend=out[7])
self.sync_blocks([b20], False, 16, b'bad-txns-premature-spend-of-coinbase')
# Attempt to spend a coinbase at depth too low (on a fork this time)
# genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)
# \-> b12 (3) -> b13 (4) -> b15 (5)
# \-> b21 (6) -> b22 (5)
# \-> b3 (1) -> b4 (2)
self.log.info("Reject a block spending an immature coinbase (on a forked chain)")
self.move_tip(13)
b21 = self.next_block(21, spend=out[6])
self.sync_blocks([b21], False)
b22 = self.next_block(22, spend=out[5])
self.sync_blocks([b22], False, 16, b'bad-txns-premature-spend-of-coinbase')
# Create a block on either side of MAX_BLOCK_BASE_SIZE and make sure its accepted/rejected
# genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)
# \-> b12 (3) -> b13 (4) -> b15 (5) -> b23 (6)
# \-> b24 (6) -> b25 (7)
# \-> b3 (1) -> b4 (2)
self.log.info("Accept a block of size MAX_BLOCK_BASE_SIZE")
self.move_tip(15)
b23 = self.next_block(23, spend=out[6])
tx = CTransaction()
script_length = MAX_BLOCK_BASE_SIZE - len(b23.serialize()) - 69
script_output = CScript([b'\x00' * script_length])
tx.vout.append(CTxOut(0, script_output))
tx.vin.append(CTxIn(COutPoint(b23.vtx[1].sha256, 0)))
b23 = self.update_block(23, [tx])
# Make sure the math above worked out to produce a max-sized block
assert_equal(len(b23.serialize()), MAX_BLOCK_BASE_SIZE)
self.sync_blocks([b23], True)
self.save_spendable_output()
self.log.info("Reject a block of size MAX_BLOCK_BASE_SIZE + 1")
self.move_tip(15)
b24 = self.next_block(24, spend=out[6])
script_length = MAX_BLOCK_BASE_SIZE - len(b24.serialize()) - 69
script_output = CScript([b'\x00' * (script_length + 1)])
tx.vout = [CTxOut(0, script_output)]
b24 = self.update_block(24, [tx])
assert_equal(len(b24.serialize()), MAX_BLOCK_BASE_SIZE + 1)
self.sync_blocks([b24], False, 16, b'bad-blk-length', reconnect=True)
b25 = self.next_block(25, spend=out[7])
self.sync_blocks([b25], False)
# Create blocks with a coinbase input script size out of range
# genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)
# \-> b12 (3) -> b13 (4) -> b15 (5) -> b23 (6) -> b30 (7)
# \-> ... (6) -> ... (7)
# \-> b3 (1) -> b4 (2)
self.log.info("Reject a block with coinbase input script size out of range")
self.move_tip(15)
b26 = self.next_block(26, spend=out[6])
b26.vtx[0].vin[0].scriptSig = b'\x00'
b26.vtx[0].rehash()
# update_block causes the merkle root to get updated, even with no new
# transactions, and updates the required state.
b26 = self.update_block(26, [])
self.sync_blocks([b26], False, 16, b'bad-cb-length', reconnect=True)
# Extend the b26 chain to make sure bitcoind isn't accepting b26
b27 = self.next_block(27, spend=out[7])
self.sync_blocks([b27], False)
# Now try a too-large-coinbase script
self.move_tip(15)
b28 = self.next_block(28, spend=out[6])
b28.vtx[0].vin[0].scriptSig = b'\x00' * 101
b28.vtx[0].rehash()
b28 = self.update_block(28, [])
self.sync_blocks([b28], False, 16, b'bad-cb-length', reconnect=True)
# Extend the b28 chain to make sure bitcoind isn't accepting b28
b29 = self.next_block(29, spend=out[7])
self.sync_blocks([b29], False)
# b30 has a max-sized coinbase scriptSig.
self.move_tip(23)
b30 = self.next_block(30)
b30.vtx[0].vin[0].scriptSig = b'\x00' * 100
b30.vtx[0].rehash()
b30 = self.update_block(30, [])
self.sync_blocks([b30], True)
self.save_spendable_output()
# b31 - b35 - check sigops of OP_CHECKMULTISIG / OP_CHECKMULTISIGVERIFY / OP_CHECKSIGVERIFY
#
# genesis -> ... -> b30 (7) -> b31 (8) -> b33 (9) -> b35 (10)
# \-> b36 (11)
# \-> b34 (10)
# \-> b32 (9)
#
# MULTISIG: each op code counts as 20 sigops. To create the edge case, pack another 19 sigops at the end.
self.log.info("Accept a block with the max number of OP_CHECKMULTISIG sigops")
lots_of_multisigs = CScript([OP_CHECKMULTISIG] * ((MAX_BLOCK_SIGOPS - 1) // 20) + [OP_CHECKSIG] * 19)
b31 = self.next_block(31, spend=out[8], script=lots_of_multisigs)
assert_equal(get_legacy_sigopcount_block(b31), MAX_BLOCK_SIGOPS)
self.sync_blocks([b31], True)
self.save_spendable_output()
# this goes over the limit because the coinbase has one sigop
self.log.info("Reject a block with too many OP_CHECKMULTISIG sigops")
too_many_multisigs = CScript([OP_CHECKMULTISIG] * (MAX_BLOCK_SIGOPS // 20))
b32 = self.next_block(32, spend=out[9], script=too_many_multisigs)
assert_equal(get_legacy_sigopcount_block(b32), MAX_BLOCK_SIGOPS + 1)
self.sync_blocks([b32], False, 16, b'bad-blk-sigops', reconnect=True)
# CHECKMULTISIGVERIFY
self.log.info("Accept a block with the max number of OP_CHECKMULTISIGVERIFY sigops")
self.move_tip(31)
lots_of_multisigs = CScript([OP_CHECKMULTISIGVERIFY] * ((MAX_BLOCK_SIGOPS - 1) // 20) + [OP_CHECKSIG] * 19)
b33 = self.next_block(33, spend=out[9], script=lots_of_multisigs)
self.sync_blocks([b33], True)
self.save_spendable_output()
self.log.info("Reject a block with too many OP_CHECKMULTISIGVERIFY sigops")
too_many_multisigs = CScript([OP_CHECKMULTISIGVERIFY] * (MAX_BLOCK_SIGOPS // 20))
b34 = self.next_block(34, spend=out[10], script=too_many_multisigs)
self.sync_blocks([b34], False, 16, b'bad-blk-sigops', reconnect=True)
# CHECKSIGVERIFY
self.log.info("Accept a block with the max number of OP_CHECKSIGVERIFY sigops")
self.move_tip(33)
lots_of_checksigs = CScript([OP_CHECKSIGVERIFY] * (MAX_BLOCK_SIGOPS - 1))
b35 = self.next_block(35, spend=out[10], script=lots_of_checksigs)
self.sync_blocks([b35], True)
self.save_spendable_output()
self.log.info("Reject a block with too many OP_CHECKSIGVERIFY sigops")
too_many_checksigs = CScript([OP_CHECKSIGVERIFY] * (MAX_BLOCK_SIGOPS))
b36 = self.next_block(36, spend=out[11], script=too_many_checksigs)
self.sync_blocks([b36], False, 16, b'bad-blk-sigops', reconnect=True)
# Check spending of a transaction in a block which failed to connect
#
# b6 (3)
# b12 (3) -> b13 (4) -> b15 (5) -> b23 (6) -> b30 (7) -> b31 (8) -> b33 (9) -> b35 (10)
# \-> b37 (11)
# \-> b38 (11/37)
#
# save 37's spendable output, but then double-spend out11 to invalidate the block
self.log.info("Reject a block spending transaction from a block which failed to connect")
self.move_tip(35)
b37 = self.next_block(37, spend=out[11])
txout_b37 = b37.vtx[1]
tx = self.create_and_sign_transaction(out[11], 0)
b37 = self.update_block(37, [tx])
self.sync_blocks([b37], False, 16, b'bad-txns-inputs-missingorspent', reconnect=True)
# attempt to spend b37's first non-coinbase tx, at which point b37 was still considered valid
self.move_tip(35)
b38 = self.next_block(38, spend=txout_b37)
self.sync_blocks([b38], False, 16, b'bad-txns-inputs-missingorspent', reconnect=True)
# Check P2SH SigOp counting
#
#
# 13 (4) -> b15 (5) -> b23 (6) -> b30 (7) -> b31 (8) -> b33 (9) -> b35 (10) -> b39 (11) -> b41 (12)
# \-> b40 (12)
#
# b39 - create some P2SH outputs that will require 6 sigops to spend:
#
# redeem_script = COINBASE_PUBKEY, (OP_2DUP+OP_CHECKSIGVERIFY) * 5, OP_CHECKSIG
# p2sh_script = OP_HASH160, ripemd160(sha256(script)), OP_EQUAL
#
self.log.info("Check P2SH SIGOPS are correctly counted")
self.move_tip(35)
b39 = self.next_block(39)
b39_outputs = 0
b39_sigops_per_output = 6
# Build the redeem script, hash it, use hash to create the p2sh script
redeem_script = CScript([self.coinbase_pubkey] + [OP_2DUP, OP_CHECKSIGVERIFY] * 5 + [OP_CHECKSIG])
redeem_script_hash = hash160(redeem_script)
p2sh_script = CScript([OP_HASH160, redeem_script_hash, OP_EQUAL])
# Create a transaction that spends one satoshi to the p2sh_script, the rest to OP_TRUE
# This must be signed because it is spending a coinbase
spend = out[11]
tx = self.create_tx(spend, 0, 1, p2sh_script)
tx.vout.append(CTxOut(spend.vout[0].nValue - 1, CScript([OP_TRUE])))
self.sign_tx(tx, spend)
tx.rehash()
b39 = self.update_block(39, [tx])
b39_outputs += 1
# Until block is full, add tx's with 1 satoshi to p2sh_script, the rest to OP_TRUE
tx_new = None
tx_last = tx
total_size = len(b39.serialize())
while(total_size < MAX_BLOCK_BASE_SIZE):
tx_new = self.create_tx(tx_last, 1, 1, p2sh_script)
tx_new.vout.append(CTxOut(tx_last.vout[1].nValue - 1, CScript([OP_TRUE])))
tx_new.rehash()
total_size += len(tx_new.serialize())
if total_size >= MAX_BLOCK_BASE_SIZE:
break
b39.vtx.append(tx_new) # add tx to block
tx_last = tx_new
b39_outputs += 1
b39 = self.update_block(39, [])
self.sync_blocks([b39], True)
self.save_spendable_output()
# Test sigops in P2SH redeem scripts
#
# b40 creates 3333 tx's spending the 6-sigop P2SH outputs from b39 for a total of 19998 sigops.
# The first tx has one sigop and then at the end we add 2 more to put us just over the max.
#
# b41 does the same, less one, so it has the maximum sigops permitted.
#
self.log.info("Reject a block with too many P2SH sigops")
self.move_tip(39)
b40 = self.next_block(40, spend=out[12])
sigops = get_legacy_sigopcount_block(b40)
numTxes = (MAX_BLOCK_SIGOPS - sigops) // b39_sigops_per_output
assert_equal(numTxes <= b39_outputs, True)
lastOutpoint = COutPoint(b40.vtx[1].sha256, 0)
new_txs = []
for i in range(1, numTxes + 1):
tx = CTransaction()
tx.vout.append(CTxOut(1, CScript([OP_TRUE])))
tx.vin.append(CTxIn(lastOutpoint, b''))
# second input is corresponding P2SH output from b39
tx.vin.append(CTxIn(COutPoint(b39.vtx[i].sha256, 0), b''))
# Note: must pass the redeem_script (not p2sh_script) to the signature hash function
(sighash, err) = SignatureHash(redeem_script, tx, 1, SIGHASH_ALL)
sig = self.coinbase_key.sign(sighash) + bytes(bytearray([SIGHASH_ALL]))
scriptSig = CScript([sig, redeem_script])
tx.vin[1].scriptSig = scriptSig
tx.rehash()
new_txs.append(tx)
lastOutpoint = COutPoint(tx.sha256, 0)
b40_sigops_to_fill = MAX_BLOCK_SIGOPS - (numTxes * b39_sigops_per_output + sigops) + 1
tx = CTransaction()
tx.vin.append(CTxIn(lastOutpoint, b''))
tx.vout.append(CTxOut(1, CScript([OP_CHECKSIG] * b40_sigops_to_fill)))
tx.rehash()
new_txs.append(tx)
self.update_block(40, new_txs)
self.sync_blocks([b40], False, 16, b'bad-blk-sigops', reconnect=True)
# same as b40, but one less sigop
self.log.info("Accept a block with the max number of P2SH sigops")
self.move_tip(39)
b41 = self.next_block(41, spend=None)
self.update_block(41, b40.vtx[1:-1])
b41_sigops_to_fill = b40_sigops_to_fill - 1
tx = CTransaction()
tx.vin.append(CTxIn(lastOutpoint, b''))
tx.vout.append(CTxOut(1, CScript([OP_CHECKSIG] * b41_sigops_to_fill)))
tx.rehash()
self.update_block(41, [tx])
self.sync_blocks([b41], True)
# Fork off of b39 to create a constant base again
#
# b23 (6) -> b30 (7) -> b31 (8) -> b33 (9) -> b35 (10) -> b39 (11) -> b42 (12) -> b43 (13)
# \-> b41 (12)
#
self.move_tip(39)
b42 = self.next_block(42, spend=out[12])
self.save_spendable_output()
b43 = self.next_block(43, spend=out[13])
self.save_spendable_output()
self.sync_blocks([b42, b43], True)
# Test a number of really invalid scenarios
#
# -> b31 (8) -> b33 (9) -> b35 (10) -> b39 (11) -> b42 (12) -> b43 (13) -> b44 (14)
# \-> ??? (15)
# The next few blocks are going to be created "by hand" since they'll do funky things, such as having
# the first transaction be non-coinbase, etc. The purpose of b44 is to make sure this works.
self.log.info("Build block 44 manually")
height = self.block_heights[self.tip.sha256] + 1
coinbase = create_coinbase(height, self.coinbase_pubkey)
b44 = CBlock()
b44.nTime = self.tip.nTime + 1
b44.hashPrevBlock = self.tip.sha256
b44.nBits = 0x207fffff
b44.vtx.append(coinbase)
b44.hashMerkleRoot = b44.calc_merkle_root()
b44.solve()
self.tip = b44
self.block_heights[b44.sha256] = height
self.blocks[44] = b44
self.sync_blocks([b44], True)
self.log.info("Reject a block with a non-coinbase as the first tx")
non_coinbase = self.create_tx(out[15], 0, 1)
b45 = CBlock()
b45.nTime = self.tip.nTime + 1
b45.hashPrevBlock = self.tip.sha256
b45.nBits = 0x207fffff
b45.vtx.append(non_coinbase)
b45.hashMerkleRoot = b45.calc_merkle_root()
b45.calc_sha256()
b45.solve()
self.block_heights[b45.sha256] = self.block_heights[self.tip.sha256] + 1
self.tip = b45
self.blocks[45] = b45
self.sync_blocks([b45], False, 16, b'bad-cb-missing', reconnect=True)
self.log.info("Reject a block with no transactions")
self.move_tip(44)
b46 = CBlock()
b46.nTime = b44.nTime + 1
b46.hashPrevBlock = b44.sha256
b46.nBits = 0x207fffff
b46.vtx = []
b46.hashMerkleRoot = 0
b46.solve()
self.block_heights[b46.sha256] = self.block_heights[b44.sha256] + 1
self.tip = b46
assert 46 not in self.blocks
self.blocks[46] = b46
self.sync_blocks([b46], False, 16, b'bad-blk-length', reconnect=True)
self.log.info("Reject a block with invalid work")
self.move_tip(44)
b47 = self.next_block(47, solve=False)
target = uint256_from_compact(b47.nBits)
while b47.sha256 < target:
b47.nNonce += 1
b47.rehash()
self.sync_blocks([b47], False, request_block=False)
self.log.info("Reject a block with a timestamp >2 hours in the future")
self.move_tip(44)
b48 = self.next_block(48, solve=False)
b48.nTime = int(time.time()) + 60 * 60 * 3
b48.solve()
self.sync_blocks([b48], False, request_block=False)
self.log.info("Reject a block with invalid merkle hash")
self.move_tip(44)
b49 = self.next_block(49)
b49.hashMerkleRoot += 1
b49.solve()
self.sync_blocks([b49], False, 16, b'bad-txnmrklroot', reconnect=True)
self.log.info("Reject a block with incorrect POW limit")
self.move_tip(44)
b50 = self.next_block(50)
b50.nBits = b50.nBits - 1
b50.solve()
self.sync_blocks([b50], False, request_block=False, reconnect=True)
self.log.info("Reject a block with two coinbase transactions")
self.move_tip(44)
b51 = self.next_block(51)
cb2 = create_coinbase(51, self.coinbase_pubkey)
b51 = self.update_block(51, [cb2])
self.sync_blocks([b51], False, 16, b'bad-cb-multiple', reconnect=True)
self.log.info("Reject a block with duplicate transactions")
# Note: txns have to be in the right position in the merkle tree to trigger this error
self.move_tip(44)
b52 = self.next_block(52, spend=out[15])
tx = self.create_tx(b52.vtx[1], 0, 1)
b52 = self.update_block(52, [tx, tx])
self.sync_blocks([b52], False, 16, b'bad-txns-duplicate', reconnect=True)
# Test block timestamps
# -> b31 (8) -> b33 (9) -> b35 (10) -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15)
# \-> b54 (15)
#
self.move_tip(43)
b53 = self.next_block(53, spend=out[14])
self.sync_blocks([b53], False)
self.save_spendable_output()
self.log.info("Reject a block with timestamp before MedianTimePast")
b54 = self.next_block(54, spend=out[15])
b54.nTime = b35.nTime - 1
b54.solve()
self.sync_blocks([b54], False, request_block=False)
# valid timestamp
self.move_tip(53)
b55 = self.next_block(55, spend=out[15])
b55.nTime = b35.nTime
self.update_block(55, [])
self.sync_blocks([b55], True)
self.save_spendable_output()
# Test Merkle tree malleability
#
# -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57p2 (16)
# \-> b57 (16)
# \-> b56p2 (16)
# \-> b56 (16)
#
# Merkle tree malleability (CVE-2012-2459): repeating sequences of transactions in a block without
# affecting the merkle root of a block, while still invalidating it.
# See: src/consensus/merkle.h
#
# b57 has three txns: coinbase, tx, tx1. The merkle root computation will duplicate tx.
# Result: OK
#
# b56 copies b57 but duplicates tx1 and does not recalculate the block hash. So it has a valid merkle
# root but duplicate transactions.
# Result: Fails
#
# b57p2 has six transactions in its merkle tree:
# - coinbase, tx, tx1, tx2, tx3, tx4
# Merkle root calculation will duplicate as necessary.
# Result: OK.
#
# b56p2 copies b57p2 but adds both tx3 and tx4. The purpose of the test is to make sure the code catches
# duplicate txns that are not next to one another with the "bad-txns-duplicate" error (which indicates
# that the error was caught early, avoiding a DOS vulnerability.)
# b57 - a good block with 2 txs, don't submit until end
self.move_tip(55)
b57 = self.next_block(57)
tx = self.create_and_sign_transaction(out[16], 1)
tx1 = self.create_tx(tx, 0, 1)
b57 = self.update_block(57, [tx, tx1])
# b56 - copy b57, add a duplicate tx
self.log.info("Reject a block with a duplicate transaction in the Merkle Tree (but with a valid Merkle Root)")
self.move_tip(55)
b56 = copy.deepcopy(b57)
self.blocks[56] = b56
assert_equal(len(b56.vtx), 3)
b56 = self.update_block(56, [tx1])
assert_equal(b56.hash, b57.hash)
self.sync_blocks([b56], False, 16, b'bad-txns-duplicate', reconnect=True)
# b57p2 - a good block with 6 tx'es, don't submit until end
self.move_tip(55)
b57p2 = self.next_block("57p2")
tx = self.create_and_sign_transaction(out[16], 1)
tx1 = self.create_tx(tx, 0, 1)
tx2 = self.create_tx(tx1, 0, 1)
tx3 = self.create_tx(tx2, 0, 1)
tx4 = self.create_tx(tx3, 0, 1)
b57p2 = self.update_block("57p2", [tx, tx1, tx2, tx3, tx4])
# b56p2 - copy b57p2, duplicate two non-consecutive tx's
self.log.info("Reject a block with two duplicate transactions in the Merkle Tree (but with a valid Merkle Root)")
self.move_tip(55)
b56p2 = copy.deepcopy(b57p2)
self.blocks["b56p2"] = b56p2
assert_equal(b56p2.hash, b57p2.hash)
assert_equal(len(b56p2.vtx), 6)
b56p2 = self.update_block("b56p2", [tx3, tx4])
self.sync_blocks([b56p2], False, 16, b'bad-txns-duplicate', reconnect=True)
self.move_tip("57p2")
self.sync_blocks([b57p2], True)
self.move_tip(57)
self.sync_blocks([b57], False) # The tip is not updated because 57p2 seen first
self.save_spendable_output()
# Test a few invalid tx types
#
# -> b35 (10) -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17)
# \-> ??? (17)
#
# tx with prevout.n out of range
self.log.info("Reject a block with a transaction with prevout.n out of range")
self.move_tip(57)
b58 = self.next_block(58, spend=out[17])
tx = CTransaction()
assert(len(out[17].vout) < 42)
tx.vin.append(CTxIn(COutPoint(out[17].sha256, 42), CScript([OP_TRUE]), 0xffffffff))
tx.vout.append(CTxOut(0, b""))
tx.calc_sha256()
b58 = self.update_block(58, [tx])
self.sync_blocks([b58], False, 16, b'bad-txns-inputs-missingorspent', reconnect=True)
# tx with output value > input value
self.log.info("Reject a block with a transaction with outputs > inputs")
self.move_tip(57)
b59 = self.next_block(59)
tx = self.create_and_sign_transaction(out[17], 51 * COIN)
b59 = self.update_block(59, [tx])
self.sync_blocks([b59], False, 16, b'bad-txns-in-belowout', reconnect=True)
# reset to good chain
self.move_tip(57)
b60 = self.next_block(60, spend=out[17])
self.sync_blocks([b60], True)
self.save_spendable_output()
# Test BIP30
#
# -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17)
# \-> b61 (18)
#
# Blocks are not allowed to contain a transaction whose id matches that of an earlier,
# not-fully-spent transaction in the same chain. To test, make identical coinbases;
# the second one should be rejected.
#
self.log.info("Reject a block with a transaction with a duplicate hash of a previous transaction (BIP30)")
self.move_tip(60)
b61 = self.next_block(61, spend=out[18])
b61.vtx[0].vin[0].scriptSig = b60.vtx[0].vin[0].scriptSig # Equalize the coinbases
b61.vtx[0].rehash()
b61 = self.update_block(61, [])
assert_equal(b60.vtx[0].serialize(), b61.vtx[0].serialize())
self.sync_blocks([b61], False, 16, b'bad-txns-BIP30', reconnect=True)
# Test tx.isFinal is properly rejected (not an exhaustive tx.isFinal test, that should be in data-driven transaction tests)
#
# -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17)
# \-> b62 (18)
#
self.log.info("Reject a block with a transaction with a nonfinal locktime")
self.move_tip(60)
b62 = self.next_block(62)
tx = CTransaction()
tx.nLockTime = 0xffffffff # this locktime is non-final
tx.vin.append(CTxIn(COutPoint(out[18].sha256, 0))) # don't set nSequence
tx.vout.append(CTxOut(0, CScript([OP_TRUE])))
assert(tx.vin[0].nSequence < 0xffffffff)
tx.calc_sha256()
b62 = self.update_block(62, [tx])
self.sync_blocks([b62], False, 16, b'bad-txns-nonfinal')
# Test a non-final coinbase is also rejected
#
# -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17)
# \-> b63 (-)
#
self.log.info("Reject a block with a coinbase transaction with a nonfinal locktime")
self.move_tip(60)
b63 = self.next_block(63)
b63.vtx[0].nLockTime = 0xffffffff
b63.vtx[0].vin[0].nSequence = 0xDEADBEEF
b63.vtx[0].rehash()
b63 = self.update_block(63, [])
self.sync_blocks([b63], False, 16, b'bad-txns-nonfinal')
# This checks that a block with a bloated VARINT between the block_header and the array of tx such that
# the block is > MAX_BLOCK_BASE_SIZE with the bloated varint, but <= MAX_BLOCK_BASE_SIZE without the bloated varint,
# does not cause a subsequent, identical block with canonical encoding to be rejected. The test does not
# care whether the bloated block is accepted or rejected; it only cares that the second block is accepted.
#
# What matters is that the receiving node should not reject the bloated block, and then reject the canonical
# block on the basis that it's the same as an already-rejected block (which would be a consensus failure.)
#
# -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18)
# \
# b64a (18)
# b64a is a bloated block (non-canonical varint)
# b64 is a good block (same as b64 but w/ canonical varint)
#
self.log.info("Accept a valid block even if a bloated version of the block has previously been sent")
self.move_tip(60)
regular_block = self.next_block("64a", spend=out[18])
# make it a "broken_block," with non-canonical serialization
b64a = CBrokenBlock(regular_block)
b64a.initialize(regular_block)
self.blocks["64a"] = b64a
self.tip = b64a
tx = CTransaction()
# use canonical serialization to calculate size
script_length = MAX_BLOCK_BASE_SIZE - len(b64a.normal_serialize()) - 69
script_output = CScript([b'\x00' * script_length])
tx.vout.append(CTxOut(0, script_output))
tx.vin.append(CTxIn(COutPoint(b64a.vtx[1].sha256, 0)))
b64a = self.update_block("64a", [tx])
assert_equal(len(b64a.serialize()), MAX_BLOCK_BASE_SIZE + 8)
self.sync_blocks([b64a], False, 1, b'error parsing message')
# bitcoind doesn't disconnect us for sending a bloated block, but if we subsequently
# resend the header message, it won't send us the getdata message again. Just
# disconnect and reconnect and then call sync_blocks.
# TODO: improve this test to be less dependent on P2P DOS behaviour.
node.disconnect_p2ps()
self.reconnect_p2p()
self.move_tip(60)
b64 = CBlock(b64a)
b64.vtx = copy.deepcopy(b64a.vtx)
assert_equal(b64.hash, b64a.hash)
assert_equal(len(b64.serialize()), MAX_BLOCK_BASE_SIZE)
self.blocks[64] = b64
b64 = self.update_block(64, [])
self.sync_blocks([b64], True)
self.save_spendable_output()
# Spend an output created in the block itself
#
# -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19)
#
self.log.info("Accept a block with a transaction spending an output created in the same block")
self.move_tip(64)
b65 = self.next_block(65)
tx1 = self.create_and_sign_transaction(out[19], out[19].vout[0].nValue)
tx2 = self.create_and_sign_transaction(tx1, 0)
b65 = self.update_block(65, [tx1, tx2])
self.sync_blocks([b65], True)
self.save_spendable_output()
# Attempt to spend an output created later in the same block
#
# -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19)
# \-> b66 (20)
self.log.info("Reject a block with a transaction spending an output created later in the same block")
self.move_tip(65)
b66 = self.next_block(66)
tx1 = self.create_and_sign_transaction(out[20], out[20].vout[0].nValue)
tx2 = self.create_and_sign_transaction(tx1, 1)
b66 = self.update_block(66, [tx2, tx1])
self.sync_blocks([b66], False, 16, b'bad-txns-inputs-missingorspent', reconnect=True)
# Attempt to double-spend a transaction created in a block
#
# -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19)
# \-> b67 (20)
#
#
self.log.info("Reject a block with a transaction double spending a transaction creted in the same block")
self.move_tip(65)
b67 = self.next_block(67)
tx1 = self.create_and_sign_transaction(out[20], out[20].vout[0].nValue)
tx2 = self.create_and_sign_transaction(tx1, 1)
tx3 = self.create_and_sign_transaction(tx1, 2)
b67 = self.update_block(67, [tx1, tx2, tx3])
self.sync_blocks([b67], False, 16, b'bad-txns-inputs-missingorspent', reconnect=True)
# More tests of block subsidy
#
# -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19) -> b69 (20)
# \-> b68 (20)
#
# b68 - coinbase with an extra 10 satoshis,
# creates a tx that has 9 satoshis from out[20] go to fees
# this fails because the coinbase is trying to claim 1 satoshi too much in fees
#
# b69 - coinbase with extra 10 satoshis, and a tx that gives a 10 satoshi fee
# this succeeds
#
self.log.info("Reject a block trying to claim too much subsidy in the coinbase transaction")
self.move_tip(65)
b68 = self.next_block(68, additional_coinbase_value=10)
tx = self.create_and_sign_transaction(out[20], out[20].vout[0].nValue - 9)
b68 = self.update_block(68, [tx])
self.sync_blocks([b68], False, 16, b'bad-cb-amount', reconnect=True)
self.log.info("Accept a block claiming the correct subsidy in the coinbase transaction")
self.move_tip(65)
b69 = self.next_block(69, additional_coinbase_value=10)
tx = self.create_and_sign_transaction(out[20], out[20].vout[0].nValue - 10)
self.update_block(69, [tx])
self.sync_blocks([b69], True)
self.save_spendable_output()
# Test spending the outpoint of a non-existent transaction
#
# -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19) -> b69 (20)
# \-> b70 (21)
#
self.log.info("Reject a block containing a transaction spending from a non-existent input")
self.move_tip(69)
b70 = self.next_block(70, spend=out[21])
bogus_tx = CTransaction()
bogus_tx.sha256 = uint256_from_str(b"23c70ed7c0506e9178fc1a987f40a33946d4ad4c962b5ae3a52546da53af0c5c")
tx = CTransaction()
tx.vin.append(CTxIn(COutPoint(bogus_tx.sha256, 0), b"", 0xffffffff))
tx.vout.append(CTxOut(1, b""))
b70 = self.update_block(70, [tx])
self.sync_blocks([b70], False, 16, b'bad-txns-inputs-missingorspent', reconnect=True)
# Test accepting an invalid block which has the same hash as a valid one (via merkle tree tricks)
#
# -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19) -> b69 (20) -> b72 (21)
# \-> b71 (21)
#
# b72 is a good block.
# b71 is a copy of 72, but re-adds one of its transactions. However, it has the same hash as b72.
self.log.info("Reject a block containing a duplicate transaction but with the same Merkle root (Merkle tree malleability")
self.move_tip(69)
b72 = self.next_block(72)
tx1 = self.create_and_sign_transaction(out[21], 2)
tx2 = self.create_and_sign_transaction(tx1, 1)
b72 = self.update_block(72, [tx1, tx2]) # now tip is 72
b71 = copy.deepcopy(b72)
b71.vtx.append(tx2) # add duplicate tx2
self.block_heights[b71.sha256] = self.block_heights[b69.sha256] + 1 # b71 builds off b69
self.blocks[71] = b71
assert_equal(len(b71.vtx), 4)
assert_equal(len(b72.vtx), 3)
assert_equal(b72.sha256, b71.sha256)
self.move_tip(71)
self.sync_blocks([b71], False, 16, b'bad-txns-duplicate', reconnect=True)
self.move_tip(72)
self.sync_blocks([b72], True)
self.save_spendable_output()
# Test some invalid scripts and MAX_BLOCK_SIGOPS
#
# -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19) -> b69 (20) -> b72 (21)
# \-> b** (22)
#
# b73 - tx with excessive sigops that are placed after an excessively large script element.
# The purpose of the test is to make sure those sigops are counted.
#
# script is a bytearray of size 20,526
#
# bytearray[0-19,998] : OP_CHECKSIG
# bytearray[19,999] : OP_PUSHDATA4
# bytearray[20,000-20,003]: 521 (max_script_element_size+1, in little-endian format)
# bytearray[20,004-20,525]: unread data (script_element)
# bytearray[20,526] : OP_CHECKSIG (this puts us over the limit)
self.log.info("Reject a block containing too many sigops after a large script element")
self.move_tip(72)
b73 = self.next_block(73)
size = MAX_BLOCK_SIGOPS - 1 + MAX_SCRIPT_ELEMENT_SIZE + 1 + 5 + 1
a = bytearray([OP_CHECKSIG] * size)
a[MAX_BLOCK_SIGOPS - 1] = int("4e", 16) # OP_PUSHDATA4
element_size = MAX_SCRIPT_ELEMENT_SIZE + 1
a[MAX_BLOCK_SIGOPS] = element_size % 256
a[MAX_BLOCK_SIGOPS + 1] = element_size // 256
a[MAX_BLOCK_SIGOPS + 2] = 0
a[MAX_BLOCK_SIGOPS + 3] = 0
tx = self.create_and_sign_transaction(out[22], 1, CScript(a))
b73 = self.update_block(73, [tx])
assert_equal(get_legacy_sigopcount_block(b73), MAX_BLOCK_SIGOPS + 1)
self.sync_blocks([b73], False, 16, b'bad-blk-sigops', reconnect=True)
# b74/75 - if we push an invalid script element, all prevous sigops are counted,
# but sigops after the element are not counted.
#
# The invalid script element is that the push_data indicates that
# there will be a large amount of data (0xffffff bytes), but we only
# provide a much smaller number. These bytes are CHECKSIGS so they would
# cause b75 to fail for excessive sigops, if those bytes were counted.
#
# b74 fails because we put MAX_BLOCK_SIGOPS+1 before the element
# b75 succeeds because we put MAX_BLOCK_SIGOPS before the element
self.log.info("Check sigops are counted correctly after an invalid script element")
self.move_tip(72)
b74 = self.next_block(74)
size = MAX_BLOCK_SIGOPS - 1 + MAX_SCRIPT_ELEMENT_SIZE + 42 # total = 20,561
a = bytearray([OP_CHECKSIG] * size)
a[MAX_BLOCK_SIGOPS] = 0x4e
a[MAX_BLOCK_SIGOPS + 1] = 0xfe
a[MAX_BLOCK_SIGOPS + 2] = 0xff
a[MAX_BLOCK_SIGOPS + 3] = 0xff
a[MAX_BLOCK_SIGOPS + 4] = 0xff
tx = self.create_and_sign_transaction(out[22], 1, CScript(a))
b74 = self.update_block(74, [tx])
self.sync_blocks([b74], False, 16, b'bad-blk-sigops', reconnect=True)
self.move_tip(72)
b75 = self.next_block(75)
size = MAX_BLOCK_SIGOPS - 1 + MAX_SCRIPT_ELEMENT_SIZE + 42
a = bytearray([OP_CHECKSIG] * size)
a[MAX_BLOCK_SIGOPS - 1] = 0x4e
a[MAX_BLOCK_SIGOPS] = 0xff
a[MAX_BLOCK_SIGOPS + 1] = 0xff
a[MAX_BLOCK_SIGOPS + 2] = 0xff
a[MAX_BLOCK_SIGOPS + 3] = 0xff
tx = self.create_and_sign_transaction(out[22], 1, CScript(a))
b75 = self.update_block(75, [tx])
self.sync_blocks([b75], True)
self.save_spendable_output()
# Check that if we push an element filled with CHECKSIGs, they are not counted
self.move_tip(75)
b76 = self.next_block(76)
size = MAX_BLOCK_SIGOPS - 1 + MAX_SCRIPT_ELEMENT_SIZE + 1 + 5
a = bytearray([OP_CHECKSIG] * size)
a[MAX_BLOCK_SIGOPS - 1] = 0x4e # PUSHDATA4, but leave the following bytes as just checksigs
tx = self.create_and_sign_transaction(out[23], 1, CScript(a))
b76 = self.update_block(76, [tx])
self.sync_blocks([b76], True)
self.save_spendable_output()
# Test transaction resurrection
#
# -> b77 (24) -> b78 (25) -> b79 (26)
# \-> b80 (25) -> b81 (26) -> b82 (27)
#
# b78 creates a tx, which is spent in b79. After b82, both should be in mempool
#
# The tx'es must be unsigned and pass the node's mempool policy. It is unsigned for the
# rather obscure reason that the Python signature code does not distinguish between
# Low-S and High-S values (whereas the bitcoin code has custom code which does so);
# as a result of which, the odds are 50% that the python code will use the right
# value and the transaction will be accepted into the mempool. Until we modify the
# test framework to support low-S signing, we are out of luck.
#
# To get around this issue, we construct transactions which are not signed and which
# spend to OP_TRUE. If the standard-ness rules change, this test would need to be
# updated. (Perhaps to spend to a P2SH OP_TRUE script)
self.log.info("Test transaction resurrection during a re-org")
self.move_tip(76)
b77 = self.next_block(77)
tx77 = self.create_and_sign_transaction(out[24], 10 * COIN)
b77 = self.update_block(77, [tx77])
self.sync_blocks([b77], True)
self.save_spendable_output()
b78 = self.next_block(78)
tx78 = self.create_tx(tx77, 0, 9 * COIN)
b78 = self.update_block(78, [tx78])
self.sync_blocks([b78], True)
b79 = self.next_block(79)
tx79 = self.create_tx(tx78, 0, 8 * COIN)
b79 = self.update_block(79, [tx79])
self.sync_blocks([b79], True)
# mempool should be empty
assert_equal(len(self.nodes[0].getrawmempool()), 0)
self.move_tip(77)
b80 = self.next_block(80, spend=out[25])
self.sync_blocks([b80], False, request_block=False)
self.save_spendable_output()
b81 = self.next_block(81, spend=out[26])
self.sync_blocks([b81], False, request_block=False) # other chain is same length
self.save_spendable_output()
b82 = self.next_block(82, spend=out[27])
self.sync_blocks([b82], True) # now this chain is longer, triggers re-org
self.save_spendable_output()
# now check that tx78 and tx79 have been put back into the peer's mempool
mempool = self.nodes[0].getrawmempool()
assert_equal(len(mempool), 2)
assert(tx78.hash in mempool)
assert(tx79.hash in mempool)
# Test invalid opcodes in dead execution paths.
#
# -> b81 (26) -> b82 (27) -> b83 (28)
#
self.log.info("Accept a block with invalid opcodes in dead execution paths")
b83 = self.next_block(83)
op_codes = [OP_IF, OP_INVALIDOPCODE, OP_ELSE, OP_TRUE, OP_ENDIF]
script = CScript(op_codes)
tx1 = self.create_and_sign_transaction(out[28], out[28].vout[0].nValue, script)
tx2 = self.create_and_sign_transaction(tx1, 0, CScript([OP_TRUE]))
tx2.vin[0].scriptSig = CScript([OP_FALSE])
tx2.rehash()
b83 = self.update_block(83, [tx1, tx2])
self.sync_blocks([b83], True)
self.save_spendable_output()
# Reorg on/off blocks that have OP_RETURN in them (and try to spend them)
#
# -> b81 (26) -> b82 (27) -> b83 (28) -> b84 (29) -> b87 (30) -> b88 (31)
# \-> b85 (29) -> b86 (30) \-> b89a (32)
#
self.log.info("Test re-orging blocks with OP_RETURN in them")
b84 = self.next_block(84)
tx1 = self.create_tx(out[29], 0, 0, CScript([OP_RETURN]))
tx1.vout.append(CTxOut(0, CScript([OP_TRUE])))
tx1.vout.append(CTxOut(0, CScript([OP_TRUE])))
tx1.vout.append(CTxOut(0, CScript([OP_TRUE])))
tx1.vout.append(CTxOut(0, CScript([OP_TRUE])))
tx1.calc_sha256()
self.sign_tx(tx1, out[29])
tx1.rehash()
tx2 = self.create_tx(tx1, 1, 0, CScript([OP_RETURN]))
tx2.vout.append(CTxOut(0, CScript([OP_RETURN])))
tx3 = self.create_tx(tx1, 2, 0, CScript([OP_RETURN]))
tx3.vout.append(CTxOut(0, CScript([OP_TRUE])))
tx4 = self.create_tx(tx1, 3, 0, CScript([OP_TRUE]))
tx4.vout.append(CTxOut(0, CScript([OP_RETURN])))
tx5 = self.create_tx(tx1, 4, 0, CScript([OP_RETURN]))
b84 = self.update_block(84, [tx1, tx2, tx3, tx4, tx5])
self.sync_blocks([b84], True)
self.save_spendable_output()
self.move_tip(83)
b85 = self.next_block(85, spend=out[29])
self.sync_blocks([b85], False) # other chain is same length
b86 = self.next_block(86, spend=out[30])
self.sync_blocks([b86], True)
self.move_tip(84)
b87 = self.next_block(87, spend=out[30])
self.sync_blocks([b87], False) # other chain is same length
self.save_spendable_output()
b88 = self.next_block(88, spend=out[31])
self.sync_blocks([b88], True)
self.save_spendable_output()
# trying to spend the OP_RETURN output is rejected
b89a = self.next_block("89a", spend=out[32])
tx = self.create_tx(tx1, 0, 0, CScript([OP_TRUE]))
b89a = self.update_block("89a", [tx])
self.sync_blocks([b89a], False, 16, b'bad-txns-inputs-missingorspent', reconnect=True)
self.log.info("Test a re-org of one week's worth of blocks (1088 blocks)")
self.move_tip(88)
LARGE_REORG_SIZE = 1088
blocks = []
spend = out[32]
for i in range(89, LARGE_REORG_SIZE + 89):
b = self.next_block(i, spend)
tx = CTransaction()
script_length = MAX_BLOCK_BASE_SIZE - len(b.serialize()) - 69
script_output = CScript([b'\x00' * script_length])
tx.vout.append(CTxOut(0, script_output))
tx.vin.append(CTxIn(COutPoint(b.vtx[1].sha256, 0)))
b = self.update_block(i, [tx])
assert_equal(len(b.serialize()), MAX_BLOCK_BASE_SIZE)
blocks.append(b)
self.save_spendable_output()
spend = self.get_spendable_output()
self.sync_blocks(blocks, True, timeout=180)
chain1_tip = i
# now create alt chain of same length
self.move_tip(88)
blocks2 = []
for i in range(89, LARGE_REORG_SIZE + 89):
blocks2.append(self.next_block("alt" + str(i)))
self.sync_blocks(blocks2, False, request_block=False)
# extend alt chain to trigger re-org
block = self.next_block("alt" + str(chain1_tip + 1))
self.sync_blocks([block], True, timeout=180)
# ... and re-org back to the first chain
self.move_tip(chain1_tip)
block = self.next_block(chain1_tip + 1)
self.sync_blocks([block], False, request_block=False)
block = self.next_block(chain1_tip + 2)
self.sync_blocks([block], True, timeout=180)
# Helper methods
################
def add_transactions_to_block(self, block, tx_list):
[tx.rehash() for tx in tx_list]
block.vtx.extend(tx_list)
# this is a little handier to use than the version in blocktools.py
def create_tx(self, spend_tx, n, value, script=CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])):
return create_tx_with_script(spend_tx, n, amount=value, script_pub_key=script)
# sign a transaction, using the key we know about
# this signs input 0 in tx, which is assumed to be spending output n in spend_tx
def sign_tx(self, tx, spend_tx):
scriptPubKey = bytearray(spend_tx.vout[0].scriptPubKey)
if (scriptPubKey[0] == OP_TRUE): # an anyone-can-spend
tx.vin[0].scriptSig = CScript()
return
(sighash, err) = SignatureHash(spend_tx.vout[0].scriptPubKey, tx, 0, SIGHASH_ALL)
tx.vin[0].scriptSig = CScript([self.coinbase_key.sign(sighash) + bytes(bytearray([SIGHASH_ALL]))])
def create_and_sign_transaction(self, spend_tx, value, script=CScript([OP_TRUE])):
tx = self.create_tx(spend_tx, 0, value, script)
self.sign_tx(tx, spend_tx)
tx.rehash()
return tx
def next_block(self, number, spend=None, additional_coinbase_value=0, script=CScript([OP_TRUE]), solve=True):
if self.tip is None:
base_block_hash = self.genesis_hash
block_time = int(time.time()) + 1
else:
base_block_hash = self.tip.sha256
block_time = self.tip.nTime + 1
# First create the coinbase
height = self.block_heights[base_block_hash] + 1
coinbase = create_coinbase(height, self.coinbase_pubkey)
coinbase.vout[0].nValue += additional_coinbase_value
coinbase.rehash()
if spend is None:
block = create_block(base_block_hash, coinbase, block_time)
else:
coinbase.vout[0].nValue += spend.vout[0].nValue - 1 # all but one satoshi to fees
coinbase.rehash()
block = create_block(base_block_hash, coinbase, block_time)
tx = self.create_tx(spend, 0, 1, script) # spend 1 satoshi
self.sign_tx(tx, spend)
self.add_transactions_to_block(block, [tx])
block.hashMerkleRoot = block.calc_merkle_root()
if solve:
block.solve()
self.tip = block
self.block_heights[block.sha256] = height
assert number not in self.blocks
self.blocks[number] = block
return block
# save the current tip so it can be spent by a later block
def save_spendable_output(self):
self.log.debug("saving spendable output %s" % self.tip.vtx[0])
self.spendable_outputs.append(self.tip)
# get an output that we previously marked as spendable
def get_spendable_output(self):
self.log.debug("getting spendable output %s" % self.spendable_outputs[0].vtx[0])
return self.spendable_outputs.pop(0).vtx[0]
# move the tip back to a previous block
def move_tip(self, number):
self.tip = self.blocks[number]
# adds transactions to the block and updates state
def update_block(self, block_number, new_transactions):
block = self.blocks[block_number]
self.add_transactions_to_block(block, new_transactions)
old_sha256 = block.sha256
block.hashMerkleRoot = block.calc_merkle_root()
block.solve()
# Update the internal state just like in next_block
self.tip = block
if block.sha256 != old_sha256:
self.block_heights[block.sha256] = self.block_heights[old_sha256]
del self.block_heights[old_sha256]
self.blocks[block_number] = block
return block
def bootstrap_p2p(self):
"""Add a P2P connection to the node.
Helper to connect and wait for version handshake."""
self.nodes[0].add_p2p_connection(P2PDataStore())
# We need to wait for the initial getheaders from the peer before we
# start populating our blockstore. If we don't, then we may run ahead
# to the next subtest before we receive the getheaders. We'd then send
# an INV for the next block and receive two getheaders - one for the
# IBD and one for the INV. We'd respond to both and could get
# unexpectedly disconnected if the DoS score for that error is 50.
self.nodes[0].p2p.wait_for_getheaders(timeout=5)
def reconnect_p2p(self):
"""Tear down and bootstrap the P2P connection to the node.
The node gets disconnected several times in this test. This helper
method reconnects the p2p and restarts the network thread."""
self.nodes[0].disconnect_p2ps()
self.bootstrap_p2p()
def sync_blocks(self, blocks, success=True, reject_code=None, reject_reason=None, request_block=True, reconnect=False, timeout=60):
"""Sends blocks to test node. Syncs and verifies that tip has advanced to most recent block.
Call with success = False if the tip shouldn't advance to the most recent block."""
self.nodes[0].p2p.send_blocks_and_test(blocks, self.nodes[0], success=success, reject_code=reject_code, reject_reason=reject_reason, request_block=request_block, timeout=timeout)
if reconnect:
self.reconnect_p2p()
if __name__ == '__main__':
FullBlockTest().main()
| Bushstar/UFO-Project | test/functional/feature_block.py | Python | mit | 60,904 |
@extends("layout")
@section("content")
<script type="text/javascript" src="{{ URL("js/interactive.js") }}">
</script>
<section id="wrapper">
@if ($imagenes->isEmpty())
<section id="photos-empty">
<p class="center">
Todavía no hay imágenes
</p>
</section>
@else
<section id="photos-content">
@foreach ($imagenes as $imagen)
<figure>
<a href="{{ URL::to("/picture/".$imagen->id) }}">
<img src="{{ URL::to($imagen->ruta) }}" alt="{{ $imagen->titulo }}" title="{{ $imagen->titulo }}">
</a>
</figure>
@endforeach
</section>
@endif
<section id="info-wrapper">
@if (Session::has("aviso"))
<section id="message">
<label class="center">
{{ Session::get("aviso") }}
</label>
</section>
@endif
<section id="user">
<figure>
<img src="{{ URL::to($usuario->imagen) }}" alt="{{ $usuario->nombre }}">
</figure>
<a href="{{ URL::to("/user/".$usuario->nick) }}">
{{ $usuario->nombre }}
</a>
<p>
{{ '@'.$usuario->nick }}
</p>
@if (Auth::check() && Auth::user()->nick == $usuario->nick)
<a href="{{ URL::to("/alter") }}">
Modificar cuenta
</a>
@endif
</section>
@if (!$categorias->isEmpty())
<section id="categories">
<h2 class="center last">
Categorías
</h2>
@foreach ($categorias as $categoria)
<a href="{{ URL::to("category/".$categoria->id) }}">
{{ $categoria->nombre }}
</a>
@endforeach
</section>
@else
@if (Auth::check() && Auth::user()->nick == $usuario->nick)
<section id="categories">
<h2 class="center last">
Categorías
</h2>
<p class="center">
No has creado ninguna categoría.
</p>
</section>
@endif
@endif
@if (Auth::check() && Auth::user()->nick == $usuario->nick)
<section class="manage">
<button type="button" class="btn-default profile" id="insert">
Crear categoría
</button>
<form class="form-default" action="{{ URL::to("/insert-category") }}" method="post" id="insert-form">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<label for="category">
Nombre
</label>
<input type="text" class="inp-default last" id="category" name="category">
<button type="button" class="btn-default" id="insert-cancel">
Cerrar
</button>
<button type="submit" class="btn-primary" id="insert-category">
Crear categoría
</button>
</form>
</section>
<section class="manage">
<button type="button" class="btn-default profile" id="upload">
Subir imagen
</button>
<form class="form-default" action="{{ URL::to("/upload-picture") }}" method="post" id="upload-form" enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<button type="button" class="btn-default" id="upload-file">
Elegir imagen
</button>
<label>
Tamaño máximo: 30 MB
</label>
<input type="file" id="file" name="file">
<label for="name">
Título
</label>
<input type="text" class="inp-default last" id="name" name="name">
<button type="button" class="btn-default" id="upload-cancel">
Cerrar
</button>
<button type="submit" class="btn-primary" id="upload-image">
Subir imagen
</button>
</form>
</section>
<section class="manage">
<button type="button" class="btn-default profile" id="delete">
Darme de baja
</button>
<form class="form-default" action="{{ URL::to("/delete-user") }}" method="post" id="delete-form">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<label>
Esta acción eliminará tu cuenta y tus datos de Piclike
</label>
<button type="button" class="btn-default" id="delete-cancel">
Cerrar
</button>
<button type="submit" class="btn-primary">
Darme de baja
</button>
</form>
</section>
@endif
</section>
</section>
@stop | iamas92/piclike | resources/views/user.blade.php | PHP | mit | 5,037 |
<?php
namespace Zakharovvi\HumansTxtBundle\Tests\Renderer;
use Zakharovvi\HumansTxtBundle\Tests\Filesystem;
use Zakharovvi\HumansTxtBundle\Renderer\TwigRenderer;
use Zakharovvi\HumansTxtBundle\Authors\Author;
/**
* @author Vitaliy Zakharov <zakharovvi@gmail.com>
*/
class TwigRendererTest extends \PHPUnit_Framework_TestCase
{
/**
* @var \PHPUnit_Framework_MockObject_MockObject
*/
protected $fileLocatorStub;
/**
* @var \Zakharovvi\HumansTxtBundle\Tests\Filesystem
*/
protected $filesystem;
/**
* @var string
*/
protected $workspace;
protected function setUp()
{
$this->fileLocatorStub = $this->getMock('\Symfony\Component\Config\FileLocatorInterface');
$this->filesystem = new Filesystem();
$this->workspace = $this->filesystem->getWorkspace();
}
protected function tearDown()
{
$this->filesystem->clean($this->workspace);
}
/**
* @param string $content
* @return string
*/
protected function initSkeletonFile($content)
{
$realSkeletonFile = $this->workspace.DIRECTORY_SEPARATOR.'humans.txt';
file_put_contents($realSkeletonFile, $content);
$unrealSkeletonFile = '/unrealFile';
$this->fileLocatorStub->expects($this->once())
->method('locate')
->with($unrealSkeletonFile)
->will($this->returnValue($realSkeletonFile));
return $unrealSkeletonFile;
}
public function testFailOnInvalidSkeletonFile()
{
$this->setExpectedException('\InvalidArgumentException');
$nonexistentFile = '/path/to/nonexistent/file';
$this->fileLocatorStub->expects($this->once())
->method('locate')
->with($nonexistentFile)
->will($this->throwException(new \InvalidArgumentException));
new TwigRenderer($this->fileLocatorStub, $nonexistentFile);
}
public function testFailOnInvalidTemplate()
{
$this->setExpectedException('\RuntimeException');
$skeletonFile = $this->initSkeletonFile('{{ nonexistent_variable }}');
$renderer = new TwigRenderer($this->fileLocatorStub, $skeletonFile);
$renderer->render(array());
}
public function testRender()
{
$template = '/* TEAM */
{% for author in authors %}
{{ author.name }}
{{ author.email }}
{% endfor %}
';
$skeletonFile = $this->initSkeletonFile($template);
$renderer = new TwigRenderer($this->fileLocatorStub, $skeletonFile);
$renderedContent = '/* TEAM */
Vitaliy Zakharov
zakharovvi@gmail.com
Noreal Name
name@example.com
';
$author1 = new Author('Vitaliy Zakharov');
$author1->setEmail('zakharovvi@gmail.com');
$author2 = new Author('Noreal Name');
$author2->setEmail('name@example.com');
$authors = array($author1,$author2);
$this->assertEquals($renderedContent,$renderer->render($authors));
}
}
| zakharovvi/ZakharovviHumansTxtBundle | Tests/Renderer/TwigRendererTest.php | PHP | mit | 2,993 |
package pl.edu.wat.tim.webstore.service;
import pl.edu.wat.tim.webstore.model.UploadFile;
/**
* Created by Piotr on 15.06.2017.
*/
public interface UploadFileService {
void save(UploadFile uploadFile);
UploadFile getUploadFile(String name);
}
| PiotrJakubiak/GymNotes | src/main/java/pl/edu/wat/tim/webstore/service/UploadFileService.java | Java | mit | 256 |
'use strict';
angular.module('mgcrea.ngStrap.dropdown', ['mgcrea.ngStrap.tooltip'])
.provider('$dropdown', function() {
var defaults = this.defaults = {
animation: 'am-fade',
prefixClass: 'dropdown',
prefixEvent: 'dropdown',
placement: 'bottom-left',
template: 'dropdown/dropdown.tpl.html',
trigger: 'click',
container: false,
keyboard: true,
html: false,
delay: 0
};
this.$get = function($window, $rootScope, $tooltip, $timeout) {
var bodyEl = angular.element($window.document.body);
var matchesSelector = Element.prototype.matchesSelector || Element.prototype.webkitMatchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector;
function DropdownFactory(element, config) {
var $dropdown = {};
// Common vars
var options = angular.extend({}, defaults, config);
var scope = $dropdown.$scope = options.scope && options.scope.$new() || $rootScope.$new();
$dropdown = $tooltip(element, options);
var parentEl = element.parent();
// Protected methods
$dropdown.$onKeyDown = function(evt) {
if (!/(38|40)/.test(evt.keyCode)) return;
evt.preventDefault();
evt.stopPropagation();
// Retrieve focused index
var items = angular.element($dropdown.$element[0].querySelectorAll('li:not(.divider) a'));
if(!items.length) return;
var index;
angular.forEach(items, function(el, i) {
if(matchesSelector && matchesSelector.call(el, ':focus')) index = i;
});
// Navigate with keyboard
if(evt.keyCode === 38 && index > 0) index--;
else if(evt.keyCode === 40 && index < items.length - 1) index++;
else if(angular.isUndefined(index)) index = 0;
items.eq(index)[0].focus();
};
// Overrides
var show = $dropdown.show;
$dropdown.show = function() {
show();
// use timeout to hookup the events to prevent
// event bubbling from being processed imediately.
$timeout(function() {
options.keyboard && $dropdown.$element.on('keydown', $dropdown.$onKeyDown);
bodyEl.on('click', onBodyClick);
}, 0, false);
parentEl.hasClass('dropdown') && parentEl.addClass('open');
};
var hide = $dropdown.hide;
$dropdown.hide = function() {
if(!$dropdown.$isShown) return;
options.keyboard && $dropdown.$element.off('keydown', $dropdown.$onKeyDown);
bodyEl.off('click', onBodyClick);
parentEl.hasClass('dropdown') && parentEl.removeClass('open');
hide();
};
var destroy = $dropdown.destroy;
$dropdown.destroy = function() {
bodyEl.off('click', onBodyClick);
destroy();
};
// Private functions
function onBodyClick(evt) {
if(evt.target === element[0]) return;
return evt.target !== element[0] && $dropdown.hide();
}
return $dropdown;
}
return DropdownFactory;
};
})
.directive('bsDropdown', function($window, $sce, $dropdown) {
return {
restrict: 'EAC',
scope: true,
link: function postLink(scope, element, attr, transclusion) {
// Directive options
var options = {scope: scope};
angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'id'], function(key) {
if(angular.isDefined(attr[key])) options[key] = attr[key];
});
// use string regex match boolean attr falsy values, leave truthy values be
var falseValueRegExp = /^(false|0|)$/i;
angular.forEach(['html', 'container'], function(key) {
if(angular.isDefined(attr[key]) && falseValueRegExp.test(attr[key]))
options[key] = false;
});
// Support scope as an object
attr.bsDropdown && scope.$watch(attr.bsDropdown, function(newValue, oldValue) {
scope.content = newValue;
}, true);
// Visibility binding support
attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {
if(!dropdown || !angular.isDefined(newValue)) return;
if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(dropdown),?/i);
newValue === true ? dropdown.show() : dropdown.hide();
});
// Initialize dropdown
var dropdown = $dropdown(element, options);
// Garbage collection
scope.$on('$destroy', function() {
if (dropdown) dropdown.destroy();
options = null;
dropdown = null;
});
}
};
});
| avizuber/karma-web | app/bower_components/angular-strap/src/dropdown/dropdown.js | JavaScript | mit | 4,859 |
/*
*
* hocNotification
*
*/
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { compose, setPropTypes } from 'recompose';
import { createStructuredSelector } from 'reselect';
import { selectNotifications } from 'features/common_ui/selectors';
const mapStateToProps = createStructuredSelector({
notifications: selectNotifications(),
});
const sliderPropsType = setPropTypes({
notifications: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,
});
const hocNotification = compose(connect(mapStateToProps), sliderPropsType);
export default hocNotification;
| ch-apptitude/goomi | setup/src/universal/features/common_ui/hoc/hocNotification.js | JavaScript | mit | 615 |
<?php
declare(strict_types=1);
/*
* This file is part of the G.L.S.R. Apps package.
*
* (c) Dev-Int Création <info@developpement-interessant.com>.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Core\Infrastructure\Doctrine\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210502131525 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create the first throw of necessary tables.';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql(
'CREATE TABLE company (' .
'uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', ' .
'company_name VARCHAR(255) NOT NULL, ' .
'address VARCHAR(255) NOT NULL, ' .
'zip_code VARCHAR(5) NOT NULL, ' .
'town VARCHAR(255) NOT NULL, ' .
'country VARCHAR(255) NOT NULL, ' .
'phone VARCHAR(14) NOT NULL, ' .
'facsimile VARCHAR(14) DEFAULT NULL, ' .
'email VARCHAR(255) NOT NULL, ' .
'contact_name VARCHAR(255) NOT NULL, ' .
'cellphone VARCHAR(14) NOT NULL, ' .
'slug VARCHAR(255) NOT NULL, ' .
'UNIQUE INDEX UNIQ_4FBF094F1D4E64E8 (company_name), ' .
'UNIQUE INDEX UNIQ_4FBF094F989D9B62 (slug), ' .
'PRIMARY KEY(uuid)' .
') DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'
);
$this->addSql(
'CREATE TABLE settings (' .
'uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', ' .
'locale VARCHAR(255) NOT NULL, ' .
'currency VARCHAR(255) NOT NULL, ' .
'PRIMARY KEY(uuid)' .
') DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'
);
$this->addSql(
'CREATE TABLE supplier (' .
'uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', ' .
'family_log VARCHAR(255) NOT NULL, ' .
'delay_delivery INT NOT NULL, ' .
'order_days LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', ' .
'active TINYINT(1) NOT NULL, ' .
'company_name VARCHAR(255) NOT NULL, ' .
'address VARCHAR(255) NOT NULL, ' .
'zip_code VARCHAR(5) NOT NULL, ' .
'town VARCHAR(255) NOT NULL, ' .
'country VARCHAR(255) NOT NULL, ' .
'phone VARCHAR(14) NOT NULL, ' .
'facsimile VARCHAR(14) DEFAULT NULL, ' .
'email VARCHAR(255) NOT NULL, ' .
'contact_name VARCHAR(255) NOT NULL, ' .
'cellphone VARCHAR(14) NOT NULL, s' .
'lug VARCHAR(255) NOT NULL, ' .
'UNIQUE INDEX UNIQ_9B2A6C7E1D4E64E8 (company_name), ' .
'UNIQUE INDEX UNIQ_9B2A6C7E989D9B62 (slug), ' .
'PRIMARY KEY(uuid)' .
') DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'
);
$this->addSql(
'CREATE TABLE user (' .
'uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', ' .
'username VARCHAR(150) NOT NULL, ' .
'email VARCHAR(255) NOT NULL, ' .
'password VARCHAR(120) NOT NULL, ' .
'roles LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', ' .
'PRIMARY KEY(uuid)' .
') DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'
);
$this->addSql(
'CREATE TABLE messenger_messages (' .
'id BIGINT AUTO_INCREMENT NOT NULL, ' .
'body LONGTEXT NOT NULL, ' .
'headers LONGTEXT NOT NULL, ' .
'queue_name VARCHAR(190) NOT NULL, ' .
'created_at DATETIME NOT NULL, ' .
'available_at DATETIME NOT NULL, ' .
'delivered_at DATETIME DEFAULT NULL, ' .
'INDEX IDX_75EA56E0FB7336F0 (queue_name), ' .
'INDEX IDX_75EA56E0E3BD61CE (available_at), ' .
'INDEX IDX_75EA56E016BA31DB (delivered_at), ' .
'PRIMARY KEY(id)' .
') DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'
);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE company');
$this->addSql('DROP TABLE settings');
$this->addSql('DROP TABLE supplier');
$this->addSql('DROP TABLE user');
$this->addSql('DROP TABLE messenger_messages');
}
}
| Dev-Int/glsr | server/src/Core/Infrastructure/Doctrine/Migrations/Version20210502131525.php | PHP | mit | 4,815 |
package com.mybatistemplate.adapter;
import com.mybatistemplate.core.GeneratorIdSqlCallback;
import com.mybatistemplate.core.IdGeneratorType;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.ResultMap;
/**
* Created by leicheng on 2016/7/12.
*/
public abstract class TemplateExAdapter {
public void insertBatch(MappedStatement ms, ResultMap resultMap, String table, Class entity, IdGeneratorType idGeneratorType, GeneratorIdSqlCallback generatorIdSqlCallback) throws Exception{
}
public void updateBatch(MappedStatement ms, ResultMap resultMap, String table, Class entity) throws Exception{
}
}
| leicheng6563/MybatisTemplate | MybatisTemplate/src/main/java/com/mybatistemplate/adapter/TemplateExAdapter.java | Java | mit | 673 |
<?php
namespace Proxies\__CG__\Mistra\TutoBundle\Entity;
/**
* THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE.
*/
class User extends \Mistra\TutoBundle\Entity\User implements \Doctrine\ORM\Proxy\Proxy
{
private $_entityPersister;
private $_identifier;
public $__isInitialized__ = false;
public function __construct($entityPersister, $identifier)
{
$this->_entityPersister = $entityPersister;
$this->_identifier = $identifier;
}
/** @private */
public function __load()
{
if (!$this->__isInitialized__ && $this->_entityPersister) {
$this->__isInitialized__ = true;
if (method_exists($this, "__wakeup")) {
// call this after __isInitialized__to avoid infinite recursion
// but before loading to emulate what ClassMetadata::newInstance()
// provides.
$this->__wakeup();
}
if ($this->_entityPersister->load($this->_identifier, $this) === null) {
throw new \Doctrine\ORM\EntityNotFoundException();
}
unset($this->_entityPersister, $this->_identifier);
}
}
/** @private */
public function __isInitialized()
{
return $this->__isInitialized__;
}
public function getId()
{
if ($this->__isInitialized__ === false) {
return (int) $this->_identifier["id"];
}
$this->__load();
return parent::getId();
}
public function setLogin($login)
{
$this->__load();
return parent::setLogin($login);
}
public function getLogin()
{
$this->__load();
return parent::getLogin();
}
public function setPassword($password)
{
$this->__load();
return parent::setPassword($password);
}
public function getPassword()
{
$this->__load();
return parent::getPassword();
}
public function setAccess($access)
{
$this->__load();
return parent::setAccess($access);
}
public function getAccess()
{
$this->__load();
return parent::getAccess();
}
public function __sleep()
{
return array('__isInitialized__', 'id', 'login', 'password', 'access');
}
public function __clone()
{
if (!$this->__isInitialized__ && $this->_entityPersister) {
$this->__isInitialized__ = true;
$class = $this->_entityPersister->getClassMetadata();
$original = $this->_entityPersister->load($this->_identifier);
if ($original === null) {
throw new \Doctrine\ORM\EntityNotFoundException();
}
foreach ($class->reflFields as $field => $reflProperty) {
$reflProperty->setValue($this, $reflProperty->getValue($original));
}
unset($this->_entityPersister, $this->_identifier);
}
}
} | sportelli/mistra_tuto_symfony2 | app/cache/prod/doctrine/orm/Proxies/__CG__MistraTutoBundleEntityUser.php | PHP | mit | 3,004 |
// This contains the module definition factory function, application state,
// events, and the router.
this.jda = {
// break up logical components of code into modules.
module: function()
{
// Internal module cache.
var modules = {};
// Create a new module reference scaffold or load an existing module.
return function(name)
{
// If this module has already been created, return it
if (modules[name]) return modules[name];
// Create a module and save it under this name
return modules[name] = { Views: {} };
};
}(),
// Keep active application instances namespaced under an app object.
app: _.extend({
apiLocation : sessionStorage.getItem("apiUrl"),
currentView : 'list',
resultsPerPage : 100,
init : function(){
// make item collection
this.currentFilter=null;
var Browser = jda.module("browser");
this.resultsView = new Browser.Items.Collections.Views.Results();
this.eventMap = new Browser.Views.EventMap();
this.initCollectionsDrawer();
this.startRouter();
var _this=this;
},
initCollectionsDrawer:function(){
//load my collections drawer
var Browser = jda.module("browser");
this.myCollectionsDrawer = new Browser.Items.Collections.Views.MyCollectionsDrawer();
this.myCollectionsDrawer.getCollectionList();
},
startRouter: function()
{
var _this = this;
// Defining the application router, you can attach sub routers here.
var Router = Backbone.Router.extend({
routes: {
"" : 'search',
":query" : 'search'
},
search : function( query ){
_this.parseURLHash(query);
}
});
this.router = new Router();
Backbone.history.start();
},
queryStringToHash: function (query) {
var query_obj = {};
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
pair[0] = decodeURIComponent(pair[0]);
pair[1] = decodeURIComponent(pair[1]);
// If first entry with this name
if (typeof query_obj[pair[0]] === "undefined") {
query_obj[pair[0]] = pair[1];
// If second entry with this name
} else if (typeof query_obj[pair[0]] === "string") {
var arr = [ query_obj[pair[0]], pair[1] ];
query_obj[pair[0]] = arr;
// If third or later entry with this name
} else {
query_obj[pair[0]].push(pair[1]);
}
}
//parse time slider properties
query_obj.times = {};
if (query_obj.min_date !== null){
query_obj.times.start = query_obj.min_date;
}
if (query_obj.max_date !== null){
query_obj.times.end = query_obj.max_date;
}
return query_obj;
},
parseURLHash : function (query){
var _this=this;
var Browser = jda.module("browser");
//Update Search Object
if (!_.isUndefined(query)){
this.searchObject = this.queryStringToHash(query);
} else {
this.searchObject = {page:1};
}
console.log("searchObject",this.searchObject);
//Update interface
this.updateSearchUI(this.searchObject);
//Load filter if nec, carry out search
if(sessionStorage.getItem('filterType')=='none'||!_.isUndefined(this.filterModel)) {
if (!_.isUndefined(this.searchObject.view_type)) this.switchViewTo(this.searchObject.view_type,true) ;
else this.search(this.searchObject);
}
else{
$('.tab-content').find('.btn-group').hide();
$('#jda-related-tags').hide();
$('#event-button').hide();
if(sessionStorage.getItem('filterType')=='user'){
this.filterType ="user";
this.filterModel = new Browser.Users.Model({id:sessionStorage.getItem('filterId')});
this.filterModel.fetch({
success : function(model, response){
_this.resultsView.userFilter = new Browser.Users.Views.UserPage({model:model});
if (!_.isUndefined(_this.searchObject.view_type)) _this.switchViewTo(_this.searchObject.view_type,true) ;
else _this.search(_this.searchObject);
},
error : function(model, response){
console.log('Failed to fetch the user object.');
}
});
}
else if(sessionStorage.getItem('filterType')=='collection'){
this.filterType ="collection";
this.filterModel = new Browser.Items.Model({id:sessionStorage.getItem('filterId')});
this.filterModel.fetch({
success : function(model, response){
_this.resultsView.collectionFilter = new Browser.Items.Views.CollectionPage({model:model});
if (!_.isUndefined(_this.searchObject.view_type)) _this.switchViewTo(_this.searchObject.view_type,true) ;
else _this.search(_this.searchObject);
},
error : function(model, response){
console.log('Failed to fetch the user object.');
}
});
}
}
},
sort : function(){
this.searchObject.sort = $('#zeega-sort').val();
this.updateURLHash(this.searchObject);
this.search(this.searchObject);
},
parseSearchUI : function(){
var facets = VisualSearch.searchQuery.models;
var obj={};
var tagQuery = "";
var textQuery = "";
_.each( VisualSearch.searchBox.facetViews, function( facet ){
if( facet.model.get('category') != 'tag' && facet.model.get('category') != 'text')
{
facet.model.set({'value': null });
facet.remove();
}
});
_.each(facets, function(facet){
switch ( facet.get('category') )
{
case 'text':
textQuery = (textQuery.length > 0) ? textQuery + " AND " + facet.get('value') : facet.get('value');
textQuery=textQuery.replace(/^#/, '');
break;
case 'tag':
tagQuery = (tagQuery.length > 0) ? tagQuery + " AND " + facet.get('value') : tagQuery + facet.get('value');
tagQuery=tagQuery.replace(/^#/, '');
break;
}
});
obj.q = textQuery;
obj.tags = tagQuery;
obj.view_type = this.currentView;
obj.media_type = $('#zeega-content-type').val();
// remove retweets
if ($("#noRTChk").is(":checked")) {
obj.nq = "RT";
}
obj.sort = $('#zeega-sort').val();
obj.times = this.searchObject.times;
this.searchObject=obj;
this.updateURLHash(obj);
this.search(obj);
},
updateSearchUI : function(obj){
VisualSearch.searchBox.disableFacets();
VisualSearch.searchBox.value('');
VisualSearch.searchBox.flags.allSelected = false;
var tags, text;
if (!_.isUndefined(obj.q)&&obj.q.length>0){
text = obj.q.split(" AND ");
for( var j=0; j<text.length; j++ ){
VisualSearch.searchBox.addFacet('text', text[j], 0);
}
}
//check for tags
if (!_.isUndefined(obj.tags)&&obj.tags.length>0){
tags = obj.tags.split(" AND ");
for(var i=0;i<tags.length;i++)
{
VisualSearch.searchBox.addFacet('tag', tags[i], 0);
}
}
if (!_.isUndefined(obj.media_type)) $('#zeega-content-type').val(obj.media_type);
else $('#zeega-content-type').val("");
if (!_.isUndefined(obj.sort)) $('#zeega-sort').val(obj.sort);
else $('#zeega-sort').val("relevant");
$('#select-wrap-text').text( $('#zeega-content-type option[value=\''+$('#zeega-content-type').val()+'\']').text() );
},
updateURLHash : function(obj){
var hash = '';
if( !_.isUndefined(this.viewType)) hash += 'view_type=' + this.viewType + '&';
if( !_.isUndefined(obj.q) && obj.q.length > 0) hash += 'q=' + obj.q + '&';
if( !_.isUndefined(obj.nq)) hash += 'nq=' + obj.nq + '&';
if( !_.isUndefined(obj.tags) && obj.tags.length > 0) hash += 'tags=' + obj.tags + '&';
if( !_.isUndefined(obj.media_type) )hash += 'media_type='+ obj.media_type + '&';
if( !_.isUndefined(obj.media_after) )hash += 'media_after='+ obj.media_after + '&';
if( !_.isUndefined(obj.media_before) )hash += 'media_before='+ obj.media_before + '&';
if( !_.isUndefined(obj.sort) ) hash += 'sort='+ obj.sort + '&';
if( !_.isUndefined(obj.mapBounds) ) hash += 'map_bounds='+ encodeURIComponent(obj.mapBounds) + '&';
if( !_.isUndefined(obj.times)&& !_.isNull(obj.times) )
{
if( !_.isUndefined(obj.times.start) ) hash += 'min_date='+ obj.times.start + '&';
if( !_.isUndefined(obj.times.end) ) hash += 'max_date='+ obj.times.end + '&';
}
jda.app.router.navigate(hash,{trigger:false});
},
search : function(obj){
if(!_.isUndefined(this.filterType)){
if(this.filterType=="user"){
obj.user= sessionStorage.getItem('filterId');
}
else if(this.filterType=="collection"){
obj.itemId = sessionStorage.getItem('filterId');
}
}
this.resultsView.search( obj,true );
if (this.currentView == 'event') this.eventMap.load();
},
switchViewTo : function( view , refresh ){
var _this=this;
if( view != this.currentView&&(view=="event"||this.currentView=="event"))refresh = true;
this.currentView = view;
$('.tab-pane').removeClass('active');
$('#zeega-'+view+'-view').addClass('active');
switch( this.currentView )
{
case 'list':
this.showListView(refresh);
break;
case 'event':
this.showEventView(refresh);
break;
case 'thumb':
this.showThumbnailView(refresh);
break;
default:
console.log('view type not recognized');
}
},
showListView : function(refresh){
$('#zeega-view-buttons .btn').removeClass('active');
$('#list-button').addClass('active');
$('#jda-right').show();
$('#event-time-slider').hide();
$('#zeega-results-count').removeClass('zeega-results-count-event');
$('#zeega-results-count').css('left', 0);
$('#zeega-results-count').css('z-index', 0);
$('#zeega-results-count-text-with-date').hide();
if(this.resultsView.updated)
{
this.resultsView.render();
}
this.viewType='list';
if(refresh){
this.searchObject.times=null;
this.search(this.searchObject);
}
this.updateURLHash(this.searchObject);
},
showThumbnailView : function(refresh){
$('#zeega-view-buttons .btn').removeClass('active');
$('#thumb-button').addClass('active');
$('#jda-right').show();
$('#event-time-slider').hide();
$('#zeega-results-count').removeClass('zeega-results-count-event');
$('#zeega-results-count').css('left', 0);
$('#zeega-results-count').css('z-index', 0);
$('#zeega-results-count-text-with-date').hide();
if(this.resultsView.updated)
{
this.resultsView.render();
}
this.viewType='thumb';
if(refresh){
this.searchObject.times=null;
this.search(this.searchObject);
}
this.updateURLHash(this.searchObject);
},
showEventView : function(refresh){
$('#zeega-view-buttons .btn').removeClass('active');
$('#event-button').addClass('active');
$('#jda-right').hide();
$('#event-time-slider').show();
$('#zeega-results-count').addClass('zeega-results-count-event');
$('#zeega-results-count').offset( { top:$('#zeega-results-count').offset().top, left:10 } );
$('#zeega-results-count').css('z-index', 1000);
$('#zeega-results-count-text-with-date').show();
/*
var removedFilters = "";
var _this = this;
_.each( VisualSearch.searchBox.facetViews, function( facet ){
if( facet.model.get('category') == 'tag' || facet.model.get('category') == 'collection' ||
facet.model.get('category') == 'user');
{
facet.model.set({'value': null });
facet.remove();
removedFilters += facet.model.get('category') + ": " + facet.model.get('value') + " ";
}
if( facet.model.get('category') == 'tag'){
_this.resultsView.clearTags();
}
if( facet.model.get('category') == 'collection' ||
facet.model.get('category') == 'user') {
_this.removeFilter(facet.model.get('category'),_this.resultsView.getSearch());
}
});
if (removedFilters.length > 0){
$('#removed-tag-name').text(removedFilters);
$('#remove-tag-alert').show('slow');
setTimeout(function() {
$('#remove-tag-alert').hide('slow');
}, 5000);
}
*/
$("#zeega-event-view").width($(window).width());
//this is the hacky way to update the search count properly on the map
$("#zeega-results-count").fadeTo(100,0);
this.viewType='event';
//this.parseSearchUI();
this.updateURLHash(this.searchObject);
this.search(this.searchObject);
},
setEventViewTimePlace : function(obj){
this.eventMap.updateTimePlace(obj);
},
clearSearchFilters : function(doSearch){
$('#zeega-content-type').val("all");
$('#select-wrap-text').text( $('#zeega-content-type option[value=\''+$('#zeega-content-type').val()+'\']').text() );
//remove search box values
VisualSearch.searchBox.disableFacets();
VisualSearch.searchBox.value('');
VisualSearch.searchBox.flags.allSelected = false;
if(doSearch) this.search({ page:1});
},
goToCollection: function (id){
window.location=$('#zeega-main-content').data('collection-link')+"/"+id;
},
goToUser: function (id){
window.location=$('#zeega-main-content').data('user-link')+"/"+id;
},
/***************************************************************************
- called when user authentication has occured
***************************************************************************/
userAuthenticated: function(){
$('#zeega-my-collections-share-and-organize').html('Saving collection...');
var _this=this;
if(this.myCollectionsDrawer.activeCollection.get('new_items').length>0){
this.myCollectionsDrawer.activeCollection.save({},{
success:function(model,response){
_this.initCollectionsDrawer();
}
});
}
else this.initCollectionsDrawer();
}
}, Backbone.Events)
};
| corinnecurcie/Japan-Digital-Archive | web/js/app/jda.js | JavaScript | mit | 15,904 |
require 'spec_helper'
module Sendgrid
module API
module Entities
describe Stats do
subject { described_class.new }
it { should respond_to(:delivered) }
it { should respond_to(:request) }
it { should respond_to(:unique_open) }
it { should respond_to(:unique_click) }
it { should respond_to(:processed) }
it { should respond_to(:date) }
it { should respond_to(:open) }
it { should respond_to(:click) }
it { should respond_to(:blocked) }
it { should respond_to(:spamreport) }
it { should respond_to(:drop) }
it { should respond_to(:bounce) }
it { should respond_to(:deferred) }
end
end
end
end | renatosnrg/sendgrid-api | spec/sendgrid/api/entities/stats_spec.rb | Ruby | mit | 728 |
//! @file
//! @copyright See <a href="LICENSE.txt">LICENSE.txt</a>.
#pragma once
#include "entity.hpp"
namespace ql {
//! Makes @p entity_id an entity: a being or object that can exist in the world.
auto make_entity(reg& reg, id entity_id, location location) -> id {
reg.assign<ql::location>(entity_id, location);
return entity_id;
}
}
| jonathansharman/Questless | Questless/Questless/src/entities/entity.cpp | C++ | mit | 346 |
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
using System.Runtime.Remoting.Lifetime;
using System.Windows.Forms;
using System.Drawing;
using System.Linq;
using NationalInstruments;
using NationalInstruments.DAQmx;
using NationalInstruments.VisaNS;
using DAQ;
using DAQ.HAL;
using DAQ.Environment;
using DAQ.TransferCavityLock;
using IMAQ;
using NavAnalysis;
using Newtonsoft.Json;
namespace NavHardwareControl
{
/// <summary>
/// This is the interface to the sympathetic specific hardware.
///
/// Flow chart (under normal conditions): UI -> controller -> hardware. Basically, that's it.
/// Exceptions:
/// -controller can set values displayed on UI (only meant for special cases, like startup or re-loading a saved parameter set)
/// -Some public functions allow the HC to be controlled remotely (see below).
///
/// HardwareState:
/// There are 3 states which the controller can be in: OFF, LOCAL and REMOTE.
/// OFF just means the HC is idle.
/// The state is set to LOCAL when this program is actively upating the state of the hardware. It does this by
/// reading off what's on the UI, finding any discrepancies between the current state of the hardware and the values on the UI
/// and by updating the hardware accordingly.
/// After finishing with the update, it resets the state to OFF.
/// When the state is set to REMOTE, the UI is disactivated. The hardware controller saves all the parameter values upon switching from
/// LOCAL to REMOTE, then does nothing. When switching back, it reinstates the hardware state to what it was before it switched to REMOTE.
/// Use this when you want to control the hardware from somewhere else (e.g. MOTMaster).
///
/// Remoting functions (SetValue):
/// Having said that, you'll notice that there are also public functions for modifying parameter values without putting the HC in REMOTE.
/// I wrote it like this because you want to be able to do two different things:
/// -Have the hardware controller take a back seat and let something else control the hardware for a while (e.g. MOTMaster)
/// This is when you should use the REMOTE state.
/// -You still want the HC to keep track of the hardware (hence remaining in LOCAL), but you want to send commands to it remotely
/// (say from a console) instead of from the UI. This is when you would use the SetValue functions.
///
/// The Hardware Report:
/// The Hardware report is a way of passing a dictionary (gauges, temperature measurements, error signals) to another program
/// (MotMaster, say). MOTMaster can then save the dictionary along with the data. I hope this will help towards answering questions
/// like: "what was the source chamber pressure when we took this data?". At the moment, the hardware state is also included in the report.
///
/// </summary>
public class Controller : MarshalByRefObject, CameraControllable, ExperimentReportable, IHardwareRelease
{
#region Constants
//Put any constants and stuff here
private static string cameraAttributesPath = (string)Environs.FileSystem.Paths["CameraAttributesPath"];
private static string profilesPath = (string)Environs.FileSystem.Paths["settingsPath"] + "\\NavigatorHardwareController\\";
private static Hashtable calibrations = Environs.Hardware.Calibrations;
#endregion
#region Setup
// table of all digital analogTasks
Hashtable digitalTasks = new Hashtable();
HSDIOStaticChannelController HSchannels;
//Cameras
public CameraController ImageController;
public bool cameraLoaded = false;
// Declare that there will be a controlWindow
ControlWindow controlWindow;
//Add the window for analysis
AnalWindow analWindow;
//private bool sHCUIControl;
public enum HCUIControlState { OFF, LOCAL, REMOTE };
public HCUIControlState HCState = new HCUIControlState();
private class cameraNotFoundException : ArgumentException { };
HardwareState stateRecord;
private Dictionary<string, Task> analogTasks;
// without this method, any remote connections to this object will time out after
// five minutes of inactivity.
// It just overrides the lifetime lease system completely.
public override Object InitializeLifetimeService()
{
return null;
}
public void Start()
{
// make the digital analogTasks. The function "CreateDigitalTask" is defined later
//e.g CreateDigitalTask("notEOnOff");
// CreateDigitalTask("eOnOff");
//This is to keep track of the various things which the HC controls.
analogTasks = new Dictionary<string, Task>();
var temp = Environs.Info["HSDIOBoard"];
HSchannels = new HSDIOStaticChannelController((string)Environs.Hardware.GetInfo("HSDIOBoard"), "0-31");
stateRecord = new HardwareState();
CreateHSDigitalTask("do00");
CreateHSDigitalTask("do01");
CreateDigitalTask("testDigitalChannel");
// make the analog output analogTasks. The function "CreateAnalogOutputTask" is defined later
//e.g. bBoxAnalogOutputTask = CreateAnalogOutputTask("b");
// steppingBBiasAnalogOutputTask = CreateAnalogOutputTask("steppingBBias");
CreateAnalogOutputTask("motCoil");
CreateAnalogOutputTask("aom1freq");
CreateAnalogOutputTask("motShutter");
CreateAnalogOutputTask("imagingShutter");
CreateAnalogOutputTask("rfSwitch");
CreateAnalogOutputTask("rfAtten");
//CreateAnalogInputTask("testInput", -10, 10);
// make the control controlWindow
controlWindow = new ControlWindow();
controlWindow.controller = this;
HCState = HCUIControlState.OFF;
Application.Run(controlWindow);
}
// this method runs immediately after the GUI sets up
internal void ControllerLoaded()
{
HardwareState loadedState = loadParameters(profilesPath + "StoppedParameters.json");
if (!loadedState.Equals(stateRecord))
{
foreach (KeyValuePair<string, double> pair in loadedState.analogs)
{
if (stateRecord.analogs.ContainsKey(pair.Key))
{
stateRecord.analogs[pair.Key] = pair.Value;
}
}
foreach (KeyValuePair<string, bool> pair in loadedState.digitals)
{
if (stateRecord.digitals.ContainsKey(pair.Key))
{
stateRecord.digitals[pair.Key] = pair.Value;
}
}
}
setValuesDisplayedOnUI(stateRecord);
ApplyRecordedStateToHardware();
}
public void ControllerStopping()
{
// things like saving parameters, turning things off before quitting the program should go here
StoreParameters(profilesPath + "StoppedParameters.json");
}
#endregion
#region private methods for creating un-timed Tasks/channels
// a list of functions for creating various analogTasks
private void CreateAnalogInputTask(string channel)
{
analogTasks[channel] = new Task(channel);
((AnalogInputChannel)Environs.Hardware.AnalogInputChannels[channel]).AddToTask(
analogTasks[channel],
0,
10
);
analogTasks[channel].Control(TaskAction.Verify);
}
// an overload to specify input range
private void CreateAnalogInputTask(string channel, double lowRange, double highRange)
{
analogTasks[channel] = new Task(channel);
((AnalogInputChannel)Environs.Hardware.AnalogInputChannels[channel]).AddToTask(
analogTasks[channel],
lowRange,
highRange
);
analogTasks[channel].Control(TaskAction.Verify);
}
private void CreateAnalogOutputTask(string channel)
{
stateRecord.analogs[channel] = (double)0.0;
analogTasks[channel] = new Task(channel);
AnalogOutputChannel c = ((AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels[channel]);
c.AddToTask(
analogTasks[channel],
c.RangeLow,
c.RangeHigh
);
analogTasks[channel].Control(TaskAction.Verify);
}
// setting an analog voltage to an output
public void SetAnalogOutput(string channel, double voltage)
{
SetAnalogOutput(channel, voltage, false);
}
//Overload for using a calibration before outputting to hardware
public void SetAnalogOutput(string channelName, double voltage, bool useCalibration)
{
AnalogSingleChannelWriter writer = new AnalogSingleChannelWriter(analogTasks[channelName].Stream);
double output;
if (useCalibration)
{
try
{
output = ((Calibration)calibrations[channelName]).Convert(voltage);
}
catch (DAQ.HAL.Calibration.CalibrationRangeException)
{
MessageBox.Show("The number you have typed is out of the calibrated range! \n Try typing something more sensible.");
throw new CalibrationException();
}
catch
{
MessageBox.Show("Calibration error");
throw new CalibrationException();
}
}
else
{
output = voltage;
}
try
{
writer.WriteSingleSample(true, output);
analogTasks[channelName].Control(TaskAction.Unreserve);
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
public class CalibrationException : ArgumentOutOfRangeException { };
// reading an analog voltage from input
public double ReadAnalogInput(string channel)
{
return ReadAnalogInput(channel, false);
}
public double ReadAnalogInput(string channelName, bool useCalibration)
{
AnalogSingleChannelReader reader = new AnalogSingleChannelReader(analogTasks[channelName].Stream);
double val = reader.ReadSingleSample();
analogTasks[channelName].Control(TaskAction.Unreserve);
if (useCalibration)
{
try
{
return ((Calibration)calibrations[channelName]).Convert(val);
}
catch
{
MessageBox.Show("Calibration error");
return val;
}
}
else
{
return val;
}
}
// overload for reading multiple samples
public double ReadAnalogInput(string channel, double sampleRate, int numOfSamples, bool useCalibration)
{
//Configure the timing parameters of the task
analogTasks[channel].Timing.ConfigureSampleClock("", sampleRate,
SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, numOfSamples);
//Read in multiple samples
AnalogSingleChannelReader reader = new AnalogSingleChannelReader(analogTasks[channel].Stream);
double[] valArray = reader.ReadMultiSample(numOfSamples);
analogTasks[channel].Control(TaskAction.Unreserve);
//Calculate the average of the samples
double sum = 0;
for (int j = 0; j < numOfSamples; j++)
{
sum = sum + valArray[j];
}
double val = sum / numOfSamples;
if (useCalibration)
{
try
{
return ((Calibration)calibrations[channel]).Convert(val);
}
catch
{
MessageBox.Show("Calibration error");
return val;
}
}
else
{
return val;
}
}
private void CreateDigitalTask(String name)
{
stateRecord.digitals[name] = false;
Task digitalTask = new Task(name);
((DigitalOutputChannel)Environs.Hardware.DigitalOutputChannels[name]).AddToTask(digitalTask);
digitalTask.Control(TaskAction.Verify);
digitalTasks.Add(name, digitalTask);
}
public void SetDigitalLine(string name, bool value)
{
Task digitalTask = ((Task)digitalTasks[name]);
DigitalSingleChannelWriter writer = new DigitalSingleChannelWriter(digitalTask.Stream);
writer.WriteSingleSampleSingleLine(true, value);
digitalTask.Control(TaskAction.Unreserve);
}
private void CreateHSDigitalTask(String name)
{
DigitalOutputChannel channel = (DigitalOutputChannel)Environs.Hardware.DigitalOutputChannels[name];
stateRecord.HSdigitals[name] = false;
HSchannels.CreateHSDigitalTask(name, channel.BitNumber);
}
public void SetHSDigitalLine(string name, bool value)
{
HSchannels.SetHSDigitalLine(name, value);
}
#endregion
#region keeping track of the state of the hardware!
/// <summary>
/// There's this thing I've called a hardware state. It's something which keeps track of digital and analog values.
/// I then have something called stateRecord (defines above as an instance of hardwareState) which keeps track of
/// what the hardware is doing.
/// Anytime the hardware gets modified by this program, the stateRecord get updated. Don't hack this.
/// It's useful to know what the hardware is doing at all times.
/// When switching to REMOTE, the updates no longer happen. That's why we store the state before switching to REMOTE and apply the state
/// back again when returning to LOCAL.
/// </summary>
[Serializable]
public class HardwareState
{
public Dictionary<string, double> analogs;
public Dictionary<string, bool> digitals;
public Dictionary<string, bool> HSdigitals;
public HardwareState()
{
analogs = new Dictionary<string, double>();
digitals = new Dictionary<string, bool>();
HSdigitals = new Dictionary<string, bool>();
}
}
#endregion
#region Saving and loading experimental parameters
// Saving the parameters when closing the controller
public void SaveParametersWithDialog()
{
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.Filter = "shc parameters|*.json";
saveFileDialog1.Title = "Save parameters";
saveFileDialog1.InitialDirectory = profilesPath;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
if (saveFileDialog1.FileName != "")
{
StoreParameters(saveFileDialog1.FileName);
}
}
}
private void StoreParameters(String dataStoreFilePath)
{
stateRecord = readValuesOnUI();
string record = JsonConvert.SerializeObject(stateRecord);
System.IO.File.WriteAllText(dataStoreFilePath, record);
controlWindow.WriteToConsole("Saved parameters to " + dataStoreFilePath);
}
//Load parameters when opening the controller
public void LoadParametersWithDialog()
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "Nav HC|*.json";
dialog.Title = "Load parameters";
dialog.InitialDirectory = profilesPath;
dialog.ShowDialog();
if (dialog.FileName != "") stateRecord = loadParameters(dialog.FileName);
setValuesDisplayedOnUI(stateRecord);
controlWindow.WriteToConsole("Parameters loaded from " + dialog.FileName);
}
private HardwareState loadParameters(String dataStoreFilePath)
{
if (!File.Exists(dataStoreFilePath))
{
controlWindow.WriteToConsole("Can't Find File");
return stateRecord;
}
HardwareState state;
using (StreamReader r = new StreamReader(dataStoreFilePath))
{
string json = r.ReadToEnd();
state = JsonConvert.DeserializeObject<HardwareState>(json);
}
return state;
}
#endregion
#region Controlling hardware and UI.
//This gets/sets the values on the GUI panel
#region Updating the hardware
public void ApplyRecordedStateToHardware()
{
applyToHardware(stateRecord);
}
public void UpdateHardware()
{
HardwareState uiState = readValuesOnUI();
DoUpdateHardware(uiState);
}
public void DoUpdateHardware(HardwareState newState)
{
HardwareState changes = getDiscrepancies(stateRecord, newState);
applyToHardware(changes);
updateStateRecord(changes);
setValuesDisplayedOnUI(stateRecord);
}
private void applyToHardware(HardwareState state)
{
if (state.analogs.Count != 0 || state.digitals.Count != 0 || state.HSdigitals.Count != 0)
{
if (HCState == HCUIControlState.OFF)
{
HCState = HCUIControlState.LOCAL;
controlWindow.UpdateUIState(HCState);
applyAnalogs(state);
applyDigitals(state);
applyHSDigitals(state);
HCState = HCUIControlState.OFF;
controlWindow.UpdateUIState(HCState);
}
}
else
{
controlWindow.WriteToConsole("The values on the UI are identical to those on the controller's records. Hardware must be up to date.");
}
}
private HardwareState getDiscrepancies(HardwareState oldState, HardwareState newState)
{
HardwareState state = new HardwareState();
state.analogs = new Dictionary<string, double>();
state.digitals = new Dictionary<string, bool>();
state.HSdigitals = new Dictionary<string, bool>();
foreach(KeyValuePair<string, double> pairs in oldState.analogs)
{
if (oldState.analogs[pairs.Key] != newState.analogs[pairs.Key])
{
state.analogs[pairs.Key] = newState.analogs[pairs.Key];
}
}
foreach (KeyValuePair<string, bool> pairs in oldState.digitals)
{
if (oldState.digitals[pairs.Key] != newState.digitals[pairs.Key])
{
state.digitals[pairs.Key] = newState.digitals[pairs.Key];
}
}
foreach (KeyValuePair<string, bool> pairs in oldState.HSdigitals)
{
if (oldState.HSdigitals[pairs.Key] != newState.HSdigitals[pairs.Key])
{
state.HSdigitals[pairs.Key] = newState.HSdigitals[pairs.Key];
}
}
return state;
}
private void updateStateRecord(HardwareState changes)
{
foreach (KeyValuePair<string, double> pairs in changes.analogs)
{
stateRecord.analogs[pairs.Key] = changes.analogs[pairs.Key];
}
foreach (KeyValuePair<string, bool> pairs in changes.digitals)
{
stateRecord.digitals[pairs.Key] = changes.digitals[pairs.Key];
}
foreach (KeyValuePair<string, bool> pairs in changes.HSdigitals)
{
stateRecord.HSdigitals[pairs.Key] = changes.HSdigitals[pairs.Key];
}
}
private void applyAnalogs(HardwareState state)
{
List<string> toRemove = new List<string>(); //In case of errors, keep track of things to delete from the list of changes.
foreach (KeyValuePair<string, double> pairs in state.analogs)
{
try
{
if (calibrations.ContainsKey(pairs.Key))
{
SetAnalogOutput(pairs.Key, pairs.Value, true);
}
else
{
SetAnalogOutput(pairs.Key, pairs.Value);
}
controlWindow.WriteToConsole("Set channel '" + pairs.Key.ToString() + "' to " + pairs.Value.ToString());
}
catch (CalibrationException)
{
controlWindow.WriteToConsole("Failed to set channel '"+ pairs.Key.ToString() + "' to new value");
toRemove.Add(pairs.Key);
}
}
foreach (string s in toRemove) //Remove those from the list of changes, as nothing was done to the Hardware.
{
state.analogs.Remove(s);
}
}
private void applyDigitals(HardwareState state)
{
foreach (KeyValuePair<string, bool> pairs in state.digitals)
{
SetDigitalLine(pairs.Key, pairs.Value);
controlWindow.WriteToConsole("Set channel '" + pairs.Key.ToString() + "' to " + pairs.Value.ToString());
}
}
private void applyHSDigitals(HardwareState state)
{
foreach (KeyValuePair<string, bool> pairs in state.HSdigitals)
{
SetHSDigitalLine(pairs.Key, pairs.Value);
controlWindow.WriteToConsole("Set channel '" + pairs.Key.ToString() + "' to " + pairs.Value.ToString());
}
}
#endregion
#region Reading and Writing to UI
private HardwareState readValuesOnUI()
{
HardwareState state = new HardwareState();
state.analogs = readUIAnalogs(stateRecord.analogs.Keys);
state.digitals = readUIDigitals(stateRecord.digitals.Keys);
state.HSdigitals = readUIHSDigitals(stateRecord.HSdigitals.Keys);
return state;
}
private Dictionary<string, double> readUIAnalogs(Dictionary<string, double>.KeyCollection keys)
{
Dictionary<string, double> analogs = new Dictionary<string, double>();
string[] keyArray = new string[keys.Count];
keys.CopyTo(keyArray, 0);
for (int i = 0; i < keys.Count; i++)
{
analogs[keyArray[i]] = controlWindow.ReadAnalog(keyArray[i]);
}
return analogs;
}
private Dictionary<string, bool> readUIDigitals(Dictionary<string, bool>.KeyCollection keys)
{
Dictionary<string, bool> digitals = new Dictionary<string,bool>();
string[] keyArray = new string[keys.Count];
keys.CopyTo(keyArray, 0);
for (int i = 0; i < keys.Count; i++)
{
digitals[keyArray[i]] = controlWindow.ReadDigital(keyArray[i]);
}
return digitals;
}
private Dictionary<string, bool> readUIHSDigitals(Dictionary<string, bool>.KeyCollection keys)
{
Dictionary<string, bool> digitals = new Dictionary<string, bool>();
string[] keyArray = new string[keys.Count];
keys.CopyTo(keyArray, 0);
for (int i = 0; i < keys.Count; i++)
{
digitals[keyArray[i]] = controlWindow.ReadHSDigital(keyArray[i]);
}
return digitals;
}
private void setValuesDisplayedOnUI(HardwareState state)
{
setUIAnalogs(state);
setUIDigitals(state);
setUIHSDigitals(state);
}
private void setUIAnalogs(HardwareState state)
{
foreach (KeyValuePair<string, double> pairs in state.analogs)
{
try
{
controlWindow.SetAnalog(pairs.Key, (double)pairs.Value);
}
catch
{
MessageBox.Show("Some parameters couldn't be loaded, check the parameter file in the settings folder");
}
}
}
private void setUIDigitals(HardwareState state)
{
foreach (KeyValuePair<string, bool> pairs in state.digitals)
{
controlWindow.SetDigital(pairs.Key, (bool)pairs.Value);
}
}
private void setUIHSDigitals(HardwareState state)
{
foreach (KeyValuePair<string, bool> pairs in state.HSdigitals)
{
controlWindow.SetHSDigital(pairs.Key, (bool)pairs.Value);
}
}
#endregion
#region Remoting stuff
/// <summary>
/// This is used when you want another program to take control of some/all of the hardware. The hc then just saves the
/// last hardware state, then prevents you from making any changes to the UI. Use this if your other program wants direct control of hardware.
/// </summary>
public void StartRemoteControl()
{
if (HCState == HCUIControlState.OFF)
{
if (!ImageController.IsCameraFree())
{
StopCameraStream();
}
StoreParameters(profilesPath + "tempParameters.json");
HCState = HCUIControlState.REMOTE;
controlWindow.UpdateUIState(HCState);
controlWindow.WriteToConsole("Remoting Started!");
}
else
{
MessageBox.Show("Controller is busy");
}
}
public void StopRemoteControl()
{
try
{
controlWindow.WriteToConsole("Remoting Stopped!");
setValuesDisplayedOnUI(loadParameters(profilesPath + "tempParameters.json"));
if (System.IO.File.Exists(profilesPath + "tempParameters.json"))
{
System.IO.File.Delete(profilesPath + "tempParameters.json");
}
}
catch (Exception)
{
controlWindow.WriteToConsole("Unable to load Parameters.");
}
HCState = HCUIControlState.OFF;
controlWindow.UpdateUIState(HCState);
ApplyRecordedStateToHardware();
}
/// <summary>
/// These SetValue functions are for giving commands to the hc from another program, while keeping the hc in control of hardware.
/// Use this if you want the HC to keep control, but you want to control the HC from some other program
/// </summary>
public void SetValue(string channel, double value)
{
HCState = HCUIControlState.LOCAL;
stateRecord.analogs[channel] = value;
SetAnalogOutput(channel, value, false);
setValuesDisplayedOnUI(stateRecord);
HCState = HCUIControlState.OFF;
}
public void SetValue(string channel, double value, bool useCalibration)
{
stateRecord.analogs[channel] = value;
HCState = HCUIControlState.LOCAL;
SetAnalogOutput(channel, value, useCalibration);
setValuesDisplayedOnUI(stateRecord);
HCState = HCUIControlState.OFF;
}
public void SetValue(string channel, bool value)
{
HCState = HCUIControlState.LOCAL;
if (stateRecord.digitals.ContainsKey(channel))
{
stateRecord.digitals[channel] = value;
SetDigitalLine(channel, value);
setValuesDisplayedOnUI(stateRecord);
}
else if (stateRecord.HSdigitals.ContainsKey(channel))
{
stateRecord.digitals[channel] = value;
SetHSDigitalLine(channel, value);
setValuesDisplayedOnUI(stateRecord);
}
HCState = HCUIControlState.OFF;
}
#endregion
#endregion
#region Local camera control
public void StartCameraControl()
{
try
{
ImageController = new CameraController("cam0");
ImageController.Initialize();
ImageController.SetCameraAttributes(cameraAttributesPath);
ImageController.PrintCameraAttributesToConsole();
cameraLoaded = true;
}
catch (Exception e)
{
MessageBox.Show(e.Message, "Camera Initialization Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
}
}
public void CameraStream()
{
try
{
ImageController.Stream(cameraAttributesPath);
}
catch { }
}
public void StopCameraStream()
{
try
{
ImageController.StopStream();
}
catch { }
}
public void CameraSnapshot()
{
try
{
ImageController.SingleSnapshot(cameraAttributesPath);
}
catch { }
}
public ushort[,] TempCameraSnapshot()
{
return ImageController.SingleSnapshot(cameraAttributesPath);
}
#endregion
#region Release/Reclaim Hardware
public void ReleaseHardware()
{
HSchannels.ReleaseHardware();
}
public void ReclaimHardware()
{
HSchannels.ReclaimHardware();
}
#endregion
#region Remote Camera Control
//Written for taking images triggered by TTL. This "Arm" sets the camera so it's expecting a TTL.
public ushort[,] GrabSingleImage(string cameraAttributesPath)
{
return ImageController.SingleSnapshot(cameraAttributesPath);
}
public ushort[][,] GrabMultipleImages(string cameraAttributesPath, int numberOfShots)
{
try
{
ushort[][,] images = ImageController.MultipleSnapshot(cameraAttributesPath, numberOfShots);
return images;
}
catch (TimeoutException)
{
FinishRemoteCameraControl();
return null;
}
}
public bool IsReadyForAcquisition()
{
return ImageController.IsReadyForAcqisition();
}
public void PrepareRemoteCameraControl()
{
StartRemoteControl();
}
public void FinishRemoteCameraControl()
{
StopRemoteControl();
}
public bool doesCameraExist()
{
return cameraLoaded;
}
#endregion
#region Saving Images
public void SaveImageWithDialog()
{
ImageController.SaveImageWithDialog();
}
public void SaveImage(string path)
{
ImageController.SaveImage(path);
}
#endregion
#region Hardware Monitor
#region Remote Access for Hardware Monitor
public Dictionary<String, Object> GetExperimentReport()
{
Dictionary<String, Object> report = new Dictionary<String, Object>();
report["testReport"] = "Report?";
foreach (KeyValuePair<string, double> pair in stateRecord.analogs)
{
report[pair.Key] = pair.Value;
}
foreach (KeyValuePair<string, bool> pair in stateRecord.digitals)
{
report[pair.Key] = pair.Value;
}
return report;
}
#endregion
#endregion
#region Stuff To Access from python
///In theory you can access any public method from python.
///In practice we only really want to access a small number of them.
///This region contains them. Hopefully by only putting functions in here we
///want to use we can get an idea of what, exactly we want this control
///software to do.
///
public void RemoteTest(object input)
{
controlWindow.WriteToConsole(input.ToString());
}
public string RemoteSetChannel(String channelName, object value)
{
if (digitalTasks.Contains(channelName))
{
if (value.GetType() != typeof(bool))
{
return "Can't set digital channel to non bool value";
}
HardwareState state = readValuesOnUI();
state.digitals[channelName] = (bool)value;
DoUpdateHardware(state);
return "";
}
if (analogTasks.ContainsKey(channelName))
{
float outValue;
bool didItParse = float.TryParse(value.ToString(), out outValue);
if (!didItParse)
{
return "Cant't set an analog channel to non numeric value";
}
HardwareState state = readValuesOnUI();
state.analogs[channelName] = outValue;
DoUpdateHardware(state);
return "";
}
return "Channel name not found";
}
public string[] RemoteGetChannels()
{
List<string> channels = new List<string>();
channels.AddRange(stateRecord.digitals.Keys);
channels.AddRange(stateRecord.analogs.Keys);
return channels.ToArray();
}
public string RemoteLoadParameters(string file)
{
if (!File.Exists(file))
{
return "file doesn't exist";
}
stateRecord = loadParameters(file);
setValuesDisplayedOnUI(stateRecord);
controlWindow.WriteToConsole("Loaded parameters from " + file);
return "";
}
public void CloseIt()
{
controlWindow.Close();
}
#endregion
}
}
| jstammers/EDMSuite | NavHardwareControl/Controller.cs | C# | mit | 35,814 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Khaale.TechTalks.AwesomeLibrary.Service")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("EPAM Systems")]
[assembly: AssemblyProduct("Khaale.TechTalks.AwesomeLibrary.Service")]
[assembly: AssemblyCopyright("Copyright © EPAM Systems 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("32ebdbb0-37fb-4197-aeab-5def4dd5102a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| khaale/Khaale.TechTalks.AwesomeLibs | src/BusinessService/Properties/AssemblyInfo.cs | C# | mit | 1,478 |
package at.ac.tuwien.big.xmlintelledit.xmltext.ecoretransform.impl;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import javax.activation.UnsupportedDataTypeException;
import org.apache.commons.lang3.StringEscapeUtils;
import org.eclipse.emf.common.util.Enumerator;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EEnumLiteral;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EcoreFactory;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
import org.eclipse.emf.ecore.util.ExtendedMetaData;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.FeatureMapUtil;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
import at.ac.tuwien.big.xmlintelledit.xmltext.ecoretransform.CollectionValueTransformation;
import at.ac.tuwien.big.xmlintelledit.xmltext.ecoretransform.EAttributeTransformator;
import at.ac.tuwien.big.xmlintelledit.xmltext.ecoretransform.EReferenceTransformator;
import at.ac.tuwien.big.xmlintelledit.xmltext.ecoretransform.PartialObjectCopier;
import at.ac.tuwien.big.xmlintelledit.xmltext.ecoretransform.SingleObjectTransformator;
import at.ac.tuwien.big.xmlintelledit.xmltext.ecoretransform.Transformator;
import at.ac.tuwien.big.xmlintelledit.xmltext.ecoretransform.ValueTransformator;
import at.ac.tuwien.big.xtext.util.MyEcoreUtil;
@SuppressWarnings({"rawtypes", "unchecked", "unused"})
public class TransformatorStructure {
private Map<EAttribute, EAttributeTransformator> xmlToEcoreAttr = new HashMap<EAttribute, EAttributeTransformator>();
private Map<EAttribute, EAttributeTransformator> ecoreToXmlAttr = new HashMap<EAttribute, EAttributeTransformator>();
private Map<EStructuralFeature, PartialObjectCopier> xmlToEcoreChanger = new HashMap<>();
private Map<EStructuralFeature, PartialObjectCopier> ecoreToXmlChanger = new HashMap<>();
private TypeTransformatorStore store;
private Map<EReference, EReferenceTransformator> xmlToEcoreRef = new HashMap<EReference, EReferenceTransformator>();
private Map<EReference, EReferenceTransformator> ecoreToXmlRef = new HashMap<EReference, EReferenceTransformator>();
private Map<String, EObject> fragmentToXmlObject = new HashMap<String, EObject>();
private Map<EReference,EReference> xmlToEcoreReferences = new HashMap<EReference, EReference>();
private Map<EAttribute,EAttribute> xmlToEcoreAttribute = new HashMap<>();
private Map<EEnum,EEnum> copiedEEnums = new HashMap<EEnum, EEnum>();
private Map<EEnumLiteral,EEnumLiteral> copiedEEnumLiterals = new HashMap<EEnumLiteral, EEnumLiteral>();
private Map<EEnumLiteral,EEnumLiteral> backEEnumLiteral = new HashMap<EEnumLiteral, EEnumLiteral>();
private Map<String,EEnumLiteral> backEEnumLiteralStr = new HashMap<String, EEnumLiteral>();
private Map<EClass, EClass> xmlToEcoreClasses = new HashMap<EClass, EClass>();
private Map<EClass, EClass> ecoreToXmlClasses = new HashMap<EClass, EClass>();
private Map<EStructuralFeature,EStructuralFeature> ecoreToXmlFeature = new HashMap<EStructuralFeature, EStructuralFeature>();
private Map<String,EObject> targetMap = new HashMap<String, EObject>();
private Set<EObject> handledTargets = new HashSet<EObject>();
private Map<String,String> restrictedDatatypes = new HashMap<String,String>();
public Map<String, String> getRestrictedDatatypes() {
return restrictedDatatypes;
}
public String getStoreName(EObject eobj) {
if (eobj instanceof EClass) {
return ((EClass) eobj).getName();
} else if (eobj instanceof EEnum) {
return ((EEnum)eobj).getName();
} else if (eobj instanceof EStructuralFeature) {
EStructuralFeature esf = (EStructuralFeature)eobj;
return esf.getEContainingClass().getName()+"."+esf.getName();
}
return null;
}
public void readInBasicTarget(Resource targetRes) {
for (EObject eobj: (Iterable<EObject>)()->targetRes.getAllContents()) {
String storeName = getStoreName(eobj);
if (storeName != null) {
targetMap.put(storeName, eobj);
}
}
}
public EObject getIfExists(String targetName) {
EObject ret = targetMap.get(targetName);
if (ret != null) {
handledTargets.add(ret);
}
return ret;
}
//1 to one correspondance
public TransformatorStructure(Resource source, Resource target) {
for (EObject eobj: (Iterable<EObject>)source.getAllContents()) {
if (eobj instanceof EClass) {
EClass cl = (EClass)eobj;
EClass ecoreClass = (EClass)target.getEObject(source.getURIFragment(eobj));
xmlToEcoreClasses.put(cl, ecoreClass);
ecoreToXmlClasses.put(ecoreClass,cl);
System.out.println("Associating "+ cl+ " to "+ecoreClass);
//Not all, because then we would do something multiple times
for (EAttribute eattr: cl.getEAttributes()) {
EAttribute newA = (EAttribute)target.getEObject(source.getURIFragment(eattr));
xmlToEcoreAttribute.put(eattr, newA);
}
for (EReference eattr: cl.getEReferences()) {
EReference newRef = (EReference)target.getEObject(source.getURIFragment(eattr));
xmlToEcoreReferences.put(eattr, newRef);
}
} else if (eobj instanceof EEnum) {
EEnum eenum = (EEnum)eobj;
copiedEEnums.put(eenum, (EEnum)target.getEObject(source.getURIFragment(eenum)));
for (EEnumLiteral lit: eenum.getELiterals()) {
EEnumLiteral back = (EEnumLiteral)target.getEObject(source.getURIFragment(lit));
copiedEEnumLiterals.put(lit, back);
backEEnumLiteral.put(back, lit);
backEEnumLiteralStr.put(eenum.getName()+"."+lit.getLiteral(), lit);
}
//Ignore for now
} else if (eobj instanceof EDataType) {
//???
} else if (eobj instanceof EAttribute) {
//Have handled every important above?
} else if (eobj instanceof EReference) {
//Have handled every important above?
}
}
//TODO: F�r kopierte ist es gef�hrlich ...
for (Entry<EClass,EClass> entr: xmlToEcoreClasses.entrySet()) {
if (!augmentEClassBasic(entr.getKey(), entr.getValue())) {
//TODO: Das stimmt so nicht ...
entr.setValue(null);
}
}
for (Entry<EAttribute,EAttribute> entr: xmlToEcoreAttribute.entrySet()) {
if (!augmentAttributeBasic(entr.getKey(), entr.getValue())) {
entr.setValue(null);
}
}
for (Entry<EReference,EReference> entr: xmlToEcoreReferences.entrySet()) {
if (!augmentReferenceBasic(entr.getKey(), entr.getValue())) {
entr.setValue(null);
}
}
}
private EClass mixedData;
private EClass mixedText;
private EClass mixedFeature;
private EClass mixedBaseClass;
private EReference mixedBaseMixedAttr;
private EAttribute mixedValueAttr;
private EPackage ecorePackage;
public void generateMixClasses() {
if (mixedData == null) {
mixedData = (EClass)getIfExists("MixedData");
if (mixedData == null) {
mixedData = EcoreFactory.eINSTANCE.createEClass();
mixedData.setName("MixedData");
mixedData.setAbstract(true);
mixedValueAttr = EcoreFactory.eINSTANCE.createEAttribute();
mixedValueAttr.setName("value");
mixedValueAttr.setEType(EcorePackage.Literals.ESTRING);
mixedValueAttr.setLowerBound(1);
mixedValueAttr.setUpperBound(1);
mixedData.getEStructuralFeatures().add(mixedValueAttr);
ecorePackage.getEClassifiers().add(mixedData);
} else {
mixedValueAttr = (EAttribute)mixedData.getEStructuralFeature("value");
}
mixedText = (EClass)getIfExists("MixedText");
if (mixedText == null) {
mixedText = EcoreFactory.eINSTANCE.createEClass();
mixedText.setName("MixedText");
mixedText.getESuperTypes().add(mixedData);
ecorePackage.getEClassifiers().add(mixedText);
}
mixedFeature = (EClass)getIfExists("MixedFeature");
if (mixedFeature == null) {
mixedFeature = EcoreFactory.eINSTANCE.createEClass();
mixedFeature.setName("MixedFeature");
mixedFeature.getESuperTypes().add(mixedData);
ecorePackage.getEClassifiers().add(mixedFeature);
}
mixedBaseClass = (EClass)getIfExists("MixedBaseClass");
if (mixedBaseClass == null) {
mixedBaseClass = EcoreFactory.eINSTANCE.createEClass();
mixedBaseClass.setName("MixedBaseClass");
mixedBaseClass.setAbstract(true);
mixedBaseMixedAttr = EcoreFactory.eINSTANCE.createEReference();
mixedBaseMixedAttr.setName("mixed");
mixedBaseMixedAttr.setLowerBound(0);
mixedBaseMixedAttr.setUpperBound(-1);
mixedBaseMixedAttr.setContainment(true);
mixedBaseMixedAttr.setEType(mixedData);
mixedBaseClass.getEStructuralFeatures().add(mixedBaseMixedAttr);
ecorePackage.getEClassifiers().add(mixedBaseClass);
} else {
mixedBaseMixedAttr = (EReference)mixedBaseClass.getEStructuralFeature("mixed");
}
}
}
public boolean isMixed(EStructuralFeature feat) {
//TODO: ... faster
if (!"mixed".equals(feat.getName())) {
return false;
}
if ((feat.getEType() instanceof EClass && mixedData.isSuperTypeOf((EClass)feat.getEType())) || (feat.getEType() != null && "EFeatureMapEntry".equals(feat.getEType().getName()))) {
return true;
}
return false;
}
public TransformatorStructure(TypeTransformatorStore store, ResourceSet resourceSet, File xmlEcore) {
this.store = store;
parseXmlEcore(resourceSet,xmlEcore);
}
private TransformatorStructure() {
}
public static TransformatorStructure withKnownResult(TypeTransformatorStore store, ResourceSet resourceSet,
Resource xmlResource, Resource ecoreResource) {
TransformatorStructure ret = new TransformatorStructure();
ret.store = store;
ret.xmlResource = ()->xmlResource.getAllContents();
ret.ecoreResources.add(ecoreResource);
ret.readInBasicTarget(ecoreResource);
ret.parseXmlEcoreBasic(ecoreResource, resourceSet, xmlResource.getURI(), ()->xmlResource.getAllContents(), false);
return ret;
}
public static TransformatorStructure fromXmlEcore(TypeTransformatorStore store,
ResourceSet resourceSet, Resource ecoreXmlResource, String targetFilename) {
TransformatorStructure ret = new TransformatorStructure();
ret.store = store;
ret.xmlResource = ()->ecoreXmlResource.getAllContents();
ret.parseXmlEcore(null,resourceSet,targetFilename==null?null:URI.createFileURI(targetFilename),ret.xmlResource, false);
return ret;
}
public static TransformatorStructure fromXmlEcores(TypeTransformatorStore store,
ResourceSet resourceSet, List<Resource> ecoreXmlResources, String targetFilename) {
TransformatorStructure ret = new TransformatorStructure();
ret.store = store;
int ind = 0;
for (Resource ecoreXmlResource: ecoreXmlResources) {
ret.xmlResource = ()->ecoreXmlResource.getAllContents();
ret.parseXmlEcore(null,resourceSet,targetFilename==null?null:URI.createFileURI(targetFilename+(++ind)+".ecore"),ret.xmlResource, false);
}
return ret;
}
public TransformatorStructure(TypeTransformatorStore store, ResourceSet resourceSet, Resource xmlResource) {
this.store = store;
this.xmlResource = ()->xmlResource.getAllContents();
parseXmlEcore(null,resourceSet,URI.createURI(xmlResource.getURI()+"simplified"),this.xmlResource,false);
}
public TransformatorStructure(TypeTransformatorStore store, ResourceSet resourceSet, File xmlResourceFile, Iterable<EObject> xmlResource) {
this.store = store;
this.xmlResource = xmlResource;
parseXmlEcore(null,resourceSet,URI.createFileURI(xmlResourceFile.getAbsolutePath()+".simple.ecore"),xmlResource,false);
}
private EAttribute commonIdAttribute = null;
private EClass commonIdClass = null;
private Map<EClass, EAttribute> realId = new HashMap<EClass, EAttribute>();
//private Map<EAttribute, EReference> attributeToReference = new HashMap<>();
//private Map<EReference, EAttribute> referenceToAttribute = new HashMap<>();
private void buildChangers() {
for (Entry<EAttribute,EAttributeTransformator> entry: xmlToEcoreAttr.entrySet()) {
// EAttribute attr = entry.getKey(); // TODO remove unused?
EAttributeTransformator tf = entry.getValue();
PartialObjectCopier poc = new PartialObjectCopier() {
@Override
public void copyFrom(TransformatorImpl trans, EObject xmlObject, EObject ret) {
//Workaround - remove if ressource is always correct
try {
if (xmlObject.eIsSet(tf.getXml())) {
Collection c = MyEcoreUtil.getAsCollection(xmlObject, tf.getXml());
c = tf.convertToEcore(c);
MyEcoreUtil.setAsCollectionBasic(ret,tf.getEcore(),c);
} else {
ret.eUnset(tf.getEcore());
}
} catch (IllegalArgumentException e) {
EStructuralFeature esf = xmlObject.eClass().getEStructuralFeature(tf.getXml().getName());
System.err.println(e.getMessage()+" => replaced by " + esf);
if (esf != null) {
if (xmlObject.eIsSet(esf)) {
Collection c = MyEcoreUtil.getAsCollection(xmlObject, esf);
c = tf.convertToEcore(c);
MyEcoreUtil.setAsCollectionBasic(ret,tf.getEcore(),c);
} else {
ret.eUnset(tf.getEcore());
}
}
}
}
};
xmlToEcoreChanger.put(tf.getXml(),poc);
xmlToEcoreChanger.put(tf.getEcore(),poc);
}
for (Entry<EAttribute,EAttributeTransformator> entry: ecoreToXmlAttr.entrySet()) {
// EAttribute attr = entry.getKey(); // TODO remove unused?
EAttributeTransformator tf = entry.getValue();
PartialObjectCopier poc = new PartialObjectCopier() {
@Override
public void copyFrom(TransformatorImpl trans, EObject eobject, EObject ret) {
if (eobject.eIsSet(tf.getEcore())) {
// String bla = attr.getName(); // TODO remove unused?
Collection c = MyEcoreUtil.getAsCollection(eobject, tf.getEcore());
c = tf.convertToXml(c);
MyEcoreUtil.setAsCollectionBasic(ret,tf.getXml(),c);
} else {
ret.eUnset(tf.getXml());
}
}
};
ecoreToXmlChanger.put(tf.getXml(),poc);
ecoreToXmlChanger.put(tf.getEcore(),poc);
}
for (Entry<EReference,EReferenceTransformator> entry: xmlToEcoreRef.entrySet()) {
// EReference ref = entry.getKey(); // TODO remove unused?
EReferenceTransformator tf = entry.getValue();
// ResourceSet rs; // TODO remove unused?
PartialObjectCopier poc = new PartialObjectCopier() {
@Override
public void copyFrom(TransformatorImpl trans, EObject xmlObject, EObject ret) {
try {
if (xmlObject.eIsSet(tf.getXml())) {
Collection c = MyEcoreUtil.getAsCollection(xmlObject, tf.getXml());
c = tf.convertToEcore(c, trans);
MyEcoreUtil.setAsCollectionBasic(ret,tf.getEcore(),c);
} else {
ret.eUnset(tf.getEcore());
}
} catch (IllegalArgumentException e) {
EStructuralFeature esf = xmlObject.eClass().getEStructuralFeature(tf.getXml().getName());
System.err.println(e.getMessage()+" => replaced by " + esf);
if (esf != null) {
if (xmlObject.eIsSet(esf)) {
Collection c = MyEcoreUtil.getAsCollection(xmlObject, esf);
c = tf.convertToEcore(c, trans);
MyEcoreUtil.setAsCollectionBasic(ret,tf.getEcore(),c);
} else {
ret.eUnset(tf.getEcore());
}
}
}
}
};
xmlToEcoreChanger.put(tf.getXml(),poc);
xmlToEcoreChanger.put(tf.getEcore(),poc);
}
for (Entry<EReference,EReferenceTransformator> entry: ecoreToXmlRef.entrySet()) {
// EReference ref = entry.getKey(); // TODO remove unused?
EReferenceTransformator tf = entry.getValue();
PartialObjectCopier poc = new PartialObjectCopier() {
@Override
public void copyFrom(TransformatorImpl trans, EObject eobject, EObject ret) {
if (eobject.eIsSet(tf.getEcore())) {
Collection c = MyEcoreUtil.getAsCollection(eobject, tf.getEcore());
c = tf.convertToXml(c, trans);
MyEcoreUtil.setAsCollectionBasic(ret,tf.getXml(),c);
} else {
ret.eUnset(tf.getXml());
}
}
};
ecoreToXmlChanger.put(tf.getXml(),poc);
ecoreToXmlChanger.put(tf.getEcore(),poc);
}
}
private void calcId() {
//Baue �berklasse �ber alle IDs
List<EClass> allIdClasses = new ArrayList<EClass>();
for (EClass ecl: ecoreToXmlClasses.keySet()) {
for (EAttribute attr: ecl.getEAttributes()) {
if (attr.isID()) {
allIdClasses.add(ecl);
}
}
}
Set<EClass> allIdClassesSet = new HashSet<EClass>(allIdClasses);
if (allIdClasses.isEmpty()) {
//Nothing to do
return;
}
//If there is only one, just pick the first ID you find and you are done!
if (allIdClassesSet.size() == 1) {
commonIdClass = allIdClasses.get(0);
commonIdAttribute = commonIdClass.getEIDAttribute();
} else {
//Check if there is a superclass which is a superclass of all id classes
Set<EClass> superClasses = new HashSet<EClass>();
EClass first = allIdClasses.get(0);
superClasses.add(first);
superClasses.addAll(first.getEAllSuperTypes());
for (int i = 1; i < allIdClasses.size(); ++i) {
EClass cl = allIdClasses.get(i);
Set<EClass> subSuper = new HashSet<EClass>(cl.getEAllSuperTypes());
subSuper.add(cl);
superClasses.retainAll(subSuper);
}
//All of these classes are candidates, but there must exist no class which has an attribute added due to that fact
for (EClass cl: ecoreToXmlClasses.keySet()) {
if (allIdClassesSet.contains(cl)) {
continue;
}
Set<EClass> superTypes = new HashSet<>(cl.getEAllSuperTypes());
superTypes.retainAll(allIdClassesSet);
if (!superTypes.isEmpty()) {
continue;
}
superClasses.remove(cl);
superClasses.removeAll(cl.getEAllSuperTypes());
}
boolean idAttributeExisted = false;
//Now you can arbitrarily pick one of the remaining candidates to add the ID attribute
if (!superClasses.isEmpty()) {
commonIdClass = superClasses.iterator().next();
} else {
//Create
commonIdClass = (EClass)getIfExists("CommonIdClass");
if (commonIdClass == null) {
commonIdClass = EcoreFactory.eINSTANCE.createEClass();
commonIdClass.setAbstract(true);
commonIdClass.setName("CommonIdClass");
ecorePackage.getEClassifiers().add(commonIdClass);
} else {
idAttributeExisted = true;
}
}
Object commonIdAttributeO = getIfExists("CommonIdClass.name");
if (commonIdAttributeO instanceof EAttribute) {
commonIdAttribute = (EAttribute)commonIdAttributeO;
} else {
commonIdAttribute = EcoreFactory.eINSTANCE.createEAttribute();
}
commonIdAttribute.setName("name"); //Good to provide an xtext ID!
commonIdAttribute.setUnique(true);
commonIdAttribute.setID(true);
commonIdAttribute.setLowerBound(1);
commonIdAttribute.setUpperBound(1);
commonIdAttribute.setEType(EcorePackage.Literals.ESTRING);
if (!idAttributeExisted) {
commonIdClass.getEStructuralFeatures().add(commonIdAttribute);
}
for (EClass cl: ecoreToXmlClasses.keySet()) {
realId.put(cl, cl.getEIDAttribute());
}
if (!idAttributeExisted) {
for (EClass cl: allIdClasses) {
EAttribute id = cl.getEIDAttribute();
if (cl != commonIdClass) {
if (id != null && id.getEContainingClass() == cl) {
cl.getEStructuralFeatures().remove(id);
}
if (!cl.getEAllSuperTypes().contains(commonIdClass)) {
cl.getESuperTypes().add(commonIdClass);
}
}
}
}
}
//Whenever you have an attribute which is an IDREF, replace it by a reference
for (Entry<EAttribute,EAttributeTransformator> entry: xmlToEcoreAttr.entrySet()) {
EAttribute attr = entry.getKey();
String attrEType = (attr.getEType() != null)?attr.getEType().getName():"";
if ("IDREF".equals(attrEType)) {
EAttribute ecoreAttr = entry.getValue().getEcore();
EObject erefO = getIfExists(getEcoreClassName(attr.getEContainingClass())+"."+getEcoreAttributeName(attr));
EReference ref = null;
boolean hadReference = false;
if (erefO instanceof EReference) {
ref = (EReference)erefO;
hadReference = true;
} else {
ref = EcoreFactory.eINSTANCE.createEReference();
setSimple(ecoreAttr, ref);
ref.setName(ecoreAttr.getName());
ref.setEType(commonIdClass);
}
EReference fref = ref;
//attributeToReference.put(ecoreAttr, ref);
//referenceToAttribute.put(ref, ecoreAttr);
if (!hadReference && ecoreAttr.getEContainingClass() != null) {
int idx = ecoreAttr.getEContainingClass().getEStructuralFeatures().indexOf(ecoreAttr);
ecoreAttr.getEContainingClass().getEStructuralFeatures().add(idx,ref);
ecoreAttr.getEContainingClass().getEStructuralFeatures().remove(ecoreAttr);
}
//Konvertiere jedes Objekt in seine ID
PartialObjectCopier poc = new PartialObjectCopier() {
@Override
public void copyFrom(TransformatorImpl transformator, EObject from, EObject to) {
Collection c = MyEcoreUtil.getAsCollection(from, fref);
List<Object> targetIds = new ArrayList<Object>();
for (Object o: c) {
EObject eo = (EObject)o;
EAttribute idAttr = null;
if (eo != null && eo.eClass() != null && eo.eClass().getEIDAttribute() != null) {
idAttr = eo.eClass().getEIDAttribute();
}
Collection ids = MyEcoreUtil.getAsCollection(eo, idAttr);
targetIds.addAll(ids);
}
MyEcoreUtil.setAsCollectionBasic(to, attr, targetIds);
}
};
ecoreToXmlChanger.put(ref,poc);
ecoreToXmlChanger.put(attr,poc);
ecoreToXmlFeature.put(ref, attr);
poc = new PartialObjectCopier() {
@Override
public void copyFrom(TransformatorImpl transformator, EObject from, EObject to) {
Collection c = MyEcoreUtil.getAsCollection(from, attr);
List<EObject> targetObjects = new ArrayList<>();
for (Object o: c) {
EObject eo = transformator.getXmlObject(String.valueOf(o));
if (eo != null) {
targetObjects.add(transformator.xml2Eobject(eo));
}
}
MyEcoreUtil.setAsCollectionBasic(to, fref, targetObjects);
}
};
xmlToEcoreChanger.put(attr, poc);
xmlToEcoreChanger.put(ref, poc);
}
if (attr.isID()) {
//Konvertiere jedes Objekt in seine ID
PartialObjectCopier poc = new PartialObjectCopier() {
@Override
public void copyFrom(TransformatorImpl transformator, EObject from, EObject to) {
Collection c = MyEcoreUtil.getAsCollection(from, commonIdAttribute);
MyEcoreUtil.setAsCollectionBasic(to, to.eClass().getEIDAttribute(), c);
}
};
ecoreToXmlChanger.put(commonIdAttribute,poc);
ecoreToXmlChanger.put(attr,poc);
poc = new PartialObjectCopier() {
@Override
public void copyFrom(TransformatorImpl transformator, EObject from, EObject to) {
Collection c = MyEcoreUtil.getAsCollection(from, from.eClass().getEIDAttribute());
MyEcoreUtil.setAsCollectionBasic(to, commonIdAttribute, c);
}
};
xmlToEcoreChanger.put(attr, poc);
xmlToEcoreChanger.put(commonIdAttribute, poc);
}
}
}
public void augmentWithStandardDatatypes() {
//Whenever you have an attribute which is an IDREF, replace it by a reference
for (Entry<EAttribute,EAttributeTransformator> entry: xmlToEcoreAttr.entrySet()) {
EAttribute attr = entry.getKey();
String attrEType = (attr.getEType() != null)?attr.getEType().getName():"";
EAttribute ecoreAttr = entry.getValue().getEcore();
if (ecoreAttr != null) {
String name = attr.getEAttributeType().getName();
String instanceClassName = attr.getEAttributeType().getInstanceClassName();
System.out.println("Have attribute with name "+name+ " of type "+attrEType+" with instance class "+instanceClassName);
//TODO: Warum ist das so? Gibt es auch andere unterschiede?
if ("AnyURI".equals(attrEType)) {
attrEType = "URI";
}
if (store.isStandardDatatype(attrEType)) {
EAnnotation annot = ecoreAttr.getEAnnotation("http://big.tuwien.ac.at/standardXMLDatatype");
if (annot == null) {
ecoreAttr.getEAnnotations().add(annot = EcoreFactory.eINSTANCE.createEAnnotation());
annot.setSource("http://big.tuwien.ac.at/standardXMLDatatype");
}
annot.getDetails().put("type",attrEType);
}
}
}
}
public EAttribute transformatorEcoreAttribute(EClass cl, EAttribute base) {
if (base == commonIdAttribute) {
return realId.getOrDefault(cl,base);
}
return base;
}
public EAttribute getIdAttribute() {
if (commonIdAttribute == null) {
calcId();
}
return commonIdAttribute;
}
private List<Resource> ecoreResources = new ArrayList<Resource>();
private Iterable<EObject> xmlResource;
public EClass getEcoreEClass(EClass xml) {
return xmlToEcoreClasses.get(xml);
}
public EClass getXmlEClass(EClass ecore) {
return ecoreToXmlClasses.get(ecore);
}
public PartialObjectCopier getChangerForXml(EStructuralFeature ecorefeat) {
return ecoreToXmlChanger.get(ecorefeat);
}
public PartialObjectCopier getChangerForEcore(EStructuralFeature xmlfeat) {
return xmlToEcoreChanger.get(xmlfeat);
}
private EAttributeTransformator getTransformatorForXml(EAttribute xml) {
EAttributeTransformator trafo = xmlToEcoreAttr.get(xml);
if (trafo == null) {
String fragment = xml.eResource().getURIFragment(xml);
EObject eobj = fragmentToXmlObject.get(fragment);
EAttributeTransformator ftrafo = xmlToEcoreAttr.get(eobj);
if (ftrafo == null) {
System.err.println("No transformator for "+xml +" found, eobject: " +eobj+"!");
} else {
trafo = new EAttributeTransformatorImpl(xml, ftrafo.getEcore(), ftrafo.getTransformation());
}
}
if (trafo.getEcore().isID() && trafo.getEcore() != commonIdAttribute) {
EAttributeTransformator ftrafo = trafo;
return new EAttributeTransformator() {
@Override
public EAttribute getXml() {
return xml;
}
@Override
public CollectionValueTransformation getTransformation() {
return ftrafo.getTransformation();
}
@Override
public EAttribute getEcore() {
return commonIdAttribute;
}
};
}
return trafo;
}
private EAttributeTransformator getTransformatorForEcore(EClass eClass, EAttribute ecore) {
return ecoreToXmlAttr.get(transformatorEcoreAttribute(eClass,ecore));
}
private EReferenceTransformator getTransformatorForXml(EReference xml) {
EReferenceTransformator trafo = xmlToEcoreRef.get(xml);
if (trafo == null) {
String fragment = xml.eResource().getURIFragment(xml);
EObject eobj = fragmentToXmlObject.get(fragment);
trafo = xmlToEcoreRef.get((EReference)eobj);
if (trafo == null) {
System.err.println("No transformator for "+xml +" found, eobject: " +eobj+"!");
} else {
trafo = new EReferenceTransformatorImpl(xml, trafo.getEcore(), trafo.getTransformation());
}
}
return trafo;
}
private EReferenceTransformator getTransformatorForEcore(EReference ecore) {
return ecoreToXmlRef.get(ecore);
}
private boolean addedAnyAnnotations = false;
private EClass documentRootClassXml;
private EClass rootClassXml;
private EClass rootClassEcore;
private EReference rootReferenceXml;
public void parseXmlEcoreBasic(Resource localEcore, ResourceSet resourceSet, URI targetEcoreUri, Iterable<EObject> xmlResource, boolean generateFile) {
EPackage xmlEPkg = null;
for (EObject eobj: xmlResource) {
if (eobj instanceof EPackage) {
xmlEPkg = (EPackage)eobj;
resourceSet.getPackageRegistry().put(xmlEPkg.getNsURI(), eobj);
}
}
ecorePackage = (EPackage)localEcore.getContents().get(0);
List<EAttribute> eattrs = new ArrayList<>();
List<EReference> erefs = new ArrayList<>();
List<EClass> eclasses = new ArrayList<>();
List<EEnum> eenums = new ArrayList<>();
resourceSet.getPackageRegistry().put(ecorePackage.getNsURI(), ecorePackage);
for (EObject eobj: xmlResource) {
if (eobj.eResource() != null) {
fragmentToXmlObject.put(eobj.eResource().getURIFragment(eobj),eobj);
}
if (eobj instanceof EClass) {
EClass cl = (EClass)eobj;
if (!cl.getName().equals("DocumentRoot")) {
EClass ecoreClass = generateShallowEClass(cl);
eclasses.add(cl);
xmlToEcoreClasses.put(cl, ecoreClass);
ecoreToXmlClasses.put(ecoreClass,cl);
System.out.println("Associating "+ cl+ " to "+ecoreClass);
//Not all, because then we would do something multiple times
for (EAttribute eattr: cl.getEAttributes()) {
xmlToEcoreAttribute.put(eattr, generateShallowAttribute(cl, ecoreClass, eattr));
eattrs.add(eattr);
}
for (EReference eattr: cl.getEReferences()) {
xmlToEcoreReferences.put(eattr, generateShallowReference(cl, ecoreClass, eattr));
erefs.add(eattr);
}
} else {
//Analyze subclass
documentRootClassXml = cl;
rootReferenceXml = TransformatorImpl.getRootFeature(cl);
rootClassXml = rootReferenceXml.getEReferenceType();
}
} else if (eobj instanceof EEnum) {
// EEnum eenum = (EEnum)eobj; // TODO remove unused?
EEnum targetEEnum = generateEEnum((EEnum)eobj);
eenums.add(targetEEnum);
//Ignore for now
} else if (eobj instanceof EDataType) {
//??
} else if (eobj instanceof EAttribute) {
//Have handled every important above?
} else if (eobj instanceof EReference) {
//Have handled every important above?
}
}
rootClassEcore = xmlToEcoreClasses.get(rootClassXml);
for (EClass key: eclasses) {
if (!augmentEClassBasic(key, xmlToEcoreClasses.get(key))) {
//TODO: Das stimmt so nicht ...
xmlToEcoreClasses.remove(key);
}
}
for (EAttribute attr: eattrs) {
if (!augmentAttributeBasic(attr, xmlToEcoreAttribute.get(attr))) {
xmlToEcoreAttribute.remove(attr);
}
}
for (EReference key: erefs) {
if (!augmentReferenceBasic(key, xmlToEcoreReferences.get(key))) {
xmlToEcoreReferences.remove(key);
}
}
buildChangers();
calcId();
augmentWithStandardDatatypes();
if (generateFile) {
try {
int ind = 0;
for (Resource ecoreRes: ecoreResources) {
ecoreRes.save(new FileOutputStream("testoutput"+(++ind)+".ecore"),null);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
public void parseXmlEcore(Resource localECoreResource, ResourceSet resourceSet, /*String xmlEcoreName, */URI targetEcoreUri, Iterable<EObject> xmlResource, boolean generateFile) {
EPackage xmlEPkg = null;
for (EObject eobj: xmlResource) {
if (eobj instanceof EPackage) {
xmlEPkg = (EPackage)eobj;
resourceSet.getPackageRegistry().put(xmlEPkg.getNsURI(), eobj);
}
}
if (xmlEPkg == null) {
for (EObject eobj: xmlResource) {
System.out.println("Found object: "+eobj);
}
}
if (localECoreResource == null) {
localECoreResource = targetEcoreUri==null?new XMIResourceImpl(): new XMIResourceImpl(
resourceSet.getURIConverter().normalize(targetEcoreUri)
);
this.ecoreResources.add(localECoreResource);
ecorePackage = EcoreFactory.eINSTANCE.createEPackage();
ecorePackage.setNsURI(xmlEPkg.getNsURI()+"simplified");
//epkg.setNsURI(xmlEPkg.getNsURI()+"-simplified");
//String xmlEcoreShortName = xmlEcoreName.split("\\.", 2)[0];
ecorePackage.setName((xmlEPkg.getName()+"Simplified").replace(".", ""));
ecorePackage.setNsPrefix(xmlEPkg.getNsPrefix()+"s");
localECoreResource.getContents().add(ecorePackage);
} else {
ecorePackage = (EPackage)localECoreResource.getContents().get(0);
}
List<EAttribute> eattrs = new ArrayList<>();
List<EReference> erefs = new ArrayList<>();
List<EClass> eclasses = new ArrayList<>();
List<EEnum> eenums = new ArrayList<>();
resourceSet.getPackageRegistry().put(ecorePackage.getNsURI(), ecorePackage);
for (EObject eobj: xmlResource) {
if (eobj.eResource() != null) {
fragmentToXmlObject.put(eobj.eResource().getURIFragment(eobj),eobj);
}
if (eobj instanceof EClass) {
EClass cl = (EClass)eobj;
if (!cl.getName().equals("DocumentRoot")) {
EClass ecoreClass = generateShallowEClass(cl);
eclasses.add(cl);
xmlToEcoreClasses.put(cl, ecoreClass);
ecoreToXmlClasses.put(ecoreClass,cl);
System.out.println("Associating "+ cl+ " to "+ecoreClass);
//Not all, because then we would do something multiple times
for (EAttribute eattr: cl.getEAttributes()) {
xmlToEcoreAttribute.put(eattr, generateShallowAttribute(cl, ecoreClass, eattr));
eattrs.add(eattr);
}
for (EReference eattr: cl.getEReferences()) {
xmlToEcoreReferences.put(eattr, generateShallowReference(cl, ecoreClass, eattr));
erefs.add(eattr);
}
ecorePackage.getEClassifiers().add(ecoreClass);
} else {
//Analyze subclass
if (rootReferenceXml == null) {
rootReferenceXml = TransformatorImpl.getRootFeature(cl);
if (rootReferenceXml != null) {
rootClassXml = rootReferenceXml.getEReferenceType();
documentRootClassXml = cl;
}
}
}
} else if (eobj instanceof EEnum) {
// EEnum eenum = (EEnum)eobj; // TODO remove unused?
EEnum targetEEnum = generateEEnum((EEnum)eobj);
ecorePackage.getEClassifiers().add(targetEEnum);
eenums.add(targetEEnum);
//Ignore for now
} else if (eobj instanceof EDataType) {
//???
} else if (eobj instanceof EAttribute) {
//Have handled every important above?
} else if (eobj instanceof EReference) {
//Have handled every important above?
}
}
rootClassEcore = xmlToEcoreClasses.get(rootClassXml);
for (EClass key: eclasses) {
if (!augmentEClass(key, xmlToEcoreClasses.get(key))) {
//TODO: Das stimmt so nicht ...
xmlToEcoreClasses.remove(key);
}
}
for (EAttribute attr: eattrs) {
if (!augmentAttribute(attr, xmlToEcoreAttribute.get(attr))) {
xmlToEcoreAttribute.remove(attr);
}
}
for (EReference key: erefs) {
if (!augmentReference(key, xmlToEcoreReferences.get(key))) {
xmlToEcoreReferences.remove(key);
}
}
//Add OCL expressions
for (EObject eobj: xmlResource) {
parseExtendedMetadata(eobj);
}
if (addedAnyAnnotations) {
EAnnotation annot = ecorePackage.getEAnnotation("http://www.eclipse.org/emf/2002/Ecore");
if (annot == null) {
annot = EcoreFactory.eINSTANCE.createEAnnotation();
annot.setSource("http://www.eclipse.org/emf/2002/Ecore");
ecorePackage.getEAnnotations().add(annot);
}
annot.getDetails().put("invocationDelegates","http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot");
annot.getDetails().put("settingDelegates","http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot");
annot.getDetails().put("validationDelegates","http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot");
}
buildChangers();
calcId();
augmentWithStandardDatatypes();
if (generateFile) {
try {
int ind = 0;
for (Resource ecoreRes: ecoreResources) {
ecoreRes.save(new FileOutputStream("testoutput"+(++ind)+".ecore"),null);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
public void parseXmlEcore(ResourceSet resourceSet, File xmlEcore) {
Resource.Factory.Registry reg = resourceSet.getResourceFactoryRegistry();
reg.getExtensionToFactoryMap().put(
"xmi",
new XMIResourceFactoryImpl());
reg.getExtensionToFactoryMap().put(
"ecore",
new EcoreResourceFactoryImpl());
//Register ecore file
final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(resourceSet.getPackageRegistry());
resourceSet.getLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
Resource res = resourceSet.getResource(resourceSet.getURIConverter().normalize(URI.createFileURI(xmlEcore.getAbsolutePath())), true);
this.xmlResource = ()->res.getAllContents();
parseXmlEcore(null,resourceSet, URI.createFileURI(xmlEcore.getAbsolutePath()+".simple.ecore"), xmlResource, true);
}
public void parseExtendedMetadata(EClass xml, EClass ecore) {
}
public String toFirstUpper(String str) {
if (str.length() <= 1) {
return str.toUpperCase();
}
return Character.toUpperCase(str.charAt(0))+str.substring(1);
}
public void parseExtendedMetadata(EAttribute xmlAttr, EAttribute ecoreAttr, EClass xmlClass, EClass ecoreClass) {
if (ecoreAttr == null) {
System.err.println("No attribute matching for "+xmlAttr);
return;
}
EDataType dataType = xmlAttr.getEAttributeType();
//Also parse that
for (EAnnotation dataTypeAnnot: dataType.getEAnnotations()) {
System.out.println("DataTypeAnnotation: "+dataTypeAnnot.getSource());
if ("http:///org/eclipse/emf/ecore/util/ExtendedMetaData".equals(dataTypeAnnot.getSource())) {
String pattern = dataTypeAnnot.getDetails().get("pattern");
EAnnotation additonal = ecoreClass.getEAnnotation("http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot");
/* <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
<details key="constraints" value="sameServics goodSpeed onlyOneImportant backupDifferent"/>
</eAnnotations>
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
<details key="sameServics" value="backup = null or backup.services->includesAll(services)"/>
<details key="goodSpeed" value="designSpeed <= server.speed->sum()"/>
<details key="onlyOneImportant" value="services->select(s | s.type = ServiceType::IMPORTANT)->size() <= 1"/>
<details key="backupDifferent" value="backup <> self"/>
</eAnnotations>*/
boolean needAdd = false;
boolean needAdd2 = false;
String curConstraints = "";
if (additonal == null) {
needAdd = true;
additonal = EcoreFactory.eINSTANCE.createEAnnotation();
additonal.setSource("http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot");
}
EAnnotation general = ecoreClass.getEAnnotation("http://www.eclipse.org/emf/2002/Ecore");
if (general != null) {
curConstraints = general.getDetails().get("constraints");
if (curConstraints == null) {
curConstraints = "";
}
} else {
needAdd2 = true;
general = EcoreFactory.eINSTANCE.createEAnnotation();
general.setSource("http://www.eclipse.org/emf/2002/Ecore");
}
String prepend = "self."+ecoreAttr.getName()+(MyEcoreUtil.isMany(ecoreAttr)?"->forAll(x | x":"");
String postpend = MyEcoreUtil.isMany(ecoreAttr)?")":"";
if (pattern != null) {
// 162 occurrences in eclass case study, but where do they all come from? there are only 84 occurrences of restrictions, which are not enumerations or length, and 143 in total
EAnnotation typeAnnotation = ((EClass) xmlAttr.eContainer()).getEAnnotations().get(0);
restrictedDatatypes.put(typeAnnotation.getDetails().get("name"), xmlAttr.getEAttributeType().getName());
String constraintName = "pattern"+toFirstUpper(ecoreAttr.getName());
String constraintValue = null;
constraintValue = ".matches('"+StringEscapeUtils.unescapeXml(pattern).replace("%20"," ").replace("\\", "\\\\").replace("'", "\\\"")+"')";
String[] baseConstraintValues = pattern.split("\\ ");
StringBuilder totalValue = new StringBuilder();
for (int bc = 0; bc < baseConstraintValues.length; ++bc) {
if (bc > 0) {
totalValue.append(" or ");
}
String spattern = baseConstraintValues[bc];
constraintValue = ".matches('"+StringEscapeUtils.unescapeXml(spattern).replace("%20"," ").replace("\\", "\\\\").replace("'", "\\\"")+"')";
String newValue = prepend+constraintValue+postpend;
totalValue.append(newValue);
}
String totalString = totalValue.toString();
if (xmlAttr.getLowerBound() == 0 && !xmlAttr.isMany() && baseConstraintValues.length > 0) {
totalString = "("+prepend+"=null) or "+totalString;
}
additonal.getDetails().put(constraintName, totalString);
curConstraints = curConstraints+ " "+constraintName;
}
String minLength = dataTypeAnnot.getDetails().get("minLength");
if (minLength != null) {
String constraintName = "minLength"+toFirstUpper(ecoreAttr.getName());
String constraintValue = ".size() >= "+minLength;
String prefix = (!xmlAttr.isMany()&&xmlAttr.getLowerBound()==0)?("("+prepend + " = null) or " + prepend):prepend;
additonal.getDetails().put(constraintName, prefix+constraintValue+postpend);
curConstraints = curConstraints+ " "+constraintName;
}
String maxLength = dataTypeAnnot.getDetails().get("maxLength");
if (maxLength != null) {
String constraintName = "maxLength"+toFirstUpper(ecoreAttr.getName());
String constraintValue = ".size() <= "+maxLength;
String prefix = (!xmlAttr.isMany()&&xmlAttr.getLowerBound()==0)?("("+prepend + " = null) or " + prepend):prepend;
additonal.getDetails().put(constraintName, prefix+constraintValue+postpend);
curConstraints = curConstraints+ " "+constraintName;
}
general.getDetails().put("constraints", curConstraints.trim());
if (needAdd2 && !curConstraints.trim().isEmpty()) {
ecoreClass.getEAnnotations().add(general);
}
if (needAdd && !additonal.getDetails().isEmpty()) {
ecoreClass.getEAnnotations().add(additonal);
addedAnyAnnotations = true;
}
}
}
}
public void parseExtendedMetadata(EReference xmlAttr, EReference ecoreAttr, EClass xmlClass, EClass ecoreClass) {
}
public void parseExtendedMetadata(EEnum xmlEnum, EEnum ecoreEnum) {
}
public void parseExtendedMetadata(EObject eobj) {
if (eobj instanceof EClass) {
parseExtendedMetadata((EClass)eobj,(EClass)xmlToEcoreClasses.get(eobj));
} else if (eobj instanceof EStructuralFeature) {
EStructuralFeature esf = (EStructuralFeature)eobj;
EClass srcCl = esf.getEContainingClass();
EClass trgCl = xmlToEcoreClasses.get(srcCl);
if (eobj instanceof EAttribute) {
parseExtendedMetadata((EAttribute)eobj,
(EAttribute)xmlToEcoreAttribute.get(eobj),srcCl,trgCl );
} else {
parseExtendedMetadata((EReference)eobj,
(EReference)xmlToEcoreReferences.get(eobj),srcCl,trgCl );
}
} else if (eobj instanceof EEnum) {
parseExtendedMetadata((EEnum)eobj,this.copiedEEnums.get(eobj));
}
}
public SingleObjectTransformator matchingObjectTransformation = new SingleObjectTransformator() {
@Override
public EObject convertToXml(EObject eobject, Transformator transformator) {
return transformator.eobject2xml(eobject);
}
@Override
public EObject convertToEcore(EObject xml, Transformator transformator) {
return transformator.xml2Eobject(xml);
}
};
private void setSimple(EStructuralFeature xmlFeature, EStructuralFeature target) {
target.setChangeable(true);
target.setLowerBound(xmlFeature.getLowerBound());
target.setUpperBound(xmlFeature.getUpperBound());
target.setOrdered(xmlFeature.isOrdered());
target.setTransient(false);
target.setUnique(xmlFeature.isUnique());
target.setVolatile(false);
}
public EEnum generateEEnum(EEnum from) {
EEnum ret = copiedEEnums.get(from);
if (ret != null) {
return ret;
}
copiedEEnums.put(from, ret = EcoreFactory.eINSTANCE.createEEnum());
ret.setName(from.getName());
for (EEnumLiteral lit: from.getELiterals()) {
EEnumLiteral target = copiedEEnumLiterals.get(lit);
if (target == null) {
copiedEEnumLiterals.put(lit, target = EcoreFactory.eINSTANCE.createEEnumLiteral());
backEEnumLiteral.put(target, lit);
backEEnumLiteralStr.put(from.getName()+"."+lit.getLiteral(), lit);
target.setLiteral(lit.getLiteral());
target.setName(lit.getName());
target.setValue(lit.getValue());
}
ret.getELiterals().add(target);
}
return ret;
}
public ValueTransformator<Object, Object> eenumTransformator(EEnum forEEnum) {
return new ValueTransformator<Object,Object>() {
@Override
public Object convertToEcore(Object xml) {
System.err.println("Convert to ecore needs to be reworked: was enumliteral->enumliteral, but appearanly others can be there too");
Object ret = copiedEEnumLiterals.get(xml);
if (ret == null && xml instanceof EEnumLiteral) {
String fragment = ((EEnumLiteral)xml).eResource().getURIFragment((EEnumLiteral)xml);
EObject eobj = fragmentToXmlObject.get(fragment);
ret = copiedEEnumLiterals.get(eobj);
} else {
// ret = ret;//xml; //Try?? TODO remove no-effect statement?
}
return ret;
}
@Override
public Object convertToXml(Object eobject) {
Object ret = backEEnumLiteral.get(eobject);
if (ret == null && eobject instanceof Enumerator) {
Enumerator enumerator = (Enumerator)eobject;
String totalStr = forEEnum.getName()+"."+enumerator.getLiteral();
ret = backEEnumLiteralStr.get(totalStr);
}
return ret;
}
};
}
public boolean augmentAttributeBasic(EAttribute xmlAttribute, EAttribute ecoreAttribute) {
EClass contCl = xmlToEcoreClasses.get(xmlAttribute.getEContainingClass());
if (contCl == null) {
System.err.println("No matching source found for "+xmlAttribute);
return false;
}
if (xmlAttribute.getEAttributeType() instanceof EEnum) {
//Directly reuse that enum (is this supported in the grammar?)
EEnum targetEEnum = copiedEEnums.get(xmlAttribute.getEAttributeType());
if (targetEEnum == null) {
System.err.println("I have not copied the eenum "+xmlAttribute.getEAttributeType());
return false;
} else {
EAttributeTransformatorImpl tfi = new EAttributeTransformatorImpl(xmlAttribute, ecoreAttribute,
new CollectionValueTransformationImpl(EEnumLiteral.class,
EEnumLiteral.class, eenumTransformator(targetEEnum)));
xmlToEcoreAttr.put(xmlAttribute, tfi);
ecoreToXmlAttr.put(ecoreAttribute, tfi);
return true;
}
}
CollectionValueTransformation trafo = store.getValueTransformationOrNull(xmlAttribute);
if (trafo == null) {
Boolean ret = checkMixedAttribute(contCl,xmlAttribute);
if (ret != null) {
return ret;
}
System.err.println("No transformation found for "+xmlAttribute);
return false;
}
EAttributeTransformatorImpl tfi = new EAttributeTransformatorImpl(xmlAttribute, ecoreAttribute, trafo);
xmlToEcoreAttr.put(xmlAttribute, tfi);
ecoreToXmlAttr.put(ecoreAttribute, tfi);
return true;
}
//There is no need to be a 1:1 correspondance!
public EStructuralFeature getXmlFeature(EStructuralFeature ecoreFeature) {
//Check id
if (java.util.Objects.equals(ecoreFeature,commonIdAttribute)) {
ecoreFeature = realId.getOrDefault(ecoreFeature,(EAttribute)ecoreFeature);
}
//Check reference - not necessary, I added it to ecoreToXmlFeature!
return ecoreToXmlFeature.get(ecoreFeature);
}
public Object getXmlValue(EObject eobj, EStructuralFeature ecoreFeature, int index) {
Collection col = MyEcoreUtil.getAsCollection(eobj, getXmlFeature(ecoreFeature));
if (col instanceof List) {
return ((List)col).get(index);
} else {
Object ret = null;
Iterator iter = col.iterator();
while (index >= 0) {
if (iter.hasNext()) {
ret = iter.next();
} else {
if (ecoreFeature instanceof EAttribute) {
EDataType dt = ((EAttribute)ecoreFeature).getEAttributeType();
ret = dt.getDefaultValue();
} else {
EReference ref = (EReference)ecoreFeature;
ret = MyEcoreUtil.createInstanceStatic(ref.getEReferenceType());
}
}
--index;
}
return ret;
}
}
public Boolean checkMixedAttribute(EClass contCl, EAttribute xmlAttribute) {
EDataType dt = xmlAttribute.getEAttributeType();
if (dt != null && "EFeatureMapEntry".equals(dt.getName()) && "mixed".equals(xmlAttribute.getName())) {
generateMixClasses();
contCl.getESuperTypes().add(mixedBaseClass);
PartialObjectCopier poc = new PartialObjectCopier() {
@Override
public void copyFrom(TransformatorImpl transformator, EObject from, EObject to) {
//This must NOT refer to ecoreAttribute!! //TODO: Store in a map or something like that ...
//Because there is only one target attribute
EStructuralFeature ecoreAttribute = from.eClass().getEStructuralFeature("mixed");
Collection c = MyEcoreUtil.getAsCollection(from, ecoreAttribute);
Collection t = MyEcoreUtil.getAsCollection(to, mixedBaseMixedAttr);
t.clear();
for (Object o: c) {
FeatureMap.Entry entry = (FeatureMap.Entry)o;
EStructuralFeature esf = entry.getEStructuralFeature();
if (esf.getEContainingClass().isSuperTypeOf(from.eClass())) {
//It is a class attribute
EObject feature = MyEcoreUtil.createInstanceStatic(mixedFeature);
feature.eSet(mixedValueAttr, getTargetName(esf));
t.add(feature);
} else if ("text".equals(esf.getName())) { //TODO: Improve filtering
//It is a string literal
EObject feature = MyEcoreUtil.createInstanceStatic(mixedText);
feature.eSet(mixedValueAttr, entry.getValue());
t.add(feature);
} else {
//TODO: Implement me
throw new RuntimeException(new UnsupportedDataTypeException("I currently only support text features and owned structural features in mixed content"));
}
}
}
};
//1. Add Object-Delta of this object (!) - this is automatically done by other methods
//2. Add Feature-Map-Delta of this object, so this POC has to be executed last
//Ist ok, da das Attribut bekannt ist, kann man es ja im transformer sp�ter ausf�hren, muss nur
//das letzte pro objekt sein!
xmlToEcoreChanger.put(xmlAttribute, poc);
xmlToEcoreChanger.put(mixedBaseMixedAttr, poc);
PartialObjectCopier ecoreToXmlPoc = new PartialObjectCopier() {
@Override
public void copyFrom(TransformatorImpl transformator, EObject ecore, EObject xml) {
//This must NOT use any of this attributes since it must be generic!
Collection c = MyEcoreUtil.getAsCollection(ecore, mixedBaseMixedAttr);
EStructuralFeature xmlFeature = xml.eClass().getEStructuralFeature("mixed");
List t = new ArrayList<>();
//TODO: Ber�cksichtige gleich, wenn das target eine Sequence ist ...
Map<EStructuralFeature,Integer> usedIndices = new HashMap<EStructuralFeature, Integer>();
for (Object o: c) {
EObject eo = (EObject)o;
if (mixedFeature.isSuperTypeOf(eo.eClass())) {
EStructuralFeature ecorefeat = ecore.eClass().getEStructuralFeature((String)eo.eGet(mixedValueAttr));
//Jetzt brauche ich aber den korrespondierenden Wert (und das korrespondierende Feature)
//Wenn es eine Referenz ist, ist das vielleicht nicht gespeichert
EStructuralFeature xmlFeat = getXmlFeature(ecorefeat);
Integer index = usedIndices.getOrDefault(xmlFeat, 0);
Object value = getXmlValue(xml, ecorefeat, index);
FeatureMap.Entry entry = FeatureMapUtil.createEntry(xmlFeat, value);
usedIndices.put(xmlFeat, index+1);
t.add(entry);
} else if (mixedText.isSuperTypeOf(eo.eClass())) {
FeatureMap.Entry entry = FeatureMapUtil.createTextEntry((String)eo.eGet(mixedValueAttr));
t.add(entry);
}
}
//Add remaining features
for (EStructuralFeature esf: xml.eClass().getEAllStructuralFeatures()) {
if (isMixed(esf)) {continue;}
Integer curIndex = usedIndices.getOrDefault(esf, 0);
Collection col = MyEcoreUtil.getAsCollection(xml, esf);
Iterator iter = col.iterator();
int lind = 0;
while (iter.hasNext() && lind < curIndex) {
iter.next();
}
while(iter.hasNext()) {
FeatureMap.Entry entry = FeatureMapUtil.createEntry(esf, iter.next());
t.add(entry);
}
}
MyEcoreUtil.setAsCollectionBasic(xml, xmlFeature, t);
}
};
ecoreToXmlChanger.put(xmlAttribute, ecoreToXmlPoc);
ecoreToXmlChanger.put(mixedBaseMixedAttr, ecoreToXmlPoc);
return false; //Remove this attribute because it is replaced!
}
return null;
}
public boolean augmentAttribute(EAttribute xmlAttribute, EAttribute ecoreAttribute) {
if (handledTargets.contains(ecoreAttribute)) {
return augmentAttributeBasic(xmlAttribute, ecoreAttribute);
}
EClass contCl = xmlToEcoreClasses.get(xmlAttribute.getEContainingClass());
if (xmlAttribute.getName().contains("pages")) {
System.out.println("Pages found!");
}
if (contCl == null) {
System.err.println("No matching source found for "+xmlAttribute);
return false;
}
if (xmlAttribute.getEAttributeType() instanceof EEnum) {
//Directly reuse that enum (is this supported in the grammar?)
EEnum targetEEnum = copiedEEnums.get(xmlAttribute.getEAttributeType());
if (targetEEnum == null) {
System.err.println("I have not copied the eenum "+xmlAttribute.getEAttributeType());
return false;
} else {
ecoreAttribute.setEType(targetEEnum);
contCl.getEStructuralFeatures().add(ecoreAttribute);
EAttributeTransformatorImpl tfi = new EAttributeTransformatorImpl(xmlAttribute, ecoreAttribute,
new CollectionValueTransformationImpl(EEnumLiteral.class,
EEnumLiteral.class, eenumTransformator(targetEEnum)));
xmlToEcoreAttr.put(xmlAttribute, tfi);
ecoreToXmlAttr.put(ecoreAttribute, tfi);
// EObject eobj; // TODO remove unused?
return true;
}
}
CollectionValueTransformation trafo = store.getValueTransformationOrNull(xmlAttribute);
if (trafo == null) {
//Check special case: mixed + EFeatureMapEntry
Boolean ret = checkMixedAttribute(contCl,xmlAttribute);
if (ret != null) {
return ret;
}
System.err.println("Cannot translate attribute "+xmlAttribute.getEContainingClass().getName()+"."+xmlAttribute.getName()+" of type "+xmlAttribute.getEAttributeType()+" (cannot find transformator)");
return false;
}
EDataType dt = store.getStandardDatatypeOrNull(trafo.getEcoreClass());
if (dt == null) {
System.err.println("Cannot translate attribute "+xmlAttribute.getEContainingClass().getName()+"."+xmlAttribute.getName()+" of type "+xmlAttribute.getEAttributeType()+" (cannot transform datatype)");
return false;
}
EAttributeTransformatorImpl tfi = new EAttributeTransformatorImpl(xmlAttribute, ecoreAttribute, trafo);
xmlToEcoreAttr.put(xmlAttribute, tfi);
ecoreToXmlAttr.put(ecoreAttribute, tfi);
ecoreAttribute.setEType(dt);
contCl.getEStructuralFeatures().add(ecoreAttribute);
return true;
}
public boolean augmentReferenceBasic(EReference xmlReference, EReference ecoreReference) {
EClass contCl = xmlToEcoreClasses.get(xmlReference.getEContainingClass());
if (contCl == null) {
System.err.println("No matching source found for "+xmlReference);
return false;
}
EClass targetClass = xmlToEcoreClasses.get(xmlReference.getEReferenceType());
if (targetClass == null) {
System.err.println("No matching type found for "+xmlReference.getEContainingClass().getName()+"."+xmlReference.getName()+" ("+xmlReference.getEReferenceType()+")");
return false;
}
EReferenceTransformatorImpl tfi = new EReferenceTransformatorImpl(xmlReference, ecoreReference,
new SingleBasedCollectionObjectTransformation(new InformatedSingleObjectTransformation(xmlReference.getEReferenceType(),
ecoreReference.getEReferenceType(), matchingObjectTransformation)));
xmlToEcoreRef.put(xmlReference, tfi);
ecoreToXmlRef.put(ecoreReference, tfi);
//contCl.getEStructuralFeatures().add(ecoreReference);
return true;
}
public boolean augmentReference(EReference xmlReference, EReference ecoreReference) {
if (handledTargets.contains(ecoreReference)) {
return augmentReferenceBasic(xmlReference, ecoreReference);
}
EClass contCl = xmlToEcoreClasses.get(xmlReference.getEContainingClass());
if (contCl == null) {
System.err.println("No matching source found for "+xmlReference);
return false;
}
EClass targetClass = xmlToEcoreClasses.get(xmlReference.getEReferenceType());
if (targetClass == null) {
System.err.println("No matching type found for "+xmlReference.getEContainingClass().getName()+"."+xmlReference.getName()+" ("+xmlReference.getEReferenceType()+")");
return false;
}
ecoreReference.setEType(targetClass);
EReferenceTransformatorImpl tfi = new EReferenceTransformatorImpl(xmlReference, ecoreReference,
new SingleBasedCollectionObjectTransformation(new InformatedSingleObjectTransformation(xmlReference.getEReferenceType(),
ecoreReference.getEReferenceType(), matchingObjectTransformation)));
xmlToEcoreRef.put(xmlReference, tfi);
ecoreToXmlRef.put(ecoreReference, tfi);
contCl.getEStructuralFeatures().add(ecoreReference);
return true;
}
public boolean augmentEClass(EClass xmlClass, EClass ecoreClass) {
if (handledTargets.contains(ecoreClass)) {
return augmentEClassBasic(xmlClass, ecoreClass);
}
for (EClass superType: xmlClass.getESuperTypes()) {
EClass ecoreSup = xmlToEcoreClasses.get(superType);
ecoreClass.getESuperTypes().add(ecoreSup);
}
//Ich glaube sonst ist nichts zu tun?
return true;
}
public boolean augmentEClassBasic(EClass xmlClass, EClass ecoreReference) {
return true;
}
public String getTargetName(EStructuralFeature xmlFeature){
String targetName = xmlFeature.getName();
if (xmlFeature.isMany() && !targetName.endsWith("s")) {
targetName = targetName+"s";
}
return targetName;
}
public String getEcoreAttributeName(EStructuralFeature xmlFeature) {
return getTargetName(xmlFeature);
}
public EAttribute generateShallowAttribute(EClass xmlClass, EClass ecoreClass, EAttribute xmlAttribute) {
String featName = getTargetName(xmlAttribute);
Object existing = getIfExists(ecoreClass.getName()+"."+featName);
EAttribute target = (existing instanceof EAttribute)?((EAttribute)existing):null;
if (target == null) {
target = EcoreFactory.eINSTANCE.createEAttribute();
target.setName(featName);
setSimple(xmlAttribute, target);
target.setID(xmlAttribute.isID());
}
ecoreToXmlFeature.put(target, xmlAttribute);
return target;
}
public void fixOpposites() {
//Don't fix it since it can't be handled by XText!
}
public EReference generateShallowReference(EClass xmlClass, EClass ecoreClass, EReference xmlReference) {
String featName = getTargetName(xmlReference);
EReference target = (EReference)getIfExists(ecoreClass.getName()+"."+featName);
if (target == null) {
target = EcoreFactory.eINSTANCE.createEReference();
target.setName(featName);
setSimple(xmlReference, target);
target.setContainment(xmlReference.isContainment());
}
ecoreToXmlFeature.put(target, xmlReference);
return target;
}
public String getEcoreClassName(EClass xmlClass) {
String targetName = xmlClass.getName();
if (targetName.endsWith("Type")) {
//targetName = targetName.substring(0,targetName.length()-"Type".length());
}
return targetName;
}
public EClass generateShallowEClass(EClass xmlClass) {
String targetName = getEcoreClassName(xmlClass);
EClass target = (EClass)getIfExists(targetName);
if (target == null) {
target = EcoreFactory.eINSTANCE.createEClass();
target.setName(targetName);
}
return target;
}
// TODO move this to a test class
public static void main(String[] args) {
TypeTransformatorStore store = new TypeTransformatorStore();
ResourceSet basicSet = new ResourceSetImpl();
TransformatorStructure structure = new TransformatorStructure(store, basicSet, new File("library3-base.ecore"));
}
public EObject getXmlEObject(String uriFragment) {
return fragmentToXmlObject.get(uriFragment);
}
public EClass getDocumentRoot() {
return documentRootClassXml;
}
public EClass getXmlRoot() {
return rootClassXml;
}
public EReference getXmlRootReference() {
return rootReferenceXml;
}
public EClass getEcoreRoot() {
return rootClassEcore;
}
public List<Resource> getEcoreResources() {
return ecoreResources;
}
}
| patrickneubauer/XMLIntellEdit | xmlintelledit/xmltext/src/main/java/at/ac/tuwien/big/xmlintelledit/xmltext/ecoretransform/impl/TransformatorStructure.java | Java | mit | 62,302 |
require 'rails_helper'
RSpec.describe Scrap, :type => :model do
context 'factories' do
it 'valid' do
expect(build(:scrap)).to be_valid
end
end
context 'validation' do
it { is_expected.to validate_presence_of(:message) }
end
end
| ppdeassis/scrapbook | spec/models/scrap_spec.rb | Ruby | mit | 257 |
// Copyright (c) 2011-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <qt/trafficgraphwidget.h>
#include <interfaces/node.h>
#include <qt/clientmodel.h>
#include <QColor>
#include <QPainter>
#include <QPainterPath>
#include <QTimer>
#include <cmath>
#define DESIRED_SAMPLES 800
#define XMARGIN 10
#define YMARGIN 10
TrafficGraphWidget::TrafficGraphWidget(QWidget *parent)
: QWidget(parent), timer(nullptr), fMax(0.0f), nMins(0), vSamplesIn(),
vSamplesOut(), nLastBytesIn(0), nLastBytesOut(0), clientModel(nullptr) {
timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, &TrafficGraphWidget::updateRates);
}
void TrafficGraphWidget::setClientModel(ClientModel *model) {
clientModel = model;
if (model) {
nLastBytesIn = model->node().getTotalBytesRecv();
nLastBytesOut = model->node().getTotalBytesSent();
}
}
int TrafficGraphWidget::getGraphRangeMins() const {
return nMins;
}
void TrafficGraphWidget::paintPath(QPainterPath &path, QQueue<float> &samples) {
int sampleCount = samples.size();
if (sampleCount > 0) {
int h = height() - YMARGIN * 2, w = width() - XMARGIN * 2;
int x = XMARGIN + w;
path.moveTo(x, YMARGIN + h);
for (int i = 0; i < sampleCount; ++i) {
x = XMARGIN + w - w * i / DESIRED_SAMPLES;
int y = YMARGIN + h - (int)(h * samples.at(i) / fMax);
path.lineTo(x, y);
}
path.lineTo(x, YMARGIN + h);
}
}
void TrafficGraphWidget::paintEvent(QPaintEvent *) {
QPainter painter(this);
painter.fillRect(rect(), Qt::black);
if (fMax <= 0.0f) {
return;
}
QColor axisCol(Qt::gray);
int h = height() - YMARGIN * 2;
painter.setPen(axisCol);
painter.drawLine(XMARGIN, YMARGIN + h, width() - XMARGIN, YMARGIN + h);
// decide what order of magnitude we are
int base = floor(log10(fMax));
float val = pow(10.0f, base);
const QString units = tr("KB/s");
const float yMarginText = 2.0;
// draw lines
painter.setPen(axisCol);
painter.drawText(XMARGIN, YMARGIN + h - h * val / fMax - yMarginText,
QString("%1 %2").arg(val).arg(units));
for (float y = val; y < fMax; y += val) {
int yy = YMARGIN + h - h * y / fMax;
painter.drawLine(XMARGIN, yy, width() - XMARGIN, yy);
}
// if we drew 3 or fewer lines, break them up at the next lower order of
// magnitude
if (fMax / val <= 3.0f) {
axisCol = axisCol.darker();
val = pow(10.0f, base - 1);
painter.setPen(axisCol);
painter.drawText(XMARGIN, YMARGIN + h - h * val / fMax - yMarginText,
QString("%1 %2").arg(val).arg(units));
int count = 1;
for (float y = val; y < fMax; y += val, count++) {
// don't overwrite lines drawn above
if (count % 10 == 0) {
continue;
}
int yy = YMARGIN + h - h * y / fMax;
painter.drawLine(XMARGIN, yy, width() - XMARGIN, yy);
}
}
if (!vSamplesIn.empty()) {
QPainterPath p;
paintPath(p, vSamplesIn);
painter.fillPath(p, QColor(0, 255, 0, 128));
painter.setPen(Qt::green);
painter.drawPath(p);
}
if (!vSamplesOut.empty()) {
QPainterPath p;
paintPath(p, vSamplesOut);
painter.fillPath(p, QColor(255, 0, 0, 128));
painter.setPen(Qt::red);
painter.drawPath(p);
}
}
void TrafficGraphWidget::updateRates() {
if (!clientModel) {
return;
}
quint64 bytesIn = clientModel->node().getTotalBytesRecv(),
bytesOut = clientModel->node().getTotalBytesSent();
float inRate =
(bytesIn - nLastBytesIn) / 1024.0f * 1000 / timer->interval();
float outRate =
(bytesOut - nLastBytesOut) / 1024.0f * 1000 / timer->interval();
vSamplesIn.push_front(inRate);
vSamplesOut.push_front(outRate);
nLastBytesIn = bytesIn;
nLastBytesOut = bytesOut;
while (vSamplesIn.size() > DESIRED_SAMPLES) {
vSamplesIn.pop_back();
}
while (vSamplesOut.size() > DESIRED_SAMPLES) {
vSamplesOut.pop_back();
}
float tmax = 0.0f;
for (const float f : vSamplesIn) {
if (f > tmax) {
tmax = f;
}
}
for (const float f : vSamplesOut) {
if (f > tmax) {
tmax = f;
}
}
fMax = tmax;
update();
}
void TrafficGraphWidget::setGraphRangeMins(int mins) {
nMins = mins;
int msecsPerSample = nMins * 60 * 1000 / DESIRED_SAMPLES;
timer->stop();
timer->setInterval(msecsPerSample);
clear();
}
void TrafficGraphWidget::clear() {
timer->stop();
vSamplesOut.clear();
vSamplesIn.clear();
fMax = 0.0f;
if (clientModel) {
nLastBytesIn = clientModel->node().getTotalBytesRecv();
nLastBytesOut = clientModel->node().getTotalBytesSent();
}
timer->start();
}
| cculianu/bitcoin-abc | src/qt/trafficgraphwidget.cpp | C++ | mit | 5,102 |
package de.felixroske.jfxsupport.util;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.MetadataReaderFactory;
import java.io.IOException;
/**
* Created by Krystian Kałużny on 03.07.2017.
*/
class InactiveSpringBootAppExcludeFilter extends ExcludeFilter {
@Override
public boolean exclude(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) throws IOException {
try {
if (isAnnotated(metadataReader, SpringBootApplication.class)) {
return !activeSpringBootClass.getName().equals(metadataReader.getClassMetadata().getClassName());
}
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
return false;
}
}
| krystiankaluzny/springboot-javafx-support | src/test/java/de/felixroske/jfxsupport/util/InactiveSpringBootAppExcludeFilter.java | Java | mit | 812 |
'''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Rds20140815CheckAccountNameAvailableRequest(RestApi):
def __init__(self,domain='rds.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.AccountName = None
self.DBInstanceId = None
self.resourceOwnerAccount = None
def getapiname(self):
return 'rds.aliyuncs.com.CheckAccountNameAvailable.2014-08-15'
| francisar/rds_manager | aliyun/api/rest/Rds20140815CheckAccountNameAvailableRequest.py | Python | mit | 408 |
# frozen_string_literal: true
module Eve
class AllRegionsContractsImporter
def import
region_ids.each do |region_id|
Eve::RegionContractsJob.perform_later(region_id)
end
end
private
def region_ids
@region_ids ||= Eve::Region.pluck(:region_id).sort.uniq
end
end
end
| biow0lf/evemonk | app/importers/eve/all_regions_contracts_importer.rb | Ruby | mit | 318 |
#!/usr/bin/env node
let layouts = [
`# French
&é"'(-è_çà)=
azertyuiop^$*
qsdfghjklmù
wxcvbn,;:!
`,
`# German (German (IBM) is the same)
1234567890ß
qwertzuiopü+#
asdfghjklöä
yxcvbnm,.-
`,
`# Spanish
1234567890'¡
qwertyuiop+ç
asdfghjklñ
zxcvbnm,.-
## ESV
1234567890-
qwertyuiop÷
asdfghjklñç
zxcvbnm,.=
`,
`# Português
1234567890'«
qwertyuiop+´~
asdfghjklçº
zxcvbnm,.-
## PTB
1234567890-=
qwertyuiop´[]
asdfghjklç~~
zxcvbnm,.;
`,
`# Russian
1234567890-=
йцукенгшщзхъ\
фывапролджэ
ячсмитьбю.
`,
`# Cyrillic
1234567890'+
љњертзуиопшђж
асдфгхјклчћ
ѕџцвбнм,.-
`,
`# Arabic
1234567890-=
ضصثقفغعهخحجد\
شسيبلاتنمكط
ئءؤرلاىةوزظ
`,
`# Korean
1234567890-=
qwertyuiop[]\
asdfghjkl;'
zxcvbnm,./
# Turkish
1234567890*-
qwertyuıopğü,
asdfghjklşi
zxcvbnmöç.
!'^+%&/()=?_
QWERTYUIOPĞÜ;
ASDFGHJKLŞİ
ZXCVBNMÖÇ:
`
].join("\n").split("\n").filter(
line => !(line[0] === "#" || line[0] === "(" && line.slice(-1) === ")")
).join("");
const getRe = name => name instanceof RegExp ? name : new RegExp(`[\\p{${name}}]`, "ug");
const filter = (text, re) => [...new Set(text.match(re, ""))].sort();
const parse = arr => [
arr,
arr.map(i=>i.codePointAt()).filter(i => i >= 128),
arr.length
];
const print = (category, text) => console.log(`${category}:`, ...parse(filter(text, getRe(category))));
print("Ll", layouts);
print("Lo", layouts);
print("Lu", layouts);
print("Lt", layouts);
print("Lm", layouts);
const range = (start, end, conv=String.fromCharCode) => {
const arr = [];
for (let i = start, end2 = end || start + 1; i < end2; i++) { arr.push(i); }
return conv ? conv(...arr) : arr;
};
const hex = (start, end) => range(start, end, null).map(i => i.toString(16));
print("Ll", range(1070, 1120));
print("Lo", range(1569, 1614));
var hasConsole = 1;
// hasConsole = 0;
if (typeof require === "function" && hasConsole) {
Object.assign(require('repl').start("node> ").context, {
hex, range, print, filter, parse, getRe, layouts
});
}
| gdh1995/vimium-plus | tests/unit/keyboard-layouts.js | JavaScript | mit | 2,107 |
import Ember from 'ember';
export default Ember.Component.extend({
tagName : '',
item : null,
isFollowing : false,
isLoggedIn : false,
init() {
this.set('isLoggedIn', !!this.get('application.user.login'));
if (this.get('application.places.length') > 0) {
this.set('isFollowing', !!this.get('application.places').findBy('id', this.get('item.id')));
}
}
});
| b37t1td/barapp-freecodecamp | client/app/components/user-following.js | JavaScript | mit | 389 |
class CB::Util::ServiceRescuer
def initialize instance
@instance = instance
end
def method_missing method, *args, &block
if @instance.respond_to? method
begin
@instance.public_send method, *args, &block
rescue => e
error_type = e.is_a?(ActiveRecord::RecordNotFound) ? :not_found : :exception
[false, {error: error_type, message: e.message}]
end
else
super
end
end
end | contentbird/contentbird | app/services/cb/util/service_rescuer.rb | Ruby | mit | 439 |
package com.nicolas.coding.common.photopick;
import android.content.Context;
import android.database.Cursor;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CursorAdapter;
import android.widget.ImageView;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nicolas.coding.MyApp;
import com.nicolas.coding.R;
import com.nicolas.coding.common.photopick.PhotoPickActivity.GridViewCheckTag;
/**
* Created by chenchao on 15/5/6.
*/
class GridPhotoAdapter extends CursorAdapter {
final int itemWidth;
LayoutInflater mInflater;
PhotoPickActivity mActivity;
//
// enum Mode { All, Folder }
// private Mode mMode = Mode.All;
//
// void setmMode(Mode mMode) {
// this.mMode = mMode;
// }
View.OnClickListener mClickItem = new View.OnClickListener() {
@Override
public void onClick(View v) {
mActivity.clickPhotoItem(v);
}
};
GridPhotoAdapter(Context context, Cursor c, boolean autoRequery, PhotoPickActivity activity) {
super(context, c, autoRequery);
mInflater = LayoutInflater.from(context);
mActivity = activity;
int spacePix = context.getResources().getDimensionPixelSize(R.dimen.pickimage_gridlist_item_space);
itemWidth = (MyApp.sWidthPix - spacePix * 4) / 3;
}
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View convertView = mInflater.inflate(R.layout.photopick_gridlist_item, parent, false);
ViewGroup.LayoutParams layoutParams = convertView.getLayoutParams();
layoutParams.height = itemWidth;
layoutParams.width = itemWidth;
convertView.setLayoutParams(layoutParams);
GridViewHolder holder = new GridViewHolder();
holder.icon = (ImageView) convertView.findViewById(R.id.icon);
holder.iconFore = (ImageView) convertView.findViewById(R.id.iconFore);
holder.check = (CheckBox) convertView.findViewById(R.id.check);
GridViewCheckTag checkTag = new GridViewCheckTag(holder.iconFore);
holder.check.setTag(checkTag);
holder.check.setOnClickListener(mClickItem);
convertView.setTag(holder);
ViewGroup.LayoutParams iconParam = holder.icon.getLayoutParams();
iconParam.width = itemWidth;
iconParam.height = itemWidth;
holder.icon.setLayoutParams(iconParam);
return convertView;
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
GridViewHolder holder;
holder = (GridViewHolder) view.getTag();
ImageLoader imageLoader = ImageLoader.getInstance();
String path = ImageInfo.pathAddPreFix(cursor.getString(1));
imageLoader.displayImage(path, holder.icon, PhotoPickActivity.optionsImage);
((GridViewCheckTag) holder.check.getTag()).path = path;
boolean picked = mActivity.isPicked(path);
holder.check.setChecked(picked);
holder.iconFore.setVisibility(picked ? View.VISIBLE : View.INVISIBLE);
}
static class GridViewHolder {
ImageView icon;
ImageView iconFore;
CheckBox check;
}
}
| liwangadd/Coding | app/src/main/java/com/nicolas/coding/common/photopick/GridPhotoAdapter.java | Java | mit | 3,262 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Idea.color'
db.add_column(u'brainstorming_idea', 'color',
self.gf('django.db.models.fields.CharField')(default='', max_length=100, blank=True),
keep_default=False)
def backwards(self, orm):
# Deleting field 'Idea.color'
db.delete_column(u'brainstorming_idea', 'color')
models = {
u'brainstorming.brainstorming': {
'Meta': {'ordering': "['-created']", 'object_name': 'Brainstorming'},
'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
'creator_email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
'creator_ip': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'details': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
'question': ('django.db.models.fields.CharField', [], {'max_length': '200'})
},
u'brainstorming.brainstormingwatcher': {
'Meta': {'ordering': "['-created']", 'unique_together': "(('brainstorming', 'email'),)", 'object_name': 'BrainstormingWatcher'},
'brainstorming': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['brainstorming.Brainstorming']"}),
'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'})
},
u'brainstorming.emailverification': {
'Meta': {'ordering': "['-created']", 'object_name': 'EmailVerification'},
'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
'id': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'})
},
u'brainstorming.idea': {
'Meta': {'ordering': "['-created']", 'object_name': 'Idea'},
'brainstorming': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['brainstorming.Brainstorming']"}),
'color': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
'creator_ip': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'creator_name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
'ratings': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'text': ('django.db.models.fields.TextField', [], {}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'})
}
}
complete_apps = ['brainstorming'] | atizo/braindump | brainstorming/migrations/0005_auto__add_field_idea_color.py | Python | mit | 4,031 |
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int ratio = 3; //per canny's suggestion
int canny_thresh = 12; //starts at 12, this is what we will be changing though
int hough_thresh = 27;
int angle_tracker = 20;
int max_thresh = 255;//max for both thresh variable
double angle_thresh = .14;
int frame_num = 0; //keeps track of the current frame
int max_frame = 0; //total frames in the video. this may fail for cameras?
int kernel_size = 5; //kernel for the guassian blur
int kernel_max = 256;
int num_bins = 30; // needs to divide image width cleanly (not really though)
int max_bins = 100;
VideoCapture cap;
//all the thresh variables are already assigned without us needing to do anything here, so the only thing we need to do is set the frame_num if it was changed
//the trackbars only do ints, so we need to calculate a ratio for the angle threshold
void threshCallback(int, void* )
{
angle_thresh = ((float) angle_tracker/ (float) max_thresh)*3.1415;
cap.set(CV_CAP_PROP_POS_FRAMES, frame_num);
}
void blurCallback(int, void* )
{
//the kernel for a guassian filter needs to be odd
kernel_size = (round(kernel_size / 2.0) * 2) -1; //round down to nearest odd integer
//make sure we don't have a negative number (error from round) or zero
if (kernel_size < 1){
kernel_size = 1;
}
//let the user know what the actual kernel being used is (kernel of one == no blur)
setTrackbarPos("Kernel size","parameters", kernel_size);
}
int main(int argc, char* argv[]){
//check for the input parameter correctness
if(argc != 2){
cerr <<"Incorrect input list, usage: rosrun vision gate_tuner <path_to_video_or_camera>" << endl;
exit(1);
}
//create and open the capture object
cap.open(argv[1]);
max_frame = cap.get(CV_CAP_PROP_FRAME_COUNT );
cout << max_frame << endl;
if(!cap.isOpened()){
//error in opening the video input
cerr << "Unable to open video file: " << argv[1] << endl;
exit(1);
}
//make some windows, place them at 20 pixels out because my window manager can't grab them in the corner..
namedWindow("current frame");
moveWindow("current frame", 20, 20);
namedWindow("after blur");
moveWindow("after blur", 220, 20);
namedWindow("parameters");
moveWindow("parameters", 420, 20);
createTrackbar( "Canny thresh", "parameters", &canny_thresh, max_thresh, threshCallback );
createTrackbar( "Hough thresh", "parameters", &hough_thresh, max_thresh, threshCallback );
createTrackbar( "Angle thresh", "parameters", &angle_tracker, max_thresh, threshCallback );
createTrackbar( "Num bins", "parameters", &num_bins, max_bins, threshCallback );
createTrackbar( "Kernel size", "parameters", &kernel_size, kernel_max, blurCallback);
createTrackbar( "Frame", "parameters", &frame_num, max_frame, threshCallback);
threshCallback( 0, 0 );
Mat cframe;
while(true){
cap >> cframe;
setTrackbarPos("Frame","parameters", cap.get(CV_CAP_PROP_POS_FRAMES));
//redundant matrices so that we can display intermediate steps at the end
Mat dst, cdst, gdst;
GaussianBlur(cframe, gdst, Size( kernel_size, kernel_size ), 0, 0 );
Canny(gdst, dst, canny_thresh, canny_thresh*ratio, 3);
cvtColor(dst, cdst, CV_GRAY2BGR);
vector<Vec4i> lines;
vector<Vec2f> also_lines;
HoughLinesP(dst, lines, 1, CV_PI/180, hough_thresh, 50, 10 );
HoughLines(dst, also_lines, 1, CV_PI/180, hough_thresh, 50, 10 );
vector<int> xbin_count; //TODO better name
for(int i = 0; i < num_bins; i++){
xbin_count.push_back(0);
}
// int bin_size = cap.get( CAP_PROP_FRAME_WIDTH )/num_bins; typo maybe?
int bin_size = cap.get( CV_CAP_PROP_FRAME_WIDTH )/num_bins;
cout << "bin size = " << bin_size << endl;
for( size_t i = 0; i < also_lines.size();i++) {
float rho = also_lines[i][0], theta = also_lines[i][1];
if (theta > 3.14 - angle_thresh && theta < 3.14 + angle_thresh){
//printf("line[%lu] = %f, %f \n", i, also_lines[i][0], also_lines[i][1]);
Point pt1, pt2;
double a = cos(theta), b = sin(theta);
double x0 = a*rho, y0 = b*rho;
cout << "x0 = " << x0 << " num bins = " << num_bins << " bin = " << (int) (x0/bin_size)+1 << endl;
int bin = (int) x0/bin_size;
if(bin > 0){
xbin_count[(int) ((x0/bin_size))]++;
pt1.x = cvRound(x0 + 1000*(-b));
pt1.y = cvRound(y0 + 1000*(a));
pt2.x = cvRound(x0 - 1000*(-b));
pt2.y = cvRound(y0 - 1000*(a));
line( cdst, pt1, pt2, Scalar(0,0,255), 3, CV_AA);
}
else {
pt1.x = cvRound(x0 + 1000*(-b));
pt1.y = cvRound(y0 + 1000*(a));
pt2.x = cvRound(x0 - 1000*(-b));
pt2.y = cvRound(y0 - 1000*(a));
line( cdst, pt1, pt2, Scalar(0,255,0), 3, CV_AA);
}
}
}
for(int i = 0; i < xbin_count.size(); i++){
cout << "bin" << i << "=" << " " << xbin_count[i] << endl;
}
//ok now xbin_count is populated, let's find which bin has the most lines
int max = 0;
int max_i = 0;
for( int i = 0; i < xbin_count.size(); i++){
if (xbin_count[i] > max ){
max = xbin_count[i];
max_i = i;
}
}
int max2 = 0;
int max2_i = 0;
//the two is arbitrary and there are probably better ways to go about this
for( int i = 0; i < xbin_count.size(); i++){
if (xbin_count[i] > max2 && ( i > (max_i + 2) || i < (max_i - 2 ))){
max2 = xbin_count[i];
max2_i = i;
}
}
cout << "max1 - " << max_i << endl;
cout << "max2 - " << max2_i << endl;
//great lets find the average of our two location
int average = ((bin_size*max_i + bin_size/2) + (bin_size*max2_i + bin_size/2))/2;
Point pt1, pt2;
pt1.x = (average);
pt1.y = (1000);
pt2.x = (average);
pt2.y = (-1000);
line( cdst, pt1, pt2, Scalar(255,0,0), 3, CV_AA);
// for( size_t i = 0; i < lines.size(); i++ )
// {
// Vec4i l = lines[i];
// printf("(%i, %i) (%i, %i) \n", l[0], l[1], l[2], l[3]);
// double theta = atan2((l[0] - l[2]), (l[1] - l[3]));
// cout << "theta" << theta << endl;
// // range is +- pi
// if ( (abs(theta) < angle_thresh && abs(theta) > -angle_thresh) || (abs(theta) < (3.14 + angle_thresh) && abs(theta)) > 3.14 - angle_thresh){
// line( cdst, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(0,0,255), 3, CV_AA);
// }
// }
//imshow("source", cframe);
imshow("current frame" ,cframe);
imshow("after blur", gdst);
imshow("parameters", cdst);
waitKey();
}
}
| robotics-at-maryland/qubo | src/vision/src/tuners/gate_tuner.cpp | C++ | mit | 6,479 |
const ircFramework = require('irc-framework')
const store = require('../store')
const attachEvents = require('./attachEvents')
const connect = connection => {
const state = store.getState()
let ircClient = state.ircClients[connection.id]
if (!ircClient) {
ircClient = new ircFramework.Client({
nick: connection.nick,
host: connection.host,
port: connection.port,
tls: connection.tls,
username: connection.username || connection.nick,
password: connection.password,
// "Not enough parameters" with empty gecos so a space is used.
gecos: connection.gecos || ' ',
// Custom auto reconnect mechanism is implemented, see events/connection.js.
auto_reconnect: false,
})
attachEvents(ircClient, connection.id)
store.dispatch({
type: 'SET_IRC_CLIENT',
payload: {
connectionId: connection.id,
ircClient,
},
})
}
ircClient.connect()
}
module.exports = connect
| daGrevis/msks | backend/src/irc/connect.js | JavaScript | mit | 982 |
const assert = require('assert')
const { unparse } = require('uuid-parse')
const supertest = require('supertest')
const createApp = require('../app')
const { createSetup, getAuthPassword } = require('./lib')
const { createPlayer, createKick } = require('./fixtures')
describe('Query player kick', () => {
let setup
let request
beforeAll(async () => {
setup = await createSetup()
const app = await createApp({ ...setup, disableUI: true })
request = supertest(app.callback())
}, 20000)
afterAll(async () => {
await setup.teardown()
}, 20000)
test('should resolve all fields', async () => {
const { config: server, pool } = setup.serversPool.values().next().value
const cookie = await getAuthPassword(request, 'admin@banmanagement.com')
const player = createPlayer()
const actor = createPlayer()
const kick = createKick(player, actor)
await pool('bm_players').insert([player, actor])
await pool('bm_player_kicks').insert(kick)
const { body, statusCode } = await request
.post('/graphql')
.set('Cookie', cookie)
.set('Accept', 'application/json')
.send({
query: `query playerKick {
playerKick(id:"1", serverId: "${server.id}") {
id
reason
created
actor {
id
name
}
acl {
update
delete
yours
}
}
}`
})
assert.strictEqual(statusCode, 200)
assert(body)
assert(body.data)
assert.deepStrictEqual(body.data.playerKick,
{
id: '1',
reason: kick.reason,
created: kick.created,
actor: { id: unparse(actor.id), name: actor.name },
acl: { delete: true, update: true, yours: false }
})
})
})
| BanManagement/BanManager-WebUI | server/test/playerKick.query.test.js | JavaScript | mit | 1,807 |
<?php
namespace Application\Success\CoreBundle\Twig;
//use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
class EventoExtension extends \Twig_Extension {
//private $container;
private $repository_evento;
private $templating;
public function __construct($repository_evento, $templating) {
//$this->container = $container;
$this->templating = $templating;
$this->repository_evento = $repository_evento;
}
public function getName() {
return 'core_utils';
}
public function getFunctions() {
return array(
'eventos_pasados' => new \Twig_Function_Method($this, 'eventosPasados', array('is_safe' => array('html'))),
'eventos_pasados_key' => new \Twig_Function_Method($this, 'eventosPasadosKey', array('is_safe' => array('html')))
);
}
public function eventosPasados($limit){
$eventos = $this->repository_evento->findPasadas($limit);
return $this->templating->render('WebBundle:Frontend/Evento:eventos_pasados.html.twig', array('eventos' => $eventos));
}
public function eventosPasadosKey($productora, $evento_id, $limit){
$eventos = $this->repository_evento->findByProductora($productora->getId(), $evento_id, $limit);
return $this->templating->render('WebBundle:Frontend/Evento:eventos_pasados_key.html.twig', array('eventos' => $eventos, 'productora' => $productora));
}
}
| chugas/symfony-without-vendors-2.1.9 | src/Application/Success/CoreBundle/Twig/EventoExtension.php | PHP | mit | 1,397 |
<?php
namespace EntityManager5230d19111d8e_546a8d27f194334ee012bfe64f629947b07e4919\__CG__\Doctrine\ORM;
/**
* CG library enhanced proxy class.
*
* This code was generated automatically by the CG library, manual changes to it
* will be lost upon next generation.
*/
class EntityManager extends \Doctrine\ORM\EntityManager
{
private $delegate;
private $container;
/**
* Executes a function in a transaction.
*
* The function gets passed this EntityManager instance as an (optional) parameter.
*
* {@link flush} is invoked prior to transaction commit.
*
* If an exception occurs during execution of the function or flushing or transaction commit,
* the transaction is rolled back, the EntityManager closed and the exception re-thrown.
*
* @param callable $func The function to execute transactionally.
* @return mixed Returns the non-empty value returned from the closure or true instead
*/
public function transactional($func)
{
return $this->delegate->transactional($func);
}
/**
* Performs a rollback on the underlying database connection.
*/
public function rollback()
{
return $this->delegate->rollback();
}
/**
* Removes an entity instance.
*
* A removed entity will be removed from the database at or before transaction commit
* or as a result of the flush operation.
*
* @param object $entity The entity instance to remove.
*/
public function remove($entity)
{
return $this->delegate->remove($entity);
}
/**
* Refreshes the persistent state of an entity from the database,
* overriding any local changes that have not yet been persisted.
*
* @param object $entity The entity to refresh.
*/
public function refresh($entity)
{
return $this->delegate->refresh($entity);
}
/**
* Tells the EntityManager to make an instance managed and persistent.
*
* The entity will be entered into the database at or before transaction
* commit or as a result of the flush operation.
*
* NOTE: The persist operation always considers entities that are not yet known to
* this EntityManager as NEW. Do not pass detached entities to the persist operation.
*
* @param object $object The instance to make managed and persistent.
*/
public function persist($entity)
{
return $this->delegate->persist($entity);
}
/**
* Create a new instance for the given hydration mode.
*
* @param int $hydrationMode
* @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator
*/
public function newHydrator($hydrationMode)
{
return $this->delegate->newHydrator($hydrationMode);
}
/**
* Merges the state of a detached entity into the persistence context
* of this EntityManager and returns the managed copy of the entity.
* The entity passed to merge will not become associated/managed with this EntityManager.
*
* @param object $entity The detached entity to merge into the persistence context.
* @return object The managed copy of the entity.
*/
public function merge($entity)
{
return $this->delegate->merge($entity);
}
/**
* Acquire a lock on the given entity.
*
* @param object $entity
* @param int $lockMode
* @param int $lockVersion
* @throws OptimisticLockException
* @throws PessimisticLockException
*/
public function lock($entity, $lockMode, $lockVersion = NULL)
{
return $this->delegate->lock($entity, $lockMode, $lockVersion);
}
/**
* Check if the Entity manager is open or closed.
*
* @return bool
*/
public function isOpen()
{
return $this->delegate->isOpen();
}
/**
* Checks whether the state of the filter collection is clean.
*
* @return boolean True, if the filter collection is clean.
*/
public function isFiltersStateClean()
{
return $this->delegate->isFiltersStateClean();
}
/**
* Helper method to initialize a lazy loading proxy or persistent collection.
*
* This method is a no-op for other objects
*
* @param object $obj
*/
public function initializeObject($obj)
{
return $this->delegate->initializeObject($obj);
}
/**
* Checks whether the Entity Manager has filters.
*
* @return True, if the EM has a filter collection.
*/
public function hasFilters()
{
return $this->delegate->hasFilters();
}
/**
* Gets the UnitOfWork used by the EntityManager to coordinate operations.
*
* @return \Doctrine\ORM\UnitOfWork
*/
public function getUnitOfWork()
{
return $this->delegate->getUnitOfWork();
}
/**
* Gets the repository for an entity class.
*
* @param string $entityName The name of the entity.
* @return EntityRepository The repository class.
*/
public function getRepository($className)
{
$repository = $this->delegate->getRepository($className);
if ($repository instanceof \Symfony\Component\DependencyInjection\ContainerAwareInterface) {
$repository->setContainer($this->container);
return $repository;
}
if (null !== $metadata = $this->container->get("jms_di_extra.metadata.metadata_factory")->getMetadataForClass(get_class($repository))) {
foreach ($metadata->classMetadata as $classMetadata) {
foreach ($classMetadata->methodCalls as $call) {
list($method, $arguments) = $call;
call_user_func_array(array($repository, $method), $this->prepareArguments($arguments));
}
}
}
return $repository;
}
/**
* Gets a reference to the entity identified by the given type and identifier
* without actually loading it, if the entity is not yet loaded.
*
* @param string $entityName The name of the entity type.
* @param mixed $id The entity identifier.
* @return object The entity reference.
*/
public function getReference($entityName, $id)
{
return $this->delegate->getReference($entityName, $id);
}
/**
* Gets the proxy factory used by the EntityManager to create entity proxies.
*
* @return ProxyFactory
*/
public function getProxyFactory()
{
return $this->delegate->getProxyFactory();
}
/**
* Gets a partial reference to the entity identified by the given type and identifier
* without actually loading it, if the entity is not yet loaded.
*
* The returned reference may be a partial object if the entity is not yet loaded/managed.
* If it is a partial object it will not initialize the rest of the entity state on access.
* Thus you can only ever safely access the identifier of an entity obtained through
* this method.
*
* The use-cases for partial references involve maintaining bidirectional associations
* without loading one side of the association or to update an entity without loading it.
* Note, however, that in the latter case the original (persistent) entity data will
* never be visible to the application (especially not event listeners) as it will
* never be loaded in the first place.
*
* @param string $entityName The name of the entity type.
* @param mixed $identifier The entity identifier.
* @return object The (partial) entity reference.
*/
public function getPartialReference($entityName, $identifier)
{
return $this->delegate->getPartialReference($entityName, $identifier);
}
/**
* Gets the metadata factory used to gather the metadata of classes.
*
* @return \Doctrine\ORM\Mapping\ClassMetadataFactory
*/
public function getMetadataFactory()
{
return $this->delegate->getMetadataFactory();
}
/**
* Gets a hydrator for the given hydration mode.
*
* This method caches the hydrator instances which is used for all queries that don't
* selectively iterate over the result.
*
* @param int $hydrationMode
* @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator
*/
public function getHydrator($hydrationMode)
{
return $this->delegate->getHydrator($hydrationMode);
}
/**
* Gets the enabled filters.
*
* @return FilterCollection The active filter collection.
*/
public function getFilters()
{
return $this->delegate->getFilters();
}
/**
* Gets an ExpressionBuilder used for object-oriented construction of query expressions.
*
* Example:
*
* <code>
* $qb = $em->createQueryBuilder();
* $expr = $em->getExpressionBuilder();
* $qb->select('u')->from('User', 'u')
* ->where($expr->orX($expr->eq('u.id', 1), $expr->eq('u.id', 2)));
* </code>
*
* @return \Doctrine\ORM\Query\Expr
*/
public function getExpressionBuilder()
{
return $this->delegate->getExpressionBuilder();
}
/**
* Gets the EventManager used by the EntityManager.
*
* @return \Doctrine\Common\EventManager
*/
public function getEventManager()
{
return $this->delegate->getEventManager();
}
/**
* Gets the database connection object used by the EntityManager.
*
* @return \Doctrine\DBAL\Connection
*/
public function getConnection()
{
return $this->delegate->getConnection();
}
/**
* Gets the Configuration used by the EntityManager.
*
* @return \Doctrine\ORM\Configuration
*/
public function getConfiguration()
{
return $this->delegate->getConfiguration();
}
/**
* Returns the ORM metadata descriptor for a class.
*
* The class name must be the fully-qualified class name without a leading backslash
* (as it is returned by get_class($obj)) or an aliased class name.
*
* Examples:
* MyProject\Domain\User
* sales:PriceRequest
*
* @return \Doctrine\ORM\Mapping\ClassMetadata
* @internal Performance-sensitive method.
*/
public function getClassMetadata($className)
{
return $this->delegate->getClassMetadata($className);
}
/**
* Flushes all changes to objects that have been queued up to now to the database.
* This effectively synchronizes the in-memory state of managed objects with the
* database.
*
* If an entity is explicitly passed to this method only this entity and
* the cascade-persist semantics + scheduled inserts/removals are synchronized.
*
* @param object $entity
* @throws \Doctrine\ORM\OptimisticLockException If a version check on an entity that
* makes use of optimistic locking fails.
*/
public function flush($entity = NULL)
{
return $this->delegate->flush($entity);
}
/**
* Finds an Entity by its identifier.
*
* @param string $entityName
* @param mixed $id
* @param integer $lockMode
* @param integer $lockVersion
*
* @return object
*/
public function find($entityName, $id, $lockMode = 0, $lockVersion = NULL)
{
return $this->delegate->find($entityName, $id, $lockMode, $lockVersion);
}
/**
* Detaches an entity from the EntityManager, causing a managed entity to
* become detached. Unflushed changes made to the entity if any
* (including removal of the entity), will not be synchronized to the database.
* Entities which previously referenced the detached entity will continue to
* reference it.
*
* @param object $entity The entity to detach.
*/
public function detach($entity)
{
return $this->delegate->detach($entity);
}
/**
* Create a QueryBuilder instance
*
* @return QueryBuilder $qb
*/
public function createQueryBuilder()
{
return $this->delegate->createQueryBuilder();
}
/**
* Creates a new Query object.
*
* @param string $dql The DQL string.
* @return \Doctrine\ORM\Query
*/
public function createQuery($dql = '')
{
return $this->delegate->createQuery($dql);
}
/**
* Creates a native SQL query.
*
* @param string $sql
* @param ResultSetMapping $rsm The ResultSetMapping to use.
* @return NativeQuery
*/
public function createNativeQuery($sql, \Doctrine\ORM\Query\ResultSetMapping $rsm)
{
return $this->delegate->createNativeQuery($sql, $rsm);
}
/**
* Creates a Query from a named query.
*
* @param string $name
* @return \Doctrine\ORM\Query
*/
public function createNamedQuery($name)
{
return $this->delegate->createNamedQuery($name);
}
/**
* Creates a NativeQuery from a named native query.
*
* @param string $name
* @return \Doctrine\ORM\NativeQuery
*/
public function createNamedNativeQuery($name)
{
return $this->delegate->createNamedNativeQuery($name);
}
/**
* Creates a copy of the given entity. Can create a shallow or a deep copy.
*
* @param object $entity The entity to copy.
* @return object The new entity.
* @todo Implementation need. This is necessary since $e2 = clone $e1; throws an E_FATAL when access anything on $e:
* Fatal error: Maximum function nesting level of '100' reached, aborting!
*/
public function copy($entity, $deep = false)
{
return $this->delegate->copy($entity, $deep);
}
/**
* Determines whether an entity instance is managed in this EntityManager.
*
* @param object $entity
* @return boolean TRUE if this EntityManager currently manages the given entity, FALSE otherwise.
*/
public function contains($entity)
{
return $this->delegate->contains($entity);
}
/**
* Commits a transaction on the underlying database connection.
*/
public function commit()
{
return $this->delegate->commit();
}
/**
* Closes the EntityManager. All entities that are currently managed
* by this EntityManager become detached. The EntityManager may no longer
* be used after it is closed.
*/
public function close()
{
return $this->delegate->close();
}
/**
* Clears the EntityManager. All entities that are currently managed
* by this EntityManager become detached.
*
* @param string $entityName if given, only entities of this type will get detached
*/
public function clear($entityName = NULL)
{
return $this->delegate->clear($entityName);
}
/**
* Starts a transaction on the underlying database connection.
*/
public function beginTransaction()
{
return $this->delegate->beginTransaction();
}
public function __construct($objectManager, \Symfony\Component\DependencyInjection\ContainerInterface $container)
{
$this->delegate = $objectManager;
$this->container = $container;
}
private function prepareArguments(array $arguments)
{
$processed = array();
foreach ($arguments as $arg) {
if ($arg instanceof \Symfony\Component\DependencyInjection\Reference) {
$processed[] = $this->container->get((string) $arg, $arg->getInvalidBehavior());
} else if ($arg instanceof \Symfony\Component\DependencyInjection\Parameter) {
$processed[] = $this->container->getParameter((string) $arg);
} else {
$processed[] = $arg;
}
}
return $processed;
}
} | vistorr/panel | app/cache/dev/jms_diextra/doctrine/EntityManager_5230d19111d8e.php | PHP | mit | 16,022 |
module Test
PI = 3.14
class Test2
def what_is_pi
puts PI
end
end
end
Test::Test2.new.what_is_pi # => 3.14
module MyModule
MyConstant = 'Outer Constant'
class MyClass
puts MyConstant # => Outer Constant
MyConstant = 'Inner Constant'
puts MyConstant # => Inner Constant
end
puts MyConstant # => Outer Constant
end
| rbaladron/rails-coursera | intro_rails/modulo2/Ejemplos/Lecture13-Scope/constants_scope.rb | Ruby | mit | 371 |
<?php
class SV_WarningImprovements_XenForo_ControllerPublic_Member extends XFCP_SV_WarningImprovements_XenForo_ControllerPublic_Member
{
public function actionMember()
{
SV_WarningImprovements_Globals::$warning_user_id = $this->_input->filterSingle('user_id', XenForo_Input::UINT);
$response = parent::actionMember();
if ($response instanceof XenForo_ControllerResponse_View)
{
$warningActionModel = $this->_getWarningActionModel();
$user = $response->params['user'];
if ($warningActionModel->canViewUserWarningActions($user))
{
$showAll = $warningActionModel->canViewNonSummaryUserWarningActions($user);
$showDiscouraged = $warningActionModel->canViewDiscouragedWarningActions($user);
$response->params['warningActionsCount'] = $warningActionModel->countWarningActionsByUser($user['user_id'], $showAll, $showDiscouraged);
$response->params['canViewWarningActions'] = true;
}
}
return $response;
}
public function actionWarningActions()
{
$userId = $this->_input->filterSingle('user_id', XenForo_Input::UINT);
/** @var XenForo_ControllerHelper_UserProfile $userProfileHelper */
$userProfileHelper = $this->getHelper('UserProfile');
$user = $userProfileHelper->assertUserProfileValidAndViewable($userId);
$warningActionModel = $this->_getWarningActionModel();
if (!$warningActionModel->canViewUserWarningActions($user))
{
return $this->responseNoPermission();
}
$showAll = $warningActionModel->canViewNonSummaryUserWarningActions($user);
$showDiscouraged = $warningActionModel->canViewDiscouragedWarningActions($user);
$warningActions = $warningActionModel->getWarningActionsByUser($user['user_id'], $showAll, $showDiscouraged);
if (!$warningActions)
{
return $this->responseMessage(new XenForo_Phrase('sv_this_user_has_no_warning_actions'));
}
$warningActions = $warningActionModel->prepareWarningActions($warningActions);
$viewParams = array
(
'user' => $user,
'warningActions' => $warningActions
);
return $this->responseView('SV_WarningImprovements_ViewPublic_Member_WarningActions', 'sv_member_warning_actions', $viewParams);
}
public function actionWarn()
{
SV_WarningImprovements_Globals::$warning_user_id = $this->_input->filterSingle('user_id', XenForo_Input::UINT);
SV_WarningImprovements_Globals::$SendWarningAlert = $this->_input->filterSingle('send_warning_alert', XenForo_Input::BOOLEAN);
SV_WarningImprovements_Globals::$warningInput = $this->_input->filter([
'title' => XenForo_Input::STRING,
]);
SV_WarningImprovements_Globals::$scaleWarningExpiry = true;
SV_WarningImprovements_Globals::$NotifyOnWarningAction = true;
$response = parent::actionWarn();
if (!$response instanceof XenForo_ControllerResponse_View)
{
if ($response instanceof XenForo_ControllerResponse_Redirect)
{
if ($response->redirectMessage === null)
{
$response->redirectMessage = new XenForo_Phrase('sv_issued_warning');
}
return $response;
}
if ($response instanceof XenForo_ControllerResponse_Reroute &&
$response->controllerName === 'XenForo_ControllerPublic_Error' &&
$response->action === 'noPermission')
{
$userId = $this->_input->filterSingle('user_id', XenForo_Input::UINT);
/** @var XenForo_ControllerHelper_UserProfile $userHelper */
$userHelper = $this->getHelper('UserProfile');
$user = $userHelper->getUserOrError($userId);
// this happens if the warning already exists
$contentInput = $this->_input->filter(
[
'content_type' => XenForo_Input::STRING,
'content_id' => XenForo_Input::UINT
]
);
if (!$contentInput['content_type'])
{
$contentInput['content_type'] = 'user';
$contentInput['content_id'] = $userId;
}
/* @var $warningModel XenForo_Model_Warning */
$warningModel = $this->getModelFromCache('XenForo_Model_Warning');
$warningHandler = $warningModel->getWarningHandler($contentInput['content_type']);
if (!$warningHandler)
{
return $response;
}
/** @var array|bool $content */
$content = $warningHandler->getContent($contentInput['content_id']);
if ($content && $warningHandler->canView($content) && !empty($content['warning_id']))
{
$url = $warningHandler->getContentUrl($content);
if ($url)
{
return $this->responseRedirect(
XenForo_ControllerResponse_Redirect::RESOURCE_UPDATED,
$url,
new XenForo_Phrase('sv_content_already_warned')
);
}
}
}
return $response;
}
$viewParams = &$response->params;
/** @var SV_WarningImprovements_XenForo_Model_Warning $warningModel */
$warningModel = $this->getModelFromCache('XenForo_Model_Warning');
$warningItems = $warningModel->getWarningItems(true);
if (empty($warningItems))
{
return $this->responseError(new XenForo_Phrase('sv_no_permission_to_give_warnings'), 403);
}
$warningCategories = $warningModel->groupWarningItemsByWarningCategory(
$warningItems
);
$rootWarningCategories = $warningModel
->groupWarningItemsByRootWarningCategory($warningItems);
$viewParams['warningCategories'] = $warningCategories;
$viewParams['rootWarningCategories'] = $rootWarningCategories;
return $response;
}
public function actionWarnings()
{
SV_WarningImprovements_Globals::$warning_user_id = $this->_input->filterSingle('user_id', XenForo_Input::UINT);
return parent::actionWarnings();
}
public function actionCard()
{
SV_WarningImprovements_Globals::$warning_user_id = $this->_input->filterSingle('user_id', XenForo_Input::UINT);
return parent::actionCard();
}
/**
* @return XenForo_Model|XenForo_Model_UserChangeTemp|SV_WarningImprovements_XenForo_Model_UserChangeTemp
*/
protected function _getWarningActionModel()
{
return $this->getModelFromCache('XenForo_Model_UserChangeTemp');
}
}
| Xon/XenForo-WarningImprovements | upload/library/SV/WarningImprovements/XenForo/ControllerPublic/Member.php | PHP | mit | 7,086 |
# this is the interface for `python archiver`
import archiver
import appdirs
import os
import sys
import pickle
import json
from archiver.archiver import Archiver
from archiver.parser import parseArgs
args = parseArgs()
from edit import edit
# ==============================================
print args
# TODO: see http://stackoverflow.com/questions/13168083/python-raw-input-replacement-that-uses-a-configurable-text-editor
#-- import pdb
#-- pdb.set_trace()
# ------------------------------------------------------------
# load the user data
# ------------------------------------------------------------
# get the user data directory
user_data_dir = appdirs.user_data_dir('FileArchiver', 'jdthorpe')
if not os.path.exists(user_data_dir) :
os.makedirs(user_data_dir)
# LOAD THE INDEX NAMES AND ACTIVE INDEX
indexes_path = os.path.join(user_data_dir,'INDEXES.json')
if os.path.exists(indexes_path):
with open(indexes_path,'rb') as fh:
indexes = json.load(fh)
else:
indexes= {'active':None,'names':[]}
if not os.path.exists(user_data_dir):
os.makedirs(user_data_dir)
def dumpIndexes():
with open(indexes_path,'wb') as fh:
json.dump(indexes,fh)
# ------------------------------------------------------------
# ------------------------------------------------------------
def getActiveName():
# ACTIVE INDEX NUMER
activeIndex = indexes['active']
if activeIndex is None:
print "No active index. Use 'list -i' to list available indexies and 'use' to set an active index."
sys.exit()
# GET THE NAME OF THE INDEX
try:
activeIndexName = indexes['names'][indexes['active']]
except:
print "Invalid index number"
sys.exit()
return activeIndexName
# ------------------------------------------------------------
# READ-WRITE UTILITY FUNCTIONS
# ------------------------------------------------------------
# TODO: catch specific excepitons:
# except IOError:
# # no such file
# except ValueError as e:
# # invalid json file
def readSettings(name):
""" A utility function which loads the index settings from file
"""
try:
with open(os.path.join(user_data_dir,name+".settings"),'rb') as fh:
settings = json.load(fh)
except Exception as e:
print "Error reading index settings"
import pdb
pdb.set_trace()
sys.exit()
return settings
def readData(name):
""" A utility function which loads the index data from file
"""
try:
with open(os.path.join(user_data_dir,name+".data"),'rb') as fh: data = pickle.load(fh)
except Exception as e:
print "Error reading index data"
import pdb
pdb.set_trace()
sys.exit()
return data
def dumpSettings(settings,name):
""" A utility function which saves the index settings to file
"""
try:
with open(os.path.join(user_data_dir,name+".settings"),'wb') as fh:
json.dump(settings,fh)
except Exception as e:
print "Error writing index settings"
import pdb
pdb.set_trace()
sys.exit()
def dumpData(data,name):
""" A utility function which saves the index settings to file
"""
try:
with open(os.path.join(user_data_dir,name+".data"),'wb') as fh:
pickle.dump(data,fh)
except:
print "Error writing index data"
import pdb
pdb.set_trace()
sys.exit()
# ------------------------------------------------------------
# ------------------------------------------------------------
if args.command == 'add':
activeName = getActiveName()
settings = readSettings(activeName)
if args.source is not None:
source = os.path.abspath(args.source)
if not os.path.exists(source):
print 'WARNING: no such directory "%s"'%(source)
elif not os.path.isdir(source):
print 'ERROR: "%s" is not a directory'%(source)
sys.exit()
print 'Adding source directory: %s'%(source)
if not any(samefile(source,f) for f in settings['sourceDirectories']):
settings['sourceDirectories'].append(source)
elif args.exclusions is not None:
import re
try:
re.compile(args.exclusion)
except re.error:
print 'Invalid regular expression "%s"'%(args.exclusion)
sys.exit()
if args.noic:
settings['directoryExclusionPatterns'].append(args.exclusion)
else:
settings['directoryExclusionPatterns'].append((args.exclusion,2)) # re.I == 2
elif args.archive is not None:
raise NotImplementedError
if settings['archiveDirectory'] is not None:
print "Archive path has already been set use 'remove' to delete the archive path before setting a new archive path"
archiveDirectory = os.path.abspath(args.archive)
if not os.path.exists(archiveDirectory):
if args.create :
os.makedirs(archiveDirectory)
else:
print 'ERROR: no such directory "%s"'%(archiveDirectory)
sys.exit()
elif not os.path.isdir(archiveDirectory):
print '"%s" is not a directory'%(archiveDirectory)
sys.exit()
print 'Setting archive directory to: %s'%(archiveDirectory)
settings['archiveDirectory'] = args.archive
else:
raise NotImplementedError
print 'Error in Arg Parser'
sys.exit()
dumpSettings(settings,activeName)
elif args.command == 'list':
if args.sources:
for f in readSettings(getActiveName())['sourceDirectories']:
print f
elif args.exclusions:
for f in readSettings(getActiveName())['directoryExclusionPatterns']:
print f
elif args.archive:
print readSettings(getActiveName())['archiveDirectory']
elif args.files:
archiver = Archiver()
archiver.data = readData(getActiveName())
for f in archiver:
print f
elif args.indexes:
print 'Active Index: %s (*)'%(getActiveName())
print 'Index Names: '
for i,name in enumerate(indexes['names']):
print ' %s %i: %s'%(
(' ','*')[(i == indexes['active'])+0],
i+1,
name,
)
else:
print 'Error in Arg Parser'
elif args.command == 'remove':
activeName = getActiveName()
settings = readSettings(activeName)
if args.source is not None:
if not (1 <= args.source <= len(settings['sourceDirectories'])):
print 'Invalid index %i'%(args.source)
del settings['sourceDirectories'][args.source - 1]
elif args.exclusion is not None:
raise NotImplementedError
if not (1 <= args.exclusion <= len(settings['directoryExclusionPatterns'])):
print 'Invalid index %i'%(args.exclusion)
del settings['directoryExclusionPatterns'][args.exclusion - 1]
elif args.archive is not None:
raise NotImplementedError
settings['archiveDirectory'] = None
else:
raise NotImplementedError
print 'Error in Arg Parser'
sys.exit()
dumpSettings(settings,activeName)
elif args.command == 'update':
activeName = getActiveName()
settings = readSettings(activeName)
if not len(settings['sourceDirectories']):
print "Error: no source directories in the active index. Please add a source directory via 'add -s'"
archiver = Archiver(
settings = readSettings(activeName),
data = readData(activeName))
archiver.update()
dumpSettings(archiver.settings,activeName)
dumpData(archiver.data,activeName)
elif args.command == 'clean':
raise NotImplementedError
activeName = getActiveName()
archiver = Archiver(
settings = readSettings(activeName),
data = readData(activeName))
archiver.clean()
dumpSettings(archiver.settings,activeName)
dumpData(archiver.data,activeName)
elif args.command == 'copy':
raise NotImplementedError
activeName = getActiveName()
settings = readSettings(activeName),
if settings['archiveDirectory'] is None:
print "ERROR Archive directory not set. Use 'add -a' to set the archive directory."
sys.exit()
Index(
settings = settings,
data = readData(activeName)).copy()
elif args.command == 'diskimages':
raise NotImplementedError
if args.size is None or args.size == "DVD":
size = 4.65*1<<20
elif args.size == "CD":
size = 645*1<<20
elif args.size == "DVD":
size = 4.65*1<<20
elif args.size == "DVD-dual":
size = 8.5*1<<30
elif args.size == "BD":
size = 25*1<<30
elif args.size == "BD-dual":
size = 50*1<<30
elif args.size == "BD-tripple":
size = 75*1<<30
elif args.size == "BD-xl":
size = 100*1<<30
else:
try:
size = int(float(args.size))
except:
print 'ERROR: unable to coerce "%s" to float or int'%(args.size)
sys.exit()
activeName = getActiveName()
settings = readSettings(activeName),
# GET THE DIRECTORY ARGUMENT
if args.directory is not None:
directory = args.directory
else:
if settings['archiveDirectory'] is None:
print "ERROR Archive directory not set and no directory specified. Use 'diskimages -d' to specifiy the disk image directory or 'add -a' to set the archive directory."
sys.exit()
else:
directory = os.path.join(settings['archiveDirectory'],'Disk Images')
# VALIDATE THE DIRECTORY
if not os.path.exists(directory):
if args.create :
os.makedirs(directory)
else:
print 'ERROR: no such directory "%s"'%(directory)
sys.exit()
elif not os.path.isdir(directory):
print '"%s" is not a directory'%(directory)
sys.exit()
# get the FPBF argument
if args.fpbf is not None:
FPBF = True
elif args.nofpbf is not None:
FPBF = False
else:
FPBF = sys.platform == 'darwin'
Index( settings = settings,
data = readData(activeName)).diskimages(directory,size,FPBF)
elif args.command == 'settings':
activeName = getActiveName()
if args.export is not None:
raise NotImplementedError
with open(args.export,'rb') as fh:
json.dump(readSettings(activeName),fh,indent=2,separators=(',', ': '))
elif args.load is not None:
raise NotImplementedError
with open(args.export,'wb') as fh:
settings = json.load(fh)
# give a chance for the settings to be validated
try:
archiver = Archiver(settings=settings)
except:
print "ERROR: invalid settings file"
dumpSettings(archiver.settings,args.name)
elif args.edit is not None:
settings = readSettings(activeName)
old = settings['identifierSettings'][args.edit]
new = edit(json.dumps(old,indent=2,separators=(',', ': ')))
settings['identifierSettings'][args.edit]= json.loads(new)
dumpSettings(settings,activeName)
else :
print json.dumps(readSettings(activeName),indent=2,separators=(',', ': '))
elif args.command == 'create':
if args.name in indexes['names']:
print "An index by the name '%s' already exists"%(args.name)
sys.exit()
import re
validater = re.compile(r'^[-() _a-zA-Z0-9](?:[-() _.a-zA-Z0-9]+[-() _a-zA-Z0-9])$')
if validater.match(args.name) is None:
print "ERROR: names must be composed of letters, numbers, hypen, underscore, space and dot charactes an not end or begin with a dot"
sys.exit()
archiver = Index()
dumpSettings(archiver.settings,args.name)
dumpData(archiver.data,args.name)
indexes['names'].append(args.name)
dumpIndexes()
# TODO: check if there are no other indexies. if so, make the new one active.
print "Created index '%s'"%(args.name)
elif args.command == 'save':
raise NotImplementedError
Index( settings = readSettings(getActiveName()),
data = readData(getActiveName())).save(args.filename)
elif args.command == 'use':
print indexes['names']
if not args.name in indexes['names']:
print "ERROR: No such index named '%s'"%(args.name)
sys.exit()
indexes['active'] =indexes['names'].index(args.name)
dumpIndexes()
elif args.command == 'delete':
if not args.name in indexes['names']:
print "ERROR: No such index named '%s'"%(args.name)
sys.exit()
nameIindex = indexes['names'].index(args.name)
if indexes['active'] == nameIindex:
print 'WARNING: deleting active index'
indexes['active'] = None
del indexes['names'][nameIindex]
dumpIndexes()
else :
print "unknown command %s"%(args.command)
| jdthorpe/archiver | __main__.py | Python | mit | 13,106 |
/*
* The MIT License
*
* Copyright (c) 2016 Marcelo "Ataxexe" Guimarães <ataxexe@devnull.tools>
*
* 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.
*/
package tools.devnull.boteco.predicates;
import org.junit.Before;
import org.junit.Test;
import tools.devnull.boteco.message.IncomeMessage;
import tools.devnull.boteco.Predicates;
import tools.devnull.kodo.Spec;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static tools.devnull.boteco.TestHelper.accept;
import static tools.devnull.boteco.TestHelper.notAccept;
import static tools.devnull.kodo.Expectation.it;
import static tools.devnull.kodo.Expectation.to;
public class TargetPredicateTest {
private IncomeMessage messageFromTarget;
private IncomeMessage messageFromOtherTarget;
private IncomeMessage messageFromUnknownTarget;
@Before
public void initialize() {
messageFromTarget = mock(IncomeMessage.class);
when(messageFromTarget.target()).thenReturn("target");
messageFromOtherTarget = mock(IncomeMessage.class);
when(messageFromOtherTarget.target()).thenReturn("other-target");
messageFromUnknownTarget = mock(IncomeMessage.class);
when(messageFromUnknownTarget.target()).thenReturn("unknown-target");
}
@Test
public void test() {
Spec.given(Predicates.target("target"))
.expect(it(), to(accept(messageFromTarget)))
.expect(it(), to(notAccept(messageFromOtherTarget)))
.expect(it(), to(notAccept(messageFromUnknownTarget)));
}
}
| devnull-tools/boteco | main/boteco/src/test/java/tools/devnull/boteco/predicates/TargetPredicateTest.java | Java | mit | 2,605 |
using System;
using System.Collections.Generic;
using System.Text;
using Icy.Util;
namespace Icy.Database.Query
{
public class JoinClauseOptions{
public object first;
public string operator1;
public object second;
public string boolean;
public bool where;
public bool nested;
public JoinClause join;
}
// 4d8e4bb Dec 28, 2015
public class JoinClause
{
/**
* The type of join being performed.
*
* @var string
*/
public string _type;
/**
* The table the join clause is joining to.
*
* @var string
*/
public string _table;
/**
* The "on" clauses for the join.
*
* @var array
*/
public JoinClauseOptions[] _clauses = new JoinClauseOptions[0];
/**
* The "on" bindings for the join.
*
* @var array
*/
public object[] _bindings = new object[0];
/**
* Create a new join clause instance.
*
* @param string type
* @param string table
* @return void
*/
public JoinClause(string type, string table)
{
this._type = type;
this._table = table;
}
/**
* Add an "on" clause to the join.
*
* On clauses can be chained, e.g.
*
* join.on('contacts.user_id', '=', 'users.id')
* .on('contacts.info_id', '=', 'info.id')
*
* will produce the following SQL:
*
* on `contacts`.`user_id` = `users`.`id` and `contacts`.`info_id` = `info`.`id`
*
* @param string first
* @param string|null operator
* @param string|null second
* @param string boolean
* @param bool where
* @return this
*/
public JoinClause on(Action<JoinClause> first, string operator1 = null, object second = null, string boolean = "and", bool where = false)
{
return this.nest(first, boolean);
}
public JoinClause on(object first, string operator1 = null, object second = null, string boolean = "and", bool where = false)
{
if (where)
{
this._bindings = ArrayUtil.push(this._bindings, second);
}
if(where && (operator1 == "in" || operator1 == "not in") && (second is IList<object> || second is object[])){
second = ((IList<object>)second).Count;
}
JoinClauseOptions options = new JoinClauseOptions();
options.first = first;
options.operator1 = operator1;
options.second = second;
options.boolean = boolean;
options.where = where;
options.nested = false;
this._clauses = ArrayUtil.push(this._clauses, options);
return this;
}
/**
* Add an "or on" clause to the join.
*
* @param string first
* @param string|null operator
* @param string|null second
* @return \Illuminate\Database\Query\JoinClause
*/
public JoinClause orOn(object first, string operator1 = null, object second = null)
{
return this.on(first, operator1, second, "or");
}
/**
* Add an "on where" clause to the join.
*
* @param string first
* @param string|null operator
* @param string|null second
* @param string boolean
* @return \Illuminate\Database\Query\JoinClause
*/
public JoinClause where(object first, string operator1 = null, object second = null, string boolean = "and")
{
return this.on(first, operator1, second, boolean, true);
}
/**
* Add an "or on where" clause to the join.
*
* @param string first
* @param string|null operator
* @param string|null second
* @return \Illuminate\Database\Query\JoinClause
*/
public JoinClause orWhere(object first, string operator1 = null, object second = null)
{
return this.on(first, operator1, second, "or", true);
}
/**
* Add an "on where is null" clause to the join.
*
* @param string column
* @param string boolean
* @return \Illuminate\Database\Query\JoinClause
*/
public JoinClause whereNull(object column, string boolean = "and")
{
return this.on(column, "is", new Expression("null"), boolean, false);
}
/**
* Add an "or on where is null" clause to the join.
*
* @param string column
* @return \Illuminate\Database\Query\JoinClause
*/
public JoinClause orWhereNull(object column)
{
return this.whereNull(column, "or");
}
/**
* Add an "on where is not null" clause to the join.
*
* @param string column
* @param string boolean
* @return \Illuminate\Database\Query\JoinClause
*/
public JoinClause whereNotNull(object column, string boolean = "and")
{
return this.on(column, "is", new Expression("not null"), boolean, false);
}
/**
* Add an "or on where is not null" clause to the join.
*
* @param string column
* @return \Illuminate\Database\Query\JoinClause
*/
public JoinClause orWhereNotNull(object column)
{
return this.whereNotNull(column, "or");
}
/**
* Add an "on where in (...)" clause to the join.
*
* @param string column
* @param array values
* @return \Illuminate\Database\Query\JoinClause
*/
public JoinClause whereIn(object column, object[] values)
{
return this.on(column, "in", values, "and", true);
}
/**
* Add an "on where not in (...)" clause to the join.
*
* @param string column
* @param array values
* @return \Illuminate\Database\Query\JoinClause
*/
public JoinClause whereNotIn(object column, object[] values)
{
return this.on(column, "not in", values, "and", true);
}
/**
* Add an "or on where in (...)" clause to the join.
*
* @param string column
* @param array values
* @return \Illuminate\Database\Query\JoinClause
*/
public JoinClause orWhereIn(object column, object[] values)
{
return this.on(column, "in", values, "or", true);
}
/**
* Add an "or on where not in (...)" clause to the join.
*
* @param string column
* @param array values
* @return \Illuminate\Database\Query\JoinClause
*/
public JoinClause orWhereNotIn(object column, object[] values)
{
return this.on(column, "not in", values, "or", true);
}
/**
* Add a nested where statement to the query.
*
* @param \Closure $callback
* @param string $boolean
* @return \Illuminate\Database\Query\JoinClause
*/
public JoinClause nest(Action<JoinClause> callback, string boolean = "and")
{
JoinClause join = new JoinClause(this._type, this._table);
callback(join);
if (join._clauses.Length > 0) {
JoinClauseOptions options = new JoinClauseOptions();
options.nested = true;
options.join = join;
options.boolean = boolean;
this._clauses = ArrayUtil.push(this._clauses, options);
this._bindings = ArrayUtil.concat(this._bindings, join._bindings);
}
return this;
}
}
}
| mattiamanzati/Icy | Icy/Database/Query/JoinClause.cs | C# | mit | 8,200 |
// All code points in the Khmer Symbols block as per Unicode v5.0.0:
[
0x19E0,
0x19E1,
0x19E2,
0x19E3,
0x19E4,
0x19E5,
0x19E6,
0x19E7,
0x19E8,
0x19E9,
0x19EA,
0x19EB,
0x19EC,
0x19ED,
0x19EE,
0x19EF,
0x19F0,
0x19F1,
0x19F2,
0x19F3,
0x19F4,
0x19F5,
0x19F6,
0x19F7,
0x19F8,
0x19F9,
0x19FA,
0x19FB,
0x19FC,
0x19FD,
0x19FE,
0x19FF
]; | mathiasbynens/unicode-data | 5.0.0/blocks/Khmer-Symbols-code-points.js | JavaScript | mit | 360 |
jQuery(document).ready(function() {
$('.alert-close').bind('click', function() {
$(this).parent().fadeOut(100);
});
function createAutoClosingAlert(selector, delay) {
var alert = $(selector).alert();
window.setTimeout(function() { alert.alert('close') }, delay);
}
createAutoClosingAlert(".alert", 20000);
}); | scr-be/mantle-bundle | src/Resources/public/js/scribe/alert.js | JavaScript | mit | 337 |
package com.rrajath.orange;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| rrajath/Orange | app/src/main/java/com/rrajath/orange/MainActivity.java | Java | mit | 1,118 |
package org.zezutom.schematic.model.json;
import org.zezutom.schematic.service.generator.json.StringGenerator;
public class StringNodeTest extends NodeTestCase<String, StringGenerator, StringNode> {
@Override
StringNode newInstance(String name, StringGenerator generator) {
return new StringNode(name, generator);
}
@Override
Class<StringGenerator> getGeneratorClass() {
return StringGenerator.class;
}
@Override
String getTestValue() {
return "test";
}
}
| zezutom/schematic | src/test/java/org/zezutom/schematic/model/json/StringNodeTest.java | Java | mit | 521 |
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Reservation's</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-lg-12">
<?php if($this->session->flashdata('approved_success')): ?>
<?= "<div class='alert alert-success'>". $this->session->flashdata("approved_success"). "</div>"; ?>
<?php endif; ?>
<?php if($this->session->flashdata('approved_failed')): ?>
<?= "<div class='alert alert-danger'>". $this->session->flashdata("approved_failed"). "</div>"; ?>
<?php endif; ?>
<?php if($this->session->flashdata('reject_success')): ?>
<?= "<div class='alert alert-success'>". $this->session->flashdata("reject_success"). "</div>"; ?>
<?php endif; ?>
<?php if($this->session->flashdata('invoice_ok')): ?>
<?= "<div class='alert alert-success'>". $this->session->flashdata("invoice_ok"). "</div>"; ?>
<?php endif; ?>
<?php if($this->session->flashdata('invoice_cancel')): ?>
<?= "<div class='alert alert-success'>". $this->session->flashdata("invoice_cancel"). "</div>"; ?>
<?php endif; ?>
<?php if($this->session->flashdata('reject_failed')): ?>
<?= "<div class='alert alert-danger'>". $this->session->flashdata("reject_failed"). "</div>"; ?>
<?php endif; ?>
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
User Appointement's
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th>SNo</th>
<th>Invoice</th>
<th>Appartment</th>
<th>Owner</th>
<th>Buy User</th>
<th>Appointment Ok</th>
<th>Appointemnt Cencel</th>
<th>Invoice Date</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
<?php foreach($book as $app): ?>
<?php $app->invoice_date;
?>
<?php
$current = strtotime(date('m/d/Y'));
$invoice_date = strtotime($app->invoice_date);
$sub = $invoice_date-$current;
$days = floor($sub/(60*60*24));
$result = explode("-",$days);
?>
<tr>
<td><?php echo $i++; ?></td>
<td><?= $app->invoice; ?></td>
<td><a href="<?php echo base_url('admin/admin_controller/appartment_details/'.$app->appartement_id.'');?>">Appartment Details</a></td>
<td><a href="<?php echo base_url('admin/admin_controller/user_details/'.$app->owner_id.'');?>">Owner Details</a></td>
<td><a href="<?php echo base_url('admin/admin_controller/user_details/'.$app->buy_user_id.'');?>">Buy User Details</a></td>
<td><a href="<?php echo base_url('admin/admin_controller/invoice_ok/'.$app->appartement_id.'');?>" class="btn btn-success"><span class="glyphicon glyphicon-ok"></span></a></td>
<td><a href="<?php echo base_url('admin/admin_controller/invoice_cancel/'.$app->appartement_id.'');?>" class="btn btn-danger"><span class="glyphicon glyphicon-remove"></span></a></td>
<?php if($days == 1): ?>
<td><?php echo "Today"; ?></td>
<?php else: ?>
<td><?php echo $result[1]." Days"; ?></td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<!-- /.table-responsive -->
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
</div>
<!-- /.col-lg-12 -->
</div> | shakilkhan12/Rent_Room | application/views/admin/parts/book.php | PHP | mit | 5,242 |
<?php
/*
* This file is part of PHPExifTool.
*
* (c) 2012 Romain Neutron <imprec@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPExiftool\Driver\Tag\Olympus;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class WBGLevel extends AbstractTag
{
protected $Id = 287;
protected $Name = 'WB_GLevel';
protected $FullName = 'Olympus::ImageProcessing';
protected $GroupName = 'Olympus';
protected $g0 = 'MakerNotes';
protected $g1 = 'Olympus';
protected $g2 = 'Camera';
protected $Type = 'int16u';
protected $Writable = true;
protected $Description = 'WB G Level';
protected $flag_Permanent = true;
}
| romainneutron/PHPExiftool | lib/PHPExiftool/Driver/Tag/Olympus/WBGLevel.php | PHP | mit | 835 |
<?php
return array (
'id' => 'mot_v3i_ver1_sub080305r',
'fallback' => 'mot_v3i_ver1',
'capabilities' =>
array (
),
);
| cuckata23/wurfl-data | data/mot_v3i_ver1_sub080305r.php | PHP | mit | 129 |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="uk" version="2.0">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About GoobyCoin</source>
<translation>Про GoobyCoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>GoobyCoin</b> version</source>
<translation>Версія <b>GoobyCoin'a<b></translation>
</message>
<message>
<location line="+57"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation>
Це програмне забезпечення є експериментальним.
Поширюється за ліцензією MIT/X11, додаткова інформація міститься у файлі COPYING, а також за адресою http://www.opensource.org/licenses/mit-license.php.
Цей продукт включає в себе програмне забезпечення, розроблене в рамках проекту OpenSSL (http://www.openssl.org/), криптографічне програмне забезпечення, написане Еріком Янгом (eay@cryptsoft.com), та функції для роботи з UPnP, написані Томасом Бернардом.</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation>Авторське право</translation>
</message>
<message>
<location line="+0"/>
<source>The GoobyCoin developers</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Адресна книга</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>Двічі клікніть на адресу чи назву для їх зміни</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Створити нову адресу</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Копіювати виділену адресу в буфер обміну</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>&Створити адресу</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your GoobyCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation>Це ваші адреси для отримання платежів. Ви можете давати різні адреси різним людям, таким чином маючи можливість відслідкувати хто конкретно і скільки вам заплатив.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation>&Скопіювати адресу</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Показати QR-&Код</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a GoobyCoin address</source>
<translation>Підпишіть повідомлення щоб довести, що ви є власником цієї адреси</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>&Підписати повідомлення</translation>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation>Вилучити вибрані адреси з переліку</translation>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation>Експортувати дані з поточної вкладки в файл</translation>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified GoobyCoin address</source>
<translation>Перевірте повідомлення для впевненості, що воно підписано вказаною GoobyCoin-адресою</translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation>Перевірити повідомлення</translation>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Видалити</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your GoobyCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation>Скопіювати &мітку</translation>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation>&Редагувати</translation>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+265"/>
<source>Export Address Book Data</source>
<translation>Експортувати адресну книгу</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Файли відділені комами (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Помилка при експортуванні</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Неможливо записати у файл %1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Назва</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Адреса</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(немає назви)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Діалог введення паролю</translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Введіть пароль</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Новий пароль</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Повторіть пароль</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Введіть новий пароль для гаманця.<br/>Будь ласка, використовуйте паролі що містять <b>як мінімум 10 випадкових символів</b>, або <b>як мінімум 8 слів</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Зашифрувати гаманець</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Ця операція потребує пароль для розблокування гаманця.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Розблокувати гаманець</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Ця операція потребує пароль для дешифрування гаманця.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Дешифрувати гаманець</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Змінити пароль</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Ввести старий та новий паролі для гаманця.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Підтвердити шифрування гаманця</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!</source>
<translation>УВАГА: Якщо ви зашифруєте гаманець і забудете пароль, ви <b>ВТРАТИТЕ ВСІ СВОЇ БІТКОІНИ</b>!</translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Ви дійсно хочете зашифрувати свій гаманець?</translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Увага: Ввімкнено Caps Lock!</translation>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>Гаманець зашифровано</translation>
</message>
<message>
<location line="-56"/>
<source>GoobyCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your goobycoins from being stolen by malware infecting your computer.</source>
<translation>Біткоін-клієнт буде закрито для завершення процесу шифрування. Пам'ятайте, що шифрування гаманця не може повністю захистити ваші біткоіни від крадіжки, у випадку якщо ваш комп'ютер буде інфіковано шкідливими програмами.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Не вдалося зашифрувати гаманець</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Виникла помилка під час шифрування гаманця. Ваш гаманець не було зашифровано.</translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>Введені паролі не співпадають.</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation>Не вдалося розблокувати гаманець</translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Введений пароль є невірним.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Не вдалося розшифрувати гаманець</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Пароль було успішно змінено.</translation>
</message>
</context>
<context>
<name>GoobyCoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+254"/>
<source>Sign &message...</source>
<translation>&Підписати повідомлення...</translation>
</message>
<message>
<location line="+246"/>
<source>Synchronizing with network...</source>
<translation>Синхронізація з мережею...</translation>
</message>
<message>
<location line="-321"/>
<source>&Overview</source>
<translation>&Огляд</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Показати загальний огляд гаманця</translation>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation>Транзакції</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Переглянути історію транзакцій</translation>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Редагувати список збережених адрес та міток</translation>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Показати список адрес для отримання платежів</translation>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation>&Вихід</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Вийти</translation>
</message>
<message>
<location line="+7"/>
<source>Show information about GoobyCoin</source>
<translation>Показати інформацію про GoobyCoin</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>&Про Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Показати інформацію про Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Параметри...</translation>
</message>
<message>
<location line="+9"/>
<source>&Encrypt Wallet...</source>
<translation>&Шифрування гаманця...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Резервне копіювання гаманця...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>Змінити парол&ь...</translation>
</message>
<message>
<location line="+251"/>
<source>Importing blocks from disk...</source>
<translation>Імпорт блоків з диску...</translation>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-319"/>
<source>Send coins to a GoobyCoin address</source>
<translation>Відправити монети на вказану адресу</translation>
</message>
<message>
<location line="+52"/>
<source>Modify configuration options for GoobyCoin</source>
<translation>Редагувати параметри</translation>
</message>
<message>
<location line="+12"/>
<source>Backup wallet to another location</source>
<translation>Резервне копіювання гаманця в інше місце</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Змінити пароль, який використовується для шифрування гаманця</translation>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation>Вікно зневадження</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Відкрити консоль зневадження і діагностики</translation>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation>Перевірити повідомлення...</translation>
</message>
<message>
<location line="-183"/>
<location line="+6"/>
<location line="+508"/>
<source>GoobyCoin</source>
<translation>GoobyCoin</translation>
</message>
<message>
<location line="-514"/>
<location line="+6"/>
<source>Wallet</source>
<translation>Гаманець</translation>
</message>
<message>
<location line="+107"/>
<source>&Send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<location line="+2"/>
<source>&About GoobyCoin</source>
<translation>&Про GoobyCoin</translation>
</message>
<message>
<location line="+10"/>
<location line="+2"/>
<source>&Show / Hide</source>
<translation>Показати / Приховати</translation>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation>Показує або приховує головне вікно</translation>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your GoobyCoin addresses to prove you own them</source>
<translation>Підтвердіть, що Ви є власником повідомлення підписавши його Вашою GoobyCoin-адресою </translation>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified GoobyCoin addresses</source>
<translation>Перевірте повідомлення для впевненості, що воно підписано вказаною GoobyCoin-адресою</translation>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>&Файл</translation>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation>&Налаштування</translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation>&Довідка</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Панель вкладок</translation>
</message>
<message>
<location line="-228"/>
<location line="+288"/>
<source>[testnet]</source>
<translation>[тестова мережа]</translation>
</message>
<message>
<location line="-5"/>
<location line="+5"/>
<source>GoobyCoin client</source>
<translation>GoobyCoin-клієнт</translation>
</message>
<message numerus="yes">
<location line="+121"/>
<source>%n active connection(s) to GoobyCoin network</source>
<translation><numerusform>%n активне з'єднання з мережею</numerusform><numerusform>%n активні з'єднання з мережею</numerusform><numerusform>%n активних з'єднань з мережею</numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation>Оброблено %1 блоків історії транзакцій.</translation>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation>Помилка</translation>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation>Увага</translation>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation>Інформація</translation>
</message>
<message>
<location line="+70"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation>Синхронізовано</translation>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation>Синхронізується...</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation>Підтвердити комісію</translation>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation>Надіслані транзакції</translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation>Отримані перекази</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Дата: %1
Кількість: %2
Тип: %3
Адреса: %4
</translation>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation>Обробка URI</translation>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid GoobyCoin address or malformed URI parameters.</source>
<translation>Неможливо обробити URI! Це може бути викликано неправильною GoobyCoin-адресою, чи невірними параметрами URI.</translation>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation><b>Зашифрований</b> гаманець <b>розблоковано</b></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation><b>Зашифрований</b> гаманець <b>заблоковано</b></translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+110"/>
<source>A fatal error occurred. GoobyCoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+105"/>
<source>Network Alert</source>
<translation>Сповіщення мережі</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Редагувати адресу</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Мітка</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Мітка, пов'язана з цим записом адресної книги</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Адреса</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>Адреса, пов'язана з цим записом адресної книги. Може бути змінено тільки для адреси відправника.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation>Нова адреса для отримання</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Нова адреса для відправлення</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Редагувати адресу для отримання</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Редагувати адресу для відправлення</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Введена адреса «%1» вже присутня в адресній книзі.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid GoobyCoin address.</source>
<translation>Введена адреса «%1» не є коректною адресою в мережі GoobyCoin.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Неможливо розблокувати гаманець.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Не вдалося згенерувати нові ключі.</translation>
</message>
</context>
<context>
<name>FreespaceChecker</name>
<message>
<location filename="../intro.cpp" line="+61"/>
<source>A new data directory will be created.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>name</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Directory already exists. Add %1 if you intend to create a new directory here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Path already exists, and is not a directory.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Cannot create data directory here.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+517"/>
<location line="+13"/>
<source>GoobyCoin-Qt</source>
<translation>GoobyCoin-Qt</translation>
</message>
<message>
<location line="-13"/>
<source>version</source>
<translation>версія</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Використання:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation>параметри командного рядка</translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>Параметри інтерфейсу</translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Встановлення мови, наприклад "de_DE" (типово: системна)</translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Запускати згорнутим</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation>Показувати заставку під час запуску (типово: 1)</translation>
</message>
<message>
<location line="+1"/>
<source>Choose data directory on startup (default: 0)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>Intro</name>
<message>
<location filename="../forms/intro.ui" line="+14"/>
<source>Welcome</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Welcome to GoobyCoin-Qt.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+26"/>
<source>As this is the first time the program is launched, you can choose where GoobyCoin-Qt will store its data.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>GoobyCoin-Qt will download and store a copy of the GoobyCoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Use the default data directory</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Use a custom data directory:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../intro.cpp" line="+100"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>GB of free space available</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>(of %1GB needed)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Параметри</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Головні</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>Заплатити комісі&ю</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start GoobyCoin after logging in to the system.</source>
<translation>Автоматично запускати гаманець при вході до системи.</translation>
</message>
<message>
<location line="+3"/>
<source>&Start GoobyCoin on system login</source>
<translation>&Запускати гаманець при вході в систему</translation>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation>Скинути всі параметри клієнта на типові.</translation>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation>Скинути параметри</translation>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation>&Мережа</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the GoobyCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Автоматично відкривати порт для клієнту біткоін на роутері. Працює лише якщо ваш роутер підтримує UPnP і ця функція увімкнена.</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Відображення порту через &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the GoobyCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation>Підключатись до мережі GoobyCoin через SOCKS-проксі (наприклад при використанні Tor).</translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>Підключатись через &SOCKS-проксі:</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>&IP проксі:</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>IP-адреса проксі-сервера (наприклад 127.0.0.1)</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Порт:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Порт проксі-сервера (наприклад 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS версії:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>Версія SOCKS-проксі (наприклад 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Вікно</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Показувати лише іконку в треї після згортання вікна.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>Мінімізувати &у трей</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Згортати замість закриття. Якщо ця опція включена, програма закриється лише після вибору відповідного пункту в меню.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>Згортати замість закритт&я</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Відображення</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>Мова інтерфейсу користувача:</translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting GoobyCoin.</source>
<translation>Встановлює мову інтерфейсу. Зміни набудуть чинності після перезапуску GoobyCoin.</translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>В&имірювати монети в:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Виберіть одиницю вимірювання монет, яка буде відображатись в гаманці та при відправленні.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show GoobyCoin addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>&Відображати адресу в списку транзакцій</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>&Гаразд</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Скасувати</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>&Застосувати</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+54"/>
<source>default</source>
<translation>типово</translation>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation>Підтвердження скидання параметрів</translation>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation>Деякі параметри потребують перезапуск клієнта для набуття чинності.</translation>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation>Продовжувати?</translation>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation>Увага</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting GoobyCoin.</source>
<translation>Цей параметр набуде чинності після перезапуску GoobyCoin.</translation>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Невірно вказано адресу проксі.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Форма</translation>
</message>
<message>
<location line="+50"/>
<location line="+202"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the GoobyCoin network after a connection is established, but this process has not completed yet.</source>
<translation>Показана інформація вже може бути застарілою. Ваш гаманець буде автоматично синхронізовано з мережею GoobyCoin після встановлення підключення, але цей процес ще не завершено.</translation>
</message>
<message>
<location line="-131"/>
<source>Unconfirmed:</source>
<translation>Непідтверджені:</translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation>Гаманець</translation>
</message>
<message>
<location line="+49"/>
<source>Confirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Total:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+53"/>
<source><b>Recent transactions</b></source>
<translation><b>Недавні транзакції</b></translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation>не синхронізовано</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+108"/>
<source>Cannot start goobycoin: click-to-pay handler</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../bitcoin.cpp" line="+92"/>
<location filename="../intro.cpp" line="-32"/>
<source>GoobyCoin</source>
<translation>GoobyCoin</translation>
</message>
<message>
<location line="+1"/>
<source>Error: Specified data directory "%1" does not exist.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../intro.cpp" line="+1"/>
<source>Error: Specified data directory "%1" can not be created.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation>Діалог QR-коду</translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation>Запросити Платіж</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Кількість:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Мітка:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Повідомлення:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>&Зберегти як...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+64"/>
<source>Error encoding URI into QR Code.</source>
<translation>Помилка при кодуванні URI в QR-код.</translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation>Невірно введено кількість, будь ласка, перевірте.</translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>Кінцевий URI занадто довгий, спробуйте зменшити текст для мітки / повідомлення.</translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation>Зберегти QR-код</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>PNG-зображення (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Назва клієнту</translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+345"/>
<source>N/A</source>
<translation>Н/Д</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Версія клієнту</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>&Інформація</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>Використовується OpenSSL версії</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Мережа</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Кількість підключень</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation>В тестовій мережі</translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Поточне число блоків</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>Відкрити</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation>Параметри командного рядка</translation>
</message>
<message>
<location line="+7"/>
<source>Show the GoobyCoin-Qt help message to get a list with possible GoobyCoin command-line options.</source>
<translation>Показати довідку GoobyCoin-Qt для отримання переліку можливих параметрів командного рядка.</translation>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation>Показати</translation>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>Консоль</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>Дата збирання</translation>
</message>
<message>
<location line="-104"/>
<source>GoobyCoin - Debug window</source>
<translation>GoobyCoin - Вікно зневадження</translation>
</message>
<message>
<location line="+25"/>
<source>GoobyCoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>Файл звіту зневадження</translation>
</message>
<message>
<location line="+7"/>
<source>Open the GoobyCoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Очистити консоль</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the GoobyCoin RPC console.</source>
<translation>Вітаємо у консолі GoobyCoin RPC.</translation>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Використовуйте стрілки вгору вниз для навігації по історії, і <b>Ctrl-L</b> для очищення екрана.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Наберіть <b>help</b> для перегляду доступних команд.</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+128"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Відправити</translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation>Відправити на декілька адрес</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>Дод&ати одержувача</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>Видалити всі поля транзакції</translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Очистити &все</translation>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation>Баланс:</translation>
</message>
<message>
<location line="+10"/>
<source>123.456 ABC</source>
<translation>123.456 ABC</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Підтвердити відправлення</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&Відправити</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-62"/>
<location line="+2"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> адресату %2 (%3)</translation>
</message>
<message>
<location line="+6"/>
<source>Confirm send coins</source>
<translation>Підтвердіть відправлення</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Ви впевнені що хочете відправити %1?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation> і </translation>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Адреса отримувача невірна, будь ласка перепровірте.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Кількість монет для відправлення повинна бути більшою 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Кількість монет для відправлення перевищує ваш баланс.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Сума перевищить ваш баланс, якщо комісія %1 буде додана до вашої транзакції.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Знайдено адресу що дублюється. Відправлення на кожну адресу дозволяється лише один раз на кожну операцію переказу.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation>Помилка: Не вдалося створити транзакцію!</translation>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Помилка: транзакцію було відхилено. Це може статись, якщо декілька монет з вашого гаманця вже використані, наприклад, якщо ви використовуєте одну копію гаманця (wallet.dat), а монети були використані з іншої копії, але не позначені як використані в цій.</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Форма</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>&Кількість:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>&Отримувач:</translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Введіть мітку для цієї адреси для додавання її в адресну книгу</translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>&Мітка:</translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation>Вибрати адресу з адресної книги</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Вставити адресу</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation>Видалити цього отримувача</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a GoobyCoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Введіть адресу GoobyCoin (наприклад 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>Підписи - Підпис / Перевірка повідомлення</translation>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation>&Підписати повідомлення</translation>
</message>
<message>
<location line="+6"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Введіть адресу GoobyCoin (наприклад 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation>Вибрати адресу з адресної книги</translation>
</message>
<message>
<location line="-203"/>
<location line="+213"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-203"/>
<source>Paste address from clipboard</source>
<translation>Вставити адресу</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>Введіть повідомлення, яке ви хочете підписати тут</translation>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation>Підпис</translation>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation>Копіювати поточну сигнатуру до системного буферу обміну</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this GoobyCoin address</source>
<translation>Підпишіть повідомлення щоб довести, що ви є власником цієї адреси</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>&Підписати повідомлення</translation>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation>Скинути всі поля підпису повідомлення</translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Очистити &все</translation>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation>Перевірити повідомлення</translation>
</message>
<message>
<location line="+6"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Введіть адресу GoobyCoin (наприклад 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified GoobyCoin address</source>
<translation>Перевірте повідомлення для впевненості, що воно підписано вказаною GoobyCoin-адресою</translation>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation>Перевірити повідомлення</translation>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation>Скинути всі поля перевірки повідомлення</translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a GoobyCoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Введіть адресу GoobyCoin (наприклад 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Натисніть кнопку «Підписати повідомлення», для отримання підпису</translation>
</message>
<message>
<location line="+3"/>
<source>Enter GoobyCoin signature</source>
<translation>Введіть сигнатуру GoobyCoin</translation>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>Введена нечинна адреса.</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>Будь ласка, перевірте адресу та спробуйте ще.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Не вдалося підписати повідомлення.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Повідомлення підписано.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Підпис не можливо декодувати.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Будь ласка, перевірте підпис та спробуйте ще.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Не вдалося перевірити повідомлення.</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Повідомлення перевірено.</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>The GoobyCoin developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation>[тестова мережа]</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation>Відкрити до %1</translation>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation>%1/поза інтернетом</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/не підтверджено</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 підтверджень</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Статус</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Згенеровано</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>Відправник</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>Отримувач</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>Мітка</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Кредит</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>не прийнято</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Дебет</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Комісія за транзакцію</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Загальна сума</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Повідомлення</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Коментар</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>ID транзакції</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 10 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>Після генерації монет, потрібно зачекати 10 блоків, перш ніж їх можна буде використати. Коли ви згенерували цей блок, його було відправлено в мережу для того, щоб він був доданий до ланцюжка блоків. Якщо ця процедура не вдасться, статус буде змінено на «не підтверджено» і ви не зможете потратити згенеровані монету. Таке може статись, якщо хтось інший згенерував блок на декілька секунд раніше.</translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Транзакція</translation>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Кількість</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>true</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>false</translation>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation>, ще не було успішно розіслано</translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation>невідомий</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Деталі транзакції</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Даний діалог показує детальну статистику по вибраній транзакції</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+225"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Тип</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Адреса</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Кількість</translation>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>Відкрити до %1</translation>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation>Поза інтернетом (%1 підтверджень)</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>Непідтверджено (%1 із %2 підтверджень)</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Підтверджено (%1 підтверджень)</translation>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Цей блок не був отриманий жодними іншими вузлами і, ймовірно, не буде прийнятий!</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Згенеровано, але не підтверджено</translation>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation>Отримано</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Отримано від</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Відправлено</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Відправлено собі</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Добуто</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(недоступно)</translation>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Статус транзакції. Наведіть вказівник на це поле, щоб показати кількість підтверджень.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Дата і час, коли транзакцію було отримано.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Тип транзакції.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Адреса отримувача транзакції.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Сума, додана чи знята з балансу.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation>Всі</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Сьогодні</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>На цьому тижні</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>На цьому місяці</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Минулого місяця</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Цього року</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Проміжок...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Отримані на</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Відправлені на</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Відправлені собі</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Добуті</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Інше</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Введіть адресу чи мітку для пошуку</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Мінімальна сума</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Скопіювати адресу</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Скопіювати мітку</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Копіювати кількість</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Редагувати мітку</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Показати деталі транзакції</translation>
</message>
<message>
<location line="+143"/>
<source>Export Transaction Data</source>
<translation>Експортувати дані транзакцій</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Файли, розділені комою (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Підтверджені</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Тип</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Мітка</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Адреса</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Кількість</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>Ідентифікатор</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Помилка експорту</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Неможливо записати у файл %1.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Діапазон від:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>до</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation>Відправити</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+46"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation>Експортувати дані з поточної вкладки в файл</translation>
</message>
<message>
<location line="+197"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation>Виникла помилка при спробі зберегти гаманець в новому місці.</translation>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation>Успішне створення резервної копії</translation>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation>Данні гаманця успішно збережено в новому місці призначення.</translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+98"/>
<source>GoobyCoin version</source>
<translation>Версія</translation>
</message>
<message>
<location line="+104"/>
<source>Usage:</source>
<translation>Використання:</translation>
</message>
<message>
<location line="-30"/>
<source>Send command to -server or goobycoind</source>
<translation>Відправити команду серверу -server чи демону</translation>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation>Список команд</translation>
</message>
<message>
<location line="-13"/>
<source>Get help for a command</source>
<translation>Отримати довідку по команді</translation>
</message>
<message>
<location line="+25"/>
<source>Options:</source>
<translation>Параметри:</translation>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: goobycoin.conf)</source>
<translation>Вкажіть файл конфігурації (типово: goobycoin.conf)</translation>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: goobycoind.pid)</source>
<translation>Вкажіть pid-файл (типово: goobycoind.pid)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Вкажіть робочий каталог</translation>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Встановити розмір кешу бази даних в мегабайтах (типово: 25)</translation>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 10221 or testnet: 20221)</source>
<translation>Чекати на з'єднання на <port> (типово: 10221 або тестова мережа: 20221)</translation>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Підтримувати не більше <n> зв'язків з колегами (типово: 125)</translation>
</message>
<message>
<location line="-49"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+84"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Поріг відключення неправильно під'єднаних пірів (типово: 100)</translation>
</message>
<message>
<location line="-136"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Максимальній розмір вхідного буферу на одне з'єднання (типово: 86400)</translation>
</message>
<message>
<location line="-33"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Listen for JSON-RPC connections on <port> (default: 10222 or testnet: 20222)</source>
<translation>Прослуховувати <port> для JSON-RPC-з'єднань (типово: 10222 або тестова мережа: 20222)</translation>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Приймати команди із командного рядка та команди JSON-RPC</translation>
</message>
<message>
<location line="+77"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Запустити в фоновому режимі (як демон) та приймати команди</translation>
</message>
<message>
<location line="+38"/>
<source>Use the test network</source>
<translation>Використовувати тестову мережу</translation>
</message>
<message>
<location line="-114"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-84"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=goobycoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "GoobyCoin Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. GoobyCoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Помилка: транзакцію було відхилено. Це може статись, якщо декілька монет з вашого гаманця вже використані, наприклад, якщо ви використовуєте одну копію гаманця (wallet.dat), а монети були використані з іншої копії, але не позначені як використані в цій.</translation>
</message>
<message>
<location line="+4"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Увага: встановлено занадто велику комісію (-paytxfee). Комісія зніматиметься кожен раз коли ви проводитимете транзакції.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong GoobyCoin will not work properly.</source>
<translation>Увага: будь ласка, перевірте дату і час на своєму комп'ютері. Якщо ваш годинник йде неправильно, GoobyCoin може працювати некоректно.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation>Увага: помилка читання wallet.dat! Всі ключі прочитано коректно, але дані транзакцій чи записи адресної книги можуть бути пропущені, або пошкоджені.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation>Увага: файл wallet.dat пошкоджено, дані врятовано! Оригінальний wallet.dat збережено як wallet.{timestamp}.bak до %s; якщо Ваш баланс чи транзакції неправильні, Ви можете відновити їх з резервної копії. </translation>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation>Спроба відновити закриті ключі з пошкодженого wallet.dat</translation>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation>Підключитись лише до вказаного вузла</translation>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation>Помилка ініціалізації бази даних блоків</translation>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation>Помилка завантаження бази даних блоків</translation>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation>Помилка: Мало вільного місця на диску!</translation>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation>Помилка: Гаманець заблокований, неможливо створити транзакцію!</translation>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation>Помилка: системна помилка: </translation>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation>Скільки блоків перевіряти під час запуску (типово: 288, 0 = всі)</translation>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Incorrect or no genesis block found. Wrong datadir for network?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Not enough file descriptors available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Specify wallet file (within data directory)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Verifying blocks...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Wallet %s resides outside data directory %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>You need to rebuild the database using -reindex to change -txindex</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-76"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation>Імпорт блоків з зовнішнього файлу blk000??.dat</translation>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+78"/>
<source>Information</source>
<translation>Інформація</translation>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation>Помилка в адресі -tor: «%s»</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>Максимальний буфер, <n>*1000 байт (типово: 5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>Максимальній розмір вихідного буферу на одне з'єднання, <n>*1000 байт (типово: 1000)</translation>
</message>
<message>
<location line="+2"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation>Виводити більше налагоджувальної інформації. Мається на увазі всі шнші -debug* параметри</translation>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation>Доповнювати налагоджувальний вивід відміткою часу</translation>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the GoobyCoin Wiki for SSL setup instructions)</source>
<translation>Параметри SSL: (див. GoobyCoin Wiki для налаштування SSL)</translation>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation>Вибір версії socks-проксі для використання (4-5, типово: 5)</translation>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Відсилати налагоджувальну інформацію на консоль, а не у файл debug.log</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>Відсилати налагоджувальну інформацію до налагоджувача</translation>
</message>
<message>
<location line="+5"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation>Встановити максимальний розмір блоку у байтах (типово: 250000)</translation>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>Встановити мінімальний розмір блоку у байтах (типово: 0)</translation>
</message>
<message>
<location line="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>Стискати файл debug.log під час старту клієнта (типово: 1 коли відсутутній параметр -debug)</translation>
</message>
<message>
<location line="+1"/>
<source>Signing transaction failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Вказати тайм-аут підключення у мілісекундах (типово: 5000)</translation>
</message>
<message>
<location line="+5"/>
<source>System error: </source>
<translation>Системна помилка: </translation>
</message>
<message>
<location line="+4"/>
<source>Transaction amount too small</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction amounts must be positive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction too large</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Намагатись використовувати UPnP для відображення порту, що прослуховується на роутері (default: 0)</translation>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Намагатись використовувати UPnP для відображення порту, що прослуховується на роутері (default: 1 when listening)</translation>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation>Ім'я користувача для JSON-RPC-з'єднань</translation>
</message>
<message>
<location line="+5"/>
<source>Warning</source>
<translation>Попередження</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>Увага: Поточна версія застаріла, необхідне оновлення!</translation>
</message>
<message>
<location line="+2"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation>wallet.dat пошкоджено, відновлення не вдалося</translation>
</message>
<message>
<location line="-52"/>
<source>Password for JSON-RPC connections</source>
<translation>Пароль для JSON-RPC-з'єднань</translation>
</message>
<message>
<location line="-68"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Дозволити JSON-RPC-з'єднання з вказаної IP-адреси</translation>
</message>
<message>
<location line="+77"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Відправляти команди на вузол, запущений на <ip> (типово: 127.0.0.1)</translation>
</message>
<message>
<location line="-121"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+149"/>
<source>Upgrade wallet to latest format</source>
<translation>Модернізувати гаманець до останнього формату</translation>
</message>
<message>
<location line="-22"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Встановити розмір пулу ключів <n> (типово: 100)</translation>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Пересканувати ланцюжок блоків, в пошуку втрачених транзакцій</translation>
</message>
<message>
<location line="+36"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Використовувати OpenSSL (https) для JSON-RPC-з'єднань</translation>
</message>
<message>
<location line="-27"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Файл сертифіката сервера (типово: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Закритий ключ сервера (типово: server.pem)</translation>
</message>
<message>
<location line="-156"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Допустимі шифри (типово: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location line="+171"/>
<source>This help message</source>
<translation>Дана довідка</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Неможливо прив'язати до порту %s на цьому комп'ютері (bind returned error %d, %s)</translation>
</message>
<message>
<location line="-93"/>
<source>Connect through socks proxy</source>
<translation>Підключитись через SOCKS-проксі</translation>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Дозволити пошук в DNS для команд -addnode, -seednode та -connect</translation>
</message>
<message>
<location line="+56"/>
<source>Loading addresses...</source>
<translation>Завантаження адрес...</translation>
</message>
<message>
<location line="-36"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Помилка при завантаженні wallet.dat: Гаманець пошкоджено</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of GoobyCoin</source>
<translation>Помилка при завантаженні wallet.dat: Гаманець потребує новішої версії Біткоін-клієнта</translation>
</message>
<message>
<location line="+96"/>
<source>Wallet needed to be rewritten: restart GoobyCoin to complete</source>
<translation>Потрібно перезаписати гаманець: перезапустіть Біткоін-клієнт для завершення</translation>
</message>
<message>
<location line="-98"/>
<source>Error loading wallet.dat</source>
<translation>Помилка при завантаженні wallet.dat</translation>
</message>
<message>
<location line="+29"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Помилка в адресі проксі-сервера: «%s»</translation>
</message>
<message>
<location line="+57"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Невідома мережа вказана в -onlynet: «%s»</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-98"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Помилка у величині комісії -paytxfee=<amount>: «%s»</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation>Некоректна кількість</translation>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation>Недостатньо коштів</translation>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation>Завантаження індексу блоків...</translation>
</message>
<message>
<location line="-58"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Додати вузол до підключення і лишити його відкритим</translation>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. GoobyCoin is probably already running.</source>
<translation>Неможливо прив'язати до порту %s на цьому комп'ютері. Можливо гаманець вже запущено.</translation>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Комісія за КБ</translation>
</message>
<message>
<location line="+20"/>
<source>Loading wallet...</source>
<translation>Завантаження гаманця...</translation>
</message>
<message>
<location line="-53"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation>Неможливо записати типову адресу</translation>
</message>
<message>
<location line="+65"/>
<source>Rescanning...</source>
<translation>Сканування...</translation>
</message>
<message>
<location line="-58"/>
<source>Done loading</source>
<translation>Завантаження завершене</translation>
</message>
<message>
<location line="+84"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-76"/>
<source>Error</source>
<translation>Помилка</translation>
</message>
<message>
<location line="-31"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>Ви мусите встановити rpcpassword=<password> в файлі конфігурації:
%s
Якщо файл не існує, створіть його із правами тільки для читання власником (owner-readable-only).</translation>
</message>
</context>
</TS> | GoobyCoin/GoobyCoin | src/qt/locale/bitcoin_uk.ts | TypeScript | mit | 127,958 |
// ===========================================================================
//
// PUBLIC DOMAIN NOTICE
// Agricultural Research Service
// United States Department of Agriculture
//
// This software/database is a "United States Government Work" under the
// terms of the United States Copyright Act. It was written as part of
// the author's official duties as a United States Government employee
// and thus cannot be copyrighted. This software/database is freely
// available to the public for use. The Department of Agriculture (USDA)
// and the U.S. Government have not placed any restriction on its use or
// reproduction.
//
// Although all reasonable efforts have been taken to ensure the accuracy
// and reliability of the software and data, the USDA and the U.S.
// Government do not and cannot warrant the performance or results that
// may be obtained by using this software or data. The USDA and the U.S.
// Government disclaim all warranties, express or implied, including
// warranties of performance, merchantability or fitness for any
// particular purpose.
//
// Please cite the author in any work or product based on this material.
//
// =========================================================================
#ifndef _PARTIAL_CORE_MATRIX_H_
#define _PARTIAL_CORE_MATRIX_H_ 1
#include <memory>
#include <map>
#include <exception>
#include "logging.hpp"
#include "distributions.hpp"
#include "continuous_dynamics.hpp"
namespace afidd
{
namespace smv
{
template<typename GSPN, typename State, typename RNG>
class PartialCoreMatrix
{
public:
// Re-advertise the transition key.
typedef typename GSPN::TransitionKey TransitionKey;
typedef ContinuousPropagator<TransitionKey,RNG> Propagator;
using PropagatorVector=std::vector<Propagator*>;
typedef GSPN PetriNet;
PartialCoreMatrix(GSPN& gspn, PropagatorVector pv)
: gspn_(gspn), propagator_{pv} {}
void set_state(State* s) {
state_=s;
}
void MakeCurrent(RNG& rng) {
if (state_->marking.Modified().size()==0) return;
// Check all neighbors of a place to see if they were enabled.
auto lm=state_->marking.GetLocalMarking();
NeighborsOfPlaces(gspn_, state_->marking.Modified(),
[&] (TransitionKey neighbor_id) {
// Was this transition enabled? When?
double enabling_time=0.0;
Propagator* previous_propagator=nullptr;
for (const auto& enable_prop : propagator_) {
double previously_enabled=false;
std::tie(previously_enabled, enabling_time)
=enable_prop->Enabled(neighbor_id);
if (previously_enabled) {
previous_propagator=enable_prop;
break;
}
}
if (previous_propagator==nullptr) enabling_time=state_->CurrentTime();
// Set up the local marking.
auto neighboring_places=
InputsOfTransition(gspn_, neighbor_id);
state_->marking.InitLocal(lm, neighboring_places);
bool isEnabled=false;
std::unique_ptr<TransitionDistribution<RNG>> dist;
try {
std::tie(isEnabled, dist)=
Enabled(gspn_, neighbor_id, state_->user, lm,
enabling_time, state_->CurrentTime(), rng);
} catch (const std::exception& e) {
BOOST_LOG_TRIVIAL(error)<<"Exception in Enabled new of "
<< neighbor_id <<": " << e.what();
throw;
}
if (isEnabled) {
Propagator* appropriate=nullptr;
for (const auto& prop_ptr : propagator_) {
if (prop_ptr->Include(*dist)) {
appropriate=prop_ptr;
}
}
BOOST_ASSERT_MSG(appropriate!=nullptr, "No propagator willing to "
"accept this distribution");
// Even if it was already enabled, take the new distribution
// in case it has changed.
if (dist!=nullptr) {
bool was_enabled=previous_propagator!=nullptr;
if (was_enabled) {
if (previous_propagator==appropriate) {
try {
appropriate->Enable(neighbor_id, dist, state_->CurrentTime(),
was_enabled, rng);
} catch (const std::exception& e) {
BOOST_LOG_TRIVIAL(error)<<"Exception in Enabled previous of "
<< neighbor_id <<": " << e.what();
throw;
}
} else {
try {
previous_propagator->Disable(neighbor_id,
state_->CurrentTime());
} catch (const std::exception& e) {
BOOST_LOG_TRIVIAL(error)<<"Exception in Disable of "
<< neighbor_id <<": " << e.what();
throw;
}
try {
appropriate->Enable(neighbor_id, dist, state_->CurrentTime(),
was_enabled, rng);
} catch (const std::exception& e) {
BOOST_LOG_TRIVIAL(error)<<"Exception in Enable wasn't "
<< "noprev of " << neighbor_id <<": " << e.what();
throw;
}
}
} else {
try {
appropriate->Enable(neighbor_id, dist, state_->CurrentTime(),
was_enabled, rng);
} catch (const std::exception& e) {
BOOST_LOG_TRIVIAL(error)<<"Exception in Enable wasn't of "
<< neighbor_id <<": " << e.what();
throw;
}
}
} else {
BOOST_ASSERT_MSG(previous_propagator!=nullptr, "Transition didn't "
"return a distribution, so it thinks it was enabled, but it "
"isn't listed as enabled in any propagator");
}
} else if (!isEnabled && previous_propagator!=nullptr) {
previous_propagator->Disable(neighbor_id, state_->CurrentTime());
} else {
; // not enabled, not becoming enabled.
}
});
SMVLOG(BOOST_LOG_TRIVIAL(trace) << "Marking modified cnt: "<<
state_->marking.Modified().size());
state_->marking.Clear();
}
void Trigger(TransitionKey trans_id, double when, RNG& rng) {
if (when-state_->CurrentTime()<-1e-4) {
BOOST_LOG_TRIVIAL(error) << "Firing negative time "<<when <<
" given current time "<<state_->CurrentTime() <<" for transition "
<<trans_id;
}
auto neighboring_places=NeighborsOfTransition(gspn_, trans_id);
auto lm=state_->marking.GetLocalMarking();
state_->marking.InitLocal(lm, neighboring_places);
Fire(gspn_, trans_id, state_->user, lm, when, rng);
state_->marking.ReadLocal(lm, neighboring_places);
SMVLOG(BOOST_LOG_TRIVIAL(trace) << "Fire "<<trans_id <<" neighbors: "<<
neighboring_places.size() << " modifies "
<< state_->marking.Modified().size() << " places.");
state_->SetTime(when);
bool enabled=false;
double previous_when;
for (auto& prop_ptr : propagator_) {
std::tie(enabled, previous_when)=prop_ptr->Enabled(trans_id);
if (enabled) {
prop_ptr->Fire(trans_id, state_->CurrentTime(), rng);
break;
}
}
BOOST_ASSERT_MSG(enabled, "The transition that fired wasn't enabled?");
}
PropagatorVector& Propagators() { return propagator_; }
private:
GSPN& gspn_;
State* state_;
PropagatorVector propagator_;
};
} // smv
} // afidd
#endif // _PARTIAL_CORE_MATRIX_H_
| adolgert/hop-skip-bite | hopskip/src/semimarkov-0.1/partial_core_matrix.hpp | C++ | mit | 7,601 |
using System;
using Xamarin.Forms;
namespace TextSpeaker.Views
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private async void Button_OnClicked(object sender, EventArgs e)
{
var result = await DisplayAlert("確認", "Text Speech画面へ遷移しますか?", "OK", "Cancel");
if (result)
{
await Navigation.PushAsync(new TextSpeechPage());
}
}
}
}
| jxug/PrismAndMoqHansOn | before/TextSpeaker/TextSpeaker/TextSpeaker/Views/MainPage.xaml.cs | C# | mit | 539 |
var fans=require('../../modules/blog/fans');
var User=require('../../modules/resume/user');
var async = require('asyncawait/async');
var await = require('asyncawait/await');
module.exports=(async(function(method,req,res){
var result;
if(method==='get'){
}
else if(method==='post'){
var userId=req.session.uid;
var targetId=req.body.targetId;
if(userId){
if(userId==targetId){
result={
status:-1,
msg:"你咋可以自己关注自己呢?自恋!"
}
}else{
//已登录才能关注,查询是否已关注过
var isFansDate=await(fans.findOne({
where:{
userId:userId,
targetId:targetId
}
}))
if(isFansDate){
result={
status:-1,
msg:"已关注"
}
}
else{
var fansDate=await(fans.create({
userId:userId,
targetId:targetId
}))
if(fansDate){
result={
status:0,
msg:"关注成功"
}
}else{
result={
status:-1,
msg:"关注失败"
}
}
}
}
}else{
result={
status:-1,
msg:"未登录"
}
}
}
else if(method==='delete'){
var targetId=req.query.targetId;
var userId=req.session.uid;
if(userId){
//已登录才能取消关注,查询是否已关注过
var isFansDate=await(fans.findOne({
where:{
userId:userId,
targetId:targetId
}
}))
if(isFansDate){
var fansDate=await(fans.destroy({
where:{
userId:userId,
targetId:targetId
}
}))
if(fansDate){
result={
status:0,
msg:"取消关注成功"
}
}else{
result={
status:-1,
msg:"取消关注失败"
}
}
}
else{
result={
status:-1,
msg:"未关注"
}
}
}else{
result={
status:-1,
msg:"未登录"
}
}
}
res.writeHead(200,{"Content-Type":"text/html;charset=utf-8"});
res.end(JSON.stringify(result))
})) | weijiafen/antBlog | src/main/server/controler/blog/fans.js | JavaScript | mit | 1,918 |
<?php
namespace Guardian\User\Caller;
use Assert\Assertion;
use Guardian\Caller\HasLoginToken;
use Guardian\User\Caller;
/**
* Simple user caller
*
* @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
*/
class User implements Caller, HasLoginToken, \ArrayAccess
{
/**
* @var string|integer
*/
protected $id;
/**
* @var array
*/
protected $data;
/**
* @param string|integer $id
* @param array $data
*/
public function __construct($id, $data)
{
// TODO: check for id's type
Assertion::choicesNotEmpty($data, ['username', 'password']);
$this->id = $id;
$this->data = $data;
}
/**
* {@inheritdoc}
*/
public function getId()
{
return $this->id;
}
/**
* {@inheritdoc}
*/
public function getLoginToken()
{
return $this->id;
}
/**
* {@inheritdoc}
*/
public function getUsername()
{
return $this->data['username'];
}
/**
* {@inheritdoc}
*/
public function getPassword()
{
return $this->data['password'];
}
/**
* Returns dynamic properties passed to the object
*
* Notice: property names should be camelCased
*
* @param string $method
* @param array $arguments
*
* @return mixed
*
* @throws BadMethodCallException If $method is not a property
*/
public function __call($method, array $arguments)
{
if (substr($method, 0, 3) === 'get' and $property = substr($method, 3)) {
$property = lcfirst($property);
Assertion::notEmptyKey($this->data, $property, 'User does not have a(n) "%s" property');
return $this->data[$property];
}
throw new \BadMethodCallException(sprintf('Method "%s" does not exists', $method));
}
/**
* {@inheritdoc}
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->data[] = $value;
} else {
$this->data[$offset] = $value;
}
}
/**
* {@inheritdoc}
*/
public function offsetExists($offset)
{
return isset($this->data[$offset]);
}
/**
* {@inheritdoc}
*/
public function offsetUnset($offset)
{
if (isset($this->data[$offset])) {
unset($this->data[$offset]);
}
}
/**
* {@inheritdoc}
*/
public function offsetGet($offset)
{
if (isset($this->data[$offset])) {
return $this->data[$offset];
}
}
}
| guardianphp/user | src/Caller/User.php | PHP | mit | 2,639 |
module HashRollup
extend self
def rollup data, into
raise ArgumentError, "arguments must be Hashes" unless data.is_a?(Hash) && into.is_a?(Hash)
into.merge(data) do |key, current_val, new_val|
if current_val.class.name != new_val.class.name
raise "Mismatch in types detected! Key = #{key}, current value type = #{current_val.class.name}, new value type = #{new_val.class.name}"
end
if current_val.is_a?(Hash)
rollup new_val, current_val
elsif current_val.is_a?(String)
new_val
else
current_val + new_val
end
end
end
end
| UKHomeOffice/platform-hub | platform-hub-api/app/lib/hash_rollup.rb | Ruby | mit | 609 |
"""
.. module:: mlpy.auxiliary.datastructs
:platform: Unix, Windows
:synopsis: Provides data structure implementations.
.. moduleauthor:: Astrid Jackson <ajackson@eecs.ucf.edu>
"""
from __future__ import division, print_function, absolute_import
import heapq
import numpy as np
from abc import ABCMeta, abstractmethod
class Array(object):
"""The managed array class.
The managed array class pre-allocates memory to the given size
automatically resizing as needed.
Parameters
----------
size : int
The size of the array.
Examples
--------
>>> a = Array(5)
>>> a[0] = 3
>>> a[1] = 6
Retrieving an elements:
>>> a[0]
3
>>> a[2]
0
Finding the length of the array:
>>> len(a)
2
"""
def __init__(self, size):
self._data = np.zeros((size,))
self._capacity = size
self._size = 0
def __setitem__(self, index, value):
"""Set the the array at the index to the given value.
Parameters
----------
index : int
The index into the array.
value :
The value to set the array to.
"""
if index >= self._size:
if self._size == self._capacity:
self._capacity *= 2
new_data = np.zeros((self._capacity,))
new_data[:self._size] = self._data
self._data = new_data
self._size += 1
self._data[index] = value
def __getitem__(self, index):
"""Get the value at the given index.
Parameters
----------
index : int
The index into the array.
"""
return self._data[index]
def __len__(self):
"""The length of the array.
Returns
-------
int :
The size of the array
"""
return self._size
class Point2D(object):
"""The 2d-point class.
The 2d-point class is a container for positions
in a 2d-coordinate system.
Parameters
----------
x : float, optional
The x-position in a 2d-coordinate system. Default is 0.0.
y : float, optional
The y-position in a 2d-coordinate system. Default is 0.0.
Attributes
----------
x : float
The x-position in a 2d-coordinate system.
y : float
The y-position in a 2d-coordinate system.
"""
__slots__ = ['x', 'y']
def __init__(self, x=0.0, y=0.0):
self.x = x
self.y = y
class Point3D(object):
"""
The 3d-point class.
The 3d-point class is a container for positions
in a 3d-coordinate system.
Parameters
----------
x : float, optional
The x-position in a 2d-coordinate system. Default is 0.0.
y : float, optional
The y-position in a 2d-coordinate system. Default is 0.0.
z : float, optional
The z-position in a 3d-coordinate system. Default is 0.0.
Attributes
----------
x : float
The x-position in a 2d-coordinate system.
y : float
The y-position in a 2d-coordinate system.
z : float
The z-position in a 3d-coordinate system.
"""
__slots__ = ['x', 'y', 'z']
def __init__(self, x=0.0, y=0.0, z=0.0):
self.x = x
self.y = y
self.z = z
class Vector3D(Point3D):
"""The 3d-vector class.
.. todo::
Implement vector functionality.
Parameters
----------
x : float, optional
The x-position in a 2d-coordinate system. Default is 0.0.
y : float, optional
The y-position in a 2d-coordinate system. Default is 0.0.
z : float, optional
The z-position in a 3d-coordinate system. Default is 0.0.
Attributes
----------
x : float
The x-position in a 2d-coordinate system.
y : float
The y-position in a 2d-coordinate system.
z : float
The z-position in a 3d-coordinate system.
"""
def __init__(self, x=0.0, y=0.0, z=0.0):
super(Vector3D, self).__init__(x, y, z)
class Queue(object):
"""The abstract queue base class.
The queue class handles core functionality common for
any type of queue. All queues inherit from the queue
base class.
See Also
--------
:class:`FIFOQueue`, :class:`PriorityQueue`
"""
__metaclass__ = ABCMeta
def __init__(self):
self._queue = []
def __len__(self):
return len(self._queue)
def __contains__(self, item):
try:
self._queue.index(item)
return True
except Exception:
return False
def __iter__(self):
return iter(self._queue)
def __str__(self):
return '[' + ', '.join('{}'.format(el) for el in self._queue) + ']'
def __repr__(self):
return ', '.join('{}'.format(el) for el in self._queue)
@abstractmethod
def push(self, item):
"""Push a new element on the queue
Parameters
----------
item :
The element to push on the queue
"""
raise NotImplementedError
@abstractmethod
def pop(self):
"""Pop an element from the queue."""
raise NotImplementedError
def empty(self):
"""Check if the queue is empty.
Returns
-------
bool :
Whether the queue is empty.
"""
return len(self._queue) <= 0
def extend(self, items):
"""Extend the queue by a number of elements.
Parameters
----------
items : list
A list of items.
"""
for item in items:
self.push(item)
def get(self, item):
"""Return the element in the queue identical to `item`.
Parameters
----------
item :
The element to search for.
Returns
-------
The element in the queue identical to `item`. If the element
was not found, None is returned.
"""
try:
index = self._queue.index(item)
return self._queue[index]
except Exception:
return None
def remove(self, item):
"""Remove an element from the queue.
Parameters
----------
item :
The element to remove.
"""
self._queue.remove(item)
class FIFOQueue(Queue):
"""The first-in-first-out (FIFO) queue.
In a FIFO queue the first element added to the queue
is the first element to be removed.
Examples
--------
>>> q = FIFOQueue()
>>> q.push(5)
>>> q.extend([1, 3, 7])
>>> print q
[5, 1, 3, 7]
Retrieving an element:
>>> q.pop()
5
Removing an element:
>>> q.remove(3)
>>> print q
[1, 7]
Get the element in the queue identical to the given item:
>>> q.get(7)
7
Check if the queue is empty:
>>> q.empty()
False
Loop over the elements in the queue:
>>> for x in q:
>>> print x
1
7
Check if an element is in the queue:
>>> if 7 in q:
>>> print "yes"
yes
See Also
--------
:class:`PriorityQueue`
"""
def __init__(self):
super(FIFOQueue, self).__init__()
def push(self, item):
"""Push an element to the end of the queue.
Parameters
----------
item :
The element to append.
"""
self._queue.append(item)
def pop(self):
"""Return the element at the front of the queue.
Returns
-------
The first element in the queue.
"""
return self._queue.pop(0)
def extend(self, items):
"""Append a list of elements at the end of the queue.
Parameters
----------
items : list
List of elements.
"""
self._queue.extend(items)
class PriorityQueue(Queue):
"""
The priority queue.
In a priority queue each element has a priority associated with it. An element
with high priority (i.e., smallest value) is served before an element with low priority
(i.e., largest value). The priority queue is implemented with a heap.
Parameters
----------
func : callable
A callback function handling the priority. By default the priority
is the value of the element.
Examples
--------
>>> q = PriorityQueue()
>>> q.push(5)
>>> q.extend([1, 3, 7])
>>> print q
[(1,1), (5,5), (3,3), (7,7)]
Retrieving the element with highest priority:
>>> q.pop()
1
Removing an element:
>>> q.remove((3, 3))
>>> print q
[(5,5), (7,7)]
Get the element in the queue identical to the given item:
>>> q.get(7)
7
Check if the queue is empty:
>>> q.empty()
False
Loop over the elements in the queue:
>>> for x in q:
>>> print x
(5, 5)
(7, 7)
Check if an element is in the queue:
>>> if 7 in q:
>>> print "yes"
yes
See Also
--------
:class:`FIFOQueue`
"""
def __init__(self, func=lambda x: x):
super(PriorityQueue, self).__init__()
self.func = func
def __contains__(self, item):
for _, element in self._queue:
if item == element:
return True
return False
def __str__(self):
return '[' + ', '.join('({},{})'.format(*el) for el in self._queue) + ']'
def push(self, item):
"""Push an element on the priority queue.
The element is pushed on the priority queue according
to its priority.
Parameters
----------
item :
The element to push on the queue.
"""
heapq.heappush(self._queue, (self.func(item), item))
def pop(self):
"""Get the element with the highest priority.
Get the element with the highest priority (i.e., smallest value).
Returns
-------
The element with the highest priority.
"""
return heapq.heappop(self._queue)[1]
def get(self, item):
"""Return the element in the queue identical to `item`.
Parameters
----------
item :
The element to search for.
Returns
-------
The element in the queue identical to `item`. If the element
was not found, None is returned.
"""
for _, element in self._queue:
if item == element:
return element
return None
def remove(self, item):
"""Remove an element from the queue.
Parameters
----------
item :
The element to remove.
"""
super(PriorityQueue, self).remove(item)
heapq.heapify(self._queue)
| evenmarbles/mlpy | mlpy/auxiliary/datastructs.py | Python | mit | 10,818 |
<?php
/**
* Created by PhpStorm.
* User: gseidel
* Date: 16.10.18
* Time: 23:45
*/
namespace Enhavo\Bundle\FormBundle\Form\Type;
use Enhavo\Bundle\FormBundle\Form\Helper\EntityTreeChoiceBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
class EntityTreeType extends AbstractType
{
public function buildView(FormView $view, FormInterface $form, array $options)
{
$choices = $view->vars['choices'];
$builder = new EntityTreeChoiceBuilder($options['parent_property']);
$builder->build($choices);
$view->vars['choice_tree_builder'] = $builder;
$view->vars['children_container_class'] = $options['children_container_class'];
}
public function finishView(FormView $view, FormInterface $form, array $options)
{
$builder = $view->vars['choice_tree_builder'];
if($builder instanceof EntityTreeChoiceBuilder) {
$builder->map($view);
}
if(!$options['expanded']) {
$view->vars['choices'] = $builder->getChoiceViews();
}
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'parent_property' => 'parent',
'children_container_class' => 'entity-tree-children',
]);
}
public function getBlockPrefix()
{
return 'entity_tree';
}
public function getParent()
{
return EntityType::class;
}
}
| npakai/enhavo | src/Enhavo/Bundle/FormBundle/Form/Type/EntityTreeType.php | PHP | mit | 1,622 |
// @flow
import React, { Component } from 'react'
import { Helmet } from 'react-helmet'
import AlternativeMedia from './AlternativeMedia'
import ImageViewer from './ImageViewer'
import { Code, CodeBlock, Title } from '../components'
const propFn = k => {
const style = { display: 'inline-block', marginBottom: 4, marginRight: 4 }
return (
<span key={k} style={style}>
<Code>{k}</Code>
</span>
)
}
const commonProps = [
'carouselProps',
'currentIndex',
'currentView',
'frameProps',
'getStyles',
'isFullscreen',
'isModal',
'modalProps',
'interactionIsIdle',
'trackProps',
'views',
]
export default class CustomComponents extends Component<*> {
render() {
return (
<div>
<Helmet>
<title>Components - React Images</title>
<meta
name="description"
content="React Images allows you to augment layout and functionality by
replacing the default components with your own."
/>
</Helmet>
<Title>Components</Title>
<p>
The main feature of this library is providing consumers with the building blocks necessary to create <em>their</em> component.
</p>
<h3>Replacing Components</h3>
<p>
React-Images allows you to augment layout and functionality by replacing the default components with your own, using the <Code>components</Code>{' '}
property. These components are given all the current props and state letting you achieve anything you dream up.
</p>
<h3>Inner Props</h3>
<p>
All functional properties that the component needs are provided in <Code>innerProps</Code> which you must spread.
</p>
<h3>Common Props</h3>
<p>
Every component receives <Code>commonProps</Code> which are spread onto the component. These include:
</p>
<p>{commonProps.map(propFn)}</p>
<CodeBlock>
{`import React from 'react';
import Carousel from 'react-images';
const CustomHeader = ({ innerProps, isModal }) => isModal ? (
<div {...innerProps}>
// your component internals
</div>
) : null;
class Component extends React.Component {
render() {
return <Carousel components={{ Header: CustomHeader }} />;
}
}`}
</CodeBlock>
<h2>Component API</h2>
<h3>{'<Container />'}</h3>
<p>Wrapper for the carousel. Attachment point for mouse and touch event listeners.</p>
<h3>{'<Footer />'}</h3>
<p>
Element displayed beneath the views. Renders <Code>FooterCaption</Code> and <Code>FooterCount</Code> by default.
</p>
<h3>{'<FooterCaption />'}</h3>
<p>
Text associated with the current view. Renders <Code>{'{viewData.caption}'}</Code> by default.
</p>
<h3>{'<FooterCount />'}</h3>
<p>
How far through the carousel the user is. Renders{' '}
<Code>
{'{currentIndex}'} of {'{totalViews}'}
</Code>{' '}
by default
</p>
<h3>{'<Header />'}</h3>
<p>
Element displayed above the views. Renders <Code>FullscreenButton</Code> and <Code>CloseButton</Code> by default.
</p>
<h3>{'<HeaderClose />'}</h3>
<p>
The button to close the modal. Accepts the <Code>onClose</Code> function.
</p>
<h3>{'<HeaderFullscreen />'}</h3>
<p>
The button to fullscreen the modal. Accepts the <Code>toggleFullscreen</Code> function.
</p>
<h3>{'<Navigation />'}</h3>
<p>
Wrapper for the <Code>{'<NavigationNext />'}</Code> and <Code>{'<NavigationPrev />'}</Code> buttons.
</p>
<h3>{'<NavigationPrev />'}</h3>
<p>
Button allowing the user to navigate to the previous view. Accepts an <Code>onClick</Code> function.
</p>
<h3>{'<NavigationNext />'}</h3>
<p>
Button allowing the user to navigate to the next view. Accepts an <Code>onClick</Code> function.
</p>
<h3>{'<View />'}</h3>
<p>
The view component renders your media to the user. Receives the current view object as the <Code>data</Code> property.
</p>
<h2>Examples</h2>
<ImageViewer {...this.props} />
<AlternativeMedia />
</div>
)
}
}
| jossmac/react-images | docs/pages/CustomComponents/index.js | JavaScript | mit | 4,414 |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
namespace LibGit2Sharp.Core
{
/// <summary>
/// Ensure input parameters
/// </summary>
[DebuggerStepThrough]
internal static class Ensure
{
/// <summary>
/// Checks an argument to ensure it isn't null.
/// </summary>
/// <param name="argumentValue">The argument value to check.</param>
/// <param name="argumentName">The name of the argument.</param>
public static void ArgumentNotNull(object argumentValue, string argumentName)
{
if (argumentValue == null)
{
throw new ArgumentNullException(argumentName);
}
}
/// <summary>
/// Checks an array argument to ensure it isn't null or empty.
/// </summary>
/// <param name="argumentValue">The argument value to check.</param>
/// <param name="argumentName">The name of the argument.</param>
public static void ArgumentNotNullOrEmptyEnumerable<T>(IEnumerable<T> argumentValue, string argumentName)
{
ArgumentNotNull(argumentValue, argumentName);
if (!argumentValue.Any())
{
throw new ArgumentException("Enumerable cannot be empty", argumentName);
}
}
/// <summary>
/// Checks a string argument to ensure it isn't null or empty.
/// </summary>
/// <param name="argumentValue">The argument value to check.</param>
/// <param name="argumentName">The name of the argument.</param>
public static void ArgumentNotNullOrEmptyString(string argumentValue, string argumentName)
{
ArgumentNotNull(argumentValue, argumentName);
if (String.IsNullOrWhiteSpace (argumentValue))
{
throw new ArgumentException("String cannot be empty", argumentName);
}
}
/// <summary>
/// Checks a string argument to ensure it doesn't contain a zero byte.
/// </summary>
/// <param name="argumentValue">The argument value to check.</param>
/// <param name="argumentName">The name of the argument.</param>
public static void ArgumentDoesNotContainZeroByte(string argumentValue, string argumentName)
{
if (string.IsNullOrEmpty(argumentValue))
{
return;
}
int zeroPos = -1;
for (var i = 0; i < argumentValue.Length; i++)
{
if (argumentValue[i] == '\0')
{
zeroPos = i;
break;
}
}
if (zeroPos == -1)
{
return;
}
throw new ArgumentException(
string.Format(CultureInfo.InvariantCulture,
"Zero bytes ('\\0') are not allowed. A zero byte has been found at position {0}.", zeroPos), argumentName);
}
private static readonly Dictionary<GitErrorCode, Func<string, GitErrorCode, GitErrorCategory, LibGit2SharpException>>
GitErrorsToLibGit2SharpExceptions =
new Dictionary<GitErrorCode, Func<string, GitErrorCode, GitErrorCategory, LibGit2SharpException>>
{
{ GitErrorCode.User, (m, r, c) => new UserCancelledException(m, r, c) },
{ GitErrorCode.BareRepo, (m, r, c) => new BareRepositoryException(m, r, c) },
{ GitErrorCode.Exists, (m, r, c) => new NameConflictException(m, r, c) },
{ GitErrorCode.InvalidSpecification, (m, r, c) => new InvalidSpecificationException(m, r, c) },
{ GitErrorCode.UnmergedEntries, (m, r, c) => new UnmergedIndexEntriesException(m, r, c) },
{ GitErrorCode.NonFastForward, (m, r, c) => new NonFastForwardException(m, r, c) },
{ GitErrorCode.MergeConflict, (m, r, c) => new MergeConflictException(m, r, c) },
{ GitErrorCode.LockedFile, (m, r, c) => new LockedFileException(m, r, c) },
{ GitErrorCode.NotFound, (m, r, c) => new NotFoundException(m, r, c) },
{ GitErrorCode.Peel, (m, r, c) => new PeelException(m, r, c) },
};
private static void HandleError(int result)
{
string errorMessage;
GitError error = NativeMethods.giterr_last().MarshalAsGitError();
if (error == null)
{
error = new GitError { Category = GitErrorCategory.Unknown, Message = IntPtr.Zero };
errorMessage = "No error message has been provided by the native library";
}
else
{
errorMessage = LaxUtf8Marshaler.FromNative(error.Message);
}
Func<string, GitErrorCode, GitErrorCategory, LibGit2SharpException> exceptionBuilder;
if (!GitErrorsToLibGit2SharpExceptions.TryGetValue((GitErrorCode)result, out exceptionBuilder))
{
exceptionBuilder = (m, r, c) => new LibGit2SharpException(m, r, c);
}
throw exceptionBuilder(errorMessage, (GitErrorCode)result, error.Category);
}
/// <summary>
/// Check that the result of a C call was successful
/// <para>
/// The native function is expected to return strictly 0 for
/// success or a negative value in the case of failure.
/// </para>
/// </summary>
/// <param name="result">The result to examine.</param>
public static void ZeroResult(int result)
{
if (result == (int)GitErrorCode.Ok)
{
return;
}
HandleError(result);
}
/// <summary>
/// Check that the result of a C call returns a boolean value.
/// <para>
/// The native function is expected to return strictly 0 or 1.
/// </para>
/// </summary>
/// <param name="result">The result to examine.</param>
public static void BooleanResult(int result)
{
if (result == 0 || result == 1)
{
return;
}
HandleError(result);
}
/// <summary>
/// Check that the result of a C call that returns an integer
/// value was successful.
/// <para>
/// The native function is expected to return 0 or a positive
/// value for success or a negative value in the case of failure.
/// </para>
/// </summary>
/// <param name="result">The result to examine.</param>
public static void Int32Result(int result)
{
if (result >= (int)GitErrorCode.Ok)
{
return;
}
HandleError(result);
}
/// <summary>
/// Checks an argument by applying provided checker.
/// </summary>
/// <param name="argumentValue">The argument value to check.</param>
/// <param name="checker">The predicate which has to be satisfied</param>
/// <param name="argumentName">The name of the argument.</param>
public static void ArgumentConformsTo<T>(T argumentValue, Func<T, bool> checker, string argumentName)
{
if (checker(argumentValue))
{
return;
}
throw new ArgumentException(argumentName);
}
/// <summary>
/// Checks an argument is a positive integer.
/// </summary>
/// <param name="argumentValue">The argument value to check.</param>
/// <param name="argumentName">The name of the argument.</param>
public static void ArgumentPositiveInt32(long argumentValue, string argumentName)
{
if (argumentValue >= 0 && argumentValue <= uint.MaxValue)
{
return;
}
throw new ArgumentException(argumentName);
}
/// <summary>
/// Check that the result of a C call that returns a non-null GitObject
/// using the default exception builder.
/// <para>
/// The native function is expected to return a valid object value.
/// </para>
/// </summary>
/// <param name="gitObject">The <see cref="GitObject"/> to examine.</param>
/// <param name="identifier">The <see cref="GitObject"/> identifier to examine.</param>
public static void GitObjectIsNotNull(GitObject gitObject, string identifier)
{
Func<string, LibGit2SharpException> exceptionBuilder;
if (string.Equals("HEAD", identifier, StringComparison.Ordinal))
{
exceptionBuilder = m => new UnbornBranchException(m);
}
else
{
exceptionBuilder = m => new NotFoundException(m);
}
GitObjectIsNotNull(gitObject, identifier, exceptionBuilder);
}
/// <summary>
/// Check that the result of a C call that returns a non-null GitObject
/// using the default exception builder.
/// <para>
/// The native function is expected to return a valid object value.
/// </para>
/// </summary>
/// <param name="gitObject">The <see cref="GitObject"/> to examine.</param>
/// <param name="identifier">The <see cref="GitObject"/> identifier to examine.</param>
/// <param name="exceptionBuilder">The builder which constructs an <see cref="LibGit2SharpException"/> from a message.</param>
public static void GitObjectIsNotNull(
GitObject gitObject,
string identifier,
Func<string, LibGit2SharpException> exceptionBuilder)
{
if (gitObject != null)
{
return;
}
throw exceptionBuilder(string.Format(CultureInfo.InvariantCulture,
"No valid git object identified by '{0}' exists in the repository.",
identifier));
}
}
}
| GeertvanHorrik/libgit2sharp | LibGit2Sharp/Core/Ensure.cs | C# | mit | 10,346 |
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Graphics;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModPerfect : ModSuddenDeath
{
public override string Name => "Perfect";
public override string Acronym => "PF";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_perfect;
public override string Description => "SS or quit.";
protected override bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Accuracy.Value != 1;
}
}
| naoey/osu | osu.Game/Rulesets/Mods/ModPerfect.cs | C# | mit | 664 |
var gulp = require('gulp');
var browserify = require('browserify');
//transform jsx to js
var reactify = require('reactify');
//convert to stream
var source = require('vinyl-source-stream');
var nodemon = require('gulp-nodemon');
gulp.task('browserify', function() {
//source
browserify('./src/js/main.js')
//convert jsx to js
.transform('reactify')
//creates a bundle
.bundle()
.pipe(source('main.js'))
.pipe(gulp.dest('dist/js'))
});
gulp.task('copy', function() {
gulp.src('src/index.html')
.pipe(gulp.dest('dist'));
gulp.src('src/assets/**/*.*')
.pipe(gulp.dest('dist/assets'));
});
gulp.task('nodemon', function(cb) {
var called = false;
return nodemon({
script: 'server.js'
}).on('start', function() {
if (!called) {
called = true;
cb();
}
});
});
gulp.task('default', ['browserify', 'copy', 'nodemon'], function() {
return gulp.watch('src/**/*.*', ['browserify', 'copy']);
});
| felixcriv/react_scheduler_component | gulpfile.js | JavaScript | mit | 1,039 |
<?php
namespace TodoListBundle\Repository;
use TodoListBundle\Entity\Todo;
use TodoListBundle\Google\Client;
use Google_Service_Tasks;
use Google_Service_Tasks_Task;
class GTaskApiTodoRepository implements ITodoRepository
{
/**
* @var Google_Service_Tasks
*/
private $taskService;
private $todoRepository;
private function convertTask2Todo(Google_Service_Tasks_Task $task) {
$todo = new Todo();
$todo->setId($task->getId());
$todo->setDescription($task->getTitle());
$todo->setDone($task->getStatus() === 'completed');
$todo->setList($this->todoRepository->getById('@default'));
return $todo;
}
private function convertTodo2Task(Todo $todo) {
$task = new Google_Service_Tasks_Task();
$task->setKind('tasks#task');
$date = new \DateTime();
$date->format(\DateTime::RFC3339);
if ($todo->getId() == null) {
$task->setId($todo->getId());
}
$task->setTitle($todo->getDescription());
$task->setDue($date);
$task->setNotes($todo->getDescription());
$task->setDeleted(false);
$task->setHidden(false);
$task->setParent('@default');
$task->setUpdated($date);
$task->setStatus($todo->getDone() ? 'completed' : 'needsAction');
$task->setCompleted($date);
return $task;
}
public function __construct(Client $googleClient, ITodoListRepository $todoListRepository, $tokenStorage)
{
$googleClient->setAccessToken(json_decode($tokenStorage->getToken()->getUser(), true));
$this->taskService = $googleClient->getTaskService();
$this->todoRepository = $todoListRepository;
}
/**
* Gives all entities.
*/
public function findAll($offset = 0, $limit = null) {
$tasks = $this->taskService->tasks->listTasks('@default');
$result = [];
foreach ($tasks as $task) {
$result[] = $this->convertTask2Todo($task);
}
return $result;
}
/**
* Gives entity corresponding to the given identifier if it exists
* and null otherwise.
*
* @param $id int
*/
public function getById($id, $taskListId = null) {
$task = $this->taskService->tasks->get($taskListId, $id);
return $this->convertTask2Todo($task);
}
/**
* Save or update an entity.
*
* @param $entity
*/
public function persist($entity) {
$task = $this->convertTodo2Task($entity);
if ($entity->getId() == null) {
$task = $this->taskService->tasks->insert($task->getParent(), $task);
$entity->setId($task->getId());
} else {
$this->taskService->tasks->update($task->getParent(), $task->getId(), $task);
}
}
/**
* Delete the given entity.
*
* @param $entity
*/
public function delete($entity) {
$this->taskService->tasks->delete($entity->getList()->getId(), $entity->getId());
}
} | Green92/gcTodoList | src/TodoListBundle/Repository/GTaskApiTodoRepository.php | PHP | mit | 2,671 |
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
// **NOTE** This file was generated by a tool and any changes will be overwritten.
// Template Source: Templates\CSharp\Requests\MethodRequestBuilder.cs.tt
namespace Microsoft.Graph
{
using System;
using System.Collections.Generic;
using System.IO;
/// <summary>
/// The type WorkbookFunctionsNetworkDaysRequestBuilder.
/// </summary>
public partial class WorkbookFunctionsNetworkDaysRequestBuilder : BaseActionMethodRequestBuilder<IWorkbookFunctionsNetworkDaysRequest>, IWorkbookFunctionsNetworkDaysRequestBuilder
{
/// <summary>
/// Constructs a new <see cref="WorkbookFunctionsNetworkDaysRequestBuilder"/>.
/// </summary>
/// <param name="requestUrl">The URL for the request.</param>
/// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param>
/// <param name="startDate">A startDate parameter for the OData method call.</param>
/// <param name="endDate">A endDate parameter for the OData method call.</param>
/// <param name="holidays">A holidays parameter for the OData method call.</param>
public WorkbookFunctionsNetworkDaysRequestBuilder(
string requestUrl,
IBaseClient client,
Newtonsoft.Json.Linq.JToken startDate,
Newtonsoft.Json.Linq.JToken endDate,
Newtonsoft.Json.Linq.JToken holidays)
: base(requestUrl, client)
{
this.SetParameter("startDate", startDate, true);
this.SetParameter("endDate", endDate, true);
this.SetParameter("holidays", holidays, true);
}
/// <summary>
/// A method used by the base class to construct a request class instance.
/// </summary>
/// <param name="functionUrl">The request URL to </param>
/// <param name="options">The query and header options for the request.</param>
/// <returns>An instance of a specific request class.</returns>
protected override IWorkbookFunctionsNetworkDaysRequest CreateRequest(string functionUrl, IEnumerable<Option> options)
{
var request = new WorkbookFunctionsNetworkDaysRequest(functionUrl, this.Client, options);
if (this.HasParameter("startDate"))
{
request.RequestBody.StartDate = this.GetParameter<Newtonsoft.Json.Linq.JToken>("startDate");
}
if (this.HasParameter("endDate"))
{
request.RequestBody.EndDate = this.GetParameter<Newtonsoft.Json.Linq.JToken>("endDate");
}
if (this.HasParameter("holidays"))
{
request.RequestBody.Holidays = this.GetParameter<Newtonsoft.Json.Linq.JToken>("holidays");
}
return request;
}
}
}
| ginach/msgraph-sdk-dotnet | src/Microsoft.Graph/Requests/Generated/WorkbookFunctionsNetworkDaysRequestBuilder.cs | C# | mit | 3,138 |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Tell the browser to be responsive to screen width -->
<title>SI Administrasi Desa</title>
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="<?=base_url()?>assets/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
<!-- DataTables -->
<link rel="stylesheet" href="<?=base_url()?>assets/plugins/datatables/dataTables.bootstrap.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.2.2/css/buttons.dataTables.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="<?=base_url()?>assets/dist/css/AdminLTE.min.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="<?=base_url()?>assets/dist/css/skins/_all-skins.min.css">
<!-- Select2 -->
<link rel="stylesheet" href="<?=base_url()?>assets/plugins/select2/select2.min.css">
<!-- simple line icon -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.css">
<link rel="manifest" href="<?=base_url()?>assets/manifest.json">
<!-- jQuery 2.2.0 -->
<script src="<?=base_url()?>assets/plugins/jQuery/jQuery-2.2.0.min.js"></script>
<!-- DataTables -->
<script src="<?=base_url()?>assets/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="<?=base_url()?>assets/plugins/datatables/dataTables.bootstrap.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="hold-transition skin-red sidebar-mini">
<div class="wrapper">
<header class="main-header">
<!-- Logo -->
<a href="<?=site_url('dashboard')?>" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>SI</b></span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg"><b>SI</b>ADMINISTRASI</span>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top">
<!-- Sidebar toggle button-->
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">Toggle navigation</span>
</a>
</nav>
</header>
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<!-- Sidebar user panel -->
<div class="user-panel">
<div class="pull-left image">
<img class="img-circle" src="<?=base_url()?>assets/dist/img/no-image-user.jpg" alt="User profile picture">
</div>
<div class="pull-left info">
<input name='id' id='id' value='".$id."' type='hidden'>
<p><a href="#">User</a></p>
<a><i class="fa fa-circle text-success"></i> Online</a>
</div>
</div>
<!-- sidebar menu: : style can be found in sidebar.less -->
<ul class="sidebar-menu">
<li class="header"> MENU</li>
<li id="home"><a href="<?=site_url('dashboard')?>"><i class="fa fa-home"></i> <span> Home</span></a></li>
<li id="data_penduduk" class="treeview">
<a href="#">
<i class="fa icon-wallet"></i> <span> Data Penduduk</span> <i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li id="penduduk"><a href="<?=site_url('penduduk')?>"><i class="fa icon-arrow-right"></i> Data Penduduk</a></li>
<li id="kelahiran"><a href="<?=site_url('kelahiran')?>"><i class="fa icon-arrow-right"></i> Data Kelahiran</a></li>
<li id="pendatang"><a href="<?=site_url('pendatang')?>"><i class="fa icon-arrow-right"></i> Data Pendatang</a></li>
<li id="kematian"><a href="<?=site_url('kematian')?>"><i class="fa icon-arrow-right"></i> Data Penduduk Meninggal</a></li>
<li id="pindah"><a href="<?=site_url('pindah')?>"><i class="fa icon-arrow-right"></i> Data Penduduk Pindah</a></li>
</ul>
</li>
<li id="surat" class="treeview">
<a href="#">
<i class="fa icon-wallet"></i> <span> Surat</span> <i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li id="surat_kelahiran"><a href="<?=site_url('surat_kelahiran')?>"><i class="fa icon-arrow-right"></i> SK Kelahiran</a></li>
<li id="surat_pendatang"><a href="#"><i class="fa icon-arrow-right"></i> SK Pendatang</a></li>
<li id="surat_kematian"><a href="#"><i class="fa icon-arrow-right"></i> SK Kematian</a></li>
<li id="surat_pindah"><a href="#"><i class="fa icon-arrow-right"></i> SK Pindah</a></li>
<li id="surat_kelakuan_baik"><a href="#"><i class="fa icon-arrow-right"></i> SK Kelakuan Baik</a></li>
<li id="surat_usaha"><a href="#"><i class="fa icon-arrow-right"></i> SK Usaha</a></li>
<li id="surat_tidak_mampu"><a href="#"><i class="fa icon-arrow-right"></i> SK Tidak Mampu</a></li>
<li id="surat_belum_kawin"><a href="#"><i class="fa icon-arrow-right"></i> SK Belum Pernah Kawin</a></li>
<li id="surat_perkawinan_hindu"><a href="#"><i class="fa icon-arrow-right"></i> SK Perkawinan Umat Hindu</a></li>
<li id="surat_permohonan_ktp"><a href="#"><i class="fa icon-arrow-right"></i> SK Permohonan KTP</a></li>
</ul>
</li>
<li id="potensi"><a href="#"><i class="fa icon-basket"></i> <span> Potensi Daerah</span></a></li>
<li class="header"> LOGOUT</li>
<li><a onclick="return confirm('Pilih OK untuk melanjutkan.')" href="<?=site_url('login/logout')?>"><i class="fa fa-power-off text-red"></i> <span> Logout</span></a></li>
</ul>
</section>
<!-- /.sidebar -->
</aside>
<?=$body?>
<!-- /.content-wrapper -->
<footer class="main-footer">
<div class="pull-right hidden-xs">
<b>Version</b> 1.0.0
</div>
<strong>Copyright © 2017 <a href="#">SI Administrasi Desa</a>.</strong> All rights
reserved.
</footer>
<!-- /.control-sidebar -->
<!-- Add the sidebar's background. This div must be placed
immediately after the control sidebar -->
<div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->
<!-- Bootstrap 3.3.6 -->
<script src="<?=base_url()?>assets/bootstrap/js/bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="<?=base_url()?>assets/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="<?=base_url()?>assets/plugins/fastclick/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="<?=base_url()?>assets/dist/js/app.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?=base_url()?>assets/dist/js/demo.js"></script>
<!-- bootstrap datepicker -->
<script src="<?=base_url()?>assets/plugins/datepicker/bootstrap-datepicker.js"></script>
<!-- Select2 -->
<script src="<?=base_url()?>assets/plugins/select2/select2.full.min.js"></script>
<!-- excel -->
<script src="https://rawgithub.com/eligrey/FileSaver.js/master/FileSaver.js" type="text/javascript"></script>
<script>
function export() {
var blob = new Blob([document.getElementById('exportable').innerHTML], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
});
saveAs(blob, "report.xls");
}
</script>
<!-- page script -->
<script src="https://cdn.datatables.net/buttons/1.2.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
<script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"></script>
<script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.html5.min.js"></script>
<script>
$(document).ready(function() {
//Initialize Select2 Elements
$(".select2").select2();
$('#example2').DataTable( {
"paging": false,
"lengthChange": true,
"searching": false,
"ordering": true,
"scrollX": true,
dom: 'Bfrtip',
buttons: [
'copyHtml5',
'excelHtml5',
'csvHtml5',
'pdfHtml5'
]
});
$('#example1').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": false
});
//Date picker
$('#datepicker').datepicker({
autoclose: true,
format: 'dd-mm-yyyy'
});
$('#kedatangan_datepicker').datepicker({
autoclose: true,
format: 'dd-mm-yyyy'
});
$('#datepicker2').datepicker({
autoclose: true,
format: 'dd-mm-yyyy'
});
} );
</script>
</body>
</body>
</html> | swantara/si-administrasi-kependudukan | application/views/template.php | PHP | mit | 9,733 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Resources;
using System.Security;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("mko")]
[assembly: AssemblyDescription("mko: Klassen zur Organisiation von Fehler- und Statusmeldungen (LogServer). Diverse Hilfsklassen für Debugging und Serialisierung;")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("www.mkoit.de")]
[assembly: AssemblyProduct("mko")]
[assembly: AssemblyCopyright("Copyright © Martin Korneffel, Stuttgart 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("04255517-3840-4f51-a09b-a41c68fe2f0d")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Revisions- und Buildnummern
// übernehmen, indem Sie "*" eingeben:
[assembly: AssemblyVersion("7.4.1.0")]
[assembly: AssemblyFileVersion("7.4.1.0")]
[assembly: NeutralResourcesLanguageAttribute("de-DE")]
[assembly: AllowPartiallyTrustedCallers]
| mk-prg-net/mk-prg-net.lib | mko/Properties/AssemblyInfo.cs | C# | mit | 1,762 |
/**
* @namespace http
*
* The C<http> namespace groups functions and classes used while making
* HTTP Requests.
*
*/
ECMAScript.Extend('http', function (ecma) {
// Intentionally private
var _documentLocation = null
function _getDocumentLocation () {
if (!_documentLocation) _documentLocation = new ecma.http.Location();
return _documentLocation;
}
/**
* @constant HTTP_STATUS_NAMES
* HTTP/1.1 Status Code Definitions
*
* Taken from, RFC 2616 Section 10:
* L<http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>
*
* These names are used in conjuction with L<ecma.http.Request> for
* indicating callback functions. The name is prepended with C<on> such
* that
* onMethodNotAllowed
* corresponds to the callback triggered when a 405 status is received.
*
# Names
*
* 100 Continue
* 101 SwitchingProtocols
* 200 Ok
* 201 Created
* 202 Accepted
* 203 NonAuthoritativeInformation
* 204 NoContent
* 205 ResetContent
* 206 PartialContent
* 300 MultipleChoices
* 301 MovedPermanently
* 302 Found
* 303 SeeOther
* 304 NotModified
* 305 UseProxy
* 306 Unused
* 307 TemporaryRedirect
* 400 BadRequest
* 401 Unauthorized
* 402 PaymentRequired
* 403 Forbidden
* 404 NotFound
* 405 MethodNotAllowed
* 406 NotAcceptable
* 407 ProxyAuthenticationRequired
* 408 RequestTimeout
* 409 Conflict
* 410 Gone
* 411 LengthRequired
* 412 PreconditionFailed
* 413 RequestEntityTooLarge
* 414 RequestURITooLong
* 415 UnsupportedMediaType
* 416 RequestedRangeNotSatisfiable
* 417 ExpectationFailed
* 500 InternalServerError
* 501 NotImplemented
* 502 BadGateway
* 503 ServiceUnavailable
* 504 GatewayTimeout
* 505 HTTPVersionNotSupported
*/
this.HTTP_STATUS_NAMES = {
100: 'Continue',
101: 'SwitchingProtocols',
200: 'Ok',
201: 'Created',
202: 'Accepted',
203: 'NonAuthoritativeInformation',
204: 'NoContent',
205: 'ResetContent',
206: 'PartialContent',
300: 'MultipleChoices',
301: 'MovedPermanently',
302: 'Found',
303: 'SeeOther',
304: 'NotModified',
305: 'UseProxy',
306: 'Unused',
307: 'TemporaryRedirect',
400: 'BadRequest',
401: 'Unauthorized',
402: 'PaymentRequired',
403: 'Forbidden',
404: 'NotFound',
405: 'MethodNotAllowed',
406: 'NotAcceptable',
407: 'ProxyAuthenticationRequired',
408: 'RequestTimeout',
409: 'Conflict',
410: 'Gone',
411: 'LengthRequired',
412: 'PreconditionFailed',
413: 'RequestEntityTooLarge',
414: 'RequestURITooLong',
415: 'UnsupportedMediaType',
416: 'RequestedRangeNotSatisfiable',
417: 'ExpectationFailed',
500: 'InternalServerError',
501: 'NotImplemented',
502: 'BadGateway',
503: 'ServiceUnavailable',
504: 'GatewayTimeout',
505: 'HTTPVersionNotSupported'
};
/**
* @function isSameOrigin
*
* Compare originating servers.
*
* var bool = ecma.http.isSameOrigin(uri);
* var bool = ecma.http.isSameOrigin(uri, uri);
*
* Is the resource located on the server at the port using the same protocol
* which served the document.
*
* var bool = ecma.http.isSameOrigin('http://www.example.com');
*
* Are the two URI's served from the same origin
*
* var bool = ecma.http.isSameOrigin('http://www.example.com', 'https://www.example.com');
*
*/
this.isSameOrigin = function(uri1, uri2) {
if (!(uri1)) return false;
var loc1 = uri1 instanceof ecma.http.Location
? uri1 : new ecma.http.Location(uri1);
var loc2 = uri2 || _getDocumentLocation();
return loc1.isSameOrigin(loc2);
};
});
| ryangies/lsn-javascript | src/lib/ecma/http/http.js | JavaScript | mit | 3,860 |
<?php
namespace Anax\Questions;
/**
* A controller for question-related pages
*
*/
class QuestionsController implements \Anax\DI\IInjectionAware
{
use \Anax\DI\TInjectable;
public function initialize()
{
$this->questions = new \Anax\Questions\Question();
$this->questions->setDI($this->di);
$this->textFilter = new \Anax\Utils\CTextFilter();
$this->comments = new \Anax\Questions\Comments();
$this->comments->setDI($this->di);
}
public function listAction($tagId = null)
{
$all = $this->questions->getQuestionsWithAuthor($tagId);
$title = ($tagId) ? $this->questions->getTagName($tagId) : "Senaste frågorna";
foreach ($all as $q) {
$q->tags = $this->questions->getTagsForQuestion($q->ID);
}
$this->theme->setTitle("List all questions");
$this->views->add('question/list', [
'questions' => $all,
'title' => $title
]);
$this->views->add('question/list-sidebar', [], 'sidebar');
}
public function viewAction($id = null) {
$question = $this->questions->findQuestionWithAuthor($id);
$qComments = $this->comments->getCommentsForQuestion($id);
$tags = $this->questions->getTagsForQuestion($id);
$answers = $this->questions->getAnswersForQuestions($id);
foreach ($qComments as $c) {
$c->content = $this->textFilter->doFilter($c->content, 'markdown');
}
foreach($answers AS $a) {
$a->comments = $this->comments->getCommentsForAnswer($a->ID);
$a->content = $this->textFilter->doFilter($a->content, 'markdown');
foreach ($a->comments as $c) {
$c->content = $this->textFilter->doFilter($c->content, 'markdown');
}
}
$question->content = $this->textFilter->doFilter($question->content, 'markdown');
$this->theme->setTitle("Fråga");
$this->views->add('question/view', [
'question' => $question,
'questionComments' => $qComments,
"tags" => $tags,
'answers' => $answers,
]);
}
public function newAction() {
$tags = $this->questions->getTags();
$this->theme->setTitle("Skapa ny fråga");
$this->views->add('question/create', ["tags" => $tags], 'main');
$this->views->add('question/create-sidebar', [], 'sidebar');
}
public function createAction() {
$tags = array();
$dbTagCount = $this->questions->getTagCount();
for ($i=1; $i <= $dbTagCount; $i++) {
$tag = $this->request->getPost('tag'.$i);
if($tag) {
$tags[] = $i;
}
}
$question = array(
"title" => $this->request->getPost('title'),
"content" => $this->request->getPost('content'),
"author" => $this->session->get("user")->id
);
if($this->questions->createQuestion($question, $tags)) {
$url = $this->url->create('questions/list');
$this->response->redirect($url);
} else {
die("Ett fel uppstod. Var god försök att lägga till din fråga igen!");
}
}
public function tagsAction() {
$tags = $this->questions->getTags();
$this->theme->setTitle("Taggar");
$this->views->add('question/tags', ["tags" => $tags]);
}
public function answerAction() {
$answer = array();
$answer["author"] = $this->session->get("user")->id;
$answer["content"] = $this->request->getPost('content');
$answer["question"] = $this->request->getPost('questionId');
$this->questions->createAnswer($answer);
$url = $this->url->create('questions/view/'.$answer["question"]);
$this->response->redirect($url);
}
public function commentAction() {
$type = addslashes($this->request->getPost('type'));
$id = $this->request->getPost('ID');
$question = $type == 'question' ? $id : 0;
$answer = ($type == 'answer') ? $id : 0;
$author = $this->session->get('user')->id;
$now = date("Y-m-d H:i:s");
$comment = array(
"content" => addslashes($this->request->getPost('content')),
"question" => $question,
"answer" => $answer,
"author" => $author,
"created" => $now
);
$this->comments->create($comment);
$questionId = $this->request->getPost('questionId');
$url = $this->url->create('questions/view/'.$questionId);
$this->response->redirect($url);
}
}
?> | sebastianjonasson/phpmvcprojekt | app/src/Question/QuestionsController.php | PHP | mit | 4,081 |
# Uncomment this if you reference any of your controllers in activate
# require_dependency 'application'
class ReservationExtension < Radiant::Extension
version "0.1"
description "Small Reservation System"
url "http://github.com/simerom/radiant-reservation-extension"
define_routes do |map|
map.namespace :admin, :member => { :remove => :get } do |admin|
admin.resources :reservations, :reservation_items, :reservation_subscribers
end
end
def activate
admin.tabs.add "Reservations", "/admin/reservations", :after => "Layouts", :visibility => [:all]
end
def deactivate
admin.tabs.remove "Reservations"
end
end
| raskhadafi/radiant-reservation-extension | reservation_extension.rb | Ruby | mit | 662 |
<?php
/**
* Routes - all standard routes are defined here.
*/
/** Create alias for Router. */
use Core\Router;
use Helpers\Hooks;
/* Force user to login unless running cron */
if(!isset($_SESSION['user']) && $_SERVER['REDIRECT_URL'] != "/reminders/run") {
$c = new Controllers\Users();
$c->login();
exit();
}
/** Define routes. */
// Router::any('', 'Controllers\FoodProducts@index');
Router::any('', function() {
header("Location: /food-products");
exit();
});
Router::any('food-products', 'Controllers\FoodProducts@index');
Router::any('food-products/add', 'Controllers\FoodProducts@addProduct');
Router::any('food-products/delete', 'Controllers\FoodProducts@deleteProduct');
Router::any('food-products/view', 'Controllers\FoodProducts@viewProduct');
Router::any('food-products/edit', 'Controllers\FoodProducts@editProduct');
Router::any('food-products/addIngredient', 'Controllers\FoodProducts@addIngredient');
Router::any('food-products/editIngredient', 'Controllers\FoodProducts@editIngredient');
Router::any('food-products/deleteIngredient', 'Controllers\FoodProducts@deleteIngredient');
Router::any('employees', 'Controllers\Employees@index');
Router::any('employees/view', 'Controllers\Employees@view');
Router::any('employees/add', 'Controllers\Employees@add');
Router::any('employees/add-new-start', 'Controllers\Employees@addNewStart');
Router::any('employees/edit', 'Controllers\Employees@edit');
Router::any('employees/delete', 'Controllers\Employees@delete');
Router::any('employees/qualification/edit', 'Controllers\Employees@editQualification');
Router::any('employees/qualification/add', 'Controllers\Employees@addQualification');
Router::any('employees/qualification/delete','Controllers\Employees@deleteQualification');
Router::any('employees/new-start-item/complete','Controllers\Employees@markNewStartComplete');
Router::any('employees/new-start-item/incomplete','Controllers\Employees@markNewStartIncomplete');
Router::any('employees/new-start-item/delete','Controllers\Employees@deleteNewStart');
Router::any('employees/new-start-item/edit','Controllers\Employees@editNewStart');
Router::any('health-and-safety','Controllers\HealthSafety@index');
Router::any('health-and-safety/add','Controllers\HealthSafety@add');
Router::any('health-and-safety/edit','Controllers\HealthSafety@edit');
Router::any('health-and-safety/delete','Controllers\HealthSafety@delete');
Router::any('health-and-safety/viewdocs','Controllers\HealthSafety@viewdocs');
Router::any('health-and-safety/uploadDocument','Controllers\HealthSafety@uploadDocument');
Router::any('health-and-safety/deleteDocument','Controllers\HealthSafety@deleteDocument');
Router::any('operating-procedures','Controllers\OperatingProcedures@index');
Router::any('operating-procedures/edit','Controllers\OperatingProcedures@edit');
Router::any('operating-procedures/view','Controllers\OperatingProcedures@view');
Router::any('operating-procedures/add','Controllers\OperatingProcedures@add');
Router::any('operating-procedures/delete','Controllers\OperatingProcedures@delete');
Router::any('operating-procedures/print','Controllers\OperatingProcedures@print_pdf');
Router::any('operating-procedures/email','Controllers\OperatingProcedures@email');
Router::any('monitor','Controllers\Monitor@index');
Router::any('reminders/run', 'Controllers\Reminders@reminders');
Router::any('/health-and-safety/categories/manage', 'Controllers\HealthSafety@manageCategories');
Router::any('/health-and-safety/categories/add', 'Controllers\HealthSafety@addCategory');
Router::any('/health-and-safety/categories/delete', 'Controllers\HealthSafety@deleteCategory');
Router::any('/health-and-safety/categories/edit', 'Controllers\HealthSafety@editCategory');
Router::any('/users', 'Controllers\Users@index');
Router::any('/users/add', 'Controllers\Users@add');
Router::any('/users/edit', 'Controllers\Users@edit');
Router::any('/users/delete', 'Controllers\Users@delete');
Router::any('/users/delete', 'Controllers\Users@delete');
Router::any('/users/logout', 'Controllers\Users@logout');
/** Module routes. */
$hooks = Hooks::get();
$hooks->run('routes');
/** If no route found. */
Router::error('Core\Error@index');
/** Turn on old style routing. */
Router::$fallback = false;
/** Execute matched routes. */
Router::dispatch();
| tsnudden/afsc | app/Core/routes.php | PHP | mit | 4,351 |
// Copyright Johannes Falk
// example for directed percolation
// one can choose the probability in the main
// critical-value = 0.68
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include "../xcbwin.h"
double get_rand() {
return static_cast<double>(rand()) / RAND_MAX;
}
// this function does the percolation steps
// since google-c++-style does not allow references
// for out-parameters, we use a pointer
void doPercolationStep(vector<int>* sites, const double PROP, int time) {
int size = sites->size();
int even = time%2;
for (int i = even; i < size; i += 2) {
if (sites->at(i)) {
if (get_rand() < PROP) sites->at((i+size-1)%size) = 1;
if (get_rand() < PROP) sites->at((i+1)%size) = 1;
sites->at(i) = 0;
}
}
}
int main() {
srand(time(NULL)); // initialize the random-generator
const int HEIGHT = 600;
const int WIDTH = 800;
// modify here
const double PROP = 0.68; // probability for bond to be open
Xcbwin Window;
vector<int> sites(WIDTH, 1);
Window.Open(WIDTH, HEIGHT);
for (int y = 0; y < HEIGHT; ++y) {
for (int x = 0; x < WIDTH; ++x) {
if (sites[x]) {
Window.Black();
Window.DrawPoint(x, y);
}
}
doPercolationStep(&sites, PROP, y);
}
Window.Screenshot();
Window.WaitForKeypress();
}
| jofalk/Xcbwin | demo/directed_percolation.cpp | C++ | mit | 1,357 |
package ee.shy.cli;
import ee.shy.Builder;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* Class for building help text with preset format
*/
public class HelptextBuilder implements Builder<String> {
/**
* Data structure that contains command's argument and its corresponding description.
*/
private final Map<String, String> commandWithArgs = new LinkedHashMap<>();
/**
* List that provides information about executing the command without arguments.
*/
private final List<String> commandWithoutArgs = new ArrayList<>();
/**
* List containing additional information about the command.
*/
private final List<String> descriptions = new ArrayList<>();
public HelptextBuilder addWithArgs(String command, String description) {
commandWithArgs.put(command, description);
return this;
}
public HelptextBuilder addWithoutArgs(String description) {
commandWithoutArgs.add(description);
return this;
}
public HelptextBuilder addDescription(String description) {
descriptions.add(description);
return this;
}
/**
* Create a StringBuilder object to create a formatted help text.
*
* @return formatted help text
*/
@Override
public String create() {
StringBuilder helptext = new StringBuilder();
if (!commandWithArgs.isEmpty()) {
helptext.append("Usage with arguments:\n");
for (Map.Entry<String, String> entry : commandWithArgs.entrySet()) {
helptext.append("\t").append(entry.getKey()).append("\n");
helptext.append("\t\t- ").append(entry.getValue()).append("\n");
}
helptext.append("\n");
}
if (!commandWithoutArgs.isEmpty()) {
helptext.append("Usage without arguments:\n");
for (String commandWithoutArg : commandWithoutArgs) {
helptext.append("\t").append(commandWithoutArg).append("\n");
}
helptext.append("\n");
}
if (!descriptions.isEmpty()) {
helptext.append("Description:\n");
for (String description : descriptions) {
helptext.append("\t").append(description).append("\n");
}
helptext.append("\n");
}
return helptext.toString();
}
}
| sim642/shy | app/src/main/java/ee/shy/cli/HelptextBuilder.java | Java | mit | 2,440 |
package org.asciicerebrum.neocortexengine.domain.events;
/**
*
* @author species8472
*/
public enum EventType {
/**
* Event thrown directly after the initialization of a new combat round.
*/
COMBATROUND_POSTINIT,
/**
* Event thrown before the initialization of a new combat round.
*/
COMBATROUND_PREINIT,
/**
* The event of gaining a new condition.
*/
CONDITION_GAIN,
/**
* The event of losing a condition.
*/
CONDITION_LOSE,
/**
* The event of applying the inflicted damage.
*/
DAMAGE_APPLICATION,
/**
* The event of inflicting damage.
*/
DAMAGE_INFLICTED,
/**
* The event of some character ending its turn.
*/
END_TURN_END,
/**
* The event of some character starting its turn after the end turn of the
* previous character.
*/
END_TURN_START,
/**
* The event thrown when the single attack hits normally.
*/
SINGLE_ATTACK_HIT,
/**
* The event thrown when the single attack hits critically.
*/
SINGLE_ATTACK_HIT_CRITICAL,
/**
* The event thrown when the single attack misses.
*/
SINGLE_ATTACK_MISS,
/**
* The event thrown before a single attack is performed.
*/
SINGLE_ATTACK_PRE,
}
| asciiCerebrum/neocortexEngine | src/main/java/org/asciicerebrum/neocortexengine/domain/events/EventType.java | Java | mit | 1,310 |
package shadows;
import java.util.List;
import java.util.Map;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.vector.Matrix4f;
import org.lwjgl.util.vector.Vector2f;
import org.lwjgl.util.vector.Vector3f;
import entities.Camera;
import entities.Entity;
import entities.Light;
import entities.Player;
import models.TexturedModel;
public class ShadowMapMasterRenderer {
private static final int SHADOW_MAP_SIZE = 5200;
private ShadowFrameBuffer shadowFbo;
private ShadowShader shader;
private ShadowBox shadowBox;
private Matrix4f projectionMatrix = new Matrix4f();
private Matrix4f lightViewMatrix = new Matrix4f();
private Matrix4f projectionViewMatrix = new Matrix4f();
private Matrix4f offset = createOffset();
private ShadowMapEntityRenderer entityRenderer;
/**
* Creates instances of the important objects needed for rendering the scene
* to the shadow map. This includes the {@link ShadowBox} which calculates
* the position and size of the "view cuboid", the simple renderer and
* shader program that are used to render objects to the shadow map, and the
* {@link ShadowFrameBuffer} to which the scene is rendered. The size of the
* shadow map is determined here.
*
* @param camera
* - the camera being used in the scene.
*/
public ShadowMapMasterRenderer(Camera camera) {
shader = new ShadowShader();
shadowBox = new ShadowBox(lightViewMatrix, camera);
shadowFbo = new ShadowFrameBuffer(SHADOW_MAP_SIZE, SHADOW_MAP_SIZE);
entityRenderer = new ShadowMapEntityRenderer(shader, projectionViewMatrix);
}
/**
* Carries out the shadow render pass. This renders the entities to the
* shadow map. First the shadow box is updated to calculate the size and
* position of the "view cuboid". The light direction is assumed to be
* "-lightPosition" which will be fairly accurate assuming that the light is
* very far from the scene. It then prepares to render, renders the entities
* to the shadow map, and finishes rendering.
*
* @param entities
* - the lists of entities to be rendered. Each list is
* associated with the {@link TexturedModel} that all of the
* entities in that list use.
* @param sun
* - the light acting as the sun in the scene.
*/
public void render(Map<TexturedModel, List<Entity>> entities, Light sun) {
shadowBox.update();
Vector3f sunPosition = sun.getPosition();
Vector3f lightDirection = new Vector3f(-sunPosition.x, -sunPosition.y, -sunPosition.z);
prepare(lightDirection, shadowBox);
entityRenderer.render(entities);
finish();
}
/**
* This biased projection-view matrix is used to convert fragments into
* "shadow map space" when rendering the main render pass. It converts a
* world space position into a 2D coordinate on the shadow map. This is
* needed for the second part of shadow mapping.
*
* @return The to-shadow-map-space matrix.
*/
public Matrix4f getToShadowMapSpaceMatrix() {
return Matrix4f.mul(offset, projectionViewMatrix, null);
}
/**
* Clean up the shader and FBO on closing.
*/
public void cleanUp() {
shader.cleanUp();
shadowFbo.cleanUp();
}
/**
* @return The ID of the shadow map texture. The ID will always stay the
* same, even when the contents of the shadow map texture change
* each frame.
*/
public int getShadowMap() {
return shadowFbo.getShadowMap();
}
/**
* @return The light's "view" matrix.
*/
protected Matrix4f getLightSpaceTransform() {
return lightViewMatrix;
}
/**
* Prepare for the shadow render pass. This first updates the dimensions of
* the orthographic "view cuboid" based on the information that was
* calculated in the {@link SHadowBox} class. The light's "view" matrix is
* also calculated based on the light's direction and the center position of
* the "view cuboid" which was also calculated in the {@link ShadowBox}
* class. These two matrices are multiplied together to create the
* projection-view matrix. This matrix determines the size, position, and
* orientation of the "view cuboid" in the world. This method also binds the
* shadows FBO so that everything rendered after this gets rendered to the
* FBO. It also enables depth testing, and clears any data that is in the
* FBOs depth attachment from last frame. The simple shader program is also
* started.
*
* @param lightDirection
* - the direction of the light rays coming from the sun.
* @param box
* - the shadow box, which contains all the info about the
* "view cuboid".
*/
private void prepare(Vector3f lightDirection, ShadowBox box) {
updateOrthoProjectionMatrix(box.getWidth(), box.getHeight(), box.getLength());
updateLightViewMatrix(lightDirection, box.getCenter());
Matrix4f.mul(projectionMatrix, lightViewMatrix, projectionViewMatrix);
shadowFbo.bindFrameBuffer();
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
shader.start();
}
/**
* Finish the shadow render pass. Stops the shader and unbinds the shadow
* FBO, so everything rendered after this point is rendered to the screen,
* rather than to the shadow FBO.
*/
private void finish() {
shader.stop();
shadowFbo.unbindFrameBuffer();
}
/**
* Updates the "view" matrix of the light. This creates a view matrix which
* will line up the direction of the "view cuboid" with the direction of the
* light. The light itself has no position, so the "view" matrix is centered
* at the center of the "view cuboid". The created view matrix determines
* where and how the "view cuboid" is positioned in the world. The size of
* the view cuboid, however, is determined by the projection matrix.
*
* @param direction
* - the light direction, and therefore the direction that the
* "view cuboid" should be pointing.
* @param center
* - the center of the "view cuboid" in world space.
*/
private void updateLightViewMatrix(Vector3f direction, Vector3f center) {
direction.normalise();
center.negate();
lightViewMatrix.setIdentity();
float pitch = (float) Math.acos(new Vector2f(direction.x, direction.z).length());
Matrix4f.rotate(pitch, new Vector3f(1, 0, 0), lightViewMatrix, lightViewMatrix);
float yaw = (float) Math.toDegrees(((float) Math.atan(direction.x / direction.z)));
yaw = direction.z > 0 ? yaw - 180 : yaw;
Matrix4f.rotate((float) -Math.toRadians(yaw), new Vector3f(0, 1, 0), lightViewMatrix,
lightViewMatrix);
Matrix4f.translate(center, lightViewMatrix, lightViewMatrix);
}
/**
* Creates the orthographic projection matrix. This projection matrix
* basically sets the width, length and height of the "view cuboid", based
* on the values that were calculated in the {@link ShadowBox} class.
*
* @param width
* - shadow box width.
* @param height
* - shadow box height.
* @param length
* - shadow box length.
*/
private void updateOrthoProjectionMatrix(float width, float height, float length) {
projectionMatrix.setIdentity();
projectionMatrix.m00 = 2f / width;
projectionMatrix.m11 = 2f / height;
projectionMatrix.m22 = -2f / length;
projectionMatrix.m33 = 1;
}
/**
* Create the offset for part of the conversion to shadow map space. This
* conversion is necessary to convert from one coordinate system to the
* coordinate system that we can use to sample to shadow map.
*
* @return The offset as a matrix (so that it's easy to apply to other matrices).
*/
private static Matrix4f createOffset() {
Matrix4f offset = new Matrix4f();
offset.translate(new Vector3f(0.5f, 0.5f, 0.5f));
offset.scale(new Vector3f(0.5f, 0.5f, 0.5f));
return offset;
}
}
| jely2002/Walk-Simulator | src/shadows/ShadowMapMasterRenderer.java | Java | mit | 7,992 |
import debounce from 'debounce';
import $ from 'jquery';
const groupElementsByTop = (groups, element) => {
const top = $(element).offset().top;
groups[top] = groups[top] || [];
groups[top].push(element);
return groups;
};
const groupElementsByZero = (groups, element) => {
groups[0] = groups[0] || [];
groups[0].push(element);
return groups;
};
const clearHeight = elements => $(elements).css('height', 'auto');
const getHeight = element => $(element).height();
const applyMaxHeight = (elements) => {
const heights = elements.map(getHeight);
const maxHeight = Math.max.apply(null, heights);
$(elements).height(maxHeight);
};
const equalizeHeights = (elements, groupByTop) => {
// Sort into groups.
const groups = groupByTop ?
elements.reduce(groupElementsByTop, {}) :
elements.reduce(groupElementsByZero, {});
// Convert to arrays.
const groupsAsArray = Object.keys(groups).map((key) => {
return groups[key];
});
// Apply max height.
groupsAsArray.forEach(clearHeight);
groupsAsArray.forEach(applyMaxHeight);
};
$.fn.equalHeight = function ({
groupByTop = false,
resizeTimeout = 20,
updateOnDOMReady = true,
updateOnDOMLoad = false
} = {}) {
// Convert to native array.
const elements = this.toArray();
// Handle resize event.
$(window).on('resize', debounce(() => {
equalizeHeights(elements, groupByTop);
}, resizeTimeout));
// Handle load event.
$(window).on('load', () => {
if (updateOnDOMLoad) {
equalizeHeights(elements, groupByTop);
}
});
// Handle ready event.
$(document).on('ready', () => {
if (updateOnDOMReady) {
equalizeHeights(elements, groupByTop);
}
});
return this;
};
| dubbs/equal-height | src/jquery.equalHeight.js | JavaScript | mit | 1,714 |
/// <reference path="typings/tsd.d.ts" />
var plugins = {
beautylog: require("beautylog")("os"),
gulp: require("gulp"),
jade: require("gulp-jade"),
util: require("gulp-util"),
vinylFile: require("vinyl-file"),
jsonjade: require("./index.js"),
gulpInspect: require("gulp-inspect")
};
var jadeTemplate = plugins.vinylFile.readSync("./test/test.jade");
var noJadeTemplate = {}
plugins.gulp.task("check1",function(){
var stream = plugins.gulp.src("./test/test.json")
.pipe(plugins.jsonjade(jadeTemplate))
.pipe(plugins.jade({ //let jade do its magic
pretty: true,
basedir: '/'
})).on("error",plugins.util.log)
.pipe(plugins.gulpInspect(true))
.pipe(plugins.gulp.dest("./test/result/"));
return stream;
});
plugins.gulp.task("check2",function(){
var stream = plugins.gulp.src("./test/test.json")
.pipe(plugins.jsonjade(noJadeTemplate));
});
plugins.gulp.task("default",["check1","check2"],function(){
plugins.beautylog.success("Test passed");
});
plugins.gulp.start.apply(plugins.gulp, ['default']); | pushrocks/gulp-jsonjade | ts/test.ts | TypeScript | mit | 1,117 |
// Structure to represent a proof
class ProofTree {
constructor({equation, rule, newScope=false }) {
this.equation = equation;
this.rule = rule;
this.newScope = newScope;
this.parent = null;
this.children = [];
this.isSound = !newScope;
}
isAssumption() {
return this.newScope;
}
isEmpty() {
return this.parent === null && this.children === [];
}
size() {
if (this.isEmpty()) return 0;
if (this.children.length)
return 1 + this.children.map(c=>c.size()).reduce((acc, c)=>acc+c);
return 1;
}
lastNumber() {
return this.size();
}
walk(fn) {
fn(this);
this.children.forEach(child => {
child.walk(fn);
});
}
last() {
if (this.children.length === 0) return this;
var last = this;
this.children.forEach(child => {
if (!child.isAssumption()) {
last = child.last();
}
});
return last;
}
setLines() {
var count = 1;
this.walk((child) => {
child.lineNumber = count;
count ++;
});
}
root() {
if (this.parent === null) return this;
return this.parent.root();
}
inScope(target) {
if (this.lineNumber === target) {
return true;
} else {
if (this.parent === null) return false;
var child = null;
var anySiblings = this.parent.children.some(child => {
return !child.isAssumption() && (child.lineNumber === target)
})
if (anySiblings) {
return true;
}
return this.parent.inScope(target);
}
}
// inScope(line1, line2, context=this.root()) {
//
// if (line1 === line2) return true;
// if (line1 > line2) return false;
// var line1Obj = context.line(line1);
// var line2Obj = context.line(line2);
// return this.inScope(line1Obj.lineNumber, line2Obj.parent.lineNumber, context);
// }
line(lineNumber) {
var line = null;
var count = 1;
this.walk(child => {
if (lineNumber === count) line = child;
count ++;
});
return line;
}
addLine(line) {
line.parent = this.last();
line.parent.children.push(line);
this.root().setLines();
}
closeBox() {
this.isSound = true;
}
addLineTo(line, lineNumber) {
// line.parent = this.line()
}
addLineNewScope({equation, rule}) {
var line = new ProofTree({
equation,
rule,
newScope: true
});
line.parent = this.last();
this.children.push(line);
line.root().setLines();
}
}
// Synonym as it reads better sometimes
ProofTree.prototype.scope = ProofTree.prototype.line;
export default ProofTree;
| jackdeadman/Natural-Deduction-React | src/js/classes/Proof/ProofTree.js | JavaScript | mit | 2,618 |
package me.puras.common.controller;
import me.puras.common.domain.DomainModel;
import me.puras.common.error.BaseErrCode;
import me.puras.common.json.Response;
import me.puras.common.json.ResponseHelper;
import me.puras.common.service.CrudService;
import me.puras.common.util.ClientListSlice;
import me.puras.common.util.ListSlice;
import me.puras.common.util.Pagination;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
public abstract class CrudController<T> extends BaseController {
public abstract CrudService<T> getService();
protected boolean beforeCheck(T t) {
return true;
}
protected void doCreateBefore(T t) {}
protected void doUpdateBefore(T t) {}
@GetMapping("")
public Response<ClientListSlice<T>> list(Pagination pagination) {
ListSlice<T> slice = getService().findAll(getBounds(pagination));
return updateResultResponse(pagination, slice);
}
@GetMapping("{id}")
public Response<T> detail(@PathVariable("id") Long id) {
T t = getService().findById(id);
notFoundIfNull(t);
return ResponseHelper.createSuccessResponse(t);
}
@PostMapping("")
public Response<T> create(@Valid @RequestBody T t, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResponseHelper.createResponse(BaseErrCode.DATA_BIND_ERR.getCode(), BaseErrCode.DATA_BIND_ERR.getDesc());
}
if (!beforeCheck(t)) {
return ResponseHelper.createResponse(BaseErrCode.DATA_ALREADY_EXIST.getCode(), BaseErrCode.DATA_ALREADY_EXIST.getDesc());
}
doCreateBefore(t);
getService().create(t);
return ResponseHelper.createSuccessResponse(t);
}
@PutMapping("{id}")
public Response<T> update(@PathVariable("id") Long id, @RequestBody T t) {
T oldT = getService().findById(id);
notFoundIfNull(oldT);
if (t instanceof DomainModel) {
((DomainModel)t).setId(id);
}
if (!beforeCheck(t)) {
return ResponseHelper.createResponse(BaseErrCode.DATA_ALREADY_EXIST.getCode(), BaseErrCode.DATA_ALREADY_EXIST.getDesc());
}
doUpdateBefore(t);
getService().update(t);
return ResponseHelper.createSuccessResponse(t);
}
@DeleteMapping("{id}")
public Response<Boolean> delete(@PathVariable("id") Long id) {
T t = getService().findById(id);
notFoundIfNull(t);
int result = getService().delete(id);
return ResponseHelper.createSuccessResponse(result > 0 ? true : false);
}
} | puras/mo-common | src/main/java/me/puras/common/controller/CrudController.java | Java | mit | 2,669 |
version https://git-lfs.github.com/spec/v1
oid sha256:20e35c5c96301564881e3f892b8c5e38c98b131ea58889ed9889b15874e39cbe
size 8394
| yogeshsaroya/new-cdnjs | ajax/libs/preconditions/5.2.4/preconditions.min.js | JavaScript | mit | 129 |
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using AgileSqlClub.MergeUi.DacServices;
using AgileSqlClub.MergeUi.Merge;
using AgileSqlClub.MergeUi.Metadata;
using AgileSqlClub.MergeUi.PackagePlumbing;
using AgileSqlClub.MergeUi.VSServices;
using MessageBox = System.Windows.Forms.MessageBox;
namespace AgileSqlClub.MergeUi.UI
{
public static class DebugLogging
{
public static bool Enable = true;
}
public partial class MyControl : UserControl, IStatus
{
private bool _currentDataGridDirty;
private VsProject _currentProject;
private ISchema _currentSchema;
private ITable _currentTable;
private ISolution _solution;
public MyControl()
{
InitializeComponent();
//Refresh();
}
public void SetStatus(string message)
{
Dispatcher.InvokeAsync(() => { LastStatusMessage.Text = message; });
}
private void Refresh()
{
Task.Run(() => DoRefresh());
}
private void DoRefresh()
{
Dispatcher.Invoke(() => { DebugLogging.Enable = Logging.IsChecked.Value; });
try
{
if (_currentDataGridDirty)
{
if (!CheckSaveChanges())
{
return;
}
}
var cursor = Cursors.Arrow;
Dispatcher.Invoke(() =>
{
cursor = Cursor;
RefreshButton.IsEnabled = false;
Projects.ItemsSource = null;
Schemas.ItemsSource = null;
Tables.ItemsSource = null;
DataGrid.DataContext = null;
Cursor = Cursors.Wait;
});
_solution = new SolutionParser(new ProjectEnumerator(), new DacParserBuilder(), this);
Dispatcher.Invoke(() =>
{
Projects.ItemsSource = _solution.GetProjects();
Cursor = cursor;
RefreshButton.IsEnabled = true;
});
}
catch (Exception e)
{
Dispatcher.Invoke(() => { LastStatusMessage.Text = "Error see output window"; });
OutputWindowMessage.WriteMessage("Error Enumerating projects:");
OutputWindowMessage.WriteMessage(e.Message);
}
}
[SuppressMessage("Microsoft.Globalization", "CA1300:SpecifyMessageBoxOptions")]
private void button1_Click(object sender, RoutedEventArgs e)
{
Refresh();
}
private void Projects_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
try
{
if (null == Projects.SelectedValue)
return;
var projectName = Projects.SelectedValue.ToString();
if (String.IsNullOrEmpty(projectName))
return;
Schemas.ItemsSource = null;
Tables.ItemsSource = null;
_currentProject = _solution.GetProject(projectName);
if (string.IsNullOrEmpty(_currentProject.GetScript(ScriptType.PreDeploy)) &&
string.IsNullOrEmpty(_currentProject.GetScript(ScriptType.PostDeploy)))
{
MessageBox.Show(
"The project needs a post deploy script - add one anywhere in the project and refresh", "MergeUi");
return;
}
LastBuildTime.Text = string.Format("Last Dacpac Build Time: {0}", _currentProject.GetLastBuildTime());
Schemas.ItemsSource = _currentProject.GetSchemas();
}
catch (Exception ex)
{
Dispatcher.Invoke(() => { LastStatusMessage.Text = "Error see output window "; });
OutputWindowMessage.WriteMessage("Error reading project: {0}", ex.Message);
}
}
private void Schemas_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
try
{
if (null == Schemas.SelectedValue)
return;
var schemaName = Schemas.SelectedValue.ToString();
if (String.IsNullOrEmpty(schemaName))
return;
_currentSchema = _currentProject.GetSchema(schemaName);
Tables.ItemsSource = _currentSchema.GetTables();
}
catch (Exception ex)
{
Dispatcher.Invoke(() => { LastStatusMessage.Text = "Error see output window"; });
OutputWindowMessage.WriteMessage("Error selecting schema:");
OutputWindowMessage.WriteMessage(ex.Message);
}
}
private void Tables_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
try
{
if (null == Tables.SelectedValue)
return;
var tableName = Tables.SelectedValue.ToString();
if (String.IsNullOrEmpty(tableName))
return;
_currentTable = _currentSchema.GetTable(tableName);
if (_currentTable.Data == null)
{
_currentTable.Data = new DataTableBuilder(tableName, _currentTable.Columns).Get();
}
DataGrid.DataContext = _currentTable.Data.DefaultView;
//TODO -= check for null and start adding a datatable when building the table (maybe need a lazy loading)
//we also need a repository of merge statements which is the on disk representation so we can grab those
//if they exist or just create a new one - then save them back and
}
catch (Exception ex)
{
Dispatcher.Invoke(() => { LastStatusMessage.Text = "Error Enumerating projects: " + ex.Message; });
OutputWindowMessage.WriteMessage("Error selecting table ({0}-):",
_currentTable == null ? "null" : _currentTable.Name,
Tables.SelectedValue == null ? "selected = null" : Tables.SelectedValue.ToString());
OutputWindowMessage.WriteMessage(ex.Message);
}
}
private bool CheckSaveChanges()
{
return true;
}
private void DataGrid_OnRowEditEnding(object sender, DataGridRowEditEndingEventArgs e)
{
_currentDataGridDirty = true;
}
private void button1_Save(object sender, RoutedEventArgs e)
{
//need to finish off saving back to the files (need a radio button with pre/post deploy (not changeable when read from file) - futrue feature
//need a check to write files on window closing
//need lots of tests
try
{
_solution.Save();
}
catch (Exception ex)
{
Dispatcher.Invoke(() => { LastStatusMessage.Text = "Error see output window"; });
OutputWindowMessage.WriteMessage("Error saving solution files:");
OutputWindowMessage.WriteMessage(ex.Message);
}
}
private void ImportTable(object sender, RoutedEventArgs e)
{
if (_currentTable == null)
{
MessageBox.Show("Please choose a table in the drop down list", "MergeUi");
return;
}
try
{
new Importer().GetData(_currentTable);
}
catch (Exception ex)
{
Dispatcher.Invoke(() => { LastStatusMessage.Text = "Error see output window"; });
OutputWindowMessage.WriteMessage("Error importing data (table={0}):", _currentTable.Name);
OutputWindowMessage.WriteMessage(ex.Message);
}
DataGrid.DataContext = _currentTable.Data.DefaultView;
}
private void Logging_OnChecked(object sender, RoutedEventArgs e)
{
DebugLogging.Enable = Logging.IsChecked.Value;
}
}
public interface IStatus
{
void SetStatus(string message);
}
} | GoEddie/MergeUi | src/AgileSqlClub.MergeUiPackage/UI/MyControl.xaml.cs | C# | mit | 8,845 |
<?php
namespace Aquicore\API\PHP\Common;
class BatteryLevelModule
{
/* Battery range: 6000 ... 3600 */
const BATTERY_LEVEL_0 = 5500;/*full*/
const BATTERY_LEVEL_1 = 5000;/*high*/
const BATTERY_LEVEL_2 = 4500;/*medium*/
const BATTERY_LEVEL_3 = 4000;/*low*/
/* below 4000: very low */
}
| koodiph/acquicore-api | src/Common/BatteryLevelModule.php | PHP | mit | 311 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using ZitaAsteria;
using ZitaAsteria.World;
namespace ZAsteroids.World.HUD
{
class HUDSheilds : HUDComponent
{
public SpriteFont Font { get; set; }
public Texture2D SheildTexture { get; set; }
public Texture2D ActiveTexture { get; set; }
public Texture2D DamageTexture { get; set; }
private RelativeTexture SheildInfo;
private RelativeTexture WorkingValue;
private bool enabled;
private bool update = false;
private Vector2 safePositionTopRight;
private Color color;
public HUDSheilds()
{
}
public override void Initialize()
{
// Must initialize base to get safe draw area
base.Initialize();
SheildTexture = WorldContent.hudContent.sheilds;
ActiveTexture = WorldContent.hudContent.active;
DamageTexture = WorldContent.hudContent.damage;
SheildInfo = new RelativeTexture(SheildTexture);
SheildInfo.Children.Add("Base01", new RelativeTexture(ActiveTexture) { Position = new Vector2(129, 203), EnableDraw = true });
SheildInfo.Children.Add("Base02", new RelativeTexture(ActiveTexture) { Position = new Vector2(164.5f, 182.5f), EnableDraw = true });
SheildInfo.Children.Add("Base03", new RelativeTexture(ActiveTexture) { Position = new Vector2(129.5f, 123), EnableDraw = true });
SheildInfo.Children.Add("Base04", new RelativeTexture(ActiveTexture) { Position = new Vector2(147, 92.5f), EnableDraw = true });
SheildInfo.Children.Add("Base05", new RelativeTexture(ActiveTexture) { Position = new Vector2(199.5f, 42), EnableDraw = true });
SheildInfo.Children.Add("Base06", new RelativeTexture(ActiveTexture) { Position = new Vector2(234.5f, 102), EnableDraw = true });
SheildInfo.Children.Add("Damage01", new RelativeTexture(DamageTexture) { Position = new Vector2(94.5f, 143) });
SheildInfo.Children.Add("Damage02", new RelativeTexture(DamageTexture) { Position = new Vector2(112, 153) });
SheildInfo.Children.Add("Damage03", new RelativeTexture(DamageTexture) { Position = new Vector2(112, 133) });
SheildInfo.Children.Add("Damage04", new RelativeTexture(DamageTexture) { Position = new Vector2(112, 113) });
SheildInfo.Children.Add("Damage05", new RelativeTexture(DamageTexture) { Position = new Vector2(129.5f, 143) });
SheildInfo.Children.Add("Damage06", new RelativeTexture(DamageTexture) { Position = new Vector2(129.5f, 103) });
SheildInfo.Children.Add("Damage07", new RelativeTexture(DamageTexture) { Position = new Vector2(129.5f, 83) });
SheildInfo.Children.Add("Damage08", new RelativeTexture(DamageTexture) { Position = new Vector2(147, 173) });
SheildInfo.Children.Add("Damage09", new RelativeTexture(DamageTexture) { Position = new Vector2(147, 153) });
SheildInfo.Children.Add("Damage10", new RelativeTexture(DamageTexture) { Position = new Vector2(147, 133) });
SheildInfo.Children.Add("Damage11", new RelativeTexture(DamageTexture) { Position = new Vector2(147, 113) });
SheildInfo.Children.Add("Damage12", new RelativeTexture(DamageTexture) { Position = new Vector2(147, 73) });
SheildInfo.Children.Add("Damage13", new RelativeTexture(DamageTexture) { Position = new Vector2(147, 53) });
SheildInfo.Children.Add("Damage14", new RelativeTexture(DamageTexture) { Position = new Vector2(147, 12) });
SheildInfo.Children.Add("Damage15", new RelativeTexture(DamageTexture) { Position = new Vector2(164.5f, 162.5f) });
SheildInfo.Children.Add("Damage16", new RelativeTexture(DamageTexture) { Position = new Vector2(164.5f, 142.5f) });
SheildInfo.Children.Add("Damage17", new RelativeTexture(DamageTexture) { Position = new Vector2(164.5f, 122.5f) });
SheildInfo.Children.Add("Damage18", new RelativeTexture(DamageTexture) { Position = new Vector2(164.5f, 102.5f) });
SheildInfo.Children.Add("Damage19", new RelativeTexture(DamageTexture) { Position = new Vector2(164.5f, 82.5f) });
SheildInfo.Children.Add("Damage20", new RelativeTexture(DamageTexture) { Position = new Vector2(164.5f, 62.5f) });
SheildInfo.Children.Add("Damage21", new RelativeTexture(DamageTexture) { Position = new Vector2(164.5f, 42.5f) });
SheildInfo.Children.Add("Damage22", new RelativeTexture(DamageTexture) { Position = new Vector2(164.5f, 22.5f) });
SheildInfo.Children.Add("Damage23", new RelativeTexture(DamageTexture) { Position = new Vector2(182.5f, 173) });
SheildInfo.Children.Add("Damage24", new RelativeTexture(DamageTexture) { Position = new Vector2(182.5f, 153) });
SheildInfo.Children.Add("Damage25", new RelativeTexture(DamageTexture) { Position = new Vector2(182.5f, 133) });
SheildInfo.Children.Add("Damage26", new RelativeTexture(DamageTexture) { Position = new Vector2(182.5f, 113) });
SheildInfo.Children.Add("Damage27", new RelativeTexture(DamageTexture) { Position = new Vector2(182.5f, 73) });
SheildInfo.Children.Add("Damage28", new RelativeTexture(DamageTexture) { Position = new Vector2(182.5f, 53) });
SheildInfo.Children.Add("Damage29", new RelativeTexture(DamageTexture) { Position = new Vector2(199.5f, 62) });
SheildInfo.Children.Add("Damage30", new RelativeTexture(DamageTexture) { Position = new Vector2(199.5f, 82) });
SheildInfo.Children.Add("Damage31", new RelativeTexture(DamageTexture) { Position = new Vector2(199.5f, 102) });
SheildInfo.Children.Add("Damage32", new RelativeTexture(DamageTexture) { Position = new Vector2(199.5f, 122) });
SheildInfo.Children.Add("Damage33", new RelativeTexture(DamageTexture) { Position = new Vector2(199.5f, 142) });
SheildInfo.Children.Add("Damage34", new RelativeTexture(DamageTexture) { Position = new Vector2(199.5f, 162) });
SheildInfo.Children.Add("Damage35", new RelativeTexture(DamageTexture) { Position = new Vector2(199.5f, 182) });
SheildInfo.Children.Add("Damage36", new RelativeTexture(DamageTexture) { Position = new Vector2(217.5f, 112.5f) });
SheildInfo.Children.Add("Damage37", new RelativeTexture(DamageTexture) { Position = new Vector2(217.5f, 92.5f) });
SheildInfo.Children.Add("Damage38", new RelativeTexture(DamageTexture) { Position = new Vector2(217.5f, 72.5f) });
SheildInfo.Children.Add("Damage39", new RelativeTexture(DamageTexture) { Position = new Vector2(235, 122) });
SheildInfo.EnableDraw = true;
SheildInfo.Position = new Vector2(HUDDrawSafeArea.Right - (SheildTexture.Width / 2), HUDDrawSafeArea.Top + (SheildTexture.Height / 2));
safePositionTopRight = new Vector2(HUDDrawSafeArea.Right, HUDDrawSafeArea.Top);
Font = WorldContent.fontAL15pt;
}
public override void Update(GameTime gameTime)
{
//base.Update(gameTime);
// Fuck this sucks, but doing it at work, so will fix later
//DUUUUUUUUUDE, holy crap! 10 points for effort :) [GearsAD]
if (update)
{
if (HUDProperties.HealthAmount <= 97.0f)
{
SheildInfo.Children.TryGetValue("Damage32", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage32", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 95.0f)
{
SheildInfo.Children.TryGetValue("Damage39", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage39", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 93.0f)
{
SheildInfo.Children.TryGetValue("Damage02", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage02", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 90.0f)
{
SheildInfo.Children.TryGetValue("Damage38", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage38", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 87.0f)
{
SheildInfo.Children.TryGetValue("Damage03", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage03", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 85.0f)
{
SheildInfo.Children.TryGetValue("Damage37", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage37", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 83.0f)
{
SheildInfo.Children.TryGetValue("Damage04", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage04", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 80.0f)
{
SheildInfo.Children.TryGetValue("Damage36", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage36", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 77.0f)
{
SheildInfo.Children.TryGetValue("Damage05", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage05", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 75.0f)
{
SheildInfo.Children.TryGetValue("Damage35", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage35", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 73.0f)
{
SheildInfo.Children.TryGetValue("Damage06", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage06", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 70.0f)
{
SheildInfo.Children.TryGetValue("Damage34", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage34", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 67.0f)
{
SheildInfo.Children.TryGetValue("Damage07", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage07", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 65.0f)
{
SheildInfo.Children.TryGetValue("Damage33", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage33", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 63.0f)
{
SheildInfo.Children.TryGetValue("Damage22", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage22", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 60.0f)
{
SheildInfo.Children.TryGetValue("Damage01", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage01", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 57.0f)
{
SheildInfo.Children.TryGetValue("Damage09", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage09", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 55.0f)
{
SheildInfo.Children.TryGetValue("Damage31", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage31", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 53.0f)
{
SheildInfo.Children.TryGetValue("Damage10", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage10", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 50.0f)
{
SheildInfo.Children.TryGetValue("Damage30", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage30", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 47.0f)
{
SheildInfo.Children.TryGetValue("Damage11", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage11", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 45.0f)
{
SheildInfo.Children.TryGetValue("Damage29", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage29", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 43.0f)
{
SheildInfo.Children.TryGetValue("Damage12", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage12", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 40.0f)
{
SheildInfo.Children.TryGetValue("Damage28", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage28", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 37.0f)
{
SheildInfo.Children.TryGetValue("Damage13", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage13", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 35.0f)
{
SheildInfo.Children.TryGetValue("Damage27", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage27", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 33.0f)
{
SheildInfo.Children.TryGetValue("Damage14", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage14", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 30.0f)
{
SheildInfo.Children.TryGetValue("Damage26", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage26", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 27.0f)
{
SheildInfo.Children.TryGetValue("Damage15", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage15", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 25.0f)
{
SheildInfo.Children.TryGetValue("Damage25", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage25", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 23.0f)
{
SheildInfo.Children.TryGetValue("Damage16", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage16", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 20.0f)
{
SheildInfo.Children.TryGetValue("Damage24", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage24", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 17.0f)
{
SheildInfo.Children.TryGetValue("Damage17", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage17", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 15.0f)
{
SheildInfo.Children.TryGetValue("Damage23", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage23", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 13.0f)
{
SheildInfo.Children.TryGetValue("Damage18", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage18", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 10.0f)
{
SheildInfo.Children.TryGetValue("Damage08", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage08", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 7.0f)
{
SheildInfo.Children.TryGetValue("Damage19", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage19", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 5.0f)
{
SheildInfo.Children.TryGetValue("Damage21", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage21", out WorkingValue);
WorkingValue.EnableDraw = false;
}
if (HUDProperties.HealthAmount <= 0.0f)
{
SheildInfo.Children.TryGetValue("Damage20", out WorkingValue);
WorkingValue.EnableDraw = true;
}
else
{
SheildInfo.Children.TryGetValue("Damage20", out WorkingValue);
WorkingValue.EnableDraw = false;
}
}
update = !update;
}
public override void Draw()
{
if (enabled)
{
HUDSpriteBatch.Begin();
SheildInfo.Draw(HUDSpriteBatch);
string health = HUDProperties.HealthAmount.ToString();
if (HUDProperties.HealthAmount <= 80)
{
color = Color.Orange;
}
else if (HUDProperties.HealthAmount <= 40)
{
color = Color.Red;
}
else
{
color = WorldContent.hudContent.hudTextColor;
}
HUDSpriteBatch.DrawString(Font, health, safePositionTopRight + new Vector2(-SheildTexture.Width + 45, 22), color);
HUDSpriteBatch.End();
}
}
/// <summary>
/// Sets whether the component should be drawn.
/// </summary>
/// <param name="enabled">enable the component</param>
public void Enable(bool enabled)
{
this.enabled = enabled;
}
}
}
| GearsAD/zasteroids | ZAsteroids/World/HUD/HUDSheilds.cs | C# | mit | 26,807 |
namespace Miruken.Callback
{
using System;
[AttributeUsage(AttributeTargets.Parameter)]
public class KeyAttribute : Attribute
{
public KeyAttribute(object key)
{
Key = key;
}
public KeyAttribute(string key, StringComparison comparison)
{
Key = new StringKey(key, comparison);
}
public object Key { get; }
}
}
| Miruken-DotNet/Miruken | Source/Miruken/Callback/KeyAttribute.cs | C# | mit | 419 |
namespace OpenProtocolInterpreter.IOInterface
{
/// <summary>
/// IO interface message category. Every IO interface mid must implement <see cref="IIOInterface"/>.
/// </summary>
public interface IIOInterface
{
}
}
| Rickedb/OpenProtocolInterpreter | src/OpenProtocolInterpreter/IOInterface/IIOInterface.cs | C# | mit | 241 |
require 'RMagick'
class MemesController < ApplicationController
before_action :check_meme_destroy_permission, only: [:destroy]
before_action :check_meme_group_permissions, only: [:show]
# GET /memes
# GET /memes.json
def index
@memes = Meme.where(:group_id => nil).order("created_at DESC")
@group = nil
if params[:sort] and params[:sort] == "popular"
@memes = @memes.sort{|m1, m2| m2.popularity <=> m1.popularity }
@memes = Kaminari.paginate_array(@memes)
end
@memes = @memes.page(params[:page]).per($MEMES_PER_PAGE)
end
# GET /memes/1
# GET /memes/1.json
def show
if @meme.user_id
@author = User.find(@meme.user_id)
if @author.username
@author_name = @author.username
end
end
end
# GET /memes/new
def new
@meme = Meme.new
@group = Group.find_by_key(params[:group_id])
if current_user.try(:groups)
@groups = current_user.groups
elsif @group
@groups = [@group]
else
@groups = []
end
@templates = Template.all
end
# POST /memes
# POST /memes.json
def create
# TODO(juarez): Add security, sanitize input. Check if template is actually present.
@meme = Meme.new(meme_params.merge({:key => UUID.new().generate, :user_id => current_user}))
if user_signed_in?
@meme.user_id = current_user.id
end
if !params[:images][:bg].empty?
# Set result to background image.
result = Magick::Image.read_inline(params[:images][:bg]).first
result.format = "JPEG"
end
if !params[:images][:top].empty?
image_top = Magick::Image.read_inline(params[:images][:top]).first
result = result.composite!(image_top, Magick::CenterGravity, Magick::OverCompositeOp)
end
if !params[:images][:bottom].empty?
image_bottom = Magick::Image.read_inline(params[:images][:bottom]).first
result = result.composite!(image_bottom, Magick::CenterGravity, Magick::OverCompositeOp)
end
respond_to do |format|
if @meme.save
s3 = AWS::S3.new
begin
obj = s3.buckets[ENV['S3_BUCKET_NAME']].objects[@meme.id.to_s + ".jpg"]
obj.write(result.to_blob, {:acl => :public_read, :cache_control => "max-age=14400"})
rescue Exception => ex
# Upload failed, try again.
puts 'Error uploading meme to S3, retrying.'
puts ex.message
begin
obj = s3.buckets[ENV['S3_BUCKET_NAME']].objects[@meme.id.to_s + ".jpg"]
obj.write(result.to_blob, {:acl => :public_read, :cache_control => "max-age=14400"})
rescue Exception => ex
# Upload failed, alert the user and return to the previous page.
puts 'Error uploading meme to S3 on 2nd and final attempt.'
puts ex.message
flash[:error] = "Oh noes! There was an error saving your meme, please try again."
@meme.destroy
redirect_to :back
return
end
else
# Upload completed.
if user_signed_in?
# If the user is signed in then auto add an upvote from them.
Vote.new(user: current_user, meme: @meme, value: :up).save
end
if @meme.group
redirect_path = group_meme_path(@meme.group, @meme)
else
redirect_path = meme_path(@meme)
end
end
format.html { redirect_to redirect_path, notice: 'Meme was successfully created.' }
format.json { render action: 'show', status: :created, location: @meme }
else
format.html { render action: 'new' }
format.json { render json: @meme.errors, status: :unprocessable_entity }
end
end
end
# DELETE /memes/1
# DELETE /memes/1.json
def destroy
@meme.destroy
respond_to do |format|
format.html { redirect_to memes_url, notice: 'Meme was successfully deleted.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_meme
@meme = Meme.find_by_key(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def meme_params
if params[:meme][:group_id] == "0" or params[:meme][:group_id] == 0
# The meme is to be public.
params[:meme].delete(:group_id)
end
params.require(:meme).permit(:context, :group_id)
end
def vote_params
params.require(:vote).permit(:meme, :user_id, :value)
end
def check_meme_group_permissions
@meme = Meme.find_by_key(params[:id])
@group = @meme.group
if !@group.nil? and (@group.visibility == "private") and (!current_user or (current_user and !current_user.groups.include?(@group)))
not_found_error
end
end
def check_meme_destroy_permission
@meme = Meme.find_by_key(params[:id])
if !current_user or (@meme.user_id != current_user.id and !current_user.admin)
forbidden_access_error
end
end
end
| ignition25/memegen | app/controllers/memes_controller.rb | Ruby | mit | 5,069 |
/**
* Javascript file for Category Show.
* It requires jQuery.
*/
function wpcs_gen_tag() {
// Category Show searches for term_id since 0.4.1 and not term slug.
// There is a need to add the id%% tag to be compatible with other versions
$("#wpcs_gen_tag").val("%%wpcs-"+$("#wpcs_term_dropdown").val()+"%%"+$("#wpcs_order_type").val()+$("#wpcs_order_by").val()+"%%id%%");
$("#wpcs_gen_tag").select();
$("#wpcs_gen_tag").focus();
} | mfolker/saddind | wp-content/plugins/wp-catergory-show/wp-category-show.js | JavaScript | mit | 438 |
function mathGame(){
var game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.auto, 'math', {
preload: onPreload,
create: onCreate,
// resize:onResize
});
WebFontConfig = {
active: function() { game.time.events.add(Phaser.Timer.SECOND, createText, this); },
google: {
families: ['Fredericka the Great']
}
};
var sumsArray = [];
var questionText;
var randomSum;
var timeTween;
var numberTimer;
var buttonMask;
var replay;
var score=0;
var scoreText;
var isGameOver = false;
var topScore;
var numbersArray = [-3,-2,-1,1,2,3];
function buildThrees(initialNummber,currentIndex,limit,currentString){
for(var i=0;i<numbersArray.length;i++){
var sum = initialNummber+numbersArray[i];
var outputString = currentString+(numbersArray[i]<0?"":"+")+numbersArray[i];
if(sum>0 && sum<4 && currentIndex==limit){
sumsArray[limit][sum-1].push(outputString);
}
if(currentIndex<limit){
buildThrees(sum,currentIndex+1,limit,outputString);
}
}
}
function onPreload() {
// responsiveScale();
game.load.script('webfont', '//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js');
game.load.image("timebar", "/images/math/timebar.png");
game.load.image("buttonmask", "/images/math/buttonmask.png");
game.load.spritesheet("buttons", "/images/math/buttons.png",400,50);
game.load.spritesheet('myguy', '/images/math/dance.png', 70, 120);
game.load.image("background", "/images/math/board2.png");
game.load.image("replay", "images/math/replay.png");
game.load.image("home", "images/home.png");
}
function onCreate() {
topScore = localStorage.getItem("topScore")==null?0:localStorage.getItem("topScore");
// game.stage.backgroundColor = "#cccccc";
chalkBoard = game.add.sprite(1100, 850,"background");
chalkBoard.x = 0;
chalkBoard.y = 0;
chalkBoard.height = game.height;
chalkBoard.width = game.width;
game.stage.disableVisibilityChange = true;
gameOverSprite = this.game.add.sprite(600, 300, 'myguy');
gameOverSprite.visible = false;
gameOverSprite.frame = 0;
gameOverSprite.animations.add('left', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13], 10, true);
replay = game.add.button(game.width*.6, game.height*.1,"replay",replay,this);
replay.visable = false;
home = game.add.button(game.width*.75, game.height*.1, 'home', function onClick(){window.location.href ="/home"});
home.scale.setTo(0.2,0.2);
for(var i=1;i<5;i++){
sumsArray[i]=[[],[],[]];
for(var j=1;j<=3;j++){
buildThrees(j,1,i,j);
}
}
questionText = game.add.text(game.width*.5,game.height*.3,"-");
questionText.anchor.set(0.5);
scoreText = game.add.text(game.width*.1,game.height*.10,"-");
for(var i=0;i<3;i++){
var numberButton = game.add.button(game.width*.3,game.height*.4+i*75,"buttons",checkAnswer,this).frame=i;
}
numberTimer = game.add.sprite(game.width*.3,game.height*.4,"timebar");
nextNumber();
}
function createText() {
questionText.font = 'Fredericka the Great';
questionText.fontSize = 37;
questionText.addColor('#edf0f3',0);
scoreText.font = 'Fredericka the Great';
scoreText.fontSize = 37;
scoreText.addColor('#edf0f3',0);
};
function gameOver(gameOverString){
// game.stage.backgroundColor = "#ff0000";
console.log(gameOverString)
questionText.text = "Wrong Answer!";
questionText.addColor('#ff471a',0);
isGameOver = true;
localStorage.setItem("topScore",Math.max(score,topScore));
numberTimer.destroy();
buttonMask.destroy();
replay.visible = true;
// gameOverSprite.visible = true;
// gameOverSprite.animations.play('left');
}
function checkAnswer(button){
var correctAnswer;
if(!isGameOver){
if(button.frame==randomSum){
score+=Math.floor((buttonMask.x+350)/4);
nextNumber();
}
else{
if(score>0) {
timeTween.stop();
}
correctAnswer = randomSum;
gameOver(correctAnswer);
}
}
}
function replay(){
$("#math").html("");
mathGame();
}
function nextNumber(){
scoreText.text = "Score: "+score.toString()+"\nBest Score: "+topScore.toString();
if(buttonMask){
buttonMask.destroy();
game.tweens.removeAll();
}
buttonMask = game.add.graphics(game.width*.3,game.height*.4);
buttonMask.beginFill(0xffffff);
buttonMask.drawRect(0, 0, 400, 200);
buttonMask.endFill();
numberTimer.mask = buttonMask;
if(score>0){
timeTween=game.add.tween(buttonMask);
timeTween.to({
x: -350
}, 9000, "Linear",true);
timeTween.onComplete.addOnce(function(){
gameOver("?");
}, this);
}
randomSum = game.rnd.between(0,2);
questionText.text = sumsArray[Math.min(Math.round((score-100)/400)+1,4)][randomSum][game.rnd.between(0,sumsArray[Math.min(Math.round((score-100)/400)+1,4)][randomSum].length-1)];
}
}
// }
| JulianBoralli/klink | app/assets/javascripts/math.js | JavaScript | mit | 5,149 |
package com.javarush.test.level14.lesson08.bonus03;
/**
* Created by Алексей on 12.04.2014.
*/
public class Singleton
{
private static Singleton instance;
private Singleton()
{
}
public static Singleton getInstance()
{
if ( instance == null )
{
instance = new Singleton();
}
return instance;
}
}
| Juffik/JavaRush-1 | src/com/javarush/test/level14/lesson08/bonus03/Singleton.java | Java | mit | 381 |
// Copyright (c) Rotorz Limited. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root.
namespace Rotorz.Games.Collections
{
/// <summary>
/// Can be implemented along with <see cref="IReorderableListAdaptor"/> when drop
/// insertion or ordering is desired.
/// </summary>
/// <remarks>
/// <para>This type of "drop" functionality can occur when the "drag" phase of the
/// drag and drop operation was initiated elsewhere. For example, a custom
/// <see cref="IReorderableListAdaptor"/> could insert entirely new items by
/// dragging and dropping from the Unity "Project" window.</para>
/// </remarks>
/// <see cref="IReorderableListAdaptor"/>
public interface IReorderableListDropTarget
{
/// <summary>
/// Determines whether an item is being dragged and that it can be inserted
/// or moved by dropping somewhere into the reorderable list control.
/// </summary>
/// <remarks>
/// <para>This method is always called whilst drawing an editor GUI.</para>
/// </remarks>
/// <param name="insertionIndex">Zero-based index of insertion.</param>
/// <returns>
/// A value of <c>true</c> if item can be dropped; otherwise <c>false</c>.
/// </returns>
/// <see cref="UnityEditor.DragAndDrop"/>
bool CanDropInsert(int insertionIndex);
/// <summary>
/// Processes the current drop insertion operation when <see cref="CanDropInsert(int)"/>
/// returns a value of <c>true</c> to process, accept or cancel.
/// </summary>
/// <remarks>
/// <para>This method is always called whilst drawing an editor GUI.</para>
/// <para>This method is only called when <see cref="CanDropInsert(int)"/>
/// returns a value of <c>true</c>.</para>
/// </remarks>
/// <param name="insertionIndex">Zero-based index of insertion.</param>
/// <see cref="ReorderableListGUI.CurrentListControlID"/>
/// <see cref="UnityEditor.DragAndDrop"/>
void ProcessDropInsertion(int insertionIndex);
}
}
| tenvick/hugula | Client/Assets/Third/PSD2UGUI/@rotorz/unity3d-reorderable-list/Editor/Collections/IReorderableListDropTarget.cs | C# | mit | 2,164 |