repo_name
stringlengths 4
116
| path
stringlengths 4
379
| size
stringlengths 1
7
| content
stringlengths 3
1.05M
| license
stringclasses 15
values |
---|---|---|---|---|
kongchun/salary | web/src/manage/answers.js | 3878 | $(function() {
initTable();
$("#searchBtn").on('click',function(){
let positionStatus = $("select[name=positionStatus]").val();
layui.table.reload('compnayList', {where: {'positionConfirm':positionStatus},page: {curr: 1}});
});
});
function initTable(){
layui.use(['table'], function(){
var table = layui.table,
$ = layui.jquery;
table.render({
elem: '#compnayList'
,url:'/manage/listcompany'
,id:'compnayList'
,cols: [[
{field:'_id', width:80, title: '', sort: false,templet: function(d){
return d.LAY_INDEX;
}},
{field:'company', width:250, title: '公司'}
,{field:'alias', width:150, title: '別名', sort: false}
,{field:'addr', title: '地址', minWidth: 250}
,{field:'city', width:80, title: '城市', sort: false}
,{field:'district', width:90,title: '区域'}
,{field:'bdStatus', width:92,title: '审核状态',templet: function(d){
if(!!d.bdStatus && 99==d.bdStatus){
return '<span class="layui-badge-rim" style="padding: 1px 5px 20px;">手动审核</span>';
}else if(!!d.bdStatus && 3==d.bdStatus){
return '<span class="layui-badge-rim" style="padding: 1px 5px 20px;">地图识别</span>';
}else if(!!d.bdStatus && 2==d.bdStatus){
return '<span class="layui-badge-rim" style="padding: 1px 5px 20px;">库识别</span>';
}else if(!!d.bdStatus && 1==d.bdStatus){
return '<span class="layui-badge-rim" style="padding: 1px 5px 20px;">自动识别</span>';
}else if(0==d.bdStatus){
return '<span class="layui-badge-rim" style="padding: 1px 5px 20px;">未识别</span>';
}else{
return '<span class="layui-badge-rim" style="padding: 1px 5px 20px;">未识别</span>';
}
}}
,{fixed: 'right', width: 120, align:'center', toolbar: '#barCompany'}
]]
,page: true
});
//监听工具条
table.on('tool(company)', function(obj){ //注:tool是工具条事件名,test是table原始容器的属性 lay-filter="对应的值"
var data = obj.data //获得当前行数据
,layEvent = obj.event; //获得 lay-event 对应的值
if(layEvent === 'detail'){
layer.msg('查看暂不支持');
} else if(layEvent === 'del'){
layer.confirm('删除数据:'+(data.alias||data.company)+'?', function(index){
let index1 = layer.load(2);
$.ajax({
url: '/manage/deleteCompanyById',
type: 'post',
data: {'_id':data['_id']}
}).done(function (data) {
//obj.del(); //删除对应行(tr)的DOM结构
layer.close(index1);
if(!!data & !!data['n'] && data['n']>0){
layer.msg('删除成功!');
try{
layui.table.reload('compnayList');
}catch(e){}
}else{
layer.msg('删除失败,原因:未匹配的记录');
}
$("#commitData").removeAttr("disabled");
}).fail(function (e) {
layer.close(index1);
console.error(e);
layer.msg('删除失败');
$("#commitData").removeAttr("disabled");
});
return;
});
} else if(layEvent === 'edit'){
layer.msg('编辑操作');
} else if(layEvent === 'position'){
let index = layer.open({
type : 2,
title : data.company+'-位置',
maxmin : false,
offset: '100px',
area : [ $(window).width()+'px', $(window).height()+'px' ],
content : '/manage/pagecompanyposition?_id='+data._id
});
layer.full(index);
}
});
});
}
| mit |
0100354256/Prct12M17 | lib/Prct12M17/naranjero.rb | 798 | class Naranjero
VELOCIDAD_CRECIMIENTO = 1.5
EDAD_PRODUCCION = 3
EDAD_MUERTE = 10
NARANJAS_ANIO = 70
attr_reader :edad, :altura, :contador
def initialize
@altura = 0
@edad = 0
@contador = 0
end
def edad()
return @edad
end
def altura()
return @altura
end
def contador()
return @contador
end
def uno_mas
@edad += 1
@altura += VELOCIDAD_CRECIMIENTO
@contador = (@edad - (EDAD_PRODUCCION - 1)) * ((NARANJAS_ANIO * Math.log(@altura)) + (rand (1..10)))
end
def recolectar_una
if (@edad == EDAD_MUERTE)
print "El arbol esta muerto\n"
elsif (@contador > 0)
@contador -= 1
print "La naranja esta deliciosa\n"
else
print "No hay mas naranjas\n"
end
end
end | mit |
edersonjseder/devopsbank | userfront/src/main/java/com/userfront/web/controller/AppointmentController.java | 2299 | package com.userfront.web.controller;
import java.security.Principal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.userfront.backend.domain.Appointment;
import com.userfront.backend.domain.User;
import com.userfront.backend.service.AppointmentService;
import com.userfront.backend.service.UserService;
import com.userfront.enums.AppointmentEnum;
@Controller
@RequestMapping("/appointment")
public class AppointmentController {
public static final String APPOINTMENT_CREATE_URL_MAPPING = "/create";
@Autowired
private AppointmentService appointmentService;
@Autowired
private UserService userService;
// private ZoneId defaultZoneId = ZoneId.systemDefault();
@RequestMapping(value = APPOINTMENT_CREATE_URL_MAPPING, method = RequestMethod.GET)
public String createAppointment(Model model) {
Appointment appointment = new Appointment();
model.addAttribute(AppointmentEnum.MODEL_APPOINTMENT.getMessage(), appointment);
model.addAttribute(AppointmentEnum.MODEL_DATE.getMessage(), "");
return AppointmentEnum.APPOINTMENT_VIEW_NAME.getMessage();
}
@RequestMapping(value = APPOINTMENT_CREATE_URL_MAPPING, method = RequestMethod.POST)
public String createAppointmentPost(@ModelAttribute("appointment") Appointment appointment, @ModelAttribute("dateString") String date, Model model, Principal principal) throws ParseException{
SimpleDateFormat format = new SimpleDateFormat(AppointmentEnum.DATE_FORMAT.getMessage());
Date time = format.parse(date);
// Instant instant = time.toInstant();
// LocalDateTime localDate = instant.atZone(defaultZoneId).toLocalDateTime();
// appointment.setDate(localDate);
appointment.setDate(time);
User user = userService.findByUsername(principal.getName());
appointment.setUser(user);
appointmentService.createAppointment(appointment);
return AppointmentEnum.REDIRECT_USER_FRONT_VIEW_NAME.getMessage();
}
}
| mit |
visla/i18n-walker | example/test/js/test.js | 6239 | 'use strict';
var _ = require('underscore');
var common = require('../common');
var companyController = null;
var Security = require('../lib/security');
var orm = require('orm');
var selectn = require('selectn');
var striptags = require('striptags');
var async = require('async');
var SessionLogManager = require('../lib/session-log-manager');
var CompanySearchHelper = require('../lib/company-search-helper');
/*
GET /company/:company_seo_title (seo_title is company_id.company_name)
GET /company/:company_seo_title/reviews/create - make a new review page
GET /company/:company_seo_title/salaries/create - make a new salary
GET /company/:company_seo_title/reviews
GET /company/:company_seo_title/salaries
*/
/**
* Home controller.
*/
function CompanyController() {
/**
* Express app.
* @type {[type]}
*/
this.app = null;
}
/**
* setup controller.
* @param {[type]} app [description]
* @return {[type]} [description]
*/
CompanyController.prototype.setup = function(app) {
this.app = app;
app.get('/companies/list/:pageNumber', this.getListCompanies.bind(this));
app.get('/companies/suggest', this.getSuggestCompany.bind(this));
// Backend entry.
app.get('/backend/companies/:pageNumber',
Security.requiredScope('admin:companies:read'),
this.getBackendCompanies.bind(this));
app.get('/company/:companySeoTitle/suggested',
this.loadCompany.bind(this),
this.getCompanySuggested.bind(this));
// Backend entry - REST
app.put('/rest/v1/backend/company/:companyId/approval/:approved',
Security.requiredScope('admin:companies:write'),
this.restBackendApproveCompany.bind(this));
// Backend entry - REST
app.put('/rest/v1/backend/company/:companyId/remove/:removed',
Security.requiredScope('admin:companies:remove'),
this.restBackendRemoveCompany.bind(this));
app.put('/rest/v1/backend/company/:companyId/add_name',
Security.requiredScope('admin:companies:write'),
this.restBackendAddCompanyName.bind(this));
app.put('/rest/v1/backend/company/replace/:leftCompanyId/with/:rightCompanyId',
Security.requiredScope('admin:companies:write'),
this.restBackendReplaceCompany.bind(this));
app.put('/rest/v1/backend/company/:companyId/rename',
Security.requiredScope('admin:companies:write'),
this.restBackendRenameCompany.bind(this));
app.put('/rest/v1/backend/company/:companyId/ignore/:ignored',
Security.requiredScope('admin:companies:write'),
this.restBackendIgnoreCompany.bind(this));
app.delete('/rest/v1/backend/company/remove_name/:companyNameId',
Security.requiredScope('admin:companies:remove'),
this.restBackendRemoveCompanyName.bind(this));
// Form POSTs
app.post('/companies/suggest', this.postSuggestCompany.bind(this));
app.get('/companies/search', this.getSearchCompany.bind(this));
app.get('/company/:companySeoTitle',
this.loadCompany.bind(this),
this.getCompanyInfo.bind(this));
app.get('/rest/v1/company/search', this.restSearchCompany.bind(this));
app.post('/rest/v1/company/:companyId/track_30s_view', this.restTrack30sView.bind(this));
app.post('/rest/v1/company/:companyId/track_15s_view', this.restTrack15sView.bind(this));
// REST - Suggest company.
app.post('/rest/v1/company/suggest', this.restSuggestCompany.bind(this));
};
/**
* Get Or create new empty company.
* @param {[type]} companyId [description]
* @param {[type]} companyName [description]
* @param {[type]} req [description]
* @param {Function} callback [description]
* @return {[type]} [description]
*/
CompanyController.prototype.createOrGetCompany = function(companyName, req, callback) {
var self = this;
if (_.isEmpty(companyName)) {
process.nextTick(function() {
callback(new Error('missing company name'));
});
return;
}
// Create company or use existing one if needed.
GLOBAL.models.Company.find({ deleted: false })
.where('deleted = 0 AND (LOWER(name) = ?)', [companyName.toLowerCase()])
.all(function(err, companies) {
if (err) {
logger.error('finding company', { company_name: companyName, error: err});
return callback(err);
}
if (_.isEmpty(companies)) {
// Just create empty company profile here that needs approval.
self.createEmptyCompany(companyName, req, callback);
} else {
var company = companies[0];
callback(null, company);
}
});
};
/**
* Make new empty company.
* @param {[type]} companyName [description]
* @param {Function} callback [description]
* @return {[type]} [description]
*/
CompanyController.prototype.createEmptyCompany = function(companyName, req, callback) {
GLOBAL.models.Company.create({
name: companyName,
industry_id: 1,
source_ip: req.ip,
}, function(err, company) {
if (err) {
logger.error('Error creating empty company', {
company_name: companyName,
error: err
});
return callback(err);
}
callback(null, company);
});
};
/**
* Return companyId and companyName from req.params.
* @param {[type]} req [description]
* @return {[type]} [description]
*/
CompanyController.prototype.getCompanyInfoFromParams = function(req) {
var companyParts = req.params.companySeoTitle.split('.');
return {
companyId: companyParts[0],
companyName: companyParts[1],
};
};
/**
* Create company SEO Title.
* @param {[type]} companyId [description]
* @param {[type]} name [description]
* @return {[type]} [description]
*/
CompanyController.prototype.createSeoTitle = function(companyId, name) {
return companyId + '.' + name;
};
function test() {
common.restRespondError(res, 404, __n('Ova stranica ne postoji %s'));
}
/**
* Get company controller.
* @return {[type]} [description]
*/
module.exports.get = function() {
return companyController;
}; | mit |
bouzuya/hubot-backlog-burndownchart | lib/scripts/backlog-burndownchart.js | 4286 | // Description
// A Hubot script that DESCRIPTION
//
// Dependencies:
// "form-data": "^0.1.4",
// "hubot-arm": "^0.2.1",
// "hubot-request-arm": "^0.2.1",
// "q": "^1.0.1",
// "request": "^2.42.0"
//
// Configuration:
// HUBOT_BACKLOG_BURNDOWNCHART_SPACE_ID
// HUBOT_BACKLOG_BURNDOWNCHART_USERNAME
// HUBOT_BACKLOG_BURNDOWNCHART_PASSWORD
// HUBOT_BACKLOG_BURNDOWNCHART_API_KEY
// HUBOT_BACKLOG_BURNDOWNCHART_SLACK_TOKEN
//
// Commands:
// hubot backlog burndownchart <P> <M> - display the backlog burn down chart
//
// Author:
// bouzuya <[email protected]>
//
module.exports = function(robot) {
var API_KEY, BASE_URL, PASSWORD, SLACK_TOKEN, SPACE_ID, USERNAME, getBurnDownChart, getMilestone, getMilestones, uploadToSlack;
require('hubot-arm')(robot);
SPACE_ID = process.env.HUBOT_BACKLOG_BURNDOWNCHART_SPACE_ID;
USERNAME = process.env.HUBOT_BACKLOG_BURNDOWNCHART_USERNAME;
PASSWORD = process.env.HUBOT_BACKLOG_BURNDOWNCHART_PASSWORD;
API_KEY = process.env.HUBOT_BACKLOG_BURNDOWNCHART_API_KEY;
SLACK_TOKEN = process.env.HUBOT_BACKLOG_BURNDOWNCHART_SLACK_TOKEN;
BASE_URL = "https://" + SPACE_ID + ".backlog.jp";
getBurnDownChart = function(milestoneId) {
return robot.arm('request')({
method: 'POST',
url: BASE_URL + '/Login.action',
form: {
url: '',
userId: USERNAME,
password: PASSWORD
}
}).then(function(res) {
var cookies, sessionId;
cookies = res.headers['set-cookie'];
sessionId = cookies.filter(function(i) {
return i.match(/^JSESSIONID=/);
})[0];
return robot.arm('request')({
method: 'GET',
headers: {
cookie: sessionId
},
url: BASE_URL + '/BurndownChartSmall.action',
qs: {
milestoneId: milestoneId
},
encoding: 'binary'
});
}).then(function(res) {
return res.body;
});
};
getMilestones = function(projectKey) {
return robot.arm('request')({
method: 'GET',
url: BASE_URL + '/api/v2/projects/' + projectKey + '/versions',
qs: {
apiKey: API_KEY
},
format: 'json'
});
};
getMilestone = function(projectKey, milestoneName) {
return getMilestones(projectKey).then(function(res) {
var milestones;
milestones = res.json;
return milestones.filter(function(m) {
return m.name.toLowerCase() === milestoneName.toLowerCase();
})[0];
});
};
uploadToSlack = function(projectKey, milestoneName, image, channel) {
var Promise, fs, mkdirp, request;
fs = require('fs');
mkdirp = require('mkdirp');
request = require('request');
Promise = require('q').Promise;
return new Promise(function(resolve, reject) {
var dir, path, promise;
dir = './hubot-backlog-burndownchart' + '/' + projectKey;
path = dir + '/' + milestoneName + '.png';
promise = fs.existsSync(dir) ? Promise.resolve() : new Promise(function(resolve, reject) {
return mkdirp(dir, function(err) {
if (err != null) {
return reject(err);
}
return resolve();
});
});
return promise.then(function() {
var form, r, url;
fs.writeFileSync(path, image, {
encoding: 'binary'
});
url = 'https://slack.com/api/files.upload';
r = request.post(url, function(err, httpResponse, body) {
if (err != null) {
return reject(err);
}
return resolve();
});
form = r.form();
form.append('file', fs.createReadStream(path));
form.append('token', SLACK_TOKEN);
return form.append('channels', channel);
}).then(null, function(e) {
return reject(e);
});
});
};
return robot.respond(/backlog\s+burn(?:downchart)?\s+(\S+)\s+(\S+)$/i, function(res) {
var milestoneName, projectKey;
projectKey = res.match[1];
milestoneName = res.match[2];
return getMilestone(projectKey, milestoneName).then(function(milestone) {
if (milestone == null) {
return;
}
return getBurnDownChart(milestone.id);
}).then(function(image) {
return uploadToSlack(projectKey, milestoneName, image, res.envelope.room);
});
});
};
| mit |
karim/adila | database/src/main/java/adila/db/atlas40_n880e.java | 191 | // This file is automatically generated.
package adila.db;
/*
* ZTE
*
* DEVICE: atlas40
* MODEL: N880E
*/
final class atlas40_n880e {
public static final String DATA = "ZTE||";
}
| mit |
tejanium/satutempat_locale-client | spec/config/config_spec.rb | 471 | require 'spec_helper'
describe SatutempatLocale::Client::Config do
before :each do
SatutempatLocale::Client.reset_configuration
end
context 'override' do
before :each do
SatutempatLocale::Client.configure do |config|
config.server_url = 'http://anywhere.else'
end
end
it 'locale_path goes to http://anywhere.else' do
SatutempatLocale::Client.configuration.server_url.should eql 'http://anywhere.else'
end
end
end
| mit |
apo-j/Projects_Working | S/SOURCE/SOURCE.EspaceCandidature/SOURCE.EspaceCandidature.Web/JsModules/Global/Templates.js | 2318 | Templates.tabTemplate = "<li id='#{id}' class='#{class}' data-type='#{type}' data-vueid='#{vueid}' data-groupevueid='#{groupevueid}'><a href='#{href}'>#{label}</a></li>";
Templates.tabConflictTemplate = "<li id='#{id}' class='#{class}' data-type='#{type}' data-targetpanelid= '#{targetpanelid}' data-vueid='#{vueid}' data-groupevueid='#{groupevueid}'><a href='#{href}'>#{label}</a></li>";
Templates.closeTabTemplate = "<span class='ui-icon ui-icon-close' role='presentation'></span>"
Templates.spinnerTemplate = "<div class='progress progress-striped active'><div class='progress-bar progress-bar-info' style='width: 100%'></div></div>";
Templates.AccordionHeaderSpinner = "<div class='" + Static.TabAccordionSpinnerClass + "'><div id='circleG_1' class='circleG'></div><div id='circleG_2' class='circleG'></div><div id='circleG_3' class='circleG'></div></div>";
Templates.AjaxPopinTemplate = "<div id='#{id}' class='modal fade' tabindex='-1' style='display: none;' role='dialog' aria-hidden='true' aria-labelledby='#{ariaLabel}' data-remote = '1'> <div class='modal-header'><button type='button' class='close' data-dismiss='modal' aria-hidden='true'>×</button><h4 class='modal-title'>#{title}</h4></div><div class='modal-body clearfix'>" + Templates.spinnerTemplate + "</div></div>";
Templates.HtmlPopinTemplate = "<div id='#{id}' class='modal fade' tabindex='-1' style='display: none;' role='dialog' aria-hidden='true' aria-labelledby='#{ariaLabel}' data-remote = '1'> <div class='modal-header'><button type='button' class='close' data-dismiss='modal' aria-hidden='true'>×</button><h4 class='modal-title'>#{title}</h4></div><div class='modal-body clearfix'>#{content}</div></div>";
Templates.ConfirmDialogTemplate = "<div id='dialog-confirm' title='#{title}'><p><i class='glyphicon glyphicon-warning-sign'></i> #{text}</p></div>";
Templates.CalendarEventStatusIconTemplate = "<span class='fc-event-icon' style='padding: 0 3px; float:left; color: #{color}'><i class='glyphicon glyphicon-user'/></span>";
Templates.CalendarEventHelpIconTemplate = "<span class='fc-event-help' style='padding: 0 3px; float:right'><i class='fa fa-info-circle'/></span>";
Templates.AccordionEnteteMSGTemplate = "<div class='accordion-entete-msg' style='font-size:18px;font-weight:bold;margin-bottom:20px'>#{msg}</div>"; | mit |
ellianadwi/LARAVEL | resources/views/detail.blade.php | 1105 | @extends('layouts.app')
@section('content')
<div class="container">
<div class="col-sm-offset-2 col-sm-8">
<div class="panel panel-default">
<div class="panel-heading">
Current Tasks
</div>
<div class="panel-body">
<table class="table table-striped task-table">
<tbody>
<tr>
<td class="table-text"><div>Name</div></td>
<td class="table-text"><div>{{ $tasks->name }}</div></td>
</tr>
<tr>
<td class="table-text"><div>Address</div></td>
<td class="table-text"><div>{{ $tasks->address }}</div></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
| mit |
ghenga/ghenga-ui | app/controllers/navbar.js | 633 | (function () {
"use strict";
angular
.module("ghenga.controllers")
.controller("NavbarController", NavbarController);
function NavbarController($scope, $state, $rootScope, Authentication) {
var vm = this;
vm.logout = logout;
vm.account = Authentication.getAuthenticatedAccount();
$rootScope.$on('Authentication.Status', function (event, loggedIn) {
if (loggedIn) {
vm.account = Authentication.getAuthenticatedAccount();
return;
}
vm.account = {};
});
function logout() {
console.log("logout clicked");
Authentication.logout();
}
}
}());
| mit |
hguerrerojaime/bong2 | modules/validation/index.ts | 36 | export * from './src/ts/validation'; | mit |
daemon3000/BombingChap | Assets/_BomberChap/Scripts/AI/AIController.cs | 3510 | using UnityEngine;
using System.Collections;
namespace BomberChap
{
[RequireComponent(typeof(CharacterMotor))]
[RequireComponent(typeof(AIAnimatorParameters))]
public class AIController : MonoBehaviour
{
private const int DIR_UP = 0;
private const int DIR_DOWN = 1;
private const int DIR_RIGHT = 2;
private const int DIR_LEFT = 3;
[SerializeField]
private Animator m_animator;
[SerializeField]
private AudioClip m_hurtSound;
private CharacterMotor m_motor;
private Level m_currentLevel;
private AIAnimatorParameters m_animParam;
private int m_lastHDir;
private int m_lastVDir;
private int[] m_randDir;
private void Start()
{
m_motor = GetComponent<CharacterMotor>();
m_animParam = GetComponent<AIAnimatorParameters>();
m_currentLevel = LevelManager.GetLoadedLevel();
m_lastHDir = 0;
m_lastVDir = 0;
m_randDir = new int[4];
for(int i = 0; i < m_randDir.Length; i++)
m_randDir[i] = i;
}
private void Update()
{
if(!m_motor.IsAtDestination || m_currentLevel == null)
return;
Vector2 tilePos = m_currentLevel.WorldToTile(transform.position);
int h = m_lastHDir, v = m_lastVDir;
if((h == 0 && v == 0) || !CanMoveInDirection((int)tilePos.x, (int)tilePos.y, h, v))
ChooseNewMoveDirection((int)tilePos.x, (int)tilePos.y, out h, out v);
if(v > 0)
{
m_motor.SetDestination(m_currentLevel.TileToWorld((int)tilePos.x, (int)tilePos.y - 1, transform.position.z));
if(v != m_lastVDir)
m_animator.SetTrigger(m_animParam.StartMoveUp);
}
else if(v < 0)
{
m_motor.SetDestination(m_currentLevel.TileToWorld((int)tilePos.x, (int)tilePos.y + 1, transform.position.z));
if(v != m_lastVDir)
m_animator.SetTrigger(m_animParam.StartMoveDown);
}
else if(h > 0)
{
m_motor.SetDestination(m_currentLevel.TileToWorld((int)tilePos.x + 1, (int)tilePos.y, transform.position.z));
if(h != m_lastHDir)
m_animator.SetTrigger(m_animParam.StartMoveRight);
}
else if(h < 0)
{
m_motor.SetDestination(m_currentLevel.TileToWorld((int)tilePos.x - 1, (int)tilePos.y, transform.position.z));
if(h != m_lastHDir)
m_animator.SetTrigger(m_animParam.StartMoveLeft);
}
m_lastHDir = h;
m_lastVDir = v;
m_animator.SetInteger(m_animParam.MoveHorizontal, h);
m_animator.SetInteger(m_animParam.MoveVertical, v);
}
private bool CanMoveInDirection(int c, int r, int hDir, int vDir)
{
Tile tile = m_currentLevel.GetAt(c + hDir, r - vDir);
return tile != null && !tile.IsSolid;
}
private void ChooseNewMoveDirection(int c, int r, out int hDir, out int vDir)
{
Utils.Shuffle(m_randDir);
hDir = vDir = 0;
for(int i = 0; i < m_randDir.Length; i++) {
switch(m_randDir[i]) {
case DIR_UP:
if(CanMoveInDirection(c, r, 0, 1))
{
vDir = 1;
return;
}
break;
case DIR_DOWN:
if(CanMoveInDirection(c, r, 0, -1))
{
vDir = -1;
return;
}
break;
case DIR_RIGHT:
if(CanMoveInDirection(c, r, 1, 0))
{
hDir = 1;
return;
}
break;
case DIR_LEFT:
if(CanMoveInDirection(c, r, -1, 0))
{
hDir = -1;
return;
}
break;
default:
break;
}
}
}
private void OnTriggerEnter2D(Collider2D other)
{
if(other.tag == Tags.Flame)
{
NotificationCenter.Dispatch(Notifications.ON_ENEMY_DEAD);
AudioManager.PlaySound(m_hurtSound);
GameObject.Destroy(gameObject);
}
}
}
} | mit |
Credit-Jeeves/Heartland | src/Payum2/Heartland/Soap/Base/AuthenticateRequest.php | 2369 | <?php
namespace Payum2\Heartland\Soap\Base;
/**
* This class is generated from the following WSDL:
* https://heartlandpaymentservices.net/BillingDataManagement/v3/BillingDataManagementService.svc?xsd=xsd2
*/
class AuthenticateRequest
{
/**
* ApplicationID
*
* The property has the following characteristics/restrictions:
* - SchemaType: xs:int
*
* @var int
*/
protected $ApplicationID = null;
/**
* MacAddress
*
* The property has the following characteristics/restrictions:
* - SchemaType: xs:string
*
* @var string
*/
protected $MacAddress = null;
/**
* Password
*
* The property has the following characteristics/restrictions:
* - SchemaType: xs:string
*
* @var string
*/
protected $Password = null;
/**
* UserName
*
* The property has the following characteristics/restrictions:
* - SchemaType: xs:string
*
* @var string
*/
protected $UserName = null;
/**
* @param int $applicationID
*
* @return AuthenticateRequest
*/
public function setApplicationID($applicationID)
{
$this->ApplicationID = $applicationID;
return $this;
}
/**
* @return int
*/
public function getApplicationID()
{
return $this->ApplicationID;
}
/**
* @param string $macAddress
*
* @return AuthenticateRequest
*/
public function setMacAddress($macAddress)
{
$this->MacAddress = $macAddress;
return $this;
}
/**
* @return string
*/
public function getMacAddress()
{
return $this->MacAddress;
}
/**
* @param string $password
*
* @return AuthenticateRequest
*/
public function setPassword($password)
{
$this->Password = $password;
return $this;
}
/**
* @return string
*/
public function getPassword()
{
return $this->Password;
}
/**
* @param string $userName
*
* @return AuthenticateRequest
*/
public function setUserName($userName)
{
$this->UserName = $userName;
return $this;
}
/**
* @return string
*/
public function getUserName()
{
return $this->UserName;
}
}
| mit |
balinterdi/twuckoo | lib/twuckoo/duration_string.rb | 421 | module Twuckoo
module DurationString
class << self
MULTIPLIERS = { "s" => 1, "m" => 60, "h" => 60 * 60, "d" => 60 * 60 * 24, "w" => 60 * 60 * 24 * 7 }
def to_seconds(duration)
duration.scan(/(\d+)([smhdw])/).inject(0) do |seconds, match|
num, dur_chr = match
multiplier = MULTIPLIERS[dur_chr]
seconds + num.to_i * multiplier
end
end
end
end
end
| mit |
Muhammadkumail/Car_Secure_Me | example/src/main/java/com/felhr/serialportexample/MyNotification.java | 434 | package com.felhr.serialportexample;
import java.io.Serializable;
public class MyNotification implements Serializable{
private String title;
private String msg;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
| mit |
lulurun/earthworm | src/Scraper.js | 411 | module.exports = class Scraper {
/* eslint class-methods-use-this: 0 */
/* eslint-disable no-unused-vars */
scrape(content, emitter) {
throw new Error('You have to implement the method "scrape"!');
/**
* const item = parseForItem(content);
* emitter.emitItem(item);
* ...
* const url = parseForNewLink(content);
* emitter.emitRunner(url, new SomeSraper());
*/
}
};
| mit |
wonderzhou/read4u | src/main/java/com/zoe/wechat/message/event/SubscribeEvent.java | 89 | package com.zoe.wechat.message.event;
public class SubscribeEvent extends BaseEvent {
} | mit |
Mteuahasan/ror-microblog | public/jspm_packages/npm/[email protected] | 110 | define(["npm:[email protected]/aurelia-fetch-client"], function(main) {
return main;
}); | mit |
samuelcolvin/pydantic | pydantic/errors.py | 17547 | from decimal import Decimal
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Sequence, Set, Tuple, Type, Union
from .typing import display_as_type
if TYPE_CHECKING:
from .typing import DictStrAny
# explicitly state exports to avoid "from .errors import *" also importing Decimal, Path etc.
__all__ = (
'PydanticTypeError',
'PydanticValueError',
'ConfigError',
'MissingError',
'ExtraError',
'NoneIsNotAllowedError',
'NoneIsAllowedError',
'WrongConstantError',
'NotNoneError',
'BoolError',
'BytesError',
'DictError',
'EmailError',
'UrlError',
'UrlSchemeError',
'UrlSchemePermittedError',
'UrlUserInfoError',
'UrlHostError',
'UrlHostTldError',
'UrlPortError',
'UrlExtraError',
'EnumError',
'IntEnumError',
'EnumMemberError',
'IntegerError',
'FloatError',
'PathError',
'PathNotExistsError',
'PathNotAFileError',
'PathNotADirectoryError',
'PyObjectError',
'SequenceError',
'ListError',
'SetError',
'FrozenSetError',
'TupleError',
'TupleLengthError',
'ListMinLengthError',
'ListMaxLengthError',
'ListUniqueItemsError',
'SetMinLengthError',
'SetMaxLengthError',
'FrozenSetMinLengthError',
'FrozenSetMaxLengthError',
'AnyStrMinLengthError',
'AnyStrMaxLengthError',
'StrError',
'StrRegexError',
'NumberNotGtError',
'NumberNotGeError',
'NumberNotLtError',
'NumberNotLeError',
'NumberNotMultipleError',
'DecimalError',
'DecimalIsNotFiniteError',
'DecimalMaxDigitsError',
'DecimalMaxPlacesError',
'DecimalWholeDigitsError',
'DateTimeError',
'DateError',
'DateNotInThePastError',
'DateNotInTheFutureError',
'TimeError',
'DurationError',
'HashableError',
'UUIDError',
'UUIDVersionError',
'ArbitraryTypeError',
'ClassError',
'SubclassError',
'JsonError',
'JsonTypeError',
'PatternError',
'DataclassTypeError',
'CallableError',
'IPvAnyAddressError',
'IPvAnyInterfaceError',
'IPvAnyNetworkError',
'IPv4AddressError',
'IPv6AddressError',
'IPv4NetworkError',
'IPv6NetworkError',
'IPv4InterfaceError',
'IPv6InterfaceError',
'ColorError',
'StrictBoolError',
'NotDigitError',
'LuhnValidationError',
'InvalidLengthForBrand',
'InvalidByteSize',
'InvalidByteSizeUnit',
'MissingDiscriminator',
'InvalidDiscriminator',
)
def cls_kwargs(cls: Type['PydanticErrorMixin'], ctx: 'DictStrAny') -> 'PydanticErrorMixin':
"""
For built-in exceptions like ValueError or TypeError, we need to implement
__reduce__ to override the default behaviour (instead of __getstate__/__setstate__)
By default pickle protocol 2 calls `cls.__new__(cls, *args)`.
Since we only use kwargs, we need a little constructor to change that.
Note: the callable can't be a lambda as pickle looks in the namespace to find it
"""
return cls(**ctx)
class PydanticErrorMixin:
code: str
msg_template: str
def __init__(self, **ctx: Any) -> None:
self.__dict__ = ctx
def __str__(self) -> str:
return self.msg_template.format(**self.__dict__)
def __reduce__(self) -> Tuple[Callable[..., 'PydanticErrorMixin'], Tuple[Type['PydanticErrorMixin'], 'DictStrAny']]:
return cls_kwargs, (self.__class__, self.__dict__)
class PydanticTypeError(PydanticErrorMixin, TypeError):
pass
class PydanticValueError(PydanticErrorMixin, ValueError):
pass
class ConfigError(RuntimeError):
pass
class MissingError(PydanticValueError):
msg_template = 'field required'
class ExtraError(PydanticValueError):
msg_template = 'extra fields not permitted'
class NoneIsNotAllowedError(PydanticTypeError):
code = 'none.not_allowed'
msg_template = 'none is not an allowed value'
class NoneIsAllowedError(PydanticTypeError):
code = 'none.allowed'
msg_template = 'value is not none'
class WrongConstantError(PydanticValueError):
code = 'const'
def __str__(self) -> str:
permitted = ', '.join(repr(v) for v in self.permitted) # type: ignore
return f'unexpected value; permitted: {permitted}'
class NotNoneError(PydanticTypeError):
code = 'not_none'
msg_template = 'value is not None'
class BoolError(PydanticTypeError):
msg_template = 'value could not be parsed to a boolean'
class BytesError(PydanticTypeError):
msg_template = 'byte type expected'
class DictError(PydanticTypeError):
msg_template = 'value is not a valid dict'
class EmailError(PydanticValueError):
msg_template = 'value is not a valid email address'
class UrlError(PydanticValueError):
code = 'url'
class UrlSchemeError(UrlError):
code = 'url.scheme'
msg_template = 'invalid or missing URL scheme'
class UrlSchemePermittedError(UrlError):
code = 'url.scheme'
msg_template = 'URL scheme not permitted'
def __init__(self, allowed_schemes: Set[str]):
super().__init__(allowed_schemes=allowed_schemes)
class UrlUserInfoError(UrlError):
code = 'url.userinfo'
msg_template = 'userinfo required in URL but missing'
class UrlHostError(UrlError):
code = 'url.host'
msg_template = 'URL host invalid'
class UrlHostTldError(UrlError):
code = 'url.host'
msg_template = 'URL host invalid, top level domain required'
class UrlPortError(UrlError):
code = 'url.port'
msg_template = 'URL port invalid, port cannot exceed 65535'
class UrlExtraError(UrlError):
code = 'url.extra'
msg_template = 'URL invalid, extra characters found after valid URL: {extra!r}'
class EnumMemberError(PydanticTypeError):
code = 'enum'
def __str__(self) -> str:
permitted = ', '.join(repr(v.value) for v in self.enum_values) # type: ignore
return f'value is not a valid enumeration member; permitted: {permitted}'
class IntegerError(PydanticTypeError):
msg_template = 'value is not a valid integer'
class FloatError(PydanticTypeError):
msg_template = 'value is not a valid float'
class PathError(PydanticTypeError):
msg_template = 'value is not a valid path'
class _PathValueError(PydanticValueError):
def __init__(self, *, path: Path) -> None:
super().__init__(path=str(path))
class PathNotExistsError(_PathValueError):
code = 'path.not_exists'
msg_template = 'file or directory at path "{path}" does not exist'
class PathNotAFileError(_PathValueError):
code = 'path.not_a_file'
msg_template = 'path "{path}" does not point to a file'
class PathNotADirectoryError(_PathValueError):
code = 'path.not_a_directory'
msg_template = 'path "{path}" does not point to a directory'
class PyObjectError(PydanticTypeError):
msg_template = 'ensure this value contains valid import path or valid callable: {error_message}'
class SequenceError(PydanticTypeError):
msg_template = 'value is not a valid sequence'
class IterableError(PydanticTypeError):
msg_template = 'value is not a valid iterable'
class ListError(PydanticTypeError):
msg_template = 'value is not a valid list'
class SetError(PydanticTypeError):
msg_template = 'value is not a valid set'
class FrozenSetError(PydanticTypeError):
msg_template = 'value is not a valid frozenset'
class DequeError(PydanticTypeError):
msg_template = 'value is not a valid deque'
class TupleError(PydanticTypeError):
msg_template = 'value is not a valid tuple'
class TupleLengthError(PydanticValueError):
code = 'tuple.length'
msg_template = 'wrong tuple length {actual_length}, expected {expected_length}'
def __init__(self, *, actual_length: int, expected_length: int) -> None:
super().__init__(actual_length=actual_length, expected_length=expected_length)
class ListMinLengthError(PydanticValueError):
code = 'list.min_items'
msg_template = 'ensure this value has at least {limit_value} items'
def __init__(self, *, limit_value: int) -> None:
super().__init__(limit_value=limit_value)
class ListMaxLengthError(PydanticValueError):
code = 'list.max_items'
msg_template = 'ensure this value has at most {limit_value} items'
def __init__(self, *, limit_value: int) -> None:
super().__init__(limit_value=limit_value)
class ListUniqueItemsError(PydanticValueError):
code = 'list.unique_items'
msg_template = 'the list has duplicated items'
class SetMinLengthError(PydanticValueError):
code = 'set.min_items'
msg_template = 'ensure this value has at least {limit_value} items'
def __init__(self, *, limit_value: int) -> None:
super().__init__(limit_value=limit_value)
class SetMaxLengthError(PydanticValueError):
code = 'set.max_items'
msg_template = 'ensure this value has at most {limit_value} items'
def __init__(self, *, limit_value: int) -> None:
super().__init__(limit_value=limit_value)
class FrozenSetMinLengthError(PydanticValueError):
code = 'frozenset.min_items'
msg_template = 'ensure this value has at least {limit_value} items'
def __init__(self, *, limit_value: int) -> None:
super().__init__(limit_value=limit_value)
class FrozenSetMaxLengthError(PydanticValueError):
code = 'frozenset.max_items'
msg_template = 'ensure this value has at most {limit_value} items'
def __init__(self, *, limit_value: int) -> None:
super().__init__(limit_value=limit_value)
class AnyStrMinLengthError(PydanticValueError):
code = 'any_str.min_length'
msg_template = 'ensure this value has at least {limit_value} characters'
def __init__(self, *, limit_value: int) -> None:
super().__init__(limit_value=limit_value)
class AnyStrMaxLengthError(PydanticValueError):
code = 'any_str.max_length'
msg_template = 'ensure this value has at most {limit_value} characters'
def __init__(self, *, limit_value: int) -> None:
super().__init__(limit_value=limit_value)
class StrError(PydanticTypeError):
msg_template = 'str type expected'
class StrRegexError(PydanticValueError):
code = 'str.regex'
msg_template = 'string does not match regex "{pattern}"'
def __init__(self, *, pattern: str) -> None:
super().__init__(pattern=pattern)
class _NumberBoundError(PydanticValueError):
def __init__(self, *, limit_value: Union[int, float, Decimal]) -> None:
super().__init__(limit_value=limit_value)
class NumberNotGtError(_NumberBoundError):
code = 'number.not_gt'
msg_template = 'ensure this value is greater than {limit_value}'
class NumberNotGeError(_NumberBoundError):
code = 'number.not_ge'
msg_template = 'ensure this value is greater than or equal to {limit_value}'
class NumberNotLtError(_NumberBoundError):
code = 'number.not_lt'
msg_template = 'ensure this value is less than {limit_value}'
class NumberNotLeError(_NumberBoundError):
code = 'number.not_le'
msg_template = 'ensure this value is less than or equal to {limit_value}'
class NumberNotMultipleError(PydanticValueError):
code = 'number.not_multiple'
msg_template = 'ensure this value is a multiple of {multiple_of}'
def __init__(self, *, multiple_of: Union[int, float, Decimal]) -> None:
super().__init__(multiple_of=multiple_of)
class DecimalError(PydanticTypeError):
msg_template = 'value is not a valid decimal'
class DecimalIsNotFiniteError(PydanticValueError):
code = 'decimal.not_finite'
msg_template = 'value is not a valid decimal'
class DecimalMaxDigitsError(PydanticValueError):
code = 'decimal.max_digits'
msg_template = 'ensure that there are no more than {max_digits} digits in total'
def __init__(self, *, max_digits: int) -> None:
super().__init__(max_digits=max_digits)
class DecimalMaxPlacesError(PydanticValueError):
code = 'decimal.max_places'
msg_template = 'ensure that there are no more than {decimal_places} decimal places'
def __init__(self, *, decimal_places: int) -> None:
super().__init__(decimal_places=decimal_places)
class DecimalWholeDigitsError(PydanticValueError):
code = 'decimal.whole_digits'
msg_template = 'ensure that there are no more than {whole_digits} digits before the decimal point'
def __init__(self, *, whole_digits: int) -> None:
super().__init__(whole_digits=whole_digits)
class DateTimeError(PydanticValueError):
msg_template = 'invalid datetime format'
class DateError(PydanticValueError):
msg_template = 'invalid date format'
class DateNotInThePastError(PydanticValueError):
code = 'date.not_in_the_past'
msg_template = 'date is not in the past'
class DateNotInTheFutureError(PydanticValueError):
code = 'date.not_in_the_future'
msg_template = 'date is not in the future'
class TimeError(PydanticValueError):
msg_template = 'invalid time format'
class DurationError(PydanticValueError):
msg_template = 'invalid duration format'
class HashableError(PydanticTypeError):
msg_template = 'value is not a valid hashable'
class UUIDError(PydanticTypeError):
msg_template = 'value is not a valid uuid'
class UUIDVersionError(PydanticValueError):
code = 'uuid.version'
msg_template = 'uuid version {required_version} expected'
def __init__(self, *, required_version: int) -> None:
super().__init__(required_version=required_version)
class ArbitraryTypeError(PydanticTypeError):
code = 'arbitrary_type'
msg_template = 'instance of {expected_arbitrary_type} expected'
def __init__(self, *, expected_arbitrary_type: Type[Any]) -> None:
super().__init__(expected_arbitrary_type=display_as_type(expected_arbitrary_type))
class ClassError(PydanticTypeError):
code = 'class'
msg_template = 'a class is expected'
class SubclassError(PydanticTypeError):
code = 'subclass'
msg_template = 'subclass of {expected_class} expected'
def __init__(self, *, expected_class: Type[Any]) -> None:
super().__init__(expected_class=display_as_type(expected_class))
class JsonError(PydanticValueError):
msg_template = 'Invalid JSON'
class JsonTypeError(PydanticTypeError):
code = 'json'
msg_template = 'JSON object must be str, bytes or bytearray'
class PatternError(PydanticValueError):
code = 'regex_pattern'
msg_template = 'Invalid regular expression'
class DataclassTypeError(PydanticTypeError):
code = 'dataclass'
msg_template = 'instance of {class_name}, tuple or dict expected'
class CallableError(PydanticTypeError):
msg_template = '{value} is not callable'
class EnumError(PydanticTypeError):
code = 'enum_instance'
msg_template = '{value} is not a valid Enum instance'
class IntEnumError(PydanticTypeError):
code = 'int_enum_instance'
msg_template = '{value} is not a valid IntEnum instance'
class IPvAnyAddressError(PydanticValueError):
msg_template = 'value is not a valid IPv4 or IPv6 address'
class IPvAnyInterfaceError(PydanticValueError):
msg_template = 'value is not a valid IPv4 or IPv6 interface'
class IPvAnyNetworkError(PydanticValueError):
msg_template = 'value is not a valid IPv4 or IPv6 network'
class IPv4AddressError(PydanticValueError):
msg_template = 'value is not a valid IPv4 address'
class IPv6AddressError(PydanticValueError):
msg_template = 'value is not a valid IPv6 address'
class IPv4NetworkError(PydanticValueError):
msg_template = 'value is not a valid IPv4 network'
class IPv6NetworkError(PydanticValueError):
msg_template = 'value is not a valid IPv6 network'
class IPv4InterfaceError(PydanticValueError):
msg_template = 'value is not a valid IPv4 interface'
class IPv6InterfaceError(PydanticValueError):
msg_template = 'value is not a valid IPv6 interface'
class ColorError(PydanticValueError):
msg_template = 'value is not a valid color: {reason}'
class StrictBoolError(PydanticValueError):
msg_template = 'value is not a valid boolean'
class NotDigitError(PydanticValueError):
code = 'payment_card_number.digits'
msg_template = 'card number is not all digits'
class LuhnValidationError(PydanticValueError):
code = 'payment_card_number.luhn_check'
msg_template = 'card number is not luhn valid'
class InvalidLengthForBrand(PydanticValueError):
code = 'payment_card_number.invalid_length_for_brand'
msg_template = 'Length for a {brand} card must be {required_length}'
class InvalidByteSize(PydanticValueError):
msg_template = 'could not parse value and unit from byte string'
class InvalidByteSizeUnit(PydanticValueError):
msg_template = 'could not interpret byte unit: {unit}'
class MissingDiscriminator(PydanticValueError):
code = 'discriminated_union.missing_discriminator'
msg_template = 'Discriminator {discriminator_key!r} is missing in value'
class InvalidDiscriminator(PydanticValueError):
code = 'discriminated_union.invalid_discriminator'
msg_template = (
'No match for discriminator {discriminator_key!r} and value {discriminator_value!r} '
'(allowed values: {allowed_values})'
)
def __init__(self, *, discriminator_key: str, discriminator_value: Any, allowed_values: Sequence[Any]) -> None:
super().__init__(
discriminator_key=discriminator_key,
discriminator_value=discriminator_value,
allowed_values=', '.join(map(repr, allowed_values)),
)
| mit |
whitj00/VpnCoin-mac | src/qt/locale/bitcoin_da.ts | 128797 | <?xml version="1.0" ?><!DOCTYPE TS><TS language="da" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About VPNCoin</source>
<translation>Om VPNCoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>VPNCoin</b> version</source>
<translation><b>VPNCoin</b> version</translation>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The VPNCoin developers</source>
<translation>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The VPNCoin developers</translation>
</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 ([email protected]) and UPnP software written by Thomas Bernard.</source>
<translation>
Dette program er eksperimentelt.
Det er gjort tilgængeligt under MIT/X11-softwarelicensen. Se den medfølgende fil "COPYING" eller http://www.opensource.org/licenses/mit-license.php.
Produktet indeholder software, som er udviklet af OpenSSL Project til brug i OpenSSL Toolkit (http://www.openssl.org/). Kryptografisk software er skrevet af Eric Young ([email protected]), og UPnP-software er skrevet af Thomas Bernard.</translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Adressebog</translation>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation>Dobbeltklik for at redigere adresse eller mærkat</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Opret en ny adresse</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopier den valgte adresse til udklipsholder</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>&Ny adresse</translation>
</message>
<message>
<location line="-46"/>
<source>These are your VPNCoin 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>Dette er dine VPNCoin adresser til at modtage betalinger. Du ønsker måske at give en anden en til af hver afsender, så du kan holde styr på hvem der betaler dig.</translation>
</message>
<message>
<location line="+60"/>
<source>&Copy Address</source>
<translation>&Kopier adresse</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Vis &QR kode</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a VPNCoin address</source>
<translation>Signerer en meddelelse for at bevise du ejer en VPNCoin adresse</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Signere & Besked</translation>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation>Slet den markerede adresse fra listen</translation>
</message>
<message>
<location line="-14"/>
<source>Verify a message to ensure it was signed with a specified VPNCoin address</source>
<translation>Bekræft en meddelelse for at sikre, den blev underskrevet med en specificeret VPNCoin adresse</translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation>Bekræft Meddelse</translation>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Slet</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation>Kopier mærkat</translation>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation>Rediger</translation>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation>Eksporter Adresse Bog</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kommasepareret fil (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Fejl ved eksportering</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Kunne ikke skrive til fil% 1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Mærkat</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(ingen mærkat)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Adgangskodedialog</translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Indtast adgangskode</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Ny adgangskode</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Gentag ny adgangskode</translation>
</message>
<message>
<location line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation>Deaktivere trivielle sendmoney når OS konto er kompromitteret. Giver ingen reel sikkerhed.</translation>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation>Kun til renteberegning</translation>
</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>Indtast den nye adgangskode til tegnebogen.<br/>Brug venligst en adgangskode på <b>10 eller flere tilfældige tegn</b> eller <b>otte eller flere ord</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Krypter tegnebog</translation>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Denne funktion har brug for din tegnebogs adgangskode for at låse tegnebogen op.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Lås tegnebog op</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Denne funktion har brug for din tegnebogs adgangskode for at dekryptere tegnebogen.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Dekrypter tegnebog</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Skift adgangskode</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Indtast den gamle og den nye adgangskode til tegnebogen.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Bekræft tegnebogskryptering</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>Advarsel: Hvis du krypterer din tegnebog og mister din adgangskode, vil du <b> miste alle dine mønter </ b>!</translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Er du sikker på, at du ønsker at kryptere din tegnebog?</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>VIGTIGT: Enhver tidligere sikkerhedskopi, som du har lavet af tegnebogsfilen, bør blive erstattet af den nyligt genererede, krypterede tegnebogsfil. Af sikkerhedsmæssige årsager vil tidligere sikkerhedskopier af den ikke-krypterede tegnebogsfil blive ubrugelig i det øjeblik, du starter med at anvende den nye, krypterede tegnebog.</translation>
</message>
<message>
<location line="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Advarsel: Caps Lock-tasten er aktiveret!</translation>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation>Tegnebog krypteret</translation>
</message>
<message>
<location line="-58"/>
<source>VPNCoin 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>VPNCoin lukker nu for at afslutte krypteringen. Husk at en krypteret tegnebog ikke fuldt ud beskytter dine mønter mod at blive stjålet af malware som har inficeret din computer.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Tegnebogskryptering mislykkedes</translation>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Tegnebogskryptering mislykkedes på grund af en intern fejl. Din tegnebog blev ikke krypteret.</translation>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation>De angivne adgangskoder stemmer ikke overens.</translation>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation>Tegnebogsoplåsning mislykkedes</translation>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Den angivne adgangskode for tegnebogsdekrypteringen er forkert.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Tegnebogsdekryptering mislykkedes</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Tegnebogens adgangskode blev ændret.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+280"/>
<source>Sign &message...</source>
<translation>Underskriv besked...</translation>
</message>
<message>
<location line="+242"/>
<source>Synchronizing with network...</source>
<translation>Synkroniserer med netværk...</translation>
</message>
<message>
<location line="-308"/>
<source>&Overview</source>
<translation>&Oversigt</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Vis generel oversigt over tegnebog</translation>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation>&Transaktioner</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Gennemse transaktionshistorik</translation>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation>&Adressebog</translation>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Redigere listen over gemte adresser og etiketter</translation>
</message>
<message>
<location line="-13"/>
<source>&Receive coins</source>
<translation>&Modtag mønter</translation>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Vis listen over adresser for modtagne betalinger</translation>
</message>
<message>
<location line="-7"/>
<source>&Send coins</source>
<translation>&Send mønter</translation>
</message>
<message>
<location line="+35"/>
<source>E&xit</source>
<translation>Luk</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Afslut program</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about VPNCoin</source>
<translation>Vis oplysninger om VPNCoin</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Om Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Vis informationer om Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Indstillinger...</translation>
</message>
<message>
<location line="+4"/>
<source>&Encrypt Wallet...</source>
<translation>Krypter tegnebog...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>Sikkerhedskopier tegnebog...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>Skift adgangskode...</translation>
</message>
<message numerus="yes">
<location line="+250"/>
<source>~%n block(s) remaining</source>
<translation><numerusform>~%n blok resterer</numerusform><numerusform>~%n blokke resterende</numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation>Overført %1 af %2 blokke af transaktions historie (%3% færdig).</translation>
</message>
<message>
<location line="-247"/>
<source>&Export...</source>
<translation>&Eksporter...</translation>
</message>
<message>
<location line="-62"/>
<source>Send coins to a VPNCoin address</source>
<translation>Send mønter til en VPNCoin adresse</translation>
</message>
<message>
<location line="+45"/>
<source>Modify configuration options for VPNCoin</source>
<translation>Ændre indstillingsmuligheder for VPNCoin</translation>
</message>
<message>
<location line="+18"/>
<source>Export the data in the current tab to a file</source>
<translation>Eksportere data i den aktuelle fane til en fil</translation>
</message>
<message>
<location line="-14"/>
<source>Encrypt or decrypt wallet</source>
<translation>Kryptere eller dekryptere tegnebog</translation>
</message>
<message>
<location line="+3"/>
<source>Backup wallet to another location</source>
<translation>Lav sikkerhedskopi af tegnebogen til et andet sted</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Skift adgangskode anvendt til tegnebogskryptering</translation>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation>Fejlsøgningsvindue</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Åbn fejlsøgnings- og diagnosticeringskonsollen</translation>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation>Verificér besked...</translation>
</message>
<message>
<location line="-200"/>
<source>VPNCoin</source>
<translation>VPNCoin</translation>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation>Tegnebog</translation>
</message>
<message>
<location line="+178"/>
<source>&About VPNCoin</source>
<translation>&Om VPNCoin</translation>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>Vis / skjul</translation>
</message>
<message>
<location line="+9"/>
<source>Unlock wallet</source>
<translation>Lås tegnebog</translation>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation>&Lås tegnebog</translation>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation>Lås tegnebog</translation>
</message>
<message>
<location line="+34"/>
<source>&File</source>
<translation>Fil</translation>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation>Indstillinger</translation>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation>Hjælp</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Faneværktøjslinje</translation>
</message>
<message>
<location line="+8"/>
<source>Actions toolbar</source>
<translation>Fanværktøjslinje</translation>
</message>
<message>
<location line="+13"/>
<location line="+9"/>
<source>[testnet]</source>
<translation>[testnetværk]</translation>
</message>
<message>
<location line="+0"/>
<location line="+60"/>
<source>VPNCoin client</source>
<translation>VPNCoin klient</translation>
</message>
<message numerus="yes">
<location line="+70"/>
<source>%n active connection(s) to VPNCoin network</source>
<translation><numerusform>%n aktiv forbindelse til VPNCoin netværk</numerusform><numerusform>%n aktive forbindelser til VPNCoin netværk</numerusform></translation>
</message>
<message>
<location line="+40"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation>Downloadet %1 blokke af transaktions historie.</translation>
</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>Renter.<br> Din andel er% 1 <br> Netværkets andel er% 2 <br> Forventet tid til at modtage rente %3</translation>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation>Ingen rente fordi tegnebog er låst</translation>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation>Ingen rente fordi tegnebog er offline</translation>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation>Ingen rente fordi tegnebog er ved at synkronisere</translation>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation>Ingen rente fordi der ingen modne mønter eksistere </translation>
</message>
<message numerus="yes">
<location line="-403"/>
<source>%n second(s) ago</source>
<translation><numerusform>%n sekund siden</numerusform><numerusform>%n sekunder siden</numerusform></translation>
</message>
<message>
<location line="-284"/>
<source>&Unlock Wallet...</source>
<translation>Lås tegnebog op</translation>
</message>
<message numerus="yes">
<location line="+288"/>
<source>%n minute(s) ago</source>
<translation><numerusform>%n minut siden</numerusform><numerusform>%n minutter siden</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation><numerusform>%n time siden</numerusform><numerusform>%n timer siden</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation><numerusform>%n dag siden</numerusform><numerusform>%n dage siden</numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation>Opdateret</translation>
</message>
<message>
<location line="+7"/>
<source>Catching up...</source>
<translation>Indhenter...</translation>
</message>
<message>
<location line="+10"/>
<source>Last received block was generated %1.</source>
<translation>Sidst modtagne blok blev genereret %1.</translation>
</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>Denne transaktion er over grænsen størrelse. Du kan stadig sende det for et gebyr på %1, der går til de noder, der behandler din transaktion og hjælper med at støtte netværket. Ønsker du at betale gebyret?</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm transaction fee</source>
<translation>Bekræft transaktionsgebyr</translation>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation>Afsendt transaktion</translation>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation>Indgående transaktion</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Dato: %1
Beløb: %2
Type: %3
Adresse: %4
</translation>
</message>
<message>
<location line="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation>URI håndtering</translation>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid VPNCoin address or malformed URI parameters.</source>
<translation>URI kan ikke tolkes! Dette kan skyldes en ugyldig VPNCoin adresse eller misdannede URI parametre.</translation>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Tegnebog er <b>krypteret</b> og i øjeblikket <b>ulåst</b></translation>
</message>
<message>
<location line="+10"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Tegnebog er <b>krypteret</b> og i øjeblikket <b>låst</b></translation>
</message>
<message>
<location line="+25"/>
<source>Backup Wallet</source>
<translation>Sikkerhedskopier Tegnebog</translation>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation>Tegnebogsdata (*.dat)</translation>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation>Sikkerhedskopiering Mislykkedes</translation>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation>Der opstod en fejl under forsøg på at gemme data i tegnebogen til den nye placering.</translation>
</message>
<message numerus="yes">
<location line="+76"/>
<source>%n second(s)</source>
<translation><numerusform>%n sekund</numerusform><numerusform>%n sekunder</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation><numerusform>%n minut</numerusform><numerusform>%n minutter</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s)</source>
<translation><numerusform>%n time(r)</numerusform><numerusform>%n time(r)</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation><numerusform>%n dag(e)</numerusform><numerusform>%n dag(e)</numerusform></translation>
</message>
<message>
<location line="+18"/>
<source>Not staking</source>
<translation>Ingen rente</translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+109"/>
<source>A fatal error occurred. VPNCoin can no longer continue safely and will quit.</source>
<translation>Der opstod en fejl under forsøg på at gemme dataene i tegnebogen til den nye placering.</translation>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+90"/>
<source>Network Alert</source>
<translation>Netværksadvarsel</translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation>Mønt Kontrol</translation>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation>Antal:</translation>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation>Beløb:</translation>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation>Prioritet:</translation>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation>Gebyr:</translation>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation>Lav Udgangseffekt:</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+551"/>
<source>no</source>
<translation>nej</translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation>Efter Gebyr:</translation>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation>Ændre:</translation>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation>(fra)vælg alle</translation>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation>Træ tilstand</translation>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation>Liste tilstand</translation>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation>Beløb</translation>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation>Mærkat</translation>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation>Bekræftelser</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation>Bekræftet</translation>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation>Prioritet</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-515"/>
<source>Copy address</source>
<translation>Kopier adresse</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopier mærkat</translation>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation>Kopier beløb</translation>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation>Kopier transaktionens ID</translation>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation>Kopier antal</translation>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation>Kopier transkationsgebyr</translation>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation>Kopier efter transkationsgebyr</translation>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation>Kopier bytes</translation>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation>Kopier prioritet</translation>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation>Lav udgangseffekt</translation>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation>Kopier ændring</translation>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation>højeste</translation>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation>høj</translation>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation>medium-høj</translation>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation>medium</translation>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation>lav-medium</translation>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation>lav</translation>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation>lavest</translation>
</message>
<message>
<location line="+155"/>
<source>DUST</source>
<translation>DUST</translation>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation>ja</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>Denne etiket bliver rød, hvis transaktionen størrelse er større end 10000 byte.
Det betyder, at et gebyr på mindst %1 per kb er påkrævet.
Kan variere + / - 1 byte per indgang.</translation>
</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>Transaktioner med højere prioritet får mere sandsynligt en blok.
Denne etiket bliver rød, hvis prioritet er mindre end "medium".
Det betyder, at et gebyr på mindst %1 per kb er påkrævet.</translation>
</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>Denne etiket bliver rød, hvis nogen modtager et beløb, der er mindre end %1.
Det betyder, at et gebyr på mindst %2 er påkrævet.
Beløb under 0,546 gange det minimale gebyr er vist som DUST.</translation>
</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>Denne etiket bliver rød, hvis ændringen er mindre end %1.
Det betyder, at et gebyr på mindst %2 er påkrævet.</translation>
</message>
<message>
<location line="+37"/>
<location line="+66"/>
<source>(no label)</source>
<translation>(ingen mærkat)</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation>skift fra %1 (%2)</translation>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation>(skift)</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Rediger adresse</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>Mærkat</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Etiketten er forbundet med denne post i adressekartoteket</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>Adressen er forbundet med denne post i adressekartoteket. Dette kan kun ændres til sende adresser.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<source>New receiving address</source>
<translation>Ny modtagelsesadresse</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Ny afsendelsesadresse</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Rediger modtagelsesadresse</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Rediger afsendelsesadresse</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Den indtastede adresse "%1" er allerede i adressebogen.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid VPNCoin address.</source>
<translation>Den indtastede adresse "%1" er ikke en gyldig VPNCoin adresse.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Kunne ikke låse tegnebog op.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Ny nøglegenerering mislykkedes.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+420"/>
<location line="+12"/>
<source>VPNCoin-Qt</source>
<translation>VPNCoin-Qt</translation>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>version</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Anvendelse:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation>Kommandolinjeparametrene</translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>UI opsætning</translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Indstil sprog, for eksempel "de_DE" (standard: system locale)</translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Start minimeret</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation>Vis splash skærm ved opstart (default: 1)</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Indstillinger</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>Generelt</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>Valgfri transaktionsgebyr pr kB, som hjælper med at sikre dine transaktioner bliver behandlet hurtigt. De fleste transaktioner er 1 kB. Gebyr 0,01 anbefales.</translation>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>Betal transaktionsgebyr</translation>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation>Reserveret beløb deltager ikke i forrentning og er derfor tilrådighed til enhver tid.</translation>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation>Reserve</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start VPNCoin after logging in to the system.</source>
<translation>Automatisk start VPNCoin efter at have logget ind på systemet.</translation>
</message>
<message>
<location line="+3"/>
<source>&Start VPNCoin on system login</source>
<translation>&Start VPNCoin ved systems login</translation>
</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>Frigør blok og adressedatabaser ved lukning. Det betyder, at de kan flyttes til et anden data-bibliotek, men det sinker lukning. Tegnebogen er altid frigjort.</translation>
</message>
<message>
<location line="+3"/>
<source>&Detach databases at shutdown</source>
<translation>&Frigør databaser ved lukning</translation>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation>Netværk</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the VPNCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Automatisk åbne VPNCoin klient-port på routeren. Dette virker kun, når din router understøtter UPnP og er det er aktiveret.</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Konfigurer port vha. UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the VPNCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation>Opret forbindelse til VPNCoin netværk via en SOCKS proxy (fx ved tilslutning gennem Tor).</translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>&Tilslut gennem SOCKS proxy:</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>Proxy-IP:</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>IP-adressen på proxy (f.eks 127.0.0.1)</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>Port:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Porten på proxyen (f.eks. 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS-version</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>SOCKS-version af proxyen (f.eks. 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>Vindue</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Vis kun et statusikon efter minimering af vinduet.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>Minimer til statusfeltet i stedet for proceslinjen</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>Minimer i stedet for at afslutte programmet, når vinduet lukkes. Når denne indstilling er valgt, vil programmet kun blive lukket, når du har valgt Afslut i menuen.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>Minimer ved lukning</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>Visning</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>Brugergrænsefladesprog:</translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting VPNCoin.</source>
<translation>Sproget i brugergrænsefladen kan indstilles her. Denne indstilling vil træde i kraft efter genstart af VPNCoin tegnebog.</translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>Enhed at vise beløb i:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Vælg den standard underopdelingsenhed, som skal vises i brugergrænsefladen og ved afsendelse af bitcoins.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show VPNCoin addresses in the transaction list or not.</source>
<translation>Få vist VPNCoin adresser på listen over transaktioner eller ej.</translation>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>Vis adresser i transaktionsliste</translation>
</message>
<message>
<location line="+7"/>
<source>Whether to show coin control features or not.</source>
<translation> Vis mønt kontrol funktioner eller ej.</translation>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</source>
<translation>Vis mønt & kontrol funktioner (kun for eksperter!)</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>OK</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>Annuller</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>&Anvend</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+55"/>
<source>default</source>
<translation>standard</translation>
</message>
<message>
<location line="+149"/>
<location line="+9"/>
<source>Warning</source>
<translation>Advarsel</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting VPNCoin.</source>
<translation>Denne indstilling vil træde i kraft efter genstart af VPNCoin.</translation>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Ugyldig proxy-adresse</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Formular</translation>
</message>
<message>
<location line="+33"/>
<location line="+231"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the VPNCoin network after a connection is established, but this process has not completed yet.</source>
<translation>De viste oplysninger kan være forældet. Din tegnebog synkroniserer automatisk med VPNCoin netværket efter en forbindelse er etableret, men denne proces er ikke afsluttet endnu.</translation>
</message>
<message>
<location line="-160"/>
<source>Stake:</source>
<translation>Rente:</translation>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>Ubekræftede:</translation>
</message>
<message>
<location line="-107"/>
<source>Wallet</source>
<translation>Tegnebog</translation>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation>Brugbar:</translation>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation>Din nuværende tilgængelige saldo</translation>
</message>
<message>
<location line="+71"/>
<source>Immature:</source>
<translation>Umodne:</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation>Udvunden saldo, som endnu ikke er modnet</translation>
</message>
<message>
<location line="+20"/>
<source>Total:</source>
<translation>Total:</translation>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation>Din nuværende totale saldo</translation>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Nyeste transaktioner</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>Summen af transaktioner, der endnu mangler at blive bekræftet, og ikke tæller mod den nuværende balance</translation>
</message>
<message>
<location line="-29"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation>I alt mønter, der bliver berentet, og endnu ikke tæller mod den nuværende balance</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+113"/>
<location line="+1"/>
<source>out of sync</source>
<translation>ikke synkroniseret</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation>QR Kode Dialog</translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation>Betalingsanmodning</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Antal:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Label:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Besked:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>&Gem Som...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation>Fejl kode URI i QR kode.</translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation>Det indtastede beløb er ugyldig, venligst tjek igen.</translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>Resulterende URI for lang, prøv at reducere teksten til etiketten / besked.</translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation>Gem QR kode</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>PNG billede (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Klientnavn</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>N/A</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Klientversion</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>Information</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>Anvender OpenSSL-version</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>Opstartstid</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Netværk</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Antal forbindelser</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation>På testnet</translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>Blokkæde</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Nuværende antal blokke</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation>Estimeret antal blokke</translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>Tidsstempel for seneste blok</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>Åbn</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation>Kommandolinjeparametrene</translation>
</message>
<message>
<location line="+7"/>
<source>Show the VPNCoin-Qt help message to get a list with possible VPNCoin command-line options.</source>
<translation>Vis VPNCoin-Qt hjælpe besked for at få en liste med mulige VPNCoin kommandolinjeparametre.</translation>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation>&Vis</translation>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>Konsol</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>Byggedato</translation>
</message>
<message>
<location line="-104"/>
<source>VPNCoin - Debug window</source>
<translation>VPNCoin - Debug vindue</translation>
</message>
<message>
<location line="+25"/>
<source>VPNCoin Core</source>
<translation>VPNCoin Kerne</translation>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>Fejlsøgningslogfil</translation>
</message>
<message>
<location line="+7"/>
<source>Open the VPNCoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation>Åbn VPNCoin debug logfilen fra den nuværende data mappe. Dette kan tage et par sekunder for store logfiler.</translation>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Ryd konsol</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-33"/>
<source>Welcome to the VPNCoin RPC console.</source>
<translation>Velkommen til VPNCoin RPC-konsol.</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>Brug op og ned-piletasterne til at navigere historikken og <b>Ctrl-L</b> til at rydde skærmen.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Tast <b>help</b> for en oversigt over de tilgængelige kommandoer.</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>Send bitcoins</translation>
</message>
<message>
<location line="+76"/>
<source>Coin Control Features</source>
<translation>Mønt Kontrol Egenskaber</translation>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation>Input ...</translation>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation>Automatisk valgt</translation>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation>Utilstrækkelig midler!</translation>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation>Antal:</translation>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation>0</translation>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation>Beløb:</translation>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 BC</source>
<translation>123.456 BC {0.00 ?}</translation>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation>Prioritet:</translation>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation>medium</translation>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation>Gebyr</translation>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation>Lav udgangseffekt</translation>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation>nej</translation>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation>Efter gebyr</translation>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation>Skift</translation>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation>Ændre adresse</translation>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation>Send til flere modtagere på en gang</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>Tilføj modtager</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>Fjern alle transaktions omkostnings felter </translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Ryd alle</translation>
</message>
<message>
<location line="+28"/>
<source>Balance:</source>
<translation>Saldo:</translation>
</message>
<message>
<location line="+16"/>
<source>123.456 BC</source>
<translation>123.456 BC</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Bekræft afsendelsen</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>Afsend</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-173"/>
<source>Enter a VPNCoin address (e.g. V8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation>Indtast en VPNCoin-adresse (f.eks V8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation>Kopier antal</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopier beløb</translation>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation>Kopier transkationsgebyr</translation>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation>Kopier efter transkationsgebyr</translation>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation>Kopier bytes</translation>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation>Kopier prioritet</translation>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation>Kopier lav produktion</translation>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation>Kopier forandring</translation>
</message>
<message>
<location line="+86"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> til %2 (%3)</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Bekræft afsendelse af bitcoins</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Er du sikker på du vil sende% 1?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation>og</translation>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Modtagerens adresse er ikke gyldig. Tjek venligst adressen igen.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Beløbet til betaling skal være større end 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Beløbet overstiger din saldo.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Totalen overstiger din saldo, når %1 transaktionsgebyr er inkluderet.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Duplikeret adresse fundet. Du kan kun sende til hver adresse en gang pr. afsendelse.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed.</source>
<translation>Fejl: Transaktion oprettelse mislykkedes.</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>Fejl: Transaktionen blev afvist. Dette kan ske, hvis nogle af mønterne i din tegnebog allerede er blevet brugt, som hvis du brugte en kopi af wallet.dat og mønterne blev brugt i kopien, men ikke markeret som brugt her.</translation>
</message>
<message>
<location line="+251"/>
<source>WARNING: Invalid VPNCoin address</source>
<translation>ADVARSEL: Ugyldig VPNCoin adresse</translation>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>(ingen mærkat)</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation>ADVARSEL: ukendt adresse forandring</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Form</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>Beløb:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Betal til:</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>Indtast en mærkat for denne adresse for at føje den til din adressebog</translation>
</message>
<message>
<location line="+9"/>
<source>&Label:</source>
<translation>Mærkat:</translation>
</message>
<message>
<location line="+18"/>
<source>The address to send the payment to (e.g. V8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation>Adressen til at sende betalingen til (f.eks V8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation>
</message>
<message>
<location line="+10"/>
<source>Choose address from address book</source>
<translation>Vælg adresse fra adressebogen</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>Indsæt adresse fra udklipsholderen</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>Fjern denne modtager</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a VPNCoin address (e.g. V8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation>Indtast en VPNCoin-adresse (f.eks V8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>Signature - Underskriv/verificér en besked</translation>
</message>
<message>
<location line="+13"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation>Underskriv besked</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>Du kan underskrive beskeder med dine Bitcoin-adresser for at bevise, at de tilhører dig. Pas på ikke at underskrive noget vagt, da phisingangreb kan narre dig til at overdrage din identitet. Underskriv kun fuldt detaljerede udsagn, du er enig i.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. V8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation>Adresse til at underskrive meddelelsen med (f.eks V8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation>
</message>
<message>
<location line="+10"/>
<location line="+203"/>
<source>Choose an address from the address book</source>
<translation>Vælg en adresse fra adressebogen</translation>
</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>Indsæt adresse fra udklipsholderen</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>Indtast beskeden, du ønsker at underskrive</translation>
</message>
<message>
<location line="+24"/>
<source>Copy the current signature to the system clipboard</source>
<translation>Kopier den nuværende underskrift til systemets udklipsholder</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this VPNCoin address</source>
<translation>Underskriv brevet for at bevise du ejer denne VPNCoin adresse</translation>
</message>
<message>
<location line="+17"/>
<source>Reset all sign message fields</source>
<translation>Nulstil alle "underskriv besked"-felter</translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Ryd alle</translation>
</message>
<message>
<location line="-87"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation>Verificér besked</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>Indtast den underskrevne adresse, beskeden (inkluder linjeskift, mellemrum mv. nøjagtigt, som de fremgår) og underskriften for at verificére beskeden. Vær forsigtig med ikke at lægge mere i underskriften end besked selv, så du undgår at blive narret af et man-in-the-middle-angreb.</translation>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. V8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation>Adressen meddelelse blev underskrevet med (f.eks V8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified VPNCoin address</source>
<translation>Kontroller meddelelsen for at sikre, at den blev indgået med den angivne VPNCoin adresse</translation>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation>Nulstil alle "verificér besked"-felter</translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a VPNCoin address (e.g. V8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation>Indtast en VPNCoin-adresse (f.eks V8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Klik "Underskriv besked" for at generere underskriften</translation>
</message>
<message>
<location line="+3"/>
<source>Enter VPNCoin signature</source>
<translation>Indtast VPNCoin underskrift</translation>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>Den indtastede adresse er ugyldig.</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>Tjek venligst adressen, og forsøg igen.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation>Den indtastede adresse henviser ikke til en nøgle.</translation>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>Tegnebogsoplåsning annulleret.</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>Den private nøgle for den indtastede adresse er ikke tilgængelig.</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Underskrivning af besked mislykkedes.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Besked underskrevet.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Underskriften kunne ikke afkodes.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Tjek venligst underskriften, og forsøg igen.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>Underskriften matcher ikke beskedens indhold.</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Verificéring af besked mislykkedes.</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Besked verificéret.</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+19"/>
<source>Open until %1</source>
<translation>Åben indtil %1</translation>
</message>
<message numerus="yes">
<location line="-2"/>
<source>Open for %n block(s)</source>
<translation><numerusform>Åben for %n blok</numerusform><numerusform>Åben for %n blok(ke)</numerusform></translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation>konflikt</translation>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation>%1/offline</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/ubekræftet</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 bekræftelser</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Status</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation><numerusform>, transmitteret igennem %n knude(r)</numerusform><numerusform>, transmitteret igennem %n knude(r)</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>Kilde</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Genereret</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>Fra</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>Til</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation>egen adresse</translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>mærkat</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Kredit</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation><numerusform>modner efter yderligere %n blok(ke)</numerusform><numerusform>modner efter yderligere %n blok(ke)</numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>ikke accepteret</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Debet</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Transaktionsgebyr</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Nettobeløb</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Besked</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Kommentar</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>Transaktionens ID</translation>
</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>Generet mønter skal modne 510 blokke, før de kan blive brugt. Når du genererede denne blok blev det transmitteret til netværket, der tilføjes til blokkæden. Hvis det mislykkes at komme ind i kæden, vil dens tilstand ændres til "ikke godkendt", og det vil ikke være brugbar. Dette kan lejlighedsvis ske, hvis en anden node genererer en blok et par sekunder efter din.</translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>Fejlsøgningsinformation</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Transaktion</translation>
</message>
<message>
<location line="+5"/>
<source>Inputs</source>
<translation>Input</translation>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Beløb</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>sand</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>falsk</translation>
</message>
<message>
<location line="-211"/>
<source>, has not been successfully broadcast yet</source>
<translation>, er ikke blevet transmitteret endnu</translation>
</message>
<message>
<location line="+35"/>
<source>unknown</source>
<translation>ukendt</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Transaktionsdetaljer</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Denne rude viser en detaljeret beskrivelse af transaktionen</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>Type</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Beløb</translation>
</message>
<message>
<location line="+60"/>
<source>Open until %1</source>
<translation>Åben indtil %1</translation>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Bekræftet (%1 bekræftelser)</translation>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation><numerusform>Åben %n blok(ke) yderligere</numerusform><numerusform>Åben %n blok(ke) yderligere</numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation>Offline</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation>Ubekræftede</translation>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation>Bekræftelse (% 1 af% 2 anbefalede bekræftelser)</translation>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation>Konflikt</translation>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation>Umodne (% 1 bekræftelser, vil være tilgængelige efter% 2)</translation>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Denne blok blev ikke modtaget af nogen andre knuder og vil formentlig ikke blive accepteret!</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Genereret, men ikke accepteret</translation>
</message>
<message>
<location line="+42"/>
<source>Received with</source>
<translation>Modtaget med</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Modtaget fra</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Sendt til</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Betaling til dig selv</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Udvundne</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(n/a)</translation>
</message>
<message>
<location line="+190"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Transaktionsstatus. Hold musen over dette felt for at vise antallet af bekræftelser.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Dato og klokkeslæt for modtagelse af transaktionen.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Transaktionstype.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Destinationsadresse for transaktion.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Beløb fjernet eller tilføjet balance.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+55"/>
<location line="+16"/>
<source>All</source>
<translation>Alle</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>I dag</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Denne uge</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Denne måned</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Sidste måned</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Dette år</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Interval...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Modtaget med</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Sendt til</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Til dig selv</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Udvundne</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Andet</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Indtast adresse eller mærkat for at søge</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Minimumsbeløb</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Kopier adresse</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopier mærkat</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopier beløb</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation>Kopier transaktionens ID</translation>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Rediger mærkat</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Vis transaktionsdetaljer</translation>
</message>
<message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation>Exportere transaktionsdata</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kommasepareret fil (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Bekræftet</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Type</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Mærkat</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Beløb</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Fejl exporting</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Kunne ikke skrive til filen% 1.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Interval:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>til</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+206"/>
<source>Sending...</source>
<translation>Sender...</translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+33"/>
<source>VPNCoin version</source>
<translation>VPNCoin version</translation>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation>Anvendelse:</translation>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or vpncoind</source>
<translation>Send kommando til-server eller vpncoind</translation>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation>Liste over kommandoer</translation>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation>Få hjælp til en kommando</translation>
</message>
<message>
<location line="+2"/>
<source>Options:</source>
<translation>Indstillinger:</translation>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: vpncoin.conf)</source>
<translation>Angiv konfigurationsfil (default: vpncoin.conf)</translation>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: vpncoind.pid)</source>
<translation>Angiv pid fil (standard: vpncoind.pid)</translation>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation>Angiv tegnebogs fil (indenfor data mappe)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Angiv datakatalog</translation>
</message>
<message>
<location line="+2"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Angiv databasecachestørrelse i megabytes (standard: 25)</translation>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation>Set database disk logstørrelsen i megabyte (standard: 100)</translation>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 15714 or testnet: 25714)</source>
<translation>Lyt efter forbindelser på <port> (default: 15714 eller Testnet: 25714)</translation>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Oprethold højest <n> forbindelser til andre i netværket (standard: 125)</translation>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Forbind til en knude for at modtage adresse, og afbryd</translation>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation>Angiv din egen offentlige adresse</translation>
</message>
<message>
<location line="+5"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation>Binder til en given adresse. Brug [host]: port notation for IPv6</translation>
</message>
<message>
<location line="+2"/>
<source>Stake your coins to support network and gain reward (default: 1)</source>
<translation>Opbevar dine mønter for at støtte netværket og få belønning (default: 1)</translation>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Grænse for afbrydelse til dårlige forbindelser (standard: 100)</translation>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Antal sekunder dårlige forbindelser skal vente før reetablering (standard: 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>Der opstod en fejl ved angivelse af RPC-porten %u til at lytte på IPv4: %s</translation>
</message>
<message>
<location line="+51"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation>Frigør blok og adresse databaser. Øg shutdown tid (default: 0)</translation>
</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>Fejl: Transaktionen blev afvist. Dette kan ske, hvis nogle af mønterne i din pung allerede er blevet brugt, som hvis du brugte en kopi af wallet.dat og mønterne blev brugt i kopien, men ikke markeret her.</translation>
</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>Fejl: Denne transaktion kræver et transaktionsgebyr på mindst% s på grund af dens størrelse, kompleksitet, eller anvendelse af nylig modtaget midler</translation>
</message>
<message>
<location line="-87"/>
<source>Listen for JSON-RPC connections on <port> (default: 15715 or testnet: 25715)</source>
<translation>Spor efter JSON-RPC-forbindelser på <port> (default: 15715 eller Testnet: 25715)</translation>
</message>
<message>
<location line="-11"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Accepter kommandolinje- og JSON-RPC-kommandoer</translation>
</message>
<message>
<location line="+101"/>
<source>Error: Transaction creation failed </source>
<translation>Fejl: Transaktion oprettelse mislykkedes</translation>
</message>
<message>
<location line="-5"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation>Fejl: Wallet låst, ude af stand til at skabe transaktion</translation>
</message>
<message>
<location line="-8"/>
<source>Importing blockchain data file.</source>
<translation>Importerer blockchain datafil.</translation>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation>Import af bootstrap blockchain datafil.</translation>
</message>
<message>
<location line="-88"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Kør i baggrunden som en service, og accepter kommandoer</translation>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation>Brug testnetværket</translation>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Accepter forbindelser udefra (standard: 1 hvis hverken -proxy eller -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>Der opstod en fejl ved angivelse af RPC-porten %u til at lytte på IPv6, falder tilbage til 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>Fejl initialisering database miljø% s! For at gendanne, BACKUP denne mappe, og derefter fjern alt bortset fra wallet.dat.</translation>
</message>
<message>
<location line="-20"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation>Angiv maksimal størrelse på high-priority/low-fee transaktioner i bytes (standard: 27000)</translation>
</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>Advarsel: -paytxfee er sat meget højt! Dette er det gebyr du vil betale, hvis du sender en transaktion.</translation>
</message>
<message>
<location line="+61"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong VPNCoin will not work properly.</source>
<translation>Advarsel: Kontroller venligst, at computerens dato og klokkeslæt er korrekt! Hvis dit ur er forkert vil VPNCoin ikke fungere korrekt.</translation>
</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>Advarsel: fejl under læsning af wallet.dat! Alle nøgler blev læst korrekt, men transaktionsdata eller adressebogsposter kan mangle eller være forkerte.</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>Advarsel: wallet.dat ødelagt, data reddet! Oprindelig wallet.net gemt som wallet.{timestamp}.bak i %s; hvis din saldo eller dine transaktioner er forkert, bør du genskabe fra en sikkerhedskopi.</translation>
</message>
<message>
<location line="-30"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation>Forsøg at genskabe private nøgler fra ødelagt wallet.dat</translation>
</message>
<message>
<location line="+4"/>
<source>Block creation options:</source>
<translation>Blokoprettelsestilvalg:</translation>
</message>
<message>
<location line="-62"/>
<source>Connect only to the specified node(s)</source>
<translation>Tilslut kun til de(n) angivne knude(r)</translation>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>Find egen IP-adresse (standard: 1 når lytter og ingen -externalip)</translation>
</message>
<message>
<location line="+94"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>Lytning på enhver port mislykkedes. Brug -listen=0, hvis du ønsker dette.</translation>
</message>
<message>
<location line="-90"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation>Find peer bruges DNS-opslag (default: 1)</translation>
</message>
<message>
<location line="+5"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation>Synkroniser checkpoints politik (default: streng)</translation>
</message>
<message>
<location line="+83"/>
<source>Invalid -tor address: '%s'</source>
<translation>Ugyldig-tor-adresse: '% s'</translation>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation>Ugyldigt beløb for-reservebalance = <beløb></translation>
</message>
<message>
<location line="-82"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>Maksimum for modtagelsesbuffer pr. forbindelse, <n>*1000 bytes (standard: 5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>Maksimum for afsendelsesbuffer pr. forbindelse, <n>*1000 bytes (standard: 1000)</translation>
</message>
<message>
<location line="-16"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation>Tilslut kun til knuder i netværk <net> (IPv4, IPv6 eller Tor)</translation>
</message>
<message>
<location line="+28"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation>Output ekstra debugging information. Indebærer alle andre-debug * muligheder</translation>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation>Output ekstra netværk debugging information</translation>
</message>
<message>
<location line="+1"/>
<source>Prepend debug output with timestamp</source>
<translation>Prepend debug output med tidsstempel</translation>
</message>
<message>
<location line="+35"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation>SSL-indstillinger: (se Bitcoin Wiki for SSL-opsætningsinstruktioner)</translation>
</message>
<message>
<location line="-74"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation>Vælg den version af socks proxy du vil bruge (4-5, standard: 5)</translation>
</message>
<message>
<location line="+41"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Send sporings-/fejlsøgningsinformation til konsollen i stedet for debug.log filen</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>Send trace / debug info til debugger</translation>
</message>
<message>
<location line="+28"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation>Indstil maks. blok størrelse i bytes (standard: 250000)</translation>
</message>
<message>
<location line="-1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>Angiv minimumsblokstørrelse i bytes (standard: 0)</translation>
</message>
<message>
<location line="-29"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>Formindsk debug.log filen ved klientopstart (standard: 1 hvis ikke -debug)</translation>
</message>
<message>
<location line="-42"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Angiv tilslutningstimeout i millisekunder (standard: 5000)</translation>
</message>
<message>
<location line="+109"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation>Kan ikke logge checkpoint, forkert checkpointkey?
</translation>
</message>
<message>
<location line="-80"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Forsøg at bruge UPnP til at konfigurere den lyttende port (standard: 0)</translation>
</message>
<message>
<location line="-1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Forsøg at bruge UPnP til at konfigurere den lyttende port (standard: 1 når lytter)</translation>
</message>
<message>
<location line="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation>Brug proxy til at nå tor skjulte services (Standard: samme som-proxy)</translation>
</message>
<message>
<location line="+42"/>
<source>Username for JSON-RPC connections</source>
<translation>Brugernavn til JSON-RPC-forbindelser</translation>
</message>
<message>
<location line="+47"/>
<source>Verifying database integrity...</source>
<translation>Bekræfter database integritet ...</translation>
</message>
<message>
<location line="+57"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation>ADVARSEL: synkroniseret checkpoint overtrædelse opdaget, men skibbet!</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: Disk space is low!</source>
<translation>Advarsel: Diskplads lav!</translation>
</message>
<message>
<location line="-2"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>Advarsel: Denne version er forældet, opgradering påkrævet!</translation>
</message>
<message>
<location line="-48"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation>wallet.dat ødelagt, redning af data mislykkedes</translation>
</message>
<message>
<location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation>Adgangskode til JSON-RPC-forbindelser</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=vpncoinrpc
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 "VPNCoin Alert" [email protected]
</source>
<translation>% s, skal du indstille et rpcpassword i konfigurationsfilen:
% s
Det anbefales at bruge følgende tilfældig adgangskode:
rpcuser = vpncoinrpc
rpcpassword =% s
(du behøver ikke at huske denne adgangskode)
Brugernavn og adgangskode må ikke være den samme.
Hvis filen ikke findes, skal du oprette den med filtilladelser ejer-læsbar-kun.
Det kan også anbefales at sætte alertnotify så du får besked om problemer;
for eksempel: alertnotify = echo%% s | mail-s "VPNCoin Alert" [email protected]
</translation>
</message>
<message>
<location line="+51"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation>Find peers der bruger internet relay chat (default: 1) {? 0)}</translation>
</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>Synkroniser tid med andre noder. Deaktiver, hvis tiden på dit system er præcis eksempelvis synkroniseret med NTP (default: 1)</translation>
</message>
<message>
<location line="+15"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation>Når du opretter transaktioner ignoreres input med værdi mindre end dette (standard: 0,01)</translation>
</message>
<message>
<location line="+16"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Tillad JSON-RPC-forbindelser fra bestemt IP-adresse</translation>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Send kommandoer til knude, der kører på <ip> (standard: 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>Udfør kommando, når den bedste blok ændres (%s i kommandoen erstattes med blokhash)</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>Udfør kommando, når en transaktion i tegnebogen ændres (%s i kommandoen erstattes med TxID)</translation>
</message>
<message>
<location line="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation>Kræver en bekræftelser for forandring (default: 0)</translation>
</message>
<message>
<location line="+1"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation>Gennemtving transaktions omkostninger scripts til at bruge canoniske PUSH operatører (default: 1)</translation>
</message>
<message>
<location line="+2"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation>Udfør kommando, når en relevant advarsel er modtaget (% s i cmd erstattes af meddelelse)</translation>
</message>
<message>
<location line="+3"/>
<source>Upgrade wallet to latest format</source>
<translation>Opgrader tegnebog til seneste format</translation>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Angiv nøglepoolstørrelse til <n> (standard: 100)</translation>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Gennemsøg blokkæden for manglende tegnebogstransaktioner</translation>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation>Hvor mange blokke til at kontrollere ved opstart (standard: 2500, 0 = alle)</translation>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation>Hvor grundig blok verifikation er (0-6, default: 1)</translation>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation>Importere blokke fra ekstern blk000?. Dat fil</translation>
</message>
<message>
<location line="+8"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Brug OpenSSL (https) for JSON-RPC-forbindelser</translation>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Servercertifikat-fil (standard: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Serverens private nøgle (standard: server.pem)</translation>
</message>
<message>
<location line="+1"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Acceptable ciphers (default: TLSv1 + HØJ:! SSLv2: aNULL: eNULL: AH: 3DES: @ styrke)</translation>
</message>
<message>
<location line="+53"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation>Fejl: Pung låst for at udregne rente, ude af stand til at skabe transaktion.</translation>
</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>ADVARSEL: Ugyldig checkpoint fundet! Viste transaktioner er måske ikke korrekte! Du kan være nødt til at opgradere, eller underrette udviklerne.</translation>
</message>
<message>
<location line="-158"/>
<source>This help message</source>
<translation>Denne hjælpebesked</translation>
</message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation>Wallet% s placeret udenfor data mappe% s.</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot obtain a lock on data directory %s. VPNCoin is probably already running.</source>
<translation>Kan ikke få en lås på data mappe% s. VPNCoin kører sikkert allerede.</translation>
</message>
<message>
<location line="-98"/>
<source>VPNCoin</source>
<translation>VPNCoin</translation>
</message>
<message>
<location line="+140"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Kunne ikke tildele %s på denne computer (bind returnerede fejl %d, %s)</translation>
</message>
<message>
<location line="-130"/>
<source>Connect through socks proxy</source>
<translation>Tilslut gennem socks proxy</translation>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Tillad DNS-opslag for -addnode, -seednode og -connect</translation>
</message>
<message>
<location line="+122"/>
<source>Loading addresses...</source>
<translation>Indlæser adresser...</translation>
</message>
<message>
<location line="-15"/>
<source>Error loading blkindex.dat</source>
<translation>Fejl ved indlæsning af blkindex.dat</translation>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Fejl ved indlæsning af wallet.dat: Tegnebog ødelagt</translation>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of VPNCoin</source>
<translation>Fejl ved indlæsning af wallet.dat: Wallet kræver en nyere version af VPNCoin</translation>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart VPNCoin to complete</source>
<translation>Det er nødvendig for wallet at blive omskrevet: Genstart VPNCoin for fuldføre</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation>Fejl ved indlæsning af wallet.dat</translation>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Ugyldig -proxy adresse: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Ukendt netværk anført i -onlynet: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>Ukendt -socks proxy-version: %i</translation>
</message>
<message>
<location line="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>Kan ikke finde -bind adressen: '%s'</translation>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>Kan ikke finde -externalip adressen: '%s'</translation>
</message>
<message>
<location line="-24"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Ugyldigt beløb for -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+44"/>
<source>Error: could not start node</source>
<translation>Fejl: kunne ikke starte node</translation>
</message>
<message>
<location line="+11"/>
<source>Sending...</source>
<translation>Sender...</translation>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation>Ugyldigt beløb</translation>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation>Manglende dækning</translation>
</message>
<message>
<location line="-34"/>
<source>Loading block index...</source>
<translation>Indlæser blokindeks...</translation>
</message>
<message>
<location line="-103"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Tilføj en knude til at forbinde til og forsøg at holde forbindelsen åben</translation>
</message>
<message>
<location line="+122"/>
<source>Unable to bind to %s on this computer. VPNCoin is probably already running.</source>
<translation>Kunne ikke binde sig til% s på denne computer. VPNCoin kører sikkert allerede.</translation>
</message>
<message>
<location line="-97"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Gebyr pr KB som tilføjes til transaktioner, du sender</translation>
</message>
<message>
<location line="+55"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation>Ugyldigt beløb for-mininput = <beløb>: '% s'</translation>
</message>
<message>
<location line="+25"/>
<source>Loading wallet...</source>
<translation>Indlæser tegnebog...</translation>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation>Kan ikke nedgradere tegnebog</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation>Kan ikke initialisere keypool</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation>Kan ikke skrive standardadresse</translation>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation>Genindlæser...</translation>
</message>
<message>
<location line="+5"/>
<source>Done loading</source>
<translation>Indlæsning gennemført</translation>
</message>
<message>
<location line="-167"/>
<source>To use the %s option</source>
<translation>For at bruge %s mulighed</translation>
</message>
<message>
<location line="+14"/>
<source>Error</source>
<translation>Fejl</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>Du skal angive rpcpassword=<password> i konfigurationsfilen:
%s
Hvis filen ikke eksisterer, opret den og giv ingen andre end ejeren læserettighed.</translation>
</message>
</context>
</TS> | mit |
rwaldron/travis-ci | lib/travis/notifications/webhook/payload.rb | 463 | module Travis
module Notifications
class Webhook
class Payload
attr_reader :object
def initialize(object)
@object = object
end
def to_hash
render(:hash)
end
def render(format)
Travis::Renderer.send(format, object, :type => :webhook, :template => template)
end
def template
object.class.name.underscore
end
end
end
end
end
| mit |
emailhunter/workers | config.go | 1783 | package workers
import (
"strconv"
"time"
"github.com/garyburd/redigo/redis"
)
type config struct {
processId string
Namespace string
PollInterval int
Pool *redis.Pool
Fetch func(queue string, concurrency int) Fetcher
}
var Config *config
func Configure(options map[string]string) {
var poolSize int
var namespace string
var pollInterval int
if options["server"] == "" {
panic("Configure requires a 'server' option, which identifies a Redis instance")
}
if options["process"] == "" {
panic("Configure requires a 'process' option, which uniquely identifies this instance")
}
if options["pool"] == "" {
options["pool"] = "1"
}
if options["namespace"] != "" {
namespace = options["namespace"] + ":"
}
if seconds, err := strconv.Atoi(options["poll_interval"]); err == nil {
pollInterval = seconds
} else {
pollInterval = 15
}
poolSize, _ = strconv.Atoi(options["pool"])
Config = &config{
options["process"],
namespace,
pollInterval,
&redis.Pool{
MaxIdle: poolSize,
IdleTimeout: 240 * time.Second,
Dial: func() (redis.Conn, error) {
c, err := redis.Dial("tcp", options["server"])
if err != nil {
return nil, err
}
if options["password"] != "" {
if _, err := c.Do("AUTH", options["password"]); err != nil {
c.Close()
return nil, err
}
}
if options["database"] != "" {
if _, err := c.Do("SELECT", options["database"]); err != nil {
c.Close()
return nil, err
}
}
return c, err
},
TestOnBorrow: func(c redis.Conn, t time.Time) error {
_, err := c.Do("PING")
return err
},
},
func(queue string, concurrency int) Fetcher {
return NewFetch(queue, concurrency, make(chan *Msg), make(chan bool))
},
}
}
| mit |
team5149/2016 | src/subsystems/drivetrain.cpp | 838 | #include "drivetrain.h"
#include "../utils/constants.h"
Drivetrain::Drivetrain()
{
tal_left_a.reset(new Talon {Constants::LEFT_DRIVE_PWM_A});
tal_left_b.reset(new Talon {Constants::LEFT_DRIVE_PWM_B});
tal_right_a.reset(new Talon {Constants::RIGHT_DRIVE_PWM_A});
tal_right_b.reset(new Talon {Constants::RIGHT_DRIVE_PWM_B});
// Are we going to use the Talon safety features?
// tal_controller.SetSafetyEnabled(true)?
// TODO: find out if setting the motor safety matters
}
// Set left and right drive output power on scale -1 to 1
// Caller responsibility to ensure that left_pwr and right_pwr are in between -1 and 1.
void Drivetrain::setPower(float left_pwr, float right_pwr) {
tal_left_a->Set(left_pwr);
tal_left_b->Set(left_pwr);
tal_right_a->Set(right_pwr);
tal_right_b->Set(right_pwr);
}
Drivetrain::~Drivetrain(){}
| mit |
masonium/twinkle | src/spectrum.cpp | 3299 | #include <iostream>
#include "spectrum.h"
#include "util.h"
using std::cout;
using std::cerr;
const spectrum spectrum::zero{0.0};
const spectrum spectrum::one{1.0};
const scalar CIE_RGB_TO_XYZ[3][3] = {{0.4887180, 0.3106803, 0.2006017},
{0.1762044, 0.8129847, 0.0108109},
{0.0000000, 0.0102048, 0.9897952}};
const scalar CIE_XYZ_TO_RGB[3][3] = {{2.3706743, -0.9000405 -0.4706338},
{-0.5138850, 1.4253036, 0.0885814},
{0.0052982, -0.0146949, 1.0093968}};
spectrum::spectrum(const spectrum_XYZ& xyz)
{
for (int i = 0; i < 3; ++i)
for (int j = 0; j < 3; ++j)
v[i] += CIE_XYZ_TO_RGB[i][j] * xyz[j];
}
spectrum::operator spectrum_XYZ() const
{
spectrum_XYZ xyz;
for (int i = 0; i < 3; ++i)
for (int j = 0; j < 3; ++j)
xyz.v[i] += CIE_RGB_TO_XYZ[i][j] * v[j];
return xyz;
}
spectrum spectrum::clamp(scalar m, scalar M) const
{
return spectrum{::max(m, ::min(x, M)), ::max(m, ::min(y, M)), ::max(m, ::min(z, M))};
}
spectrum spectrum::from_hex(uint hex)
{
uint b = hex & 0xff;
uint g = (hex >> 8) & 0xff;
uint r = (hex >> 16) & 0xff;
const scalar denom = 255.0;
return spectrum{r / denom, g / denom, b / denom};
}
spectrum spectrum::from_hsv(scalar hue, scalar sat, scalar value)
{
const scalar c = sat * value;
double intval;
const scalar x = c * (1 - fabs( modf(hue / 120.0, &intval) * 2 - 1));
const scalar m = value - c;
scalar r = 0, g = 0, b = 0;
if (hue < 60)
{
r = c; g = x;
}
else if (hue < 120)
{
r = x; g = c;
}
else if (hue < 180)
{
g = c; b = x;
}
else if (hue < 240)
{
g = x; b = c;
}
else if (hue < 300)
{
r = x; b = c;
}
else
{
r = c; b = x;
}
return spectrum{(r + m), (g + m), (b + m)};
}
spectrum spectrum::max(const spectrum &a, const spectrum& b)
{
return spectrum{::max(a.x, b.x), ::max(a.y, b.y), ::max(a.z, b.z)};
}
scalar spectrum::luminance() const
{
return CIE_RGB_TO_XYZ[1][0] * x + CIE_RGB_TO_XYZ[1][1] * y + CIE_RGB_TO_XYZ[1][2] * z;
}
scalar tvi(scalar luminance)
{
luminance = std::max<scalar>(luminance, 0.00001);
scalar logl = log10(luminance);
scalar log_tvi;
if (logl <= -3.94)
log_tvi = -2.86;
else if (logl >= -1.44)
log_tvi = logl - 0.395;
else
log_tvi = pow(0.405 * logl + 1.6, 2.18) - 2.86;
scalar t = pow(10, log_tvi);
return t;
}
spectrum spectrum::rescale_luminance(scalar nl) const
{
scalar L = luminance();
if (L == 0)
return spectrum::zero;
scalar m = ::max(x, ::max(y, z));
spectrum coef = *this / m;
const scalar max_denom = coef.luminance();
return coef * nl / max_denom;
}
ostream& operator<<(ostream& out, spectrum s)
{
out << "{" << s.x << ", " << s.y << ", " << s.z << "}";
return out;
}
////////////////////////////////////////////////////////////////////////////////
spectrum_xyY::spectrum_xyY(const spectrum_XYZ& xyz)
{
auto denom = xyz.x + xyz.y + xyz.z;
x = xyz.x / denom;
Y = xyz.y;
y = xyz.z / denom;
}
spectrum_xyY::operator spectrum_XYZ() const
{
return spectrum_XYZ{x * Y / y, Y, (1 - x - y) * Y / y};
}
////////////////////////////////////////////////////////////////////////////////
| mit |
yogeshsaroya/new-cdnjs | ajax/libs/codemirror/2.36.0/continuecomment.js | 129 | version https://git-lfs.github.com/spec/v1
oid sha256:06a22496a721f9c627cac51da2ff61422d51a47de1ae4b492c9b8bec0fb8d55b
size 1518
| mit |
jlgaffney/neo-gui-wpf | Neo.Gui.Base/Dialogs/Results/Home/HomeDialogResult.cs | 97 | namespace Neo.Gui.Base.Dialogs.Results.Home
{
public class HomeDialogResult
{
}
}
| mit |
omadahealth/SlidePager | lib/src/main/java/com/github/omadahealth/slidepager/lib/views/SlideChartView.java | 19674 | /*
* The MIT License (MIT)
*
* Copyright (c) 2015 Omada Health, Inc
*
* 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 com.github.omadahealth.slidepager.lib.views;
import android.content.Context;
import android.content.res.TypedArray;
import android.databinding.DataBindingUtil;
import android.graphics.Typeface;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import com.daimajia.androidanimations.library.Techniques;
import com.daimajia.androidanimations.library.YoYo;
import com.github.omadahealth.slidepager.lib.R;
import com.github.omadahealth.slidepager.lib.SlideTransformer;
import com.github.omadahealth.slidepager.lib.databinding.ViewChartSlideBinding;
import com.github.omadahealth.slidepager.lib.interfaces.OnSlideListener;
import com.github.omadahealth.slidepager.lib.interfaces.OnSlidePageChangeListener;
import com.github.omadahealth.slidepager.lib.utils.ChartProgressAttr;
import com.github.omadahealth.slidepager.lib.utils.ProgressAttr;
import com.github.omadahealth.slidepager.lib.utils.Utilities;
import com.github.omadahealth.typefaceview.TypefaceTextView;
import com.github.omadahealth.typefaceview.TypefaceType;
import java.util.ArrayList;
import java.util.List;
/**
* Created by stoyan on 4/7/15.
*/
public class SlideChartView extends AbstractSlideView {
/**
* The tag for logging
*/
private static final String TAG = "SlideBarChartView";
/**
* The duration for the animation for {@link #mSelectedView} when {@link OnSlideListener#onDaySelected(int, int)}
* is not allowed
*/
private static final long NOT_ALLOWED_SHAKE_ANIMATION_DURATION = 500;
/**
* An array that holds all the {@link TypefaceTextView} that are at the top
*/
private List<TypefaceTextView> mProgressTopTextList = new ArrayList<>(7);
/**
* An array that holds all the {@link ProgressView} for this layout
*/
private List<ProgressView> mProgressList = new ArrayList<>(7);
/**
* An array that holds all the {@link TypefaceTextView} that are at the bottom
*/
private List<TypefaceTextView> mProgressBottomTextList = new ArrayList<>(7);
/**
* An array that holds all the {@link android.widget.ImageView} that are part of the chart bar
*/
private List<ImageView> mChartBarList = new ArrayList<>(15);
/**
* The callback listener for when views are clicked
*/
private OnSlideListener mCallback;
/**
* The list of {@link ProgressAttr} to associate with {@link #mProgressList}.
* Used in {@link #injectViewsAndAttributes()}
*/
private List<ChartProgressAttr> mProgressAttr;
/**
* The int tag of the selected {@link ProgressView} we store so that we can restore the previous selected day.
*/
private static int mSelectedView;
/**
* The default animation time
*/
private static final int DEFAULT_PROGRESS_ANIMATION_TIME = 1000;
/**
* True of we want to shake the view in {@link #toggleSelectedViews(int)}
*/
private boolean mShakeIfNotSelectable;
/**
* The xml attributes of this view
*/
private TypedArray mAttributes;
/**
* Indicates if the user configured the style to be reanimating each time we are scrolling the {@link com.github.omadahealth.slidepager.lib.SlidePager}
* or not.
*/
private boolean mHasToReanimate;
/**
* The {@link android.graphics.Color} link of the special day: {@link ProgressAttr#isSpecial()}
*/
private int mSpecialBottomTextColor;
/**
* The {@link android.graphics.Color} link of the top texts: {@link SlideChartView#mProgressTopTextList}
*/
private int mTopTextColor;
/**
* The {@link android.graphics.Color} link of the Bottom texts: {@link SlideChartView#mProgressBottomTextList}
*/
private int mBottomTextColor;
/**
* The {@link android.graphics.Color} link of the Bar: {@link SlideChartView#mChartBarList}
*/
private int mChartBarColor;
/**
* The {@link android.support.annotation.DimenRes} link of the Bar: {@link SlideChartView#mChartBarList}
*/
private float mChartBarSize;
/**
* The position of this page within the {@link com.github.omadahealth.slidepager.lib.SlidePager}
*/
private int mPagePosition;
/**
* The animation time in milliseconds that we animate the progress
*/
private int mProgressAnimationTime = DEFAULT_PROGRESS_ANIMATION_TIME;
/**
* The outline size set to the {@link ProgressView} and used here to set padding to the lines
* so that they don't overlap in {@link #setPaddingForOutlineSize(View)}
*/
private float mOutlineSize;
/**
* A user defined {@link ViewPager.OnPageChangeListener}
*/
private OnSlidePageChangeListener<ChartProgressAttr> mUserPageListener;
/**
* The binding object created in {@link #init(Context, TypedArray, int, OnSlidePageChangeListener)}
*/
private ViewChartSlideBinding mBinding;
public SlideChartView(Context context) {
this(context, null, -1, null);
}
public SlideChartView(Context context, TypedArray attributes, int pagePosition, OnSlidePageChangeListener pageListener) {
super(context, null);
init(context, attributes, pagePosition, pageListener);
}
private void loadStyledAttributes(TypedArray attributes) {
mAttributes = attributes;
if (mAttributes != null) {
mOutlineSize = mAttributes.getDimension(R.styleable.SlidePager_slide_progress_not_completed_outline_size, getResources().getDimension(R.dimen.circular_bar_default_outline_width));
mHasToReanimate = mAttributes.getBoolean(R.styleable.SlidePager_slide_pager_reanimate_slide_view, true);
mTopTextColor = attributes.getColor(R.styleable.SlidePager_slide_progress_chart_bar_top_text_color, getResources().getColor(R.color.default_progress_chart_bar_top_text));
mSpecialBottomTextColor = attributes.getColor(R.styleable.SlidePager_slide_progress_chart_bar_bottom_special_text_color, getResources().getColor(R.color.default_progress_chart_bar_special_bottom_text));
mBottomTextColor = attributes.getColor(R.styleable.SlidePager_slide_progress_chart_bar_bottom_text_color, getResources().getColor(R.color.default_progress_chart_bar_bottom_text));
mChartBarColor = attributes.getColor(R.styleable.SlidePager_slide_progress_chart_color, getResources().getColor(R.color.default_progress_chart_bar_color));
mChartBarSize = attributes.getDimension(R.styleable.SlidePager_slide_progress_chart_bar_size, getResources().getDimension(R.dimen.default_progress_chart_bar_size));
mShakeIfNotSelectable = attributes.getBoolean(R.styleable.SlidePager_slide_shake_if_not_selectable, true);
}
}
/**
* Bind the views, set the listeners and attrs
*
* @param context
*/
private void init(Context context, TypedArray attributes, int pagePosition, OnSlidePageChangeListener pageListener) {
if (!isInEditMode()) {
this.mPagePosition = pagePosition;
this.mUserPageListener = pageListener;
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mBinding = DataBindingUtil.inflate(inflater, R.layout.view_chart_slide, this, true);
mAttributes = attributes;
loadStyledAttributes(attributes);
injectViewsAndAttributes();
setListeners();
}
}
/**
* Inject the views into {@link #mProgressList}
*/
private void injectViewsAndAttributes() {
if (mUserPageListener == null) {
return;
}
//Init the ProgressAttr for this page
mProgressAttr = new ArrayList<>();
for (int i = 0; i < 7; i++) {
mProgressAttr.add(mUserPageListener.getDayProgress(mPagePosition, i));
}
//Progress top texts
mProgressTopTextList.add(mBinding.progressTopText1);
mProgressTopTextList.add(mBinding.progressTopText2);
mProgressTopTextList.add(mBinding.progressTopText3);
mProgressTopTextList.add(mBinding.progressTopText4);
mProgressTopTextList.add(mBinding.progressTopText5);
mProgressTopTextList.add(mBinding.progressTopText6);
mProgressTopTextList.add(mBinding.progressTopText7);
//Progress circles
mProgressList.add(mBinding.progress1.loadStyledAttributes(mAttributes, mProgressAttr.get(0)));
mProgressList.add(mBinding.progress2.loadStyledAttributes(mAttributes, mProgressAttr.get(1)));
mProgressList.add(mBinding.progress3.loadStyledAttributes(mAttributes, mProgressAttr.get(2)));
mProgressList.add(mBinding.progress4.loadStyledAttributes(mAttributes, mProgressAttr.get(3)));
mProgressList.add(mBinding.progress5.loadStyledAttributes(mAttributes, mProgressAttr.get(4)));
mProgressList.add(mBinding.progress6.loadStyledAttributes(mAttributes, mProgressAttr.get(5)));
mProgressList.add(mBinding.progress7.loadStyledAttributes(mAttributes, mProgressAttr.get(6)));
//Progress bottom texts
mProgressBottomTextList.add(mBinding.progressBottomText1);
mProgressBottomTextList.add(mBinding.progressBottomText2);
mProgressBottomTextList.add(mBinding.progressBottomText3);
mProgressBottomTextList.add(mBinding.progressBottomText4);
mProgressBottomTextList.add(mBinding.progressBottomText5);
mProgressBottomTextList.add(mBinding.progressBottomText6);
mProgressBottomTextList.add(mBinding.progressBottomText7);
//Chart bars
mChartBarList.add(mBinding.progress1BarTop);
mChartBarList.add(mBinding.progress2BarTop);
mChartBarList.add(mBinding.progress3BarTop);
mChartBarList.add(mBinding.progress4BarTop);
mChartBarList.add(mBinding.progress5BarTop);
mChartBarList.add(mBinding.progress6BarTop);
mChartBarList.add(mBinding.progress7BarTop);
mChartBarList.add(mBinding.progress1BarBottom);
mChartBarList.add(mBinding.progress2BarBottom);
mChartBarList.add(mBinding.progress3BarBottom);
mChartBarList.add(mBinding.progress4BarBottom);
mChartBarList.add(mBinding.progress5BarBottom);
mChartBarList.add(mBinding.progress6BarBottom);
mChartBarList.add(mBinding.progress7BarBottom);
mChartBarList.add(mBinding.progressBottomAxis);
//Set padding depending on outline size
setPaddingForOutlineSize(mBinding.progress1);
setPaddingForOutlineSize(mBinding.progress2);
setPaddingForOutlineSize(mBinding.progress3);
setPaddingForOutlineSize(mBinding.progress4);
setPaddingForOutlineSize(mBinding.progress5);
setPaddingForOutlineSize(mBinding.progress6);
setPaddingForOutlineSize(mBinding.progress7);
//Init the tags of the subviews
SlideTransformer.initTags(this);
//Init values and days text
initTopAndBottomTexts();
//Init bar colors and sizes
initBarColorsAndSize();
}
/**
* Set the padding on the {@link View} based on {@link #mOutlineSize}
*/
private void setPaddingForOutlineSize(View view) {
view.setPadding(view.getPaddingLeft(), (int) mOutlineSize, view.getPaddingRight(), (int) mOutlineSize);
}
/**
* Init the list of {@link TypefaceTextView}: {@link #mProgressTopTextList} and {@link #mProgressBottomTextList}
*/
private void initTopAndBottomTexts() {
//Set the top text to be the values
for (int i = 0; i < mProgressTopTextList.size(); i++) {
if (mProgressAttr != null && mProgressAttr.get(i) != null) {
String oneDecimal = Utilities.formatValue(mProgressAttr.get(i).getValue());
mProgressTopTextList.get(i).setText(oneDecimal);
mProgressTopTextList.get(i).setTextColor(mTopTextColor);
}
}
//Set the bottom texts to be the day values and set the color if special
for (int i = 0; i < mProgressBottomTextList.size(); i++) {
if (mProgressAttr != null && mProgressAttr.get(i) != null) {
TypefaceTextView currentTextView = mProgressBottomTextList.get(i);
currentTextView.setTextColor(mProgressAttr.get(i).isSpecial() ? mSpecialBottomTextColor : mBottomTextColor);
currentTextView.setText(mProgressAttr.get(i).getBottomText());
}
}
}
/**
* Init the {@link android.graphics.Color} of the {@link #mChartBarList}
*/
private void initBarColorsAndSize() {
for (ImageView imageView : mChartBarList) {
imageView.setBackgroundColor(mChartBarColor);
if (imageView.getId() != R.id.progress_bottom_axis) {
imageView.setMinimumHeight((int) (mChartBarSize / 2.0f));
}
}
}
/**
* Set up listeners for all the views in {@link #mProgressList}
*/
private void setListeners() {
for (final ProgressView progressView : mProgressList) {
if (progressView != null) {
progressView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
int index = progressView.getIntTag();
boolean allowed = true;
if (mCallback != null) {
allowed = mCallback.isDaySelectable(mPagePosition, index);
}
if (allowed) {
if (mCallback != null) {
mCallback.onDaySelected(mPagePosition, index);
}
toggleSelectedViews(index);
} else {
if (mShakeIfNotSelectable) {
YoYo.with(Techniques.Shake)
.duration(NOT_ALLOWED_SHAKE_ANIMATION_DURATION)
.playOn(SlideChartView.this);
}
}
}
});
}
}
}
/**
* Sets the selected {@link ProgressView}
*
* @param selected The index of the selected view in {@link #mProgressList}
*/
private void toggleSelectedViews(int selected) {
mSelectedView = selected;
for (int i = 0; i < mProgressList.size(); i++) {
ProgressView day = mProgressList.get(i);
TypefaceTextView currentBottomText = mProgressBottomTextList.get(i);
if (day.getIntTag() == mSelectedView) {
day.isSelected(true);
currentBottomText.setTypeface(currentBottomText.getTypeface(), Typeface.BOLD);
continue;
}
day.isSelected(false);
currentBottomText.setTypeface(TypefaceTextView.getFont(getContext(), TypefaceType.getTypeface(TypefaceType.getDefaultTypeface(getContext())).getAssetFileName()), Typeface.NORMAL);
}
}
@SuppressWarnings("unchecked")
@Override
public void animatePage(OnSlidePageChangeListener listener, TypedArray attributes) {
super.animatePage(listener, attributes);
final List<View> children = (List<View>) getTag(R.id.slide_transformer_tag_key);
if (children != null) {
for (final View child : children) {
if (child instanceof ProgressView) {
ProgressAttr progressAttr = listener.getDayProgress(mPagePosition, ((ProgressView) child).getIntTag());
((ProgressView) child).loadStyledAttributes(attributes, progressAttr);
animateProgress((ProgressView) child, children, progressAttr);
}
}
}
}
@SuppressWarnings("unchecked")
public void resetStreaks(boolean show) {
final List<View> children = (List<View>) getTag(R.id.slide_transformer_tag_key);
if (children != null) {
for (final View child : children) {
if (child instanceof ProgressView) {
final ProgressView progressView = (ProgressView) child;
progressView.showStreak(show, ProgressView.STREAK.RIGHT_STREAK);
progressView.showStreak(show, ProgressView.STREAK.LEFT_STREAK);
if (mHasToReanimate) {
progressView.showCheckMark(show);
}
}
}
}
}
@Override
@SuppressWarnings("unchecked")
public void animateStreaks(OnSlidePageChangeListener listener, TypedArray attributes) {
final List<View> children = (List<View>) getTag(R.id.slide_transformer_tag_key);
if (children != null) {
for (final View child : children) {
if (child instanceof ProgressView) {
final ProgressView progressView = (ProgressView) child;
ProgressAttr progressAttr = listener.getDayProgress(mPagePosition, ((ProgressView) child).getIntTag());
((ProgressView) child).loadStyledAttributes(attributes, progressAttr);
progressView.animateStreaks();
}
}
}
}
@SuppressWarnings("unchecked")
public void resetPage(TypedArray mAttributes) {
this.setVisibility(View.VISIBLE);
this.setAlpha(1f);
loadStyledAttributes(mAttributes);
resetStreaks(false);
final List<View> children = (List<View>) getTag(R.id.slide_transformer_tag_key);
if (children != null) {
for (final View child : children) {
if (child instanceof ProgressView) {
ProgressView progressView = (ProgressView) child;
progressView.reset();
}
}
}
}
private void animateProgress(ProgressView view, List<View> children, ProgressAttr chartProgressAttr) {
if (chartProgressAttr != null) {
view.animateProgress(0, chartProgressAttr, mProgressAnimationTime, children);
}
}
/**
* Sets the listener for click events in this view
*
* @param listener
*/
public void setListener(OnSlideListener listener) {
this.mCallback = listener;
}
}
| mit |
heneke/php-doctrine-module | src/test/configs/orm.nounits.config.php | 1196 | <?php
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Hendrik Heneke
*
* 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.
*/
return [
'driver' => 'annotation',
]; | mit |
SorX14/smart-mirror | public/assets/js/main.js | 12275 | /**
* Created by stephen.parker on 13/03/2016.
*/
var React = require('react');
var ReactDom = require('react-dom');
var $ = jQuery = require('jquery');
var moment = require('moment');
var ReactCSSTransitionGroup = require('react-addons-css-transition-group');
// SetInterval mixin, allowing timed events to occur
var SetIntervalMixin = {
componentWillMount: function() {
this.intervals = [];
},
setInterval: function() {
this.intervals.push(setInterval.apply(null, arguments));
},
componentWillUnmount: function() {
this.intervals.forEach(clearInterval);
}
};
// This will be the components that controls whats shown
var SmContainer = React.createClass({
loadLayoutFromServer: function () {
$.ajax({
url: this.props.url,
dataType: 'json',
cache: false,
success: function (data) {
this.setState({data: data});
}.bind(this),
error: function (xhr, status, err) {
console.error(this.props.url, status, err.toString());
}.bind(this)
});
},
getInitialState: function () {
return {data: {
modules: []
}};
},
componentDidMount: function () {
this.loadLayoutFromServer();
},
render: function () {
var elements = this.state.data.modules.map(function (element) {
return (
<SmComponentContainer
key={element.id}
{...element}
>
</SmComponentContainer>
);
});
return (
<div className="componentContainer">
{elements}
</div>
);
}
});
var SmComponentContainer = React.createClass({
render: function () {
var component;
switch (this.props.name) {
case 'clock':
component = (<ComponentClock {...this.props} />);
break;
case 'compliment':
component = (<ComponentCompliment {...this.props} />);
break;
case 'weather':
component = (<ComponentWeather {...this.props} />);
break;
}
return (
<div className="componentContainerModule" id={"component" + this.props.name}>
<div className="componentContainer">
{component}
</div>
</div>
);
}
});
var ClockDate = React.createClass({
rawMarkup: function () {
//var rawMarkup = this.state.value.format('[<span class="dayname">]dddd,[</span> <span class="longdate">]MMMM Do[</span>]');
var rawMarkup = this.state.value.format('[<span class="dayname">]dddd,[</span> <span class="longdate">]MMMM Do[</span>]');
return {__html: rawMarkup};
},
getInitialState: function () {
return {
value: this.props.value
};
},
componentWillReceiveProps: function (incoming) {
this.setState(incoming);
},
render: function () {
return (
<ReactCSSTransitionGroup transitionName="fade" transitionAppear={true} transitionAppearTimeout={500}
transitionEnterTimeout={1000} transitionLeaveTimeout={1000}>
<span className="dimmed small" key={this.state.value.format('YYYYMMDD')}
dangerouslySetInnerHTML={this.rawMarkup()}/>
</ReactCSSTransitionGroup>
);
}
});
var ClockTime = React.createClass({
getInitialState: function () {
return {
value: this.props.value
};
},
componentWillReceiveProps: function (incoming) {
this.setState(incoming);
},
render: function () {
return (
<ReactCSSTransitionGroup transitionName="fade" transitionAppear={true} transitionAppearTimeout={500}
transitionEnterTimeout={1000} transitionLeaveTimeout={1000}>
<span key={this.state.value.format('HH:mm')}>
{this.state.value.format('HH:mm')}
</span>
</ReactCSSTransitionGroup>
);
}
});
var ComponentClock = React.createClass({
mixins: [SetIntervalMixin],
handleUpdate: function () {
},
getInitialState: function () {
return {
dateTime: moment()
};
},
tick: function () {
this.setState({
dateTime: moment()
});
},
componentDidMount: function () {
this.setInterval(this.tick, this.props.provider.updateRate);
},
render: function () {
// In order to animate in place, change the key, and make the element absolute
return (
<span>
<div className="date">
<ClockDate value={this.state.dateTime}/>
</div>
<div className="time">
<ClockTime value={this.state.dateTime}/>
</div>
</span>
);
}
});
var ComponentCompliment = React.createClass({
mixins: [SetIntervalMixin],
componentDidMount: function () {
this.loadFromServer();
this.setInterval(this.loadFromServer, this.props.provider.updateRate);
},
getInitialState: function () {
return {
data: {
text: 'Mirror, mirror on the wall'
}
}
},
loadFromServer: function () {
$.ajax({
url: this.props.provider.url,
dataType: 'json',
cache: false,
success: function (data) {
this.setState({data: { text: data.compliment.text }});
}.bind(this),
error: function (xhr, status, err) {
console.error(this.props.provider.url, status, err.toString());
}.bind(this)
});
},
render: function () {
return (
<ReactCSSTransitionGroup transitionName="fade" transitionAppear={true} transitionAppearTimeout={500} transitionEnterTimeout={1000} transitionLeaveTimeout={1000}>
<div className="compliment" key={this.state.data.text}>
{this.state.data.text}
</div>
</ReactCSSTransitionGroup>
);
}
});
var WeatherToday = React.createClass({
propTypes: {
id: React.PropTypes.number,
temperature: React.PropTypes.number,
units: React.PropTypes.string,
sunriseTime: React.PropTypes.string,
sunsetTime: React.PropTypes.string,
now: React.PropTypes.string
},
isDay: function () {
if (this.props.sunriseTime < this.props.now && this.props.sunsetTime > this.props.now) {
return true;
} else {
retunr false;
}
},
getIconClass: function () {
return 'wi-owm-' + (this.isDay() ? 'day' : 'night') + '-' + this.props.id;
}
render: function () {
return (
<span className="today">
<span className={"icon " + this.getIconClass() + " dimmed wi"}></span>
<span>{this.props.temperature.toFixed(0)}°{this.props.units}</span>
</span>
);
}
});
var WeatherWind = React.createClass({
propTypes: {
direction: React.PropTypes.string,
speed: React.PropTypes.number
},
render: function () {
return (
<span className="wind">
<span className={"wi wi-wind from-" + this.props.direction + "-deg xdimmed"}></span>{this.props.speed.toFixed(1)}
</span>
);
}
});
var WeatherSunState = React.createClass({
propTypes: {
sunriseTime: React.PropTypes.string,
sunsetTime: React.PropTypes.string,
now: React.PropTypes.string,
},
render: function () {
var sun = (
<span><span className="wi wi-sunrise xdimmed"></span>{this.props.sunriseTime}</span>
);
if (this.props.sunriseTime < this.props.now && this.props.sunsetTime > this.props.now) {
sun = (
<span><span className="wi wi-sunset xdimmed"></span>{this.props.sunsetTime}</span>
);
}
return (
<span className="sun">{sun}</span>
);
}
});
var WeatherTop = React.createClass({
componentWillReceiveProps: function (incoming) {
console.log('componentWillReceiveProps');
console.log(incoming);
},
render: function () {
if (this.props.hasOwnProperty('weather')) {
var windMph = (this.props.weather.weather.weatherItem.wind.speedValue * 2.23694),
currentWeather = this.props.weather.weather.weatherItem,
sunriseTime = moment.unix(this.props.weather.weather.city.sunrise).format('HH:mm'),
sunsetTime = moment.unix(this.props.weather.weather.city.sunset).format('HH:mm'),
now = moment().format('HH:mm');
var windSun = (
<span className="windSun small dimmed">
<WeatherWind direction={currentWeather.wind.directionValue} speed={windMph} />
<WeatherSunState sunriseTime={sunriseTime} sunsetTime={sunsetTime} now={now} />
</span>
);
var todayWeather = (
<WeatherToday id={currentWeather.number} temperature={currentWeather.temperature.value} units={currentWeather.temperature.units} sunriseTime={sunriseTime} sunsetTime={sunsetTime} now={now} />
);
var todayWeather = (
<span className="today">
<span className={"icon " + this.iconTable[currentWeather.icon] + " dimmed wi"}></span>
<span>{currentWeather.temperature.value.toFixed(0)}°{currentWeather.temperature.units}</span>
</span>
);
return (
<div id="weatherTop">
{windSun}
{todayWeather}
</div>
);
} else {
return (
<div id="weatherTop">
</div>
);
}
}
});
var WeatherForecastRow = React.createClass({
render: function () {
var day = moment.unit(this.props.timestamp).format('ddd');
var windMph = (this.props.weather.weather.weatherItem.wind.speedValue * 2.23694);
var windIcon = (
<WeatherWind direction={this.props.wind.directionValue} speed={windMph} />)
;
return (
<span>{windIcon} {day}: {this.props.temperature.value} {this.props.temperature.min} {this.props.temperature.max}</span>
);
}
})
var WeatherForecast = React.createClass({
render: function () {
var weatherRows = this.props.forecast.map(function (comment) {
return (
<WeatherForecastRow ...{this.props} />
)
}).bind(this);
return (
<div id="weatherForecast">{weatherRows}</div>
)
}
});
var ComponentWeather = React.createClass({
mixins: [SetIntervalMixin],
componentDidMount: function () {
this.loadFromServer();
this.setInterval(this.loadFromServer, this.props.provider.updateRate);
},
getInitialState: function () {
return { data: null };
},
loadFromServer: function () {
$.ajax({
url: this.props.provider.url,
dataType: 'json',
cache: false,
success: function (data) {
this.setState(data);
}.bind(this),
error: function (xhr, status, err) {
console.error(this.props.provider.url, status, err.toString());
}.bind(this)
});
},
render: function () {
var weatherPanel = (
<div className="weatherPanel">
<div className="weatherTop">
<WeatherTop {...this.state} />
</div>
<div className="weatherForecast">
<WeatherForecast {...this.state} />
</div>
</div>
);
return (
<ReactCSSTransitionGroup transitionName="fade" transitionAppear={true} transitionAppearTimeout={500} transitionEnterTimeout={1000} transitionLeaveTimeout={1000}>
<div className="weather">
{weatherPanel}
</div>
</ReactCSSTransitionGroup>
);
}
});
ReactDom.render(
<SmContainer url="/api/layout" />,
document.getElementById('content')
);
| mit |
fabricioct/Hedy | src/Hedy.Core.Authentication/Models/Validator/CreateRoleModelValidator.cs | 338 | using FluentValidation;
using Hedy.Core.Authentication.Models;
namespace Hedy.Core.Administration.Models.Validator
{
public class CreateRoleModelValidator : AbstractValidator<CreateRoleModel>
{
public CreateRoleModelValidator()
{
this.RuleFor(x => x.Name).NotNull().Length(3, 64);
}
}
} | mit |
abique/vst-bridge | plugin/plugin.cc | 26165 | #include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <limits.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <pthread.h>
#include <signal.h>
#include <list>
#include <X11/Xlib.h>
#define __cdecl
#include "../config.h"
#include "../common/common.h"
const char g_plugin_path[PATH_MAX] = VST_BRIDGE_TPL_DLL;
const char g_host_path[PATH_MAX] = VST_BRIDGE_TPL_HOST;
const char g_plugin_wineprefix[PATH_MAX] = VST_BRIDGE_TPL_WINEPREFIX;
#ifdef DEBUG
# define LOG(Args...) \
do { \
fprintf(g_log ? : stderr, "P: " Args); \
fflush(g_log ? : stderr); \
} while (0)
#else
# define LOG(Args...) do { ; } while (0)
#endif
#define CRIT(Args...) \
do { \
fprintf(g_log ? : stderr, "[CRIT] P: " Args); \
fflush(g_log ? : stderr); \
} while (0)
#include "../vstsdk2.4/pluginterfaces/vst2.x/aeffectx.h"
static FILE *g_log = NULL;
struct vst_bridge_effect {
vst_bridge_effect()
: socket(-1),
child(-1),
next_tag(0),
chunk(NULL)
{
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&lock, &attr);
pthread_mutexattr_destroy(&attr);
memset(&e, 0, sizeof (e));
}
~vst_bridge_effect()
{
if (socket >= 0)
close(socket);
free(chunk);
pthread_mutex_destroy(&lock);
int st;
waitpid(child, &st, 0);
if (display)
XCloseDisplay(display);
}
struct AEffect e;
int socket;
pid_t child;
uint32_t next_tag;
audioMasterCallback audio_master;
void *chunk;
pthread_mutex_t lock;
ERect rect;
bool close_flag;
std::list<vst_bridge_request> pending;
Display *display;
bool show_window;
};
void copy_plugin_data(struct vst_bridge_effect *vbe,
struct vst_bridge_request *rq)
{
vbe->e.numPrograms = rq->plugin_data.numPrograms;
vbe->e.numParams = rq->plugin_data.numParams;
vbe->e.numInputs = rq->plugin_data.numInputs;
vbe->e.numOutputs = rq->plugin_data.numOutputs;
vbe->e.flags = rq->plugin_data.flags;
vbe->e.initialDelay = rq->plugin_data.initialDelay;
vbe->e.uniqueID = rq->plugin_data.uniqueID;
vbe->e.version = rq->plugin_data.version;
if (!rq->plugin_data.hasSetParameter)
vbe->e.setParameter = NULL;
if (!rq->plugin_data.hasGetParameter)
vbe->e.getParameter = NULL;
if (!rq->plugin_data.hasProcessReplacing)
vbe->e.processReplacing = NULL;
if (!rq->plugin_data.hasProcessDoubleReplacing)
vbe->e.processDoubleReplacing = NULL;
}
void vst_bridge_handle_audio_master(struct vst_bridge_effect *vbe,
struct vst_bridge_request *rq)
{
LOG("audio_master(%s, %d, %d, %f) <= tag %d\n",
vst_bridge_audio_master_opcode_name[rq->amrq.opcode],
rq->amrq.index, rq->amrq.value, rq->amrq.opt, rq->tag);
switch (rq->amrq.opcode) {
// no additional data
case audioMasterAutomate:
case audioMasterVersion:
case audioMasterCurrentId:
case audioMasterIdle:
case __audioMasterPinConnectedDeprecated:
case audioMasterIOChanged:
case audioMasterSizeWindow:
case audioMasterGetSampleRate:
case audioMasterGetBlockSize:
case audioMasterGetInputLatency:
case audioMasterGetOutputLatency:
case audioMasterGetCurrentProcessLevel:
case audioMasterGetAutomationState:
case __audioMasterWantMidiDeprecated:
case __audioMasterNeedIdleDeprecated:
case audioMasterCanDo:
case audioMasterGetVendorVersion:
case audioMasterBeginEdit:
case audioMasterEndEdit:
case audioMasterUpdateDisplay:
case __audioMasterTempoAtDeprecated:
rq->amrq.value = vbe->audio_master(&vbe->e, rq->amrq.opcode, rq->amrq.index,
rq->amrq.value, rq->amrq.data, rq->amrq.opt);
write(vbe->socket, rq, VST_BRIDGE_AMRQ_LEN(0));
break;
case audioMasterGetProductString:
case audioMasterGetVendorString:
rq->amrq.value = vbe->audio_master(&vbe->e, rq->amrq.opcode, rq->amrq.index,
rq->amrq.value, rq->amrq.data, rq->amrq.opt);
write(vbe->socket, rq, VST_BRIDGE_AMRQ_LEN(strlen((const char *)rq->amrq.data) + 1));
break;
case audioMasterProcessEvents: {
struct vst_bridge_midi_events *mes = (struct vst_bridge_midi_events *)rq->amrq.data;
struct VstEvents *ves = (struct VstEvents *)malloc(sizeof (*ves) + mes->nb * sizeof (void*));
ves->numEvents = mes->nb;
ves->reserved = 0;
struct vst_bridge_midi_event *me = mes->events;
for (size_t i = 0; i < mes->nb; ++i) {
ves->events[i] = (VstEvent*)me;
me = (struct vst_bridge_midi_event *)(me->data + me->byteSize);
}
rq->amrq.value = vbe->audio_master(&vbe->e, rq->amrq.opcode, rq->amrq.index,
rq->amrq.value, ves, rq->amrq.opt);
free(ves);
write(vbe->socket, rq, ((uint8_t*)me) - ((uint8_t*)rq));
break;
}
case audioMasterGetTime: {
VstTimeInfo *time_info = (VstTimeInfo *)vbe->audio_master(
&vbe->e, rq->amrq.opcode, rq->amrq.index, rq->amrq.value, rq->amrq.data,
rq->amrq.opt);
if (!time_info)
rq->amrq.value = 0;
else {
rq->amrq.value = 1;
memcpy(rq->amrq.data, time_info, sizeof (*time_info));
}
write(vbe->socket, rq, VST_BRIDGE_AMRQ_LEN(sizeof (*time_info)));
break;
}
default:
CRIT(" !!!!!!! audio master callback (unhandled): op: %d,"
" index: %d, value: %ld, opt: %f\n",
rq->amrq.opcode, rq->amrq.index, rq->amrq.value, rq->amrq.opt);
break;
}
}
bool vst_bridge_wait_response(struct vst_bridge_effect *vbe,
struct vst_bridge_request *rq,
uint32_t tag)
{
ssize_t len;
while (true) {
std::list<vst_bridge_request>::iterator it;
for (it = vbe->pending.begin(); it != vbe->pending.end(); ++it) {
if (it->tag != tag)
continue;
*rq = *it; // XXX could be optimized?
vbe->pending.erase(it);
return true;
}
LOG(" <=== Waiting for tag %d\n", tag);
len = ::read(vbe->socket, rq, sizeof (*rq));
if (len <= 0)
return false;
assert(len >= VST_BRIDGE_RQ_LEN);
LOG(" ===> Got tag %d\n", rq->tag);
if (rq->tag == tag)
return true;
// handle request
if (rq->cmd == VST_BRIDGE_CMD_AUDIO_MASTER_CALLBACK) {
vst_bridge_handle_audio_master(vbe, rq);
continue;
} else if (rq->cmd == VST_BRIDGE_CMD_PLUGIN_DATA) {
copy_plugin_data(vbe, rq);
continue;
}
vbe->pending.push_back(*rq);
}
}
void vst_bridge_show_window(struct vst_bridge_effect *vbe)
{
struct vst_bridge_request rq;
if (vbe->show_window) {
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_SHOW_WINDOW;
vbe->next_tag += 2;
vbe->show_window = false;
write(vbe->socket, &rq, VST_BRIDGE_RQ_LEN);
vst_bridge_wait_response(vbe, &rq, rq.tag);
}
}
void vst_bridge_call_process(AEffect* effect,
float** inputs,
float** outputs,
VstInt32 sampleFrames)
{
struct vst_bridge_effect *vbe = container_of(effect, struct vst_bridge_effect, e);
struct vst_bridge_request rq;
pthread_mutex_lock(&vbe->lock);
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_PROCESS;
rq.frames.nframes = sampleFrames;
vbe->next_tag += 2;
for (int i = 0; i < vbe->e.numInputs; ++i)
memcpy(rq.frames.frames + i * sampleFrames, inputs[i],
sizeof (float) * sampleFrames);
write(vbe->socket, &rq, VST_BRIDGE_FRAMES_LEN(vbe->e.numInputs * sampleFrames));
vst_bridge_wait_response(vbe, &rq, rq.tag);
for (int i = 0; i < vbe->e.numOutputs; ++i)
memcpy(outputs[i], rq.frames.frames + i * sampleFrames,
sizeof (float) * sampleFrames);
pthread_mutex_unlock(&vbe->lock);
}
void vst_bridge_call_process_double(AEffect* effect,
double** inputs,
double** outputs,
VstInt32 sampleFrames)
{
struct vst_bridge_effect *vbe = container_of(effect, struct vst_bridge_effect, e);
struct vst_bridge_request rq;
pthread_mutex_lock(&vbe->lock);
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_PROCESS_DOUBLE;
rq.framesd.nframes = sampleFrames;
vbe->next_tag += 2;
for (int i = 0; i < vbe->e.numInputs; ++i)
memcpy(rq.framesd.frames + i * sampleFrames, inputs[i],
sizeof (double) * sampleFrames);
write(vbe->socket, &rq, VST_BRIDGE_FRAMES_DOUBLE_LEN(vbe->e.numInputs * sampleFrames));
vst_bridge_wait_response(vbe, &rq, rq.tag);
for (int i = 0; i < vbe->e.numOutputs; ++i)
memcpy(outputs[i], rq.framesd.frames + i * sampleFrames,
sizeof (double) * sampleFrames);
pthread_mutex_unlock(&vbe->lock);
}
float vst_bridge_call_get_parameter(AEffect* effect,
VstInt32 index)
{
struct vst_bridge_effect *vbe = container_of(effect, struct vst_bridge_effect, e);
struct vst_bridge_request rq;
pthread_mutex_lock(&vbe->lock);
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_GET_PARAMETER;
rq.param.index = index;
vbe->next_tag += 2;
write(vbe->socket, &rq, VST_BRIDGE_PARAM_LEN);
vst_bridge_wait_response(vbe, &rq, rq.tag);
pthread_mutex_unlock(&vbe->lock);
return rq.param.value;
}
void vst_bridge_call_set_parameter(AEffect* effect,
VstInt32 index,
float parameter)
{
struct vst_bridge_effect *vbe = container_of(effect, struct vst_bridge_effect, e);
struct vst_bridge_request rq;
pthread_mutex_lock(&vbe->lock);
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_SET_PARAMETER;
rq.param.index = index;
rq.param.value = parameter;
vbe->next_tag += 2;
write(vbe->socket, &rq, VST_BRIDGE_PARAM_LEN);
pthread_mutex_unlock(&vbe->lock);
}
VstIntPtr vst_bridge_call_effect_dispatcher2(AEffect* effect,
VstInt32 opcode,
VstInt32 index,
VstIntPtr value,
void* ptr,
float opt)
{
struct vst_bridge_effect *vbe = container_of(effect, struct vst_bridge_effect, e);
struct vst_bridge_request rq;
ssize_t len;
LOG("[%p] effect_dispatcher(%s, %d, %d, %p, %f) => next_tag: %d\n",
pthread_self(), vst_bridge_effect_opcode_name[opcode], index, value,
ptr, opt, vbe->next_tag);
switch (opcode) {
case effSetBlockSize:
case effSetProgram:
case effSetSampleRate:
case effEditIdle:
case effGetProgram:
case __effIdleDeprecated:
case effSetTotalSampleToProcess:
case effStartProcess:
case effStopProcess:
case effSetPanLaw:
case effSetProcessPrecision:
case effGetNumMidiInputChannels:
case effGetNumMidiOutputChannels:
case effEditClose:
case effCanBeAutomated:
case effGetTailSize:
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(0));
vst_bridge_wait_response(vbe, &rq, rq.tag);
return rq.amrq.value;
case effGetOutputProperties:
case effGetInputProperties:
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(0));
vst_bridge_wait_response(vbe, &rq, rq.tag);
memcpy(ptr, rq.erq.data, sizeof (VstPinProperties));
return rq.erq.value;
case effBeginLoadBank:
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(sizeof (VstPatchChunkInfo)));
vst_bridge_wait_response(vbe, &rq, rq.tag);
return rq.erq.value;
case effOpen:
case effGetPlugCategory:
case effGetVstVersion:
case effGetVendorVersion:
case effMainsChanged:
case effBeginSetProgram:
case effEndSetProgram:
case __effConnectOutputDeprecated:
case __effConnectInputDeprecated:
case effSetEditKnobMode:
case effEditKeyUp:
case effEditKeyDown:
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
write(vbe->socket, &rq, sizeof (rq));
vst_bridge_wait_response(vbe, &rq, rq.tag);
return rq.amrq.value;
case effClose:
// quit
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(0));
vbe->close_flag = true;
return 0;
case effEditOpen: {
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(0));
vst_bridge_wait_response(vbe, &rq, rq.tag);
Window parent = (Window)ptr;
Window child = (Window)rq.erq.index;
if (!vbe->display)
vbe->display = XOpenDisplay(NULL);
XReparentWindow(vbe->display, child, parent, 0, 0);
#if 0
XEvent ev;
memset(&ev, 0, sizeof (ev));
ev.xclient.type = ClientMessage;
ev.xclient.window = child;
ev.xclient.message_type = XInternAtom(vbe->display, "_XEMBED", false);
ev.xclient.format = 32;
ev.xclient.data.l[0] = CurrentTime;
ev.xclient.data.l[1] = XEMBED_EMBEDDED_NOTIFY;
ev.xclient.data.l[3] = parent;
XSendEvent(vbe->display, child, false, NoEventMask, &ev);
#endif
XSync(vbe->display, false);
XFlush(vbe->display);
vbe->show_window = true;
vst_bridge_show_window(vbe);
return rq.erq.value;
}
case effEditGetRect: {
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(0));
vst_bridge_wait_response(vbe, &rq, rq.tag);
memcpy(&vbe->rect, rq.erq.data, sizeof (vbe->rect));
ERect **r = (ERect **)ptr;
*r = &vbe->rect;
return rq.erq.value;
}
case effSetProgramName:
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
strcpy((char*)rq.erq.data, (const char *)ptr);
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(strlen((const char *)ptr) + 1));
if (!vst_bridge_wait_response(vbe, &rq, rq.tag))
return 0;
return rq.amrq.value;
case effGetMidiKeyName:
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
memcpy(rq.erq.data, ptr, sizeof (MidiKeyName));
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(sizeof (MidiKeyName)));
if (!vst_bridge_wait_response(vbe, &rq, rq.tag))
return 0;
memcpy(ptr, rq.erq.data, sizeof (MidiKeyName));
return rq.erq.value;
case effGetProgramName:
case effGetParamLabel:
case effGetParamDisplay:
case effGetParamName:
case effGetEffectName:
case effGetVendorString:
case effGetProductString:
case effGetProgramNameIndexed:
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(0));
if (!vst_bridge_wait_response(vbe, &rq, rq.tag))
return 0;
strcpy((char*)ptr, (const char *)rq.erq.data);
LOG("Got string: %s\n", (char *)ptr);
return rq.amrq.value;
case effCanDo:
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
strcpy((char*)rq.erq.data, (const char *)ptr);
write(vbe->socket, &rq, sizeof (rq));
if (!vst_bridge_wait_response(vbe, &rq, rq.tag))
return 0;
return rq.erq.value;
case effGetParameterProperties:
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(0));
if (!vst_bridge_wait_response(vbe, &rq, rq.tag))
return 0;
if (ptr && rq.amrq.value)
memcpy(ptr, rq.erq.data, sizeof (VstParameterProperties));
return rq.amrq.value;
case effGetChunk: {
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
write(vbe->socket, &rq, sizeof (rq));
if (!vst_bridge_wait_response(vbe, &rq, rq.tag))
return 0;
void *chunk = realloc(vbe->chunk, rq.erq.value);
if (!chunk)
return 0;
vbe->chunk = chunk;
for (size_t off = 0; rq.erq.value > 0; ) {
size_t can_read = MIN(VST_BRIDGE_CHUNK_SIZE, rq.erq.value - off);
memcpy(static_cast<uint8_t *>(vbe->chunk) + off, rq.erq.data, can_read);
off += can_read;
if (off == static_cast<size_t>(rq.erq.value))
break;
if (!vst_bridge_wait_response(vbe, &rq, rq.tag))
return 0;
}
*((void **)ptr) = chunk;
return rq.erq.value;
}
case effSetChunk: {
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
for (size_t off = 0; off < static_cast<size_t>(value); ) {
size_t can_write = MIN(VST_BRIDGE_CHUNK_SIZE, value - off);
memcpy(rq.erq.data, static_cast<uint8_t *>(ptr) + off, can_write);
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(can_write));
off += can_write;
}
vst_bridge_wait_response(vbe, &rq, rq.tag);
return rq.erq.value;
}
case effSetSpeakerArrangement: {
struct VstSpeakerArrangement *ar = (struct VstSpeakerArrangement *)value;
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
size_t len = 8 + ar->numChannels * sizeof (ar->speakers[0]);
memcpy(rq.erq.data, ptr, len);
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(len));
if (!vst_bridge_wait_response(vbe, &rq, rq.tag))
return 0;
memcpy(ptr, rq.erq.data, 8 + ar->numChannels * sizeof (ar->speakers[0]));
return rq.amrq.value;
}
case effProcessEvents: {
// compute the size
struct VstEvents *evs = (struct VstEvents *)ptr;
struct vst_bridge_midi_events *mes = (struct vst_bridge_midi_events *)rq.erq.data;
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
mes->nb = evs->numEvents;
struct vst_bridge_midi_event *me = mes->events;
for (int i = 0; i < evs->numEvents; ++i) {
memcpy(me, evs->events[i], sizeof (*me) + evs->events[i]->byteSize);
me = (struct vst_bridge_midi_event *)(me->data + me->byteSize);
}
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(((uint8_t *)me) - rq.erq.data));
if (!vst_bridge_wait_response(vbe, &rq, rq.tag))
return 0;
return rq.amrq.value;
}
case effVendorSpecific: {
switch (index) {
case effGetParamDisplay:
rq.tag = vbe->next_tag;
rq.cmd = VST_BRIDGE_CMD_EFFECT_DISPATCHER;
rq.erq.opcode = opcode;
rq.erq.index = index;
rq.erq.value = value;
rq.erq.opt = opt;
vbe->next_tag += 2;
write(vbe->socket, &rq, VST_BRIDGE_ERQ_LEN(0));
if (!vst_bridge_wait_response(vbe, &rq, rq.tag))
return 0;
strcpy((char*)ptr, (const char *)rq.erq.data);
LOG("Got string: %s\n", (char *)ptr);
return rq.amrq.value;
default:
// fall through
break;
}
}
default:
CRIT("[%p] !!!!!!!!!! UNHANDLED effect_dispatcher(%s, %d, %d, %p, %f)\n",
pthread_self(), vst_bridge_effect_opcode_name[opcode], index, value,
ptr);
return 0;
}
}
VstIntPtr vst_bridge_call_effect_dispatcher(AEffect* effect,
VstInt32 opcode,
VstInt32 index,
VstIntPtr value,
void* ptr,
float opt)
{
struct vst_bridge_effect *vbe = container_of(effect, struct vst_bridge_effect, e);
pthread_mutex_lock(&vbe->lock);
VstIntPtr ret = vst_bridge_call_effect_dispatcher2(
effect, opcode, index, value, ptr, opt);
pthread_mutex_unlock(&vbe->lock);
if (!vbe->close_flag)
return ret;
delete vbe;
return ret;
}
bool vst_bridge_call_plugin_main(struct vst_bridge_effect *vbe)
{
struct vst_bridge_request rq;
rq.tag = 0;
rq.cmd = VST_BRIDGE_CMD_PLUGIN_MAIN;
if (write(vbe->socket, &rq, sizeof (rq)) != sizeof (rq))
return false;
while (true) {
ssize_t rbytes = read(vbe->socket, &rq, sizeof (rq));
if (rbytes <= 0)
return false;
LOG("cmd: %d, tag: %d, bytes: %d\n", rq.cmd, rq.tag, rbytes);
switch (rq.cmd) {
case VST_BRIDGE_CMD_PLUGIN_DATA:
copy_plugin_data(vbe, &rq);
break;
case VST_BRIDGE_CMD_PLUGIN_MAIN:
copy_plugin_data(vbe, &rq);
return true;
case VST_BRIDGE_CMD_AUDIO_MASTER_CALLBACK:
vst_bridge_handle_audio_master(vbe, &rq);
break;
default:
LOG("UNEXPECTED COMMAND: %d\n", rq.cmd);
break;
}
}
}
extern "C" {
AEffect* VSTPluginMain(audioMasterCallback audio_master);
AEffect* VSTPluginMain2(audioMasterCallback audio_master) asm ("main");
}
AEffect* VSTPluginMain2(audioMasterCallback audio_master)
{
return VSTPluginMain(audio_master);
}
AEffect* VSTPluginMain(audioMasterCallback audio_master)
{
struct vst_bridge_effect *vbe = NULL;
int fds[2];
if (!g_log) {
#ifdef DEBUG
char path[128];
snprintf(path, sizeof (path), "/tmp/vst-bridge-plugin.%d.log", getpid());
g_log = fopen(path, "w+");
#else
g_log = stdout;
#endif
}
// allocate the context
vbe = new vst_bridge_effect;
if (!vbe)
goto failed;
// XXX move to the class description
vbe->audio_master = audio_master;
vbe->e.user = NULL;
vbe->e.magic = kEffectMagic;
vbe->e.dispatcher = vst_bridge_call_effect_dispatcher;
vbe->e.setParameter = vst_bridge_call_set_parameter;
vbe->e.getParameter = vst_bridge_call_get_parameter;
vbe->e.processReplacing = vst_bridge_call_process;
vbe->e.processDoubleReplacing = vst_bridge_call_process_double;
vbe->close_flag = false;
vbe->show_window = false;
vbe->display = NULL;
// initialize sockets
if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds))
goto failed_sockets;
vbe->socket = fds[0];
// fork
vbe->child = fork();
if (vbe->child == -1)
goto failed_fork;
if (!vbe->child) {
// in the child
// A hack to cheat GCC optimisation. If we'd simply compare
// g_plugin_wineprefix to VST_BRIDGE_TPL_WINEPREFIX, the
// whole if(strcmp(...)) {} will disappear in the assembly.
char *local_plugin_wineprefix = strdup(g_plugin_wineprefix);
if (strcmp(local_plugin_wineprefix, VST_BRIDGE_TPL_WINEPREFIX) != 0)
setenv("WINEPREFIX", local_plugin_wineprefix, 1); // Should we really override an existing var?
free(local_plugin_wineprefix);
char buff[8];
close(fds[0]);
snprintf(buff, sizeof (buff), "%d", fds[1]);
execl("/bin/sh", "/bin/sh", g_host_path, g_plugin_path, buff, NULL);
CRIT("Failed to spawn child process: /bin/sh %s %s %s\n", g_host_path, g_plugin_path, buff);
exit(1);
}
// in the father
close(fds[1]);
// forward plugin main
if (!vst_bridge_call_plugin_main(vbe)) {
close(vbe->socket);
delete vbe;
return NULL;
}
LOG(" => PluginMain done!\n");
// Return the VST AEffect structure
return &vbe->e;
failed_fork:
close(fds[0]);
close(fds[1]);
failed_sockets:
failed:
delete vbe;
return NULL;
}
| mit |
FlowerWrong/camaleon-cms | app/controllers/camaleon_cms/admin/posts/drafts_controller.rb | 2060 | class CamaleonCms::Admin::Posts::DraftsController < CamaleonCms::Admin::PostsController
before_action :set_post_data_params, only: [:create, :update]
def index
render json: @post_type
end
def create
if params[:post_id].present?
@post_draft = CamaleonCms::Post.drafts.where(post_parent: params[:post_id]).first
if @post_draft.present?
@post_draft.set_option('draft_status', @post_draft.status)
@post_draft.attributes = @post_data
end
end
@post_draft = @post_type.posts.new(@post_data) unless @post_draft.present?
r = {post: @post_draft, post_type: @post_type}; hooks_run("create_post_draft", r)
if @post_draft.save(:validate => false)
@post_draft.set_params(params[:meta], params[:field_options], @post_data[:keywords])
msg = {draft: {id: @post_draft.id}, _drafts_path: cama_admin_post_type_draft_path(@post_type.id, @post_draft)}
r = {post: @post_draft, post_type: @post_type}; hooks_run("created_post_draft", r)
else
msg = {error: @post_draft.errors.full_messages}
end
render json: msg
end
def update
@post_draft = CamaleonCms::Post.drafts.find(params[:id])
@post_draft.attributes = @post_data
r = {post: @post_draft, post_type: @post_type}; hooks_run("update_post_draft", r)
if @post_draft.save(validate: false)
@post_draft.set_params(params[:meta], params[:field_options], params[:options])
hooks_run("updated_post_draft", {post: @post_draft, post_type: @post_type})
msg = {draft: {id: @post_draft.id}}
else
msg = {error: @post_draft.errors.full_messages}
end
render json: msg
end
def destroy
end
private
def set_post_data_params
post_data = params.require(:post).permit!
post_data[:status] = 'draft'
post_data[:post_parent] = params[:post_id]
post_data[:user_id] = cama_current_user.id unless post_data[:user_id].present?
post_data[:data_tags] = params[:tags].to_s
post_data[:data_categories] = params[:categories] || []
@post_data = post_data
end
end
| mit |
handshakinglemma/cwhlstatbot | stat_bot.py | 2676 | from read_file import read_file
import most_stat_per
import most_stat
import team_most_per
import random
from secret import *
import tweepy
def main():
auth = tweepy.OAuthHandler(C_KEY, C_SECRET)
auth.set_access_token(A_TOKEN, A_TOKEN_SECRET)
api = tweepy.API(auth)
skaters = read_file('skaters.csv')
goalies = read_file('goalies.csv')
skater_stats = ['games played', 'goals', 'assists', 'points', 'plus-minus', 'penalty minutes', 'power play goals', 'power play assists', 'short-handed goals', 'short-handed assists', 'game winning goals']
goalie_stats = ['games played', 'minutes played', 'wins', 'losses', 'overtime losses', 'shootout losses', 'shutouts', 'goals against', 'goals against average', 'saves', 'save percentage']
goalie_stat_list = ['#', 'GP', 'W', 'L', 'OTL', 'SOL', 'SO', 'GA', 'GAA', 'SV', 'SV%']
skater_stat_list = ['#', 'GP', 'G', 'A', 'PTS', '+/-', 'PIM', 'PP', 'PPA', 'SH', 'SHA', 'GWG']
abbreviations = {'#':'jersey number', 'GP':'games played', 'MIN':'minutes played', 'W':'wins', 'L':'losses', 'OTL':'overtime losses', 'SOL':'shootout losses', 'SO':'shutouts', 'GA':'goals against', 'GAA':'goals against average', 'SV':'saves', 'SV%':'save percentage', 'G':'goals', 'A':'assists', 'PTS':'points', '+/-':'plus-minus', 'PIM':'penalty minutes', 'PP':'power play goals', 'PPA':'power play assists', 'SH':'short-handed goals', 'SHA':'short-handed assists', 'GWG':'game winning goals'}
prefix = {'#':'Highest', 'GP':'Most', 'MIN':'Most', 'W':'Most', 'L':'Most', 'OTL':'Most', 'SOL':'Most', 'SO':'Most', 'GA':'Most', 'GAA':'Highest', 'SV':'Most', 'SV%':'Highest', 'G':'Most', 'A':'Most', 'PTS':'Most', '+/-':'Highest', 'PIM':'Most', 'PP':'Most', 'PPA':'Most', 'SH':'Most', 'SHA':'Most', 'GWG':'Most'}
# Generate a random number to decide what kind of stat to tweet.
epsilon = random.random()
# Total number of possible stats to tweet.
total = 6
# Make the tweet!
if epsilon < (1 / total):
tweet = most_stat_per.tweet(skater_stat_list, skaters, abbreviations)
elif epsilon < (2 / total):
tweet = most_stat_per.tweet(goalie_stat_list, goalies, abbreviations)
elif epsilon < (3 / total):
tweet = most_stat.tweet(skater_stat_list, skaters, abbreviations, prefix)
elif epsilon < (4 / total):
tweet = most_stat.tweet(goalie_stat_list, goalies, abbreviations, prefix)
elif epsilon < (5 / total):
tweet = team_most_per.tweet(skater_stat_list, skaters, abbreviations)
else:
tweet = team_most_per.tweet(goalie_stat_list, goalies, abbreviations)
# Tweet the tweet!
api.update_status(tweet)
main()
| mit |
landolsi1/tunisiehologram | app/cache/dev/twig/66/6656a11eca60c44de42831f9e574b35f8e29ce66a4fee51d2a84d9541de45cfb.php | 2075 | <?php
/* HologramBundle:Group:new.html.twig */
class __TwigTemplate_6d1459436444d566a8267c304f9f09baeb5af004b296d206df4e29e96825e642 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
// line 1
$this->parent = $this->loadTemplate("FOSUserBundle::layout.html.twig", "HologramBundle:Group:new.html.twig", 1);
$this->blocks = array(
'fos_user_content' => array($this, 'block_fos_user_content'),
);
}
protected function doGetParent(array $context)
{
return "FOSUserBundle::layout.html.twig";
}
protected function doDisplay(array $context, array $blocks = array())
{
$this->parent->display($context, array_merge($this->blocks, $blocks));
}
// line 3
public function block_fos_user_content($context, array $blocks = array())
{
// line 4
$this->loadTemplate("FOSUserBundle:Group:new_content.html.twig", "HologramBundle:Group:new.html.twig", 4)->display($context);
}
public function getTemplateName()
{
return "HologramBundle:Group:new.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 31 => 4, 28 => 3, 11 => 1,);
}
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
public function getSource()
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
return $this->getSourceContext()->getCode();
}
public function getSourceContext()
{
return new Twig_Source("{% extends \"FOSUserBundle::layout.html.twig\" %}
{% block fos_user_content %}
{% include \"FOSUserBundle:Group:new_content.html.twig\" %}
{% endblock fos_user_content %}
", "HologramBundle:Group:new.html.twig", "C:\\wamp64\\www\\tunisiehologram\\src\\HologramBundle/Resources/views/Group/new.html.twig");
}
}
| mit |
workinprog/beebee | src/init.cpp | 29128 | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2011-2012 Litecoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "db.h"
#include "walletdb.h"
#include "bitcoinrpc.h"
#include "net.h"
#include "init.h"
#include "util.h"
#include "ui_interface.h"
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/convenience.hpp>
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/algorithm/string/predicate.hpp>
#ifndef WIN32
#include <signal.h>
#endif
using namespace std;
using namespace boost;
CWallet* pwalletMain;
CClientUIInterface uiInterface;
//////////////////////////////////////////////////////////////////////////////
//
// Shutdown
//
void ExitTimeout(void* parg)
{
#ifdef WIN32
Sleep(5000);
ExitProcess(0);
#endif
}
void StartShutdown()
{
#ifdef QT_GUI
// ensure we leave the Qt main loop for a clean GUI exit (Shutdown() is called in bitcoin.cpp afterwards)
uiInterface.QueueShutdown();
#else
// Without UI, Shutdown() can simply be started in a new thread
CreateThread(Shutdown, NULL);
#endif
}
void Shutdown(void* parg)
{
static CCriticalSection cs_Shutdown;
static bool fTaken;
// Make this thread recognisable as the shutdown thread
RenameThread("bitcoin-shutoff");
bool fFirstThread = false;
{
TRY_LOCK(cs_Shutdown, lockShutdown);
if (lockShutdown)
{
fFirstThread = !fTaken;
fTaken = true;
}
}
static bool fExit;
if (fFirstThread)
{
fShutdown = true;
nTransactionsUpdated++;
bitdb.Flush(false);
StopNode();
bitdb.Flush(true);
boost::filesystem::remove(GetPidFile());
UnregisterWallet(pwalletMain);
delete pwalletMain;
CreateThread(ExitTimeout, NULL);
Sleep(50);
printf("BeeBee exited\n\n");
fExit = true;
#ifndef QT_GUI
// ensure non UI client get's exited here, but let Bitcoin-Qt reach return 0; in bitcoin.cpp
exit(0);
#endif
}
else
{
while (!fExit)
Sleep(500);
Sleep(100);
ExitThread(0);
}
}
void HandleSIGTERM(int)
{
fRequestShutdown = true;
}
void HandleSIGHUP(int)
{
fReopenDebugLog = true;
}
//////////////////////////////////////////////////////////////////////////////
//
// Start
//
#if !defined(QT_GUI)
bool AppInit(int argc, char* argv[])
{
bool fRet = false;
try
{
//
// Parameters
//
// If Qt is used, parameters/litecoin.conf are parsed in qt/bitcoin.cpp's main()
ParseParameters(argc, argv);
if (!boost::filesystem::is_directory(GetDataDir(false)))
{
fprintf(stderr, "Error: Specified directory does not exist\n");
Shutdown(NULL);
}
ReadConfigFile(mapArgs, mapMultiArgs);
if (mapArgs.count("-?") || mapArgs.count("--help"))
{
// First part of help message is specific to BeeBee server / RPC client
std::string strUsage = _("BeeBee version") + " " + FormatFullVersion() + "\n\n" +
_("Usage:") + "\n" +
" beebee [options] " + "\n" +
" beebee [options] <command> [params] " + _("Send command to -server or beebee") + "\n" +
" beebee [options] help " + _("List commands") + "\n" +
" beebee [options] help <command> " + _("Get help for a command") + "\n";
strUsage += "\n" + HelpMessage();
fprintf(stderr, "%s", strUsage.c_str());
return false;
}
// Command-line RPC
for (int i = 1; i < argc; i++)
if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "beebee:"))
fCommandLine = true;
if (fCommandLine)
{
int ret = CommandLineRPC(argc, argv);
exit(ret);
}
fRet = AppInit2();
}
catch (std::exception& e) {
PrintException(&e, "AppInit()");
} catch (...) {
PrintException(NULL, "AppInit()");
}
if (!fRet)
Shutdown(NULL);
return fRet;
}
extern void noui_connect();
int main(int argc, char* argv[])
{
bool fRet = false;
// Connect signal handlers
noui_connect();
fRet = AppInit(argc, argv);
if (fRet && fDaemon)
return 0;
return 1;
}
#endif
bool static InitError(const std::string &str)
{
uiInterface.ThreadSafeMessageBox(str, _("BeeBee"), CClientUIInterface::OK | CClientUIInterface::MODAL);
return false;
}
bool static InitWarning(const std::string &str)
{
uiInterface.ThreadSafeMessageBox(str, _("BeeBee"), CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION | CClientUIInterface::MODAL);
return true;
}
bool static Bind(const CService &addr, bool fError = true) {
if (IsLimited(addr))
return false;
std::string strError;
if (!BindListenPort(addr, strError)) {
if (fError)
return InitError(strError);
return false;
}
return true;
}
/* import from bitcoinrpc.cpp */
extern double GetDifficulty(const CBlockIndex* blockindex = NULL);
// Core-specific options shared between UI and daemon
std::string HelpMessage()
{
string strUsage = _("Options:") + "\n" +
" -conf=<file> " + _("Specify configuration file (default: beebee.conf)") + "\n" +
" -pid=<file> " + _("Specify pid file (default: beebee.pid)") + "\n" +
" -gen " + _("Generate coins") + "\n" +
" -gen=0 " + _("Don't generate coins") + "\n" +
" -datadir=<dir> " + _("Specify data directory") + "\n" +
" -dbcache=<n> " + _("Set database cache size in megabytes (default: 25)") + "\n" +
" -dblogsize=<n> " + _("Set database disk log size in megabytes (default: 100)") + "\n" +
" -timeout=<n> " + _("Specify connection timeout (in milliseconds)") + "\n" +
" -proxy=<ip:port> " + _("Connect through socks proxy") + "\n" +
" -socks=<n> " + _("Select the version of socks proxy to use (4-5, default: 5)") + "\n" +
" -tor=<ip:port> " + _("Use proxy to reach tor hidden services (default: same as -proxy)") + "\n"
" -dns " + _("Allow DNS lookups for -addnode, -seednode and -connect") + "\n" +
" -port=<port> " + _("Listen for connections on <port> (default: 55884 or testnet: 45884)") + "\n" +
" -maxconnections=<n> " + _("Maintain at most <n> connections to peers (default: 125)") + "\n" +
" -addnode=<ip> " + _("Add a node to connect to and attempt to keep the connection open") + "\n" +
" -connect=<ip> " + _("Connect only to the specified node(s)") + "\n" +
" -seednode=<ip> " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n" +
" -externalip=<ip> " + _("Specify your own public address") + "\n" +
" -onlynet=<net> " + _("Only connect to nodes in network <net> (IPv4, IPv6 or Tor)") + "\n" +
" -discover " + _("Discover own IP address (default: 1 when listening and no -externalip)") + "\n" +
" -irc " + _("Find peers using internet relay chat (default: 0)") + "\n" +
" -listen " + _("Accept connections from outside (default: 1 if no -proxy or -connect)") + "\n" +
" -bind=<addr> " + _("Bind to given address. Use [host]:port notation for IPv6") + "\n" +
" -dnsseed " + _("Find peers using DNS lookup (default: 1 unless -connect)") + "\n" +
" -banscore=<n> " + _("Threshold for disconnecting misbehaving peers (default: 100)") + "\n" +
" -bantime=<n> " + _("Number of seconds to keep misbehaving peers from reconnecting (default: 86400)") + "\n" +
" -maxreceivebuffer=<n> " + _("Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)") + "\n" +
" -maxsendbuffer=<n> " + _("Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)") + "\n" +
" -detachdb " + _("Detach block and address databases. Increases shutdown time (default: 0)") + "\n" +
" -paytxfee=<amt> " + _("Fee per KB to add to transactions you send") + "\n" +
" -mininput=<amt> " + _("When creating transactions, ignore inputs with value less than this (default: 0.0001)") + "\n" +
#ifdef QT_GUI
" -server " + _("Accept command line and JSON-RPC commands") + "\n" +
#endif
#if !defined(WIN32) && !defined(QT_GUI)
" -daemon " + _("Run in the background as a daemon and accept commands") + "\n" +
#endif
" -testnet " + _("Use the test network") + "\n" +
" -debug " + _("Output extra debugging information. Implies all other -debug* options") + "\n" +
" -debugnet " + _("Output extra network debugging information") + "\n" +
" -logtimestamps " + _("Prepend debug output with timestamp") + "\n" +
" -printtoconsole " + _("Send trace/debug info to console instead of debug.log file") + "\n" +
#ifdef WIN32
" -printtodebugger " + _("Send trace/debug info to debugger") + "\n" +
#endif
" -rpcuser=<user> " + _("Username for JSON-RPC connections") + "\n" +
" -rpcpassword=<pw> " + _("Password for JSON-RPC connections") + "\n" +
" -rpcport=<port> " + _("Listen for JSON-RPC connections on <port> (default: 55883)") + "\n" +
" -rpcallowip=<ip> " + _("Allow JSON-RPC connections from specified IP address") + "\n" +
" -rpcconnect=<ip> " + _("Send commands to node running on <ip> (default: 127.0.0.1)") + "\n" +
" -blocknotify=<cmd> " + _("Execute command when the best block changes (%s in cmd is replaced by block hash)") + "\n" +
" -upgradewallet " + _("Upgrade wallet to latest format") + "\n" +
" -keypool=<n> " + _("Set key pool size to <n> (default: 100)") + "\n" +
" -rescan " + _("Rescan the block chain for missing wallet transactions") + "\n" +
" -checkblocks=<n> " + _("How many blocks to check at startup (default: 2500, 0 = all)") + "\n" +
" -checklevel=<n> " + _("How thorough the block verification is (0-6, default: 1)") + "\n" +
" -loadblock=<file> " + _("Imports blocks from external blk000?.dat file") + "\n" +
" -? " + _("This help message") + "\n";
strUsage += string() +
_("\nSSL options: (see the Bitcoin Wiki for SSL setup instructions)") + "\n" +
" -rpcssl " + _("Use OpenSSL (https) for JSON-RPC connections") + "\n" +
" -rpcsslcertificatechainfile=<file.cert> " + _("Server certificate file (default: server.cert)") + "\n" +
" -rpcsslprivatekeyfile=<file.pem> " + _("Server private key (default: server.pem)") + "\n" +
" -rpcsslciphers=<ciphers> " + _("Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)") + "\n";
return strUsage;
}
/** Initialize BeeBee.
* @pre Parameters should be parsed and config file should be read.
*/
bool AppInit2()
{
// ********************************************************* Step 1: setup
#ifdef _MSC_VER
// Turn off microsoft heap dump noise
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_WARN, CreateFileA("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0));
#endif
#if _MSC_VER >= 1400
// Disable confusing "helpful" text message on abort, ctrl-c
_set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
#endif
#ifndef WIN32
umask(077);
#endif
#ifndef WIN32
// Clean shutdown on SIGTERM
struct sigaction sa;
sa.sa_handler = HandleSIGTERM;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sigaction(SIGTERM, &sa, NULL);
sigaction(SIGINT, &sa, NULL);
// Reopen debug.log on SIGHUP
struct sigaction sa_hup;
sa_hup.sa_handler = HandleSIGHUP;
sigemptyset(&sa_hup.sa_mask);
sa_hup.sa_flags = 0;
sigaction(SIGHUP, &sa_hup, NULL);
#endif
// ********************************************************* Step 2: parameter interactions
fTestNet = GetBoolArg("-testnet");
// Keep irc seeding on by default for now.
// if (fTestNet)
// {
SoftSetBoolArg("-irc", true);
// }
if (mapArgs.count("-bind")) {
// when specifying an explicit binding address, you want to listen on it
// even when -connect or -proxy is specified
SoftSetBoolArg("-listen", true);
}
if (mapArgs.count("-connect")) {
// when only connecting to trusted nodes, do not seed via DNS, or listen by default
SoftSetBoolArg("-dnsseed", false);
SoftSetBoolArg("-listen", false);
}
if (mapArgs.count("-proxy")) {
// to protect privacy, do not listen by default if a proxy server is specified
SoftSetBoolArg("-listen", false);
}
if (!GetBoolArg("-listen", true)) {
// do not map ports or try to retrieve public IP when not listening (pointless)
SoftSetBoolArg("-upnp", false);
SoftSetBoolArg("-discover", false);
}
if (mapArgs.count("-externalip")) {
// if an explicit public IP is specified, do not try to find others
SoftSetBoolArg("-discover", false);
}
// ********************************************************* Step 3: parameter-to-internal-flags
fDebug = GetBoolArg("-debug");
// -debug implies fDebug*
if (fDebug)
fDebugNet = true;
else
fDebugNet = GetBoolArg("-debugnet");
bitdb.SetDetach(GetBoolArg("-detachdb", false));
#if !defined(WIN32) && !defined(QT_GUI)
fDaemon = GetBoolArg("-daemon");
#else
fDaemon = false;
#endif
if (fDaemon)
fServer = true;
else
fServer = GetBoolArg("-server");
/* force fServer when running without GUI */
#if !defined(QT_GUI)
fServer = true;
#endif
fPrintToConsole = GetBoolArg("-printtoconsole");
fPrintToDebugger = GetBoolArg("-printtodebugger");
fLogTimestamps = GetBoolArg("-logtimestamps");
if (mapArgs.count("-timeout"))
{
int nNewTimeout = GetArg("-timeout", 5000);
if (nNewTimeout > 0 && nNewTimeout < 600000)
nConnectTimeout = nNewTimeout;
}
// Continue to put "/P2SH/" in the coinbase to monitor
// BIP16 support.
// This can be removed eventually...
const char* pszP2SH = "/P2SH/";
COINBASE_FLAGS << std::vector<unsigned char>(pszP2SH, pszP2SH+strlen(pszP2SH));
if (mapArgs.count("-paytxfee"))
{
if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee))
return InitError(strprintf(_("Invalid amount for -paytxfee=<amount>: '%s'"), mapArgs["-paytxfee"].c_str()));
if (nTransactionFee > 0.25 * COIN)
InitWarning(_("Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."));
}
if (mapArgs.count("-mininput"))
{
if (!ParseMoney(mapArgs["-mininput"], nMinimumInputValue))
return InitError(strprintf(_("Invalid amount for -mininput=<amount>: '%s'"), mapArgs["-mininput"].c_str()));
}
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log
// Make sure only a single beebee process is using the data directory.
boost::filesystem::path pathLockFile = GetDataDir() / ".lock";
FILE* file = fopen(pathLockFile.string().c_str(), "a"); // empty lock file; created if it doesn't exist.
if (file) fclose(file);
static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
if (!lock.try_lock())
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. BeeBee is probably already running."), GetDataDir().string().c_str()));
#if !defined(WIN32) && !defined(QT_GUI)
if (fDaemon)
{
// Daemonize
pid_t pid = fork();
if (pid < 0)
{
fprintf(stderr, "Error: fork() returned %d errno %d\n", pid, errno);
return false;
}
if (pid > 0)
{
CreatePidFile(GetPidFile(), pid);
return true;
}
pid_t sid = setsid();
if (sid < 0)
fprintf(stderr, "Error: setsid() returned %d errno %d\n", sid, errno);
}
#endif
if (!fDebug)
ShrinkDebugFile();
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("BeeBee version %s (%s)\n", FormatFullVersion().c_str(), CLIENT_DATE.c_str());
printf("Startup time: %s\n", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());
printf("Default data directory %s\n", GetDefaultDataDir().string().c_str());
printf("Used data directory %s\n", GetDataDir().string().c_str());
std::ostringstream strErrors;
if (fDaemon)
fprintf(stdout, "BeeBee server starting\n");
int64 nStart;
// ********************************************************* Step 5: network initialization
int nSocksVersion = GetArg("-socks", 5);
if (nSocksVersion != 4 && nSocksVersion != 5)
return InitError(strprintf(_("Unknown -socks proxy version requested: %i"), nSocksVersion));
if (mapArgs.count("-onlynet")) {
std::set<enum Network> nets;
BOOST_FOREACH(std::string snet, mapMultiArgs["-onlynet"]) {
enum Network net = ParseNetwork(snet);
if (net == NET_UNROUTABLE)
return InitError(strprintf(_("Unknown network specified in -onlynet: '%s'"), snet.c_str()));
nets.insert(net);
}
for (int n = 0; n < NET_MAX; n++) {
enum Network net = (enum Network)n;
if (!nets.count(net))
SetLimited(net);
}
}
CService addrProxy;
bool fProxy = false;
if (mapArgs.count("-proxy")) {
addrProxy = CService(mapArgs["-proxy"], 9050);
if (!addrProxy.IsValid())
return InitError(strprintf(_("Invalid -proxy address: '%s'"), mapArgs["-proxy"].c_str()));
if (!IsLimited(NET_IPV4))
SetProxy(NET_IPV4, addrProxy, nSocksVersion);
if (nSocksVersion > 4) {
#ifdef USE_IPV6
if (!IsLimited(NET_IPV6))
SetProxy(NET_IPV6, addrProxy, nSocksVersion);
#endif
SetNameProxy(addrProxy, nSocksVersion);
}
fProxy = true;
}
// -tor can override normal proxy, -notor disables tor entirely
if (!(mapArgs.count("-tor") && mapArgs["-tor"] == "0") && (fProxy || mapArgs.count("-tor"))) {
CService addrOnion;
if (!mapArgs.count("-tor"))
addrOnion = addrProxy;
else
addrOnion = CService(mapArgs["-tor"], 9050);
if (!addrOnion.IsValid())
return InitError(strprintf(_("Invalid -tor address: '%s'"), mapArgs["-tor"].c_str()));
SetProxy(NET_TOR, addrOnion, 5);
SetReachable(NET_TOR);
}
// see Step 2: parameter interactions for more information about these
fNoListen = !GetBoolArg("-listen", true);
fDiscover = GetBoolArg("-discover", true);
fNameLookup = GetBoolArg("-dns", true);
bool fBound = false;
if (!fNoListen)
{
std::string strError;
if (mapArgs.count("-bind")) {
BOOST_FOREACH(std::string strBind, mapMultiArgs["-bind"]) {
CService addrBind;
if (!Lookup(strBind.c_str(), addrBind, GetListenPort(), false))
return InitError(strprintf(_("Cannot resolve -bind address: '%s'"), strBind.c_str()));
fBound |= Bind(addrBind);
}
} else {
struct in_addr inaddr_any;
inaddr_any.s_addr = INADDR_ANY;
#ifdef USE_IPV6
if (!IsLimited(NET_IPV6))
fBound |= Bind(CService(in6addr_any, GetListenPort()), false);
#endif
if (!IsLimited(NET_IPV4))
fBound |= Bind(CService(inaddr_any, GetListenPort()), !fBound);
}
if (!fBound)
return InitError(_("Failed to listen on any port. Use -listen=0 if you want this."));
}
if (mapArgs.count("-externalip"))
{
BOOST_FOREACH(string strAddr, mapMultiArgs["-externalip"]) {
CService addrLocal(strAddr, GetListenPort(), fNameLookup);
if (!addrLocal.IsValid())
return InitError(strprintf(_("Cannot resolve -externalip address: '%s'"), strAddr.c_str()));
AddLocal(CService(strAddr, GetListenPort(), fNameLookup), LOCAL_MANUAL);
}
}
BOOST_FOREACH(string strDest, mapMultiArgs["-seednode"])
AddOneShot(strDest);
// ********************************************************* Step 6: load blockchain
if (GetBoolArg("-loadblockindextest"))
{
CTxDB txdb("r");
txdb.LoadBlockIndex();
PrintBlockTree();
return false;
}
uiInterface.InitMessage(_("Loading block index..."));
printf("Loading block index...\n");
nStart = GetTimeMillis();
if (!LoadBlockIndex())
strErrors << _("Error loading blkindex.dat") << "\n";
// as LoadBlockIndex can take several minutes, it's possible the user
// requested to kill beebee-qt during the last operation. If so, exit.
// As the program has not fully started yet, Shutdown() is possibly overkill.
if (fRequestShutdown)
{
printf("Shutdown requested. Exiting.\n");
return false;
}
printf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart);
if (GetBoolArg("-printblockindex") || GetBoolArg("-printblocktree"))
{
PrintBlockTree();
return false;
}
if (mapArgs.count("-printblock"))
{
string strMatch = mapArgs["-printblock"];
int nFound = 0;
for (map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi)
{
uint256 hash = (*mi).first;
if (strncmp(hash.ToString().c_str(), strMatch.c_str(), strMatch.size()) == 0)
{
CBlockIndex* pindex = (*mi).second;
CBlock block;
block.ReadFromDisk(pindex);
block.BuildMerkleTree();
block.print();
printf("\n");
nFound++;
}
}
if (nFound == 0)
printf("No blocks matching %s were found\n", strMatch.c_str());
return false;
}
if (mapArgs.count("-exportStatData"))
{
FILE* file = fopen((GetDataDir() / "blockstat.dat").string().c_str(), "w");
if (!file)
return false;
for (map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi)
{
CBlockIndex* pindex = (*mi).second;
CBlock block;
block.ReadFromDisk(pindex);
block.BuildMerkleTree();
fprintf(file, "%d,%s,%s,%d,%f,%u\n",
pindex->nHeight, /* todo: height */
block.GetHash().ToString().c_str(),
block.GetPoWHash().ToString().c_str(),
block.nVersion,
//CBigNum().SetCompact(block.nBits).getuint256().ToString().c_str(),
GetDifficulty(pindex),
block.nTime
);
}
fclose(file);
return false;
}
// ********************************************************* Step 7: load wallet
uiInterface.InitMessage(_("Loading wallet..."));
printf("Loading wallet...\n");
nStart = GetTimeMillis();
bool fFirstRun;
pwalletMain = new CWallet("wallet.dat");
int nLoadWalletRet = pwalletMain->LoadWallet(fFirstRun);
if (nLoadWalletRet != DB_LOAD_OK)
{
if (nLoadWalletRet == DB_CORRUPT)
strErrors << _("Error loading wallet.dat: Wallet corrupted") << "\n";
else if (nLoadWalletRet == DB_TOO_NEW)
strErrors << _("Error loading wallet.dat: Wallet requires newer version of BeeBee") << "\n";
else if (nLoadWalletRet == DB_NEED_REWRITE)
{
strErrors << _("Wallet needed to be rewritten: restart BeeBee to complete") << "\n";
printf("%s", strErrors.str().c_str());
return InitError(strErrors.str());
}
else
strErrors << _("Error loading wallet.dat") << "\n";
}
if (GetBoolArg("-upgradewallet", fFirstRun))
{
int nMaxVersion = GetArg("-upgradewallet", 0);
if (nMaxVersion == 0) // the -upgradewallet without argument case
{
printf("Performing wallet upgrade to %i\n", FEATURE_LATEST);
nMaxVersion = CLIENT_VERSION;
pwalletMain->SetMinVersion(FEATURE_LATEST); // permanently upgrade the wallet immediately
}
else
printf("Allowing wallet upgrade up to %i\n", nMaxVersion);
if (nMaxVersion < pwalletMain->GetVersion())
strErrors << _("Cannot downgrade wallet") << "\n";
pwalletMain->SetMaxVersion(nMaxVersion);
}
if (fFirstRun)
{
// Create new keyUser and set as default key
RandAddSeedPerfmon();
CPubKey newDefaultKey;
if (!pwalletMain->GetKeyFromPool(newDefaultKey, false))
strErrors << _("Cannot initialize keypool") << "\n";
pwalletMain->SetDefaultKey(newDefaultKey);
if (!pwalletMain->SetAddressBookName(pwalletMain->vchDefaultKey.GetID(), ""))
strErrors << _("Cannot write default address") << "\n";
}
printf("%s", strErrors.str().c_str());
printf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart);
RegisterWallet(pwalletMain);
CBlockIndex *pindexRescan = pindexBest;
if (GetBoolArg("-rescan"))
pindexRescan = pindexGenesisBlock;
else
{
CWalletDB walletdb("wallet.dat");
CBlockLocator locator;
if (walletdb.ReadBestBlock(locator))
pindexRescan = locator.GetBlockIndex();
}
if (pindexBest != pindexRescan)
{
uiInterface.InitMessage(_("Rescanning..."));
printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight);
nStart = GetTimeMillis();
pwalletMain->ScanForWalletTransactions(pindexRescan, true);
printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart);
}
// ********************************************************* Step 8: import blocks
if (mapArgs.count("-loadblock"))
{
BOOST_FOREACH(string strFile, mapMultiArgs["-loadblock"])
{
FILE *file = fopen(strFile.c_str(), "rb");
if (file)
LoadExternalBlockFile(file);
}
}
// ********************************************************* Step 9: load peers
uiInterface.InitMessage(_("Loading addresses..."));
printf("Loading addresses...\n");
nStart = GetTimeMillis();
{
CAddrDB adb;
if (!adb.Read(addrman))
printf("Invalid or missing peers.dat; recreating\n");
}
printf("Loaded %i addresses from peers.dat %"PRI64d"ms\n",
addrman.size(), GetTimeMillis() - nStart);
// ********************************************************* Step 10: start node
if (!CheckDiskSpace())
return false;
RandAddSeedPerfmon();
//// debug print
printf("mapBlockIndex.size() = %d\n", mapBlockIndex.size());
printf("nBestHeight = %d\n", nBestHeight);
printf("setKeyPool.size() = %d\n", pwalletMain->setKeyPool.size());
printf("mapWallet.size() = %d\n", pwalletMain->mapWallet.size());
printf("mapAddressBook.size() = %d\n", pwalletMain->mapAddressBook.size());
if (!CreateThread(StartNode, NULL))
InitError(_("Error: could not start node"));
if (fServer)
CreateThread(ThreadRPCServer, NULL);
// ********************************************************* Step 11: finished
uiInterface.InitMessage(_("Done loading"));
printf("Done loading\n");
if (!strErrors.str().empty())
return InitError(strErrors.str());
// Add wallet transactions that aren't already in a block to mapTransactions
pwalletMain->ReacceptWalletTransactions();
#if !defined(QT_GUI)
// Loop until process is exit()ed from shutdown() function,
// called from ThreadRPCServer thread when a "stop" command is received.
while (1)
Sleep(5000);
#endif
return true;
}
| mit |
gryffon/ringteki | server/game/cards/01-Core/HidaKisada.js | 1781 | const DrawCard = require('../../drawcard.js');
const EventRegistrar = require('../../eventregistrar.js');
const { Locations, CardTypes, EventNames, AbilityTypes } = require('../../Constants');
class HidaKisada extends DrawCard {
setupCardAbilities() {
this.firstActionEvent = null;
this.abilityRegistrar = new EventRegistrar(this.game, this);
this.abilityRegistrar.register([{
[EventNames.OnInitiateAbilityEffects + ':' + AbilityTypes.WouldInterrupt]: 'onInitiateAbilityEffectsWouldInterrupt'
}]);
this.abilityRegistrar.register([{
[EventNames.OnInitiateAbilityEffects + ':' + AbilityTypes.OtherEffects]: 'onInitiateAbilityEffectsOtherEffects'
}]);
this.abilityRegistrar.register([
EventNames.OnConflictDeclared
]);
}
onInitiateAbilityEffectsWouldInterrupt(event) {
if(!this.firstActionEvent && this.game.isDuringConflict() && event.context.ability.abilityType === 'action' && !event.context.ability.cannotBeCancelled && event.context.player !== this.controller) {
this.firstActionEvent = event;
}
}
onInitiateAbilityEffectsOtherEffects(event) {
if(event === this.firstActionEvent && !event.cancelled && this.location === Locations.PlayArea && !this.isBlank() && !this.game.conflictRecord.some(conflict => conflict.winner === this.controller.opponent)) {
event.cancel();
this.game.addMessage('{0} attempts to initiate {1}{2}, but {3} cancels it', event.context.player, event.card, event.card.type === CardTypes.Event ? '' : '\'s ability', this);
}
}
onConflictDeclared() {
this.firstActionEvent = null;
}
}
HidaKisada.id = 'hida-kisada';
module.exports = HidaKisada;
| mit |
hks-epod/paydash | tasks/watch.js | 287 | 'use strict';
var Gulp = require('gulp');
var paths = require('../config/assets');
Gulp.task('watch', ['dev-build'], function() {
Gulp.watch(paths.get('/fonts'), ['fonts']);
Gulp.watch(paths.get('/styles'), ['styles']);
// Js watch is done with webpack for performance
});
| mit |
Hackathonners/swap | app/Judite/Models/Student.php | 4358 | <?php
namespace App\Judite\Models;
use Illuminate\Database\Eloquent\Model;
use App\Exceptions\EnrollmentCannotBeDeleted;
use App\Exceptions\StudentIsNotEnrolledInCourseException;
use App\Exceptions\UserIsAlreadyEnrolledInCourseException;
class Student extends Model
{
/**
* The relations to eager load on every query.
*
* @var array
*/
protected $with = ['user'];
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['student_number'];
/**
* Get user who owns this student.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function user()
{
return $this->belongsTo(User::class);
}
/**
* Get exchanges requested by this student.
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function requestedExchanges()
{
$enrollmentsRelationship = $this->enrollments();
$enrollmentsKeyName = $enrollmentsRelationship->getRelated()->getKeyName();
$enrollmentsIdsQuery = $enrollmentsRelationship
->select($enrollmentsKeyName)
->getBaseQuery();
return Exchange::whereFromEnrollmentIn($enrollmentsIdsQuery);
}
/**
* Get exchanges proposed to this student.
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function proposedExchanges()
{
$enrollmentsRelationship = $this->enrollments();
$enrollmentsKeyName = $enrollmentsRelationship->getRelated()->getKeyName();
$enrollmentsIdsQuery = $enrollmentsRelationship
->select($enrollmentsKeyName)
->getBaseQuery();
return Exchange::whereToEnrollmentIn($enrollmentsIdsQuery);
}
/**
* Get enrollments of this student.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function enrollments()
{
return $this->hasMany(Enrollment::class);
}
/**
* Get enrollment of this student in a given course.
*
* @param \App\Judite\Models\Course $course
*
* @return \App\Judite\Models\Enrollment|null
*/
public function getEnrollmentInCourse(Course $course)
{
return $this->enrollments()
->where('course_id', $course->id)
->first();
}
/**
* Enroll this student with a given course.
*
* @param \App\Judite\Models\Course $course
*
* @throws \App\Exceptions\UserIsAlreadyEnrolledInCourseException
*
* @return \App\Judite\Models\Enrollment
*/
public function enroll(Course $course): Enrollment
{
if ($this->isEnrolledInCourse($course)) {
throw new UserIsAlreadyEnrolledInCourseException($course);
}
$enrollment = $this->enrollments()->make();
$enrollment->course()->associate($course);
$enrollment->save();
return $enrollment;
}
/**
* Check if this student is enrolled in a course.
*
* @param \App\Judite\Models\Course $course
*
* @return bool
*/
public function isEnrolledInCourse(Course $course): bool
{
return $this->enrollments()->where('course_id', $course->id)->exists();
}
/**
* Remove enrollment in the given course.
*
* @param \App\Judite\Models\Course $course
*
* @throws \App\Exceptions\StudentIsNotEnrolledInCourseException|\App\Exceptions\EnrollmentCannotBeDeleted
*
* @return bool
*/
public function unenroll(Course $course): bool
{
$enrollment = $this->getEnrollmentInCourse($course);
if (is_null($enrollment)) {
throw new StudentIsNotEnrolledInCourseException($course);
}
if (! $enrollment->isDeletable()) {
throw new EnrollmentCannotBeDeleted($enrollment);
}
return $enrollment->delete();
}
/**
* Scope a query to only include users with the given student number.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param string $studentNumber
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeWhereNumber($query, $studentNumber)
{
return $query->where('student_number', $studentNumber);
}
}
| mit |
EUDAT-B2STAGE/http-api-base | rapydo/services/authentication/neo4j.py | 9323 | # -*- coding: utf-8 -*-
"""
Implement authentication with graphdb as user database
Note: to delete the whole db
MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE n,r
Remove tokens:
MATCH (a:Token) WHERE NOT (a)<-[]-() DELETE a
"""
import pytz
from datetime import datetime, timedelta
from rapydo.utils.uuid import getUUID
from rapydo.services.authentication import BaseAuthentication
from rapydo.services.detect import detector
from rapydo.utils.logs import get_logger
log = get_logger(__name__)
if not detector.check_availability(__name__):
log.critical_exit("No neo4j GraphDB service found for auth")
class Authentication(BaseAuthentication):
def get_user_object(self, username=None, payload=None):
user = None
try:
if username is not None:
user = self.db.User.nodes.get(email=username)
if payload is not None and 'user_id' in payload:
user = self.db.User.nodes.get(uuid=payload['user_id'])
except self.db.User.DoesNotExist:
log.warning("Could not find user for '%s'" % username)
return user
def get_roles_from_user(self, userobj=None):
roles = []
if userobj is None:
try:
userobj = self.get_user()
except Exception as e:
log.warning("Roles check: invalid current user.\n%s" % e)
return roles
for role in userobj.roles.all():
roles.append(role.name)
return roles
def fill_custom_payload(self, userobj, payload):
# TO FIX: should be implemented in vanilla, not here
return payload
# Also used by POST user
def create_user(self, userdata, roles=[]):
user_node = self.db.User(**userdata)
try:
user_node.save()
except Exception as e:
message = "Can't create user %s:\n%s" % (userdata['email'], e)
log.error(message)
raise AttributeError(message)
self.link_roles(user_node, roles)
return user_node
# Also user by PUT user
def link_roles(self, user, roles):
if self.default_role not in roles:
roles.append(self.default_role)
for p in user.roles.all():
user.roles.disconnect(p)
for role in roles:
log.debug("Adding role %s" % role)
try:
role_obj = self.db.Role.nodes.get(name=role)
except self.db.Role.DoesNotExist:
raise Exception("Graph role %s does not exist" % role)
user.roles.connect(role_obj)
def create_role(self, role, description="automatic"):
role = self.db.Role(name=role, description=description)
role.save()
return role
def init_users_and_roles(self):
# Handle system roles
current_roles = []
current_roles_objs = self.db.Role.nodes.all()
for role in current_roles_objs:
current_roles.append(role.name)
for role in self.default_roles:
if role not in current_roles:
self.create_role(role)
# TO FIX: Create some users for testing
from flask import current_app
if current_app.config['TESTING']:
pass
# Default user (if no users yet available)
if not len(self.db.User.nodes) > 0:
log.warning("No users inside graphdb. Injecting default.")
self.create_user({
# 'uuid': getUUID(),
'email': self.default_user,
'authmethod': 'credentials',
'name': 'Default', 'surname': 'User',
'name_surname': 'Default#_#User',
'password': self.hash_password(self.default_password)
}, roles=self.default_roles)
def save_token(self, user, token, jti):
now = datetime.now(pytz.utc)
exp = now + timedelta(seconds=self.shortTTL)
token_node = self.db.Token()
token_node.jti = jti
token_node.token = token
token_node.creation = now
token_node.last_access = now
token_node.expiration = exp
ip, hostname = self.get_host_info()
# log.critical(ip)
# log.critical(hostname)
token_node.IP = ip
token_node.hostname = hostname
token_node.save()
token_node.emitted_for.connect(user)
log.debug("Token stored in graphDB")
def verify_token_custom(self, jti, user, payload):
try:
token_node = self.db.Token.nodes.get(jti=jti)
except self.db.Token.DoesNotExist:
return False
if not token_node.emitted_for.is_connected(user):
return False
return True
def refresh_token(self, jti):
now = datetime.now(pytz.utc)
try:
token_node = self.db.Token.nodes.get(jti=jti)
if now > token_node.expiration:
self.invalidate_token(token=token_node.token)
log.critical("This token is not longer valid")
return False
exp = now + timedelta(seconds=self.shortTTL)
token_node.last_access = now
token_node.expiration = exp
token_node.save()
return True
except self.db.Token.DoesNotExist:
log.warning("Token %s not found" % jti)
return False
def get_tokens(self, user=None, token_jti=None):
# TO FIX: TTL should be considered?
list = []
tokens = None
if user is not None:
tokens = user.tokens.all()
elif token_jti is not None:
try:
tokens = [self.db.Token.nodes.get(jti=token_jti)]
except self.db.Token.DoesNotExist:
pass
if tokens is not None:
for token in tokens:
t = {}
t["id"] = token.jti
t["token"] = token.token
t["emitted"] = token.creation.strftime('%s')
t["last_access"] = token.last_access.strftime('%s')
if token.expiration is not None:
t["expiration"] = token.expiration.strftime('%s')
t["IP"] = token.IP
t["hostname"] = token.hostname
list.append(t)
return list
def invalidate_all_tokens(self, user=None):
if user is None:
user = self.get_user()
user.uuid = getUUID()
user.save()
return True
def invalidate_token(self, token, user=None):
if user is None:
user = self.get_user()
try:
token_node = self.db.Token.nodes.get(token=token)
token_node.delete()
except self.db.Token.DoesNotExist:
log.warning("Unable to invalidate, token not found: %s" % token)
return False
return True
# def clean_pending_tokens(self):
# log.debug("Removing all pending tokens")
# return self.cypher("MATCH (a:Token) WHERE NOT (a)<-[]-() DELETE a")
def store_oauth2_user(self, current_user, token):
"""
Allow external accounts (oauth2 credentials)
to be connected to internal local user
"""
email = current_user.data.get('email')
cn = current_user.data.get('cn')
# A graph node for internal accounts associated to oauth2
try:
user_node = self.db.User.nodes.get(email=email)
if user_node.authmethod != 'oauth2':
# The user already exist with another type of authentication
return None
# TO BE VERIFIED
except self.db.User.DoesNotExist:
user_node = self.create_user(userdata={
# 'uuid': getUUID(),
'email': email,
'authmethod': 'oauth2'
})
# NOTE: missing roles for this user?
# A self.db node for external oauth2 account
try:
oauth2_external = \
self.db.ExternalAccounts.nodes.get(username=email)
except self.db.ExternalAccounts.DoesNotExist:
oauth2_external = self.db.ExternalAccounts(username=email)
# update main info for this user
oauth2_external.email = email
oauth2_external.token = token
oauth2_external.certificate_cn = cn
oauth2_external.save()
user_node.externals.connect(oauth2_external)
return user_node, oauth2_external
def store_proxy_cert(self, external_user, proxy):
# external_user = user_node.externals.all().pop()
external_user.proxyfile = proxy
external_user.save()
# def associate_object_to_attribute(self, obj, key, value):
# # ##################################
# # # Create irods user inside the database
# # graph_irods_user = None
# # graph = self.neo
# # try:
# # graph_irods_user = .IrodsUser.nodes.get(username=irods_user)
# # except graph.IrodsUser.DoesNotExist:
# # # Save into the graph
# # graph_irods_user = graph.IrodsUser(username=irods_user)
# # graph_irods_user.save()
# # # Connect the user to graph If not already
# # user_node.associated.connect(graph_irods_user)
# pass
| mit |
Lazyuki/Discord-Stats-Bot | eventProcessors/imgurUploads.js | 1895 | module.exports.name = 'imgurUploads';
module.exports.events = ['NEW'];
module.exports.initialize = (json, server) => {
server.watchedImagesID = [];
server.watchedImagesLink = [];
if (!json || !json['watchedImagesID']) return;
server.watchedImagesID = json['watchedImagesID'];
server.watchedImagesLink = json['watchedImagesLink'];
};
module.exports.isAllowed = (message, server) => {
return server.watchedUsers.includes(message.author.id);
};
const config = require('../config.json');
const request = require('request');
module.exports.process = (message, server) => {
if (message.attachments.size > 0) {
let imageURL = message.attachments.first().url;
var options = {
method: 'POST',
url: 'https://api.imgur.com/3/image',
headers: {
'cache-control': 'no-cache',
authorization: `Bearer ${config.imgurAccessToken}`,
'content-type':
'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW',
},
formData: {
image: imageURL,
album: config.imgurAlbum,
description: `In ${message.channel.name} by ${message.author.tag}`,
type: 'URL',
},
};
request(
options,
function (error, response, body) {
if (error) {
console.log(error);
return;
}
try {
let ret = JSON.parse(body);
if (ret.data.link == undefined) {
console.log(JSON.stringify(ret));
} else {
this.watchedImagesID.push(message.id);
this.watchedImagesLink.push(ret.data.link);
if (this.watchedImagesID.length > 50) {
this.watchedImagesID.shift();
this.watchedImagesLink.shift();
}
}
} catch (e) {
console.log(e);
}
}.bind(server)
); // Bind server as 'this' in the callback
}
};
| mit |
IronCountySchoolDistrict/test-forge | src/logger.js | 283 | import { logger } from './index';
import { printObj } from './util';
export function logErrors(item, msg, e) {
logger.log('info', msg, {
psDbError: printObj(e)
});
if (item) {
logger.log('info', 'Source Data Record: ', {
sourceData: printObj(item)
});
}
}
| mit |
TeamFat/go-way | code/atomic/main.go | 484 | package main
import (
"fmt"
"log"
"net/http"
_ "net/http/pprof"
"runtime"
"sync"
"sync/atomic"
"time"
)
var (
count int32
wg sync.WaitGroup
)
func main() {
go func() {
log.Println(http.ListenAndServe("localhost:8081", nil))
}()
wg.Add(2)
go incCount(1)
go incCount(2)
wg.Wait()
fmt.Println("dfdadf", count)
time.Sleep(time.Minute)
}
func incCount(ii int32) {
defer wg.Done()
for i := 0; i < 2; i++ {
runtime.Gosched()
atomic.AddInt32(&count, 1)
}
}
| mit |
janko-m/tus-ruby-server | test/test_helper.rb | 132 | require "bundler/setup"
ENV["MT_NO_EXPECTATIONS"] = "1"
require "minitest/autorun"
require "minitest/pride"
require "tus-server"
| mit |
lucas-solutions/work-server | ext/src/form/field/Text.js | 43001 | /**
* @docauthor Jason Johnston <[email protected]>
*
* A basic text field. Can be used as a direct replacement for traditional text inputs,
* or as the base class for more sophisticated input controls (like {@link Ext.form.field.TextArea}
* and {@link Ext.form.field.ComboBox}). Has support for empty-field placeholder values (see {@link #emptyText}).
*
* # Validation
*
* The Text field has a useful set of validations built in:
*
* - {@link #allowBlank} for making the field required
* - {@link #minLength} for requiring a minimum value length
* - {@link #maxLength} for setting a maximum value length (with {@link #enforceMaxLength} to add it
* as the `maxlength` attribute on the input element)
* - {@link #regex} to specify a custom regular expression for validation
*
* In addition, custom validations may be added:
*
* - {@link #vtype} specifies a virtual type implementation from {@link Ext.form.field.VTypes} which can contain
* custom validation logic
* - {@link #validator} allows a custom arbitrary function to be called during validation
*
* The details around how and when each of these validation options get used are described in the
* documentation for {@link #getErrors}.
*
* By default, the field value is checked for validity immediately while the user is typing in the
* field. This can be controlled with the {@link #validateOnChange}, {@link #checkChangeEvents}, and
* {@link #checkChangeBuffer} configurations. Also see the details on Form Validation in the
* {@link Ext.form.Panel} class documentation.
*
* # Masking and Character Stripping
*
* Text fields can be configured with custom regular expressions to be applied to entered values before
* validation: see {@link #maskRe} and {@link #stripCharsRe} for details.
*
* # Example usage
*
* @example
* Ext.create('Ext.form.Panel', {
* title: 'Contact Info',
* width: 300,
* bodyPadding: 10,
* renderTo: Ext.getBody(),
* items: [{
* xtype: 'textfield',
* name: 'name',
* fieldLabel: 'Name',
* allowBlank: false // requires a non-empty value
* }, {
* xtype: 'textfield',
* name: 'email',
* fieldLabel: 'Email Address',
* vtype: 'email' // requires value to be a valid email address format
* }]
* });
*/
Ext.define('Ext.form.field.Text', {
extend:'Ext.form.field.Base',
alias: 'widget.textfield',
requires: [
'Ext.form.field.VTypes',
'Ext.form.trigger.Trigger'
],
alternateClassName: ['Ext.form.TextField', 'Ext.form.Text'],
config: {
/**
* @cfg {Boolean} hideTrigger
* `true` to hide all triggers
*/
hideTrigger: false,
/**
* @cfg {Object} triggers
* {@link Ext.form.trigger.Trigger Triggers} to use in this field. The keys in
* this object are unique identifiers for the triggers. The values in this object
* are {@link Ext.form.trigger.Trigger Trigger} configuration objects.
*
* @example
* Ext.create('Ext.form.field.Text', {
* renderTo: Ext.getBody(),
* fieldLabel: 'My Custom Field',
* triggers: {
* foo: {
* cls: 'my-foo-trigger',
* handler: function() {
* console.log('foo trigger clicked');
* }
* },
* bar: {
* cls: 'my-bar-trigger',
* handler: function() {
* console.log('bar trigger clicked');
* }
* }
* }
* });
*/
triggers: undefined
},
/**
* @cfg {String} vtypeText
* A custom error message to display in place of the default message provided for the **`{@link #vtype}`** currently
* set for this field. **Note**: only applies if **`{@link #vtype}`** is set, else ignored.
*/
/**
* @cfg {RegExp} stripCharsRe
* A JavaScript RegExp object used to strip unwanted content from the value
* during input. If `stripCharsRe` is specified,
* every *character sequence* matching `stripCharsRe` will be removed.
*/
/**
* @cfg {Number} size
* An initial value for the 'size' attribute on the text input element. This is only
* used if the field has no configured {@link #width} and is not given a width by its
* container's layout. Defaults to 20.
* @deprecated use {@link #width} instead.
*/
/**
* @cfg {Boolean} [grow=false]
* true if this field should automatically grow and shrink to its content
*/
/**
* @cfg {Number} growMin
* The minimum width to allow when `{@link #grow} = true`
*/
growMin : 30,
/**
* @cfg {Number} growMax
* The maximum width to allow when `{@link #grow} = true`
*/
growMax : 800,
//<locale>
/**
* @cfg {String} growAppend
* A string that will be appended to the field's current value for the purposes of calculating the target field
* size. Only used when the {@link #grow} config is true. Defaults to a single capital "W" (the widest character in
* common fonts) to leave enough space for the next typed character and avoid the field value shifting before the
* width is adjusted.
*/
growAppend: 'W',
//</locale>
/**
* @cfg {String} vtype
* A validation type name as defined in {@link Ext.form.field.VTypes}
*/
/**
* @cfg {RegExp} maskRe An input mask regular expression that will be used to filter keystrokes (character being
* typed) that do not match.
* Note: It does not filter characters already in the input.
*/
/**
* @cfg {Boolean} [disableKeyFilter=false]
* Specify true to disable input keystroke filtering
*/
/**
* @cfg {Boolean} [allowBlank=true]
* Specify false to validate that the value's length must be > 0. If `true`, then a blank value is **always** taken to be valid regardless of any {@link #vtype}
* validation that may be applied.
*
* If {@link #vtype} validation must still be applied to blank values, configure {@link #validateBlank} as `true`;
*/
allowBlank : true,
/**
* @cfg {Boolean} [validateBlank=false]
* Specify as `true` to modify the behaviour of {@link #allowBlank} so that blank values are not passed as valid, but are subject to any configure {@link #vtype} validation.
*/
validateBlank: false,
/**
* @cfg {Boolean} allowOnlyWhitespace
* Specify false to automatically trim the value before validating
* the whether the value is blank. Setting this to false automatically
* sets {@link #allowBlank} to false.
*/
allowOnlyWhitespace: true,
/**
* @cfg {Number} minLength
* Minimum input field length required
*/
minLength : 0,
/**
* @cfg {Number} maxLength
* Maximum input field length allowed by validation. This behavior is intended to
* provide instant feedback to the user by improving usability to allow pasting and editing or overtyping and back
* tracking. To restrict the maximum number of characters that can be entered into the field use the
* **{@link Ext.form.field.Text#enforceMaxLength enforceMaxLength}** option.
*
* Defaults to Number.MAX_VALUE.
*/
maxLength : Number.MAX_VALUE,
/**
* @cfg {Boolean} enforceMaxLength
* True to set the maxLength property on the underlying input field. Defaults to false
*/
//<locale>
/**
* @cfg {String} minLengthText
* Error text to display if the **{@link #minLength minimum length}** validation fails.
*/
minLengthText : 'The minimum length for this field is {0}',
//</locale>
//<locale>
/**
* @cfg {String} maxLengthText
* Error text to display if the **{@link #maxLength maximum length}** validation fails
*/
maxLengthText : 'The maximum length for this field is {0}',
//</locale>
/**
* @cfg {Boolean} [selectOnFocus=false]
* `true` to automatically select any existing field text when the field receives input
* focus. Only applies when {@link #editable editable} = true
*/
//<locale>
/**
* @cfg {String} blankText
* The error text to display if the **{@link #allowBlank}** validation fails
*/
blankText : 'This field is required',
//</locale>
/**
* @cfg {Function} validator
* A custom validation function to be called during field validation ({@link #getErrors}).
* If specified, this function will be called first, allowing the developer to override the default validation
* process.
*
* This function will be passed the following parameters:
*
* @cfg {Object} validator.value The current field value
* @cfg {Boolean/String} validator.return
*
* - True if the value is valid
* - An error message if the value is invalid
*/
/**
* @cfg {RegExp} regex
* A JavaScript RegExp object to be tested against the field value during validation.
* If the test fails, the field will be marked invalid using
* either **{@link #regexText}** or **{@link #invalidText}**.
*/
/**
* @cfg {String} regexText
* The error text to display if **{@link #regex}** is used and the test fails during validation
*/
regexText : '',
/**
* @cfg {String} emptyText
* The default text to place into an empty field.
*
* Note that normally this value will be submitted to the server if this field is enabled; to prevent this you can
* set the {@link Ext.form.action.Action#submitEmptyText submitEmptyText} option of {@link Ext.form.Basic#submit} to
* false.
*
* Also note that if you use {@link #inputType inputType}:'file', {@link #emptyText} is not supported and should be
* avoided.
*
* Note that for browsers that support it, setting this property will use the HTML 5 placeholder attribute, and for
* older browsers that don't support the HTML 5 placeholder attribute the value will be placed directly into the input
* element itself as the raw value. This means that older browsers will obfuscate the {@link #emptyText} value for
* password input fields.
*/
/**
* @cfg {String} [emptyCls='x-form-empty-field']
* The CSS class to apply to an empty field to style the **{@link #emptyText}**.
* This class is automatically added and removed as needed depending on the current field value.
*/
emptyCls : Ext.baseCSSPrefix + 'form-empty-field',
/**
* @cfg {String} [requiredCls='x-form-required-field']
* The CSS class to apply to a required field, i.e. a field where **{@link #allowBlank}** is false.
*/
requiredCls : Ext.baseCSSPrefix + 'form-required-field',
/**
* @cfg {Boolean} [enableKeyEvents=false]
* true to enable the proxying of key events for the HTML input field
*/
// private
valueContainsPlaceholder : false,
ariaRole: 'textbox',
/**
* @cfg {Boolean} editable
* false to prevent the user from typing text directly into the field; the field can
* only have its value set programmatically or via an action invoked by a trigger.
*/
editable: true,
/**
* @cfg {Boolean} repeatTriggerClick
* `true` to attach a {@link Ext.util.ClickRepeater click repeater} to the trigger(s).
* Click repeating behavior can also be configured on the individual {@link #triggers
* trigger instances using the trigger's {@link {Ext.form.trigger.Trigger#repeatClick
* repeatClick} config.
*/
repeatTriggerClick: false,
/**
* @cfg {Boolean} readOnly
* `true` to prevent the user from changing the field, and hide all triggers.
*/
/**
* @cfg {String}
* The CSS class that is added to the div wrapping the input element and trigger button(s).
*/
triggerWrapCls: Ext.baseCSSPrefix + 'form-trigger-wrap',
triggerWrapFocusCls: Ext.baseCSSPrefix + 'form-trigger-wrap-focus',
triggerWrapInvalidCls: Ext.baseCSSPrefix + 'form-trigger-wrap-invalid',
fieldBodyCls: Ext.baseCSSPrefix + 'form-text-field-body',
/**
* @cfg {String}
* The CSS class that is added to the element wrapping the input element
*/
inputWrapCls: Ext.baseCSSPrefix + 'form-text-wrap',
inputWrapFocusCls: Ext.baseCSSPrefix + 'form-text-wrap-focus',
inputWrapInvalidCls: Ext.baseCSSPrefix + 'form-text-wrap-invalid',
// private
monitorTab: true,
// private
mimicing: false,
childEls: [
/**
* @property {Ext.Element} triggerWrap
* A reference to the element which encapsulates the input field and all
* trigger button(s). Only set after the field has been rendered.
*/
'triggerWrap',
'inputWrap'
],
preSubTpl: [
'<div id="{cmpId}-triggerWrap" class="{triggerWrapCls} {triggerWrapCls}-{ui}">',
'<div id={cmpId}-inputWrap class="{inputWrapCls} {inputWrapCls}-{ui}">'
],
postSubTpl: [
'</div>', // end inputWrap
'<tpl for="triggers">{[values.renderTrigger(parent)]}</tpl>',
'</div>' // end triggerWrap
],
/**
* @event autosize
* Fires when the **{@link #autoSize}** function is triggered and the field is resized according to the
* {@link #grow}/{@link #growMin}/{@link #growMax} configs as a result. This event provides a hook for the
* developer to apply additional logic at runtime to resize the field if needed.
* @param {Ext.form.field.Text} this This text field
* @param {Number} width The new field width
*/
/**
* @event keydown
* Keydown input field event. This event only fires if **{@link #enableKeyEvents}** is set to true.
* @param {Ext.form.field.Text} this This text field
* @param {Ext.event.Event} e
*/
/**
* @event keyup
* Keyup input field event. This event only fires if **{@link #enableKeyEvents}** is set to true.
* @param {Ext.form.field.Text} this This text field
* @param {Ext.event.Event} e
*/
/**
* @event keypress
* Keypress input field event. This event only fires if **{@link #enableKeyEvents}** is set to true.
* @param {Ext.form.field.Text} this This text field
* @param {Ext.event.Event} e
*/
initComponent: function () {
var me = this,
emptyCls = me.emptyCls;
if (me.allowOnlyWhitespace === false) {
me.allowBlank = false;
}
//<debug>
if (me.size) {
Ext.log.warn('Ext.form.field.Text "size" config was deprecated in Ext 5.0. Please specify a "width" or use a layout instead.');
}
//</debug>
// In Ext JS 4.x the layout system used the following magic formula for converting
// the "size" config into a pixel value.
me.defaultBodyWidth = me.size * 6.5 + 20;
if (!me.onTrigger1Click) {
// for compat with 4.x TriggerField
me.onTrigger1Click = me.onTriggerClick;
}
me.callParent();
me.setReadOnly(me.readOnly);
me.fieldFocusCls = me.baseCls + '-focus';
me.emptyUICls = emptyCls + ' ' + emptyCls + '-' + me.ui;
me.addStateEvents('change');
me.setGrowSizePolicy();
},
// private
setGrowSizePolicy: function(){
if (this.grow) {
this.shrinkWrap |= 1; // width must shrinkWrap
}
},
// private
initEvents: function(){
var me = this,
el = me.inputEl;
// a global before focus listener to detect when another component takes focus
// away from this field because el.focus() was explicitly called. We have to
// attach this listener up front (vs. in onFocus) just in case focus is called
// multiple times in the same thread. In such a case IE processes the events
// asynchronously. for example:
// someTrigger.focus();
// someOther.focus(); // onOtherFocus would not be called here if we wait until
// onFocus of someTrigger to attach the listener
// See EXTJSIV-11712
this.mon(Ext.GlobalEvents, 'beforefocus', this.onOtherFocus, this);
me.callParent();
if(me.selectOnFocus || me.emptyText){
me.mon(el, 'mousedown', me.onMouseDown, me);
}
if(me.maskRe || (me.vtype && me.disableKeyFilter !== true && (me.maskRe = Ext.form.field.VTypes[me.vtype+'Mask']))){
me.mon(el, 'keypress', me.filterKeys, me);
}
if (me.enableKeyEvents) {
me.mon(el, {
scope: me,
keyup: me.onKeyUp,
keydown: me.onKeyDown,
keypress: me.onKeyPress
});
}
},
/**
* @private
* Override. Treat undefined and null values as equal to an empty string value.
*/
isEqual: function(value1, value2) {
return this.isEqualAsString(value1, value2);
},
/**
* @private
* If grow=true, invoke the autoSize method when the field's value is changed.
*/
onChange: function(newVal, oldVal) {
this.callParent(arguments);
this.autoSize();
},
getSubTplData: function() {
var me = this,
value = me.getRawValue(),
isEmpty = me.emptyText && value.length < 1,
maxLength = me.maxLength,
placeholder;
// We can't just dump the value here, since MAX_VALUE ends up
// being something like 1.xxxxe+300, which gets interpreted as 1
// in the markup
if (me.enforceMaxLength) {
if (maxLength === Number.MAX_VALUE) {
maxLength = undefined;
}
} else {
maxLength = undefined;
}
if (isEmpty) {
if (Ext.supports.Placeholder) {
placeholder = me.emptyText;
} else {
value = me.emptyText;
me.valueContainsPlaceholder = true;
}
}
return Ext.apply(me.callParent(), {
triggerWrapCls: me.triggerWrapCls,
inputWrapCls: me.inputWrapCls,
triggers: me.orderedTriggers,
maxLength: maxLength,
readOnly: !me.editable || me.readOnly,
placeholder: placeholder,
value: value,
fieldCls: me.fieldCls + ((isEmpty && (placeholder || value)) ? ' ' + me.emptyUICls : '') + (me.allowBlank ? '' : ' ' + me.requiredCls)
});
},
onRender: function() {
var me = this,
triggers = me.getTriggers(),
elements = [],
id, triggerEl;
if (Ext.supports.MinWidthTableCellBug) {
// Workaround for https://bugs.webkit.org/show_bug.cgi?id=130239
// See styleHooks for more details
me.el._needsMinWithFix = true;
}
me.callParent();
if (triggers) {
this.invokeTriggers('onFieldRender');
/**
* @property {Ext.CompositeElement} triggerEl
* @deprecated 5.0
* A composite of all the trigger button elements. Only set after the field has
* been rendered.
*/
for(id in triggers) {
elements.push(triggers[id].el);
}
// for 4.x compat, also set triggerCell
triggerEl = me.triggerEl = me.triggerCell = new Ext.CompositeElement(elements, true);
}
/**
* @property {Ext.Element} inputCell
* A reference to the element that wraps the input element. Only set after the
* field has been rendered.
* @deprecated 5.0 use {@link #inputWrap} instead
*/
me.inputCell = me.inputWrap;
},
afterRender: function(){
var me = this;
me.autoSize();
me.callParent();
this.invokeTriggers('afterFieldRender');
},
onMouseDown: function(e){
var me = this;
if(!me.hasFocus){
me.mon(me.inputEl, 'mouseup', Ext.emptyFn, me, { single: true, preventDefault: true });
}
},
applyTriggers: function(triggers) {
var me = this,
hideAllTriggers = me.getHideTrigger(),
readOnly = me.readOnly,
orderedTriggers = me.orderedTriggers = [],
repeatTriggerClick = me.repeatTriggerClick,
id, triggerCfg, trigger, triggerCls, i;
//<debug>
if (me.rendered) {
Ext.Error.raise("Cannot set triggers after field has already been rendered.");
}
// don't warn if we have both triggerCls and triggers, because picker field
// uses triggerCls to style the "picker" trigger.
if ((me.triggerCls && !triggers) || me.trigger1Cls) {
Ext.log.warn("Ext.form.field.Text: 'triggerCls' and 'trigger<n>Cls'" +
" are deprecated. Use 'triggers' instead.");
}
//</debug>
if (!triggers) {
// For compatibility with 4.x, transform the trigger<n>Cls configs into the
// new "triggers" config.
triggers = {};
if (me.triggerCls && !me.trigger1Cls) {
me.trigger1Cls = me.triggerCls;
}
for (i = 1; triggerCls = me['trigger' + i + 'Cls']; i++) {
triggers['trigger' + i] = {
cls: triggerCls,
extraCls: Ext.baseCSSPrefix + 'trigger-index-' + i,
handler: 'onTrigger' + i + 'Click',
compat4Mode: true,
scope: me
};
}
}
for(id in triggers) {
if (triggers.hasOwnProperty(id)) {
triggerCfg = triggers[id];
triggerCfg.field = me;
triggerCfg.id = id;
/*
* An explicitly-configured 'triggerConfig.hideOnReadOnly : false' allows {@link #hideTrigger} analysis
*/
if ((readOnly && triggerCfg.hideOnReadOnly !== false) || (hideAllTriggers && triggerCfg.hidden !== false)) {
triggerCfg.hidden = true;
}
if (repeatTriggerClick && (triggerCfg.repeatClick !== false)) {
triggerCfg.repeatClick = true;
}
trigger = triggers[id] = Ext.form.trigger.Trigger.create(triggerCfg);
orderedTriggers.push(trigger);
}
}
Ext.Array.sort(orderedTriggers, Ext.form.trigger.Trigger.weightComparator);
return triggers;
},
/**
* Invokes a method on all triggers.
* @param {String} methodName
* @private
*/
invokeTriggers: function(methodName, args) {
var me = this,
triggers = me.getTriggers(),
id, trigger;
if (triggers) {
for (id in triggers) {
if (triggers.hasOwnProperty(id)) {
trigger = triggers[id];
// IE8 needs "|| []" if args is undefined
trigger[methodName].apply(trigger, args || []);
}
}
}
},
/**
* Returns the trigger with the given id
* @param {String} id
* @return {Ext.form.trigger.Trigger}
*/
getTrigger: function(id) {
return this.getTriggers()[id];
},
updateHideTrigger: function(hideTrigger) {
if (this.rendered) {
this.invokeTriggers(hideTrigger ? 'hide' : 'show');
}
},
/**
* Sets the editable state of this field.
* @param {Boolean} editable True to allow the user to directly edit the field text.
* If false is passed, the user will only be able to modify the field using the trigger.
*/
setEditable: function(editable) {
var me = this;
me.editable = editable;
if (me.rendered) {
me.setReadOnlyAttr(!editable || me.readOnly);
}
},
/**
* Sets the read-only state of this field.
* @param {Boolean} readOnly True to prevent the user changing the field and explicitly
* hide the trigger(s). Setting this to true will supersede settings editable and
* hideTrigger. Setting this to false will defer back to {@link #editable editable} and {@link #hideTrigger hideTrigger}.
*/
setReadOnly: function(readOnly) {
var me = this,
triggers = me.getTriggers(),
hideTriggers = me.getHideTrigger(),
trigger,
id;
readOnly = !!readOnly;
me.callParent([readOnly]);
if (me.rendered) {
me.setReadOnlyAttr(readOnly || !me.editable);
if (triggers) {
for (id in triggers) {
trigger = triggers[id];
/*
* Controlled trigger visibility state is only managed fully when 'hideOnReadOnly' is falsy.
* Truth table:
* - If the trigger is configured/defaulted as 'hideOnReadOnly : true', it's readOnly-visibility
* is determined solely by readOnly state of the Field.
* - If 'hideOnReadOnly : false/undefined', the Fields.{link #hideTrigger hideTrigger} is honored.
*/
if (trigger.hideOnReadOnly === true || (trigger.hideOnReadOnly !== false && !hideTriggers)) {
trigger[readOnly ? 'hide' : 'show'].call(trigger);
}
}
}
}
},
// private. sets the readonly attribute of the input element
setReadOnlyAttr: function(readOnly) {
var me = this,
readOnlyName = 'readonly',
inputEl = me.inputEl.dom;
if (readOnly) {
inputEl.setAttribute(readOnlyName, readOnlyName);
} else {
inputEl.removeAttribute(readOnlyName);
}
},
/**
* Performs any necessary manipulation of a raw String value to prepare it for conversion and/or
* {@link #validate validation}. For text fields this applies the configured {@link #stripCharsRe}
* to the raw value.
* @param {String} value The unprocessed string value
* @return {String} The processed string value
*/
processRawValue: function(value) {
var me = this,
stripRe = me.stripCharsRe,
newValue;
if (stripRe) {
newValue = value.replace(stripRe, '');
if (newValue !== value) {
me.setRawValue(newValue);
value = newValue;
}
}
return value;
},
//private
onDisable: function(){
this.callParent();
if (Ext.isIE) {
this.inputEl.dom.unselectable = 'on';
}
},
//private
onEnable: function(){
this.callParent();
if (Ext.isIE) {
this.inputEl.dom.unselectable = '';
}
},
onKeyDown: function(e) {
this.fireEvent('keydown', this, e);
},
onKeyUp: function(e) {
this.fireEvent('keyup', this, e);
},
onKeyPress: function(e) {
this.fireEvent('keypress', this, e);
},
/**
* Resets the current field value to the originally-loaded value and clears any validation messages.
* Also adds **{@link #emptyText}** and **{@link #emptyCls}** if the original value was blank.
*/
reset : function(){
this.callParent();
this.applyEmptyText();
},
applyEmptyText : function(){
var me = this,
emptyText = me.emptyText,
isEmpty;
if (me.rendered && emptyText) {
isEmpty = me.getRawValue().length < 1 && !me.hasFocus;
if (Ext.supports.Placeholder) {
me.inputEl.dom.placeholder = emptyText;
} else if (isEmpty) {
me.setRawValue(emptyText);
me.valueContainsPlaceholder = true;
}
//all browsers need this because of a styling issue with chrome + placeholders.
//the text isnt vertically aligned when empty (and using the placeholder)
if (isEmpty) {
me.inputEl.addCls(me.emptyUICls);
}
me.autoSize();
}
},
afterFirstLayout: function() {
this.callParent();
if (Ext.isIE && this.disabled) {
var el = this.inputEl;
if (el) {
el.dom.unselectable = 'on';
}
}
},
//private
toggleInvalidCls: function(hasError) {
var method = hasError ? 'addCls' : 'removeCls';
this.callParent();
this.triggerWrap[method](this.triggerWrapInvalidCls);
this.inputWrap[method](this.inputWrapInvalidCls);
},
// private
beforeFocus : function(){
var me = this,
inputEl = me.inputEl,
emptyText = me.emptyText,
isEmpty;
me.callParent(arguments);
if ((emptyText && !Ext.supports.Placeholder) && (inputEl.dom.value === me.emptyText && me.valueContainsPlaceholder)) {
me.setRawValue('');
isEmpty = true;
inputEl.removeCls(me.emptyUICls);
me.valueContainsPlaceholder = false;
} else if (Ext.supports.Placeholder) {
inputEl.removeCls(me.emptyUICls);
}
if (me.selectOnFocus || isEmpty) {
// see: http://code.google.com/p/chromium/issues/detail?id=4505
if (Ext.isWebKit) {
if (!me.inputFocusTask) {
me.inputFocusTask = new Ext.util.DelayedTask(me.focusInput, me);
}
me.inputFocusTask.delay(1);
} else {
me.focusInput();
}
}
},
focusInput: function(){
var input = this.inputEl;
if (input) {
input = input.dom;
if (input) {
input.select();
}
}
},
onFocus: function(e) {
var me = this;
// When this is focused, this flag must be cleared
me.otherFocused = false;
me.callParent(arguments);
if (me.emptyText) {
me.autoSize();
}
if (!me.mimicing) {
me.addCls(me.fieldFocusCls);
me.triggerWrap.addCls(me.triggerWrapFocusCls);
me.inputWrap.addCls(me.inputWrapFocusCls);
me.invokeTriggers('onFieldFocus', [e]);
me.mimicing = true;
me.mon(Ext.getDoc(), 'mousedown', me.mimicBlur, me, {
delay: 10
});
if (me.monitorTab) {
me.on('specialkey', me.checkTab, me);
}
}
},
/**
* @private
* The default blur handling must not occur for a TriggerField, implementing this template method disables that.
* Instead the tab key is monitored, and the superclass's onBlur is called when tab is detected
*/
onBlur: function() {
// Only trigger a blur if blur() or focus() called programmatically
if (this.blurring || this.otherFocused) {
this.triggerBlur();
this.otherFocused = false;
}
},
// ensures we trigger a blur if some other component/element is programmatically
// focused (see EXTJSIV-11712)
onOtherFocus: function(dom) {
this.otherFocused = (this.hasFocus && !this.bodyEl.contains(dom));
},
// @private
checkTab: function(me, e) {
if (!this.ignoreMonitorTab && e.getKey() === e.TAB) {
this.triggerBlur();
}
},
// @private
mimicBlur: function(e) {
if (!this.isDestroyed && !this.bodyEl.contains(e.target)) {
this.triggerBlur(e);
}
},
// @private
triggerBlur: function(e) {
var me = this;
me.mimicing = false;
me.mun(Ext.getDoc(), 'mousedown', me.mimicBlur, me);
if (me.monitorTab && me.inputEl) {
me.un('specialkey', me.checkTab, me);
}
Ext.form.field.Text.superclass.onBlur.call(me, e);
me.removeCls(me.fieldFocusCls);
me.triggerWrap.removeCls(me.triggerWrapFocusCls);
me.inputWrap.removeCls(me.inputWrapFocusCls);
me.invokeTriggers('onFieldBlur', [e]);
},
// private
postBlur: function(){
var task = this.inputFocusTask;
this.callParent(arguments);
this.applyEmptyText();
// Once we blur, cancel any pending select events from focus
// We need this because of the WebKit bug detailed in beforeFocus
if (task) {
task.cancel();
}
},
// private
filterKeys : function(e){
/*
* On European keyboards, the right alt key, Alt Gr, is used to type certain special characters.
* JS detects a keypress of this as ctrlKey & altKey. As such, we check that alt isn't pressed
* so we can still process these special characters.
*/
if (e.ctrlKey && !e.altKey) {
return;
}
var key = e.getKey(),
charCode = String.fromCharCode(e.getCharCode());
if((Ext.isGecko || Ext.isOpera) && (e.isNavKeyPress() || key === e.BACKSPACE || (key === e.DELETE && e.button === -1))){
return;
}
if((!Ext.isGecko && !Ext.isOpera) && e.isSpecialKey() && !charCode){
return;
}
if(!this.maskRe.test(charCode)){
e.stopEvent();
}
},
getState: function() {
return this.addPropertyToState(this.callParent(), 'value');
},
applyState: function(state) {
this.callParent(arguments);
if(state.hasOwnProperty('value')) {
this.setValue(state.value);
}
},
/**
* Returns the raw String value of the field, without performing any normalization, conversion, or validation. Gets
* the current value of the input element if the field has been rendered, ignoring the value if it is the
* {@link #emptyText}. To get a normalized and converted value see {@link #getValue}.
* @return {String} The raw String value of the field
*/
getRawValue: function() {
var me = this,
v = me.callParent();
if (v === me.emptyText && me.valueContainsPlaceholder) {
v = '';
}
return v;
},
/**
* Sets a data value into the field and runs the change detection and validation. Also applies any configured
* {@link #emptyText} for text fields. To set the value directly without these inspections see {@link #setRawValue}.
* @param {Object} value The value to set
* @return {Ext.form.field.Text} this
*/
setValue: function(value) {
var me = this,
inputEl = me.inputEl;
if (inputEl && me.emptyText && !Ext.isEmpty(value)) {
inputEl.removeCls(me.emptyUICls);
me.valueContainsPlaceholder = false;
}
me.callParent(arguments);
me.applyEmptyText();
return me;
},
/**
* Validates a value according to the field's validation rules and returns an array of errors
* for any failing validations. Validation rules are processed in the following order:
*
* 1. **Field specific validator**
*
* A validator offers a way to customize and reuse a validation specification.
* If a field is configured with a `{@link #validator}`
* function, it will be passed the current field value. The `{@link #validator}`
* function is expected to return either:
*
* - Boolean `true` if the value is valid (validation continues).
* - a String to represent the invalid message if invalid (validation halts).
*
* 2. **Basic Validation**
*
* If the `{@link #validator}` has not halted validation,
* basic validation proceeds as follows:
*
* - `{@link #allowBlank}` : (Invalid message = `{@link #blankText}`)
*
* Depending on the configuration of `{@link #allowBlank}`, a
* blank field will cause validation to halt at this step and return
* Boolean true or false accordingly.
*
* - `{@link #minLength}` : (Invalid message = `{@link #minLengthText}`)
*
* If the passed value does not satisfy the `{@link #minLength}`
* specified, validation halts.
*
* - `{@link #maxLength}` : (Invalid message = `{@link #maxLengthText}`)
*
* If the passed value does not satisfy the `{@link #maxLength}`
* specified, validation halts.
*
* 3. **Preconfigured Validation Types (VTypes)**
*
* If none of the prior validation steps halts validation, a field
* configured with a `{@link #vtype}` will utilize the
* corresponding {@link Ext.form.field.VTypes VTypes} validation function.
* If invalid, either the field's `{@link #vtypeText}` or
* the VTypes vtype Text property will be used for the invalid message.
* Keystrokes on the field will be filtered according to the VTypes
* vtype Mask property.
*
* 4. **Field specific regex test**
*
* If none of the prior validation steps halts validation, a field's
* configured `{@link #regex}` test will be processed.
* The invalid message for this test is configured with `{@link #regexText}`
*
* @param {Object} value The value to validate. The processed raw value will be used if nothing is passed.
* @return {String[]} Array of any validation errors
*/
getErrors: function(value) {
var me = this,
errors = me.callParent(arguments),
validator = me.validator,
vtype = me.vtype,
vtypes = Ext.form.field.VTypes,
regex = me.regex,
format = Ext.String.format,
msg, trimmed, isBlank;
value = value || me.processRawValue(me.getRawValue());
if (Ext.isFunction(validator)) {
msg = validator.call(me, value);
if (msg !== true) {
errors.push(msg);
}
}
trimmed = me.allowOnlyWhitespace ? value : Ext.String.trim(value);
if (trimmed.length < 1 || (value === me.emptyText && me.valueContainsPlaceholder)) {
if (!me.allowBlank) {
errors.push(me.blankText);
}
// If we are not configured to validate blank values, there cannot be any additional errors
if (!me.validateBlank) {
return errors;
}
isBlank = true;
}
// If a blank value has been allowed through, then exempt it from the minLength check.
// It must be allowed to hit the vtype validation.
if (!isBlank && value.length < me.minLength) {
errors.push(format(me.minLengthText, me.minLength));
}
if (value.length > me.maxLength) {
errors.push(format(me.maxLengthText, me.maxLength));
}
if (vtype) {
if (!vtypes[vtype](value, me)) {
errors.push(me.vtypeText || vtypes[vtype +'Text']);
}
}
if (regex && !regex.test(value)) {
errors.push(me.regexText || me.invalidText);
}
return errors;
},
/**
* Selects text in this field
* @param {Number} [start=0] The index where the selection should start
* @param {Number} [end] The index where the selection should end (defaults to the text length)
*/
selectText : function(start, end){
var me = this,
v = me.getRawValue(),
doFocus = true,
el = me.inputEl.dom,
undef,
range;
if (v.length > 0) {
start = start === undef ? 0 : start;
end = end === undef ? v.length : end;
if (el.setSelectionRange) {
el.setSelectionRange(start, end);
}
else if(el.createTextRange) {
range = el.createTextRange();
range.moveStart('character', start);
range.moveEnd('character', end - v.length);
range.select();
}
doFocus = Ext.isGecko || Ext.isOpera;
}
if (doFocus) {
me.focus();
}
},
/**
* Automatically grows the field to accommodate the width of the text up to the maximum field width allowed. This
* only takes effect if {@link #grow} = true, and fires the {@link #autosize} event if the width changes.
*/
autoSize: function() {
var me = this;
if (me.grow && me.rendered) {
me.autoSizing = true;
me.updateLayout();
}
},
afterComponentLayout: function() {
var me = this,
width;
me.callParent(arguments);
if (me.autoSizing) {
width = me.inputEl.getWidth();
if (width !== me.lastInputWidth) {
me.fireEvent('autosize', me, width);
me.lastInputWidth = width;
delete me.autoSizing;
}
}
},
onDestroy: function(){
var me = this;
me.invokeTriggers('destroy');
Ext.destroy(me.triggerRepeater);
me.callParent();
if (me.inputFocusTask) {
me.inputFocusTask.cancel();
me.inputFocusTask = null;
}
},
onTriggerClick: Ext.emptyFn,
deprecated: {
5: {
methods: {
/**
* Get the total width of the trigger button area.
* @return {Number} The total trigger width
* @deprecated 5.0
*/
getTriggerWidth: function() {
var triggers = this.getTriggers(),
width = 0,
id;
if (triggers && this.rendered) {
for (id in triggers) {
if (triggers.hasOwnProperty(id)) {
width += triggers[id].el.getWidth();
}
}
}
return width;
}
}
}
}
});
| mit |
EvanSimpson/olin-dining-hacks | routes/recipes.js | 2094 | var express = require('express');
var router = express.Router();
var ObjectID = require('mongodb').ObjectID;
module.exports = function(db){
router.post('/recipe', function(req, res){
// post a new recipe and save to database
var ingredients = req.body.ingredients.split(",");
if (req.session.user.id == req.body.user_id){
db.recipes.save({
name: req.body.name,
user_id: req.body.user_id,
display_name: req.body.display_name,
ingredients: ingredients,
instructions: req.body.instructions,
breakfast: req.body.breakfast || false,
lunch: req.body.lunch || false,
dinner: req.body.dinner || false,
dessert: req.body.dessert || false,
drink: req.body.drink || false
},
res.redirect.bind(res, '/')
);
}
});
router.delete('/recipe', function(req, res){
// delete the specified recipe from database - should validate user
db.recipes.findOne({
id: req.recipe_id
}, function(err, doc){
if (!err){
if (req.user.id == doc.user_id){
db.recipes.remove({
id: doc.id,
user_id: doc.user_id
}, function(err){
res.redirect('/');
});
}
}else{
res.redirect('/');
}
})
});
router.get('/recipes', function(req, res){
if (req.session.user){
db.recipes.find(function(err, docs){
res.render('recipes', {recipes: docs, user: req.session.user});
});
}
});
router.get('/recipe/new', function(req, res){
res.render('new', {user: req.session.user});
})
router.get('/recipe/:recipe_id', function(req, res){
// view the requested recipe - should render view
if (req.session.user){
db.recipes.findOne({
_id: new ObjectID(req.params.recipe_id)
}, function(err, doc){
if (!err){
doc.user = req.session.user;
res.render('recipe', doc);
}else{
res.redirect('/');
}
});
}else{
redirect('/login');
}
});
return router;
}
| mit |
novify/batmania | src/Novify/ModelBundle/DataFixtures/ORM/LoadArticles.php | 1550 | <?php
namespace Novify\ModelBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Novify\ModelBundle\Entity\Articles;
use Novify\ModelBundle\Entity\Categories;
use Novify\ModelBundle\Entity\Souscategories;
class LoadArticles implements FixtureInterface
{
/**
* {@inheritDoc}
*/
public function load(ObjectManager $manager)
{
// Pour créer les catégories :
// $categories = array('livres', 'videos', 'jeux-videos', 'goodies');
// foreach ($categories as $categorie) {
// $cat = new Categories();
// $cat->setCatNom($categorie);
// $manager->persist($cat);
// }
// Pour créer un article et le relier à une catégorie :
$categorie1 = new Categories();
$categorie1->setCatNom('goodies');
$manager->persist($categorie1);
$sousCategorie1 = new Souscategories();
$sousCategorie1->setSouscatNom('accessoires');
$sousCategorie1->setCategorie($categorie1);
$manager->persist($sousCategorie1);
$article1 = new Articles();
$article1->setArtNom('Bracelet');
$article1->setArtPrix('3');
$article1->setArtDescript('Ceci est un bracelet');
$article1->setArtRef('23256443');
$article1->setArtPublic('Tous publics');
$article1->setArtStock('28');
$article1->setSousCategorie($sousCategorie1);
$manager->persist($article1);
$manager->flush();
}
}
| mit |
georgeouzou/survgr | transform/migrations/0002_load_hattblocks15.py | 1152 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-22 15:28
from __future__ import unicode_literals
import os, json
from django.db import migrations
def load(apps, schema_editor):
Hattblock = apps.get_model("transform", "Hattblock")
OKXECoefficient = apps.get_model("transform", "OKXECoefficient")
cur_dir = os.path.dirname(__file__) #/migrations
transform_dir = os.path.split(cur_dir)[0] #/transform
with open(os.path.join(transform_dir, 'hatt', 'hattblocks15.json'),'r', encoding="utf8") as fd:
hattblocks = []
coeffs = []
for chunk in json.load(fd):
hb = Hattblock(
id=chunk['id'],
name=chunk['name'],
center_lon=chunk['cx'],
center_lat=chunk['cy'],
geometry=json.dumps(chunk['geom'])
)
hattblocks.append(hb)
for ctype, cvalue in chunk['okxe_coeffs'].items():
coeffs.append(OKXECoefficient(block=hb,type=ctype,value=cvalue))
Hattblock.objects.bulk_create(hattblocks)
OKXECoefficient.objects.bulk_create(coeffs)
class Migration(migrations.Migration):
dependencies = [
('transform', '0001_initial'),
]
operations = [
migrations.RunPython(load)
]
| mit |
tinylabproductions/tlplib | parts/0000-TLPLib/Assets/Vendor/TLPLib/Test/FunTween/TweenCallbackTest.cs | 5472 | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using com.tinylabproductions.TLPLib.Functional;
using tlplib.reactive;
using tlplib.test_framework;
using com.tinylabproductions.TLPLib.Tween.fun_tween;
using NUnit.Framework;
namespace com.tinylabproductions.TLPLib.FunTween {
using ActionsToExecute = ImmutableList<Tpl<float, bool, ICollection<bool>>>;
public class TweenCallbackTest {
const float MIDDLE = 0.5f, END = 1f;
static readonly TweenCallback emptyCallback = new TweenCallback(_ => { });
static ActionsToExecute emptyActions => ActionsToExecute.Empty;
static ImmutableList<float> emptyOtherPoints => ImmutableList<float>.Empty;
static readonly ICollection<bool> eventForwards = ImmutableList.Create(true);
static readonly ICollection<bool> eventBackwards = ImmutableList.Create(false);
static readonly ICollection<bool> noEvent = ImmutableList<bool>.Empty;
static readonly Subject<bool> stateSubject = new Subject<bool>();
static void testSingleCallbackAt(
float insertCallbackAt, ImmutableList<float> otherPoints, ActionsToExecute actions
) {
var tsb = TweenTimeline.Builder.create().insert(
insertCallbackAt,
new TweenCallback(_ => stateSubject.push(_.playingForwards))
);
foreach (var otherPoint in otherPoints) tsb.insert(otherPoint, emptyCallback);
var ts = tsb.build();
var lastInvocation = 0f;
foreach (var action in actions) {
// Expected result correlates to playingForwards
// as we are using playing forwards as the state variable
var (setTimeTo, playingForwards, testResult) = action;
Action execute = () => {
ts.setRelativeTimePassed(lastInvocation, setTimeTo, playingForwards, true, exitTween: true, isReset: false);
lastInvocation = setTimeTo;
};
execute.shouldPushTo(stateSubject).resultIn(testResult);
}
}
[TestFixture]
public class CallbackAtZero {
public void testCallbackAtTheStartZeroDuration(ActionsToExecute testCases) => testSingleCallbackAt(
insertCallbackAt: 0f,
otherPoints: emptyOtherPoints,
actions: testCases
);
public void testCallbackAtTheStartNonZeroDuration(ActionsToExecute testCases) => testSingleCallbackAt(
insertCallbackAt: 0f,
otherPoints: emptyOtherPoints.Add(END),
actions: testCases
);
[Test]
public void zeroDurationMoveToZero() => testCallbackAtTheStartZeroDuration(
emptyActions.Add(F.t(0f, true, eventForwards))
);
[Test]
public void zeroDurationMoveToZeroAndBackToZero() => testCallbackAtTheStartZeroDuration(
emptyActions.Add(F.t(0f, true, eventForwards)).Add(F.t(0f, false, eventBackwards))
);
[Test]
public void nonZeroDurationMoveToEndAndBackToZero() => testCallbackAtTheStartNonZeroDuration(
emptyActions.Add(F.t(END, true, eventForwards)).Add(F.t(0f, false, eventBackwards))
);
[Test]
public void zeroDurationMoveTwiceForward() => testCallbackAtTheStartZeroDuration(
emptyActions.Add(F.t(0f, true, eventForwards)).Add(F.t(0f, true, noEvent))
);
[Test]
public void nonZeroDurationMoveToZeroAndMoveToEnd() => testCallbackAtTheStartNonZeroDuration(
emptyActions.Add(F.t(0f, true, eventForwards)).Add(F.t(END, true, noEvent))
);
}
[TestFixture]
public class CallbackAtEnd {
public void testCallbackAtTheEnd(ActionsToExecute testCases) => testSingleCallbackAt(
insertCallbackAt: END,
otherPoints: emptyOtherPoints,
actions: testCases
);
[Test]
public void moveToEnd() => testCallbackAtTheEnd(
emptyActions.Add(F.t(END, true, eventForwards))
);
[Test]
public void moveToEndAndMoveBack() => testCallbackAtTheEnd(
emptyActions.Add(F.t(END, true, eventForwards)).Add(F.t(0f, false, eventBackwards))
);
[Test]
public void twiceMoveToEnd() => testCallbackAtTheEnd(
emptyActions.Add(F.t(END, true, eventForwards)).Add(F.t(END, true, noEvent))
);
}
[TestFixture]
public class CallbackInTheMiddle {
public void testCallbackAtTheMiddle(ActionsToExecute testCases) => testSingleCallbackAt(
insertCallbackAt: MIDDLE,
otherPoints: emptyOtherPoints.Add(END),
actions: testCases
);
[Test]
public void moveToAndAndMoveToZero() => testCallbackAtTheMiddle(
emptyActions.Add(F.t(END, true, eventForwards)).Add(F.t(0f, false, eventBackwards))
);
[Test]
public void moveToMiddleAndMoveToZero() => testCallbackAtTheMiddle(
emptyActions.Add(F.t(MIDDLE, true, eventForwards)).Add(F.t(0f, false, eventBackwards))
);
[Test]
public void moveToMiddleAndMoveToEnd() => testCallbackAtTheMiddle(
emptyActions.Add(F.t(MIDDLE, true, eventForwards)).Add(F.t(END, true, noEvent))
);
[Test]
public void twiceMoveToMiddle() => testCallbackAtTheMiddle(
emptyActions.Add(F.t(MIDDLE, true, eventForwards)).Add(F.t(MIDDLE, true, noEvent))
);
[Test]
public void moveToMiddleMoveBackByZeroMoveToEnd() => testCallbackAtTheMiddle(
emptyActions
.Add(F.t(MIDDLE, true, eventForwards))
.Add(F.t(0f, false, eventBackwards))
.Add(F.t(END, true, eventForwards))
);
}
}
} | mit |
SolutionheadOpenTech/EF-Split-Projector | Tests/LINQMethods/DefaultIfEmpty_Value.cs | 403 | using System.Linq;
using NUnit.Framework;
namespace Tests.LINQMethods
{
[TestFixture]
public class DefaultIfEmpty_Value : LINQQueryableInventoryMethodTestBase<IntegratedTestsBase.InventorySelect>
{
protected override IQueryable<InventorySelect> GetQuery(IQueryable<InventorySelect> source)
{
return source.DefaultIfEmpty(new InventorySelect());
}
}
} | mit |
ucdavis/Commencement | Commencement.Core/Domain/TemplateToken.cs | 819 | using System.ComponentModel.DataAnnotations;
using FluentNHibernate.Mapping;
using UCDArch.Core.DomainModel;
namespace Commencement.Core.Domain
{
public class TemplateToken : DomainObject
{
[Required]
public virtual TemplateType TemplateType { get; set; }
[Required]
[StringLength(50)]
public virtual string Name { get; set; }
// grabs the name and removes the spaces
public virtual string Token {
get { return "{" + Name.Replace(" ", string.Empty) + "}"; }
}
}
public class TemplateTokenMap : ClassMap<TemplateToken>
{
public TemplateTokenMap()
{
Id(x => x.Id);
Map(x => x.Name);
References(x => x.TemplateType);
}
}
}
| mit |
rjbernaldo/hivemind | server/views/line_graph_view.js | 206 | function LineGraphView(io) {this.io = io;}
LineGraphView.prototype = {
update: function(topHashtagCounts) {
this.io.sockets.emit('new count', topHashtagCounts);
}
}
module.exports = LineGraphView;
| mit |
spurdocoin/spurdocoin | src/rpcwallet.cpp | 53716 | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <boost/assign/list_of.hpp>
#include "wallet.h"
#include "walletdb.h"
#include "bitcoinrpc.h"
#include "init.h"
#include "base58.h"
using namespace std;
using namespace boost;
using namespace boost::assign;
using namespace json_spirit;
int64 nWalletUnlockTime;
static CCriticalSection cs_nWalletUnlockTime;
std::string HelpRequiringPassphrase()
{
return pwalletMain->IsCrypted()
? "\nrequires wallet passphrase to be set with walletpassphrase first"
: "";
}
void EnsureWalletIsUnlocked()
{
if (pwalletMain->IsLocked())
throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first.");
}
void WalletTxToJSON(const CWalletTx& wtx, Object& entry)
{
int confirms = wtx.GetDepthInMainChain();
entry.push_back(Pair("confirmations", confirms));
if (wtx.IsCoinBase())
entry.push_back(Pair("generated", true));
if (confirms)
{
entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex()));
entry.push_back(Pair("blockindex", wtx.nIndex));
entry.push_back(Pair("blocktime", (boost::int64_t)(mapBlockIndex[wtx.hashBlock]->nTime)));
}
entry.push_back(Pair("txid", wtx.GetHash().GetHex()));
entry.push_back(Pair("time", (boost::int64_t)wtx.GetTxTime()));
entry.push_back(Pair("timereceived", (boost::int64_t)wtx.nTimeReceived));
BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue)
entry.push_back(Pair(item.first, item.second));
}
string AccountFromValue(const Value& value)
{
string strAccount = value.get_str();
if (strAccount == "*")
throw JSONRPCError(RPC_WALLET_INVALID_ACCOUNT_NAME, "Invalid account name");
return strAccount;
}
Value getinfo(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getinfo\n"
"Returns an object containing various state info.");
proxyType proxy;
GetProxy(NET_IPV4, proxy);
Object obj;
obj.push_back(Pair("version", (int)CLIENT_VERSION));
obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION));
obj.push_back(Pair("walletversion", pwalletMain->GetVersion()));
obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance())));
obj.push_back(Pair("blocks", (int)nBestHeight));
obj.push_back(Pair("timeoffset", (boost::int64_t)GetTimeOffset()));
obj.push_back(Pair("connections", (int)vNodes.size()));
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
obj.push_back(Pair("testnet", fTestNet));
obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime()));
obj.push_back(Pair("keypoolsize", pwalletMain->GetKeyPoolSize()));
obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee)));
if (pwalletMain->IsCrypted())
obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime / 1000));
obj.push_back(Pair("errors", GetWarnings("statusbar")));
return obj;
}
Value getnewaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"getnewaddress [account]\n"
"Returns a new SpurdoCoin address for receiving payments. "
"If [account] is specified (recommended), it is added to the address book "
"so payments received with the address will be credited to [account].");
// Parse the account first so we don't generate a key if there's an error
string strAccount;
if (params.size() > 0)
strAccount = AccountFromValue(params[0]);
if (!pwalletMain->IsLocked())
pwalletMain->TopUpKeyPool();
// Generate a new key that is added to wallet
CPubKey newKey;
if (!pwalletMain->GetKeyFromPool(newKey, false))
throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
CKeyID keyID = newKey.GetID();
pwalletMain->SetAddressBookName(keyID, strAccount);
return CBitcoinAddress(keyID).ToString();
}
CBitcoinAddress GetAccountAddress(string strAccount, bool bForceNew=false)
{
CWalletDB walletdb(pwalletMain->strWalletFile);
CAccount account;
walletdb.ReadAccount(strAccount, account);
bool bKeyUsed = false;
// Check if the current key has been used
if (account.vchPubKey.IsValid())
{
CScript scriptPubKey;
scriptPubKey.SetDestination(account.vchPubKey.GetID());
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin();
it != pwalletMain->mapWallet.end() && account.vchPubKey.IsValid();
++it)
{
const CWalletTx& wtx = (*it).second;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
if (txout.scriptPubKey == scriptPubKey)
bKeyUsed = true;
}
}
// Generate a new key
if (!account.vchPubKey.IsValid() || bForceNew || bKeyUsed)
{
if (!pwalletMain->GetKeyFromPool(account.vchPubKey, false))
throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
pwalletMain->SetAddressBookName(account.vchPubKey.GetID(), strAccount);
walletdb.WriteAccount(strAccount, account);
}
return CBitcoinAddress(account.vchPubKey.GetID());
}
Value getaccountaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"getaccountaddress <account>\n"
"Returns the current SpurdoCoin address for receiving payments to this account.");
// Parse the account first so we don't generate a key if there's an error
string strAccount = AccountFromValue(params[0]);
Value ret;
ret = GetAccountAddress(strAccount).ToString();
return ret;
}
Value setaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"setaccount <spurdocoinaddress> <account>\n"
"Sets the account associated with the given address.");
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid SpurdoCoin address");
string strAccount;
if (params.size() > 1)
strAccount = AccountFromValue(params[1]);
// Detect when changing the account of an address that is the 'unused current key' of another account:
if (pwalletMain->mapAddressBook.count(address.Get()))
{
string strOldAccount = pwalletMain->mapAddressBook[address.Get()];
if (address == GetAccountAddress(strOldAccount))
GetAccountAddress(strOldAccount, true);
}
pwalletMain->SetAddressBookName(address.Get(), strAccount);
return Value::null;
}
Value getaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"getaccount <spurdocoinaddress>\n"
"Returns the account associated with the given address.");
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid SpurdoCoin address");
string strAccount;
map<CTxDestination, string>::iterator mi = pwalletMain->mapAddressBook.find(address.Get());
if (mi != pwalletMain->mapAddressBook.end() && !(*mi).second.empty())
strAccount = (*mi).second;
return strAccount;
}
Value getaddressesbyaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"getaddressesbyaccount <account>\n"
"Returns the list of addresses for the given account.");
string strAccount = AccountFromValue(params[0]);
// Find all addresses that have the given account
Array ret;
BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& item, pwalletMain->mapAddressBook)
{
const CBitcoinAddress& address = item.first;
const string& strName = item.second;
if (strName == strAccount)
ret.push_back(address.ToString());
}
return ret;
}
Value sendtoaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 4)
throw runtime_error(
"sendtoaddress <spurdocoinaddress> <amount> [comment] [comment-to]\n"
"<amount> is a real and is rounded to the nearest 0.00000001"
+ HelpRequiringPassphrase());
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid SpurdoCoin address");
// Amount
int64 nAmount = AmountFromValue(params[1]);
// Wallet comments
CWalletTx wtx;
if (params.size() > 2 && params[2].type() != null_type && !params[2].get_str().empty())
wtx.mapValue["comment"] = params[2].get_str();
if (params.size() > 3 && params[3].type() != null_type && !params[3].get_str().empty())
wtx.mapValue["to"] = params[3].get_str();
if (pwalletMain->IsLocked())
throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first.");
string strError = pwalletMain->SendMoneyToDestination(address.Get(), nAmount, wtx);
if (strError != "")
throw JSONRPCError(RPC_WALLET_ERROR, strError);
return wtx.GetHash().GetHex();
}
Value listaddressgroupings(const Array& params, bool fHelp)
{
if (fHelp)
throw runtime_error(
"listaddressgroupings\n"
"Lists groups of addresses which have had their common ownership\n"
"made public by common use as inputs or as the resulting change\n"
"in past transactions");
Array jsonGroupings;
map<CTxDestination, int64> balances = pwalletMain->GetAddressBalances();
BOOST_FOREACH(set<CTxDestination> grouping, pwalletMain->GetAddressGroupings())
{
Array jsonGrouping;
BOOST_FOREACH(CTxDestination address, grouping)
{
Array addressInfo;
addressInfo.push_back(CBitcoinAddress(address).ToString());
addressInfo.push_back(ValueFromAmount(balances[address]));
{
LOCK(pwalletMain->cs_wallet);
if (pwalletMain->mapAddressBook.find(CBitcoinAddress(address).Get()) != pwalletMain->mapAddressBook.end())
addressInfo.push_back(pwalletMain->mapAddressBook.find(CBitcoinAddress(address).Get())->second);
}
jsonGrouping.push_back(addressInfo);
}
jsonGroupings.push_back(jsonGrouping);
}
return jsonGroupings;
}
Value signmessage(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 2)
throw runtime_error(
"signmessage <spurdocoinaddress> <message>\n"
"Sign a message with the private key of an address");
EnsureWalletIsUnlocked();
string strAddress = params[0].get_str();
string strMessage = params[1].get_str();
CBitcoinAddress addr(strAddress);
if (!addr.IsValid())
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address");
CKeyID keyID;
if (!addr.GetKeyID(keyID))
throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key");
CKey key;
if (!pwalletMain->GetKey(keyID, key))
throw JSONRPCError(RPC_WALLET_ERROR, "Private key not available");
CHashWriter ss(SER_GETHASH, 0);
ss << strMessageMagic;
ss << strMessage;
vector<unsigned char> vchSig;
if (!key.SignCompact(ss.GetHash(), vchSig))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Sign failed");
return EncodeBase64(&vchSig[0], vchSig.size());
}
Value verifymessage(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 3)
throw runtime_error(
"verifymessage <spurdocoinaddress> <signature> <message>\n"
"Verify a signed message");
string strAddress = params[0].get_str();
string strSign = params[1].get_str();
string strMessage = params[2].get_str();
CBitcoinAddress addr(strAddress);
if (!addr.IsValid())
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address");
CKeyID keyID;
if (!addr.GetKeyID(keyID))
throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key");
bool fInvalid = false;
vector<unsigned char> vchSig = DecodeBase64(strSign.c_str(), &fInvalid);
if (fInvalid)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Malformed base64 encoding");
CHashWriter ss(SER_GETHASH, 0);
ss << strMessageMagic;
ss << strMessage;
CKey key;
if (!key.SetCompactSignature(ss.GetHash(), vchSig))
return false;
return (key.GetPubKey().GetID() == keyID);
}
Value getreceivedbyaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"getreceivedbyaddress <spurdocoinaddress> [minconf=1]\n"
"Returns the total amount received by <spurdocoinaddress> in transactions with at least [minconf] confirmations.");
// Bitcoin address
CBitcoinAddress address = CBitcoinAddress(params[0].get_str());
CScript scriptPubKey;
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid SpurdoCoin address");
scriptPubKey.SetDestination(address.Get());
if (!IsMine(*pwalletMain,scriptPubKey))
return (double)0.0;
// Minimum confirmations
int nMinDepth = 1;
if (params.size() > 1)
nMinDepth = params[1].get_int();
// Tally
int64 nAmount = 0;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (wtx.IsCoinBase() || !wtx.IsFinal())
continue;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
if (txout.scriptPubKey == scriptPubKey)
if (wtx.GetDepthInMainChain() >= nMinDepth)
nAmount += txout.nValue;
}
return ValueFromAmount(nAmount);
}
void GetAccountAddresses(string strAccount, set<CTxDestination>& setAddress)
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination, string)& item, pwalletMain->mapAddressBook)
{
const CTxDestination& address = item.first;
const string& strName = item.second;
if (strName == strAccount)
setAddress.insert(address);
}
}
Value getreceivedbyaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"getreceivedbyaccount <account> [minconf=1]\n"
"Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.");
// Minimum confirmations
int nMinDepth = 1;
if (params.size() > 1)
nMinDepth = params[1].get_int();
// Get the set of pub keys assigned to account
string strAccount = AccountFromValue(params[0]);
set<CTxDestination> setAddress;
GetAccountAddresses(strAccount, setAddress);
// Tally
int64 nAmount = 0;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (wtx.IsCoinBase() || !wtx.IsFinal())
continue;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
CTxDestination address;
if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*pwalletMain, address) && setAddress.count(address))
if (wtx.GetDepthInMainChain() >= nMinDepth)
nAmount += txout.nValue;
}
}
return (double)nAmount / (double)COIN;
}
int64 GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth)
{
int64 nBalance = 0;
// Tally wallet transactions
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (!wtx.IsFinal())
continue;
int64 nReceived, nSent, nFee;
wtx.GetAccountAmounts(strAccount, nReceived, nSent, nFee);
if (nReceived != 0 && wtx.GetDepthInMainChain() >= nMinDepth)
nBalance += nReceived;
nBalance -= nSent + nFee;
}
// Tally internal accounting entries
nBalance += walletdb.GetAccountCreditDebit(strAccount);
return nBalance;
}
int64 GetAccountBalance(const string& strAccount, int nMinDepth)
{
CWalletDB walletdb(pwalletMain->strWalletFile);
return GetAccountBalance(walletdb, strAccount, nMinDepth);
}
Value getbalance(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 2)
throw runtime_error(
"getbalance [account] [minconf=1]\n"
"If [account] is not specified, returns the server's total available balance.\n"
"If [account] is specified, returns the balance in the account.");
if (params.size() == 0)
return ValueFromAmount(pwalletMain->GetBalance());
int nMinDepth = 1;
if (params.size() > 1)
nMinDepth = params[1].get_int();
if (params[0].get_str() == "*") {
// Calculate total balance a different way from GetBalance()
// (GetBalance() sums up all unspent TxOuts)
// getbalance and getbalance '*' 0 should return the same number
int64 nBalance = 0;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (!wtx.IsConfirmed())
continue;
int64 allFee;
string strSentAccount;
list<pair<CTxDestination, int64> > listReceived;
list<pair<CTxDestination, int64> > listSent;
wtx.GetAmounts(listReceived, listSent, allFee, strSentAccount);
if (wtx.GetDepthInMainChain() >= nMinDepth)
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64)& r, listReceived)
nBalance += r.second;
}
BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64)& r, listSent)
nBalance -= r.second;
nBalance -= allFee;
}
return ValueFromAmount(nBalance);
}
string strAccount = AccountFromValue(params[0]);
int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
return ValueFromAmount(nBalance);
}
Value movecmd(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 3 || params.size() > 5)
throw runtime_error(
"move <fromaccount> <toaccount> <amount> [minconf=1] [comment]\n"
"Move from one account in your wallet to another.");
string strFrom = AccountFromValue(params[0]);
string strTo = AccountFromValue(params[1]);
int64 nAmount = AmountFromValue(params[2]);
if (params.size() > 3)
// unused parameter, used to be nMinDepth, keep type-checking it though
(void)params[3].get_int();
string strComment;
if (params.size() > 4)
strComment = params[4].get_str();
CWalletDB walletdb(pwalletMain->strWalletFile);
if (!walletdb.TxnBegin())
throw JSONRPCError(RPC_DATABASE_ERROR, "database error");
int64 nNow = GetAdjustedTime();
// Debit
CAccountingEntry debit;
debit.nOrderPos = pwalletMain->IncOrderPosNext(&walletdb);
debit.strAccount = strFrom;
debit.nCreditDebit = -nAmount;
debit.nTime = nNow;
debit.strOtherAccount = strTo;
debit.strComment = strComment;
walletdb.WriteAccountingEntry(debit);
// Credit
CAccountingEntry credit;
credit.nOrderPos = pwalletMain->IncOrderPosNext(&walletdb);
credit.strAccount = strTo;
credit.nCreditDebit = nAmount;
credit.nTime = nNow;
credit.strOtherAccount = strFrom;
credit.strComment = strComment;
walletdb.WriteAccountingEntry(credit);
if (!walletdb.TxnCommit())
throw JSONRPCError(RPC_DATABASE_ERROR, "database error");
return true;
}
Value sendfrom(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 3 || params.size() > 6)
throw runtime_error(
"sendfrom <fromaccount> <tospurdocoinaddress> <amount> [minconf=1] [comment] [comment-to]\n"
"<amount> is a real and is rounded to the nearest 0.00000001"
+ HelpRequiringPassphrase());
string strAccount = AccountFromValue(params[0]);
CBitcoinAddress address(params[1].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid SpurdoCoin address");
int64 nAmount = AmountFromValue(params[2]);
int nMinDepth = 1;
if (params.size() > 3)
nMinDepth = params[3].get_int();
CWalletTx wtx;
wtx.strFromAccount = strAccount;
if (params.size() > 4 && params[4].type() != null_type && !params[4].get_str().empty())
wtx.mapValue["comment"] = params[4].get_str();
if (params.size() > 5 && params[5].type() != null_type && !params[5].get_str().empty())
wtx.mapValue["to"] = params[5].get_str();
EnsureWalletIsUnlocked();
// Check funds
int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
if (nAmount > nBalance)
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds");
// Send
string strError = pwalletMain->SendMoneyToDestination(address.Get(), nAmount, wtx);
if (strError != "")
throw JSONRPCError(RPC_WALLET_ERROR, strError);
return wtx.GetHash().GetHex();
}
Value sendmany(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 4)
throw runtime_error(
"sendmany <fromaccount> {address:amount,...} [minconf=1] [comment]\n"
"amounts are double-precision floating point numbers"
+ HelpRequiringPassphrase());
string strAccount = AccountFromValue(params[0]);
Object sendTo = params[1].get_obj();
int nMinDepth = 1;
if (params.size() > 2)
nMinDepth = params[2].get_int();
CWalletTx wtx;
wtx.strFromAccount = strAccount;
if (params.size() > 3 && params[3].type() != null_type && !params[3].get_str().empty())
wtx.mapValue["comment"] = params[3].get_str();
set<CBitcoinAddress> setAddress;
vector<pair<CScript, int64> > vecSend;
int64 totalAmount = 0;
BOOST_FOREACH(const Pair& s, sendTo)
{
CBitcoinAddress address(s.name_);
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid SpurdoCoin address: ")+s.name_);
if (setAddress.count(address))
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_);
setAddress.insert(address);
CScript scriptPubKey;
scriptPubKey.SetDestination(address.Get());
int64 nAmount = AmountFromValue(s.value_);
totalAmount += nAmount;
vecSend.push_back(make_pair(scriptPubKey, nAmount));
}
EnsureWalletIsUnlocked();
// Check funds
int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
if (totalAmount > nBalance)
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds");
// Send
CReserveKey keyChange(pwalletMain);
int64 nFeeRequired = 0;
string strFailReason;
bool fCreated = pwalletMain->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired, strFailReason);
if (!fCreated)
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, strFailReason);
if (!pwalletMain->CommitTransaction(wtx, keyChange))
throw JSONRPCError(RPC_WALLET_ERROR, "Transaction commit failed");
return wtx.GetHash().GetHex();
}
//
// Used by addmultisigaddress / createmultisig:
//
static CScript _createmultisig(const Array& params)
{
int nRequired = params[0].get_int();
const Array& keys = params[1].get_array();
// Gather public keys
if (nRequired < 1)
throw runtime_error("a multisignature address must require at least one key to redeem");
if ((int)keys.size() < nRequired)
throw runtime_error(
strprintf("not enough keys supplied "
"(got %"PRIszu" keys, but need at least %d to redeem)", keys.size(), nRequired));
std::vector<CKey> pubkeys;
pubkeys.resize(keys.size());
for (unsigned int i = 0; i < keys.size(); i++)
{
const std::string& ks = keys[i].get_str();
// Case 1: Bitcoin address and we have full public key:
CBitcoinAddress address(ks);
if (address.IsValid())
{
CKeyID keyID;
if (!address.GetKeyID(keyID))
throw runtime_error(
strprintf("%s does not refer to a key",ks.c_str()));
CPubKey vchPubKey;
if (!pwalletMain->GetPubKey(keyID, vchPubKey))
throw runtime_error(
strprintf("no full public key for address %s",ks.c_str()));
if (!vchPubKey.IsValid() || !pubkeys[i].SetPubKey(vchPubKey))
throw runtime_error(" Invalid public key: "+ks);
}
// Case 2: hex public key
else if (IsHex(ks))
{
CPubKey vchPubKey(ParseHex(ks));
if (!vchPubKey.IsValid() || !pubkeys[i].SetPubKey(vchPubKey))
throw runtime_error(" Invalid public key: "+ks);
}
else
{
throw runtime_error(" Invalid public key: "+ks);
}
}
CScript result;
result.SetMultisig(nRequired, pubkeys);
return result;
}
Value addmultisigaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 3)
{
string msg = "addmultisigaddress <nrequired> <'[\"key\",\"key\"]'> [account]\n"
"Add a nrequired-to-sign multisignature address to the wallet\"\n"
"each key is a SpurdoCoin address or hex-encoded public key\n"
"If [account] is specified, assign address to [account].";
throw runtime_error(msg);
}
string strAccount;
if (params.size() > 2)
strAccount = AccountFromValue(params[2]);
// Construct using pay-to-script-hash:
CScript inner = _createmultisig(params);
CScriptID innerID = inner.GetID();
pwalletMain->AddCScript(inner);
pwalletMain->SetAddressBookName(innerID, strAccount);
return CBitcoinAddress(innerID).ToString();
}
Value createmultisig(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 2)
{
string msg = "createmultisig <nrequired> <'[\"key\",\"key\"]'>\n"
"Creates a multi-signature address and returns a json object\n"
"with keys:\n"
"address : spurdocoin address\n"
"redeemScript : hex-encoded redemption script";
throw runtime_error(msg);
}
// Construct using pay-to-script-hash:
CScript inner = _createmultisig(params);
CScriptID innerID = inner.GetID();
CBitcoinAddress address(innerID);
Object result;
result.push_back(Pair("address", address.ToString()));
result.push_back(Pair("redeemScript", HexStr(inner.begin(), inner.end())));
return result;
}
struct tallyitem
{
int64 nAmount;
int nConf;
tallyitem()
{
nAmount = 0;
nConf = std::numeric_limits<int>::max();
}
};
Value ListReceived(const Array& params, bool fByAccounts)
{
// Minimum confirmations
int nMinDepth = 1;
if (params.size() > 0)
nMinDepth = params[0].get_int();
// Whether to include empty accounts
bool fIncludeEmpty = false;
if (params.size() > 1)
fIncludeEmpty = params[1].get_bool();
// Tally
map<CBitcoinAddress, tallyitem> mapTally;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (wtx.IsCoinBase() || !wtx.IsFinal())
continue;
int nDepth = wtx.GetDepthInMainChain();
if (nDepth < nMinDepth)
continue;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
CTxDestination address;
if (!ExtractDestination(txout.scriptPubKey, address) || !IsMine(*pwalletMain, address))
continue;
tallyitem& item = mapTally[address];
item.nAmount += txout.nValue;
item.nConf = min(item.nConf, nDepth);
}
}
// Reply
Array ret;
map<string, tallyitem> mapAccountTally;
BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& item, pwalletMain->mapAddressBook)
{
const CBitcoinAddress& address = item.first;
const string& strAccount = item.second;
map<CBitcoinAddress, tallyitem>::iterator it = mapTally.find(address);
if (it == mapTally.end() && !fIncludeEmpty)
continue;
int64 nAmount = 0;
int nConf = std::numeric_limits<int>::max();
if (it != mapTally.end())
{
nAmount = (*it).second.nAmount;
nConf = (*it).second.nConf;
}
if (fByAccounts)
{
tallyitem& item = mapAccountTally[strAccount];
item.nAmount += nAmount;
item.nConf = min(item.nConf, nConf);
}
else
{
Object obj;
obj.push_back(Pair("address", address.ToString()));
obj.push_back(Pair("account", strAccount));
obj.push_back(Pair("amount", ValueFromAmount(nAmount)));
obj.push_back(Pair("confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));
ret.push_back(obj);
}
}
if (fByAccounts)
{
for (map<string, tallyitem>::iterator it = mapAccountTally.begin(); it != mapAccountTally.end(); ++it)
{
int64 nAmount = (*it).second.nAmount;
int nConf = (*it).second.nConf;
Object obj;
obj.push_back(Pair("account", (*it).first));
obj.push_back(Pair("amount", ValueFromAmount(nAmount)));
obj.push_back(Pair("confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));
ret.push_back(obj);
}
}
return ret;
}
Value listreceivedbyaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 2)
throw runtime_error(
"listreceivedbyaddress [minconf=1] [includeempty=false]\n"
"[minconf] is the minimum number of confirmations before payments are included.\n"
"[includeempty] whether to include addresses that haven't received any payments.\n"
"Returns an array of objects containing:\n"
" \"address\" : receiving address\n"
" \"account\" : the account of the receiving address\n"
" \"amount\" : total amount received by the address\n"
" \"confirmations\" : number of confirmations of the most recent transaction included");
return ListReceived(params, false);
}
Value listreceivedbyaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 2)
throw runtime_error(
"listreceivedbyaccount [minconf=1] [includeempty=false]\n"
"[minconf] is the minimum number of confirmations before payments are included.\n"
"[includeempty] whether to include accounts that haven't received any payments.\n"
"Returns an array of objects containing:\n"
" \"account\" : the account of the receiving addresses\n"
" \"amount\" : total amount received by addresses with this account\n"
" \"confirmations\" : number of confirmations of the most recent transaction included");
return ListReceived(params, true);
}
void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDepth, bool fLong, Array& ret)
{
int64 nFee;
string strSentAccount;
list<pair<CTxDestination, int64> > listReceived;
list<pair<CTxDestination, int64> > listSent;
wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount);
bool fAllAccounts = (strAccount == string("*"));
// Sent
if ((!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount))
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64)& s, listSent)
{
Object entry;
entry.push_back(Pair("account", strSentAccount));
entry.push_back(Pair("address", CBitcoinAddress(s.first).ToString()));
entry.push_back(Pair("category", "send"));
entry.push_back(Pair("amount", ValueFromAmount(-s.second)));
entry.push_back(Pair("fee", ValueFromAmount(-nFee)));
if (fLong)
WalletTxToJSON(wtx, entry);
ret.push_back(entry);
}
}
// Received
if (listReceived.size() > 0 && wtx.GetDepthInMainChain() >= nMinDepth)
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64)& r, listReceived)
{
string account;
if (pwalletMain->mapAddressBook.count(r.first))
account = pwalletMain->mapAddressBook[r.first];
if (fAllAccounts || (account == strAccount))
{
Object entry;
entry.push_back(Pair("account", account));
entry.push_back(Pair("address", CBitcoinAddress(r.first).ToString()));
if (wtx.IsCoinBase())
{
if (wtx.GetDepthInMainChain() < 1)
entry.push_back(Pair("category", "orphan"));
else if (wtx.GetBlocksToMaturity() > 0)
entry.push_back(Pair("category", "immature"));
else
entry.push_back(Pair("category", "generate"));
}
else
entry.push_back(Pair("category", "receive"));
entry.push_back(Pair("amount", ValueFromAmount(r.second)));
if (fLong)
WalletTxToJSON(wtx, entry);
ret.push_back(entry);
}
}
}
}
void AcentryToJSON(const CAccountingEntry& acentry, const string& strAccount, Array& ret)
{
bool fAllAccounts = (strAccount == string("*"));
if (fAllAccounts || acentry.strAccount == strAccount)
{
Object entry;
entry.push_back(Pair("account", acentry.strAccount));
entry.push_back(Pair("category", "move"));
entry.push_back(Pair("time", (boost::int64_t)acentry.nTime));
entry.push_back(Pair("amount", ValueFromAmount(acentry.nCreditDebit)));
entry.push_back(Pair("otheraccount", acentry.strOtherAccount));
entry.push_back(Pair("comment", acentry.strComment));
ret.push_back(entry);
}
}
Value listtransactions(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 3)
throw runtime_error(
"listtransactions [account] [count=10] [from=0]\n"
"Returns up to [count] most recent transactions skipping the first [from] transactions for account [account].");
string strAccount = "*";
if (params.size() > 0)
strAccount = params[0].get_str();
int nCount = 10;
if (params.size() > 1)
nCount = params[1].get_int();
int nFrom = 0;
if (params.size() > 2)
nFrom = params[2].get_int();
if (nCount < 0)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative count");
if (nFrom < 0)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative from");
Array ret;
std::list<CAccountingEntry> acentries;
CWallet::TxItems txOrdered = pwalletMain->OrderedTxItems(acentries, strAccount);
// iterate backwards until we have nCount items to return:
for (CWallet::TxItems::reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it)
{
CWalletTx *const pwtx = (*it).second.first;
if (pwtx != 0)
ListTransactions(*pwtx, strAccount, 0, true, ret);
CAccountingEntry *const pacentry = (*it).second.second;
if (pacentry != 0)
AcentryToJSON(*pacentry, strAccount, ret);
if ((int)ret.size() >= (nCount+nFrom)) break;
}
// ret is newest to oldest
if (nFrom > (int)ret.size())
nFrom = ret.size();
if ((nFrom + nCount) > (int)ret.size())
nCount = ret.size() - nFrom;
Array::iterator first = ret.begin();
std::advance(first, nFrom);
Array::iterator last = ret.begin();
std::advance(last, nFrom+nCount);
if (last != ret.end()) ret.erase(last, ret.end());
if (first != ret.begin()) ret.erase(ret.begin(), first);
std::reverse(ret.begin(), ret.end()); // Return oldest to newest
return ret;
}
Value listaccounts(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"listaccounts [minconf=1]\n"
"Returns Object that has account names as keys, account balances as values.");
int nMinDepth = 1;
if (params.size() > 0)
nMinDepth = params[0].get_int();
map<string, int64> mapAccountBalances;
BOOST_FOREACH(const PAIRTYPE(CTxDestination, string)& entry, pwalletMain->mapAddressBook) {
if (IsMine(*pwalletMain, entry.first)) // This address belongs to me
mapAccountBalances[entry.second] = 0;
}
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
int64 nFee;
string strSentAccount;
list<pair<CTxDestination, int64> > listReceived;
list<pair<CTxDestination, int64> > listSent;
wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount);
mapAccountBalances[strSentAccount] -= nFee;
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64)& s, listSent)
mapAccountBalances[strSentAccount] -= s.second;
if (wtx.GetDepthInMainChain() >= nMinDepth)
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64)& r, listReceived)
if (pwalletMain->mapAddressBook.count(r.first))
mapAccountBalances[pwalletMain->mapAddressBook[r.first]] += r.second;
else
mapAccountBalances[""] += r.second;
}
}
list<CAccountingEntry> acentries;
CWalletDB(pwalletMain->strWalletFile).ListAccountCreditDebit("*", acentries);
BOOST_FOREACH(const CAccountingEntry& entry, acentries)
mapAccountBalances[entry.strAccount] += entry.nCreditDebit;
Object ret;
BOOST_FOREACH(const PAIRTYPE(string, int64)& accountBalance, mapAccountBalances) {
ret.push_back(Pair(accountBalance.first, ValueFromAmount(accountBalance.second)));
}
return ret;
}
Value listsinceblock(const Array& params, bool fHelp)
{
if (fHelp)
throw runtime_error(
"listsinceblock [blockhash] [target-confirmations]\n"
"Get all transactions in blocks since block [blockhash], or all transactions if omitted");
CBlockIndex *pindex = NULL;
int target_confirms = 1;
if (params.size() > 0)
{
uint256 blockId = 0;
blockId.SetHex(params[0].get_str());
pindex = CBlockLocator(blockId).GetBlockIndex();
}
if (params.size() > 1)
{
target_confirms = params[1].get_int();
if (target_confirms < 1)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter");
}
int depth = pindex ? (1 + nBestHeight - pindex->nHeight) : -1;
Array transactions;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); it++)
{
CWalletTx tx = (*it).second;
if (depth == -1 || tx.GetDepthInMainChain() < depth)
ListTransactions(tx, "*", 0, true, transactions);
}
uint256 lastblock;
if (target_confirms == 1)
{
lastblock = hashBestChain;
}
else
{
int target_height = pindexBest->nHeight + 1 - target_confirms;
CBlockIndex *block;
for (block = pindexBest;
block && block->nHeight > target_height;
block = block->pprev) { }
lastblock = block ? block->GetBlockHash() : 0;
}
Object ret;
ret.push_back(Pair("transactions", transactions));
ret.push_back(Pair("lastblock", lastblock.GetHex()));
return ret;
}
Value gettransaction(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"gettransaction <txid>\n"
"Get detailed information about in-wallet transaction <txid>");
uint256 hash;
hash.SetHex(params[0].get_str());
Object entry;
if (!pwalletMain->mapWallet.count(hash))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid or non-wallet transaction id");
const CWalletTx& wtx = pwalletMain->mapWallet[hash];
int64 nCredit = wtx.GetCredit();
int64 nDebit = wtx.GetDebit();
int64 nNet = nCredit - nDebit;
int64 nFee = (wtx.IsFromMe() ? wtx.GetValueOut() - nDebit : 0);
entry.push_back(Pair("amount", ValueFromAmount(nNet - nFee)));
if (wtx.IsFromMe())
entry.push_back(Pair("fee", ValueFromAmount(nFee)));
WalletTxToJSON(wtx, entry);
Array details;
ListTransactions(wtx, "*", 0, false, details);
entry.push_back(Pair("details", details));
return entry;
}
Value backupwallet(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"backupwallet <destination>\n"
"Safely copies wallet.dat to destination, which can be a directory or a path with filename.");
string strDest = params[0].get_str();
if (!BackupWallet(*pwalletMain, strDest))
throw JSONRPCError(RPC_WALLET_ERROR, "Error: Wallet backup failed!");
return Value::null;
}
Value keypoolrefill(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 0)
throw runtime_error(
"keypoolrefill\n"
"Fills the keypool."
+ HelpRequiringPassphrase());
EnsureWalletIsUnlocked();
pwalletMain->TopUpKeyPool();
if (pwalletMain->GetKeyPoolSize() < GetArg("-keypool", 100))
throw JSONRPCError(RPC_WALLET_ERROR, "Error refreshing keypool.");
return Value::null;
}
void ThreadTopUpKeyPool(void* parg)
{
// Make this thread recognisable as the key-topping-up thread
RenameThread("bitcoin-key-top");
pwalletMain->TopUpKeyPool();
}
void ThreadCleanWalletPassphrase(void* parg)
{
// Make this thread recognisable as the wallet relocking thread
RenameThread("bitcoin-lock-wa");
int64 nMyWakeTime = GetTimeMillis() + *((int64*)parg) * 1000;
ENTER_CRITICAL_SECTION(cs_nWalletUnlockTime);
if (nWalletUnlockTime == 0)
{
nWalletUnlockTime = nMyWakeTime;
do
{
if (nWalletUnlockTime==0)
break;
int64 nToSleep = nWalletUnlockTime - GetTimeMillis();
if (nToSleep <= 0)
break;
LEAVE_CRITICAL_SECTION(cs_nWalletUnlockTime);
MilliSleep(nToSleep);
ENTER_CRITICAL_SECTION(cs_nWalletUnlockTime);
} while(1);
if (nWalletUnlockTime)
{
nWalletUnlockTime = 0;
pwalletMain->Lock();
}
}
else
{
if (nWalletUnlockTime < nMyWakeTime)
nWalletUnlockTime = nMyWakeTime;
}
LEAVE_CRITICAL_SECTION(cs_nWalletUnlockTime);
delete (int64*)parg;
}
Value walletpassphrase(const Array& params, bool fHelp)
{
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2))
throw runtime_error(
"walletpassphrase <passphrase> <timeout>\n"
"Stores the wallet decryption key in memory for <timeout> seconds.");
if (fHelp)
return true;
if (!pwalletMain->IsCrypted())
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletpassphrase was called.");
if (!pwalletMain->IsLocked())
throw JSONRPCError(RPC_WALLET_ALREADY_UNLOCKED, "Error: Wallet is already unlocked.");
// Note that the walletpassphrase is stored in params[0] which is not mlock()ed
SecureString strWalletPass;
strWalletPass.reserve(100);
// TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)
// Alternately, find a way to make params[0] mlock()'d to begin with.
strWalletPass = params[0].get_str().c_str();
if (strWalletPass.length() > 0)
{
if (!pwalletMain->Unlock(strWalletPass))
throw JSONRPCError(RPC_WALLET_PASSPHRASE_INCORRECT, "Error: The wallet passphrase entered was incorrect.");
}
else
throw runtime_error(
"walletpassphrase <passphrase> <timeout>\n"
"Stores the wallet decryption key in memory for <timeout> seconds.");
NewThread(ThreadTopUpKeyPool, NULL);
int64* pnSleepTime = new int64(params[1].get_int64());
NewThread(ThreadCleanWalletPassphrase, pnSleepTime);
return Value::null;
}
Value walletpassphrasechange(const Array& params, bool fHelp)
{
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2))
throw runtime_error(
"walletpassphrasechange <oldpassphrase> <newpassphrase>\n"
"Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.");
if (fHelp)
return true;
if (!pwalletMain->IsCrypted())
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletpassphrasechange was called.");
// TODO: get rid of these .c_str() calls by implementing SecureString::operator=(std::string)
// Alternately, find a way to make params[0] mlock()'d to begin with.
SecureString strOldWalletPass;
strOldWalletPass.reserve(100);
strOldWalletPass = params[0].get_str().c_str();
SecureString strNewWalletPass;
strNewWalletPass.reserve(100);
strNewWalletPass = params[1].get_str().c_str();
if (strOldWalletPass.length() < 1 || strNewWalletPass.length() < 1)
throw runtime_error(
"walletpassphrasechange <oldpassphrase> <newpassphrase>\n"
"Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.");
if (!pwalletMain->ChangeWalletPassphrase(strOldWalletPass, strNewWalletPass))
throw JSONRPCError(RPC_WALLET_PASSPHRASE_INCORRECT, "Error: The wallet passphrase entered was incorrect.");
return Value::null;
}
Value walletlock(const Array& params, bool fHelp)
{
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 0))
throw runtime_error(
"walletlock\n"
"Removes the wallet encryption key from memory, locking the wallet.\n"
"After calling this method, you will need to call walletpassphrase again\n"
"before being able to call any methods which require the wallet to be unlocked.");
if (fHelp)
return true;
if (!pwalletMain->IsCrypted())
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletlock was called.");
{
LOCK(cs_nWalletUnlockTime);
pwalletMain->Lock();
nWalletUnlockTime = 0;
}
return Value::null;
}
Value encryptwallet(const Array& params, bool fHelp)
{
if (!pwalletMain->IsCrypted() && (fHelp || params.size() != 1))
throw runtime_error(
"encryptwallet <passphrase>\n"
"Encrypts the wallet with <passphrase>.");
if (fHelp)
return true;
if (pwalletMain->IsCrypted())
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an encrypted wallet, but encryptwallet was called.");
// TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)
// Alternately, find a way to make params[0] mlock()'d to begin with.
SecureString strWalletPass;
strWalletPass.reserve(100);
strWalletPass = params[0].get_str().c_str();
if (strWalletPass.length() < 1)
throw runtime_error(
"encryptwallet <passphrase>\n"
"Encrypts the wallet with <passphrase>.");
if (!pwalletMain->EncryptWallet(strWalletPass))
throw JSONRPCError(RPC_WALLET_ENCRYPTION_FAILED, "Error: Failed to encrypt the wallet.");
// BDB seems to have a bad habit of writing old data into
// slack space in .dat files; that is bad if the old data is
// unencrypted private keys. So:
StartShutdown();
return "wallet encrypted; SpurdoCoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.";
}
class DescribeAddressVisitor : public boost::static_visitor<Object>
{
public:
Object operator()(const CNoDestination &dest) const { return Object(); }
Object operator()(const CKeyID &keyID) const {
Object obj;
CPubKey vchPubKey;
pwalletMain->GetPubKey(keyID, vchPubKey);
obj.push_back(Pair("isscript", false));
obj.push_back(Pair("pubkey", HexStr(vchPubKey.Raw())));
obj.push_back(Pair("iscompressed", vchPubKey.IsCompressed()));
return obj;
}
Object operator()(const CScriptID &scriptID) const {
Object obj;
obj.push_back(Pair("isscript", true));
CScript subscript;
pwalletMain->GetCScript(scriptID, subscript);
std::vector<CTxDestination> addresses;
txnouttype whichType;
int nRequired;
ExtractDestinations(subscript, whichType, addresses, nRequired);
obj.push_back(Pair("script", GetTxnOutputType(whichType)));
Array a;
BOOST_FOREACH(const CTxDestination& addr, addresses)
a.push_back(CBitcoinAddress(addr).ToString());
obj.push_back(Pair("addresses", a));
if (whichType == TX_MULTISIG)
obj.push_back(Pair("sigsrequired", nRequired));
return obj;
}
};
Value validateaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"validateaddress <spurdocoinaddress>\n"
"Return information about <spurdocoinaddress>.");
CBitcoinAddress address(params[0].get_str());
bool isValid = address.IsValid();
Object ret;
ret.push_back(Pair("isvalid", isValid));
if (isValid)
{
CTxDestination dest = address.Get();
string currentAddress = address.ToString();
ret.push_back(Pair("address", currentAddress));
bool fMine = IsMine(*pwalletMain, dest);
ret.push_back(Pair("ismine", fMine));
if (fMine) {
Object detail = boost::apply_visitor(DescribeAddressVisitor(), dest);
ret.insert(ret.end(), detail.begin(), detail.end());
}
if (pwalletMain->mapAddressBook.count(dest))
ret.push_back(Pair("account", pwalletMain->mapAddressBook[dest]));
}
return ret;
}
Value lockunspent(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"lockunspent unlock? [array-of-Objects]\n"
"Updates list of temporarily unspendable outputs.");
if (params.size() == 1)
RPCTypeCheck(params, list_of(bool_type));
else
RPCTypeCheck(params, list_of(bool_type)(array_type));
bool fUnlock = params[0].get_bool();
if (params.size() == 1) {
if (fUnlock)
pwalletMain->UnlockAllCoins();
return true;
}
Array outputs = params[1].get_array();
BOOST_FOREACH(Value& output, outputs)
{
if (output.type() != obj_type)
throw JSONRPCError(-8, "Invalid parameter, expected object");
const Object& o = output.get_obj();
RPCTypeCheck(o, map_list_of("txid", str_type)("vout", int_type));
string txid = find_value(o, "txid").get_str();
if (!IsHex(txid))
throw JSONRPCError(-8, "Invalid parameter, expected hex txid");
int nOutput = find_value(o, "vout").get_int();
if (nOutput < 0)
throw JSONRPCError(-8, "Invalid parameter, vout must be positive");
COutPoint outpt(uint256(txid), nOutput);
if (fUnlock)
pwalletMain->UnlockCoin(outpt);
else
pwalletMain->LockCoin(outpt);
}
return true;
}
Value listlockunspent(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 0)
throw runtime_error(
"listlockunspent\n"
"Returns list of temporarily unspendable outputs.");
vector<COutPoint> vOutpts;
pwalletMain->ListLockedCoins(vOutpts);
Array ret;
BOOST_FOREACH(COutPoint &outpt, vOutpts) {
Object o;
o.push_back(Pair("txid", outpt.hash.GetHex()));
o.push_back(Pair("vout", (int)outpt.n));
ret.push_back(o);
}
return ret;
}
| mit |
anudeepsharma/azure-sdk-for-java | azure-mgmt-servicebus/src/main/java/com/microsoft/azure/management/servicebus/implementation/TopicAuthorizationRulesImpl.java | 5193 | /**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.management.servicebus.implementation;
import com.microsoft.azure.Page;
import com.microsoft.azure.PagedList;
import com.microsoft.azure.management.resources.fluentcore.arm.Region;
import com.microsoft.azure.management.servicebus.Topic;
import com.microsoft.azure.management.servicebus.TopicAuthorizationRule;
import com.microsoft.azure.management.servicebus.TopicAuthorizationRules;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.ServiceResponse;
import rx.Completable;
import rx.Observable;
/**
* Implementation for TopicAuthorizationRules.
*/
class TopicAuthorizationRulesImpl
extends ServiceBusChildResourcesImpl<
TopicAuthorizationRule,
TopicAuthorizationRuleImpl,
SharedAccessAuthorizationRuleInner,
TopicsInner,
ServiceBusManager,
Topic>
implements TopicAuthorizationRules {
private final String resourceGroupName;
private final String namespaceName;
private final String topicName;
private final Region region;
TopicAuthorizationRulesImpl(String resourceGroupName,
String namespaceName,
String topicName,
Region region,
ServiceBusManager manager) {
super(manager.inner().topics(), manager);
this.resourceGroupName = resourceGroupName;
this.namespaceName = namespaceName;
this.topicName = topicName;
this.region = region;
}
@Override
public TopicAuthorizationRuleImpl define(String name) {
return wrapModel(name);
}
@Override
public Completable deleteByNameAsync(String name) {
return this.inner().deleteAuthorizationRuleAsync(this.resourceGroupName,
this.namespaceName,
this.topicName,
name).toCompletable();
}
@Override
public ServiceFuture<Void> deleteByNameAsync(String name, ServiceCallback<Void> callback) {
return this.inner().deleteAuthorizationRuleAsync(this.resourceGroupName,
this.namespaceName,
this.topicName,
name,
callback);
}
@Override
protected Observable<SharedAccessAuthorizationRuleInner> getInnerByNameAsync(String name) {
return this.inner().getAuthorizationRuleAsync(this.resourceGroupName,
this.namespaceName,
this.topicName,
name);
}
@Override
protected Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>> listInnerAsync() {
return this.inner().listAuthorizationRulesWithServiceResponseAsync(this.resourceGroupName,
this.namespaceName,
this.topicName);
}
@Override
protected PagedList<SharedAccessAuthorizationRuleInner> listInner() {
return this.inner().listAuthorizationRules(this.resourceGroupName,
this.namespaceName,
this.topicName);
}
@Override
protected TopicAuthorizationRuleImpl wrapModel(String name) {
return new TopicAuthorizationRuleImpl(this.resourceGroupName,
this.namespaceName,
this.topicName,
name,
this.region,
new SharedAccessAuthorizationRuleInner(),
this.manager());
}
@Override
protected TopicAuthorizationRuleImpl wrapModel(SharedAccessAuthorizationRuleInner inner) {
return new TopicAuthorizationRuleImpl(this.resourceGroupName,
this.namespaceName,
this.topicName,
inner.name(),
this.region,
inner,
this.manager());
}
@Override
public PagedList<TopicAuthorizationRule> listByParent(String resourceGroupName, String parentName) {
// 'IndependentChildResourcesImpl' will be refactoring to remove all 'ByParent' methods
// This method is not exposed to end user from any of the derived types of IndependentChildResourcesImpl
//
throw new UnsupportedOperationException();
}
@Override
public Completable deleteByParentAsync(String groupName, String parentName, String name) {
// 'IndependentChildResourcesImpl' will be refactoring to remove all 'ByParent' methods
// This method is not exposed to end user from any of the derived types of IndependentChildResourcesImpl
//
throw new UnsupportedOperationException();
}
@Override
public Observable<TopicAuthorizationRule> getByParentAsync(String resourceGroup, String parentName, String name) {
// 'IndependentChildResourcesImpl' will be refactoring to remove all 'ByParent' methods
// This method is not exposed to end user from any of the derived types of IndependentChildResourcesImpl
//
throw new UnsupportedOperationException();
}
} | mit |
awto/effectfuljs | packages/core/test/samples/break-stmt/test2-out-ft.js | 299 | import * as M from "@effectful/core";
// *- when it is the last statement
(function () {
var ctx = M.context();
return M.scope(f_1);
});
function f_1(ctx) {
return M.chain(eff(2), f_2);
}
function f_2(ctx, a) {
if (a) {} else {
return M.chain(eff(3), f_3);
}
}
function f_3(ctx) {} | mit |
Iluvatar82/helix-toolkit | Source/HelixToolkit.SharpDX.Shared/Core/Lights/LightCoreBase.cs | 3943 | /*
The MIT License (MIT)
Copyright (c) 2018 Helix Toolkit contributors
*/
using SharpDX;
using SharpDX.Direct3D11;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
#if !NETFX_CORE
namespace HelixToolkit.Wpf.SharpDX.Core
#else
namespace HelixToolkit.UWP.Core
#endif
{
using Model;
using Render;
using System.Linq;
/// <summary>
///
/// </summary>
public abstract class LightCoreBase : RenderCore, ILight3D
{
/// <summary>
/// Gets a value indicating whether this instance is empty.
/// </summary>
/// <value>
/// <c>true</c> if this instance is empty; otherwise, <c>false</c>.
/// </value>
public bool IsEmpty { get; } = false;
/// <summary>
/// Gets or sets the type of the light.
/// </summary>
/// <value>
/// The type of the light.
/// </value>
public LightType LightType { protected set; get; }
private Color4 color = new Color4(0.2f, 0.2f, 0.2f, 1.0f);
/// <summary>
/// Gets or sets the color.
/// </summary>
/// <value>
/// The color.
/// </value>
public Color4 Color
{
set { SetAffectsRender(ref color, value); }
get { return color; }
}
protected LightCoreBase() : base(RenderType.Light) { }
protected override bool OnAttach(IRenderTechnique technique)
{
return true;
}
/// <summary>
/// Renders the specified context.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="deviceContext">The device context.</param>
public override void Render(RenderContext context, DeviceContextProxy deviceContext)
{
if (CanRender(context.LightScene))
{
OnRender(context.LightScene, context.LightScene.LightModels.LightCount);
switch (LightType)
{
case LightType.Ambient:
break;
default:
context.LightScene.LightModels.IncrementLightCount();
break;
}
}
}
/// <summary>
/// Determines whether this instance can render the specified light scene.
/// </summary>
/// <param name="lightScene">The light scene.</param>
/// <returns>
/// <c>true</c> if this instance can render the specified light scene; otherwise, <c>false</c>.
/// </returns>
protected virtual bool CanRender(Light3DSceneShared lightScene)
{
return IsAttached && lightScene.LightModels.LightCount < Constants.MaxLights;
}
/// <summary>
/// Called when [render].
/// </summary>
/// <param name="lightScene">The light scene.</param>
/// <param name="idx">The index.</param>
protected virtual void OnRender(Light3DSceneShared lightScene, int idx)
{
lightScene.LightModels.Lights[idx].LightColor = Color;
lightScene.LightModels.Lights[idx].LightType = (int)LightType;
}
}
/// <summary>
///
/// </summary>
public class AmbientLightCore : LightCoreBase
{
/// <summary>
/// Initializes a new instance of the <see cref="AmbientLightCore"/> class.
/// </summary>
public AmbientLightCore()
{
LightType = LightType.Ambient;
}
/// <summary>
/// Called when [render].
/// </summary>
/// <param name="lightScene">The light scene.</param>
/// <param name="idx">The index.</param>
protected override void OnRender(Light3DSceneShared lightScene, int idx)
{
lightScene.LightModels.AmbientLight = Color;
}
}
}
| mit |
mungobungo/coursera | parallel_scala/reductions/src/main/scala/reductions/LineOfSight.scala | 3503 | package reductions
import org.scalameter._
import common._
object LineOfSightRunner {
val standardConfig = config(
Key.exec.minWarmupRuns -> 40,
Key.exec.maxWarmupRuns -> 80,
Key.exec.benchRuns -> 100,
Key.verbose -> true
) withWarmer(new Warmer.Default)
def main(args: Array[String]) {
val length = 10000000
val input = (0 until length).map(_ % 100 * 1.0f).toArray
val output = new Array[Float](length + 1)
val seqtime = standardConfig measure {
LineOfSight.lineOfSight(input, output)
}
println(s"sequential time: $seqtime ms")
val partime = standardConfig measure {
LineOfSight.parLineOfSight(input, output, 10000)
}
println(s"parallel time: $partime ms")
println(s"speedup: ${seqtime / partime}")
}
}
object LineOfSight {
def max(a: Float, b: Float): Float = if (a > b) a else b
def lineOfSight(input: Array[Float], output: Array[Float]): Unit = {
downsweepSequential(input, output, 0.0f, 0, input.length)
}
sealed abstract class Tree {
def maxPrevious: Float
}
case class Node(left: Tree, right: Tree) extends Tree {
val maxPrevious = max(left.maxPrevious, right.maxPrevious)
}
case class Leaf(from: Int, until: Int, maxPrevious: Float) extends Tree
/** Traverses the specified part of the array and returns the maximum angle.
*/
def upsweepSequential(input: Array[Float], from: Int, until: Int): Float = {
var m = 0.0f
for(x <- from until until){
m = max(m, input(x) / x)
}
m
}
/** Traverses the part of the array starting at `from` and until `end`, and
* returns the reduction tree for that part of the array.
*
* The reduction tree is a `Leaf` if the length of the specified part of the
* array is smaller or equal to `threshold`, and a `Node` otherwise.
* If the specified part of the array is longer than `threshold`, then the
* work is divided and done recursively in parallel.
*/
def upsweep(input: Array[Float], from: Int, end: Int,
threshold: Int): Tree = {
if(end -from <= threshold){
Leaf(from, end, upsweepSequential(input, from, end))
}else
{
val middle = from + ((end-from)/2)
val (tL, tR) = parallel( upsweep(input, from, middle, threshold),
upsweep(input, middle, end, threshold))
Node(tL, tR)
}
}
/** Traverses the part of the `input` array starting at `from` and until
* `until`, and computes the maximum angle for each entry of the output array,
* given the `startingAngle`.
*/
def downsweepSequential(input: Array[Float], output: Array[Float],
startingAngle: Float, from: Int, until: Int): Unit = {
var currentMax = startingAngle
for(x <- from until until){
var angle = 0.0f
if(x != 0)
angle = input(x)/x
currentMax = max(currentMax, angle)
output(x) = currentMax
}
}
/** Pushes the maximum angle in the prefix of the array to each leaf of the
* reduction `tree` in parallel, and then calls `downsweepTraverse` to write
* the `output` angles.
*/
def downsweep(input: Array[Float], output: Array[Float], startingAngle: Float,
tree: Tree): Unit = {
downsweepSequential(input, output, startingAngle, 0, input.length)
}
/** Compute the line-of-sight in parallel. */
def parLineOfSight(input: Array[Float], output: Array[Float],
threshold: Int): Unit = {
lineOfSight(input, output)
}
}
| mit |
acadet/wanderer-android | app/src/main/java/com/adriencadet/wanderer/ui/screens/PlaceListScreen.java | 509 | package com.adriencadet.wanderer.ui.screens;
import com.adriencadet.wanderer.ui.controllers.body.PlaceListController;
import com.lyft.scoop.Controller;
import com.lyft.scoop.EnterTransition;
import com.lyft.scoop.ExitTransition;
import com.lyft.scoop.Screen;
import com.lyft.scoop.transitions.FadeTransition;
/**
* PlaceListScreen
* <p>
*/
@Controller(PlaceListController.class)
@EnterTransition(FadeTransition.class)
@ExitTransition(FadeTransition.class)
public class PlaceListScreen extends Screen {
}
| mit |
prinsmike/go-start | utils/xmlwriter.go | 3143 | package utils
import (
"fmt"
"html"
"io"
"github.com/ungerik/go-start/errs"
"github.com/ungerik/go-start/reflection"
// "github.com/ungerik/go-start/debug"
)
///////////////////////////////////////////////////////////////////////////////
// XMLWriter
func NewXMLWriter(writer io.Writer) *XMLWriter {
if xmlWriter, ok := writer.(*XMLWriter); ok {
return xmlWriter
}
return &XMLWriter{writer: writer}
}
type XMLWriter struct {
writer io.Writer
tagStack []string
inOpenTag bool
}
func (self *XMLWriter) WriteXMLDeclaration() *XMLWriter {
return self.Content(`<?xml version="1.0" encoding="UTF-8"?>`)
}
func (self *XMLWriter) OpenTag(tag string) *XMLWriter {
self.finishOpenTag()
self.writer.Write([]byte{'<'})
self.writer.Write([]byte(tag))
self.tagStack = append(self.tagStack, tag)
self.inOpenTag = true
return self
}
// value will be HTML escaped and concaternated
func (self *XMLWriter) Attrib(name string, value ...interface{}) *XMLWriter {
errs.Assert(self.inOpenTag, "utils.XMLWriter.Attrib() must be called inside of open tag")
fmt.Fprintf(self.writer, " %s='", name)
for _, valuePart := range value {
str := html.EscapeString(fmt.Sprint(valuePart))
self.writer.Write([]byte(str))
}
self.writer.Write([]byte{'\''})
return self
}
func (self *XMLWriter) AttribIfNotDefault(name string, value interface{}) *XMLWriter {
if reflection.IsDefaultValue(value) {
return self
}
return self.Attrib(name, value)
}
// AttribFlag writes a name="name" attribute if flag is true,
// else nothing will be written.
func (self *XMLWriter) AttribFlag(name string, flag bool) *XMLWriter {
if flag {
self.Attrib(name, name)
}
return self
}
func (self *XMLWriter) Content(s string) *XMLWriter {
self.Write([]byte(s))
return self
}
func (self *XMLWriter) EscapeContent(s string) *XMLWriter {
self.Write([]byte(html.EscapeString(s)))
return self
}
func (self *XMLWriter) Printf(format string, args ...interface{}) *XMLWriter {
fmt.Fprintf(self, format, args...)
return self
}
func (self *XMLWriter) PrintfEscape(format string, args ...interface{}) *XMLWriter {
return self.EscapeContent(fmt.Sprintf(format, args...))
}
// implements io.Writer
func (self *XMLWriter) Write(p []byte) (n int, err error) {
self.finishOpenTag()
return self.writer.Write(p)
}
func (self *XMLWriter) CloseTag() *XMLWriter {
// this kind of sucks
// if we can haz append() why not pop()?
top := len(self.tagStack) - 1
tag := self.tagStack[top]
self.tagStack = self.tagStack[:top]
if self.inOpenTag {
self.writer.Write([]byte("/>"))
self.inOpenTag = false
} else {
self.writer.Write([]byte("</"))
self.writer.Write([]byte(tag))
self.writer.Write([]byte{'>'})
}
return self
}
// Creates an explicit close tag, even if there is no content
func (self *XMLWriter) CloseTagAlways() *XMLWriter {
self.finishOpenTag()
return self.CloseTag()
}
func (self *XMLWriter) finishOpenTag() {
if self.inOpenTag {
self.writer.Write([]byte{'>'})
self.inOpenTag = false
}
}
func (self *XMLWriter) Reset() {
if self.tagStack != nil {
self.tagStack = self.tagStack[0:0]
}
self.inOpenTag = false
}
| mit |
roc/govuk_template | source/assets/javascripts/core.js | 697 | (function() {
// fix for printing bug in Windows Safari
var windowsSafari = (window.navigator.userAgent.match(/(\(Windows[\s\w\.]+\))[\/\(\s\w\.\,\)]+(Version\/[\d\.]+)\s(Safari\/[\d\.]+)/) !== null),
style;
if (windowsSafari) {
// set the New Transport font to Arial for printing
style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.setAttribute('media', 'print');
style.innerHTML = '@font-face { font-family: nta !important; src: local("Arial") !important; }';
document.getElementsByTagName('head')[0].appendChild(style);
}
if (window.GOVUK && GOVUK.addCookieMessage) {
GOVUK.addCookieMessage();
}
}).call(this);
| mit |
tkrekry/tkrekry-admin | app/scripts/services/user.js | 809 | angular.module('tkrekryApp')
.factory('User', function($resource) {
'use strict';
return $resource('/api/users/:id', {
id: '@id'
}, { //parameters default
update: {
method: 'PUT',
params: {
id: '@id'
}
},
get: {
method: 'GET',
params: {
id: 'me'
}
},
list: {
method: 'GET',
isArray: true,
params: {
id: ''
}
},
destroy: {
method: 'DELETE',
params: {
id: '@id'
}
}
});
});
| mit |
suxinde2009/TheFirstMyth02 | src/com/game/fengshen/GameActivity.java | 1739 | package com.game.fengshen;
import com.example.fengshen.R;
import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.pm.ActivityInfo;
import android.view.Window;
import android.view.WindowManager;
public class GameActivity extends Activity {
private GameView msf;
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
// 强制横屏
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
msf = new GameView(this);
setContentView(msf);
// setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
new AlertDialog.Builder(this)
.setTitle("温馨提示")
.setIcon(R.drawable.icon)
.setMessage("确定结束游戏?")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
// 关闭
public void onClick(DialogInterface dialoginterface, int i) {
android.os.Process.killProcess(android.os.Process
.myPid());
// SoundManager.Instance.stopBackgroundSound();
}
})
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
/* 设置跳出窗口的返回 */
public void onClick(DialogInterface dialoginterface, int i) {
// 不进行操
}
}).show();
}
public void onPause() {
super.onPause();
}
}
| mit |
jinutm/silvfinal | vendor/bundle/ruby/2.1.0/gems/high_voltage-2.0.0/config/routes.rb | 117 | Rails.application.routes.draw do
if HighVoltage.routes
get HighVoltage.route_drawer.match_attributes
end
end
| mit |
plotly/python-api | packages/python/plotly/plotly/validators/barpolar/marker/colorbar/_ticksuffix.py | 487 | import _plotly_utils.basevalidators
class TicksuffixValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="ticksuffix", parent_name="barpolar.marker.colorbar", **kwargs
):
super(TicksuffixValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "colorbars"),
role=kwargs.pop("role", "style"),
**kwargs
)
| mit |
NZJenkins/ChessAnt | util.js | 4003 | "use strict";
//Zobrist lookup table and hash object
var ZobristTable = function(){
var numbers = ZobristTable.toMove + 1;
//buffer of 64 bit ints
this.randomBuffer = new ArrayBuffer(numbers * 8);
this.view = new Uint32Array(this.randomBuffer);
this.Initialize();
}
ZobristTable.wPiece = 0;
ZobristTable.bPiece = 6 * 64;
ZobristTable.castle = 12 * 64;
ZobristTable.ep = ZobristTable.castle + 16;
ZobristTable.toMove = ZobristTable.ep + 8;
ZobristTable.prototype.Initialize = function(){
//TODO custom gen
ZobristTable.SimpleGenerate(this.view);
}
ZobristTable.SimpleGenerate = function(buffer){
for(var i = 0; i < buffer.length; ++i){
var value = 0;
for(var b = 0; b < 32; ++b){
value = value << 1;
if(Math.random() < 0.5)
value |= 1;
}
buffer[i] = value;
//console.log((value >>> 0).toString(2));
}
}
ZobristTable.PieceMap = {
K: 0,
Q: 1,
R: 2,
B: 3,
N: 4,
P: 5,
}
ZobristTable.prototype.Piece = function(piece){
var off = 0;
if(piece.white)
off = ZobristTable.wPiece;
else
off = ZobristTable.bPiece;
off += ZobristTable.PieceMap[piece.absCode] * 64;
off += piece.position.x + 8 * piece.position.y;
return this.Hash(off);
}
ZobristTable.prototype.CastleRights = function(rights){
var off = ZobristTable.castle;
if(rights.wQs)
off += 8;
if(rights.bQs)
off += 4;
if(rights.wKs)
off += 2;
if(rights.bKs)
off += 1;
return this.Hash(off);
}
ZobristTable.prototype.EnPassant = function(epFile){
return this.Hash(ZobristTable.ep + epFile);
}
ZobristTable.prototype.ToMove = function(){
return this.Hash(ZobristTable.toMove);
}
ZobristTable.prototype.Hash = function(offset){
var v1 = this.view[2 * offset]; //1st 32 bit number
var v2 = this.view[2 * offset + 1]; //2nd 32 bit number
return [v1, v2];
}
var ZobristHash = function(zTable){
this.zTable = zTable;
this.v1 = 0;
this.v2 = 0;
}
ZobristHash.prototype.Copy = function(){
var z = new ZobristHash(this.zTable);
z.v1 = this.v1;
z.v2 = this.v2;
return z;
}
ZobristHash.prototype.Toggle = function(hash){
this.v1 ^= hash[0];
this.v2 ^= hash[1];
//console.log(hash[0] + "" + hash[1]);
}
ZobristHash.prototype.TogglePiece = function(piece){
this.Toggle(this.zTable.Piece(piece));
//console.log("toggle piece: " + piece.code + " " + piece.position.x + ", " + piece.position.y);
}
ZobristHash.prototype.TogglePawn = function(piece){
if(piece.absCode == 'P')
this.TogglePiece(piece);
}
ZobristHash.prototype.ToggleCastleRights = function(rights){
this.Toggle(this.zTable.CastleRights(rights));
var cstring = (rights.wKs ? '1':'0') + "" + (rights.wQs ? '1':'0') + "" + (rights.bKs ? '1':'0') + "" + (rights.bQs ? '1':'0');
//console.log("toggle castling: " + cstring)
}
ZobristHash.prototype.ToggleEnPassant = function(enPassant){
this.Toggle(this.zTable.EnPassant(enPassant.x));
//console.log("toggle enpassant: " + enPassant.x);
}
ZobristHash.prototype.ToggleToMove = function(whiteToMove){
this.Toggle(this.zTable.ToMove(whiteToMove));
//console.log("toggle tomove: debug->" + whiteToMove);
}
ZobristHash.prototype.Equals = function(other){
return this.v1 == other.v1 && this.v2 == other.v2;
}
//Zobrist indexed transposition table
var TranspoTable = function(size){
this.table = [];
this.count = 0;
this.maxEntries = size || 2000000;
}
//return a value or null
TranspoTable.prototype.Get = function(zobrist){
var hash = this.hash(zobrist);
var value = this.table[hash];
if(value === undefined || !value.zobrist.Equals(zobrist))
return null;
return value;
}
TranspoTable.prototype.hash = function(zobrist){
//todo: see if this is trash or not
return Math.abs(zobrist.v1 ^ zobrist.v2) % this.maxEntries;
}
//Add a value or return a value if it already exists
TranspoTable.prototype.Add = function(zobrist, value){
//todo: lock down value structure
var hash = this.hash(zobrist);
var lookup = this.table[hash];
if(lookup === undefined)
this.table[hash] = value;
else{
//replacement strategy goes here
this.table[hash] = value;
}
}
| mit |
xhhjin/heroku-ghost | node_modules/mysql/test/integration/pool/test-pool-escape.js | 777 | var common = require('../../common');
var assert = require('assert');
var pool = common.createPool();
// standard test
assert.equal(pool.escape('Super'), "'Super'");
// object stringify test
assert.equal(pool.escape({ a: 123 }), "`a` = 123");
// cannot simply test with default timezone, because i don't kown the test-database timezone.
var poolMod= common.createPool({
// change the defaults
stringifyObjects : true,
timezone : "+0500"
});
// standard test
assert.equal(poolMod.escape('Super'), "'Super'");
// object stringify test
assert.equal(poolMod.escape({ a: 123 }), "'[object Object]'");
// timezone date test
var date = new Date( Date.UTC( 1950,5,15 ) );
assert.equal(poolMod.escape( date ), "'1950-06-15 05:00:00.000'");
| mit |
Georgegig/EstateSocialSystem | Source/EstateSocialSystem/EstateSocialSystem.Data/Migrations/Configuration.cs | 657 | namespace EstateSocialSystem.Data.Migrations
{
using System.Data.Entity.Migrations;
public sealed class Configuration : DbMigrationsConfiguration<EstateSocialSystemDbContext>
{
public Configuration()
{
this.AutomaticMigrationsEnabled = true;
//// TODO: Remove in production
this.AutomaticMigrationDataLossAllowed = true;
this.ContextKey = "EstateSocialSystem.Data.ApplicationDbContext";
}
protected override void Seed(EstateSocialSystemDbContext context)
{
var seed = new SeedData();
seed.Seed(context);
}
}
}
| mit |
rpgdude/r2b | app/scripts/app.js | 266 | 'use strict';
angular.module('r2bExpressApp', [])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.otherwise({
redirectTo: '/'
});
});
| mit |
stivalet/PHP-Vulnerability-test-suite | Injection/CWE_91/safe/CWE_91__GET__func_intval__ID_at-sprintf_%s_simple_quote.php | 1351 | <?php
/*
Safe sample
input : reads the field UserData from the variable $_GET
sanitize : use of intval
construction : use of sprintf via a %s with simple quote
*/
/*Copyright 2015 Bertrand STIVALET
Permission is hereby granted, without written agreement or royalty fee, to
use, copy, modify, and distribute this software and its documentation for
any purpose, provided that the above copyright notice and the following
three paragraphs appear in all copies of this software.
IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO
OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.*/
$tainted = $_GET['UserData'];
$tainted = intval($tainted);
$query = sprintf("//User[@id='%s']", $tainted);
$xml = simplexml_load_file("users.xml");//file load
echo "query : ". $query ."<br /><br />" ;
$res=$xml->xpath($query);//execution
print_r($res);
echo "<br />" ;
?> | mit |
berle/modula-client | src/Logger.php | 845 | <?php namespace Eyego\Modula\Client;
class Logger
{
protected $filename, $callback;
public function __construct($target = null) {
if ($target instanceof \Closure) {
$this->callback = $target;
} elseif (! is_null($target)) {
$this->filename = $target;
}
}
public function write($message)
{
if (isset($this->filename)) {
$this->writeFile($message);
}
if (isset($this->callback)) {
$this->writeCallback($message);
}
}
protected function writeFile($message)
{
$fh = fopen($this->filename, 'a');
fwrite($fh, date('c') . " $message\n");
fclose($fh);
}
protected function writeCallback($message)
{
$callback = $this->callback;
$callback($message);
}
}
| mit |
OctoEnigma/shiny-octo-system | lua/menu/getmaps.lua | 9756 |
local MapPatterns = {}
local MapNames = {}
local function UpdateMaps()
MapPatterns = {}
MapNames = {}
MapNames[ "aoc_" ] = "Age of Chivalry"
MapPatterns[ "^asi-" ] = "Alien Swarm"
MapNames[ "lobby" ] = "Alien Swarm"
MapNames[ "cp_docks" ] = "Blade Symphony"
MapNames[ "cp_parkour" ] = "Blade Symphony"
MapNames[ "cp_sequence" ] = "Blade Symphony"
MapNames[ "cp_terrace" ] = "Blade Symphony"
MapNames[ "cp_test" ] = "Blade Symphony"
MapNames[ "duel_" ] = "Blade Symphony"
MapNames[ "ffa_community" ] = "Blade Symphony"
MapNames[ "free_" ] = "Blade Symphony"
MapNames[ "practice_box" ] = "Blade Symphony"
MapNames[ "tut_training" ] = "Blade Symphony"
MapNames[ "ar_" ] = "Counter-Strike"
MapNames[ "cs_" ] = "Counter-Strike"
MapNames[ "de_" ] = "Counter-Strike"
MapNames[ "es_" ] = "Counter-Strike"
MapNames[ "fy_" ] = "Counter-Strike"
MapNames[ "gd_" ] = "Counter-Strike"
MapNames[ "training1" ] = "Counter-Strike"
MapNames[ "dod_" ] = "Day Of Defeat"
MapNames[ "ddd_" ] = "Dino D-Day"
MapNames[ "de_dam" ] = "DIPRIP"
MapNames[ "dm_city" ] = "DIPRIP"
MapNames[ "dm_refinery" ] = "DIPRIP"
MapNames[ "dm_supermarket" ] = "DIPRIP"
MapNames[ "dm_village" ] = "DIPRIP"
MapNames[ "ur_city" ] = "DIPRIP"
MapNames[ "ur_refinery" ] = "DIPRIP"
MapNames[ "ur_supermarket" ] = "DIPRIP"
MapNames[ "ur_village" ] = "DIPRIP"
MapNames[ "dys_" ] = "Dystopia"
MapNames[ "pb_dojo" ] = "Dystopia"
MapNames[ "pb_rooftop" ] = "Dystopia"
MapNames[ "pb_round" ] = "Dystopia"
MapNames[ "pb_urbandome" ] = "Dystopia"
MapNames[ "sav_dojo6" ] = "Dystopia"
MapNames[ "varena" ] = "Dystopia"
MapNames[ "d1_" ] = "Half-Life 2"
MapNames[ "d2_" ] = "Half-Life 2"
MapNames[ "d3_" ] = "Half-Life 2"
MapNames[ "dm_" ] = "Half-Life 2: Deathmatch"
MapNames[ "halls3" ] = "Half-Life 2: Deathmatch"
MapNames[ "ep1_" ] = "Half-Life 2: Episode 1"
MapNames[ "ep2_" ] = "Half-Life 2: Episode 2"
MapNames[ "ep3_" ] = "Half-Life 2: Episode 3"
MapNames[ "d2_lostcoast" ] = "Half-Life 2: Lost Coast"
MapPatterns[ "^c[%d]a" ] = "Half-Life"
MapPatterns[ "^t0a" ] = "Half-Life"
MapNames[ "boot_camp" ] = "Half-Life Deathmatch"
MapNames[ "bounce" ] = "Half-Life Deathmatch"
MapNames[ "crossfire" ] = "Half-Life Deathmatch"
MapNames[ "datacore" ] = "Half-Life Deathmatch"
MapNames[ "frenzy" ] = "Half-Life Deathmatch"
MapNames[ "lambda_bunker" ] = "Half-Life Deathmatch"
MapNames[ "rapidcore" ] = "Half-Life Deathmatch"
MapNames[ "snarkpit" ] = "Half-Life Deathmatch"
MapNames[ "stalkyard" ] = "Half-Life Deathmatch"
MapNames[ "subtransit" ] = "Half-Life Deathmatch"
MapNames[ "undertow" ] = "Half-Life Deathmatch"
MapNames[ "ins_" ] = "Insurgency"
MapNames[ "l4d_" ] = "Left 4 Dead"
MapPatterns[ "^c[%d]m" ] = "Left 4 Dead 2"
MapPatterns[ "^c1[%d]m" ] = "Left 4 Dead 2"
MapNames[ "curling_stadium" ] = "Left 4 Dead 2"
MapNames[ "tutorial_standards" ] = "Left 4 Dead 2"
MapNames[ "tutorial_standards_vs" ] = "Left 4 Dead 2"
MapNames[ "clocktower" ] = "Nuclear Dawn"
MapNames[ "coast" ] = "Nuclear Dawn"
MapNames[ "downtown" ] = "Nuclear Dawn"
MapNames[ "gate" ] = "Nuclear Dawn"
MapNames[ "hydro" ] = "Nuclear Dawn"
MapNames[ "metro" ] = "Nuclear Dawn"
MapNames[ "metro_training" ] = "Nuclear Dawn"
MapNames[ "oasis" ] = "Nuclear Dawn"
MapNames[ "oilfield" ] = "Nuclear Dawn"
MapNames[ "silo" ] = "Nuclear Dawn"
MapNames[ "sk_metro" ] = "Nuclear Dawn"
MapNames[ "training" ] = "Nuclear Dawn"
MapNames[ "bt_" ] = "Pirates, Vikings, & Knights II"
MapNames[ "lts_" ] = "Pirates, Vikings, & Knights II"
MapNames[ "te_" ] = "Pirates, Vikings, & Knights II"
MapNames[ "tw_" ] = "Pirates, Vikings, & Knights II"
MapNames[ "escape_" ] = "Portal"
MapNames[ "testchmb_" ] = "Portal"
MapNames[ "e1912" ] = "Portal 2"
MapPatterns[ "^mp_coop_" ] = "Portal 2"
MapPatterns[ "^sp_a" ] = "Portal 2"
MapNames[ "achievement_" ] = "Team Fortress 2"
MapNames[ "arena_" ] = "Team Fortress 2"
MapNames[ "cp_" ] = "Team Fortress 2"
MapNames[ "ctf_" ] = "Team Fortress 2"
MapNames[ "itemtest" ] = "Team Fortress 2"
MapNames[ "koth_" ] = "Team Fortress 2"
MapNames[ "mvm_" ] = "Team Fortress 2"
MapNames[ "pl_" ] = "Team Fortress 2"
MapNames[ "plr_" ] = "Team Fortress 2"
MapNames[ "rd_" ] = "Team Fortress 2"
MapNames[ "pd_" ] = "Team Fortress 2"
MapNames[ "sd_" ] = "Team Fortress 2"
MapNames[ "tc_" ] = "Team Fortress 2"
MapNames[ "tr_" ] = "Team Fortress 2"
MapNames[ "trade_" ] = "Team Fortress 2"
MapNames[ "pass_" ] = "Team Fortress 2"
MapNames[ "zpa_" ] = "Zombie Panic! Source"
MapNames[ "zpl_" ] = "Zombie Panic! Source"
MapNames[ "zpo_" ] = "Zombie Panic! Source"
MapNames[ "zps_" ] = "Zombie Panic! Source"
MapNames[ "bhop_" ] = "Bunny Hop"
MapNames[ "cinema_" ] = "Cinema"
MapNames[ "theater_" ] = "Cinema"
MapNames[ "xc_" ] = "Climb"
MapNames[ "deathrun_" ] = "Deathrun"
MapNames[ "dr_" ] = "Deathrun"
MapNames[ "fm_" ] = "Flood"
MapNames[ "gmt_" ] = "GMod Tower"
MapNames[ "gg_" ] = "Gun Game"
MapNames[ "scoutzknivez" ] = "Gun Game"
MapNames[ "ba_" ] = "Jailbreak"
MapNames[ "jail_" ] = "Jailbreak"
MapNames[ "jb_" ] = "Jailbreak"
MapNames[ "mg_" ] = "Minigames"
MapNames[ "pw_" ] = "Pirate Ship Wars"
MapNames[ "ph_" ] = "Prop Hunt"
MapNames[ "rp_" ] = "Roleplay"
MapNames[ "slb_" ] = "Sled Build"
MapNames[ "sb_" ] = "Spacebuild"
MapNames[ "slender_" ] = "Stop it Slender"
MapNames[ "gms_" ] = "Stranded"
MapNames[ "surf_" ] = "Surf"
MapNames[ "ts_" ] = "The Stalker"
MapNames[ "zm_" ] = "Zombie Survival"
MapNames[ "zombiesurvival_" ] = "Zombie Survival"
MapNames[ "zs_" ] = "Zombie Survival"
local GamemodeList = engine.GetGamemodes()
for k, gm in ipairs( GamemodeList ) do
local Name = gm.title or "Unnammed Gamemode"
local Maps = string.Split( gm.maps, "|" )
if ( Maps && gm.maps != "" ) then
for k, pattern in ipairs( Maps ) do
-- When in doubt, just try to match it with string.find
MapPatterns[ string.lower( pattern ) ] = Name
end
end
end
end
local favmaps
local function LoadFavourites()
local cookiestr = cookie.GetString( "favmaps" )
favmaps = favmaps || (cookiestr && string.Explode( ";", cookiestr ) || {})
end
local IgnorePatterns = {
"^background",
"^devtest",
"^ep1_background",
"^ep2_background",
"^styleguide",
}
local IgnoreMaps = {
-- Prefixes
[ "sdk_" ] = true,
[ "test_" ] = true,
[ "vst_" ] = true,
-- Maps
[ "c4a1y" ] = true,
[ "credits" ] = true,
[ "d2_coast_02" ] = true,
[ "d3_c17_02_camera" ] = true,
[ "ep1_citadel_00_demo" ] = true,
[ "intro" ] = true,
[ "test" ] = true
}
local MapList = {}
local function RefreshMaps( skip )
if ( !skip ) then UpdateMaps() end
MapList = {}
local maps = file.Find( "maps/*.bsp", "GAME" )
LoadFavourites()
for k, v in ipairs( maps ) do
local name = string.lower( string.gsub( v, "%.bsp$", "" ) )
local prefix = string.match( name, "^(.-_)" )
local Ignore = IgnoreMaps[ name ] or IgnoreMaps[ prefix ]
-- Don't loop if it's already ignored
if ( Ignore ) then continue end
for _, ignore in ipairs( IgnorePatterns ) do
if ( string.find( name, ignore ) ) then
Ignore = true
break
end
end
-- Don't add useless maps
if ( Ignore ) then continue end
-- Check if the map has a simple name or prefix
local Category = MapNames[ name ] or MapNames[ prefix ]
-- Check if the map has an embedded prefix, or is TTT/Sandbox
if ( !Category ) then
for pattern, category in pairs( MapPatterns ) do
if ( string.find( name, pattern ) ) then
Category = category
end
end
end
-- Throw all uncategorised maps into Other
Category = Category or "Other"
local fav
if ( table.HasValue( favmaps, name ) ) then
fav = true
end
local csgo
if ( Category == "Counter-Strike" ) then
if ( file.Exists( "maps/" .. name .. ".bsp", "csgo" ) ) then
if ( file.Exists( "maps/" .. name .. ".bsp", "cstrike" ) ) then -- Map also exists in CS:GO
csgo = true
else
Category = "CS: Global Offensive"
end
end
end
if ( !MapList[ Category ] ) then
MapList[ Category ] = {}
end
table.insert( MapList[ Category ], name )
if ( fav ) then
if ( !MapList[ "Favourites" ] ) then
MapList[ "Favourites" ] = {}
end
table.insert( MapList[ "Favourites" ], name )
end
if ( csgo ) then
if ( !MapList[ "CS: Global Offensive" ] ) then
MapList[ "CS: Global Offensive" ] = {}
end
-- We have to make the CS:GO name different from the CS:S name to prevent Favourites conflicts
table.insert( MapList[ "CS: Global Offensive" ], name .. " " )
end
end
end
hook.Add( "MenuStart", "FindMaps", RefreshMaps )
hook.Add( "GameContentChanged", "RefreshMaps", RefreshMaps )
function GetMapList()
-- Nice maplist accessor instead of a global table
return MapList
end
function ToggleFavourite( map )
LoadFavourites()
if ( table.HasValue( favmaps, map ) ) then -- is favourite, remove it
table.remove( favmaps, table.KeysFromValue( favmaps, map )[1] )
else -- not favourite, add it
table.insert( favmaps, map )
end
cookie.Set( "favmaps", table.concat( favmaps, ";" ) )
RefreshMaps( true )
UpdateMapList()
end
function SaveLastMap( map, cat )
local t = string.Explode( ";", cookie.GetString( "lastmap", "" ) )
if ( !map ) then map = t[ 1 ] or "gm_flatgrass" end
if ( !cat ) then cat = t[ 2 ] or "Sandbox" end
cookie.Set( "lastmap", map .. ";" .. cat )
end
function LoadLastMap()
local t = string.Explode( ";", cookie.GetString( "lastmap", "" ) )
local map = t[ 1 ] or "gm_flatgrass"
local cat = t[ 2 ] or "Sandbox"
cat = string.gsub( cat, "'", "\\'" )
if ( !file.Exists( "maps/" .. map .. ".bsp", "GAME" ) ) then return end
pnlMainMenu:Call( "SetLastMap('" .. map .. "','" .. cat .. "')" )
end
| mit |
liangqikang/gulosity | app/config/app.php | 6927 | <?php
return array(
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => true,
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => 'http://localhost',
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => 'NJ7gfA5cJyIhkC4xraaroNNVJbpmtin5',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => array(
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
'Illuminate\Cache\CacheServiceProvider',
'Illuminate\Session\CommandsServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
'Illuminate\Routing\ControllerServiceProvider',
'Illuminate\Cookie\CookieServiceProvider',
'Illuminate\Database\DatabaseServiceProvider',
'Illuminate\Encryption\EncryptionServiceProvider',
'Illuminate\Filesystem\FilesystemServiceProvider',
'Illuminate\Hashing\HashServiceProvider',
'Illuminate\Html\HtmlServiceProvider',
'Illuminate\Log\LogServiceProvider',
'Illuminate\Mail\MailServiceProvider',
'Illuminate\Database\MigrationServiceProvider',
'Illuminate\Pagination\PaginationServiceProvider',
'Illuminate\Queue\QueueServiceProvider',
'Illuminate\Redis\RedisServiceProvider',
'Illuminate\Remote\RemoteServiceProvider',
'Illuminate\Auth\Reminders\ReminderServiceProvider',
'Illuminate\Database\SeedServiceProvider',
'Illuminate\Session\SessionServiceProvider',
'Illuminate\Translation\TranslationServiceProvider',
'Illuminate\Validation\ValidationServiceProvider',
'Illuminate\View\ViewServiceProvider',
'Illuminate\Workbench\WorkbenchServiceProvider',
),
/*
|--------------------------------------------------------------------------
| Service Provider Manifest
|--------------------------------------------------------------------------
|
| The service provider manifest is used by Laravel to lazy load service
| providers which are not needed for each request, as well to keep a
| list of all of the services. Here, you may set its storage spot.
|
*/
'manifest' => storage_path().'/meta',
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => array(
'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
'Auth' => 'Illuminate\Support\Facades\Auth',
'Blade' => 'Illuminate\Support\Facades\Blade',
'Cache' => 'Illuminate\Support\Facades\Cache',
'ClassLoader' => 'Illuminate\Support\ClassLoader',
'Config' => 'Illuminate\Support\Facades\Config',
'Controller' => 'Illuminate\Routing\Controller',
'Cookie' => 'Illuminate\Support\Facades\Cookie',
'Crypt' => 'Illuminate\Support\Facades\Crypt',
'DB' => 'Illuminate\Support\Facades\DB',
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
'Event' => 'Illuminate\Support\Facades\Event',
'File' => 'Illuminate\Support\Facades\File',
'Form' => 'Illuminate\Support\Facades\Form',
'Hash' => 'Illuminate\Support\Facades\Hash',
'HTML' => 'Illuminate\Support\Facades\HTML',
'Input' => 'Illuminate\Support\Facades\Input',
'Lang' => 'Illuminate\Support\Facades\Lang',
'Log' => 'Illuminate\Support\Facades\Log',
'Mail' => 'Illuminate\Support\Facades\Mail',
'Paginator' => 'Illuminate\Support\Facades\Paginator',
'Password' => 'Illuminate\Support\Facades\Password',
'Queue' => 'Illuminate\Support\Facades\Queue',
'Redirect' => 'Illuminate\Support\Facades\Redirect',
'Redis' => 'Illuminate\Support\Facades\Redis',
'Request' => 'Illuminate\Support\Facades\Request',
'Response' => 'Illuminate\Support\Facades\Response',
'Route' => 'Illuminate\Support\Facades\Route',
'Schema' => 'Illuminate\Support\Facades\Schema',
'Seeder' => 'Illuminate\Database\Seeder',
'Session' => 'Illuminate\Support\Facades\Session',
'SSH' => 'Illuminate\Support\Facades\SSH',
'Str' => 'Illuminate\Support\Str',
'URL' => 'Illuminate\Support\Facades\URL',
'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View',
),
);
| mit |
intelcommerce/ffcrm_project_management | lib/ffcrm_project_management/engine.rb | 3488 | require 'project_view_hooks'
module FfcrmProjectManagement
class Engine < ::Rails::Engine
initializer :load_config_initializers do
config.paths["config/initializers"].existent.sort.each do |initializer|
load(initializer)
end
end
config.to_prepare do
require 'ffcrm_project_management/ability'
require 'ffcrm_project_management/account'
require 'ffcrm_project_management/contact'
require 'ffcrm_project_management/user'
ActiveSupport.on_load(:fat_free_crm_account) do
self.class_eval do
include FfcrmProjectManagement::Account
end
end
ActiveSupport.on_load(:fat_free_crm_contact) do
self.class_eval do
include FfcrmProjectManagement::Contact
end
end
ActiveSupport.on_load(:fat_free_crm_user) do
self.class_eval do
include FfcrmProjectManagement::User
end
end
ActiveSupport.on_load(:fat_free_crm_ability) do
self.send(:prepend, FfcrmProjectManagement::Ability)
end
HomeController.class_eval do
def index
@activities = get_activities
@my_tasks = ::Task.visible_on_dashboard(current_user).includes(:user, :asset).by_due_at
@my_opportunities = ::Opportunity.visible_on_dashboard(current_user).includes(:account, :user, :tags).by_closes_on.by_amount
@my_accounts = ::Account.visible_on_dashboard(current_user).includes(:user, :tags).by_name
@my_projects = ::Project.visible_on_dashboard(current_user).includes(:user, :tags, :account)
respond_with(@activities)
end
end
UsersController.class_eval do
def opportunities_overview
@users_with_opportunities_and_projects = ::User.have_assigned_opportunities.have_assigned_projects.order(:first_name)
@unassigned_opportunities = ::Opportunity.unassigned.pipeline.order(:stage)
@unassigned_projects = ::Project.unassigned.order(:status)
end
end
ContactsController.class_eval do
def create
@comment_body = params[:comment_body]
respond_with(@contact) do |format|
if @contact.save_with_account_and_permissions(params)
@contact.add_comment_by_user(@comment_body, current_user)
@contacts = get_contacts if called_from_index_page?
else
unless params[:account][:id].blank?
@account = Account.find(params[:account][:id])
else
if request.referer =~ /\/accounts\/(\d+)\z/
@account = Account.find($1) # related account
else
@account = Account.new(:user => current_user)
end
end
@opportunity = Opportunity.my.find(params[:opportunity]) unless params[:opportunity].blank?
@project = Project.my.find(params[:project]) unless params[:project].blank?
end
end
end
end
ApplicationHelper.class_eval do
def jumpbox(current)
tabs = [ :campaigns, :accounts, :leads, :contacts, :projects, :opportunities]
current = tabs.first unless tabs.include?(current)
tabs.map do |tab|
link_to_function(t("tab_#{tab}"), "crm.jumper('#{tab}')", "html-data" => tab, :class => (tab == current ? 'selected' : ''))
end.join(" | ").html_safe
end
end
end
end
end
| mit |
remind101/emp | env.go | 3391 | package main
import (
"fmt"
"log"
"os"
"sort"
"strings"
"github.com/remind101/emp/Godeps/_workspace/src/github.com/docker/docker/opts"
)
var cmdEnv = &Command{
Run: runEnv,
Usage: "env",
NeedsApp: true,
Category: "config",
Short: "list env vars",
Long: `Show all env vars.`,
}
func runEnv(cmd *Command, args []string) {
if len(args) != 0 {
cmd.PrintUsage()
os.Exit(2)
}
config, err := client.ConfigVarInfo(mustApp())
must(err)
var configKeys []string
for k := range config {
configKeys = append(configKeys, k)
}
sort.Strings(configKeys)
for _, k := range configKeys {
fmt.Printf("%s=%s\n", k, config[k])
}
}
var cmdGet = &Command{
Run: runGet,
Usage: "get <name>",
NeedsApp: true,
Category: "config",
Short: "get env var" + extra,
Long: `
Get the value of an env var.
Example:
$ emp get BUILDPACK_URL
http://github.com/kr/heroku-buildpack-inline.git
`,
}
func runGet(cmd *Command, args []string) {
if len(args) != 1 {
cmd.PrintUsage()
os.Exit(2)
}
config, err := client.ConfigVarInfo(mustApp())
must(err)
value, found := config[args[0]]
if !found {
printFatal("No such key as '%s'", args[0])
}
fmt.Println(value)
}
var cmdSet = &Command{
Run: runSet,
Usage: "set <name>=<value>...",
NeedsApp: true,
Category: "config",
Short: "set env var",
Long: `
Set the value of an env var.
Example:
$ emp set BUILDPACK_URL=http://github.com/kr/heroku-buildpack-inline.git
Set env vars and restarted myapp.
`,
}
func runSet(cmd *Command, args []string) {
appname := mustApp()
if len(args) == 0 {
cmd.PrintUsage()
os.Exit(2)
}
config := make(map[string]*string)
for _, arg := range args {
i := strings.Index(arg, "=")
if i < 0 {
printFatal("bad format: %#q. See 'emp help set'", arg)
}
val := arg[i+1:]
config[arg[:i]] = &val
}
_, err := client.ConfigVarUpdate(appname, config)
must(err)
log.Printf("Set env vars and restarted " + appname + ".")
}
var cmdUnset = &Command{
Run: runUnset,
Usage: "unset <name>...",
NeedsApp: true,
Category: "config",
Short: "unset env var",
Long: `
Unset an env var.
Example:
$ emp unset BUILDPACK_URL
Unset env vars and restarted myapp.
`,
}
func runUnset(cmd *Command, args []string) {
appname := mustApp()
if len(args) == 0 {
cmd.PrintUsage()
os.Exit(2)
}
config := make(map[string]*string)
for _, key := range args {
config[key] = nil
}
_, err := client.ConfigVarUpdate(appname, config)
must(err)
log.Printf("Unset env vars and restarted %s.", appname)
}
var cmdEnvLoad = &Command{
Run: runEnvLoad,
Usage: "env-load <file>",
NeedsApp: true,
Category: "config",
Short: "load env file",
Long: `
Loads environment variables from a file.
Example:
$ emp env-load app.env
Set env vars from app.env and restarted myapp.
`,
}
func runEnvLoad(cmd *Command, args []string) {
appname := mustApp()
if len(args) != 1 {
cmd.PrintUsage()
os.Exit(2)
}
parsedVars, err := opts.ParseEnvFile(args[0])
must(err)
config := make(map[string]*string)
for _, value := range parsedVars {
kv := strings.SplitN(value, "=", 2)
if len(kv) == 1 {
config[kv[0]] = new(string)
} else {
config[kv[0]] = &kv[1]
}
}
_, err = client.ConfigVarUpdate(appname, config)
must(err)
log.Printf("Updated env vars from %s and restarted %s.", args[0], appname)
}
| mit |
nekollx/RPBot | guildsetup.js | 3468 | const Discord = require('discord.js');
const client = new Discord.Client();
const token = "MjgwODM3NTg5MzAzMjk2MDEw.C4PN6w.Y2v3G9p02tcnilUmmh0PpCUngAU";
const ddiff = require('return-deep-diff');
client.on('ready', () => {
console.log('I\'m Online\nI\'m Online');
});
// client.on('',''=>{});
client.on('guildDelete', guild => {
console.log(`I have left ${guild.name} at ${new Date()}`);
});
client.on('guildCreate', guild => {
guild.defaultChannel.sendMessage(`I have joined ${guild.name}`);
});
client.on('guildMemberAdd', member => {
let guild = member.guild;
guild.defaultChannel.sendMessage(`Please welcome ${member.user.username} to the server!`);
});
client.on('guildMemberRemove', member => {
let guild = member.guild;
guild.defaultChannel.sendMessage(`Please say goodbye to ${member.user.username} we will miss you!`);
});
client.on('guildMemberSpeaking', (member, speaking) => {
let guild = member.guild;
if (member.speaking) {
guild.defaultChannel.sendMessage(`${member.user.username} is speaking!`);
}
});
client.on('guildMemberUpdate',(oMember, nMember) => {
console.log(ddiff(oMember, nMember));
});
client.on('guildUpdate',(oGuild, nGuild) => {
console.log(ddiff(oGuild, nGuild));
});
client.on('guildBanAdd',(guild, user) => {
guild.defaultChannel.sendMessage(`${user.username} was just banned!`);
});
client.on('guildBanRemove',(guild, user) => {
guild.defaultChannel.sendMessage(`${user.username} was just unbanned!`);
});
var prefix = "~"
client.on('message', message => {
let args = message.content.split(' ').slice(1);
var result = args.join(' ');
if (!message.content.startsWith(prefix)) return;
if (message.author.bot) return;
if (message.content.startsWith(prefix + 'join')) {
let voiceChan = message.member.voiceChannel;
if (!voiceChan || voiceChan.type !== 'voice') {
message.channel.sendMessage('No').catch(error => message.channel.sendMessage(error));
} else if (message.guild.voiceConnection) {
message.channel.sendMessage('I\'m already in a voice channel');
} else {
message.channel.sendMessage('Joining...').then(() => {
voiceChan.join().then(() => {
message.channel.sendMessage('Joined successfully.').catch(error => message.channel.sendMessage(error));
}).catch(error => message.channel.sendMessage(error));
}).catch(error => message.channel.sendMessage(error));
}
} else
if (message.content.startsWith(prefix + 'leave')) {
let voiceChan = message.member.voiceChannel;
if (!voiceChan) {
message.channel.sendMessage('I am not in a voice channel');
} else {
message.channel.sendMessage('Leaving...').then(() => {
voiceChan.leave();
}).catch(error => message.channel.sendMessage(error));
}
}
if (message.content.startsWith(prefix + 'ping')) {
message.channel.sendMessage(`Pong! \`${Date.now() - message.createdTimestamp} ms\``);
} else
if (message.content.startsWith(prefix + 'send')) {
client.channels.get('245491978601627648').sendMessage('Hello to the second channel!');
} else
if (message.content.startsWith(prefix + 'setgame')) {
if (!result) {
result = null;
}
client.user.setGame(result);
} else
if (message.content.startsWith(prefix + 'setstatus')) {
if (!result) {
result = 'online';
}
client.user.setStatus(result);
} else
if (message.content.startsWith(prefix + 'foo')) {
message.channel.sendMessage('bar');
}
});
client.login(token);
| mit |
joeyvandijk/rimg | test/examples/simple.js | 1280 | casper.test.begin('Simple test', 55, function suite(test) {
var currentURL = params.url + '/simple.html';
casper.start(currentURL, function() {
test.assertTitle('simple test', "page title is okay");
});
casper.then(function() {
casper.checkImage(test, 319, 480, 'tiny');
casper.checkImage(test, 320, 480, 'tiny');
casper.checkImage(test, 321, 480, 'small');
casper.checkImage(test, 479, 480, 'small');
casper.checkImage(test, 480, 480, 'small');
casper.checkImage(test, 481, 480, 'medium');
casper.checkImage(test, 599, 480, 'medium');
casper.checkImage(test, 600, 480, 'medium');
casper.checkImage(test, 601, 480, 'regular');
casper.checkImage(test, 767, 600, 'regular');
casper.checkImage(test, 768, 600, 'regular');
casper.checkImage(test, 769, 600, 'large');
casper.checkImage(test, 1023, 768, 'large');
casper.checkImage(test, 1024, 768, 'large');
casper.checkImage(test, 1025, 768, 'huge');
casper.checkImage(test, 1199, 768, 'huge');
casper.checkImage(test, 1200, 1024, 'huge');
casper.checkImage(test, 1201, 1024, 'huge');
});
//start
casper.run(function(){
test.done();
});
}); | mit |
jwilder/shuttle | registry.go | 13822 | package main
import (
"fmt"
"reflect"
"sort"
"strings"
"sync"
"github.com/litl/shuttle/client"
"github.com/litl/shuttle/log"
)
var (
ErrNoService = fmt.Errorf("service does not exist")
ErrNoBackend = fmt.Errorf("backend does not exist")
ErrDuplicateService = fmt.Errorf("service already exists")
ErrDuplicateBackend = fmt.Errorf("backend already exists")
)
type multiError struct {
errors []error
}
func (e *multiError) Add(err error) {
e.errors = append(e.errors, err)
}
func (e multiError) Len() int {
return len(e.errors)
}
func (e multiError) Error() string {
msgs := make([]string, len(e.errors))
for i, err := range e.errors {
msgs[i] = err.Error()
}
return strings.Join(msgs, ", ")
}
func (e multiError) String() string {
return e.Error()
}
type VirtualHost struct {
sync.Mutex
Name string
// All services registered under this vhost name.
services []*Service
// The last one we returned so we can RoundRobin them.
last int
}
func (v *VirtualHost) Len() int {
v.Lock()
defer v.Unlock()
return len(v.services)
}
// Insert a service
// do nothing if the service already is registered
func (v *VirtualHost) Add(svc *Service) {
v.Lock()
defer v.Unlock()
for _, s := range v.services {
if s.Name == svc.Name {
log.Debugf("Service %s already registered in VirtualHost %s", svc.Name, v.Name)
return
}
}
// TODO: is this the best place to log these?
svcCfg := svc.Config()
for _, backend := range svcCfg.Backends {
log.Printf("Adding backend http://%s to VirtualHost %s", backend.Addr, v.Name)
}
v.services = append(v.services, svc)
}
func (v *VirtualHost) Remove(svc *Service) {
v.Lock()
defer v.Unlock()
found := -1
for i, s := range v.services {
if s.Name == svc.Name {
found = i
break
}
}
if found < 0 {
log.Debugf("Service %s not found under VirtualHost %s", svc.Name, v.Name)
return
}
// safe way to get the backends info for logging
svcCfg := svc.Config()
// Now removing this Service
for _, backend := range svcCfg.Backends {
log.Printf("Removing backend http://%s from VirtualHost %s", backend.Addr, v.Name)
}
v.services = append(v.services[:found], v.services[found+1:]...)
}
// Return a *Service for this VirtualHost
func (v *VirtualHost) Service() *Service {
v.Lock()
defer v.Unlock()
if len(v.services) == 0 {
log.Warnf("No Services registered for VirtualHost %s", v.Name)
return nil
}
// start cycling through the services in case one has no backends available
for i := 1; i <= len(v.services); i++ {
idx := (v.last + i) % len(v.services)
if v.services[idx].Available() > 0 {
v.last = idx
return v.services[idx]
}
}
// even if all backends are down, return a service so that the request can
// be processed normally (we may have a custom 502 error page for this)
return v.services[v.last]
}
//TODO: notify or prevent vhost name conflicts between services.
// ServiceRegistry is a global container for all configured services.
type ServiceRegistry struct {
sync.Mutex
svcs map[string]*Service
// Multiple services may respond from a single vhost
vhosts map[string]*VirtualHost
// Global config to apply to new services.
cfg client.Config
}
// Update the global config state, including services and backends.
// This does not remove any Services, but will add or update any provided in
// the config.
func (s *ServiceRegistry) UpdateConfig(cfg client.Config) error {
// Set globals
// TODO: we might need to unset something
// TODO: this should remove services and backends to match the submitted config
if cfg.Balance != "" {
s.cfg.Balance = cfg.Balance
}
if cfg.CheckInterval != 0 {
s.cfg.CheckInterval = cfg.CheckInterval
}
if cfg.Fall != 0 {
s.cfg.Fall = cfg.Fall
}
if cfg.Rise != 0 {
s.cfg.Rise = cfg.Rise
}
if cfg.ClientTimeout != 0 {
s.cfg.ClientTimeout = cfg.ClientTimeout
}
if cfg.ServerTimeout != 0 {
s.cfg.ServerTimeout = cfg.ServerTimeout
}
if cfg.DialTimeout != 0 {
s.cfg.DialTimeout = cfg.DialTimeout
}
invalidPorts := []string{
// FIXME: lookup bound addresses some other way. We may have multiple
// http listeners, as well as all listening Services.
// listenAddr[strings.Index(listenAddr, ":")+1:],
adminListenAddr[strings.Index(adminListenAddr, ":")+1:],
}
errors := &multiError{}
for _, svc := range cfg.Services {
for _, port := range invalidPorts {
if strings.HasSuffix(svc.Addr, port) {
// TODO: report conflicts between service listeners
errors.Add(fmt.Errorf("Port conflict: %s port %s already bound by shuttle", svc.Name, port))
continue
}
}
// Add a new service, or update an existing one.
if Registry.GetService(svc.Name) == nil {
if err := Registry.AddService(svc); err != nil {
log.Errorln("Unable to add service %s: %s", svc.Name, err.Error())
errors.Add(err)
continue
}
} else if err := Registry.UpdateService(svc); err != nil {
log.Errorln("Unable to update service %s: %s", svc.Name, err.Error())
errors.Add(err)
continue
}
}
go writeStateConfig()
if errors.Len() == 0 {
return nil
}
return errors
}
// Return a service by name.
func (s *ServiceRegistry) GetService(name string) *Service {
s.Lock()
defer s.Unlock()
return s.svcs[name]
}
// Return a service that handles a particular vhost by name.
func (s *ServiceRegistry) GetVHostService(name string) *Service {
s.Lock()
defer s.Unlock()
if vhost := s.vhosts[name]; vhost != nil {
return vhost.Service()
}
return nil
}
func (s *ServiceRegistry) VHostsLen() int {
s.Lock()
defer s.Unlock()
return len(s.vhosts)
}
// Add a new service to the Registry.
// Do not replace an existing service.
func (s *ServiceRegistry) AddService(svcCfg client.ServiceConfig) error {
s.Lock()
defer s.Unlock()
log.Debug("Adding service:", svcCfg.Name)
if _, ok := s.svcs[svcCfg.Name]; ok {
log.Debug("Service already exists:", svcCfg.Name)
return ErrDuplicateService
}
s.setServiceDefaults(&svcCfg)
service := NewService(svcCfg)
err := service.start()
if err != nil {
return err
}
s.svcs[service.Name] = service
svcCfg.VirtualHosts = filterEmpty(svcCfg.VirtualHosts)
for _, name := range svcCfg.VirtualHosts {
vhost := s.vhosts[name]
if vhost == nil {
vhost = &VirtualHost{Name: name}
s.vhosts[name] = vhost
}
vhost.Add(service)
}
return nil
}
// Replace the service's configuration, or update its list of backends.
// Replacing a configuration will shutdown the existing service, and start a
// new one, which will cause the listening socket to be temporarily
// unavailable.
func (s *ServiceRegistry) UpdateService(newCfg client.ServiceConfig) error {
s.Lock()
defer s.Unlock()
log.Debug("Updating Service:", newCfg.Name)
service, ok := s.svcs[newCfg.Name]
if !ok {
log.Debug("Service not found:", newCfg.Name)
return ErrNoService
}
if err := service.UpdateDefaults(newCfg); err != nil {
return err
}
currentCfg := service.Config()
// Lots of looping here (including fetching the Config, but the cardinality
// of Backends shouldn't be very large, and the default RoundRobin balancing
// is much simpler with a slice.
// we're going to update just the backends for this config
// get a map of what's already running
currentBackends := make(map[string]client.BackendConfig)
for _, backendCfg := range currentCfg.Backends {
currentBackends[backendCfg.Name] = backendCfg
}
// Keep existing backends when they have equivalent config.
// Update changed backends, and add new ones.
for _, newBackend := range newCfg.Backends {
current, ok := currentBackends[newBackend.Name]
if ok && current.Equal(newBackend) {
log.Debugf("Backend %s/%s unchanged", service.Name, current.Name)
// no change for this one
delete(currentBackends, current.Name)
continue
}
// we need to remove and re-add this backend
log.Debugf("Updating Backend %s/%s", service.Name, newBackend.Name)
service.remove(newBackend.Name)
service.add(NewBackend(newBackend))
delete(currentBackends, newBackend.Name)
}
// remove any left over backends
for name := range currentBackends {
log.Debugf("Removing Backend %s/%s", service.Name, name)
service.remove(name)
}
if currentCfg.Equal(newCfg) {
log.Debugf("Service Unchanged %s", service.Name)
return nil
}
// replace error pages if there's any change
if !reflect.DeepEqual(service.errPagesCfg, newCfg.ErrorPages) {
log.Debugf("Updating ErrorPages")
service.errPagesCfg = newCfg.ErrorPages
service.errorPages.Update(newCfg.ErrorPages)
}
s.updateVHosts(service, filterEmpty(newCfg.VirtualHosts))
return nil
}
// update the VirtualHost entries for this service
// only to be called from UpdateService.
func (s *ServiceRegistry) updateVHosts(service *Service, newHosts []string) {
// We could just clear the vhosts and the new list since we're doing
// this all while the registry is locked, but because we want sane log
// messages about adding remove endpoints, we have to diff the slices
// anyway.
oldHosts := service.VirtualHosts
sort.Strings(oldHosts)
sort.Strings(newHosts)
// find the relative compliments of each set of hostnames
var remove, add []string
i, j := 0, 0
for i < len(oldHosts) && j < len(newHosts) {
if oldHosts[i] != newHosts[j] {
if oldHosts[i] < newHosts[j] {
// oldHosts[i] can't be in newHosts
remove = append(remove, oldHosts[i])
i++
continue
} else {
// newHosts[j] can't be in oldHosts
add = append(add, newHosts[j])
j++
continue
}
}
i++
j++
}
if i < len(oldHosts) {
// there's more!
remove = append(remove, oldHosts[i:]...)
}
if j < len(newHosts) {
add = append(add, newHosts[j:]...)
}
// remove existing vhost entries for this service, and add new ones
for _, name := range remove {
vhost := s.vhosts[name]
if vhost != nil {
vhost.Remove(service)
}
if vhost.Len() == 0 {
log.Println("Removing empty VirtualHost", name)
delete(s.vhosts, name)
}
}
for _, name := range add {
vhost := s.vhosts[name]
if vhost == nil {
vhost = &VirtualHost{Name: name}
s.vhosts[name] = vhost
}
vhost.Add(service)
}
// and replace the list
service.VirtualHosts = newHosts
}
func (s *ServiceRegistry) RemoveService(name string) error {
s.Lock()
defer s.Unlock()
svc, ok := s.svcs[name]
if ok {
log.Debugf("Removing Service %s", svc.Name)
delete(s.svcs, name)
svc.stop()
for host, vhost := range s.vhosts {
vhost.Remove(svc)
removeVhost := true
for _, service := range s.svcs {
for _, h := range service.VirtualHosts {
if host == h {
// FIXME: is this still correct? NOT TESTED!
// vhost exists in another service, so leave it
removeVhost = false
break
}
}
}
if removeVhost {
log.Debugf("Removing VirtualHost %s", host)
delete(s.vhosts, host)
}
}
return nil
}
return ErrNoService
}
func (s *ServiceRegistry) ServiceStats(serviceName string) (ServiceStat, error) {
s.Lock()
defer s.Unlock()
service, ok := s.svcs[serviceName]
if !ok {
return ServiceStat{}, ErrNoService
}
return service.Stats(), nil
}
func (s *ServiceRegistry) ServiceConfig(serviceName string) (client.ServiceConfig, error) {
s.Lock()
defer s.Unlock()
service, ok := s.svcs[serviceName]
if !ok {
return client.ServiceConfig{}, ErrNoService
}
return service.Config(), nil
}
func (s *ServiceRegistry) BackendStats(serviceName, backendName string) (BackendStat, error) {
s.Lock()
defer s.Unlock()
service, ok := s.svcs[serviceName]
if !ok {
return BackendStat{}, ErrNoService
}
for _, backend := range service.Backends {
if backendName == backend.Name {
return backend.Stats(), nil
}
}
return BackendStat{}, ErrNoBackend
}
// Add or update a Backend on an existing Service.
func (s *ServiceRegistry) AddBackend(svcName string, backendCfg client.BackendConfig) error {
s.Lock()
defer s.Unlock()
service, ok := s.svcs[svcName]
if !ok {
return ErrNoService
}
log.Debugf("Adding Backend %s/%s", service.Name, backendCfg.Name)
service.add(NewBackend(backendCfg))
return nil
}
// Remove a Backend from an existing Service.
func (s *ServiceRegistry) RemoveBackend(svcName, backendName string) error {
s.Lock()
defer s.Unlock()
log.Debugf("Removing Backend %s/%s", svcName, backendName)
service, ok := s.svcs[svcName]
if !ok {
return ErrNoService
}
if !service.remove(backendName) {
return ErrNoBackend
}
return nil
}
func (s *ServiceRegistry) Stats() []ServiceStat {
s.Lock()
defer s.Unlock()
stats := []ServiceStat{}
for _, service := range s.svcs {
stats = append(stats, service.Stats())
}
return stats
}
func (s *ServiceRegistry) Config() client.Config {
s.Lock()
defer s.Unlock()
// make sure the old ServiceConfigs are purged when we copy the slice
s.cfg.Services = nil
cfg := s.cfg
for _, service := range s.svcs {
cfg.Services = append(cfg.Services, service.Config())
}
return cfg
}
func (s *ServiceRegistry) String() string {
return string(marshal(s.Config()))
}
// set any missing defaults on a ServiceConfig
// ServiceRegistry *must* be locked
func (s *ServiceRegistry) setServiceDefaults(svc *client.ServiceConfig) {
if svc.Balance == "" && s.cfg.Balance != "" {
svc.Balance = s.cfg.Balance
}
if svc.CheckInterval == 0 && s.cfg.CheckInterval != 0 {
svc.CheckInterval = s.cfg.CheckInterval
}
if svc.Fall == 0 && s.cfg.Fall != 0 {
svc.Fall = s.cfg.Fall
}
if svc.Rise == 0 && s.cfg.Rise != 0 {
svc.Rise = s.cfg.Rise
}
if svc.ClientTimeout == 0 && s.cfg.ClientTimeout != 0 {
svc.ClientTimeout = s.cfg.ClientTimeout
}
if svc.ServerTimeout == 0 && s.cfg.ServerTimeout != 0 {
svc.ServerTimeout = s.cfg.ServerTimeout
}
if svc.DialTimeout == 0 && s.cfg.DialTimeout != 0 {
svc.DialTimeout = s.cfg.DialTimeout
}
}
| mit |
floeit/floe | config/flow.go | 5590 | package config
import (
"fmt"
"io/ioutil"
"strings"
"github.com/cavaliercoder/grab"
nt "github.com/floeit/floe/config/nodetype"
yaml "gopkg.in/yaml.v2"
)
// FlowRef is a reference that uniquely identifies a flow
type FlowRef struct {
ID string
Ver int
}
func (f FlowRef) String() string {
if f.ID == "" {
return "na"
}
return fmt.Sprintf("%s-%d", f.ID, f.Ver)
}
// NonZero returns true if this ref has been assigned nonzero values
func (f FlowRef) NonZero() bool {
return f.ID != "" && f.Ver != 0
}
// Equal returns true if all fields in f anf g are equal
func (f FlowRef) Equal(g FlowRef) bool {
return f.ID == g.ID && f.Ver == g.Ver
}
// Flow is a serialisable Flow Config, a definition of a flow. It is uniquely identified
// by an ID and Version.
type Flow struct {
ID string // url friendly ID - computed from the name if not given
Ver int // flow version, together with an ID form a global compound unique key
// FlowFile is a path to a config file describing the Tasks.
// It can be a path to a file in a git repo e.g. [email protected]:floeit/floe.git/build/FLOE.yaml
// or a local file e.g. file:./foo-bar/floe.yaml
// a FlowFile may override any setting from the flows defined in the main config file, but it
// does not make much sense that they override the Triggers.
FlowFile string `yaml:"flow-file"`
Name string // human friendly name
ReuseSpace bool `yaml:"reuse-space"` // if true then will use the single workspace and will mutex with other instances of this Flow
HostTags []string `yaml:"host-tags"` // tags that must match the tags on the host
ResourceTags []string `yaml:"resource-tags"` // tags that if any flow is running with any matching tags then don't launch
Env []string // key=value environment variables with
// Triggers are the node types that define how a run is triggered for this flow.
Triggers []*node
// The things to do once a trigger has started this flow
Tasks []*node
}
// Node returns the node matching id
func (f *Flow) Node(id string) *node {
for _, s := range f.Tasks {
if s.ID == id {
return s
}
}
return nil
}
// MatchTag finds all nodes that are waiting for this event tag
func (f *Flow) MatchTag(tag string) []*node {
res := []*node{}
for _, s := range f.Tasks {
if s.matched(tag) {
res = append(res, s)
}
}
return res
}
// Load looks at the FlowFile and loads in the flow from that reference
// overriding any pre-existing settings, except triggers.
func (f *Flow) Load(cacheDir string) (err error) {
if f.FlowFile == "" {
return nil
}
var content []byte
switch getURLType(f.FlowFile) {
case "local":
content, err = ioutil.ReadFile(f.FlowFile)
case "web":
content, err = get(cacheDir, f.FlowFile)
// TODO git - including the branch
default:
return fmt.Errorf("unrecognised floe file type: <%s>", f.FlowFile)
}
if err != nil {
return err
}
// unmarshal into a flow
newFlow := &Flow{}
err = yaml.Unmarshal(content, &newFlow)
if err != nil {
return err
}
// set up the flow, and copy bits into this flow
err = newFlow.zero()
if err != nil {
return err
}
if len(newFlow.Name) != 0 {
f.Name = newFlow.Name
}
f.ReuseSpace = newFlow.ReuseSpace
if len(newFlow.HostTags) != 0 {
f.HostTags = newFlow.HostTags
}
if len(newFlow.ResourceTags) != 0 {
f.ResourceTags = newFlow.ResourceTags
}
if len(newFlow.Env) != 0 {
f.Env = newFlow.Env
}
if len(newFlow.Tasks) != 0 {
f.Tasks = newFlow.Tasks
}
// Pointless overriding triggers - as they are what caused this load
return nil
}
// get gets the file from the web or the cache and returns its contents
func get(cacheDir, url string) ([]byte, error) {
client := grab.NewClient()
req, err := grab.NewRequest(cacheDir, url)
if err != nil {
return nil, err
}
resp := client.Do(req)
<-resp.Done
return ioutil.ReadFile(resp.Filename)
}
// getURLType returns the url type:
// "web" - it is fetchable from the web,
// "git" - it can be got from a repo,
// "local" - it can be got from the local files system
func getURLType(fileRef string) string {
if strings.Contains(fileRef, "git@") {
return "git"
}
if strings.HasPrefix(fileRef, "http") {
return "web"
}
return "local"
}
// zero checks and corrects ids and changes the options format from yaml default to
// one compatible with json serialising
func (f *Flow) zero() error {
if err := zeroNID(f); err != nil {
return err
}
fr := FlowRef{
ID: f.ID,
Ver: f.Ver,
}
ids := map[string]int{}
for i, t := range f.Triggers {
if err := t.zero(NcTrigger, fr); err != nil {
return fmt.Errorf("%s %d - %v", NcTrigger, i, err)
}
ids[t.id()]++
}
for i, t := range f.Tasks {
if err := t.zero(NcTask, fr); err != nil {
return fmt.Errorf("%s %d - %v", NcTask, i, err)
}
ids[t.id()]++
}
// check for unique id's
for k, c := range ids {
if c != 1 {
return fmt.Errorf("%d nodes have id: %s", c, k)
}
}
// convert to json-able options
f.fixupOpts()
return nil
}
func (f *Flow) fixupOpts() {
for _, v := range f.Triggers {
v.Opts.Fixup()
}
for _, v := range f.Tasks {
v.Opts.Fixup()
}
}
func (f *Flow) matchTriggers(eType string, opts *nt.Opts) []*node {
res := []*node{}
for _, s := range f.Triggers {
if s.matchedTriggers(eType, opts) {
res = append(res, s)
}
}
return res
}
// methods that implement nid so the flow can be zeroNid'd
func (f *Flow) setName(n string) {
f.Name = n
}
func (f *Flow) setID(i string) {
f.ID = i
}
func (f *Flow) name() string {
return f.Name
}
func (f *Flow) id() string {
return f.ID
}
| mit |
ptournem/AXIS_MoM_WebSite | app/Providers/CommentsServiceProvider.php | 500 | <?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\App;
class CommentsServiceProvider extends ServiceProvider {
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot() {
//
}
/**
* Register the application services.
*
* @return void
*/
public function register() {
App::bind('Comments', function() {
return new \App\Classes\Comments;
});
}
}
| mit |
heartshare/cmf-1 | based/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SslSocketAcceptanceTest.php | 1303 | <?php
require_once __DIR__ . '/AbstractStreamBufferAcceptanceTest.php';
class Swift_Transport_StreamBuffer_SslSocketAcceptanceTest
extends Swift_Transport_StreamBuffer_AbstractStreamBufferAcceptanceTest
{
public function setUp()
{
$streams = stream_get_transports();
if (!in_array('ssl', $streams)) {
$this->markTestSkipped(
'SSL is not configured for your system. It is not possible to run this test'
);
}
if (!defined('SWIFT_SSL_HOST')) {
$this->markTestSkipped(
'Cannot run test without an SSL enabled SMTP host to connect to (define ' .
'SWIFT_SSL_HOST in tests/acceptance.conf.php if you wish to run this test)'
);
}
parent::setUp();
}
protected function _initializeBuffer()
{
$parts = explode(':', SWIFT_SSL_HOST);
$host = $parts[0];
$port = isset($parts[1]) ? $parts[1] : 25;
$this->_buffer->initialize(
array(
'type' => Swift_Transport_IoBuffer::TYPE_SOCKET,
'host' => $host,
'port' => $port,
'protocol' => 'ssl',
'blocking' => 1,
'timeout' => 15,
)
);
}
}
| mit |
L5hunter/TestCoin | src/qt/locale/bitcoin_nb.ts | 145488 | <TS language="nb" version="2.0">
<context>
<name>AddressBookPage</name>
<message>
<source>Double-click to edit address or label</source>
<translation>Dobbelklikk for å redigere adresse eller merkelapp</translation>
</message>
<message>
<source>Create a new address</source>
<translation>Lag en ny adresse</translation>
</message>
<message>
<source>&New</source>
<translation>&Ny</translation>
</message>
<message>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopier den valgte adressen til systemets utklippstavle</translation>
</message>
<message>
<source>&Copy</source>
<translation>&Kopier</translation>
</message>
<message>
<source>C&lose</source>
<translation>&Lukk</translation>
</message>
<message>
<source>&Copy Address</source>
<translation>&Kopier Adresse</translation>
</message>
<message>
<source>Delete the currently selected address from the list</source>
<translation>Slett den valgte adressen fra listen.</translation>
</message>
<message>
<source>Export the data in the current tab to a file</source>
<translation>Eksporter data fra nåværende fane til fil</translation>
</message>
<message>
<source>&Export</source>
<translation>&Eksporter</translation>
</message>
<message>
<source>&Delete</source>
<translation>&Slett</translation>
</message>
<message>
<source>Choose the address to send coins to</source>
<translation>Velg adressen å sende mynter til</translation>
</message>
<message>
<source>Choose the address to receive coins with</source>
<translation>Velg adressen til å motta mynter med</translation>
</message>
<message>
<source>C&hoose</source>
<translation>&Velg</translation>
</message>
<message>
<source>Sending addresses</source>
<translation>Utsendingsadresser</translation>
</message>
<message>
<source>Receiving addresses</source>
<translation>Mottaksadresser</translation>
</message>
<message>
<source>These are your Testcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation>Dette er dine Testcoin-adresser for å sende betalinger. Alltid sjekk beløp og mottakeradresse før sending av mynter.</translation>
</message>
<message>
<source>These are your Testcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>
<translation>Dette er dine Testcoin-adresser for å sende betalinger. Det er anbefalt å bruk en ny mottaksadresse for hver transaksjon.</translation>
</message>
<message>
<source>Copy &Label</source>
<translation>Kopier &Merkelapp</translation>
</message>
<message>
<source>&Edit</source>
<translation>&Rediger</translation>
</message>
<message>
<source>Export Address List</source>
<translation>Ekporter Adresseliste</translation>
</message>
<message>
<source>Comma separated file (*.csv)</source>
<translation>Kommaseparert fil (*.csv)</translation>
</message>
<message>
<source>Exporting Failed</source>
<translation>Ekport Feilet</translation>
</message>
<message>
<source>There was an error trying to save the address list to %1. Please try again.</source>
<translation>Det oppstod en feil under lagring av adresselisten til %1. Vennligst prøv på nytt.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<source>Label</source>
<translation>Merkelapp</translation>
</message>
<message>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<source>(no label)</source>
<translation>(ingen merkelapp)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<source>Passphrase Dialog</source>
<translation>Dialog for Adgangsfrase</translation>
</message>
<message>
<source>Enter passphrase</source>
<translation>Angi adgangsfrase</translation>
</message>
<message>
<source>New passphrase</source>
<translation>Ny adgangsfrase</translation>
</message>
<message>
<source>Repeat new passphrase</source>
<translation>Gjenta ny adgangsfrase</translation>
</message>
<message>
<source>Encrypt wallet</source>
<translation>Krypter lommebok</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Denne operasjonen krever adgangsfrasen til lommeboken for å låse den opp.</translation>
</message>
<message>
<source>Unlock wallet</source>
<translation>Lås opp lommebok</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Denne operasjonen krever adgangsfrasen til lommeboken for å dekryptere den.</translation>
</message>
<message>
<source>Decrypt wallet</source>
<translation>Dekrypter lommebok</translation>
</message>
<message>
<source>Change passphrase</source>
<translation>Endre adgangsfrase</translation>
</message>
<message>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Skriv inn gammel og ny adgangsfrase for lommeboken.</translation>
</message>
<message>
<source>Confirm wallet encryption</source>
<translation>Bekreft kryptering av lommebok</translation>
</message>
<message>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR TestcoinS</b>!</source>
<translation>Advarsel: Hvis du krypterer lommeboken og mister adgangsfrasen, så vil du <b>MISTE ALLE DINE TestcoinS</b>!</translation>
</message>
<message>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Er du sikker på at du vil kryptere lommeboken?</translation>
</message>
<message>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation>VIKTIG: Tidligere sikkerhetskopier av din lommebokfil bør erstattes med den nylig genererte og krypterte filen, da de blir ugyldiggjort av sikkerhetshensyn så snart du begynner å bruke den nye krypterte lommeboken.</translation>
</message>
<message>
<source>Warning: The Caps Lock key is on!</source>
<translation>Advarsel: Caps Lock er på!</translation>
</message>
<message>
<source>Wallet encrypted</source>
<translation>Lommebok kryptert</translation>
</message>
<message>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>ten or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Oppgi adgangsfrasen til lommeboken.<br/>Vennligst bruk en adgangsfrase med <b>ti eller flere tilfeldige tegn</b>, eller <b>åtte eller flere ord</b>.</translation>
</message>
<message>
<source>Testcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your Testcoins from being stolen by malware infecting your computer.</source>
<translation>Testcoin vil nå lukkes for å fullføre krypteringsprosessen. Husk at kryptering av lommeboken ikke fullt ut kan beskytte dine Testcoins fra å bli stjålet om skadevare infiserer datamaskinen.</translation>
</message>
<message>
<source>Wallet encryption failed</source>
<translation>Kryptering av lommebok feilet</translation>
</message>
<message>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Kryptering av lommebok feilet på grunn av en intern feil. Din lommebok ble ikke kryptert.</translation>
</message>
<message>
<source>The supplied passphrases do not match.</source>
<translation>De angitte adgangsfrasene er ulike.</translation>
</message>
<message>
<source>Wallet unlock failed</source>
<translation>Opplåsing av lommebok feilet</translation>
</message>
<message>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Adgangsfrasen angitt for dekryptering av lommeboken var feil.</translation>
</message>
<message>
<source>Wallet decryption failed</source>
<translation>Dekryptering av lommebok feilet</translation>
</message>
<message>
<source>Wallet passphrase was successfully changed.</source>
<translation>Adgangsfrase for lommebok endret.</translation>
</message>
</context>
<context>
<name>TestcoinGUI</name>
<message>
<source>Sign &message...</source>
<translation>Signer &melding...</translation>
</message>
<message>
<source>Synchronizing with network...</source>
<translation>Synkroniserer med nettverk...</translation>
</message>
<message>
<source>&Overview</source>
<translation>&Oversikt</translation>
</message>
<message>
<source>Node</source>
<translation>Node</translation>
</message>
<message>
<source>Show general overview of wallet</source>
<translation>Vis generell oversikt over lommeboken</translation>
</message>
<message>
<source>&Transactions</source>
<translation>&Transaksjoner</translation>
</message>
<message>
<source>Browse transaction history</source>
<translation>Vis transaksjonshistorikk</translation>
</message>
<message>
<source>E&xit</source>
<translation>&Avslutt</translation>
</message>
<message>
<source>Quit application</source>
<translation>Avslutt applikasjonen</translation>
</message>
<message>
<source>About &Qt</source>
<translation>Om &Qt</translation>
</message>
<message>
<source>Show information about Qt</source>
<translation>Vis informasjon om Qt</translation>
</message>
<message>
<source>&Options...</source>
<translation>&Innstillinger...</translation>
</message>
<message>
<source>&Encrypt Wallet...</source>
<translation>&Krypter Lommebok...</translation>
</message>
<message>
<source>&Backup Wallet...</source>
<translation>Lag &Sikkerhetskopi av Lommebok...</translation>
</message>
<message>
<source>&Change Passphrase...</source>
<translation>&Endre Adgangsfrase...</translation>
</message>
<message>
<source>&Sending addresses...</source>
<translation>&Utsendingsadresser...</translation>
</message>
<message>
<source>&Receiving addresses...</source>
<translation>&Mottaksadresser...</translation>
</message>
<message>
<source>Open &URI...</source>
<translation>Åpne &URI...</translation>
</message>
<message>
<source>Testcoin Core client</source>
<translation>Testcoin Core-klient</translation>
</message>
<message>
<source>Importing blocks from disk...</source>
<translation>Importere blokker...</translation>
</message>
<message>
<source>Reindexing blocks on disk...</source>
<translation>Reindekserer blokker på harddisk...</translation>
</message>
<message>
<source>Send coins to a Testcoin address</source>
<translation>Send til en Testcoin-adresse</translation>
</message>
<message>
<source>Modify configuration options for Testcoin</source>
<translation>Endre oppsett for Testcoin</translation>
</message>
<message>
<source>Backup wallet to another location</source>
<translation>Sikkerhetskopier lommebok til annet sted</translation>
</message>
<message>
<source>Change the passphrase used for wallet encryption</source>
<translation>Endre adgangsfrasen brukt for kryptering av lommebok</translation>
</message>
<message>
<source>&Debug window</source>
<translation>&Feilsøkingsvindu</translation>
</message>
<message>
<source>Open debugging and diagnostic console</source>
<translation>Åpne konsoll for feilsøk og diagnostikk</translation>
</message>
<message>
<source>&Verify message...</source>
<translation>&Verifiser melding...</translation>
</message>
<message>
<source>Testcoin</source>
<translation>Testcoin</translation>
</message>
<message>
<source>Wallet</source>
<translation>Lommebok</translation>
</message>
<message>
<source>&Send</source>
<translation>&Send</translation>
</message>
<message>
<source>&Receive</source>
<translation>&Motta</translation>
</message>
<message>
<source>Show information about Testcoin Core</source>
<translation>Vis informasjon om Testcoin Core</translation>
</message>
<message>
<source>&Show / Hide</source>
<translation>&Vis / Skjul</translation>
</message>
<message>
<source>Show or hide the main Window</source>
<translation>Vis eller skjul hovedvinduet</translation>
</message>
<message>
<source>Encrypt the private keys that belong to your wallet</source>
<translation>Krypter de private nøklene som tilhører lommeboken din</translation>
</message>
<message>
<source>Sign messages with your Testcoin addresses to prove you own them</source>
<translation>Signer en melding med Testcoin-adressene dine for å bevise at du eier dem</translation>
</message>
<message>
<source>Verify messages to ensure they were signed with specified Testcoin addresses</source>
<translation>Bekreft meldinger for å være sikker på at de ble signert av en angitt Testcoin-adresse</translation>
</message>
<message>
<source>&File</source>
<translation>&Fil</translation>
</message>
<message>
<source>&Settings</source>
<translation>&Innstillinger</translation>
</message>
<message>
<source>&Help</source>
<translation>&Hjelp</translation>
</message>
<message>
<source>Tabs toolbar</source>
<translation>Verktøylinje for faner</translation>
</message>
<message>
<source>Testcoin Core</source>
<translation>Testcoin Core</translation>
</message>
<message>
<source>Request payments (generates QR codes and Testcoin: URIs)</source>
<translation>Forespør betalinger (genererer QR-koder og Testcoin: URIer)</translation>
</message>
<message>
<source>&About Testcoin Core</source>
<translation>&Om Testcoin Core</translation>
</message>
<message>
<source>Show the list of used sending addresses and labels</source>
<translation>Vis listen av brukte utsendingsadresser og merkelapper</translation>
</message>
<message>
<source>Show the list of used receiving addresses and labels</source>
<translation>Vis listen over bruke mottaksadresser og merkelapper</translation>
</message>
<message>
<source>Open a Testcoin: URI or payment request</source>
<translation>Åpne en Testcoin: URI eller betalingsetterspørring</translation>
</message>
<message>
<source>&Command-line options</source>
<translation>&Kommandolinjevalg</translation>
</message>
<message>
<source>Show the Testcoin Core help message to get a list with possible Testcoin command-line options</source>
<translation>Vis Testcoin Core hjelpemeldingen for å få en liste med mulige kommandolinjevalg</translation>
</message>
<message numerus="yes">
<source>%n active connection(s) to Testcoin network</source>
<translation><numerusform>%n aktiv forbindelse til Testcoin-nettverket</numerusform><numerusform>%n aktive forbindelser til Testcoin-nettverket</numerusform></translation>
</message>
<message>
<source>No block source available...</source>
<translation>Ingen kilde for blokker tilgjengelig...</translation>
</message>
<message numerus="yes">
<source>%n hour(s)</source>
<translation><numerusform>%n time</numerusform><numerusform>%n timer</numerusform></translation>
</message>
<message numerus="yes">
<source>%n day(s)</source>
<translation><numerusform>%n dag</numerusform><numerusform>%n dager</numerusform></translation>
</message>
<message numerus="yes">
<source>%n week(s)</source>
<translation><numerusform>%n uke</numerusform><numerusform>%n uker</numerusform></translation>
</message>
<message>
<source>%1 and %2</source>
<translation>%1 og %2</translation>
</message>
<message numerus="yes">
<source>%n year(s)</source>
<translation><numerusform>%n år</numerusform><numerusform>%n år</numerusform></translation>
</message>
<message>
<source>%1 behind</source>
<translation>%1 bak</translation>
</message>
<message>
<source>Last received block was generated %1 ago.</source>
<translation>Siste mottatte blokk ble generert for %1 siden.</translation>
</message>
<message>
<source>Transactions after this will not yet be visible.</source>
<translation>Transaksjoner etter dette vil ikke være synlige enda.</translation>
</message>
<message>
<source>Error</source>
<translation>Feil</translation>
</message>
<message>
<source>Warning</source>
<translation>Advarsel</translation>
</message>
<message>
<source>Information</source>
<translation>Informasjon</translation>
</message>
<message>
<source>Up to date</source>
<translation>Ajour</translation>
</message>
<message numerus="yes">
<source>Processed %n blocks of transaction history.</source>
<translation><numerusform>Lastet %n blokk med transaksjonshistorikk.</numerusform><numerusform>Lastet %n blokker med transaksjonshistorikk.</numerusform></translation>
</message>
<message>
<source>Catching up...</source>
<translation>Kommer ajour...</translation>
</message>
<message>
<source>Sent transaction</source>
<translation>Sendt transaksjon</translation>
</message>
<message>
<source>Incoming transaction</source>
<translation>Innkommende transaksjon</translation>
</message>
<message>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Dato: %1
Beløp: %2
Type: %3
Adresse: %4
</translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Lommeboken er <b>kryptert</b> og for tiden <b>ulåst</b></translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Lommeboken er <b>kryptert</b> og for tiden <b>låst</b></translation>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<source>Network Alert</source>
<translation>Nettverksvarsel</translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<source>Coin Selection</source>
<translation>Mynt Valg</translation>
</message>
<message>
<source>Quantity:</source>
<translation>Mengde:</translation>
</message>
<message>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<source>Amount:</source>
<translation>Beløp:</translation>
</message>
<message>
<source>Priority:</source>
<translation>Prioritet:</translation>
</message>
<message>
<source>Fee:</source>
<translation>Avgift:</translation>
</message>
<message>
<source>Dust:</source>
<translation>Støv:</translation>
</message>
<message>
<source>After Fee:</source>
<translation>Etter Gebyr:</translation>
</message>
<message>
<source>Change:</source>
<translation>Veksel:</translation>
</message>
<message>
<source>(un)select all</source>
<translation>velg (fjern) alt</translation>
</message>
<message>
<source>Tree mode</source>
<translation>Tremodus</translation>
</message>
<message>
<source>List mode</source>
<translation>Listemodus</translation>
</message>
<message>
<source>Amount</source>
<translation>Beløp</translation>
</message>
<message>
<source>Received with label</source>
<translation>Mottatt med merkelapp</translation>
</message>
<message>
<source>Received with address</source>
<translation>Mottatt med adresse</translation>
</message>
<message>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<source>Confirmations</source>
<translation>Bekreftelser</translation>
</message>
<message>
<source>Confirmed</source>
<translation>Bekreftet</translation>
</message>
<message>
<source>Priority</source>
<translation>Prioritet</translation>
</message>
<message>
<source>Copy address</source>
<translation>Kopier adresse</translation>
</message>
<message>
<source>Copy label</source>
<translation>Kopier merkelapp</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Kopier beløp</translation>
</message>
<message>
<source>Copy transaction ID</source>
<translation>Kopier transaksjons-ID</translation>
</message>
<message>
<source>Lock unspent</source>
<translation>Lås ubrukte</translation>
</message>
<message>
<source>Unlock unspent</source>
<translation>Lås opp ubrukte</translation>
</message>
<message>
<source>Copy quantity</source>
<translation>Kopier mengde</translation>
</message>
<message>
<source>Copy fee</source>
<translation>Kopier gebyr</translation>
</message>
<message>
<source>Copy after fee</source>
<translation>Kopier fra gebyr</translation>
</message>
<message>
<source>Copy bytes</source>
<translation>Kopier bytes</translation>
</message>
<message>
<source>Copy priority</source>
<translation>Kopier prioritet</translation>
</message>
<message>
<source>Copy dust</source>
<translation>Kopier støv</translation>
</message>
<message>
<source>Copy change</source>
<translation>Kopier veksel</translation>
</message>
<message>
<source>highest</source>
<translation>høyest</translation>
</message>
<message>
<source>higher</source>
<translation>høyere</translation>
</message>
<message>
<source>high</source>
<translation>høy</translation>
</message>
<message>
<source>medium-high</source>
<translation>medium-høy</translation>
</message>
<message>
<source>medium</source>
<translation>medium</translation>
</message>
<message>
<source>low-medium</source>
<translation>lav-medium</translation>
</message>
<message>
<source>low</source>
<translation>lav</translation>
</message>
<message>
<source>lower</source>
<translation>lavere</translation>
</message>
<message>
<source>lowest</source>
<translation>lavest</translation>
</message>
<message>
<source>(%1 locked)</source>
<translation>(%1 låst)</translation>
</message>
<message>
<source>none</source>
<translation>ingen</translation>
</message>
<message>
<source>Can vary +/- %1 satoshi(s) per input.</source>
<translation>Kan variere +/- %1 satoshi(er) per input.</translation>
</message>
<message>
<source>yes</source>
<translation>ja</translation>
</message>
<message>
<source>no</source>
<translation>nei</translation>
</message>
<message>
<source>This label turns red, if the transaction size is greater than 1000 bytes.</source>
<translation>Denne merkelappen blir rød, hvis transaksjonsstørrelsen er større enn 1000 bytes.</translation>
</message>
<message>
<source>This means a fee of at least %1 per kB is required.</source>
<translation>Dette betyr at et gebyr på minst %1 per KB er påkrevd.</translation>
</message>
<message>
<source>Can vary +/- 1 byte per input.</source>
<translation>Kan variere +/- 1 byte per input.</translation>
</message>
<message>
<source>Transactions with higher priority are more likely to get included into a block.</source>
<translation>Transaksjoner med høyere prioritet har mer sannsynlighet for å bli inkludert i en blokk.</translation>
</message>
<message>
<source>This label turns red, if the priority is smaller than "medium".</source>
<translation>Denne merkelappen blir rød, hvis prioriteten er mindre enn "medium".</translation>
</message>
<message>
<source>This label turns red, if any recipient receives an amount smaller than %1.</source>
<translation>Denne merkelappen blir rød, hvis en mottaker mottar en mengde på mindre enn %1.</translation>
</message>
<message>
<source>(no label)</source>
<translation>(ingen merkelapp)</translation>
</message>
<message>
<source>change from %1 (%2)</source>
<translation>veksel fra %1 (%2)</translation>
</message>
<message>
<source>(change)</source>
<translation>(veksel)</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<source>Edit Address</source>
<translation>Rediger adresse</translation>
</message>
<message>
<source>&Label</source>
<translation>&Merkelapp</translation>
</message>
<message>
<source>The label associated with this address list entry</source>
<translation>Merkelappen koblet til denne adresseliste oppføringen</translation>
</message>
<message>
<source>The address associated with this address list entry. This can only be modified for sending addresses.</source>
<translation>Adressen til denne oppføringen i adresseboken. Denne kan kun endres for utsendingsadresser.</translation>
</message>
<message>
<source>&Address</source>
<translation>&Adresse</translation>
</message>
<message>
<source>New receiving address</source>
<translation>Ny mottaksadresse</translation>
</message>
<message>
<source>New sending address</source>
<translation>Ny utsendingsadresse</translation>
</message>
<message>
<source>Edit receiving address</source>
<translation>Rediger mottaksadresse</translation>
</message>
<message>
<source>Edit sending address</source>
<translation>Rediger utsendingsadresse</translation>
</message>
<message>
<source>The entered address "%1" is already in the address book.</source>
<translation>Den oppgitte adressen "%1" er allerede i adresseboken.</translation>
</message>
<message>
<source>The entered address "%1" is not a valid Testcoin address.</source>
<translation>Den angitte adressed "%1" er ikke en gyldig Testcoin-adresse.</translation>
</message>
<message>
<source>Could not unlock wallet.</source>
<translation>Kunne ikke låse opp lommeboken.</translation>
</message>
<message>
<source>New key generation failed.</source>
<translation>Generering av ny nøkkel feilet.</translation>
</message>
</context>
<context>
<name>FreespaceChecker</name>
<message>
<source>A new data directory will be created.</source>
<translation>En ny datamappe vil bli laget.</translation>
</message>
<message>
<source>name</source>
<translation>navn</translation>
</message>
<message>
<source>Directory already exists. Add %1 if you intend to create a new directory here.</source>
<translation>Mappe finnes allerede. Legg til %1 hvis du vil lage en ny mappe her.</translation>
</message>
<message>
<source>Path already exists, and is not a directory.</source>
<translation>Snarvei finnes allerede, og er ikke en mappe.</translation>
</message>
<message>
<source>Cannot create data directory here.</source>
<translation>Kan ikke lage datamappe her.</translation>
</message>
</context>
<context>
<name>HelpMessageDialog</name>
<message>
<source>Testcoin Core</source>
<translation>Testcoin Core</translation>
</message>
<message>
<source>version</source>
<translation>versjon</translation>
</message>
<message>
<source>(%1-bit)</source>
<translation> (%1-bit)</translation>
</message>
<message>
<source>About Testcoin Core</source>
<translation>Om Testcoin Core</translation>
</message>
<message>
<source>Command-line options</source>
<translation>Kommandolinjevalg</translation>
</message>
<message>
<source>Usage:</source>
<translation>Bruk:</translation>
</message>
<message>
<source>command-line options</source>
<translation>kommandolinjevalg</translation>
</message>
<message>
<source>UI options</source>
<translation>valg i brukergrensesnitt</translation>
</message>
<message>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Sett språk, for eksempel "nb_NO" (standardverdi: fra operativsystem)</translation>
</message>
<message>
<source>Start minimized</source>
<translation>Start minimert</translation>
</message>
<message>
<source>Set SSL root certificates for payment request (default: -system-)</source>
<translation>Sett SSL-rotsertifikat for betalingsetterspørring (standard: -system-)</translation>
</message>
<message>
<source>Show splash screen on startup (default: 1)</source>
<translation>Vis splashskjerm ved oppstart (standardverdi: 1)</translation>
</message>
<message>
<source>Choose data directory on startup (default: 0)</source>
<translation>Velg datamappe ved oppstart (standard: 0)</translation>
</message>
</context>
<context>
<name>Intro</name>
<message>
<source>Welcome</source>
<translation>Velkommen</translation>
</message>
<message>
<source>Welcome to Testcoin Core.</source>
<translation>Velkommen til Testcoin Core.</translation>
</message>
<message>
<source>As this is the first time the program is launched, you can choose where Testcoin Core will store its data.</source>
<translation>Siden dette er første gang programmet starter, kan du nå velge hvor Testcoin Core skal lagre sine data.</translation>
</message>
<message>
<source>Testcoin Core will download and store a copy of the Testcoin 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>Testcoin Core vil laste ned og lagre en kopi av Testcoin sin blokkjede. Minst %1GB av data vil bli lagret i denne mappen, og det vil vokse over tid. Lommeboken vil også bli lagret i denne mappen.</translation>
</message>
<message>
<source>Use the default data directory</source>
<translation>Bruk standard datamappe</translation>
</message>
<message>
<source>Use a custom data directory:</source>
<translation>Bruk en egendefinert datamappe:</translation>
</message>
<message>
<source>Testcoin Core</source>
<translation>Testcoin Core</translation>
</message>
<message>
<source>Error: Specified data directory "%1" cannot be created.</source>
<translation>Feil: Den oppgitte datamappen "%1" kan ikke opprettes.</translation>
</message>
<message>
<source>Error</source>
<translation>Feil</translation>
</message>
<message numerus="yes">
<source>%n GB of free space available</source>
<translation><numerusform>%n GB med ledig lagringsplass</numerusform><numerusform>%n GB med ledig lagringsplass</numerusform></translation>
</message>
<message numerus="yes">
<source>(of %n GB needed)</source>
<translation><numerusform>(av %n GB som trengs)</numerusform><numerusform>(av %n GB som trengs)</numerusform></translation>
</message>
</context>
<context>
<name>OpenURIDialog</name>
<message>
<source>Open URI</source>
<translation>Åpne URI</translation>
</message>
<message>
<source>Open payment request from URI or file</source>
<translation>Åpne betalingsetterspørring fra URI eller fil</translation>
</message>
<message>
<source>URI:</source>
<translation>URI:</translation>
</message>
<message>
<source>Select payment request file</source>
<translation>Velg fil for betalingsetterspørring</translation>
</message>
<message>
<source>Select payment request file to open</source>
<translation>Velg fil for betalingsetterspørring å åpne</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<source>Options</source>
<translation>Innstillinger</translation>
</message>
<message>
<source>&Main</source>
<translation>&Hoved</translation>
</message>
<message>
<source>Automatically start Testcoin after logging in to the system.</source>
<translation>Start Testcoin automatisk etter innlogging.</translation>
</message>
<message>
<source>&Start Testcoin on system login</source>
<translation>&Start Testcoin ved systeminnlogging</translation>
</message>
<message>
<source>Size of &database cache</source>
<translation>Størrelse på &database hurtigbuffer</translation>
</message>
<message>
<source>MB</source>
<translation>MB</translation>
</message>
<message>
<source>Number of script &verification threads</source>
<translation>Antall script &verifikasjonstråder</translation>
</message>
<message>
<source>Accept connections from outside</source>
<translation>Tillat tilkoblinger fra utsiden</translation>
</message>
<message>
<source>Allow incoming connections</source>
<translation>Tillatt innkommende tilkoblinger</translation>
</message>
<message>
<source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>
<translation>IP-adressen til proxyen (f.eks. IPv4: 127.0.0.1 / IPv6: ::1)</translation>
</message>
<message>
<source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>
<translation>Tredjepart URLer (f. eks. en blokkutforsker) som dukker opp i transaksjonsfanen som kontekst meny elementer. %s i URLen er erstattet med transaksjonen sin hash. Flere URLer er separert av en vertikal linje |.</translation>
</message>
<message>
<source>Third party transaction URLs</source>
<translation>Tredjepart transaksjon URLer</translation>
</message>
<message>
<source>Active command-line options that override above options:</source>
<translation>Aktive kommandolinjevalg som overstyrer valgene ovenfor:</translation>
</message>
<message>
<source>Reset all client options to default.</source>
<translation>Tilbakestill alle klient valg til standard</translation>
</message>
<message>
<source>&Reset Options</source>
<translation>&Tilbakestill Instillinger</translation>
</message>
<message>
<source>&Network</source>
<translation>&Nettverk</translation>
</message>
<message>
<source>(0 = auto, <0 = leave that many cores free)</source>
<translation>(0 = automatisk, <0 = la så mange kjerner være ledig)</translation>
</message>
<message>
<source>W&allet</source>
<translation>L&ommebok</translation>
</message>
<message>
<source>Expert</source>
<translation>Ekspert</translation>
</message>
<message>
<source>Enable coin &control features</source>
<translation>Aktiver &myntkontroll funksjoner</translation>
</message>
<message>
<source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>
<translation>Hvis du sperrer for bruk av ubekreftet veksel, kan ikke vekselen fra transaksjonen bli brukt før transaksjonen har minimum en bekreftelse. Dette påvirker også hvordan balansen din blir beregnet.</translation>
</message>
<message>
<source>&Spend unconfirmed change</source>
<translation>&Bruk ubekreftet veksel</translation>
</message>
<message>
<source>Automatically open the Testcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Åpne automatisk Testcoin klientporten på ruteren. Dette virker kun om din ruter støtter UPnP og dette er påslått.</translation>
</message>
<message>
<source>Map port using &UPnP</source>
<translation>Sett opp port ved hjelp av &UPnP</translation>
</message>
<message>
<source>Connect to the Testcoin network through a SOCKS5 proxy.</source>
<translation>Koble til Testcoin-nettverket gjennom en SOCKS5 proxy.</translation>
</message>
<message>
<source>&Connect through SOCKS5 proxy (default proxy):</source>
<translation>&Koble til gjennom SOCKS5 proxy (standardvalg proxy):</translation>
</message>
<message>
<source>Proxy &IP:</source>
<translation>Proxy &IP:</translation>
</message>
<message>
<source>&Port:</source>
<translation>&Port:</translation>
</message>
<message>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Proxyens port (f.eks. 9050)</translation>
</message>
<message>
<source>&Window</source>
<translation>&Vindu</translation>
</message>
<message>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Vis kun ikon i systemkurv etter minimering av vinduet.</translation>
</message>
<message>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Minimer til systemkurv istedenfor oppgavelinjen</translation>
</message>
<message>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Minimerer vinduet istedenfor å avslutte applikasjonen når vinduet lukkes. Når dette er slått på avsluttes applikasjonen kun ved å velge avslutt i menyen.</translation>
</message>
<message>
<source>M&inimize on close</source>
<translation>M&inimer ved lukking</translation>
</message>
<message>
<source>&Display</source>
<translation>&Visning</translation>
</message>
<message>
<source>User Interface &language:</source>
<translation>&Språk for brukergrensesnitt</translation>
</message>
<message>
<source>The user interface language can be set here. This setting will take effect after restarting Testcoin.</source>
<translation>Språket for brukergrensesnittet kan settes her. Innstillingen trer i kraft ved omstart av Testcoin.</translation>
</message>
<message>
<source>&Unit to show amounts in:</source>
<translation>&Enhet for visning av beløper:</translation>
</message>
<message>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Velg standard delt enhet for visning i grensesnittet og for sending av Testcoins.</translation>
</message>
<message>
<source>Whether to show coin control features or not.</source>
<translation>Skal myntkontroll funksjoner vises eller ikke.</translation>
</message>
<message>
<source>&OK</source>
<translation>&OK</translation>
</message>
<message>
<source>&Cancel</source>
<translation>&Avbryt</translation>
</message>
<message>
<source>default</source>
<translation>standardverdi</translation>
</message>
<message>
<source>none</source>
<translation>ingen</translation>
</message>
<message>
<source>Confirm options reset</source>
<translation>Bekreft tilbakestilling av innstillinger</translation>
</message>
<message>
<source>Client restart required to activate changes.</source>
<translation>Omstart av klienten er nødvendig for å aktivere endringene.</translation>
</message>
<message>
<source>Client will be shutdown, do you want to proceed?</source>
<translation>Klienten vil bli lukket, vil du fortsette?</translation>
</message>
<message>
<source>This change would require a client restart.</source>
<translation>Denne endringen krever omstart av klienten.</translation>
</message>
<message>
<source>The supplied proxy address is invalid.</source>
<translation>Angitt proxyadresse er ugyldig.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<source>Form</source>
<translation>Skjema</translation>
</message>
<message>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Testcoin network after a connection is established, but this process has not completed yet.</source>
<translation>Informasjonen som vises kan være foreldet. Din lommebok synkroniseres automatisk med Testcoin-nettverket etter at tilkobling er opprettet, men denne prosessen er ikke ferdig enda.</translation>
</message>
<message>
<source>Watch-only:</source>
<translation>Kun observerbar:</translation>
</message>
<message>
<source>Available:</source>
<translation>Tilgjengelig:</translation>
</message>
<message>
<source>Your current spendable balance</source>
<translation>Din nåværende saldo</translation>
</message>
<message>
<source>Pending:</source>
<translation>Under behandling:</translation>
</message>
<message>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>
<translation>Totalt antall ubekreftede transaksjoner som ikke teller med i saldo</translation>
</message>
<message>
<source>Immature:</source>
<translation>Umoden:</translation>
</message>
<message>
<source>Mined balance that has not yet matured</source>
<translation>Minet saldo har ikke modnet enda</translation>
</message>
<message>
<source>Balances</source>
<translation>Saldoer</translation>
</message>
<message>
<source>Total:</source>
<translation>Totalt:</translation>
</message>
<message>
<source>Your current total balance</source>
<translation>Din nåværende saldo</translation>
</message>
<message>
<source>Your current balance in watch-only addresses</source>
<translation>Din nåværende balanse i kun observerbare adresser</translation>
</message>
<message>
<source>Spendable:</source>
<translation>Kan brukes:</translation>
</message>
<message>
<source>Recent transactions</source>
<translation>Nylige transaksjoner</translation>
</message>
<message>
<source>Unconfirmed transactions to watch-only addresses</source>
<translation>Ubekreftede transaksjoner til kun observerbare adresser</translation>
</message>
<message>
<source>Mined balance in watch-only addresses that has not yet matured</source>
<translation>Utvunnet balanse i kun observerbare adresser som ennå ikke har modnet</translation>
</message>
<message>
<source>Current total balance in watch-only addresses</source>
<translation>Nåværende totale balanse i kun observerbare adresser</translation>
</message>
<message>
<source>out of sync</source>
<translation>ute av synk</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<source>URI handling</source>
<translation>URI-håndtering</translation>
</message>
<message>
<source>Invalid payment address %1</source>
<translation>Ugyldig betalingsadresse %1</translation>
</message>
<message>
<source>Payment request rejected</source>
<translation>Betalingsetterspørring avvist</translation>
</message>
<message>
<source>Payment request network doesn't match client network.</source>
<translation>Nettverk for betalingsetterspørring er ikke i overensstemmelse med klientnettverket.</translation>
</message>
<message>
<source>Payment request has expired.</source>
<translation>Betalingsetterspørringen har utløpt.</translation>
</message>
<message>
<source>Payment request is not initialized.</source>
<translation>Betalingsetterspørringen er ikke initialisert.</translation>
</message>
<message>
<source>Requested payment amount of %1 is too small (considered dust).</source>
<translation>Forespurt betalingsmengde på %1 er for liten (betraktet som støv).</translation>
</message>
<message>
<source>Payment request error</source>
<translation>Betalingsetterspørringsfeil</translation>
</message>
<message>
<source>Cannot start Testcoin: click-to-pay handler</source>
<translation>Kan ikke starte Testcoin: klikk-og-betal håndterer</translation>
</message>
<message>
<source>Payment request fetch URL is invalid: %1</source>
<translation>Hentelenke for betalingsetterspørring er ugyldig: %1</translation>
</message>
<message>
<source>URI cannot be parsed! This can be caused by an invalid Testcoin address or malformed URI parameters.</source>
<translation>URI kan ikke fortolkes! Dette kan være forårsaket av en ugyldig Testcoin-adresse eller feilformede URI-parametre.</translation>
</message>
<message>
<source>Payment request file handling</source>
<translation>Filhåndtering for betalingsetterspørring</translation>
</message>
<message>
<source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>
<translation>Betalingsetterspørringsfil kan ikke leses! Dette kan være forårsaket av en ugyldig betalingsetterspørringsfil.</translation>
</message>
<message>
<source>Unverified payment requests to custom payment scripts are unsupported.</source>
<translation>Uverifiserte betalingsforespørsler til egentilpassede betalingscript er ikke støttet.</translation>
</message>
<message>
<source>Refund from %1</source>
<translation>Refundering fra %1</translation>
</message>
<message>
<source>Error communicating with %1: %2</source>
<translation>Feil i kommunikasjonen med %1: %2</translation>
</message>
<message>
<source>Payment request cannot be parsed!</source>
<translation>Betaingsetterspørrelse kan ikke fortolkes!</translation>
</message>
<message>
<source>Bad response from server %1</source>
<translation>Dårlig svar fra server %1</translation>
</message>
<message>
<source>Payment acknowledged</source>
<translation>Betaling erkjent</translation>
</message>
<message>
<source>Network request error</source>
<translation>Nettverksforespørsel feil</translation>
</message>
</context>
<context>
<name>PeerTableModel</name>
<message>
<source>User Agent</source>
<translation>Brukeragent</translation>
</message>
<message>
<source>Address/Hostname</source>
<translation>Adresse/Vertsnavn</translation>
</message>
<message>
<source>Ping Time</source>
<translation>Ping-tid</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>Amount</source>
<translation>Beløp</translation>
</message>
<message>
<source>Enter a Testcoin address (e.g. %1)</source>
<translation>Oppgi en Testcoin-adresse (f.eks. %1)</translation>
</message>
<message>
<source>%1 d</source>
<translation>%1 d</translation>
</message>
<message>
<source>%1 h</source>
<translation>%1 t</translation>
</message>
<message>
<source>%1 m</source>
<translation>%1 m</translation>
</message>
<message>
<source>%1 s</source>
<translation>%1 s</translation>
</message>
<message>
<source>NETWORK</source>
<translation>NETTVERK</translation>
</message>
<message>
<source>UNKNOWN</source>
<translation>UKJENT</translation>
</message>
<message>
<source>None</source>
<translation>Ingen</translation>
</message>
<message>
<source>N/A</source>
<translation>-</translation>
</message>
<message>
<source>%1 ms</source>
<translation>%1 ms</translation>
</message>
</context>
<context>
<name>QRImageWidget</name>
<message>
<source>&Save Image...</source>
<translation>&Lagre Bilde...</translation>
</message>
<message>
<source>&Copy Image</source>
<translation>&Kopier Bilde</translation>
</message>
<message>
<source>Save QR Code</source>
<translation>Lagre QR-kode</translation>
</message>
<message>
<source>PNG Image (*.png)</source>
<translation>PNG-bilde (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<source>Client name</source>
<translation>Klientnavn</translation>
</message>
<message>
<source>N/A</source>
<translation>-</translation>
</message>
<message>
<source>Client version</source>
<translation>Klientversjon</translation>
</message>
<message>
<source>&Information</source>
<translation>&Informasjon</translation>
</message>
<message>
<source>Debug window</source>
<translation>Feilsøkingsvindu</translation>
</message>
<message>
<source>General</source>
<translation>Generelt</translation>
</message>
<message>
<source>Using OpenSSL version</source>
<translation>Bruker OpenSSL versjon</translation>
</message>
<message>
<source>Using BerkeleyDB version</source>
<translation>Bruker BerkeleyDB versjon</translation>
</message>
<message>
<source>Startup time</source>
<translation>Oppstartstidspunkt</translation>
</message>
<message>
<source>Network</source>
<translation>Nettverk</translation>
</message>
<message>
<source>Name</source>
<translation>Navn</translation>
</message>
<message>
<source>Number of connections</source>
<translation>Antall tilkoblinger</translation>
</message>
<message>
<source>Block chain</source>
<translation>Blokkjeden</translation>
</message>
<message>
<source>Current number of blocks</source>
<translation>Nåværende antall blokker</translation>
</message>
<message>
<source>Received</source>
<translation>Mottatt</translation>
</message>
<message>
<source>Sent</source>
<translation>Sendt</translation>
</message>
<message>
<source>&Peers</source>
<translation>&Noder</translation>
</message>
<message>
<source>Select a peer to view detailed information.</source>
<translation>Velg en node for å vise detaljert informasjon.</translation>
</message>
<message>
<source>Direction</source>
<translation>Retning</translation>
</message>
<message>
<source>Version</source>
<translation>Versjon</translation>
</message>
<message>
<source>User Agent</source>
<translation>Brukeragent</translation>
</message>
<message>
<source>Services</source>
<translation>Tjenester</translation>
</message>
<message>
<source>Starting Height</source>
<translation>Starthøyde</translation>
</message>
<message>
<source>Sync Height</source>
<translation>Synkroniseringshøyde</translation>
</message>
<message>
<source>Ban Score</source>
<translation>Ban Poengsum</translation>
</message>
<message>
<source>Connection Time</source>
<translation>Tilkoblingstid</translation>
</message>
<message>
<source>Last Send</source>
<translation>Siste Sendte</translation>
</message>
<message>
<source>Last Receive</source>
<translation>Siste Mottatte</translation>
</message>
<message>
<source>Bytes Sent</source>
<translation>Byte Sendt</translation>
</message>
<message>
<source>Bytes Received</source>
<translation>Byte Mottatt</translation>
</message>
<message>
<source>Ping Time</source>
<translation>Ping-tid</translation>
</message>
<message>
<source>Last block time</source>
<translation>Tidspunkt for siste blokk</translation>
</message>
<message>
<source>&Open</source>
<translation>&Åpne</translation>
</message>
<message>
<source>&Console</source>
<translation>&Konsoll</translation>
</message>
<message>
<source>&Network Traffic</source>
<translation>&Nettverkstrafikk</translation>
</message>
<message>
<source>&Clear</source>
<translation>&Fjern</translation>
</message>
<message>
<source>Totals</source>
<translation>Totalt</translation>
</message>
<message>
<source>In:</source>
<translation>Inn:</translation>
</message>
<message>
<source>Out:</source>
<translation>Ut:</translation>
</message>
<message>
<source>Build date</source>
<translation>Byggedato</translation>
</message>
<message>
<source>Debug log file</source>
<translation>Loggfil for feilsøk</translation>
</message>
<message>
<source>Open the Testcoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation>Åpne Testcoin sin loggfil for feilsøk fra den gjeldende datamappen. Dette kan ta noen sekunder for store loggfiler.</translation>
</message>
<message>
<source>Clear console</source>
<translation>Tøm konsoll</translation>
</message>
<message>
<source>Welcome to the Testcoin RPC console.</source>
<translation>Velkommen til Testcoin sin RPC-konsoll.</translation>
</message>
<message>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Bruk opp og ned pil for å navigere historikken, og <b>Ctrl-L</b> for å tømme skjermen.</translation>
</message>
<message>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Skriv <b>help</b> for en oversikt over kommandoer.</translation>
</message>
<message>
<source>%1 B</source>
<translation>%1 B</translation>
</message>
<message>
<source>%1 KB</source>
<translation>%1 KB</translation>
</message>
<message>
<source>%1 MB</source>
<translation>%1 MB</translation>
</message>
<message>
<source>%1 GB</source>
<translation>%1 GB</translation>
</message>
<message>
<source>via %1</source>
<translation>via %1</translation>
</message>
<message>
<source>never</source>
<translation>aldri</translation>
</message>
<message>
<source>Inbound</source>
<translation>Innkommende</translation>
</message>
<message>
<source>Outbound</source>
<translation>Utgående</translation>
</message>
<message>
<source>Unknown</source>
<translation>Ukjent</translation>
</message>
<message>
<source>Fetching...</source>
<translation>Henter …</translation>
</message>
</context>
<context>
<name>ReceiveCoinsDialog</name>
<message>
<source>&Amount:</source>
<translation>&Beløp:</translation>
</message>
<message>
<source>&Label:</source>
<translation>&Merkelapp:</translation>
</message>
<message>
<source>&Message:</source>
<translation>&Melding:</translation>
</message>
<message>
<source>Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.</source>
<translation>Gjenbruk en av de tidligere brukte mottaksadressene. Gjenbruk av adresser har sikkerhets- og personvernsutfordringer. Ikke bruk dette med unntak for å gjennopprette en betalingsetterspørring som ble gjort tidligere.</translation>
</message>
<message>
<source>R&euse an existing receiving address (not recommended)</source>
<translation>Gj&enbruk en eksisterende mottaksadresse (ikke anbefalt)</translation>
</message>
<message>
<source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Testcoin network.</source>
<translation>En valgfri melding å tilknytte betalingsetterspørringen, som vil bli vist når forespørselen er åpnet. Meldingen vil ikke bli sendt med betalingen over Testcoin-nettverket.</translation>
</message>
<message>
<source>An optional label to associate with the new receiving address.</source>
<translation>En valgfri merkelapp å tilknytte den nye mottakeradressen.</translation>
</message>
<message>
<source>Use this form to request payments. All fields are <b>optional</b>.</source>
<translation>Bruk dette skjemaet til betalingsforespørsler. Alle felt er <b>valgfrie</b>.</translation>
</message>
<message>
<source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>
<translation>Et valgfritt beløp å etterspørre. La stå tomt eller null for ikke å etterspørre et spesifikt beløp.</translation>
</message>
<message>
<source>Clear all fields of the form.</source>
<translation>Fjern alle felter fra skjemaet.</translation>
</message>
<message>
<source>Clear</source>
<translation>Fjern</translation>
</message>
<message>
<source>Requested payments history</source>
<translation>Etterspurt betalingshistorikk</translation>
</message>
<message>
<source>&Request payment</source>
<translation>&Etterspør betaling</translation>
</message>
<message>
<source>Show the selected request (does the same as double clicking an entry)</source>
<translation>Vis den valgte etterspørringen (gjør det samme som å dobbelklikke på en oppføring)</translation>
</message>
<message>
<source>Show</source>
<translation>Vis</translation>
</message>
<message>
<source>Remove the selected entries from the list</source>
<translation>Fjern de valgte oppføringene fra listen</translation>
</message>
<message>
<source>Remove</source>
<translation>Fjern</translation>
</message>
<message>
<source>Copy label</source>
<translation>Kopier merkelapp</translation>
</message>
<message>
<source>Copy message</source>
<translation>Kopier melding</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Kopier beløp</translation>
</message>
</context>
<context>
<name>ReceiveRequestDialog</name>
<message>
<source>QR Code</source>
<translation>QR-kode</translation>
</message>
<message>
<source>Copy &URI</source>
<translation>Kopier &URI</translation>
</message>
<message>
<source>Copy &Address</source>
<translation>Kopier &Adresse</translation>
</message>
<message>
<source>&Save Image...</source>
<translation>&Lagre Bilde...</translation>
</message>
<message>
<source>Request payment to %1</source>
<translation>Etterspør betaling til %1</translation>
</message>
<message>
<source>Payment information</source>
<translation>Betalingsinformasjon</translation>
</message>
<message>
<source>URI</source>
<translation>URI</translation>
</message>
<message>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<source>Amount</source>
<translation>Beløp</translation>
</message>
<message>
<source>Label</source>
<translation>Merkelapp</translation>
</message>
<message>
<source>Message</source>
<translation>Melding</translation>
</message>
<message>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>Resultat URI for lang, prøv å redusere teksten for merkelapp / melding.</translation>
</message>
<message>
<source>Error encoding URI into QR Code.</source>
<translation>Feil ved koding av URI til QR-kode.</translation>
</message>
</context>
<context>
<name>RecentRequestsTableModel</name>
<message>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<source>Label</source>
<translation>Merkelapp</translation>
</message>
<message>
<source>Message</source>
<translation>Melding</translation>
</message>
<message>
<source>Amount</source>
<translation>Beløp</translation>
</message>
<message>
<source>(no label)</source>
<translation>(ingen merkelapp)</translation>
</message>
<message>
<source>(no message)</source>
<translation>(ingen melding)</translation>
</message>
<message>
<source>(no amount)</source>
<translation>(intet beløp)</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<source>Send Coins</source>
<translation>Send Testcoins</translation>
</message>
<message>
<source>Coin Control Features</source>
<translation>Myntkontroll Funksjoner</translation>
</message>
<message>
<source>Inputs...</source>
<translation>Inndata...</translation>
</message>
<message>
<source>automatically selected</source>
<translation>automatisk valgte</translation>
</message>
<message>
<source>Insufficient funds!</source>
<translation>Utilstrekkelige midler!</translation>
</message>
<message>
<source>Quantity:</source>
<translation>Mengde:</translation>
</message>
<message>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<source>Amount:</source>
<translation>Beløp:</translation>
</message>
<message>
<source>Priority:</source>
<translation>Prioritet:</translation>
</message>
<message>
<source>Fee:</source>
<translation>Gebyr:</translation>
</message>
<message>
<source>After Fee:</source>
<translation>Etter Gebyr:</translation>
</message>
<message>
<source>Change:</source>
<translation>Veksel:</translation>
</message>
<message>
<source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>
<translation>Hvis dette er aktivert, men adressen for veksel er tom eller ugyldig, vil veksel bli sendt til en nylig generert adresse.</translation>
</message>
<message>
<source>Custom change address</source>
<translation>Egendefinert adresse for veksel</translation>
</message>
<message>
<source>Transaction Fee:</source>
<translation>Transaksjonsgebyr:</translation>
</message>
<message>
<source>Choose...</source>
<translation>Velg...</translation>
</message>
<message>
<source>collapse fee-settings</source>
<translation>Legg ned gebyrinnstillinger</translation>
</message>
<message>
<source>Minimize</source>
<translation>Minimer</translation>
</message>
<message>
<source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>
<translation>Hvis den egendefinerte avgiften er satt til 1000 satoshis og transaksjonen bare er 250 bytes, da vil "per kilobyte" bare betale 250 satoshis i gebyr, mens "minst" betaler 1000 satoshis. For transaksjoner større enn en kilobyte vil begge betale for antall kilobyte.</translation>
</message>
<message>
<source>per kilobyte</source>
<translation>per kilobyte</translation>
</message>
<message>
<source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "total at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>
<translation>Hvis den egendefinerte avgiften er satt til 1000 satoshis og transaksjonen bare er 250 bytes, da vil "per kilobyte" bare betale 250 satoshis i gebyr, mens "minstebeløp" betaler 1000 satoshis. For transaksjoner større enn en kilobyte vil begge betale for antall kilobyte.</translation>
</message>
<message>
<source>total at least</source>
<translation>minstebeløp</translation>
</message>
<message>
<source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for Testcoin transactions than the network can process.</source>
<translation>Betaling av bare minimumsavgiften går helt fint så lenge det er mindre transaksjonsvolum enn plass i blokkene. Men vær klar over at dette kan ende opp i en transaksjon som aldri blir bekreftet når det er mer etterspørsel etter Testcoin-transaksjoner enn nettverket kan behandle.</translation>
</message>
<message>
<source>(read the tooltip)</source>
<translation>(les verktøytipset)</translation>
</message>
<message>
<source>Recommended:</source>
<translation>Anbefalt:</translation>
</message>
<message>
<source>Custom:</source>
<translation>Egendefinert:</translation>
</message>
<message>
<source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>
<translation>(Smartgebyr ikke innført ennå. Dette tar vanligvis noen blokker...)</translation>
</message>
<message>
<source>Confirmation time:</source>
<translation>Bekreftelsestid:</translation>
</message>
<message>
<source>normal</source>
<translation>normal</translation>
</message>
<message>
<source>fast</source>
<translation>rask</translation>
</message>
<message>
<source>Send as zero-fee transaction if possible</source>
<translation>Send uten transaksjonsgebyr hvis mulig</translation>
</message>
<message>
<source>(confirmation may take longer)</source>
<translation>(bekreftelse kan ta lengre tid)</translation>
</message>
<message>
<source>Send to multiple recipients at once</source>
<translation>Send til flere enn en mottaker</translation>
</message>
<message>
<source>Add &Recipient</source>
<translation>Legg til &Mottaker</translation>
</message>
<message>
<source>Clear all fields of the form.</source>
<translation>Fjern alle felter fra skjemaet.</translation>
</message>
<message>
<source>Dust:</source>
<translation>Støv:</translation>
</message>
<message>
<source>Clear &All</source>
<translation>Fjern &Alt</translation>
</message>
<message>
<source>Balance:</source>
<translation>Saldo:</translation>
</message>
<message>
<source>Confirm the send action</source>
<translation>Bekreft sending</translation>
</message>
<message>
<source>S&end</source>
<translation>S&end</translation>
</message>
<message>
<source>Confirm send coins</source>
<translation>Bekreft sending av Testcoins</translation>
</message>
<message>
<source>%1 to %2</source>
<translation>%1 til %2</translation>
</message>
<message>
<source>Copy quantity</source>
<translation>Kopier mengde</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Kopier beløp</translation>
</message>
<message>
<source>Copy fee</source>
<translation>Kopier gebyr</translation>
</message>
<message>
<source>Copy after fee</source>
<translation>Kopier fra gebyr</translation>
</message>
<message>
<source>Copy bytes</source>
<translation>Kopier bytes</translation>
</message>
<message>
<source>Copy priority</source>
<translation>Kopier prioritet</translation>
</message>
<message>
<source>Copy change</source>
<translation>Kopier veksel</translation>
</message>
<message>
<source>Total Amount %1 (= %2)</source>
<translation>Totalt Beløp %1 (= %2)</translation>
</message>
<message>
<source>or</source>
<translation>eller</translation>
</message>
<message>
<source>The recipient address is not valid, please recheck.</source>
<translation>Adresse for mottaker er ugyldig.</translation>
</message>
<message>
<source>The amount to pay must be larger than 0.</source>
<translation>Beløpet som skal betales må være over 0.</translation>
</message>
<message>
<source>The amount exceeds your balance.</source>
<translation>Beløpet overstiger saldo.</translation>
</message>
<message>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Totalbeløpet overstiger saldo etter at %1 transaksjonsgebyr er lagt til.</translation>
</message>
<message>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Doble antall adresser funnet. Kan bare sende en gang til hver adresse per operasjon.</translation>
</message>
<message>
<source>Transaction creation failed!</source>
<translation>Opprettelse av transaksjon feilet!</translation>
</message>
<message>
<source>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>Transaksjonen ble avvist! Dette kan skje hvis noen av myntene i lommeboken allerede er brukt, som hvis du kopierte wallet.dat og mynter ble brukt i kopien uten å bli markert som brukt her.</translation>
</message>
<message>
<source>A fee higher than %1 is considered an insanely high fee.</source>
<translation>Et gebyr høyere enn %1 er ansett som et sinnsykt høyt gebyr.</translation>
</message>
<message>
<source>Pay only the minimum fee of %1</source>
<translation>Betal kun minimumsgebyret på %1</translation>
</message>
<message>
<source>Estimated to begin confirmation within %1 block(s).</source>
<translation>Beregner å begynne bekreftelse innen %1 blokk(er).</translation>
</message>
<message>
<source>Warning: Invalid Testcoin address</source>
<translation>Advarsel: Ugyldig Testcoin-adresse</translation>
</message>
<message>
<source>(no label)</source>
<translation>(ingen merkelapp)</translation>
</message>
<message>
<source>Warning: Unknown change address</source>
<translation>Advarsel: Ukjent adresse for veksel</translation>
</message>
<message>
<source>Copy dust</source>
<translation>Kopier støv</translation>
</message>
<message>
<source>Are you sure you want to send?</source>
<translation>Er du sikker på at du vil sende?</translation>
</message>
<message>
<source>added as transaction fee</source>
<translation>lagt til som transaksjonsgebyr</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<source>A&mount:</source>
<translation>&Beløp:</translation>
</message>
<message>
<source>Pay &To:</source>
<translation>Betal &Til:</translation>
</message>
<message>
<source>Enter a label for this address to add it to your address book</source>
<translation>Skriv inn en merkelapp for denne adressen for å legge den til i din adressebok</translation>
</message>
<message>
<source>&Label:</source>
<translation>&Merkelapp:</translation>
</message>
<message>
<source>Choose previously used address</source>
<translation>Velg tidligere brukt adresse</translation>
</message>
<message>
<source>This is a normal payment.</source>
<translation>Dette er en normal betaling.</translation>
</message>
<message>
<source>The Testcoin address to send the payment to</source>
<translation>Testcoin-adressen betalingen skal sendes til</translation>
</message>
<message>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<source>Paste address from clipboard</source>
<translation>Lim inn adresse fra utklippstavlen</translation>
</message>
<message>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<source>Remove this entry</source>
<translation>Fjern denne oppføringen</translation>
</message>
<message>
<source>Message:</source>
<translation>Melding:</translation>
</message>
<message>
<source>This is a verified payment request.</source>
<translation>Dette er en verifisert betalingsetterspørring</translation>
</message>
<message>
<source>Enter a label for this address to add it to the list of used addresses</source>
<translation>Skriv inn en merkelapp for denne adressen for å legge den til listen av brukte adresser</translation>
</message>
<message>
<source>A message that was attached to the Testcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Testcoin network.</source>
<translation>En melding som var tilknyttet Testcoinen: URI vil bli lagret med transaksjonen for din oversikt. Denne meldingen vil ikke bli sendt over Testcoin-nettverket.</translation>
</message>
<message>
<source>This is an unverified payment request.</source>
<translation>Dette er en uverifisert betalingsetterspørring</translation>
</message>
<message>
<source>Pay To:</source>
<translation>Betal Til:</translation>
</message>
<message>
<source>Memo:</source>
<translation>Memo:</translation>
</message>
</context>
<context>
<name>ShutdownWindow</name>
<message>
<source>Testcoin Core is shutting down...</source>
<translation>Testcoin Core lukker...</translation>
</message>
<message>
<source>Do not shut down the computer until this window disappears.</source>
<translation>Slå ikke av datamaskinen før dette vinduet forsvinner.</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<source>Signatures - Sign / Verify a Message</source>
<translation>Signaturer - Signer / Verifiser en Melding</translation>
</message>
<message>
<source>&Sign Message</source>
<translation>&Signer Melding</translation>
</message>
<message>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation>Du kan signere meldinger med dine adresser for å bevise at du eier dem. Ikke signer vage meldinger da phishing-angrep kan prøve å lure deg til å signere din identitet over til andre. Signer kun fullt detaljerte utsagn som du er enig i.</translation>
</message>
<message>
<source>The Testcoin address to sign the message with</source>
<translation>Testcoin-adressen meldingen skal signeres med</translation>
</message>
<message>
<source>Choose previously used address</source>
<translation>Velg tidligere brukt adresse</translation>
</message>
<message>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<source>Paste address from clipboard</source>
<translation>Lim inn adresse fra utklippstavlen</translation>
</message>
<message>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<source>Enter the message you want to sign here</source>
<translation>Skriv inn meldingen du vil signere her</translation>
</message>
<message>
<source>Signature</source>
<translation>Signatur</translation>
</message>
<message>
<source>Copy the current signature to the system clipboard</source>
<translation>Kopier valgt signatur til utklippstavle</translation>
</message>
<message>
<source>Sign the message to prove you own this Testcoin address</source>
<translation>Signer meldingen for å bevise at du eier denne Testcoin-adressen</translation>
</message>
<message>
<source>Sign &Message</source>
<translation>Signer &Melding</translation>
</message>
<message>
<source>Reset all sign message fields</source>
<translation>Tilbakestill alle felter for meldingssignering</translation>
</message>
<message>
<source>Clear &All</source>
<translation>Fjern &Alt</translation>
</message>
<message>
<source>&Verify Message</source>
<translation>&Verifiser Melding</translation>
</message>
<message>
<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>Angi adresse for signering, melding (vær sikker på at du kopierer linjeskift, mellomrom, tab, etc. helt nøyaktig) og signatur under for å verifisere meldingen. Vær forsiktig med at du ikke gir signaturen mer betydning enn det som faktisk står i meldingen, for å unngå å bli lurt av såkalte "man-in-the-middle" angrep.</translation>
</message>
<message>
<source>The Testcoin address the message was signed with</source>
<translation>Testcoin-adressen meldingen ble signert med</translation>
</message>
<message>
<source>Verify the message to ensure it was signed with the specified Testcoin address</source>
<translation>Verifiser meldingen for å være sikker på at den ble signert av den angitte Testcoin-adressen</translation>
</message>
<message>
<source>Verify &Message</source>
<translation>Verifiser &Melding</translation>
</message>
<message>
<source>Reset all verify message fields</source>
<translation>Tilbakestill alle felter for meldingsverifikasjon</translation>
</message>
<message>
<source>Click "Sign Message" to generate signature</source>
<translation>Klikk "Signer Melding" for å generere signatur</translation>
</message>
<message>
<source>The entered address is invalid.</source>
<translation>Angitt adresse er ugyldig.</translation>
</message>
<message>
<source>Please check the address and try again.</source>
<translation>Vennligst sjekk adressen og prøv igjen.</translation>
</message>
<message>
<source>The entered address does not refer to a key.</source>
<translation>Angitt adresse refererer ikke til en nøkkel.</translation>
</message>
<message>
<source>Wallet unlock was cancelled.</source>
<translation>Opplåsing av lommebok ble avbrutt.</translation>
</message>
<message>
<source>Private key for the entered address is not available.</source>
<translation>Privat nøkkel for den angitte adressen er ikke tilgjengelig.</translation>
</message>
<message>
<source>Message signing failed.</source>
<translation>Signering av melding feilet.</translation>
</message>
<message>
<source>Message signed.</source>
<translation>Melding signert.</translation>
</message>
<message>
<source>The signature could not be decoded.</source>
<translation>Signaturen kunne ikke dekodes.</translation>
</message>
<message>
<source>Please check the signature and try again.</source>
<translation>Vennligst sjekk signaturen og prøv igjen.</translation>
</message>
<message>
<source>The signature did not match the message digest.</source>
<translation>Signaturen passer ikke til meldingen.</translation>
</message>
<message>
<source>Message verification failed.</source>
<translation>Verifikasjon av melding feilet.</translation>
</message>
<message>
<source>Message verified.</source>
<translation>Melding verifisert.</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<source>Testcoin Core</source>
<translation>Testcoin Core</translation>
</message>
<message>
<source>The Testcoin Core developers</source>
<translation>Testcoin Core utviklerne</translation>
</message>
<message>
<source>[testnet]</source>
<translation>[testnett]</translation>
</message>
</context>
<context>
<name>TrafficGraphWidget</name>
<message>
<source>KB/s</source>
<translation>KB/s</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<source>Open until %1</source>
<translation>Åpen til %1</translation>
</message>
<message>
<source>conflicted</source>
<translation>konflikt</translation>
</message>
<message>
<source>%1/offline</source>
<translation>%1/frakoblet</translation>
</message>
<message>
<source>%1/unconfirmed</source>
<translation>%1/ubekreftet</translation>
</message>
<message>
<source>%1 confirmations</source>
<translation>%1 bekreftelser</translation>
</message>
<message>
<source>Status</source>
<translation>Status</translation>
</message>
<message numerus="yes">
<source>, broadcast through %n node(s)</source>
<translation><numerusform>, kringkast gjennom %n node</numerusform><numerusform>, kringkast gjennom %n noder</numerusform></translation>
</message>
<message>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<source>Source</source>
<translation>Kilde</translation>
</message>
<message>
<source>Generated</source>
<translation>Generert</translation>
</message>
<message>
<source>From</source>
<translation>Fra</translation>
</message>
<message>
<source>To</source>
<translation>Til</translation>
</message>
<message>
<source>own address</source>
<translation>egen adresse</translation>
</message>
<message>
<source>watch-only</source>
<translation>kun observerbar</translation>
</message>
<message>
<source>label</source>
<translation>merkelapp</translation>
</message>
<message>
<source>Credit</source>
<translation>Kredit</translation>
</message>
<message numerus="yes">
<source>matures in %n more block(s)</source>
<translation><numerusform>blir moden om %n blokk</numerusform><numerusform>blir moden om %n blokker</numerusform></translation>
</message>
<message>
<source>not accepted</source>
<translation>ikke akseptert</translation>
</message>
<message>
<source>Debit</source>
<translation>Debet</translation>
</message>
<message>
<source>Total debit</source>
<translation>Total debet</translation>
</message>
<message>
<source>Total credit</source>
<translation>Total kredit</translation>
</message>
<message>
<source>Transaction fee</source>
<translation>Transaksjonsgebyr</translation>
</message>
<message>
<source>Net amount</source>
<translation>Nettobeløp</translation>
</message>
<message>
<source>Message</source>
<translation>Melding</translation>
</message>
<message>
<source>Comment</source>
<translation>Kommentar</translation>
</message>
<message>
<source>Transaction ID</source>
<translation>Transaksjons-ID</translation>
</message>
<message>
<source>Merchant</source>
<translation>Forhandler</translation>
</message>
<message>
<source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>Genererte Testcoins må modnes %1 blokker før de kan brukes. Da du genererte denne blokken ble den kringkastet på nettverket for å bli lagt til i kjeden av blokker. Hvis den ikke kommer med i kjeden vil den endre seg til "ikke akseptert" og pengene vil ikke kunne brukes. Dette vil noen ganger skje hvis en annen node genererer en blokk noen sekunder i tid fra din egen.</translation>
</message>
<message>
<source>Debug information</source>
<translation>Informasjon for feilsøk</translation>
</message>
<message>
<source>Transaction</source>
<translation>Transaksjon</translation>
</message>
<message>
<source>Inputs</source>
<translation>Inndata</translation>
</message>
<message>
<source>Amount</source>
<translation>Beløp</translation>
</message>
<message>
<source>true</source>
<translation>sann</translation>
</message>
<message>
<source>false</source>
<translation>usann</translation>
</message>
<message>
<source>, has not been successfully broadcast yet</source>
<translation>, har ikke blitt kringkastet med hell enda</translation>
</message>
<message numerus="yes">
<source>Open for %n more block(s)</source>
<translation><numerusform>Åpen for %n blokk til</numerusform><numerusform>Åpen for %n blokker til</numerusform></translation>
</message>
<message>
<source>unknown</source>
<translation>ukjent</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<source>Transaction details</source>
<translation>Transaksjonsdetaljer</translation>
</message>
<message>
<source>This pane shows a detailed description of the transaction</source>
<translation>Her vises en detaljert beskrivelse av transaksjonen</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<source>Type</source>
<translation>Type</translation>
</message>
<message>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation>Umoden (%1 bekreftelser, vil være tilgjengelig etter %2)</translation>
</message>
<message numerus="yes">
<source>Open for %n more block(s)</source>
<translation><numerusform>Åpen for %n blokk til</numerusform><numerusform>Åpen for %n blokker til</numerusform></translation>
</message>
<message>
<source>Open until %1</source>
<translation>Åpen til %1</translation>
</message>
<message>
<source>Confirmed (%1 confirmations)</source>
<translation>Bekreftet (%1 bekreftelser)</translation>
</message>
<message>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Denne blokken har ikke blitt mottatt av noen andre noder og vil sannsynligvis ikke bli akseptert!</translation>
</message>
<message>
<source>Generated but not accepted</source>
<translation>Generert men ikke akseptert</translation>
</message>
<message>
<source>Offline</source>
<translation>Frakoblet</translation>
</message>
<message>
<source>Unconfirmed</source>
<translation>Ubekreftet</translation>
</message>
<message>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation>Bekrefter (%1 av %2 anbefalte bekreftelser)</translation>
</message>
<message>
<source>Conflicted</source>
<translation>Konflikt</translation>
</message>
<message>
<source>Received with</source>
<translation>Mottatt med</translation>
</message>
<message>
<source>Received from</source>
<translation>Mottatt fra</translation>
</message>
<message>
<source>Sent to</source>
<translation>Sendt til</translation>
</message>
<message>
<source>Payment to yourself</source>
<translation>Betaling til deg selv</translation>
</message>
<message>
<source>Mined</source>
<translation>Utvunnet</translation>
</message>
<message>
<source>watch-only</source>
<translation>kun observerbar</translation>
</message>
<message>
<source>(n/a)</source>
<translation>-</translation>
</message>
<message>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Transaksjonsstatus. Hold muspekeren over dette feltet for å se antall bekreftelser.</translation>
</message>
<message>
<source>Date and time that the transaction was received.</source>
<translation>Dato og tid for da transaksjonen ble mottat.</translation>
</message>
<message>
<source>Type of transaction.</source>
<translation>Type transaksjon.</translation>
</message>
<message>
<source>Whether or not a watch-only address is involved in this transaction.</source>
<translation>Hvorvidt en kun observerbar adresse er involvert i denne transaksjonen.</translation>
</message>
<message>
<source>Destination address of transaction.</source>
<translation>Mottaksadresse for transaksjonen.</translation>
</message>
<message>
<source>Amount removed from or added to balance.</source>
<translation>Beløp fjernet eller lagt til saldo.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<source>All</source>
<translation>Alle</translation>
</message>
<message>
<source>Today</source>
<translation>I dag</translation>
</message>
<message>
<source>This week</source>
<translation>Denne uken</translation>
</message>
<message>
<source>This month</source>
<translation>Denne måneden</translation>
</message>
<message>
<source>Last month</source>
<translation>Forrige måned</translation>
</message>
<message>
<source>This year</source>
<translation>Dette året</translation>
</message>
<message>
<source>Range...</source>
<translation>Intervall...</translation>
</message>
<message>
<source>Received with</source>
<translation>Mottatt med</translation>
</message>
<message>
<source>Sent to</source>
<translation>Sendt til</translation>
</message>
<message>
<source>To yourself</source>
<translation>Til deg selv</translation>
</message>
<message>
<source>Mined</source>
<translation>Utvunnet</translation>
</message>
<message>
<source>Other</source>
<translation>Andre</translation>
</message>
<message>
<source>Enter address or label to search</source>
<translation>Skriv inn adresse eller merkelapp for søk</translation>
</message>
<message>
<source>Min amount</source>
<translation>Minimumsbeløp</translation>
</message>
<message>
<source>Copy address</source>
<translation>Kopier adresse</translation>
</message>
<message>
<source>Copy label</source>
<translation>Kopier merkelapp</translation>
</message>
<message>
<source>Copy amount</source>
<translation>Kopier beløp</translation>
</message>
<message>
<source>Copy transaction ID</source>
<translation>Kopier transaksjons-ID</translation>
</message>
<message>
<source>Edit label</source>
<translation>Rediger merkelapp</translation>
</message>
<message>
<source>Show transaction details</source>
<translation>Vis transaksjonsdetaljer</translation>
</message>
<message>
<source>Export Transaction History</source>
<translation>Eksporter Transaksjonshistorikk</translation>
</message>
<message>
<source>Watch-only</source>
<translation>Kun observer</translation>
</message>
<message>
<source>Exporting Failed</source>
<translation>Ekport Feilet</translation>
</message>
<message>
<source>There was an error trying to save the transaction history to %1.</source>
<translation>En feil oppstod ved lagring av transaksjonshistorikken til %1.</translation>
</message>
<message>
<source>Exporting Successful</source>
<translation>Ekport Fullført</translation>
</message>
<message>
<source>The transaction history was successfully saved to %1.</source>
<translation>Transaksjonshistorikken ble lagret til %1.</translation>
</message>
<message>
<source>Comma separated file (*.csv)</source>
<translation>Kommaseparert fil (*.csv)</translation>
</message>
<message>
<source>Confirmed</source>
<translation>Bekreftet</translation>
</message>
<message>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<source>Type</source>
<translation>Type</translation>
</message>
<message>
<source>Label</source>
<translation>Merkelapp</translation>
</message>
<message>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<source>Range:</source>
<translation>Intervall:</translation>
</message>
<message>
<source>to</source>
<translation>til</translation>
</message>
</context>
<context>
<name>UnitDisplayStatusBarControl</name>
<message>
<source>Unit to show amounts in. Click to select another unit.</source>
<translation>Enhet å vise beløper i. Klikk for å velge en annen enhet.</translation>
</message>
</context>
<context>
<name>WalletFrame</name>
<message>
<source>No wallet has been loaded.</source>
<translation>Ingen lommebok har blitt lastet.</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<source>Send Coins</source>
<translation>Send Testcoins</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<source>&Export</source>
<translation>&Eksporter</translation>
</message>
<message>
<source>Export the data in the current tab to a file</source>
<translation>Eksporter data fra nåværende fane til fil</translation>
</message>
<message>
<source>Backup Wallet</source>
<translation>Sikkerhetskopier Lommebok</translation>
</message>
<message>
<source>Wallet Data (*.dat)</source>
<translation>Lommebokdata (*.dat)</translation>
</message>
<message>
<source>Backup Failed</source>
<translation>Sikkerhetskopiering Feilet</translation>
</message>
<message>
<source>There was an error trying to save the wallet data to %1.</source>
<translation>En feil oppstod ved lagring av lommebok til %1.</translation>
</message>
<message>
<source>The wallet data was successfully saved to %1.</source>
<translation>Lommeboken ble lagret til %1.</translation>
</message>
<message>
<source>Backup Successful</source>
<translation>Sikkerhetskopiering Fullført</translation>
</message>
</context>
<context>
<name>Testcoin-core</name>
<message>
<source>Options:</source>
<translation>Innstillinger:</translation>
</message>
<message>
<source>Specify data directory</source>
<translation>Angi mappe for datafiler</translation>
</message>
<message>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Koble til node for å hente adresser til andre noder, koble så fra igjen</translation>
</message>
<message>
<source>Specify your own public address</source>
<translation>Angi din egen offentlige adresse</translation>
</message>
<message>
<source>Accept command line and JSON-RPC commands</source>
<translation>Ta imot kommandolinje- og JSON-RPC-kommandoer</translation>
</message>
<message>
<source>Run in the background as a daemon and accept commands</source>
<translation>Kjør i bakgrunnen som daemon og ta imot kommandoer</translation>
</message>
<message>
<source>Use the test network</source>
<translation>Bruk testnettverket</translation>
</message>
<message>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Ta imot tilkoblinger fra utsiden (standardverdi: 1 hvis uten -proxy eller -connect)</translation>
</message>
<message>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=Testcoinrpc
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 "Testcoin Alert" [email protected]
</source>
<translation>%s, du må angi rpcpassord i konfigurasjonsfilen.
%s
Det anbefales at du bruker det følgende tilfeldige passordet:
rpcbruker=Testcoinrpc
rpcpassord=%s
(du behøver ikke å huske passordet)
Brukernavnet og passordet MÅ IKKE være like.
Om filen ikke eksisterer, opprett den nå med eier-kun-les filrettigheter.
Det er også anbefalt at å sette varselsmelding slik du får melding om problemer.
For eksempel: varselmelding=echo %%s | mail -s "Testcoin Varsel" [email protected]</translation>
</message>
<message>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation>Bind til angitt adresse. Bruk [vertsmaskin]:port notasjon for IPv6</translation>
</message>
<message>
<source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>
<translation>Slett alle transaksjoner i lommeboken og gjenopprett kun de delene av blokkjeden gjennom -rescan ved oppstart</translation>
</message>
<message>
<source>Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>.</source>
<translation>Distribuert under MIT programvarelisensen, se medfølgende fil COPYING eller <http://www.opensource.org/licenses/mit-license.php>.</translation>
</message>
<message>
<source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly.</source>
<translation>Gå til modus for regresjonstesting, som bruker en spesiell blokkjede der blokker kan bli løst momentant.</translation>
</message>
<message>
<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>Feil: Transaksjonen ble avvist! Dette kan skje hvis noen av myntene i lommeboken allerede er blitt brukt, som om du brukte en kopi av wallet.dat og myntene ble brukt i kopien, men ikke markert som brukt her.</translation>
</message>
<message>
<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>Feil: Denne transaksjonen trenger et gebyr på minst %s på grunn av beløpet, kompleksiteten eller bruk av allerede mottatte penger!</translation>
</message>
<message>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>Kjør kommando når en lommeboktransaksjon endres (%s i kommando er erstattet med TxID)</translation>
</message>
<message>
<source>In this mode -genproclimit controls how many blocks are generated immediately.</source>
<translation>I denne modusen kontrollerer -genproclimit hvor mange blokker som genereres øyeblikkelig.</translation>
</message>
<message>
<source>Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)</source>
<translation>Angi antall tråder for skriptverifisering (%u til %d, 0 = auto, <0 = la det antallet kjerner være ledig, standard: %d)</translation>
</message>
<message>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation>Dette er en forhåndssluppet testversjon - bruk på egen risiko - ikke for bruk til blokkutvinning eller bedriftsapplikasjoner</translation>
</message>
<message>
<source>Unable to bind to %s on this computer. Testcoin Core is probably already running.</source>
<translation>Ute av stand til å binde til %s på denne datamaskinen. Testcoin Core kjører sannsynligvis allerede.</translation>
</message>
<message>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Advarsel: -paytxfee er satt veldig høyt! Dette er transaksjonsgebyret du betaler når du sender transaksjoner.</translation>
</message>
<message>
<source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>
<translation>Advarsel: Nettverket ser ikke ut til å være enig! Noen minere ser ut til å ha problemer.</translation>
</message>
<message>
<source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation>Advarsel: Vi ser ikke ut til å være enige med våre noder! Du må oppgradere, eller andre noder må oppgradere.</translation>
</message>
<message>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation>Advarsel: Feil ved lesing av wallet.dat! Alle nøkler lest riktig, men transaksjonsdataene eller oppføringer i adresseboken mangler kanskje eller er feil.</translation>
</message>
<message>
<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>Advarsel: wallet.dat korrupt, data reddet! Original wallet.dat lagret som wallet.{timestamp}.bak i %s; hvis din saldo eller dine transaksjoner ikke er korrekte bør du gjenopprette fra en backup.</translation>
</message>
<message>
<source>Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times.</source>
<translation>Hvitelist noder som kobler til fra den oppgitte nettmasken eller IP-adressen. Kan oppgis flere ganger.</translation>
</message>
<message>
<source>(default: 1)</source>
<translation>(standardverdi: 1)</translation>
</message>
<message>
<source><category> can be:</source>
<translation><category> kan være:</translation>
</message>
<message>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation>Forsøk å berge private nøkler fra en korrupt wallet.dat</translation>
</message>
<message>
<source>Block creation options:</source>
<translation>Valg for opprettelse av blokker:</translation>
</message>
<message>
<source>Connect only to the specified node(s)</source>
<translation>Koble kun til angitt(e) node(r)</translation>
</message>
<message>
<source>Connection options:</source>
<translation>Innstillinger for tilkobling:</translation>
</message>
<message>
<source>Corrupted block database detected</source>
<translation>Oppdaget korrupt blokkdatabase</translation>
</message>
<message>
<source>Debugging/Testing options:</source>
<translation>Valg for feilsøking/testing:</translation>
</message>
<message>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>Oppdag egen IP-adresse (standardverdi: 1 ved lytting og uten -externalip)</translation>
</message>
<message>
<source>Do not load the wallet and disable wallet RPC calls</source>
<translation>Ikke last inn lommeboken og deaktiver RPC-kall</translation>
</message>
<message>
<source>Do you want to rebuild the block database now?</source>
<translation>Ønsker du å gjenopprette blokkdatabasen nå?</translation>
</message>
<message>
<source>Error initializing block database</source>
<translation>Feil under initialisering av blokkdatabase</translation>
</message>
<message>
<source>Error initializing wallet database environment %s!</source>
<translation>Feil under oppstart av lommeboken sitt databasemiljø %s!</translation>
</message>
<message>
<source>Error loading block database</source>
<translation>Feil ved lasting av blokkdatabase</translation>
</message>
<message>
<source>Error opening block database</source>
<translation>Feil under åpning av blokkdatabase</translation>
</message>
<message>
<source>Error: A fatal internal error occured, see debug.log for details</source>
<translation>Feil: En fatal intern feil oppstod, se debug.log for detaljer</translation>
</message>
<message>
<source>Error: Disk space is low!</source>
<translation>Feil: Lite ledig lagringsplass!</translation>
</message>
<message>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation>Feil: Lommebok låst, kan ikke opprette transaksjon!</translation>
</message>
<message>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>Kunne ikke lytte på noen port. Bruk -listen=0 hvis det er dette du vil.</translation>
</message>
<message>
<source>If <category> is not supplied, output all debugging information.</source>
<translation>Hvis <category> ikke er oppgitt, ta ut all informasjon om feilsøking.</translation>
</message>
<message>
<source>Importing...</source>
<translation>Importerer...</translation>
</message>
<message>
<source>Incorrect or no genesis block found. Wrong datadir for network?</source>
<translation>Ugyldig eller ingen skaperblokk funnet. Feil datamappe for nettverk?</translation>
</message>
<message>
<source>Invalid -onion address: '%s'</source>
<translation>Ugyldig -onion adresse: '%s'</translation>
</message>
<message>
<source>Not enough file descriptors available.</source>
<translation>For få fildeskriptorer tilgjengelig.</translation>
</message>
<message>
<source>Only connect to nodes in network <net> (ipv4, ipv6 or onion)</source>
<translation>Bare koble til noder i nettverket <net> (IPv4, IPv6 eller onion)</translation>
</message>
<message>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation>Gjenopprett blokkjedeindeks fra blk000??.dat filer</translation>
</message>
<message>
<source>Set database cache size in megabytes (%d to %d, default: %d)</source>
<translation>Sett databasen sin størrelse på hurtigbufferen i megabytes (%d til %d, standardverdi: %d)</translation>
</message>
<message>
<source>Set maximum block size in bytes (default: %d)</source>
<translation>Sett maks blokkstørrelse i bytes (standardverdi: %d)</translation>
</message>
<message>
<source>Specify wallet file (within data directory)</source>
<translation>Angi lommebokfil (inne i datamappe)</translation>
</message>
<message>
<source>This is intended for regression testing tools and app development.</source>
<translation>Dette er tiltenkt verktøy for regresjonstesting og apputvikling.</translation>
</message>
<message>
<source>Use UPnP to map the listening port (default: %u)</source>
<translation>Bruk UPnP for å sette opp lytteport (standardverdi: %u)</translation>
</message>
<message>
<source>Verifying blocks...</source>
<translation>Verifiserer blokker...</translation>
</message>
<message>
<source>Verifying wallet...</source>
<translation>Verifiserer lommebok...</translation>
</message>
<message>
<source>Wallet %s resides outside data directory %s</source>
<translation>Lommebok %s befinner seg utenfor datamappe %s</translation>
</message>
<message>
<source>Wallet options:</source>
<translation>Valg for lommebok:</translation>
</message>
<message>
<source>You need to rebuild the database using -reindex to change -txindex</source>
<translation>Du må gjenoppbygge databasen med å bruke -reindex for å endre -txindex</translation>
</message>
<message>
<source>Imports blocks from external blk000??.dat file</source>
<translation>Importerer blokker fra ekstern fil blk000??.dat</translation>
</message>
<message>
<source>Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>
<translation>Tillat JSON-RPC-tilkoblinger fra angitt kilde. Gyldig for <ip> er en enkelt IP (f. eks. 1.2.3.4), et nettverk/nettmaske (f. eks. 1.2.3.4/255.255.255.0) eller et nettverk/CIDR (f. eks. 1.2.3.4/24). Dette alternativet kan angis flere ganger</translation>
</message>
<message>
<source>An error occurred while setting up the RPC address %s port %u for listening: %s</source>
<translation>En feil oppstod under oppsett av RPC-adressen %s port %u for lytting: %s</translation>
</message>
<message>
<source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>
<translation>Bind til gitt adresse og hvitlist peers som kobler seg til den. Bruk [host]:port notasjon for IPv6</translation>
</message>
<message>
<source>Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)</source>
<translation>Bind til gitt adresse for å lytte for JSON-RPC-tilkoblinger. Bruk [host]:port notasjon for IPv6. Dette alternativet kan angis flere ganger (standardverdi: bind til alle grensesnitt)</translation>
</message>
<message>
<source>Cannot obtain a lock on data directory %s. Testcoin Core is probably already running.</source>
<translation>Ute av stand til å låse datamappen %s. Testcoin Core kjører sannsynligvis allerede.</translation>
</message>
<message>
<source>Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u)</source>
<translation>Ratebegrens gratistransaksjoner kontinuerlig til <n>*1000 bytes per minutt (standardverdi: %u)</translation>
</message>
<message>
<source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>
<translation>Opprett nye filer med standardtillatelser i systemet, i stedet for umask 077 (kun virksom med lommebokfunksjonalitet slått av)</translation>
</message>
<message>
<source>Error: Listening for incoming connections failed (listen returned error %s)</source>
<translation>Feil: Lytting etter innkommende tilkoblinger feilet (lytting returnerte feil %s)</translation>
</message>
<message>
<source>Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>
<translation>Feil: Argumentet -socks er ikke støttet. Det er ikke lenger mulig å sette SOCKS-versjon; bare SOCKS5-proxyer er støttet.</translation>
</message>
<message>
<source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>
<translation>Utfør kommando når et relevant varsel er mottatt eller vi ser en veldig lang gaffel (%s i kommando er erstattet med melding)</translation>
</message>
<message>
<source>Fees (in tst/Kb) smaller than this are considered zero fee for relaying (default: %s)</source>
<translation>Gebyrer (i tst/Kb) mindre enn dette anses som null gebyr for videresending (standardverdi: %s)</translation>
</message>
<message>
<source>Fees (in tst/Kb) smaller than this are considered zero fee for transaction creation (default: %s)</source>
<translation>Gebyrer (i tst/Kb) mindre enn dette anses som null gebyr for laging av transaksjoner (standardverdi: %s)</translation>
</message>
<message>
<source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>
<translation>Maksimal størrelse på data i databærende transaksjoner vi videresender og ufører graving på (standardverdi: %u)</translation>
</message>
<message>
<source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)</source>
<translation>Søk etter nodeadresser via DNS-oppslag, hvis vi har få adresser å koble til (standard: 1 med mindre -connect)</translation>
</message>
<message>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: %d)</source>
<translation>Sett maksimum størrelse for transaksjoner med høy prioritet / lavt gebyr, i bytes (standardverdi: %d)</translation>
</message>
<message>
<source>Set the number of threads for coin generation if enabled (-1 = all cores, default: %d)</source>
<translation>Angi antall tråder for mynt generering hvis aktivert (-1 = alle kjerner, standardverdi: %d)</translation>
</message>
<message>
<source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>
<translation>Dette produktet inneholder programvare utviklet av OpenSSL Project for bruk i OpenSSL Toolkit <https://www.openssl.org/> og kryptografisk programvare skrevet av Eric Young og UPnP-programvare skrevet av Thomas Bernard.</translation>
</message>
<message>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Testcoin Core will not work properly.</source>
<translation>Advarsel: Vennligst undersøk at din datamaskin har riktig dato og klokkeslett! Hvis klokken er stilt feil vil ikke Testcoin Core fungere riktig.</translation>
</message>
<message>
<source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>
<translation>Hvitlistede noder kan ikke DoS-blokkeres, og deres transaksjoner videresendes alltid, selv om de allerede er i minnelageret. Nyttig f.eks. for en gateway.</translation>
</message>
<message>
<source>Cannot resolve -whitebind address: '%s'</source>
<translation>Kan ikke løse -whitebind-adresse: '%s'</translation>
</message>
<message>
<source>Connect through SOCKS5 proxy</source>
<translation>Koble til via SOCKS5-proxy</translation>
</message>
<message>
<source>Copyright (C) 2009-%i The Testcoin Core Developers</source>
<translation>Copyright (C) 2009-%i utviklerne av Testcoin Core</translation>
</message>
<message>
<source>Could not parse -rpcbind value %s as network address</source>
<translation>Kunne ikke tolke -rpcbind-verdi %s som en nettverksadresse</translation>
</message>
<message>
<source>Error loading wallet.dat: Wallet requires newer version of Testcoin Core</source>
<translation>Feil ved lasting av wallet.dat: Lommeboken krever en nyere versjon av Testcoin Core</translation>
</message>
<message>
<source>Error: Unsupported argument -tor found, use -onion.</source>
<translation>Feil: Argumentet -tor er ikke støttet, bruk -onion.</translation>
</message>
<message>
<source>Fee (in tst/kB) to add to transactions you send (default: %s)</source>
<translation>Gebyr (i tst/kB) for å legge til i transaksjoner du sender (standardverdi: %s)</translation>
</message>
<message>
<source>Information</source>
<translation>Informasjon</translation>
</message>
<message>
<source>Initialization sanity check failed. Testcoin Core is shutting down.</source>
<translation>Sunnhetssjekk ved oppstart feilet. Testcoin Core stenges ned.</translation>
</message>
<message>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation>Ugyldig mengde for -minrelaytxfee=<beløp>: '%s'</translation>
</message>
<message>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation>Ugyldig mengde for -mintxfee=<beløp>: '%s'</translation>
</message>
<message>
<source>Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s)</source>
<translation>Ugyldig beløp for -paytxfee=<amount>: '%s' (må være minst %s)</translation>
</message>
<message>
<source>Invalid netmask specified in -whitelist: '%s'</source>
<translation>Ugyldig nettmaske spesifisert i -whitelist: '%s'</translation>
</message>
<message>
<source>Keep at most <n> unconnectable blocks in memory (default: %u)</source>
<translation>Behold på det meste <n> blokker i minnet som ikke er mulig å koble (standardverdi: %u)</translation>
</message>
<message>
<source>Keep at most <n> unconnectable transactions in memory (default: %u)</source>
<translation>Hold på det meste <n> transaksjoner som ikke kobles i minnet (standardverdi: %u)</translation>
</message>
<message>
<source>Need to specify a port with -whitebind: '%s'</source>
<translation>Må oppgi en port med -whitebind: '%s'</translation>
</message>
<message>
<source>Node relay options:</source>
<translation>Node alternativer for videresending:</translation>
</message>
<message>
<source>Print block on startup, if found in block index</source>
<translation>Skriv ut blokken ved oppstart, hvis funnet i blokkindeksen</translation>
</message>
<message>
<source>RPC SSL options: (see the Testcoin Wiki for SSL setup instructions)</source>
<translation>RPC SSL-valg: (se Testcoin Wiki for oppsettsinstruksjoner for SSL)</translation>
</message>
<message>
<source>RPC server options:</source>
<translation>Innstillinger for RPC-server:</translation>
</message>
<message>
<source>Randomly drop 1 of every <n> network messages</source>
<translation>Slumpvis dropp 1 av hver <n> nettverksmeldinger</translation>
</message>
<message>
<source>Randomly fuzz 1 of every <n> network messages</source>
<translation>Slumpvis bland 1 av hver <n> nettverksmeldinger</translation>
</message>
<message>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Send spor-/feilsøkingsinformasjon til konsollen istedenfor filen debug.log</translation>
</message>
<message>
<source>Send transactions as zero-fee transactions if possible (default: %u)</source>
<translation>Send transaksjoner uten transaksjonsgebyr hvis mulig (standardverdi: %u)</translation>
</message>
<message>
<source>Show all debugging options (usage: --help -help-debug)</source>
<translation>Vis alle feilsøkingsvalg (bruk: --help -help-debug)</translation>
</message>
<message>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>Krymp filen debug.log når klienten starter (standardverdi: 1 hvis uten -debug)</translation>
</message>
<message>
<source>Signing transaction failed</source>
<translation>Signering av transaksjon feilet</translation>
</message>
<message>
<source>This is experimental software.</source>
<translation>Dette er eksperimentell programvare.</translation>
</message>
<message>
<source>Transaction amount too small</source>
<translation>Transaksjonen er for liten</translation>
</message>
<message>
<source>Transaction amounts must be positive</source>
<translation>Transaksjonsbeløpet må være positivt</translation>
</message>
<message>
<source>Transaction too large</source>
<translation>Transaksjonen er for stor</translation>
</message>
<message>
<source>Unable to bind to %s on this computer (bind returned error %s)</source>
<translation>Kan ikke binde til %s på denne datamaskinen (binding returnerte feilen %s)</translation>
</message>
<message>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Bruk UPnP for lytteport (standardverdi: 1 ved lytting)</translation>
</message>
<message>
<source>Username for JSON-RPC connections</source>
<translation>Brukernavn for JSON-RPC forbindelser</translation>
</message>
<message>
<source>Wallet needed to be rewritten: restart Testcoin Core to complete</source>
<translation>Lommeboken måtte skrives på nytt: start Testcoin Core på nytt for å fullføre</translation>
</message>
<message>
<source>Warning</source>
<translation>Advarsel</translation>
</message>
<message>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>Advarsel: Denne versjonen er foreldet, oppgradering kreves!</translation>
</message>
<message>
<source>Warning: Unsupported argument -benchmark ignored, use -debug=bench.</source>
<translation>Advarsel: Argumentet -benchmark er ikke støttet og ble ignorert, bruk -debug=bench.</translation>
</message>
<message>
<source>Warning: Unsupported argument -debugnet ignored, use -debug=net.</source>
<translation>Advarsel: Argumentet -debugnet er ikke støttet og ble ignorert, bruk -debug=net.</translation>
</message>
<message>
<source>Zapping all transactions from wallet...</source>
<translation>Zapper alle transaksjoner fra lommeboken...</translation>
</message>
<message>
<source>on startup</source>
<translation>ved oppstart</translation>
</message>
<message>
<source>wallet.dat corrupt, salvage failed</source>
<translation>wallet.dat korrupt, bergning feilet</translation>
</message>
<message>
<source>Password for JSON-RPC connections</source>
<translation>Passord for JSON-RPC forbindelser</translation>
</message>
<message>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Utfør kommando når beste blokk endrer seg (%s i kommandoen erstattes med blokkens hash)</translation>
</message>
<message>
<source>Upgrade wallet to latest format</source>
<translation>Oppgrader lommebok til nyeste format</translation>
</message>
<message>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Se gjennom blokkjeden etter manglende lommeboktransaksjoner</translation>
</message>
<message>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Bruk OpenSSL (https) for JSON-RPC forbindelser</translation>
</message>
<message>
<source>This help message</source>
<translation>Denne hjelpemeldingen</translation>
</message>
<message>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Tillat oppslag i DNS for -addnode, -seednode og -connect</translation>
</message>
<message>
<source>Loading addresses...</source>
<translation>Laster adresser...</translation>
</message>
<message>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Feil ved lasting av wallet.dat: Lommeboken er skadet</translation>
</message>
<message>
<source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>
<translation>(1 = behold metadata for transaksjon som f. eks. kontoeier og informasjon om betalingsanmodning, 2 = dropp metadata for transaksjon)</translation>
</message>
<message>
<source>Flush database activity from memory pool to disk log every <n> megabytes (default: %u)</source>
<translation>Overfør aktiviteten i databasen fra minnelageret til loggen på harddisken for hver <n> megabytes (standardverdi: %u)</translation>
</message>
<message>
<source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>
<translation>Hvor grundig blokkverifiseringen til -checkblocks er (0-4, standardverdi: %u)</translation>
</message>
<message>
<source>If paytxfee is not set, include enough fee so transactions are confirmed on average within n blocks (default: %u)</source>
<translation>Hvis paytxfee ikke er angitt, inkluderer da nok gebyr til at transaksjoner gjennomsnittligt bekreftes innen n blokker (standardverdi: %u)</translation>
</message>
<message>
<source>Log transaction priority and fee per kB when mining blocks (default: %u)</source>
<translation>Logg transaksjonsprioritet og gebyr per kB under blokkutvinning (standardverdi: %u)</translation>
</message>
<message>
<source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>
<translation>Oppretthold en full transaksjonsindeks, brukt av getrawtransaction RPC-kall (standardverdi: %u)</translation>
</message>
<message>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>
<translation>Antall sekunder noder med dårlig oppførsel hindres fra å koble til på nytt (standardverdi: %u)</translation>
</message>
<message>
<source>Output debugging information (default: %u, supplying <category> is optional)</source>
<translation>Ta ut feilsøkingsinformasjon (standardverdi: %u, bruk av <category> er valgfritt)</translation>
</message>
<message>
<source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>
<translation>Bruk separate SOCKS5 proxyer for å nå noder via Tor skjulte tjenester (standardverdi: %s)</translation>
</message>
<message>
<source>(default: %s)</source>
<translation>(standardverdi: %s)</translation>
</message>
<message>
<source>Acceptable ciphers (default: %s)</source>
<translation>Akseptable sifre (standardverdi: %s)</translation>
</message>
<message>
<source>Always query for peer addresses via DNS lookup (default: %u)</source>
<translation>Alltid søk etter nodeadresser via DNS-oppslag (standardverdi: %u)</translation>
</message>
<message>
<source>Disable safemode, override a real safe mode event (default: %u)</source>
<translation>Slå av sikkerhetsmodus, overstyr en virkelig sikkerhetsmodushendelse (standardverdi: %u)</translation>
</message>
<message>
<source>Error loading wallet.dat</source>
<translation>Feil ved lasting av wallet.dat</translation>
</message>
<message>
<source>Force safe mode (default: %u)</source>
<translation>Tving sikkerhetsmodus (standardverdi: %u)</translation>
</message>
<message>
<source>Generate coins (default: %u)</source>
<translation>Generer mynter (standardverdi: %u)</translation>
</message>
<message>
<source>How many blocks to check at startup (default: %u, 0 = all)</source>
<translation>Hvor mange blokker skal sjekkes ved oppstart (standardverdi: %u, 0 = alle)</translation>
</message>
<message>
<source>Include IP addresses in debug output (default: %u)</source>
<translation>Inkludere IP-adresser i feilsøkingslogg (standardverdi: %u)</translation>
</message>
<message>
<source>Invalid -proxy address: '%s'</source>
<translation>Ugyldig -proxy adresse: '%s'</translation>
</message>
<message>
<source>Limit size of signature cache to <n> entries (default: %u)</source>
<translation>Begrens størrelsen på hurtigbufferen for signaturer til <n> oppføringer (standardverdi: %u)</translation>
</message>
<message>
<source>Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)</source>
<translation>Lytt etter JSON-RPC tilkoblinger på <port> (standardverdi: %u eller testnett: %u)</translation>
</message>
<message>
<source>Listen for connections on <port> (default: %u or testnet: %u)</source>
<translation>Lytt etter tilkoblinger på <port> (standardverdi: %u eller testnett: %u)</translation>
</message>
<message>
<source>Maintain at most <n> connections to peers (default: %u)</source>
<translation>Hold maks <n> koblinger åpne til andre noder (standardverdi: %u)</translation>
</message>
<message>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: %u)</source>
<translation>Maks mottaksbuffer per forbindelse, <n>*1000 bytes (standardverdi: %u)</translation>
</message>
<message>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: %u)</source>
<translation>Maks sendebuffer per forbindelse, <n>*1000 bytes (standardverdi: %u)</translation>
</message>
<message>
<source>Only accept block chain matching built-in checkpoints (default: %u)</source>
<translation>Aksepter kun blokkjeden som stemmer med innebygde sjekkpunkter (standardvalg: %u)</translation>
</message>
<message>
<source>Prepend debug output with timestamp (default: %u)</source>
<translation>Sett inn tidsstempel i front av feilsøkingsdata (standardverdi: %u)</translation>
</message>
<message>
<source>Print block tree on startup (default: %u)</source>
<translation>Skriv ut blokktreet ved oppstart (standardverdi: %u)</translation>
</message>
<message>
<source>Relay and mine data carrier transactions (default: %u)</source>
<translation>Videresend og ufør graving av databærende transaksjoner (standardverdi: %u)</translation>
</message>
<message>
<source>Relay non-P2SH multisig (default: %u)</source>
<translation>Videresend ikke-P2SH multisig (standardverdi: %u)</translation>
</message>
<message>
<source>Run a thread to flush wallet periodically (default: %u)</source>
<translation>Kjør en tråd som skriver lommeboken til disk periodisk (standardverdi: %u)</translation>
</message>
<message>
<source>Server certificate file (default: %s)</source>
<translation>Fil for tjenersertifikat (standardverdi: %s)</translation>
</message>
<message>
<source>Server private key (default: %s)</source>
<translation>Privat nøkkel for tjener (standardverdi: %s) </translation>
</message>
<message>
<source>Set key pool size to <n> (default: %u)</source>
<translation>Angi størrelse på nøkkel-lager til <n> (standardverdi: %u)</translation>
</message>
<message>
<source>Set minimum block size in bytes (default: %u)</source>
<translation>Sett minimum blokkstørrelse i bytes (standardverdi: %u)</translation>
</message>
<message>
<source>Set the number of threads to service RPC calls (default: %d)</source>
<translation>Sett antall tråder til betjening av RPC-kall (standardverdi: %d)</translation>
</message>
<message>
<source>Sets the DB_PRIVATE flag in the wallet db environment (default: %u)</source>
<translation>Setter flagget DB_PRIVATE i miljøet til lommebokdatabasen (standardverdi: %u)</translation>
</message>
<message>
<source>Specify configuration file (default: %s)</source>
<translation>Angi konfigurasjonsfil (standardverdi: %s)</translation>
</message>
<message>
<source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>
<translation>Angi tidsavbrudd for forbindelse i millisekunder (minimum: 1, standardverdi: %d)</translation>
</message>
<message>
<source>Specify pid file (default: %s)</source>
<translation>Angi pid-fil (standardverdi: %s)</translation>
</message>
<message>
<source>Spend unconfirmed change when sending transactions (default: %u)</source>
<translation>Bruk ubekreftet veksel ved sending av transaksjoner (standardverdi: %u)</translation>
</message>
<message>
<source>Stop running after importing blocks from disk (default: %u)</source>
<translation>Avslutt etter import av blokker fra disk (standardverdi: %u)</translation>
</message>
<message>
<source>Threshold for disconnecting misbehaving peers (default: %u)</source>
<translation>Grenseverdi for å koble fra noder med dårlig oppførsel (standardverdi: %u)</translation>
</message>
<message>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Ukjent nettverk angitt i -onlynet '%s'</translation>
</message>
<message>
<source>Cannot resolve -bind address: '%s'</source>
<translation>Kunne ikke slå opp -bind adresse: '%s'</translation>
</message>
<message>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>Kunne ikke slå opp -externalip adresse: '%s'</translation>
</message>
<message>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Ugyldig beløp for -paytxfee=<beløp>: '%s'</translation>
</message>
<message>
<source>Invalid amount</source>
<translation>Ugyldig beløp</translation>
</message>
<message>
<source>Insufficient funds</source>
<translation>Utilstrekkelige midler</translation>
</message>
<message>
<source>Loading block index...</source>
<translation>Laster blokkindeks...</translation>
</message>
<message>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Legg til node for tilkobling og hold forbindelsen åpen</translation>
</message>
<message>
<source>Loading wallet...</source>
<translation>Laster lommebok...</translation>
</message>
<message>
<source>Cannot downgrade wallet</source>
<translation>Kan ikke nedgradere lommebok</translation>
</message>
<message>
<source>Cannot write default address</source>
<translation>Kan ikke skrive standardadresse</translation>
</message>
<message>
<source>Rescanning...</source>
<translation>Leser gjennom...</translation>
</message>
<message>
<source>Done loading</source>
<translation>Ferdig med lasting</translation>
</message>
<message>
<source>To use the %s option</source>
<translation>For å bruke %s opsjonen</translation>
</message>
<message>
<source>Error</source>
<translation>Feil</translation>
</message>
</context>
</TS> | mit |
jballe/Kragefolket.Website | src/web/wp-content/themes/radiate/content-single.php | 1911 | <?php
/**
* The template used for displaying page content in single.php
*
* @package ThemeGrill
* @subpackage Radiate
* @since Radiate 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'radiate' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
<div class="entry-meta">
<?php radiate_posted_on(); ?>
</div><!-- .entry-meta -->
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'radiate' ) );
if ( $categories_list && radiate_categorized_blog() ) :
?>
<span class="cat-links">
<?php echo $categories_list; ?>
</span>
<?php endif; // End if categories ?>
<?php
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', 'radiate' ) );
if ( $tags_list ) :
?>
<span class="tags-links">
<?php echo $tags_list; ?>
</span>
<?php endif; // End if $tags_list ?>
<?php endif; // End if 'post' == get_post_type() ?>
<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'radiate' ), __( '1 Comment', 'radiate' ), __( '% Comments', 'radiate' ) ); ?></span>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', 'radiate' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post-## -->
| mit |
HenryLoenwind/AgriCraft | src/main/java/com/InfinityRaider/AgriCraft/compatibility/natura/NaturaHelper.java | 3030 | package com.InfinityRaider.AgriCraft.compatibility.natura;
import com.InfinityRaider.AgriCraft.blocks.BlockCrop;
import com.InfinityRaider.AgriCraft.compatibility.ModHelper;
import com.InfinityRaider.AgriCraft.farming.CropPlantHandler;
import com.InfinityRaider.AgriCraft.handler.ConfigurationHandler;
import com.InfinityRaider.AgriCraft.reference.Names;
import com.InfinityRaider.AgriCraft.tileentity.TileEntityCrop;
import net.minecraft.block.Block;
import net.minecraft.block.IGrowable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
import java.util.List;
public final class NaturaHelper extends ModHelper {
@Override
protected void init() {
try {
Class naturaContent = Class.forName("mods.natura.common.NContent");
Item seed = (Item) naturaContent.getField("seeds").get(null);
OreDictionary.registerOre(Names.OreDict.listAllseed, seed);
} catch (Exception e) {
if(ConfigurationHandler.debug) {
e.printStackTrace();
}
}
}
@Override
protected void initPlants() {
try {
CropPlantHandler.registerPlant(new CropPlantNatura(0));
} catch(Exception e) {
if(ConfigurationHandler.debug) {
e.printStackTrace();
}
}
try {
CropPlantHandler.registerPlant(new CropPlantNatura(1));
} catch(Exception e) {
if(ConfigurationHandler.debug) {
e.printStackTrace();
}
}
}
@Override
protected List<Item> getTools() {
ArrayList<Item> list = new ArrayList<Item>();
list.add((Item) Item.itemRegistry.getObject("Natura:boneBag"));
return list;
}
@Override
protected boolean useTool(World world, int x, int y, int z, EntityPlayer player, ItemStack stack, BlockCrop block, TileEntityCrop crop) {
if(stack==null || stack.getItem()==null) {
return false;
}
Item item = stack.getItem();
if(item!=Item.itemRegistry.getObject("Natura:boneBag")) {
return false;
}
for(int dx=-1;dx<=1;dx++) {
for(int dz=-1;dz<=1;dz++) {
Block blockAt = world.getBlock(x+dx, y, z+dz);
if(blockAt instanceof IGrowable) {
if(((IGrowable) blockAt).func_149851_a(world, x+dx, y, z+dz, world.isRemote)) {
((IGrowable) blockAt). func_149853_b(world, world.rand, x+dx, y, z+dz);
}
}
}
}
if(!player.capabilities.isCreativeMode) {
player.getCurrentEquippedItem().stackSize =player.getCurrentEquippedItem().stackSize-1;
}
return true;
}
@Override
protected String modId() {
return Names.Mods.natura;
}
}
| mit |
grofit/treacherous | dist/commonjs/rules/regex-validation-rule.js | 954 | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var type_helper_1 = require("../helpers/type-helper");
var RegexValidationRule = /** @class */ (function () {
function RegexValidationRule() {
this.ruleName = "regex";
}
RegexValidationRule.prototype.validate = function (modelResolver, propertyName, regexPattern) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var value;
return tslib_1.__generator(this, function (_a) {
value = modelResolver.resolve(propertyName);
if (type_helper_1.TypeHelper.isEmptyValue(value)) {
return [2 /*return*/, true];
}
return [2 /*return*/, value.toString().match(regexPattern) !== null];
});
});
};
return RegexValidationRule;
}());
exports.RegexValidationRule = RegexValidationRule;
| mit |
somacoin/somacoin | src/qt/locale/bitcoin_eo.ts | 101436 | <?xml version="1.0" ?><!DOCTYPE TS><TS language="eo" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Somacoin</source>
<translation>Pri Somacoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>Somacoin</b> version</source>
<translation><b>Somacoin</b>-a versio</translation>
</message>
<message>
<location line="+57"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The Somacoin developers</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Adresaro</translation>
</message>
<message>
<location line="+19"/>
<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>Kreu novan adreson</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopiu elektitan adreson al la tondejo</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>&Nova Adreso</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your Somacoin 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 filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation>&Kopiu 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 Somacoin 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="+27"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</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 Somacoin 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>&Forviŝu</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your Somacoin 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>Kopiu &Etikedon</translation>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation>&Redaktu</translation>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation>Eksportu Adresarajn Datumojn</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Diskoma dosiero (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Eraro dum eksportado</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Ne eblis skribi al dosiero %1.</translation>
</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>(ne etikedo)</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>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 novan pasfrazon</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>Enigu novan pasfrazon por la monujo.<br/>Bonvolu, uzu pasfrazon kun <b>10 aŭ pli hazardaj signoj</b>, aŭ <b>ok aŭ pli vortoj</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Ĉifru monujon</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Ĉi tiu operacio devas vian monujan pasfrazon, por malŝlosi la monujon.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Malŝlosu monujon</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Ĉi tiu operacio devas vian monujan pasfrazon, por malĉifri la monujon.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Malĉifru monujon</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Anstataŭigu pasfrazon</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Enigu la malnovan kaj novan monujan pasfrazon.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Konfirmu ĉifrado de 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 SOMAECULECOINS</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="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>Monujo ĉifrita</translation>
</message>
<message>
<location line="-56"/>
<source>Somacoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your somacoins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Monujo ĉifrado fiaskis</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Ĉifrado de monujo fiaskis, kaŭze de interna eraro. Via monujo ne ĉifritas.</translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>La pasfrazoj enigitaj ne samas.</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation>Monujo malŝlosado fiaskis</translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>La pasfrazo enigita por ĉifrado de monujo ne konformas.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Monujo malĉifrado fiaskis</translation>
</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="+233"/>
<source>Sign &message...</source>
<translation>Subskribu &mesaĝon...</translation>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation>Sinkronigante kun reto...</translation>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation>&Superrigardo</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation>&Transakcioj</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Esploru historion de transakcioj</translation>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation>&Eliru</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Eliru de aplikaĵo</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about Somacoin</source>
<translation>Vidigu informaĵon pri Bitmono</translation>
</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>Vidigu informaĵon pri Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Opcioj...</translation>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation>&Ĉifru Monujon...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&Anstataŭigu pasfrazon...</translation>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-347"/>
<source>Send coins to a Somacoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for Somacoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<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="+6"/>
<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="-4"/>
<source>&Verify message...</source>
<translation>&Kontrolu mesaĝon...</translation>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>Somacoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation>Monujo</translation>
</message>
<message>
<location line="+101"/>
<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="+22"/>
<source>&About Somacoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation type="unfinished"/>
</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 Somacoin addresses to prove you own them</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified Somacoin addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>&Dosiero</translation>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation>&Agordoj</translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation>&Helpo</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>Somacoin client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to Somacoin network</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></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 type="unfinished"/>
</message>
<message numerus="yes">
<location line="+20"/>
<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 numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation><numerusform>%n semajno</numerusform><numerusform>%n semajnoj</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>Eraro</translation>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation type="unfinished"/>
</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>Ĝisdata</translation>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation>Ĝisdatigante...</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation>Sendita transakcio</translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation>Envenanta transakcio</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid Somacoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Monujo estas <b>ĉifrita</b> kaj nun <b>malŝlosita</b></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Monujo estas <b>ĉifrita</b> kaj nun <b>ŝlosita</b></translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+111"/>
<source>A fatal error occurred. Somacoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+104"/>
<source>Network Alert</source>
<translation>Reta Averto</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Redaktu 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>La etikedo interrilatita kun ĉi tiun adreso</translation>
</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="+21"/>
<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>La adreso enigita "%1" jam ekzistas en la adresaro.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid Somacoin 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 type="unfinished"/>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>SOMA-Qt</source>
<translation>SOMA-Qt</translation>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>versio</translation>
</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>Opcioj</translation>
</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.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start Somacoin after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start Somacoin on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Automatically open the Somacoin 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 Somacoin 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 type="unfinished"/>
</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 type="unfinished"/>
</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 Somacoin.</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 Somacoin 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="+71"/>
<source>&OK</source>
<translation>&OK</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Nuligu</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>&Apliku</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<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 Somacoin.</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="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Somacoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>Nekonfirmita:</translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation>Monujo</translation>
</message>
<message>
<location line="+107"/>
<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="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Lastaj transakcioj</b></translation>
</message>
<message>
<location line="-101"/>
<source>Your current 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 current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start somacoin: click-to-pay handler</source>
<translation type="unfinished"/>
</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>Etikedo:</translation>
</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="+339"/>
<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>Reto</translation>
</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>&Malfermu</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the SOMA-Qt help message to get a list with possible Somacoin 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 type="unfinished"/>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-104"/>
<source>Somacoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Somacoin 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 Somacoin 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 type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the Somacoin 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="+124"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Sendu Monojn</translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation>Sendu samtempe al multaj ricevantoj</translation>
</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 type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>123.456 BTC</source>
<translation>123,456 BTC</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> al %2 (%3)</translation>
</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>Ĉu vi vere volas sendi %1?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation>kaj</translation>
</message>
<message>
<location line="+23"/>
<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>
</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="+34"/>
<source>The address to send the payment to (e.g. SPav7F7oEwbejCdyLxdghQuA9XLNoQ9FTU)</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 type="unfinished"/>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>&Etikedo:</translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation>Elektu adreson el adresaro</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>Algluu adreson de 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>Forigu ĉi tiun ricevanton</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a Somacoin address (e.g. SPav7F7oEwbejCdyLxdghQuA9XLNoQ9FTU)</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"/>
<source>&Sign Message</source>
<translation type="unfinished"/>
</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. SPav7F7oEwbejCdyLxdghQuA9XLNoQ9FTU)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</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>Algluu 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 type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<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 Somacoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</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. SPav7F7oEwbejCdyLxdghQuA9XLNoQ9FTU)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified Somacoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a Somacoin address (e.g. SPav7F7oEwbejCdyLxdghQuA9XLNoQ9FTU)</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 Somacoin 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>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>The Somacoin developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/nekonfirmita</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 konfirmoj</translation>
</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><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Dato</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><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 type="unfinished"/>
</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 240 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="+3"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Sumo</translation>
</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="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation>, ankoraŭ ne elsendita sukcese</translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+70"/>
<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 type="unfinished"/>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+225"/>
<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 numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation type="unfinished"/>
</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></translation>
</message>
<message>
<location line="+5"/>
<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="+43"/>
<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 type="unfinished"/>
</message>
<message>
<location line="+199"/>
<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>Transakcia tipo.</translation>
</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="+52"/>
<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 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>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 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>Kopiu adreson</translation>
</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>Redaktu etikedon</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Diskoma 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 type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Eraro dum eksportado</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Ne eblis skribi al dosiero %1.</translation>
</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="+193"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+193"/>
<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>
<location line="+4"/>
<source>Backup Successful</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>somacoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+94"/>
<source>Somacoin version</source>
<translation>Somacoin-a versio</translation>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or somacoind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation>Listigu instrukciojn</translation>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation>Opcioj:</translation>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: somacoin.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: somacoind.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 8333 or testnet: 18333)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<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 type="unfinished"/>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=somacoinrpc
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 "Somacoin Alert" [email protected]
</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. Somacoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</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 Somacoin will not work properly.</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<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="+26"/>
<source>Verifying blocks...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation type="unfinished"/>
</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="+77"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</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 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="+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 type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the Somacoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<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="+5"/>
<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="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>System error: </source>
<translation type="unfinished"/>
</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 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="+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 type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>You need to rebuild the databases using -reindex to change -txindex</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-50"/>
<source>Password for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-120"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-26"/>
<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="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation>Ŝarĝante adresojn...</translation>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of Somacoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart Somacoin to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<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="-96"/>
<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="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation>Ŝarĝante blok-indekson...</translation>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. Somacoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation>Ŝarĝante monujon...</translation>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation>Ŝarĝado finitas</translation>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation>Por uzi la opcion %s</translation>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation>Eraro</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 type="unfinished"/>
</message>
</context>
</TS>
| mit |
FIPress/fiputil | collection.go | 215 | package fiputil
func mapArray(in interface{}, out interface{}) {
/*l := len(in)
if l == 0 {return}
//reflect
out = make([]BlogInfo,l)
for i:=0;i<l;i++ {
blog := in[i]
out[i] = newBlogBrief(&blog)
}*/
}
| mit |
creepycheese/yandex-kassa-api | lib/yandex_kassa/api.rb | 940 | module YandexKassa
class Api
include Requests
def initialize(params = {})
@response_parser = params.fetch(:response_parser)
@url = params.fetch(:url)
@cert_file = params.fetch(:cert_file)
@key_file = params.fetch(:key_file)
@request_signer = params.fetch(:request_signer)
end
private
attr_reader :cert_file, :key_file, :url, :response_parser, :request_signer
def post_signed_xml_request(yandex_kassa_request)
signed_data = request_signer.sign(yandex_kassa_request.xml_request_body)
response = client[yandex_kassa_request.request_path].post(signed_data)
response_parser.parse(response)
end
def client
@client ||= RestClient::Resource.new(
url,
ssl_client_cert: cert_file,
ssl_client_key: key_file,
verify_ssl: OpenSSL::SSL::VERIFY_NONE,
headers: { content_type: 'application/pkcs7-mime'} )
end
end
end
| mit |
science09/SpringBootDemo | src/main/java/com/example/entity/User.java | 1996 | package com.example.entity;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
/**
* Created by hadoop on 16-12-1.
* User Class
*/
public class User implements Serializable, UserDetails {
private Integer id;
private String username;
private String password;
private String role;
public User() {}
public User(String username, String password, String role) {
this.username = username;
this.password = password;
this.role = role;
}
public User(Integer id, String username, String password) {
this.id = id;
this.username = username;
this.password = password;
this.role = "ROLE_user";
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return Arrays.asList(new SimpleGrantedAuthority(getRole()));
}
@Override
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return true;
}
}
| mit |
project-ellis/ellis | src/stream/fd_input_stream.cpp | 2527 | /*
* Copyright (c) 2016 Surround.IO Corporation. All Rights Reserved.
* Copyright (c) 2017 Xevo Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <ellis/stream/fd_input_stream.hpp>
#include <ellis/core/err.hpp>
#include <ellis_private/using.hpp>
#include <unistd.h>
namespace ellis {
fd_input_stream::fd_input_stream(int fd) : m_fd(fd) {
}
bool fd_input_stream::next_input_buf(const byte **buf, size_t *bytecount) {
int n = 0;
if (m_pos < m_avail) {
/* We have some leftover buffer from earlier. Return that. */
goto give_buffer;
}
/* No more bytes in current block? Then try to get another one. */
m_pos = 0;
m_avail = 0;
while (1) {
n = read(m_fd, m_buf, sizeof(m_buf));
if (n < 0 && errno == EINTR) {
continue;
}
else {
break;
}
}
if (n < 0) {
/* TODO: extract details via strerror? Use errno? */
m_err = MAKE_UNIQUE_ELLIS_ERR(IO, "I/O error");
return false;
}
else if (n == 0) {
m_err = MAKE_UNIQUE_ELLIS_ERR(IO, "end of file");
return false;
}
/* Got some data. */
m_avail = n;
give_buffer:
*buf = (const byte *)(m_buf + m_pos);
*bytecount = m_avail - m_pos;
/* Treat input as consumed unless put_back is called. */
m_pos = m_avail;
return true;
}
void fd_input_stream::put_back(size_t bytecount) {
m_pos = m_avail - bytecount;
}
unique_ptr<err> fd_input_stream::extract_input_error() {
return std::move(m_err);
}
} /* namespace ellis */
| mit |
olegburov/Introduction-to-TypeScript | src/FamousPainters/scripts/painter/painterExample.ts | 355 | namespace Painter
{
export class PainterExample implements Interfaces.IExample
{
name: string;
year: string;
type: string;
image: string;
constructor(example: Interfaces.IExample)
{
this.name = example.name;
this.year = example.year;
this.type = example.type;
this.image = example.image;
}
}
} | mit |
angular/angular-cli-stress-test | src/app/components/comp-3412/comp-3412.component.spec.ts | 847 | /**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { Comp3412Component } from './comp-3412.component';
describe('Comp3412Component', () => {
let component: Comp3412Component;
let fixture: ComponentFixture<Comp3412Component>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ Comp3412Component ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(Comp3412Component);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
| mit |
PuercoPop/EleccionesPeru | test_cases/Ejemplo_Acta_Congreso_2_files/general.js | 3556 | /* Función que retira espacios en blanco al principio y al final de la cadena*/
/* Reemplaza además dos o mas espacios por uno solo dentro de la cadena.*/
function trim(inputString){
if (typeof inputString != "string")
return inputString;
var retValue = inputString;
var ch = retValue.substring(0, 1);
while (ch == " ")
{ // Espacios al comienzo
retValue = retValue.substring(1, retValue.length);
ch = retValue.substring(0, 1);
}
ch = retValue.substring(retValue.length-1, retValue.length);
while (ch == " ")
{ // Espacios al final
retValue = retValue.substring(0, retValue.length-1);
ch = retValue.substring(retValue.length-1, retValue.length);
}
while (retValue.indexOf(" ") != -1)
{ // Dos espacios
retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); // Again, there are two spaces in each of the strings
}
return retValue;
}
function fechahoy(){
var diasemana = new Array('Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado');
var nombremes = new Array('enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'setiembre', 'octubre', 'noviembre', 'diciembre');
var ahora;
var fecha = new Date();
var anio = fecha.getYear();
if(anio<1000)
anio += 1900;
var mes = fecha.getMonth();
var dia = fecha.getDay();
var num = fecha.getDate();
if(num<=9) num='0'+num;
ahora = diasemana[dia] + " " + num + " de " + nombremes[mes] + " de " + anio;
return ahora;
}
function fechacortahoy(){
var ahora;
var fecha = new Date();
var anio = fecha.getYear();
var mes = fecha.getMonth()+1;
var dia = fecha.getDay();
var num = fecha.getDate();
if(num<=9) num='0'+num;
if(mes<=9) mes='0'+mes;
if(anio<1000) anio += 1900;
ahora = num + "/" + mes + "/" + anio
return ahora;
}
function hora_actual(){
var ahora;
var hora = new Date();
var hh = hora.getHours();
var mm = hora.getMinutes();
var ss = hora.getSeconds();
if(hh<=9) hh='0'+hh;
if(mm<=9) mm='0'+mm;
if(ss<=9) ss='0'+ss;
ahora = hh + ":" + mm + ":" + ss
return ahora;
}
function cadena_valida(myfield,e,cadena){
switch(cadena){
//CARACTERES VALIDOS
case 1: cadena1="ABCDEFGHIJKLMNOPQRSTUVWYXZ0123456789abcdefghijklmnopqrstuvwxyz\/?#$%&()=*+}{[]_-> <:,.;ñÑáéíóúÁÉÍÓÚº";break;
//CARACTERES SOLO TEXTO SIN NUMEROS
case 2: cadena1="ABCDEFGHIJKLMNOPQRSTUVWYXZabcdefghijklmnopqrstuvwxyz,.;ñÑáéíóúÁÉÍÓÚ ";break;
//NUMEROS ENTEROS SIN DECIMALES
case 3: cadena1="0123456789";break;
//NUMEROS DECIMALES
case 4: cadena1="0123456789.";break;
//CARACTERES PARA CORREO ELECTRONICO
case 5: cadena1="ABCDEFGHIJKLMNOPQRSTUVWYXZ0123456789abcdefghijklmnopqrstuvwxyz._-@ ";break;
//TELEFONO
case 6: cadena1="0123456789 -";break;
//CARACTERES DE USUARIO Y CONTRASEÑA VALIDOS
case 7: cadena1="ABCDEFGHIJKLMNOPQRSTUVWYXZ0123456789abcdefghijklmnopqrstuvwxyz";break;
}
var key;
var keychar;
var keycadena=cadena1;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);
if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )
return true;
else
if (((keycadena).indexOf(keychar) > -1))
return true;
return false;
}
| mit |
Aqwis/verk | src/parsers/dusken.py | 684 | import sys
from bs4 import BeautifulSoup
def parse(raw_html, verbose=False):
soup = BeautifulSoup(raw_html, 'html.parser')
contents_list = soup.find_all("section", class_='article')
if len(contents_list) > 1:
raise Exception()
contents = contents_list[0]
try:
contents.find(class_='factboxcontainer').decompose()
except:
pass
lines = list([s.replace('\n', ' ') for s in contents.stripped_strings])
return " ".join(lines)
if __name__ == "__main__":
infilename = sys.argv[1]
outfilename = sys.argv[2]
infile = open(infilename, 'r')
outfile = open(outfilename, 'w')
result = parse(infile)
outfile.write(result + '\n')
infile.close()
outfile.close() | mit |
d-saitou/Spring4MvcExample | src/main/java/com/example/springmvc/domain/entity/jpa/MUserRole.java | 839 | package com.example.springmvc.domain.entity.jpa;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
import com.example.springmvc.utility.StringUtility;
import lombok.Data;
/**
* JPA entity (table: m_user_role).
*/
@Entity
@Table(name = "m_user_role")
@IdClass(MUserRolePK.class)
@Data
public class MUserRole implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "user_id", length = 10)
private String userId;
@Id
@Column(name = "role_id", length = 10)
private String roleId;
@Column(name = "description", length = 50)
private String description;
@Override
public String toString() {
return StringUtility.toJsonStyleString(this);
}
}
| mit |
ArtOfCode-/nails | src/library/cookies.js | 1122 | 'use strict';
const Cookies = require('cookies');
const getCookie = (get, ...args) => {
const str = get(...args);
// istanbul ignore if: this is only for compatibility with the library itself
if (args[0].endsWith('.sig')) {
return str;
}
if (str == null || str === 'undefined') {
return;
}
return JSON.parse(str);
};
/**
* @class Cookies
* @classdesc Cookie handling extended from the {@link https://github.com/pillarjs/cookies#api `cookies` module} on npm.
* The `get` and `set` methods serialize and deserialize the data as JSON.
**/
module.exports = library => {
const cookies = new Cookies(library.req, library.res, {
keys: library.config.keys || [library.config.key],
});
const set = cookies.set.bind(cookies);
const get = cookies.get.bind(cookies);
cookies.set = (k, v, opts) => set(k, JSON.stringify(v), opts);
cookies.get = getCookie.bind(null, get);
/**
* @function delete
* @memberof Cookies
* @instance
* @param {string} key The key to delete
**/
cookies.delete = key => {
set(key, null);
set(key + '.sig', null);
};
return cookies;
};
| mit |
jimanx2/myoffice | app/controllers/paymentstats_controller.rb | 57 | class PaymentstatsController < ApplicationController
end
| mit |
juan-gamez/simapro | application/controllers/Grupos.php | 6066 | <?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Grupos extends LoggedInController {
function __construct()
{
parent::__construct();
$this->load->model('MGrupos','',TRUE);
$this->load->model('MAreasAdministrativas','',TRUE);
$this->load->helper('url');
}
function index()
{
$data['header']['title'] = 'Asignaturas';
$this->load->view('asignaturas', $data);
}
function crear_y_asignar()
{
$grupo_id = $this->input->post('grupo_radio');
if(is_numeric($grupo_id)){
$grupo_aula = $this->input->post('grupo_aula');
$grupo_horario = $this->input->post('grupo_horario');
$id = $this->MGrupos->asociar_horario_aula($grupo_horario, $grupo_aula, $grupo_id);
}
else{
$numero = $this->input->post('grupo_numero');
$asignatura_ciclo = $this->input->post('grupo_asignatura');
$encargado = $this->input->post('grupo_personal');
$grupo_tipo = $this->input->post('grupo_tipo');
$grupo_aula = $this->input->post('grupo_aula');
$data['grupo_aula'] = $grupo_aula;
$grupo_horario = $this->input->post('grupo_horario');
$grupo_id = $this->MGrupos->save($numero, $asignatura_ciclo, $encargado, $grupo_tipo);
$id = $this->MGrupos->asociar_horario_aula($grupo_horario, $grupo_aula, $grupo_id);
}
}
function grupo_horarios_aula(){
$this->output->set_header('Content-Type: application/json; charset=utf-8');
print $this->MGrupos->getGrupoHorariosAula($this->input->post('grupo_aula'));
}
function grupo_horarios_aula_por_asignatura(){
$this->output->set_header('Content-Type: application/json; charset=utf-8');
print $this->MGrupos->getGrupoHorariosAulaporAsignatura($this->input->post('grupo_asignatura'));
}
function agregar()
{
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="validation-error"><span class="glyphicon glyphicon-warning-sign"></span>', '</div>');
$this->form_validation->set_rules('asignaturas_nombre', 'nombre', 'trim|required|is_unique[asignaturas.nombre]');
$this->form_validation->set_rules('asignaturas_facultad', 'escuela', 'trim|is_unique[asignaturas.escuela]|valid_email');
$this->form_validation->set_message('required', 'El campo %s es requerido');
$this->form_validation->set_message('valid_email', 'El campo %s debe ser un escuela valido');
$this->form_validation->set_message('is_unique', 'El campo %s debe ser unico');
if($this->form_validation->run() == FALSE){
$data['header']['title'] = 'Agregar Asignaturas';
$this->load->view('asignaturas_formulario', $data);
return;
}
else{
$id = $this->MAsignaturas->save($this->input->post('asignaturas_nombre'), $this->input->post('asignaturas_facultad'));
if($id==true) $data['msg_ok'] = 'El usuario ha sido agregado';
if($id==false) $data['msg_error'] = 'Error: El usuario no fue agregado';
$data['header']['title'] = 'Agregar Asignaturas';
$data['facultades'] = $this->MAsignaturas->getFacultades();
$this->load->view('asignaturas', $data);
return;
}
}
function modificar_formulario()
{
$id = $this->uri->segment(3);
if(is_numeric($id)){
$row = $this->MAsignaturas->getOneById($id);
$data['mod'] = array(
'asignaturas_id' => $row->id,
'asignaturas_nombre' => $row->nombre,
'asignaturas_facultad' => $row->escuela
);
$data['header']['title'] = 'Modificar Asignaturas';
$data['action'] = "/asignaturas/modificar/{$id}";
$this->load->view('asignaturas_formulario', $data);
return;
}
}
function modificar()
{
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="validation-error"><span class="glyphicon glyphicon-warning-sign"></span>', '</div>');
$this->form_validation->set_rules('asignaturas_nombre', 'nombre', 'trim|required');
$this->form_validation->set_rules('asignaturas_facultad', 'escuela', 'trim|valid_email');
$this->form_validation->set_message('required', 'El campo %s es requerido');
$this->form_validation->set_message('valid_email', 'El campo %s debe ser un escuela valido');
$this->form_validation->set_message('is_unique', 'El campo %s debe ser unico');
if($this->form_validation->run() == FALSE){
$data['header']['title'] = 'Modificar Asignaturas';
$data['action'] = "/asignaturas/modificar/{$this->input->post('asignaturas_id')}";
$this->load->view('asignaturas_formulario', $data);
return;
}
else{
$id = $this->MAsignaturas->update($this->input->post('asignaturas_id'), $this->input->post('asignaturas_nombre'), $this->input->post('asignaturas_facultad'));
if($id==true) $data['msg_ok'] = 'El usuario ha sido modificado';
if($id==false) $data['msg_error'] = 'Error: El usuario no fue modificado';
$data['header']['title'] = 'Asignaturas';
$this->load->view('asignaturas', $data);
return;
}
}
function ajax()
{
$table = 'v_asignaturas';
$primaryKey = 'codigo';
$columns = array(
array( 'db' => 'nombre_area_administrativa', 'dt' => 0 ),
array( 'db' => 'codigo', 'dt' => 1 ),
array( 'db' => 'nombre', 'dt' => 2 ),
array(
'db' => 'codigo',
'dt' => 3,
'formatter' => function( $d, $row ) {
return "<a href=\"/asignaturas/modificar_formulario/{$row['codigo']}\">Modificar</a>";
}
),
array(
'db' => 'codigo',
'dt' => 4,
'formatter' => function( $d, $row ) {
return "<a href=\"/asignaturas/eliminar/{$row['codigo']}\">Eliminar</a>";
}
)
);
$sql_details = array(
'user' => 'root',
'pass' => 'root',
'db' => 'simapro',
'host' => 'localhost'
);
require( 'ssp.class.php' );
echo json_encode(
SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns )
);
}
}
| mit |
kspearrin/NPress | src/Core/Repositories/IBlogRepository.cs | 255 | using System.Threading.Tasks;
using NPress.Core.Domains;
namespace NPress.Core.Repositories
{
public interface IBlogRepository
{
Task<Blog> GetAsync();
Task CreateAsync(Blog blog);
Task ReplaceAsync(Blog blog);
}
}
| mit |
danielwegener/unluac-scala | shared/src/main/scala/unluac/decompile/branch/OrBranch.scala | 802 | package unluac.decompile.branch
import unluac.decompile.Registers
import unluac.decompile.expression.BinaryExpression
import unluac.decompile.expression.Expression
case class OrBranch(left: Branch, right: Branch) extends Branch(right.line, right.begin, right.end) {
def invert: Branch = {
new AndBranch(left.invert, right.invert)
}
def getRegister: Int = {
val rleft: Int = left.getRegister
val rright: Int = right.getRegister
if (rleft == rright) rleft else -1
}
def asExpression(r: Registers): Expression = {
new BinaryExpression("or", left.asExpression(r), right.asExpression(r), Expression.PRECEDENCE_OR, Expression.ASSOCIATIVITY_NONE)
}
def useExpression(expression: Expression) {
left.useExpression(expression)
right.useExpression(expression)
}
} | mit |
achan/android-reddit | src/com/pocketreddit/library/things/UserSubmittedContent.java | 2958 | package com.pocketreddit.library.things;
import com.pocketreddit.library.things.Subreddit;
import com.pocketreddit.library.things.Thing;
import com.pocketreddit.library.Created;
import com.pocketreddit.library.Votable;
public abstract class UserSubmittedContent extends Thing implements Created, Votable {
private static final long serialVersionUID = 1L;
private String id;
private int upvotes;
private int downvotes;
private Boolean liked;
private double created;
private double createdUtc;
private String name;
private String author;
private String authorFlairCssClass;
private String authorFlairText;
private String body;
private String bodyHtml;
private boolean edited;
private int numReports;
private Subreddit subreddit;
public int getUpvotes() {
return upvotes;
}
public int getDownvotes() {
return downvotes;
}
public Boolean isLiked() {
return liked;
}
public double getCreated() {
// TODO Auto-generated method stub
return created;
}
public double getCreatedUtc() {
return createdUtc;
}
public Subreddit getSubreddit() {
return subreddit;
}
public void setSubreddit(Subreddit subreddit) {
this.subreddit = subreddit;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getAuthorFlairCssClass() {
return authorFlairCssClass;
}
public void setAuthorFlairCssClass(String authorFlairCssClass) {
this.authorFlairCssClass = authorFlairCssClass;
}
public String getAuthorFlairText() {
return authorFlairText;
}
public void setAuthorFlairText(String authorFlairText) {
this.authorFlairText = authorFlairText;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getBodyHtml() {
return bodyHtml;
}
public void setBodyHtml(String bodyHtml) {
this.bodyHtml = bodyHtml;
}
public boolean isEdited() {
return edited;
}
public void setEdited(boolean edited) {
this.edited = edited;
}
public void setCreated(double created) {
this.created = created;
}
public void setCreatedUtc(double createdUtc) {
this.createdUtc = createdUtc;
}
public void setUpvotes(int upvotes) {
this.upvotes = upvotes;
}
public void setDownvotes(int downvotes) {
this.downvotes = downvotes;
}
public Boolean getLiked() {
return liked;
}
public void setLiked(Boolean liked) {
this.liked = liked;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getNumReports() {
return numReports;
}
public void setNumReports(int numReports) {
this.numReports = numReports;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| mit |
BarryThePenguin/ava | lib/reporters/mini.js | 9376 | 'use strict';
const StringDecoder = require('string_decoder').StringDecoder;
const path = require('path');
const cliCursor = require('cli-cursor');
const lastLineTracker = require('last-line-stream/tracker');
const plur = require('plur');
const spinners = require('cli-spinners');
const chalk = require('chalk');
const cliTruncate = require('cli-truncate');
const cross = require('figures').cross;
const indentString = require('indent-string');
const formatAssertError = require('../format-assert-error');
const extractStack = require('../extract-stack');
const codeExcerpt = require('../code-excerpt');
const colors = require('../colors');
chalk.enabled = true;
Object.keys(colors).forEach(key => {
colors[key].enabled = true;
});
// TODO(@jamestalamge): This should be fixed in log-update and ansi-escapes once we are confident it's a good solution.
const CSI = '\u001b[';
const ERASE_LINE = CSI + '2K';
const CURSOR_TO_COLUMN_0 = CSI + '0G';
const CURSOR_UP = CSI + '1A';
// Returns a string that will erase `count` lines from the end of the terminal.
function eraseLines(count) {
let clear = '';
for (let i = 0; i < count; i++) {
clear += ERASE_LINE + (i < count - 1 ? CURSOR_UP : '');
}
if (count) {
clear += CURSOR_TO_COLUMN_0;
}
return clear;
}
class MiniReporter {
constructor(options) {
const spinnerDef = spinners[process.platform === 'win32' ? 'line' : 'dots'];
this.spinnerFrames = spinnerDef.frames.map(c => chalk.gray.dim(c));
this.spinnerInterval = spinnerDef.interval;
this.options = Object.assign({}, options);
this.reset();
this.stream = process.stderr;
this.stringDecoder = new StringDecoder();
}
start() {
this.interval = setInterval(() => {
this.spinnerIndex = (this.spinnerIndex + 1) % this.spinnerFrames.length;
this.write(this.prefix());
}, this.spinnerInterval);
return this.prefix('');
}
reset() {
this.clearInterval();
this.passCount = 0;
this.knownFailureCount = 0;
this.failCount = 0;
this.skipCount = 0;
this.todoCount = 0;
this.rejectionCount = 0;
this.exceptionCount = 0;
this.currentStatus = '';
this.currentTest = '';
this.statusLineCount = 0;
this.spinnerIndex = 0;
this.lastLineTracker = lastLineTracker();
}
spinnerChar() {
return this.spinnerFrames[this.spinnerIndex];
}
clearInterval() {
clearInterval(this.interval);
this.interval = null;
}
test(test) {
if (test.todo) {
this.todoCount++;
} else if (test.skip) {
this.skipCount++;
} else if (test.error) {
this.failCount++;
} else {
this.passCount++;
if (test.failing) {
this.knownFailureCount++;
}
}
if (test.todo || test.skip) {
return;
}
return this.prefix(this._test(test));
}
prefix(str) {
str = str || this.currentTest;
this.currentTest = str;
// The space before the newline is required for proper formatting
// TODO(jamestalmage): Figure out why it's needed and document it here
return ` \n ${this.spinnerChar()} ${str}`;
}
_test(test) {
const SPINNER_WIDTH = 3;
const PADDING = 1;
let title = cliTruncate(test.title, process.stdout.columns - SPINNER_WIDTH - PADDING);
if (test.error || test.failing) {
title = colors.error(test.title);
}
return title + '\n' + this.reportCounts();
}
unhandledError(err) {
if (err.type === 'exception') {
this.exceptionCount++;
} else {
this.rejectionCount++;
}
}
reportCounts(time) {
const lines = [
this.passCount > 0 ? '\n ' + colors.pass(this.passCount, 'passed') : '',
this.knownFailureCount > 0 ? '\n ' + colors.error(this.knownFailureCount, plur('known failure', this.knownFailureCount)) : '',
this.failCount > 0 ? '\n ' + colors.error(this.failCount, 'failed') : '',
this.skipCount > 0 ? '\n ' + colors.skip(this.skipCount, 'skipped') : '',
this.todoCount > 0 ? '\n ' + colors.todo(this.todoCount, 'todo') : ''
].filter(Boolean);
if (time && lines.length > 0) {
lines[0] += ' ' + time;
}
return lines.join('');
}
finish(runStatus) {
this.clearInterval();
let time;
if (this.options.watching) {
time = chalk.gray.dim('[' + new Date().toLocaleTimeString('en-US', {hour12: false}) + ']');
}
let status = this.reportCounts(time);
if (this.rejectionCount > 0) {
status += '\n ' + colors.error(this.rejectionCount, plur('rejection', this.rejectionCount));
}
if (this.exceptionCount > 0) {
status += '\n ' + colors.error(this.exceptionCount, plur('exception', this.exceptionCount));
}
if (runStatus.previousFailCount > 0) {
status += '\n ' + colors.error(runStatus.previousFailCount, 'previous', plur('failure', runStatus.previousFailCount), 'in test files that were not rerun');
}
if (this.knownFailureCount > 0) {
for (const test of runStatus.knownFailures) {
const title = test.title;
status += '\n\n ' + colors.title(title);
// TODO: Output description with link
// status += colors.stack(description);
}
}
if (this.failCount > 0) {
runStatus.errors.forEach((test, index) => {
if (!test.error) {
return;
}
const title = test.error ? test.title : 'Unhandled Error';
const beforeSpacing = index === 0 ? '\n\n' : '\n\n\n\n';
status += beforeSpacing + ' ' + colors.title(title) + '\n';
if (test.error.source) {
status += ' ' + colors.errorSource(test.error.source.file + ':' + test.error.source.line) + '\n';
const errorPath = path.join(this.options.basePath, test.error.source.file);
const excerpt = codeExcerpt(errorPath, test.error.source.line, {maxWidth: process.stdout.columns});
if (excerpt) {
status += '\n' + indentString(excerpt, 2) + '\n';
}
}
if (test.error.showOutput) {
status += '\n' + indentString(formatAssertError(test.error), 2);
}
// `.trim()` is needed, because default `err.message` is ' ' (see lib/assert.js)
if (test.error.message.trim()) {
status += '\n' + indentString(test.error.message, 2) + '\n';
}
if (test.error.stack) {
status += '\n' + indentString(colors.errorStack(extractStack(test.error.stack)), 2);
}
});
}
if (this.rejectionCount > 0 || this.exceptionCount > 0) {
// TODO(sindresorhus): Figure out why this causes a test failure when switched to a for-of loop
runStatus.errors.forEach(err => {
if (err.title) {
return;
}
if (err.type === 'exception' && err.name === 'AvaError') {
status += '\n\n ' + colors.error(cross + ' ' + err.message);
} else {
const title = err.type === 'rejection' ? 'Unhandled Rejection' : 'Uncaught Exception';
let description = err.stack ? err.stack.trimRight() : JSON.stringify(err);
description = description.split('\n');
const errorTitle = err.name ? description[0] : 'Threw non-error: ' + description[0];
const errorStack = description.slice(1).join('\n');
status += '\n\n ' + colors.title(title) + '\n';
status += ' ' + colors.stack(errorTitle) + '\n';
status += colors.errorStack(errorStack);
}
});
}
if (runStatus.failFastEnabled === true && runStatus.remainingCount > 0 && runStatus.failCount > 0) {
const remaining = 'At least ' + runStatus.remainingCount + ' ' + plur('test was', 'tests were', runStatus.remainingCount) + ' skipped.';
status += '\n\n ' + colors.information('`--fail-fast` is on. ' + remaining);
}
if (runStatus.hasExclusive === true && runStatus.remainingCount > 0) {
status += '\n\n ' + colors.information('The .only() modifier is used in some tests.', runStatus.remainingCount, plur('test', runStatus.remainingCount), plur('was', 'were', runStatus.remainingCount), 'not run');
}
return status + '\n\n';
}
section() {
return '\n' + chalk.gray.dim('\u2500'.repeat(process.stdout.columns || 80));
}
clear() {
return '';
}
write(str) {
cliCursor.hide();
this.currentStatus = str;
this._update();
this.statusLineCount = this.currentStatus.split('\n').length;
}
stdout(data) {
this._update(data);
}
stderr(data) {
this._update(data);
}
_update(data) {
let str = '';
let ct = this.statusLineCount;
const columns = process.stdout.columns;
let lastLine = this.lastLineTracker.lastLine();
// Terminals automatically wrap text. We only need the last log line as seen on the screen.
lastLine = lastLine.substring(lastLine.length - (lastLine.length % columns));
// Don't delete the last log line if it's completely empty.
if (lastLine.length > 0) {
ct++;
}
// Erase the existing status message, plus the last log line.
str += eraseLines(ct);
// Rewrite the last log line.
str += lastLine;
if (str.length > 0) {
this.stream.write(str);
}
if (data) {
// Send new log data to the terminal, and update the last line status.
this.lastLineTracker.update(this.stringDecoder.write(data));
this.stream.write(data);
}
let currentStatus = this.currentStatus;
if (currentStatus.length > 0) {
lastLine = this.lastLineTracker.lastLine();
// We need a newline at the end of the last log line, before the status message.
// However, if the last log line is the exact width of the terminal a newline is implied,
// and adding a second will cause problems.
if (lastLine.length % columns) {
currentStatus = '\n' + currentStatus;
}
// Rewrite the status message.
this.stream.write(currentStatus);
}
}
}
module.exports = MiniReporter;
| mit |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.